LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_krb5pac.c (source / functions) Hit Total Coverage
Test: coverage report for smb2.twrp.listdir_fix f886ca1c Lines: 1016 3046 33.4 %
Date: 2023-11-07 19:11:32 Functions: 103 230 44.8 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include <Python.h>
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_krb5pac.h"
      12             : 
      13             : 
      14             : /*
      15             :  * Suppress compiler warnings if the generated code does not call these
      16             :  * functions
      17             :  */
      18             : #ifndef _MAYBE_UNUSED_
      19             : #ifdef __has_attribute
      20             : #if __has_attribute(unused)
      21             : #define _MAYBE_UNUSED_ __attribute__ ((unused))
      22             : #else
      23             : #define _MAYBE_UNUSED_
      24             : #endif
      25             : #endif
      26             : #endif
      27             : /*
      28             :  * These functions are here to ensure they can be optimized out by
      29             :  * the compiler based on the constant input values
      30             :  */
      31             : 
      32        4362 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34        4362 :         switch (var_size) {
      35          16 :         case 8:
      36          16 :                 return UINT64_MAX;
      37        4346 :         case 4:
      38        4346 :                 return UINT32_MAX;
      39           0 :         case 2:
      40           0 :                 return UINT16_MAX;
      41           0 :         case 1:
      42           0 :                 return UINT8_MAX;
      43             :         }
      44             : 
      45           0 :         return 0;
      46             : }
      47             : 
      48           0 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50           0 :         switch (var_size) {
      51           0 :         case 8:
      52           0 :                 return INT64_MAX;
      53           0 :         case 4:
      54           0 :                 return INT32_MAX;
      55           0 :         case 2:
      56           0 :                 return INT16_MAX;
      57           0 :         case 1:
      58           0 :                 return INT8_MAX;
      59             :         }
      60             : 
      61           0 :         return 0;
      62             : }
      63             : 
      64             : #include "librpc/gen_ndr/security.h"
      65             : #include "librpc/gen_ndr/lsa.h"
      66             : #include "librpc/gen_ndr/netlogon.h"
      67             : #include "librpc/gen_ndr/samr.h"
      68             : static PyTypeObject PAC_LOGON_NAME_Type;
      69             : static PyTypeObject PAC_SIGNATURE_DATA_Type;
      70             : static PyTypeObject PAC_DOMAIN_GROUP_MEMBERSHIP_Type;
      71             : static PyTypeObject PAC_LOGON_INFO_Type;
      72             : static PyTypeObject PAC_CREDENTIAL_NTLM_SECPKG_Type;
      73             : static PyTypeObject PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type;
      74             : static PyTypeObject PAC_CREDENTIAL_DATA_Type;
      75             : static PyTypeObject PAC_CREDENTIAL_DATA_CTR_Type;
      76             : static PyTypeObject PAC_CREDENTIAL_DATA_NDR_Type;
      77             : static PyTypeObject PAC_CREDENTIAL_INFO_Type;
      78             : static PyTypeObject PAC_CONSTRAINED_DELEGATION_Type;
      79             : static PyTypeObject PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type;
      80             : static PyTypeObject PAC_UPN_DNS_INFO_EX_Type;
      81             : static PyTypeObject PAC_UPN_DNS_INFO_Type;
      82             : static PyTypeObject PAC_ATTRIBUTES_INFO_Type;
      83             : static PyTypeObject PAC_REQUESTER_SID_Type;
      84             : static PyTypeObject PAC_LOGON_INFO_CTR_Type;
      85             : static PyTypeObject PAC_CONSTRAINED_DELEGATION_CTR_Type;
      86             : static PyTypeObject PAC_DEVICE_INFO_Type;
      87             : static PyTypeObject PAC_DEVICE_INFO_CTR_Type;
      88             : static PyTypeObject DATA_BLOB_REM_Type;
      89             : static PyTypeObject PAC_INFO_Type;
      90             : static PyTypeObject PAC_BUFFER_Type;
      91             : static PyTypeObject PAC_DATA_Type;
      92             : static PyTypeObject PAC_BUFFER_RAW_Type;
      93             : static PyTypeObject PAC_DATA_RAW_Type;
      94             : static PyTypeObject PAC_Validate_Type;
      95             : static PyTypeObject netsamlogoncache_entry_Type;
      96             : static PyTypeObject krb5pac_InterfaceType;
      97             : 
      98             : static PyTypeObject *BaseObject_Type;
      99             : static PyTypeObject *dom_sid_Type;
     100             : static PyTypeObject *samr_RidWithAttributeArray_Type;
     101             : static PyTypeObject *netr_SamInfo3_Type;
     102             : static PyTypeObject *samr_Password_Type;
     103             : static PyTypeObject *lsa_String_Type;
     104             : static PyTypeObject *netr_SidAttr_Type;
     105             : static PyTypeObject *ClientConnection_Type;
     106             : static PyTypeObject *ndr_syntax_id_Type;
     107             : 
     108           0 : static PyObject *py_PAC_LOGON_NAME_get_logon_time(PyObject *obj, void *closure)
     109             : {
     110           0 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(obj);
     111           0 :         PyObject *py_logon_time;
     112           0 :         py_logon_time = PyLong_FromUnsignedLongLong(object->logon_time);
     113           0 :         return py_logon_time;
     114             : }
     115             : 
     116          16 : static int py_PAC_LOGON_NAME_set_logon_time(PyObject *py_obj, PyObject *value, void *closure)
     117             : {
     118          16 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(py_obj);
     119          16 :         if (value == NULL) {
     120           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_time");
     121           0 :                 return -1;
     122             :         }
     123             :         {
     124          16 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_time));
     125          16 :                 if (PyLong_Check(value)) {
     126           0 :                         unsigned long long test_var;
     127          16 :                         test_var = PyLong_AsUnsignedLongLong(value);
     128          16 :                         if (PyErr_Occurred() != NULL) {
     129           0 :                                 return -1;
     130             :                         }
     131          16 :                         if (test_var > uint_max) {
     132           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     133             :                                   PyLong_Type.tp_name, uint_max, test_var);
     134           0 :                                 return -1;
     135             :                         }
     136          16 :                         object->logon_time = test_var;
     137             :                 } else {
     138           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     139             :                           PyLong_Type.tp_name);
     140           0 :                         return -1;
     141             :                 }
     142             :         }
     143          16 :         return 0;
     144             : }
     145             : 
     146           0 : static PyObject *py_PAC_LOGON_NAME_get_size(PyObject *obj, void *closure)
     147             : {
     148           0 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(obj);
     149           0 :         PyObject *py_size;
     150           0 :         py_size = PyLong_FromLong((uint16_t)object->size);
     151           0 :         return py_size;
     152             : }
     153             : 
     154           0 : static int py_PAC_LOGON_NAME_set_size(PyObject *py_obj, PyObject *value, void *closure)
     155             : {
     156           0 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(py_obj);
     157           0 :         if (value == NULL) {
     158           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
     159           0 :                 return -1;
     160             :         }
     161             :         {
     162           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
     163           0 :                 if (PyLong_Check(value)) {
     164           0 :                         unsigned long long test_var;
     165           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     166           0 :                         if (PyErr_Occurred() != NULL) {
     167           0 :                                 return -1;
     168             :                         }
     169           0 :                         if (test_var > uint_max) {
     170           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     171             :                                   PyLong_Type.tp_name, uint_max, test_var);
     172           0 :                                 return -1;
     173             :                         }
     174           0 :                         object->size = test_var;
     175             :                 } else {
     176           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     177             :                           PyLong_Type.tp_name);
     178           0 :                         return -1;
     179             :                 }
     180             :         }
     181           0 :         return 0;
     182             : }
     183             : 
     184        8440 : static PyObject *py_PAC_LOGON_NAME_get_account_name(PyObject *obj, void *closure)
     185             : {
     186        8440 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(obj);
     187           0 :         PyObject *py_account_name;
     188        8440 :         if (object->account_name == NULL) {
     189           0 :                 py_account_name = Py_None;
     190           0 :                 Py_INCREF(py_account_name);
     191             :         } else {
     192        8440 :                 py_account_name = PyUnicode_Decode(object->account_name, strlen(object->account_name), "utf-8", "ignore");
     193             :         }
     194        8440 :         return py_account_name;
     195             : }
     196             : 
     197           6 : static int py_PAC_LOGON_NAME_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
     198             : {
     199           6 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(py_obj);
     200           6 :         if (value == NULL) {
     201           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
     202           0 :                 return -1;
     203             :         }
     204             :         {
     205           0 :                 const char *test_str;
     206           0 :                 const char *talloc_str;
     207           6 :                 PyObject *unicode = NULL;
     208           6 :                 if (PyUnicode_Check(value)) {
     209           6 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     210           6 :                         if (unicode == NULL) {
     211           0 :                                 PyErr_NoMemory();
     212           0 :                                 return -1;
     213             :                         }
     214           6 :                         test_str = PyBytes_AS_STRING(unicode);
     215           0 :                 } else if (PyBytes_Check(value)) {
     216           0 :                         test_str = PyBytes_AS_STRING(value);
     217             :                 } else {
     218           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     219           0 :                         return -1;
     220             :                 }
     221           6 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     222           6 :                 if (unicode != NULL) {
     223           6 :                         Py_DECREF(unicode);
     224             :                 }
     225           6 :                 if (talloc_str == NULL) {
     226           0 :                         PyErr_NoMemory();
     227           0 :                         return -1;
     228             :                 }
     229           6 :                 object->account_name = talloc_str;
     230             :         }
     231           6 :         return 0;
     232             : }
     233             : 
     234             : static PyGetSetDef py_PAC_LOGON_NAME_getsetters[] = {
     235             :         {
     236             :                 .name = discard_const_p(char, "logon_time"),
     237             :                 .get = py_PAC_LOGON_NAME_get_logon_time,
     238             :                 .set = py_PAC_LOGON_NAME_set_logon_time,
     239             :                 .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
     240             :         },
     241             :         {
     242             :                 .name = discard_const_p(char, "size"),
     243             :                 .get = py_PAC_LOGON_NAME_get_size,
     244             :                 .set = py_PAC_LOGON_NAME_set_size,
     245             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     246             :         },
     247             :         {
     248             :                 .name = discard_const_p(char, "account_name"),
     249             :                 .get = py_PAC_LOGON_NAME_get_account_name,
     250             :                 .set = py_PAC_LOGON_NAME_set_account_name,
     251             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     252             :         },
     253             :         { .name = NULL }
     254             : };
     255             : 
     256           0 : static PyObject *py_PAC_LOGON_NAME_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     257             : {
     258           0 :         return pytalloc_new(struct PAC_LOGON_NAME, type);
     259             : }
     260             : 
     261             : 
     262             : static PyTypeObject PAC_LOGON_NAME_Type = {
     263             :         PyVarObject_HEAD_INIT(NULL, 0)
     264             :         .tp_name = "krb5pac.PAC_LOGON_NAME",
     265             :         .tp_getset = py_PAC_LOGON_NAME_getsetters,
     266             :         .tp_methods = NULL,
     267             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     268             :         .tp_new = py_PAC_LOGON_NAME_new,
     269             : };
     270             : 
     271             : 
     272       24492 : static PyObject *py_PAC_SIGNATURE_DATA_get_type(PyObject *obj, void *closure)
     273             : {
     274       24492 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(obj);
     275           0 :         PyObject *py_type;
     276       24492 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
     277       24492 :         return py_type;
     278             : }
     279             : 
     280        3461 : static int py_PAC_SIGNATURE_DATA_set_type(PyObject *py_obj, PyObject *value, void *closure)
     281             : {
     282        3461 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     283        3461 :         if (value == NULL) {
     284           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
     285           0 :                 return -1;
     286             :         }
     287             :         {
     288        3461 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
     289        3461 :                 if (PyLong_Check(value)) {
     290           0 :                         unsigned long long test_var;
     291        3461 :                         test_var = PyLong_AsUnsignedLongLong(value);
     292        3461 :                         if (PyErr_Occurred() != NULL) {
     293           0 :                                 return -1;
     294             :                         }
     295        3461 :                         if (test_var > uint_max) {
     296           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     297             :                                   PyLong_Type.tp_name, uint_max, test_var);
     298           0 :                                 return -1;
     299             :                         }
     300        3461 :                         object->type = test_var;
     301             :                 } else {
     302           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     303             :                           PyLong_Type.tp_name);
     304           0 :                         return -1;
     305             :                 }
     306             :         }
     307        3461 :         return 0;
     308             : }
     309             : 
     310       24492 : static PyObject *py_PAC_SIGNATURE_DATA_get_signature(PyObject *obj, void *closure)
     311             : {
     312       24492 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(obj);
     313           0 :         PyObject *py_signature;
     314       24492 :         py_signature = PyBytes_FromStringAndSize((char *)(object->signature).data, (object->signature).length);
     315       24492 :         return py_signature;
     316             : }
     317             : 
     318       27065 : static int py_PAC_SIGNATURE_DATA_set_signature(PyObject *py_obj, PyObject *value, void *closure)
     319             : {
     320       27065 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     321       27065 :         if (value == NULL) {
     322           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature");
     323           0 :                 return -1;
     324             :         }
     325       27065 :         object->signature = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
     326       27065 :         return 0;
     327             : }
     328             : 
     329             : static PyGetSetDef py_PAC_SIGNATURE_DATA_getsetters[] = {
     330             :         {
     331             :                 .name = discard_const_p(char, "type"),
     332             :                 .get = py_PAC_SIGNATURE_DATA_get_type,
     333             :                 .set = py_PAC_SIGNATURE_DATA_set_type,
     334             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     335             :         },
     336             :         {
     337             :                 .name = discard_const_p(char, "signature"),
     338             :                 .get = py_PAC_SIGNATURE_DATA_get_signature,
     339             :                 .set = py_PAC_SIGNATURE_DATA_set_signature,
     340             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
     341             :         },
     342             :         { .name = NULL }
     343             : };
     344             : 
     345       20375 : static PyObject *py_PAC_SIGNATURE_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     346             : {
     347       20375 :         return pytalloc_new(struct PAC_SIGNATURE_DATA, type);
     348             : }
     349             : 
     350       20343 : static PyObject *py_PAC_SIGNATURE_DATA_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     351             : {
     352       20343 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     353       20343 :         PyObject *ret = NULL;
     354           0 :         DATA_BLOB blob;
     355           0 :         enum ndr_err_code err;
     356       20343 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     357       20343 :         if (tmp_ctx == NULL) {
     358           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     359           0 :                 return NULL;
     360             :         }
     361       20343 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_SIGNATURE_DATA);
     362       20343 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     363           0 :                 TALLOC_FREE(tmp_ctx);
     364           0 :                 PyErr_SetNdrError(err);
     365           0 :                 return NULL;
     366             :         }
     367             : 
     368       20343 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     369       20343 :         TALLOC_FREE(tmp_ctx);
     370       20343 :         return ret;
     371             : }
     372             : 
     373       20343 : static PyObject *py_PAC_SIGNATURE_DATA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     374             : {
     375       20343 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     376       20343 :         DATA_BLOB blob = {.data = NULL, .length = 0};
     377       20343 :         Py_ssize_t blob_length = 0;
     378           0 :         enum ndr_err_code err;
     379       20343 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
     380       20343 :         PyObject *allow_remaining_obj = NULL;
     381       20343 :         bool allow_remaining = false;
     382             : 
     383       20343 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
     384             :                 discard_const_p(char *, kwnames),
     385             :                 &blob.data, &blob_length,
     386             :                 &allow_remaining_obj)) {
     387           0 :                 return NULL;
     388             :         }
     389       20343 :         blob.length = blob_length;
     390             : 
     391       20343 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
     392           0 :                 allow_remaining = true;
     393             :         }
     394             : 
     395       20343 :         if (allow_remaining) {
     396           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA);
     397             :         } else {
     398       20343 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA);
     399             :         }
     400       20343 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     401           0 :                 PyErr_SetNdrError(err);
     402           0 :                 return NULL;
     403             :         }
     404             : 
     405       20343 :         Py_RETURN_NONE;
     406             : }
     407             : 
     408           0 : static PyObject *py_PAC_SIGNATURE_DATA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
     409             : {
     410           0 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     411           0 :         PyObject *ret;
     412           0 :         char *retstr;
     413             : 
     414           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_SIGNATURE_DATA, "PAC_SIGNATURE_DATA", object);
     415           0 :         ret = PyUnicode_FromString(retstr);
     416           0 :         talloc_free(retstr);
     417             : 
     418           0 :         return ret;
     419             : }
     420             : 
     421             : static PyMethodDef py_PAC_SIGNATURE_DATA_methods[] = {
     422             :         { "__ndr_pack__", (PyCFunction)py_PAC_SIGNATURE_DATA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
     423             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_SIGNATURE_DATA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
     424             :         { "__ndr_print__", (PyCFunction)py_PAC_SIGNATURE_DATA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
     425             :         { NULL, NULL, 0, NULL }
     426             : };
     427             : 
     428             : 
     429             : static PyTypeObject PAC_SIGNATURE_DATA_Type = {
     430             :         PyVarObject_HEAD_INIT(NULL, 0)
     431             :         .tp_name = "krb5pac.PAC_SIGNATURE_DATA",
     432             :         .tp_getset = py_PAC_SIGNATURE_DATA_getsetters,
     433             :         .tp_methods = py_PAC_SIGNATURE_DATA_methods,
     434             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     435             :         .tp_new = py_PAC_SIGNATURE_DATA_new,
     436             : };
     437             : 
     438             : 
     439          98 : static PyObject *py_PAC_DOMAIN_GROUP_MEMBERSHIP_get_domain_sid(PyObject *obj, void *closure)
     440             : {
     441          98 :         struct PAC_DOMAIN_GROUP_MEMBERSHIP *object = (struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(obj);
     442           0 :         PyObject *py_domain_sid;
     443          98 :         if (object->domain_sid == NULL) {
     444           0 :                 Py_RETURN_NONE;
     445             :         }
     446          98 :         if (object->domain_sid == NULL) {
     447           0 :                 py_domain_sid = Py_None;
     448           0 :                 Py_INCREF(py_domain_sid);
     449             :         } else {
     450          98 :                 py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
     451             :         }
     452          98 :         return py_domain_sid;
     453             : }
     454             : 
     455         499 : static int py_PAC_DOMAIN_GROUP_MEMBERSHIP_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
     456             : {
     457         499 :         struct PAC_DOMAIN_GROUP_MEMBERSHIP *object = (struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(py_obj);
     458         499 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
     459         499 :         if (value == NULL) {
     460           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid");
     461           0 :                 return -1;
     462             :         }
     463         499 :         if (value == Py_None) {
     464         449 :                 object->domain_sid = NULL;
     465             :         } else {
     466          50 :                 object->domain_sid = NULL;
     467          50 :                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
     468          50 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     469           0 :                         PyErr_NoMemory();
     470           0 :                         return -1;
     471             :                 }
     472          50 :                 object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
     473             :         }
     474         499 :         return 0;
     475             : }
     476             : 
     477        1772 : static PyObject *py_PAC_DOMAIN_GROUP_MEMBERSHIP_get_groups(PyObject *obj, void *closure)
     478             : {
     479        1772 :         struct PAC_DOMAIN_GROUP_MEMBERSHIP *object = (struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(obj);
     480           0 :         PyObject *py_groups;
     481        1772 :         py_groups = pytalloc_reference_ex(samr_RidWithAttributeArray_Type, pytalloc_get_mem_ctx(obj), &object->groups);
     482        1772 :         return py_groups;
     483             : }
     484             : 
     485           0 : static int py_PAC_DOMAIN_GROUP_MEMBERSHIP_set_groups(PyObject *py_obj, PyObject *value, void *closure)
     486             : {
     487           0 :         struct PAC_DOMAIN_GROUP_MEMBERSHIP *object = (struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(py_obj);
     488           0 :         if (value == NULL) {
     489           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups");
     490           0 :                 return -1;
     491             :         }
     492           0 :         PY_CHECK_TYPE(samr_RidWithAttributeArray_Type, value, return -1;);
     493           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     494           0 :                 PyErr_NoMemory();
     495           0 :                 return -1;
     496             :         }
     497           0 :         object->groups = *(struct samr_RidWithAttributeArray *)pytalloc_get_ptr(value);
     498           0 :         return 0;
     499             : }
     500             : 
     501             : static PyGetSetDef py_PAC_DOMAIN_GROUP_MEMBERSHIP_getsetters[] = {
     502             :         {
     503             :                 .name = discard_const_p(char, "domain_sid"),
     504             :                 .get = py_PAC_DOMAIN_GROUP_MEMBERSHIP_get_domain_sid,
     505             :                 .set = py_PAC_DOMAIN_GROUP_MEMBERSHIP_set_domain_sid,
     506             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
     507             :         },
     508             :         {
     509             :                 .name = discard_const_p(char, "groups"),
     510             :                 .get = py_PAC_DOMAIN_GROUP_MEMBERSHIP_get_groups,
     511             :                 .set = py_PAC_DOMAIN_GROUP_MEMBERSHIP_set_groups,
     512             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttributeArray")
     513             :         },
     514             :         { .name = NULL }
     515             : };
     516             : 
     517           0 : static PyObject *py_PAC_DOMAIN_GROUP_MEMBERSHIP_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     518             : {
     519           0 :         return pytalloc_new(struct PAC_DOMAIN_GROUP_MEMBERSHIP, type);
     520             : }
     521             : 
     522             : 
     523             : static PyTypeObject PAC_DOMAIN_GROUP_MEMBERSHIP_Type = {
     524             :         PyVarObject_HEAD_INIT(NULL, 0)
     525             :         .tp_name = "krb5pac.PAC_DOMAIN_GROUP_MEMBERSHIP",
     526             :         .tp_getset = py_PAC_DOMAIN_GROUP_MEMBERSHIP_getsetters,
     527             :         .tp_methods = NULL,
     528             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     529             :         .tp_new = py_PAC_DOMAIN_GROUP_MEMBERSHIP_new,
     530             : };
     531             : 
     532             : 
     533       21240 : static PyObject *py_PAC_LOGON_INFO_get_info3(PyObject *obj, void *closure)
     534             : {
     535       21240 :         struct PAC_LOGON_INFO *object = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(obj);
     536           2 :         PyObject *py_info3;
     537       21240 :         py_info3 = pytalloc_reference_ex(netr_SamInfo3_Type, pytalloc_get_mem_ctx(obj), &object->info3);
     538       21240 :         return py_info3;
     539             : }
     540             : 
     541           0 : static int py_PAC_LOGON_INFO_set_info3(PyObject *py_obj, PyObject *value, void *closure)
     542             : {
     543           0 :         struct PAC_LOGON_INFO *object = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(py_obj);
     544           0 :         if (value == NULL) {
     545           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info3");
     546           0 :                 return -1;
     547             :         }
     548           0 :         PY_CHECK_TYPE(netr_SamInfo3_Type, value, return -1;);
     549           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     550           0 :                 PyErr_NoMemory();
     551           0 :                 return -1;
     552             :         }
     553           0 :         object->info3 = *(struct netr_SamInfo3 *)pytalloc_get_ptr(value);
     554           0 :         return 0;
     555             : }
     556             : 
     557        9493 : static PyObject *py_PAC_LOGON_INFO_get_resource_groups(PyObject *obj, void *closure)
     558             : {
     559        9493 :         struct PAC_LOGON_INFO *object = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(obj);
     560           0 :         PyObject *py_resource_groups;
     561        9493 :         py_resource_groups = pytalloc_reference_ex(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type, pytalloc_get_mem_ctx(obj), &object->resource_groups);
     562        9493 :         return py_resource_groups;
     563             : }
     564             : 
     565           0 : static int py_PAC_LOGON_INFO_set_resource_groups(PyObject *py_obj, PyObject *value, void *closure)
     566             : {
     567           0 :         struct PAC_LOGON_INFO *object = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(py_obj);
     568           0 :         if (value == NULL) {
     569           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->resource_groups");
     570           0 :                 return -1;
     571             :         }
     572           0 :         PY_CHECK_TYPE(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type, value, return -1;);
     573           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     574           0 :                 PyErr_NoMemory();
     575           0 :                 return -1;
     576             :         }
     577           0 :         object->resource_groups = *(struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(value);
     578           0 :         return 0;
     579             : }
     580             : 
     581             : static PyGetSetDef py_PAC_LOGON_INFO_getsetters[] = {
     582             :         {
     583             :                 .name = discard_const_p(char, "info3"),
     584             :                 .get = py_PAC_LOGON_INFO_get_info3,
     585             :                 .set = py_PAC_LOGON_INFO_set_info3,
     586             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamInfo3")
     587             :         },
     588             :         {
     589             :                 .name = discard_const_p(char, "resource_groups"),
     590             :                 .get = py_PAC_LOGON_INFO_get_resource_groups,
     591             :                 .set = py_PAC_LOGON_INFO_set_resource_groups,
     592             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_DOMAIN_GROUP_MEMBERSHIP")
     593             :         },
     594             :         { .name = NULL }
     595             : };
     596             : 
     597           0 : static PyObject *py_PAC_LOGON_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     598             : {
     599           0 :         return pytalloc_new(struct PAC_LOGON_INFO, type);
     600             : }
     601             : 
     602             : 
     603             : static PyTypeObject PAC_LOGON_INFO_Type = {
     604             :         PyVarObject_HEAD_INIT(NULL, 0)
     605             :         .tp_name = "krb5pac.PAC_LOGON_INFO",
     606             :         .tp_getset = py_PAC_LOGON_INFO_getsetters,
     607             :         .tp_methods = NULL,
     608             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     609             :         .tp_new = py_PAC_LOGON_INFO_new,
     610             : };
     611             : 
     612             : 
     613          25 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_get_version(PyObject *obj, void *closure)
     614             : {
     615          25 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(obj);
     616           0 :         PyObject *py_version;
     617          25 :         py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
     618          25 :         return py_version;
     619             : }
     620             : 
     621           0 : static int py_PAC_CREDENTIAL_NTLM_SECPKG_set_version(PyObject *py_obj, PyObject *value, void *closure)
     622             : {
     623           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     624           0 :         if (value == NULL) {
     625           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
     626           0 :                 return -1;
     627             :         }
     628             :         {
     629           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
     630           0 :                 if (PyLong_Check(value)) {
     631           0 :                         unsigned long long test_var;
     632           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     633           0 :                         if (PyErr_Occurred() != NULL) {
     634           0 :                                 return -1;
     635             :                         }
     636           0 :                         if (test_var > uint_max) {
     637           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     638             :                                   PyLong_Type.tp_name, uint_max, test_var);
     639           0 :                                 return -1;
     640             :                         }
     641           0 :                         object->version = test_var;
     642             :                 } else {
     643           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     644             :                           PyLong_Type.tp_name);
     645           0 :                         return -1;
     646             :                 }
     647             :         }
     648           0 :         return 0;
     649             : }
     650             : 
     651          25 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_get_flags(PyObject *obj, void *closure)
     652             : {
     653          25 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(obj);
     654           0 :         PyObject *py_flags;
     655          25 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
     656          25 :         return py_flags;
     657             : }
     658             : 
     659           0 : static int py_PAC_CREDENTIAL_NTLM_SECPKG_set_flags(PyObject *py_obj, PyObject *value, void *closure)
     660             : {
     661           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     662           0 :         if (value == NULL) {
     663           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
     664           0 :                 return -1;
     665             :         }
     666             :         {
     667           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
     668           0 :                 if (PyLong_Check(value)) {
     669           0 :                         unsigned long long test_var;
     670           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     671           0 :                         if (PyErr_Occurred() != NULL) {
     672           0 :                                 return -1;
     673             :                         }
     674           0 :                         if (test_var > uint_max) {
     675           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     676             :                                   PyLong_Type.tp_name, uint_max, test_var);
     677           0 :                                 return -1;
     678             :                         }
     679           0 :                         object->flags = test_var;
     680             :                 } else {
     681           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     682             :                           PyLong_Type.tp_name);
     683           0 :                         return -1;
     684             :                 }
     685             :         }
     686           0 :         return 0;
     687             : }
     688             : 
     689          25 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_get_lm_password(PyObject *obj, void *closure)
     690             : {
     691          25 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(obj);
     692           0 :         PyObject *py_lm_password;
     693          25 :         py_lm_password = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lm_password);
     694          25 :         return py_lm_password;
     695             : }
     696             : 
     697           0 : static int py_PAC_CREDENTIAL_NTLM_SECPKG_set_lm_password(PyObject *py_obj, PyObject *value, void *closure)
     698             : {
     699           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     700           0 :         if (value == NULL) {
     701           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_password");
     702           0 :                 return -1;
     703             :         }
     704           0 :         PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
     705           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     706           0 :                 PyErr_NoMemory();
     707           0 :                 return -1;
     708             :         }
     709           0 :         object->lm_password = *(struct samr_Password *)pytalloc_get_ptr(value);
     710           0 :         return 0;
     711             : }
     712             : 
     713          25 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_get_nt_password(PyObject *obj, void *closure)
     714             : {
     715          25 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(obj);
     716           0 :         PyObject *py_nt_password;
     717          25 :         py_nt_password = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->nt_password);
     718          25 :         return py_nt_password;
     719             : }
     720             : 
     721           0 : static int py_PAC_CREDENTIAL_NTLM_SECPKG_set_nt_password(PyObject *py_obj, PyObject *value, void *closure)
     722             : {
     723           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     724           0 :         if (value == NULL) {
     725           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_password");
     726           0 :                 return -1;
     727             :         }
     728           0 :         PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
     729           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     730           0 :                 PyErr_NoMemory();
     731           0 :                 return -1;
     732             :         }
     733           0 :         object->nt_password = *(struct samr_Password *)pytalloc_get_ptr(value);
     734           0 :         return 0;
     735             : }
     736             : 
     737             : static PyGetSetDef py_PAC_CREDENTIAL_NTLM_SECPKG_getsetters[] = {
     738             :         {
     739             :                 .name = discard_const_p(char, "version"),
     740             :                 .get = py_PAC_CREDENTIAL_NTLM_SECPKG_get_version,
     741             :                 .set = py_PAC_CREDENTIAL_NTLM_SECPKG_set_version,
     742             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     743             :         },
     744             :         {
     745             :                 .name = discard_const_p(char, "flags"),
     746             :                 .get = py_PAC_CREDENTIAL_NTLM_SECPKG_get_flags,
     747             :                 .set = py_PAC_CREDENTIAL_NTLM_SECPKG_set_flags,
     748             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CREDENTIAL_NTLM_FLAGS")
     749             :         },
     750             :         {
     751             :                 .name = discard_const_p(char, "lm_password"),
     752             :                 .get = py_PAC_CREDENTIAL_NTLM_SECPKG_get_lm_password,
     753             :                 .set = py_PAC_CREDENTIAL_NTLM_SECPKG_set_lm_password,
     754             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
     755             :         },
     756             :         {
     757             :                 .name = discard_const_p(char, "nt_password"),
     758             :                 .get = py_PAC_CREDENTIAL_NTLM_SECPKG_get_nt_password,
     759             :                 .set = py_PAC_CREDENTIAL_NTLM_SECPKG_set_nt_password,
     760             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
     761             :         },
     762             :         { .name = NULL }
     763             : };
     764             : 
     765          25 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     766             : {
     767          25 :         return pytalloc_new(struct PAC_CREDENTIAL_NTLM_SECPKG, type);
     768             : }
     769             : 
     770           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     771             : {
     772           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     773           0 :         PyObject *ret = NULL;
     774           0 :         DATA_BLOB blob;
     775           0 :         enum ndr_err_code err;
     776           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     777           0 :         if (tmp_ctx == NULL) {
     778           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     779           0 :                 return NULL;
     780             :         }
     781           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_NTLM_SECPKG);
     782           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     783           0 :                 TALLOC_FREE(tmp_ctx);
     784           0 :                 PyErr_SetNdrError(err);
     785           0 :                 return NULL;
     786             :         }
     787             : 
     788           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     789           0 :         TALLOC_FREE(tmp_ctx);
     790           0 :         return ret;
     791             : }
     792             : 
     793          25 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     794             : {
     795          25 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     796          25 :         DATA_BLOB blob = {.data = NULL, .length = 0};
     797          25 :         Py_ssize_t blob_length = 0;
     798           0 :         enum ndr_err_code err;
     799          25 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
     800          25 :         PyObject *allow_remaining_obj = NULL;
     801          25 :         bool allow_remaining = false;
     802             : 
     803          25 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
     804             :                 discard_const_p(char *, kwnames),
     805             :                 &blob.data, &blob_length,
     806             :                 &allow_remaining_obj)) {
     807           0 :                 return NULL;
     808             :         }
     809          25 :         blob.length = blob_length;
     810             : 
     811          25 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
     812           0 :                 allow_remaining = true;
     813             :         }
     814             : 
     815          25 :         if (allow_remaining) {
     816           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_NTLM_SECPKG);
     817             :         } else {
     818          25 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_NTLM_SECPKG);
     819             :         }
     820          25 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     821           0 :                 PyErr_SetNdrError(err);
     822           0 :                 return NULL;
     823             :         }
     824             : 
     825          25 :         Py_RETURN_NONE;
     826             : }
     827             : 
     828           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
     829             : {
     830           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     831           0 :         PyObject *ret;
     832           0 :         char *retstr;
     833             : 
     834           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_NTLM_SECPKG, "PAC_CREDENTIAL_NTLM_SECPKG", object);
     835           0 :         ret = PyUnicode_FromString(retstr);
     836           0 :         talloc_free(retstr);
     837             : 
     838           0 :         return ret;
     839             : }
     840             : 
     841             : static PyMethodDef py_PAC_CREDENTIAL_NTLM_SECPKG_methods[] = {
     842             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
     843             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
     844             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
     845             :         { NULL, NULL, 0, NULL }
     846             : };
     847             : 
     848             : 
     849             : static PyTypeObject PAC_CREDENTIAL_NTLM_SECPKG_Type = {
     850             :         PyVarObject_HEAD_INIT(NULL, 0)
     851             :         .tp_name = "krb5pac.PAC_CREDENTIAL_NTLM_SECPKG",
     852             :         .tp_getset = py_PAC_CREDENTIAL_NTLM_SECPKG_getsetters,
     853             :         .tp_methods = py_PAC_CREDENTIAL_NTLM_SECPKG_methods,
     854             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     855             :         .tp_new = py_PAC_CREDENTIAL_NTLM_SECPKG_new,
     856             : };
     857             : 
     858             : 
     859          25 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_package_name(PyObject *obj, void *closure)
     860             : {
     861          25 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(obj);
     862           0 :         PyObject *py_package_name;
     863          25 :         py_package_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->package_name);
     864          25 :         return py_package_name;
     865             : }
     866             : 
     867           0 : static int py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_package_name(PyObject *py_obj, PyObject *value, void *closure)
     868             : {
     869           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
     870           0 :         if (value == NULL) {
     871           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->package_name");
     872           0 :                 return -1;
     873             :         }
     874           0 :         PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
     875           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     876           0 :                 PyErr_NoMemory();
     877           0 :                 return -1;
     878             :         }
     879           0 :         object->package_name = *(struct lsa_String *)pytalloc_get_ptr(value);
     880           0 :         return 0;
     881             : }
     882             : 
     883           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_credential_size(PyObject *obj, void *closure)
     884             : {
     885           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(obj);
     886           0 :         PyObject *py_credential_size;
     887           0 :         py_credential_size = PyLong_FromUnsignedLongLong((uint32_t)object->credential_size);
     888           0 :         return py_credential_size;
     889             : }
     890             : 
     891           0 : static int py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_credential_size(PyObject *py_obj, PyObject *value, void *closure)
     892             : {
     893           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
     894           0 :         if (value == NULL) {
     895           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credential_size");
     896           0 :                 return -1;
     897             :         }
     898             :         {
     899           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->credential_size));
     900           0 :                 if (PyLong_Check(value)) {
     901           0 :                         unsigned long long test_var;
     902           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     903           0 :                         if (PyErr_Occurred() != NULL) {
     904           0 :                                 return -1;
     905             :                         }
     906           0 :                         if (test_var > uint_max) {
     907           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     908             :                                   PyLong_Type.tp_name, uint_max, test_var);
     909           0 :                                 return -1;
     910             :                         }
     911           0 :                         object->credential_size = test_var;
     912             :                 } else {
     913           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
     914             :                           PyLong_Type.tp_name);
     915           0 :                         return -1;
     916             :                 }
     917             :         }
     918           0 :         return 0;
     919             : }
     920             : 
     921          25 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_credential(PyObject *obj, void *closure)
     922             : {
     923          25 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(obj);
     924           0 :         PyObject *py_credential;
     925          25 :         if (object->credential == NULL) {
     926           0 :                 Py_RETURN_NONE;
     927             :         }
     928          25 :         if (object->credential == NULL) {
     929           0 :                 py_credential = Py_None;
     930           0 :                 Py_INCREF(py_credential);
     931             :         } else {
     932          25 :                 py_credential = PyList_New(object->credential_size);
     933          25 :                 if (py_credential == NULL) {
     934           0 :                         return NULL;
     935             :                 }
     936             :                 {
     937             :                         int credential_cntr_1;
     938        1025 :                         for (credential_cntr_1 = 0; credential_cntr_1 < (object->credential_size); credential_cntr_1++) {
     939           0 :                                 PyObject *py_credential_1;
     940        1000 :                                 py_credential_1 = PyLong_FromLong((uint16_t)object->credential[credential_cntr_1]);
     941        1000 :                                 PyList_SetItem(py_credential, credential_cntr_1, py_credential_1);
     942             :                         }
     943             :                 }
     944             :         }
     945          25 :         return py_credential;
     946             : }
     947             : 
     948           0 : static int py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_credential(PyObject *py_obj, PyObject *value, void *closure)
     949             : {
     950           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
     951           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->credential));
     952           0 :         if (value == NULL) {
     953           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credential");
     954           0 :                 return -1;
     955             :         }
     956           0 :         if (value == Py_None) {
     957           0 :                 object->credential = NULL;
     958             :         } else {
     959           0 :                 object->credential = NULL;
     960           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     961             :                 {
     962           0 :                         int credential_cntr_1;
     963           0 :                         object->credential = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->credential, PyList_GET_SIZE(value));
     964           0 :                         if (!object->credential) { return -1; }
     965           0 :                         talloc_set_name_const(object->credential, "ARRAY: object->credential");
     966           0 :                         for (credential_cntr_1 = 0; credential_cntr_1 < PyList_GET_SIZE(value); credential_cntr_1++) {
     967           0 :                                 if (PyList_GET_ITEM(value, credential_cntr_1) == NULL) {
     968           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credential[credential_cntr_1]");
     969           0 :                                         return -1;
     970             :                                 }
     971             :                                 {
     972           0 :                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->credential[credential_cntr_1]));
     973           0 :                                         if (PyLong_Check(PyList_GET_ITEM(value, credential_cntr_1))) {
     974           0 :                                                 unsigned long long test_var;
     975           0 :                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, credential_cntr_1));
     976           0 :                                                 if (PyErr_Occurred() != NULL) {
     977           0 :                                                         return -1;
     978             :                                                 }
     979           0 :                                                 if (test_var > uint_max) {
     980           0 :                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
     981             :                                                           PyLong_Type.tp_name, uint_max, test_var);
     982           0 :                                                         return -1;
     983             :                                                 }
     984           0 :                                                 object->credential[credential_cntr_1] = test_var;
     985             :                                         } else {
     986           0 :                                                 PyErr_Format(PyExc_TypeError, "Expected type %s",
     987             :                                                   PyLong_Type.tp_name);
     988           0 :                                                 return -1;
     989             :                                         }
     990             :                                 }
     991             :                         }
     992             :                 }
     993             :         }
     994           0 :         return 0;
     995             : }
     996             : 
     997             : static PyGetSetDef py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_getsetters[] = {
     998             :         {
     999             :                 .name = discard_const_p(char, "package_name"),
    1000             :                 .get = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_package_name,
    1001             :                 .set = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_package_name,
    1002             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
    1003             :         },
    1004             :         {
    1005             :                 .name = discard_const_p(char, "credential_size"),
    1006             :                 .get = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_credential_size,
    1007             :                 .set = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_credential_size,
    1008             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1009             :         },
    1010             :         {
    1011             :                 .name = discard_const_p(char, "credential"),
    1012             :                 .get = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_credential,
    1013             :                 .set = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_credential,
    1014             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1015             :         },
    1016             :         { .name = NULL }
    1017             : };
    1018             : 
    1019           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1020             : {
    1021           0 :         return pytalloc_new(struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG, type);
    1022             : }
    1023             : 
    1024           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1025             : {
    1026           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
    1027           0 :         PyObject *ret = NULL;
    1028           0 :         DATA_BLOB blob;
    1029           0 :         enum ndr_err_code err;
    1030           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1031           0 :         if (tmp_ctx == NULL) {
    1032           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1033           0 :                 return NULL;
    1034             :         }
    1035           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG);
    1036           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1037           0 :                 TALLOC_FREE(tmp_ctx);
    1038           0 :                 PyErr_SetNdrError(err);
    1039           0 :                 return NULL;
    1040             :         }
    1041             : 
    1042           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1043           0 :         TALLOC_FREE(tmp_ctx);
    1044           0 :         return ret;
    1045             : }
    1046             : 
    1047           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1048             : {
    1049           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
    1050           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1051           0 :         Py_ssize_t blob_length = 0;
    1052           0 :         enum ndr_err_code err;
    1053           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1054           0 :         PyObject *allow_remaining_obj = NULL;
    1055           0 :         bool allow_remaining = false;
    1056             : 
    1057           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1058             :                 discard_const_p(char *, kwnames),
    1059             :                 &blob.data, &blob_length,
    1060             :                 &allow_remaining_obj)) {
    1061           0 :                 return NULL;
    1062             :         }
    1063           0 :         blob.length = blob_length;
    1064             : 
    1065           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1066           0 :                 allow_remaining = true;
    1067             :         }
    1068             : 
    1069           0 :         if (allow_remaining) {
    1070           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG);
    1071             :         } else {
    1072           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG);
    1073             :         }
    1074           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1075           0 :                 PyErr_SetNdrError(err);
    1076           0 :                 return NULL;
    1077             :         }
    1078             : 
    1079           0 :         Py_RETURN_NONE;
    1080             : }
    1081             : 
    1082           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1083             : {
    1084           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
    1085           0 :         PyObject *ret;
    1086           0 :         char *retstr;
    1087             : 
    1088           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG, "PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG", object);
    1089           0 :         ret = PyUnicode_FromString(retstr);
    1090           0 :         talloc_free(retstr);
    1091             : 
    1092           0 :         return ret;
    1093             : }
    1094             : 
    1095             : static PyMethodDef py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_methods[] = {
    1096             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1097             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1098             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1099             :         { NULL, NULL, 0, NULL }
    1100             : };
    1101             : 
    1102             : 
    1103             : static PyTypeObject PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type = {
    1104             :         PyVarObject_HEAD_INIT(NULL, 0)
    1105             :         .tp_name = "krb5pac.PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG",
    1106             :         .tp_getset = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_getsetters,
    1107             :         .tp_methods = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_methods,
    1108             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1109             :         .tp_new = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_new,
    1110             : };
    1111             : 
    1112             : 
    1113          50 : static PyObject *py_PAC_CREDENTIAL_DATA_get_credential_count(PyObject *obj, void *closure)
    1114             : {
    1115          50 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(obj);
    1116           0 :         PyObject *py_credential_count;
    1117          50 :         py_credential_count = PyLong_FromUnsignedLongLong((uint32_t)object->credential_count);
    1118          50 :         return py_credential_count;
    1119             : }
    1120             : 
    1121           0 : static int py_PAC_CREDENTIAL_DATA_set_credential_count(PyObject *py_obj, PyObject *value, void *closure)
    1122             : {
    1123           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1124           0 :         if (value == NULL) {
    1125           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credential_count");
    1126           0 :                 return -1;
    1127             :         }
    1128             :         {
    1129           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->credential_count));
    1130           0 :                 if (PyLong_Check(value)) {
    1131           0 :                         unsigned long long test_var;
    1132           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1133           0 :                         if (PyErr_Occurred() != NULL) {
    1134           0 :                                 return -1;
    1135             :                         }
    1136           0 :                         if (test_var > uint_max) {
    1137           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1138             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1139           0 :                                 return -1;
    1140             :                         }
    1141           0 :                         object->credential_count = test_var;
    1142             :                 } else {
    1143           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1144             :                           PyLong_Type.tp_name);
    1145           0 :                         return -1;
    1146             :                 }
    1147             :         }
    1148           0 :         return 0;
    1149             : }
    1150             : 
    1151          50 : static PyObject *py_PAC_CREDENTIAL_DATA_get_credentials(PyObject *obj, void *closure)
    1152             : {
    1153          50 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(obj);
    1154           0 :         PyObject *py_credentials;
    1155          50 :         py_credentials = PyList_New(object->credential_count);
    1156          50 :         if (py_credentials == NULL) {
    1157           0 :                 return NULL;
    1158             :         }
    1159             :         {
    1160             :                 int credentials_cntr_0;
    1161         100 :                 for (credentials_cntr_0 = 0; credentials_cntr_0 < (object->credential_count); credentials_cntr_0++) {
    1162           0 :                         PyObject *py_credentials_0;
    1163          50 :                         py_credentials_0 = pytalloc_reference_ex(&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type, object->credentials, &object->credentials[credentials_cntr_0]);
    1164          50 :                         PyList_SetItem(py_credentials, credentials_cntr_0, py_credentials_0);
    1165             :                 }
    1166             :         }
    1167          50 :         return py_credentials;
    1168             : }
    1169             : 
    1170           0 : static int py_PAC_CREDENTIAL_DATA_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
    1171             : {
    1172           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1173           0 :         if (value == NULL) {
    1174           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credentials");
    1175           0 :                 return -1;
    1176             :         }
    1177           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1178             :         {
    1179           0 :                 int credentials_cntr_0;
    1180           0 :                 object->credentials = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->credentials, PyList_GET_SIZE(value));
    1181           0 :                 if (!object->credentials) { return -1; }
    1182           0 :                 talloc_set_name_const(object->credentials, "ARRAY: object->credentials");
    1183           0 :                 for (credentials_cntr_0 = 0; credentials_cntr_0 < PyList_GET_SIZE(value); credentials_cntr_0++) {
    1184           0 :                         if (PyList_GET_ITEM(value, credentials_cntr_0) == NULL) {
    1185           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credentials[credentials_cntr_0]");
    1186           0 :                                 return -1;
    1187             :                         }
    1188           0 :                         PY_CHECK_TYPE(&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type, PyList_GET_ITEM(value, credentials_cntr_0), return -1;);
    1189           0 :                         if (talloc_reference(object->credentials, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, credentials_cntr_0))) == NULL) {
    1190           0 :                                 PyErr_NoMemory();
    1191           0 :                                 return -1;
    1192             :                         }
    1193           0 :                         object->credentials[credentials_cntr_0] = *(struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(PyList_GET_ITEM(value, credentials_cntr_0));
    1194             :                 }
    1195             :         }
    1196           0 :         return 0;
    1197             : }
    1198             : 
    1199             : static PyGetSetDef py_PAC_CREDENTIAL_DATA_getsetters[] = {
    1200             :         {
    1201             :                 .name = discard_const_p(char, "credential_count"),
    1202             :                 .get = py_PAC_CREDENTIAL_DATA_get_credential_count,
    1203             :                 .set = py_PAC_CREDENTIAL_DATA_set_credential_count,
    1204             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1205             :         },
    1206             :         {
    1207             :                 .name = discard_const_p(char, "credentials"),
    1208             :                 .get = py_PAC_CREDENTIAL_DATA_get_credentials,
    1209             :                 .set = py_PAC_CREDENTIAL_DATA_set_credentials,
    1210             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG")
    1211             :         },
    1212             :         { .name = NULL }
    1213             : };
    1214             : 
    1215           0 : static PyObject *py_PAC_CREDENTIAL_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1216             : {
    1217           0 :         return pytalloc_new(struct PAC_CREDENTIAL_DATA, type);
    1218             : }
    1219             : 
    1220           0 : static PyObject *py_PAC_CREDENTIAL_DATA_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1221             : {
    1222           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1223           0 :         PyObject *ret = NULL;
    1224           0 :         DATA_BLOB blob;
    1225           0 :         enum ndr_err_code err;
    1226           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1227           0 :         if (tmp_ctx == NULL) {
    1228           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1229           0 :                 return NULL;
    1230             :         }
    1231           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_DATA);
    1232           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1233           0 :                 TALLOC_FREE(tmp_ctx);
    1234           0 :                 PyErr_SetNdrError(err);
    1235           0 :                 return NULL;
    1236             :         }
    1237             : 
    1238           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1239           0 :         TALLOC_FREE(tmp_ctx);
    1240           0 :         return ret;
    1241             : }
    1242             : 
    1243           0 : static PyObject *py_PAC_CREDENTIAL_DATA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1244             : {
    1245           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1246           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1247           0 :         Py_ssize_t blob_length = 0;
    1248           0 :         enum ndr_err_code err;
    1249           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1250           0 :         PyObject *allow_remaining_obj = NULL;
    1251           0 :         bool allow_remaining = false;
    1252             : 
    1253           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1254             :                 discard_const_p(char *, kwnames),
    1255             :                 &blob.data, &blob_length,
    1256             :                 &allow_remaining_obj)) {
    1257           0 :                 return NULL;
    1258             :         }
    1259           0 :         blob.length = blob_length;
    1260             : 
    1261           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1262           0 :                 allow_remaining = true;
    1263             :         }
    1264             : 
    1265           0 :         if (allow_remaining) {
    1266           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA);
    1267             :         } else {
    1268           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA);
    1269             :         }
    1270           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1271           0 :                 PyErr_SetNdrError(err);
    1272           0 :                 return NULL;
    1273             :         }
    1274             : 
    1275           0 :         Py_RETURN_NONE;
    1276             : }
    1277             : 
    1278           0 : static PyObject *py_PAC_CREDENTIAL_DATA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1279             : {
    1280           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1281           0 :         PyObject *ret;
    1282           0 :         char *retstr;
    1283             : 
    1284           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_DATA, "PAC_CREDENTIAL_DATA", object);
    1285           0 :         ret = PyUnicode_FromString(retstr);
    1286           0 :         talloc_free(retstr);
    1287             : 
    1288           0 :         return ret;
    1289             : }
    1290             : 
    1291             : static PyMethodDef py_PAC_CREDENTIAL_DATA_methods[] = {
    1292             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_DATA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1293             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_DATA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1294             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_DATA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1295             :         { NULL, NULL, 0, NULL }
    1296             : };
    1297             : 
    1298             : 
    1299             : static PyTypeObject PAC_CREDENTIAL_DATA_Type = {
    1300             :         PyVarObject_HEAD_INIT(NULL, 0)
    1301             :         .tp_name = "krb5pac.PAC_CREDENTIAL_DATA",
    1302             :         .tp_getset = py_PAC_CREDENTIAL_DATA_getsetters,
    1303             :         .tp_methods = py_PAC_CREDENTIAL_DATA_methods,
    1304             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1305             :         .tp_new = py_PAC_CREDENTIAL_DATA_new,
    1306             : };
    1307             : 
    1308             : 
    1309          25 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_get_data(PyObject *obj, void *closure)
    1310             : {
    1311          25 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(obj);
    1312           0 :         PyObject *py_data;
    1313          25 :         if (object->data == NULL) {
    1314           0 :                 Py_RETURN_NONE;
    1315             :         }
    1316          25 :         if (object->data == NULL) {
    1317           0 :                 py_data = Py_None;
    1318           0 :                 Py_INCREF(py_data);
    1319             :         } else {
    1320          25 :                 py_data = pytalloc_reference_ex(&PAC_CREDENTIAL_DATA_Type, object->data, object->data);
    1321             :         }
    1322          25 :         return py_data;
    1323             : }
    1324             : 
    1325           0 : static int py_PAC_CREDENTIAL_DATA_CTR_set_data(PyObject *py_obj, PyObject *value, void *closure)
    1326             : {
    1327           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(py_obj);
    1328           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
    1329           0 :         if (value == NULL) {
    1330           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
    1331           0 :                 return -1;
    1332             :         }
    1333           0 :         if (value == Py_None) {
    1334           0 :                 object->data = NULL;
    1335             :         } else {
    1336           0 :                 object->data = NULL;
    1337           0 :                 PY_CHECK_TYPE(&PAC_CREDENTIAL_DATA_Type, value, return -1;);
    1338           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1339           0 :                         PyErr_NoMemory();
    1340           0 :                         return -1;
    1341             :                 }
    1342           0 :                 object->data = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(value);
    1343             :         }
    1344           0 :         return 0;
    1345             : }
    1346             : 
    1347             : static PyGetSetDef py_PAC_CREDENTIAL_DATA_CTR_getsetters[] = {
    1348             :         {
    1349             :                 .name = discard_const_p(char, "data"),
    1350             :                 .get = py_PAC_CREDENTIAL_DATA_CTR_get_data,
    1351             :                 .set = py_PAC_CREDENTIAL_DATA_CTR_set_data,
    1352             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CREDENTIAL_DATA")
    1353             :         },
    1354             :         { .name = NULL }
    1355             : };
    1356             : 
    1357           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1358             : {
    1359           0 :         return pytalloc_new(struct PAC_CREDENTIAL_DATA_CTR, type);
    1360             : }
    1361             : 
    1362           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1363             : {
    1364           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(py_obj);
    1365           0 :         PyObject *ret = NULL;
    1366           0 :         DATA_BLOB blob;
    1367           0 :         enum ndr_err_code err;
    1368           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1369           0 :         if (tmp_ctx == NULL) {
    1370           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1371           0 :                 return NULL;
    1372             :         }
    1373           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_DATA_CTR);
    1374           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1375           0 :                 TALLOC_FREE(tmp_ctx);
    1376           0 :                 PyErr_SetNdrError(err);
    1377           0 :                 return NULL;
    1378             :         }
    1379             : 
    1380           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1381           0 :         TALLOC_FREE(tmp_ctx);
    1382           0 :         return ret;
    1383             : }
    1384             : 
    1385           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1386             : {
    1387           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(py_obj);
    1388           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1389           0 :         Py_ssize_t blob_length = 0;
    1390           0 :         enum ndr_err_code err;
    1391           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1392           0 :         PyObject *allow_remaining_obj = NULL;
    1393           0 :         bool allow_remaining = false;
    1394             : 
    1395           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1396             :                 discard_const_p(char *, kwnames),
    1397             :                 &blob.data, &blob_length,
    1398             :                 &allow_remaining_obj)) {
    1399           0 :                 return NULL;
    1400             :         }
    1401           0 :         blob.length = blob_length;
    1402             : 
    1403           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1404           0 :                 allow_remaining = true;
    1405             :         }
    1406             : 
    1407           0 :         if (allow_remaining) {
    1408           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA_CTR);
    1409             :         } else {
    1410           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA_CTR);
    1411             :         }
    1412           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1413           0 :                 PyErr_SetNdrError(err);
    1414           0 :                 return NULL;
    1415             :         }
    1416             : 
    1417           0 :         Py_RETURN_NONE;
    1418             : }
    1419             : 
    1420           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1421             : {
    1422           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(py_obj);
    1423           0 :         PyObject *ret;
    1424           0 :         char *retstr;
    1425             : 
    1426           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_DATA_CTR, "PAC_CREDENTIAL_DATA_CTR", object);
    1427           0 :         ret = PyUnicode_FromString(retstr);
    1428           0 :         talloc_free(retstr);
    1429             : 
    1430           0 :         return ret;
    1431             : }
    1432             : 
    1433             : static PyMethodDef py_PAC_CREDENTIAL_DATA_CTR_methods[] = {
    1434             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_DATA_CTR_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1435             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_DATA_CTR_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1436             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_DATA_CTR_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1437             :         { NULL, NULL, 0, NULL }
    1438             : };
    1439             : 
    1440             : 
    1441             : static PyTypeObject PAC_CREDENTIAL_DATA_CTR_Type = {
    1442             :         PyVarObject_HEAD_INIT(NULL, 0)
    1443             :         .tp_name = "krb5pac.PAC_CREDENTIAL_DATA_CTR",
    1444             :         .tp_getset = py_PAC_CREDENTIAL_DATA_CTR_getsetters,
    1445             :         .tp_methods = py_PAC_CREDENTIAL_DATA_CTR_methods,
    1446             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1447             :         .tp_new = py_PAC_CREDENTIAL_DATA_CTR_new,
    1448             : };
    1449             : 
    1450             : 
    1451          25 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_get_ctr(PyObject *obj, void *closure)
    1452             : {
    1453          25 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(obj);
    1454           0 :         PyObject *py_ctr;
    1455          25 :         py_ctr = pytalloc_reference_ex(&PAC_CREDENTIAL_DATA_CTR_Type, pytalloc_get_mem_ctx(obj), &object->ctr);
    1456          25 :         return py_ctr;
    1457             : }
    1458             : 
    1459           0 : static int py_PAC_CREDENTIAL_DATA_NDR_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
    1460             : {
    1461           0 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(py_obj);
    1462           0 :         if (value == NULL) {
    1463           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
    1464           0 :                 return -1;
    1465             :         }
    1466           0 :         PY_CHECK_TYPE(&PAC_CREDENTIAL_DATA_CTR_Type, value, return -1;);
    1467           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1468           0 :                 PyErr_NoMemory();
    1469           0 :                 return -1;
    1470             :         }
    1471           0 :         object->ctr = *(struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(value);
    1472           0 :         return 0;
    1473             : }
    1474             : 
    1475             : static PyGetSetDef py_PAC_CREDENTIAL_DATA_NDR_getsetters[] = {
    1476             :         {
    1477             :                 .name = discard_const_p(char, "ctr"),
    1478             :                 .get = py_PAC_CREDENTIAL_DATA_NDR_get_ctr,
    1479             :                 .set = py_PAC_CREDENTIAL_DATA_NDR_set_ctr,
    1480             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CREDENTIAL_DATA_CTR")
    1481             :         },
    1482             :         { .name = NULL }
    1483             : };
    1484             : 
    1485          25 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1486             : {
    1487          25 :         return pytalloc_new(struct PAC_CREDENTIAL_DATA_NDR, type);
    1488             : }
    1489             : 
    1490           0 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1491             : {
    1492           0 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(py_obj);
    1493           0 :         PyObject *ret = NULL;
    1494           0 :         DATA_BLOB blob;
    1495           0 :         enum ndr_err_code err;
    1496           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1497           0 :         if (tmp_ctx == NULL) {
    1498           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1499           0 :                 return NULL;
    1500             :         }
    1501           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_DATA_NDR);
    1502           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1503           0 :                 TALLOC_FREE(tmp_ctx);
    1504           0 :                 PyErr_SetNdrError(err);
    1505           0 :                 return NULL;
    1506             :         }
    1507             : 
    1508           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1509           0 :         TALLOC_FREE(tmp_ctx);
    1510           0 :         return ret;
    1511             : }
    1512             : 
    1513          25 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1514             : {
    1515          25 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(py_obj);
    1516          25 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1517          25 :         Py_ssize_t blob_length = 0;
    1518           0 :         enum ndr_err_code err;
    1519          25 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1520          25 :         PyObject *allow_remaining_obj = NULL;
    1521          25 :         bool allow_remaining = false;
    1522             : 
    1523          25 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1524             :                 discard_const_p(char *, kwnames),
    1525             :                 &blob.data, &blob_length,
    1526             :                 &allow_remaining_obj)) {
    1527           0 :                 return NULL;
    1528             :         }
    1529          25 :         blob.length = blob_length;
    1530             : 
    1531          25 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1532           0 :                 allow_remaining = true;
    1533             :         }
    1534             : 
    1535          25 :         if (allow_remaining) {
    1536           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA_NDR);
    1537             :         } else {
    1538          25 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA_NDR);
    1539             :         }
    1540          25 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1541           0 :                 PyErr_SetNdrError(err);
    1542           0 :                 return NULL;
    1543             :         }
    1544             : 
    1545          25 :         Py_RETURN_NONE;
    1546             : }
    1547             : 
    1548           0 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1549             : {
    1550           0 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(py_obj);
    1551           0 :         PyObject *ret;
    1552           0 :         char *retstr;
    1553             : 
    1554           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_DATA_NDR, "PAC_CREDENTIAL_DATA_NDR", object);
    1555           0 :         ret = PyUnicode_FromString(retstr);
    1556           0 :         talloc_free(retstr);
    1557             : 
    1558           0 :         return ret;
    1559             : }
    1560             : 
    1561             : static PyMethodDef py_PAC_CREDENTIAL_DATA_NDR_methods[] = {
    1562             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_DATA_NDR_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1563             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_DATA_NDR_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1564             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_DATA_NDR_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1565             :         { NULL, NULL, 0, NULL }
    1566             : };
    1567             : 
    1568             : 
    1569             : static PyTypeObject PAC_CREDENTIAL_DATA_NDR_Type = {
    1570             :         PyVarObject_HEAD_INIT(NULL, 0)
    1571             :         .tp_name = "krb5pac.PAC_CREDENTIAL_DATA_NDR",
    1572             :         .tp_getset = py_PAC_CREDENTIAL_DATA_NDR_getsetters,
    1573             :         .tp_methods = py_PAC_CREDENTIAL_DATA_NDR_methods,
    1574             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1575             :         .tp_new = py_PAC_CREDENTIAL_DATA_NDR_new,
    1576             : };
    1577             : 
    1578             : 
    1579          25 : static PyObject *py_PAC_CREDENTIAL_INFO_get_version(PyObject *obj, void *closure)
    1580             : {
    1581          25 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(obj);
    1582           0 :         PyObject *py_version;
    1583          25 :         py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
    1584          25 :         return py_version;
    1585             : }
    1586             : 
    1587           0 : static int py_PAC_CREDENTIAL_INFO_set_version(PyObject *py_obj, PyObject *value, void *closure)
    1588             : {
    1589           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1590           0 :         if (value == NULL) {
    1591           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
    1592           0 :                 return -1;
    1593             :         }
    1594             :         {
    1595           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
    1596           0 :                 if (PyLong_Check(value)) {
    1597           0 :                         unsigned long long test_var;
    1598           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1599           0 :                         if (PyErr_Occurred() != NULL) {
    1600           0 :                                 return -1;
    1601             :                         }
    1602           0 :                         if (test_var > uint_max) {
    1603           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1604             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1605           0 :                                 return -1;
    1606             :                         }
    1607           0 :                         object->version = test_var;
    1608             :                 } else {
    1609           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1610             :                           PyLong_Type.tp_name);
    1611           0 :                         return -1;
    1612             :                 }
    1613             :         }
    1614           0 :         return 0;
    1615             : }
    1616             : 
    1617          25 : static PyObject *py_PAC_CREDENTIAL_INFO_get_encryption_type(PyObject *obj, void *closure)
    1618             : {
    1619          25 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(obj);
    1620           0 :         PyObject *py_encryption_type;
    1621          25 :         py_encryption_type = PyLong_FromUnsignedLongLong((uint32_t)object->encryption_type);
    1622          25 :         return py_encryption_type;
    1623             : }
    1624             : 
    1625           0 : static int py_PAC_CREDENTIAL_INFO_set_encryption_type(PyObject *py_obj, PyObject *value, void *closure)
    1626             : {
    1627           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1628           0 :         if (value == NULL) {
    1629           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->encryption_type");
    1630           0 :                 return -1;
    1631             :         }
    1632             :         {
    1633           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->encryption_type));
    1634           0 :                 if (PyLong_Check(value)) {
    1635           0 :                         unsigned long long test_var;
    1636           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1637           0 :                         if (PyErr_Occurred() != NULL) {
    1638           0 :                                 return -1;
    1639             :                         }
    1640           0 :                         if (test_var > uint_max) {
    1641           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1642             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1643           0 :                                 return -1;
    1644             :                         }
    1645           0 :                         object->encryption_type = test_var;
    1646             :                 } else {
    1647           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1648             :                           PyLong_Type.tp_name);
    1649           0 :                         return -1;
    1650             :                 }
    1651             :         }
    1652           0 :         return 0;
    1653             : }
    1654             : 
    1655          25 : static PyObject *py_PAC_CREDENTIAL_INFO_get_encrypted_data(PyObject *obj, void *closure)
    1656             : {
    1657          25 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(obj);
    1658           0 :         PyObject *py_encrypted_data;
    1659          25 :         py_encrypted_data = PyBytes_FromStringAndSize((char *)(object->encrypted_data).data, (object->encrypted_data).length);
    1660          25 :         return py_encrypted_data;
    1661             : }
    1662             : 
    1663           0 : static int py_PAC_CREDENTIAL_INFO_set_encrypted_data(PyObject *py_obj, PyObject *value, void *closure)
    1664             : {
    1665           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1666           0 :         if (value == NULL) {
    1667           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->encrypted_data");
    1668           0 :                 return -1;
    1669             :         }
    1670           0 :         object->encrypted_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    1671           0 :         return 0;
    1672             : }
    1673             : 
    1674             : static PyGetSetDef py_PAC_CREDENTIAL_INFO_getsetters[] = {
    1675             :         {
    1676             :                 .name = discard_const_p(char, "version"),
    1677             :                 .get = py_PAC_CREDENTIAL_INFO_get_version,
    1678             :                 .set = py_PAC_CREDENTIAL_INFO_set_version,
    1679             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1680             :         },
    1681             :         {
    1682             :                 .name = discard_const_p(char, "encryption_type"),
    1683             :                 .get = py_PAC_CREDENTIAL_INFO_get_encryption_type,
    1684             :                 .set = py_PAC_CREDENTIAL_INFO_set_encryption_type,
    1685             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1686             :         },
    1687             :         {
    1688             :                 .name = discard_const_p(char, "encrypted_data"),
    1689             :                 .get = py_PAC_CREDENTIAL_INFO_get_encrypted_data,
    1690             :                 .set = py_PAC_CREDENTIAL_INFO_set_encrypted_data,
    1691             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    1692             :         },
    1693             :         { .name = NULL }
    1694             : };
    1695             : 
    1696           0 : static PyObject *py_PAC_CREDENTIAL_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1697             : {
    1698           0 :         return pytalloc_new(struct PAC_CREDENTIAL_INFO, type);
    1699             : }
    1700             : 
    1701           0 : static PyObject *py_PAC_CREDENTIAL_INFO_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1702             : {
    1703           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1704           0 :         PyObject *ret = NULL;
    1705           0 :         DATA_BLOB blob;
    1706           0 :         enum ndr_err_code err;
    1707           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1708           0 :         if (tmp_ctx == NULL) {
    1709           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1710           0 :                 return NULL;
    1711             :         }
    1712           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_INFO);
    1713           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1714           0 :                 TALLOC_FREE(tmp_ctx);
    1715           0 :                 PyErr_SetNdrError(err);
    1716           0 :                 return NULL;
    1717             :         }
    1718             : 
    1719           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1720           0 :         TALLOC_FREE(tmp_ctx);
    1721           0 :         return ret;
    1722             : }
    1723             : 
    1724           0 : static PyObject *py_PAC_CREDENTIAL_INFO_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1725             : {
    1726           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1727           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1728           0 :         Py_ssize_t blob_length = 0;
    1729           0 :         enum ndr_err_code err;
    1730           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1731           0 :         PyObject *allow_remaining_obj = NULL;
    1732           0 :         bool allow_remaining = false;
    1733             : 
    1734           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1735             :                 discard_const_p(char *, kwnames),
    1736             :                 &blob.data, &blob_length,
    1737             :                 &allow_remaining_obj)) {
    1738           0 :                 return NULL;
    1739             :         }
    1740           0 :         blob.length = blob_length;
    1741             : 
    1742           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1743           0 :                 allow_remaining = true;
    1744             :         }
    1745             : 
    1746           0 :         if (allow_remaining) {
    1747           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_INFO);
    1748             :         } else {
    1749           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_INFO);
    1750             :         }
    1751           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1752           0 :                 PyErr_SetNdrError(err);
    1753           0 :                 return NULL;
    1754             :         }
    1755             : 
    1756           0 :         Py_RETURN_NONE;
    1757             : }
    1758             : 
    1759           0 : static PyObject *py_PAC_CREDENTIAL_INFO_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1760             : {
    1761           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1762           0 :         PyObject *ret;
    1763           0 :         char *retstr;
    1764             : 
    1765           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_INFO, "PAC_CREDENTIAL_INFO", object);
    1766           0 :         ret = PyUnicode_FromString(retstr);
    1767           0 :         talloc_free(retstr);
    1768             : 
    1769           0 :         return ret;
    1770             : }
    1771             : 
    1772             : static PyMethodDef py_PAC_CREDENTIAL_INFO_methods[] = {
    1773             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_INFO_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1774             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_INFO_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1775             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_INFO_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1776             :         { NULL, NULL, 0, NULL }
    1777             : };
    1778             : 
    1779             : 
    1780             : static PyTypeObject PAC_CREDENTIAL_INFO_Type = {
    1781             :         PyVarObject_HEAD_INIT(NULL, 0)
    1782             :         .tp_name = "krb5pac.PAC_CREDENTIAL_INFO",
    1783             :         .tp_getset = py_PAC_CREDENTIAL_INFO_getsetters,
    1784             :         .tp_methods = py_PAC_CREDENTIAL_INFO_methods,
    1785             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1786             :         .tp_new = py_PAC_CREDENTIAL_INFO_new,
    1787             : };
    1788             : 
    1789             : 
    1790         141 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_get_proxy_target(PyObject *obj, void *closure)
    1791             : {
    1792         141 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(obj);
    1793           0 :         PyObject *py_proxy_target;
    1794         141 :         py_proxy_target = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->proxy_target);
    1795         141 :         return py_proxy_target;
    1796             : }
    1797             : 
    1798           4 : static int py_PAC_CONSTRAINED_DELEGATION_set_proxy_target(PyObject *py_obj, PyObject *value, void *closure)
    1799             : {
    1800           4 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(py_obj);
    1801           4 :         if (value == NULL) {
    1802           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->proxy_target");
    1803           0 :                 return -1;
    1804             :         }
    1805           4 :         PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
    1806           4 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1807           0 :                 PyErr_NoMemory();
    1808           0 :                 return -1;
    1809             :         }
    1810           4 :         object->proxy_target = *(struct lsa_String *)pytalloc_get_ptr(value);
    1811           4 :         return 0;
    1812             : }
    1813             : 
    1814           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_get_num_transited_services(PyObject *obj, void *closure)
    1815             : {
    1816           0 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(obj);
    1817           0 :         PyObject *py_num_transited_services;
    1818           0 :         py_num_transited_services = PyLong_FromUnsignedLongLong((uint32_t)object->num_transited_services);
    1819           0 :         return py_num_transited_services;
    1820             : }
    1821             : 
    1822           4 : static int py_PAC_CONSTRAINED_DELEGATION_set_num_transited_services(PyObject *py_obj, PyObject *value, void *closure)
    1823             : {
    1824           4 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(py_obj);
    1825           4 :         if (value == NULL) {
    1826           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_transited_services");
    1827           0 :                 return -1;
    1828             :         }
    1829             :         {
    1830           4 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_transited_services));
    1831           4 :                 if (PyLong_Check(value)) {
    1832           0 :                         unsigned long long test_var;
    1833           4 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1834           4 :                         if (PyErr_Occurred() != NULL) {
    1835           0 :                                 return -1;
    1836             :                         }
    1837           4 :                         if (test_var > uint_max) {
    1838           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1839             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1840           0 :                                 return -1;
    1841             :                         }
    1842           4 :                         object->num_transited_services = test_var;
    1843             :                 } else {
    1844           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1845             :                           PyLong_Type.tp_name);
    1846           0 :                         return -1;
    1847             :                 }
    1848             :         }
    1849           4 :         return 0;
    1850             : }
    1851             : 
    1852         141 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_get_transited_services(PyObject *obj, void *closure)
    1853             : {
    1854         141 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(obj);
    1855           0 :         PyObject *py_transited_services;
    1856         141 :         if (object->transited_services == NULL) {
    1857           0 :                 Py_RETURN_NONE;
    1858             :         }
    1859         141 :         if (object->transited_services == NULL) {
    1860           0 :                 py_transited_services = Py_None;
    1861           0 :                 Py_INCREF(py_transited_services);
    1862             :         } else {
    1863         141 :                 py_transited_services = PyList_New(object->num_transited_services);
    1864         141 :                 if (py_transited_services == NULL) {
    1865           0 :                         return NULL;
    1866             :                 }
    1867             :                 {
    1868             :                         int transited_services_cntr_1;
    1869         291 :                         for (transited_services_cntr_1 = 0; transited_services_cntr_1 < (object->num_transited_services); transited_services_cntr_1++) {
    1870           0 :                                 PyObject *py_transited_services_1;
    1871         150 :                                 py_transited_services_1 = pytalloc_reference_ex(lsa_String_Type, object->transited_services, &object->transited_services[transited_services_cntr_1]);
    1872         150 :                                 PyList_SetItem(py_transited_services, transited_services_cntr_1, py_transited_services_1);
    1873             :                         }
    1874             :                 }
    1875             :         }
    1876         141 :         return py_transited_services;
    1877             : }
    1878             : 
    1879           4 : static int py_PAC_CONSTRAINED_DELEGATION_set_transited_services(PyObject *py_obj, PyObject *value, void *closure)
    1880             : {
    1881           4 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(py_obj);
    1882           4 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->transited_services));
    1883           4 :         if (value == NULL) {
    1884           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->transited_services");
    1885           0 :                 return -1;
    1886             :         }
    1887           4 :         if (value == Py_None) {
    1888           0 :                 object->transited_services = NULL;
    1889             :         } else {
    1890           4 :                 object->transited_services = NULL;
    1891           4 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1892             :                 {
    1893           0 :                         int transited_services_cntr_1;
    1894           4 :                         object->transited_services = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->transited_services, PyList_GET_SIZE(value));
    1895           4 :                         if (!object->transited_services) { return -1; }
    1896           4 :                         talloc_set_name_const(object->transited_services, "ARRAY: object->transited_services");
    1897          16 :                         for (transited_services_cntr_1 = 0; transited_services_cntr_1 < PyList_GET_SIZE(value); transited_services_cntr_1++) {
    1898          12 :                                 if (PyList_GET_ITEM(value, transited_services_cntr_1) == NULL) {
    1899           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->transited_services[transited_services_cntr_1]");
    1900           0 :                                         return -1;
    1901             :                                 }
    1902          12 :                                 PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, transited_services_cntr_1), return -1;);
    1903          12 :                                 if (talloc_reference(object->transited_services, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, transited_services_cntr_1))) == NULL) {
    1904           0 :                                         PyErr_NoMemory();
    1905           0 :                                         return -1;
    1906             :                                 }
    1907          12 :                                 object->transited_services[transited_services_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, transited_services_cntr_1));
    1908             :                         }
    1909             :                 }
    1910             :         }
    1911           4 :         return 0;
    1912             : }
    1913             : 
    1914             : static PyGetSetDef py_PAC_CONSTRAINED_DELEGATION_getsetters[] = {
    1915             :         {
    1916             :                 .name = discard_const_p(char, "proxy_target"),
    1917             :                 .get = py_PAC_CONSTRAINED_DELEGATION_get_proxy_target,
    1918             :                 .set = py_PAC_CONSTRAINED_DELEGATION_set_proxy_target,
    1919             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
    1920             :         },
    1921             :         {
    1922             :                 .name = discard_const_p(char, "num_transited_services"),
    1923             :                 .get = py_PAC_CONSTRAINED_DELEGATION_get_num_transited_services,
    1924             :                 .set = py_PAC_CONSTRAINED_DELEGATION_set_num_transited_services,
    1925             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1926             :         },
    1927             :         {
    1928             :                 .name = discard_const_p(char, "transited_services"),
    1929             :                 .get = py_PAC_CONSTRAINED_DELEGATION_get_transited_services,
    1930             :                 .set = py_PAC_CONSTRAINED_DELEGATION_set_transited_services,
    1931             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
    1932             :         },
    1933             :         { .name = NULL }
    1934             : };
    1935             : 
    1936           4 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1937             : {
    1938           4 :         return pytalloc_new(struct PAC_CONSTRAINED_DELEGATION, type);
    1939             : }
    1940             : 
    1941             : 
    1942             : static PyTypeObject PAC_CONSTRAINED_DELEGATION_Type = {
    1943             :         PyVarObject_HEAD_INIT(NULL, 0)
    1944             :         .tp_name = "krb5pac.PAC_CONSTRAINED_DELEGATION",
    1945             :         .tp_getset = py_PAC_CONSTRAINED_DELEGATION_getsetters,
    1946             :         .tp_methods = NULL,
    1947             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1948             :         .tp_new = py_PAC_CONSTRAINED_DELEGATION_new,
    1949             : };
    1950             : 
    1951             : 
    1952           0 : static PyObject *py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_get_samaccountname_size(PyObject *obj, void *closure)
    1953             : {
    1954           0 :         struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *object = (struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(obj);
    1955           0 :         PyObject *py_samaccountname_size;
    1956           0 :         py_samaccountname_size = PyLong_FromLong((uint16_t)object->samaccountname_size);
    1957           0 :         return py_samaccountname_size;
    1958             : }
    1959             : 
    1960           0 : static int py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_set_samaccountname_size(PyObject *py_obj, PyObject *value, void *closure)
    1961             : {
    1962           0 :         struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *object = (struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(py_obj);
    1963           0 :         if (value == NULL) {
    1964           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->samaccountname_size");
    1965           0 :                 return -1;
    1966             :         }
    1967             :         {
    1968           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->samaccountname_size));
    1969           0 :                 if (PyLong_Check(value)) {
    1970           0 :                         unsigned long long test_var;
    1971           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1972           0 :                         if (PyErr_Occurred() != NULL) {
    1973           0 :                                 return -1;
    1974             :                         }
    1975           0 :                         if (test_var > uint_max) {
    1976           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    1977             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1978           0 :                                 return -1;
    1979             :                         }
    1980           0 :                         object->samaccountname_size = test_var;
    1981             :                 } else {
    1982           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    1983             :                           PyLong_Type.tp_name);
    1984           0 :                         return -1;
    1985             :                 }
    1986             :         }
    1987           0 :         return 0;
    1988             : }
    1989             : 
    1990         666 : static PyObject *py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_get_samaccountname(PyObject *obj, void *closure)
    1991             : {
    1992         666 :         struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *object = (struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(obj);
    1993           0 :         PyObject *py_samaccountname;
    1994         666 :         if (object->samaccountname == NULL) {
    1995           0 :                 Py_RETURN_NONE;
    1996             :         }
    1997         666 :         if (object->samaccountname == NULL) {
    1998           0 :                 py_samaccountname = Py_None;
    1999           0 :                 Py_INCREF(py_samaccountname);
    2000             :         } else {
    2001         666 :                 py_samaccountname = PyString_FromStringOrNULL(object->samaccountname);
    2002             :         }
    2003         666 :         return py_samaccountname;
    2004             : }
    2005             : 
    2006           0 : static int py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_set_samaccountname(PyObject *py_obj, PyObject *value, void *closure)
    2007             : {
    2008           0 :         struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *object = (struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(py_obj);
    2009           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->samaccountname));
    2010           0 :         if (value == NULL) {
    2011           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->samaccountname");
    2012           0 :                 return -1;
    2013             :         }
    2014           0 :         if (value == Py_None) {
    2015           0 :                 object->samaccountname = NULL;
    2016             :         } else {
    2017           0 :                 object->samaccountname = NULL;
    2018             :                 {
    2019           0 :                         const char *test_str;
    2020           0 :                         const char *talloc_str;
    2021           0 :                         PyObject *unicode = NULL;
    2022           0 :                         if (PyUnicode_Check(value)) {
    2023           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2024           0 :                                 if (unicode == NULL) {
    2025           0 :                                         PyErr_NoMemory();
    2026           0 :                                         return -1;
    2027             :                                 }
    2028           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2029           0 :                         } else if (PyBytes_Check(value)) {
    2030           0 :                                 test_str = PyBytes_AS_STRING(value);
    2031             :                         } else {
    2032           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2033           0 :                                 return -1;
    2034             :                         }
    2035           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2036           0 :                         if (unicode != NULL) {
    2037           0 :                                 Py_DECREF(unicode);
    2038             :                         }
    2039           0 :                         if (talloc_str == NULL) {
    2040           0 :                                 PyErr_NoMemory();
    2041           0 :                                 return -1;
    2042             :                         }
    2043           0 :                         object->samaccountname = talloc_str;
    2044             :                 }
    2045             :         }
    2046           0 :         return 0;
    2047             : }
    2048             : 
    2049           0 : static PyObject *py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_get_objectsid_size(PyObject *obj, void *closure)
    2050             : {
    2051           0 :         struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *object = (struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(obj);
    2052           0 :         PyObject *py_objectsid_size;
    2053           0 :         py_objectsid_size = PyLong_FromLong((uint16_t)object->objectsid_size);
    2054           0 :         return py_objectsid_size;
    2055             : }
    2056             : 
    2057           0 : static int py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_set_objectsid_size(PyObject *py_obj, PyObject *value, void *closure)
    2058             : {
    2059           0 :         struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *object = (struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(py_obj);
    2060           0 :         if (value == NULL) {
    2061           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->objectsid_size");
    2062           0 :                 return -1;
    2063             :         }
    2064             :         {
    2065           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->objectsid_size));
    2066           0 :                 if (PyLong_Check(value)) {
    2067           0 :                         unsigned long long test_var;
    2068           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2069           0 :                         if (PyErr_Occurred() != NULL) {
    2070           0 :                                 return -1;
    2071             :                         }
    2072           0 :                         if (test_var > uint_max) {
    2073           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2074             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2075           0 :                                 return -1;
    2076             :                         }
    2077           0 :                         object->objectsid_size = test_var;
    2078             :                 } else {
    2079           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2080             :                           PyLong_Type.tp_name);
    2081           0 :                         return -1;
    2082             :                 }
    2083             :         }
    2084           0 :         return 0;
    2085             : }
    2086             : 
    2087         445 : static PyObject *py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_get_objectsid(PyObject *obj, void *closure)
    2088             : {
    2089         445 :         struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *object = (struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(obj);
    2090           0 :         PyObject *py_objectsid;
    2091         445 :         if (object->objectsid == NULL) {
    2092           0 :                 Py_RETURN_NONE;
    2093             :         }
    2094         445 :         if (object->objectsid == NULL) {
    2095           0 :                 py_objectsid = Py_None;
    2096           0 :                 Py_INCREF(py_objectsid);
    2097             :         } else {
    2098         445 :                 py_objectsid = pytalloc_reference_ex(dom_sid_Type, object->objectsid, object->objectsid);
    2099             :         }
    2100         445 :         return py_objectsid;
    2101             : }
    2102             : 
    2103         142 : static int py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_set_objectsid(PyObject *py_obj, PyObject *value, void *closure)
    2104             : {
    2105         142 :         struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *object = (struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(py_obj);
    2106         142 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->objectsid));
    2107         142 :         if (value == NULL) {
    2108           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->objectsid");
    2109           0 :                 return -1;
    2110             :         }
    2111         142 :         if (value == Py_None) {
    2112           0 :                 object->objectsid = NULL;
    2113             :         } else {
    2114         142 :                 object->objectsid = NULL;
    2115         142 :                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    2116         142 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2117           0 :                         PyErr_NoMemory();
    2118           0 :                         return -1;
    2119             :                 }
    2120         142 :                 object->objectsid = (struct dom_sid *)pytalloc_get_ptr(value);
    2121             :         }
    2122         142 :         return 0;
    2123             : }
    2124             : 
    2125             : static PyGetSetDef py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_getsetters[] = {
    2126             :         {
    2127             :                 .name = discard_const_p(char, "samaccountname_size"),
    2128             :                 .get = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_get_samaccountname_size,
    2129             :                 .set = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_set_samaccountname_size,
    2130             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2131             :         },
    2132             :         {
    2133             :                 .name = discard_const_p(char, "samaccountname"),
    2134             :                 .get = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_get_samaccountname,
    2135             :                 .set = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_set_samaccountname,
    2136             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    2137             :         },
    2138             :         {
    2139             :                 .name = discard_const_p(char, "objectsid_size"),
    2140             :                 .get = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_get_objectsid_size,
    2141             :                 .set = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_set_objectsid_size,
    2142             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2143             :         },
    2144             :         {
    2145             :                 .name = discard_const_p(char, "objectsid"),
    2146             :                 .get = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_get_objectsid,
    2147             :                 .set = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_set_objectsid,
    2148             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    2149             :         },
    2150             :         { .name = NULL }
    2151             : };
    2152             : 
    2153           0 : static PyObject *py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2154             : {
    2155           0 :         return pytalloc_new(struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID, type);
    2156             : }
    2157             : 
    2158             : 
    2159             : static PyTypeObject PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type = {
    2160             :         PyVarObject_HEAD_INIT(NULL, 0)
    2161             :         .tp_name = "krb5pac.PAC_UPN_DNS_INFO_SAM_NAME_AND_SID",
    2162             :         .tp_getset = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_getsetters,
    2163             :         .tp_methods = NULL,
    2164             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2165             :         .tp_new = py_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_new,
    2166             : };
    2167             : 
    2168        8477 : static PyObject *py_import_PAC_UPN_DNS_INFO_EX(TALLOC_CTX *mem_ctx, int level, union PAC_UPN_DNS_INFO_EX *in)
    2169             : {
    2170           0 :         PyObject *ret;
    2171             : 
    2172        8477 :         switch (level) {
    2173        8477 :                 case PAC_UPN_DNS_FLAG_HAS_SAM_NAME_AND_SID:
    2174        8477 :                         ret = pytalloc_reference_ex(&PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type, mem_ctx, &in->sam_name_and_sid);
    2175        8477 :                         return ret;
    2176             : 
    2177           0 :                 default:
    2178           0 :                         ret = Py_None;
    2179           0 :                         Py_INCREF(ret);
    2180           0 :                         return ret;
    2181             : 
    2182             :         }
    2183             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    2184             :         return NULL;
    2185             : }
    2186             : 
    2187           0 : static union PAC_UPN_DNS_INFO_EX *py_export_PAC_UPN_DNS_INFO_EX(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    2188             : {
    2189           0 :         union PAC_UPN_DNS_INFO_EX *ret = talloc_zero(mem_ctx, union PAC_UPN_DNS_INFO_EX);
    2190           0 :         switch (level) {
    2191           0 :                 case PAC_UPN_DNS_FLAG_HAS_SAM_NAME_AND_SID:
    2192           0 :                         if (in == NULL) {
    2193           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sam_name_and_sid");
    2194           0 :                                 talloc_free(ret); return NULL;
    2195             :                         }
    2196           0 :                         PY_CHECK_TYPE(&PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type, in, talloc_free(ret); return NULL;);
    2197           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2198           0 :                                 PyErr_NoMemory();
    2199           0 :                                 talloc_free(ret); return NULL;
    2200             :                         }
    2201           0 :                         ret->sam_name_and_sid = *(struct PAC_UPN_DNS_INFO_SAM_NAME_AND_SID *)pytalloc_get_ptr(in);
    2202           0 :                         break;
    2203             : 
    2204           0 :                 default:
    2205           0 :                         break;
    2206             : 
    2207             :         }
    2208             : 
    2209           0 :         return ret;
    2210             : }
    2211             : 
    2212        8477 : static PyObject *py_PAC_UPN_DNS_INFO_EX_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2213             : {
    2214        8477 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2215        8477 :         PyObject *mem_ctx_obj = NULL;
    2216        8477 :         TALLOC_CTX *mem_ctx = NULL;
    2217        8477 :         int level = 0;
    2218        8477 :         PyObject *in_obj = NULL;
    2219        8477 :         union PAC_UPN_DNS_INFO_EX *in = NULL;
    2220             : 
    2221        8477 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    2222             :                 discard_const_p(char *, kwnames),
    2223             :                 &mem_ctx_obj,
    2224             :                 &level,
    2225             :                 &in_obj)) {
    2226           0 :                 return NULL;
    2227             :         }
    2228        8477 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2229        8477 :         if (mem_ctx == NULL) {
    2230           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2231           0 :                 return NULL;
    2232             :         }
    2233        8477 :         in = (union PAC_UPN_DNS_INFO_EX *)pytalloc_get_ptr(in_obj);
    2234        8477 :         if (in == NULL) {
    2235           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union PAC_UPN_DNS_INFO_EX!");
    2236           0 :                 return NULL;
    2237             :         }
    2238             : 
    2239        8477 :         return py_import_PAC_UPN_DNS_INFO_EX(mem_ctx, level, in);
    2240             : }
    2241             : 
    2242           0 : static PyObject *py_PAC_UPN_DNS_INFO_EX_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2243             : {
    2244           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2245           0 :         PyObject *mem_ctx_obj = NULL;
    2246           0 :         TALLOC_CTX *mem_ctx = NULL;
    2247           0 :         int level = 0;
    2248           0 :         PyObject *in = NULL;
    2249           0 :         union PAC_UPN_DNS_INFO_EX *out = NULL;
    2250             : 
    2251           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    2252             :                 discard_const_p(char *, kwnames),
    2253             :                 &mem_ctx_obj,
    2254             :                 &level,
    2255             :                 &in)) {
    2256           0 :                 return NULL;
    2257             :         }
    2258           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2259           0 :         if (mem_ctx == NULL) {
    2260           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2261           0 :                 return NULL;
    2262             :         }
    2263             : 
    2264           0 :         out = py_export_PAC_UPN_DNS_INFO_EX(mem_ctx, level, in);
    2265           0 :         if (out == NULL) {
    2266           0 :                 return NULL;
    2267             :         }
    2268             : 
    2269           0 :         return pytalloc_GenericObject_reference(out);
    2270             : }
    2271             : 
    2272             : static PyMethodDef py_PAC_UPN_DNS_INFO_EX_methods[] = {
    2273             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_UPN_DNS_INFO_EX_import),
    2274             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2275             :                 "T.__import__(mem_ctx, level, in) => ret." },
    2276             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_UPN_DNS_INFO_EX_export),
    2277             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2278             :                 "T.__export__(mem_ctx, level, in) => ret." },
    2279             :         { NULL, NULL, 0, NULL }
    2280             : };
    2281             : 
    2282           0 : static PyObject *py_PAC_UPN_DNS_INFO_EX_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2283             : {
    2284           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    2285           0 :         return NULL;
    2286             : }
    2287             : 
    2288             : 
    2289             : static PyTypeObject PAC_UPN_DNS_INFO_EX_Type = {
    2290             :         PyVarObject_HEAD_INIT(NULL, 0)
    2291             :         .tp_name = "krb5pac.PAC_UPN_DNS_INFO_EX",
    2292             :         .tp_getset = NULL,
    2293             :         .tp_methods = py_PAC_UPN_DNS_INFO_EX_methods,
    2294             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2295             :         .tp_new = py_PAC_UPN_DNS_INFO_EX_new,
    2296             : };
    2297             : 
    2298             : 
    2299           0 : static PyObject *py_PAC_UPN_DNS_INFO_get_upn_name_size(PyObject *obj, void *closure)
    2300             : {
    2301           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2302           0 :         PyObject *py_upn_name_size;
    2303           0 :         py_upn_name_size = PyLong_FromLong((uint16_t)object->upn_name_size);
    2304           0 :         return py_upn_name_size;
    2305             : }
    2306             : 
    2307           0 : static int py_PAC_UPN_DNS_INFO_set_upn_name_size(PyObject *py_obj, PyObject *value, void *closure)
    2308             : {
    2309           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2310           0 :         if (value == NULL) {
    2311           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->upn_name_size");
    2312           0 :                 return -1;
    2313             :         }
    2314             :         {
    2315           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->upn_name_size));
    2316           0 :                 if (PyLong_Check(value)) {
    2317           0 :                         unsigned long long test_var;
    2318           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2319           0 :                         if (PyErr_Occurred() != NULL) {
    2320           0 :                                 return -1;
    2321             :                         }
    2322           0 :                         if (test_var > uint_max) {
    2323           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2324             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2325           0 :                                 return -1;
    2326             :                         }
    2327           0 :                         object->upn_name_size = test_var;
    2328             :                 } else {
    2329           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2330             :                           PyLong_Type.tp_name);
    2331           0 :                         return -1;
    2332             :                 }
    2333             :         }
    2334           0 :         return 0;
    2335             : }
    2336             : 
    2337          31 : static PyObject *py_PAC_UPN_DNS_INFO_get_upn_name(PyObject *obj, void *closure)
    2338             : {
    2339          31 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2340           0 :         PyObject *py_upn_name;
    2341          31 :         if (object->upn_name == NULL) {
    2342           0 :                 Py_RETURN_NONE;
    2343             :         }
    2344          31 :         if (object->upn_name == NULL) {
    2345           0 :                 py_upn_name = Py_None;
    2346           0 :                 Py_INCREF(py_upn_name);
    2347             :         } else {
    2348          31 :                 py_upn_name = PyString_FromStringOrNULL(object->upn_name);
    2349             :         }
    2350          31 :         return py_upn_name;
    2351             : }
    2352             : 
    2353           0 : static int py_PAC_UPN_DNS_INFO_set_upn_name(PyObject *py_obj, PyObject *value, void *closure)
    2354             : {
    2355           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2356           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->upn_name));
    2357           0 :         if (value == NULL) {
    2358           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->upn_name");
    2359           0 :                 return -1;
    2360             :         }
    2361           0 :         if (value == Py_None) {
    2362           0 :                 object->upn_name = NULL;
    2363             :         } else {
    2364           0 :                 object->upn_name = NULL;
    2365             :                 {
    2366           0 :                         const char *test_str;
    2367           0 :                         const char *talloc_str;
    2368           0 :                         PyObject *unicode = NULL;
    2369           0 :                         if (PyUnicode_Check(value)) {
    2370           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2371           0 :                                 if (unicode == NULL) {
    2372           0 :                                         PyErr_NoMemory();
    2373           0 :                                         return -1;
    2374             :                                 }
    2375           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2376           0 :                         } else if (PyBytes_Check(value)) {
    2377           0 :                                 test_str = PyBytes_AS_STRING(value);
    2378             :                         } else {
    2379           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2380           0 :                                 return -1;
    2381             :                         }
    2382           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2383           0 :                         if (unicode != NULL) {
    2384           0 :                                 Py_DECREF(unicode);
    2385             :                         }
    2386           0 :                         if (talloc_str == NULL) {
    2387           0 :                                 PyErr_NoMemory();
    2388           0 :                                 return -1;
    2389             :                         }
    2390           0 :                         object->upn_name = talloc_str;
    2391             :                 }
    2392             :         }
    2393           0 :         return 0;
    2394             : }
    2395             : 
    2396           0 : static PyObject *py_PAC_UPN_DNS_INFO_get_dns_domain_name_size(PyObject *obj, void *closure)
    2397             : {
    2398           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2399           0 :         PyObject *py_dns_domain_name_size;
    2400           0 :         py_dns_domain_name_size = PyLong_FromLong((uint16_t)object->dns_domain_name_size);
    2401           0 :         return py_dns_domain_name_size;
    2402             : }
    2403             : 
    2404           0 : static int py_PAC_UPN_DNS_INFO_set_dns_domain_name_size(PyObject *py_obj, PyObject *value, void *closure)
    2405             : {
    2406           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2407           0 :         if (value == NULL) {
    2408           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_name_size");
    2409           0 :                 return -1;
    2410             :         }
    2411             :         {
    2412           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dns_domain_name_size));
    2413           0 :                 if (PyLong_Check(value)) {
    2414           0 :                         unsigned long long test_var;
    2415           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2416           0 :                         if (PyErr_Occurred() != NULL) {
    2417           0 :                                 return -1;
    2418             :                         }
    2419           0 :                         if (test_var > uint_max) {
    2420           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2421             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2422           0 :                                 return -1;
    2423             :                         }
    2424           0 :                         object->dns_domain_name_size = test_var;
    2425             :                 } else {
    2426           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2427             :                           PyLong_Type.tp_name);
    2428           0 :                         return -1;
    2429             :                 }
    2430             :         }
    2431           0 :         return 0;
    2432             : }
    2433             : 
    2434        7993 : static PyObject *py_PAC_UPN_DNS_INFO_get_dns_domain_name(PyObject *obj, void *closure)
    2435             : {
    2436        7993 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2437           0 :         PyObject *py_dns_domain_name;
    2438        7993 :         if (object->dns_domain_name == NULL) {
    2439           0 :                 Py_RETURN_NONE;
    2440             :         }
    2441        7993 :         if (object->dns_domain_name == NULL) {
    2442           0 :                 py_dns_domain_name = Py_None;
    2443           0 :                 Py_INCREF(py_dns_domain_name);
    2444             :         } else {
    2445        7993 :                 py_dns_domain_name = PyString_FromStringOrNULL(object->dns_domain_name);
    2446             :         }
    2447        7993 :         return py_dns_domain_name;
    2448             : }
    2449             : 
    2450           0 : static int py_PAC_UPN_DNS_INFO_set_dns_domain_name(PyObject *py_obj, PyObject *value, void *closure)
    2451             : {
    2452           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2453           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dns_domain_name));
    2454           0 :         if (value == NULL) {
    2455           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_name");
    2456           0 :                 return -1;
    2457             :         }
    2458           0 :         if (value == Py_None) {
    2459           0 :                 object->dns_domain_name = NULL;
    2460             :         } else {
    2461           0 :                 object->dns_domain_name = NULL;
    2462             :                 {
    2463           0 :                         const char *test_str;
    2464           0 :                         const char *talloc_str;
    2465           0 :                         PyObject *unicode = NULL;
    2466           0 :                         if (PyUnicode_Check(value)) {
    2467           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2468           0 :                                 if (unicode == NULL) {
    2469           0 :                                         PyErr_NoMemory();
    2470           0 :                                         return -1;
    2471             :                                 }
    2472           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2473           0 :                         } else if (PyBytes_Check(value)) {
    2474           0 :                                 test_str = PyBytes_AS_STRING(value);
    2475             :                         } else {
    2476           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2477           0 :                                 return -1;
    2478             :                         }
    2479           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2480           0 :                         if (unicode != NULL) {
    2481           0 :                                 Py_DECREF(unicode);
    2482             :                         }
    2483           0 :                         if (talloc_str == NULL) {
    2484           0 :                                 PyErr_NoMemory();
    2485           0 :                                 return -1;
    2486             :                         }
    2487           0 :                         object->dns_domain_name = talloc_str;
    2488             :                 }
    2489             :         }
    2490           0 :         return 0;
    2491             : }
    2492             : 
    2493           0 : static PyObject *py_PAC_UPN_DNS_INFO_get_flags(PyObject *obj, void *closure)
    2494             : {
    2495           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2496           0 :         PyObject *py_flags;
    2497           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
    2498           0 :         return py_flags;
    2499             : }
    2500             : 
    2501           0 : static int py_PAC_UPN_DNS_INFO_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    2502             : {
    2503           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2504           0 :         if (value == NULL) {
    2505           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
    2506           0 :                 return -1;
    2507             :         }
    2508             :         {
    2509           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
    2510           0 :                 if (PyLong_Check(value)) {
    2511           0 :                         unsigned long long test_var;
    2512           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2513           0 :                         if (PyErr_Occurred() != NULL) {
    2514           0 :                                 return -1;
    2515             :                         }
    2516           0 :                         if (test_var > uint_max) {
    2517           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2518             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2519           0 :                                 return -1;
    2520             :                         }
    2521           0 :                         object->flags = test_var;
    2522             :                 } else {
    2523           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2524             :                           PyLong_Type.tp_name);
    2525           0 :                         return -1;
    2526             :                 }
    2527             :         }
    2528           0 :         return 0;
    2529             : }
    2530             : 
    2531        8477 : static PyObject *py_PAC_UPN_DNS_INFO_get_ex(PyObject *obj, void *closure)
    2532             : {
    2533        8477 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2534           0 :         PyObject *py_ex;
    2535        8477 :         py_ex = pyrpc_import_union(&PAC_UPN_DNS_INFO_EX_Type, pytalloc_get_mem_ctx(obj), object->flags & PAC_UPN_DNS_FLAG_HAS_SAM_NAME_AND_SID, &object->ex, "union PAC_UPN_DNS_INFO_EX");
    2536        8477 :         if (py_ex == NULL) {
    2537           0 :                 return NULL;
    2538             :         }
    2539        8477 :         return py_ex;
    2540             : }
    2541             : 
    2542           0 : static int py_PAC_UPN_DNS_INFO_set_ex(PyObject *py_obj, PyObject *value, void *closure)
    2543             : {
    2544           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2545           0 :         if (value == NULL) {
    2546           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ex");
    2547           0 :                 return -1;
    2548             :         }
    2549             :         {
    2550           0 :                 union PAC_UPN_DNS_INFO_EX *ex_switch_0;
    2551           0 :                 ex_switch_0 = (union PAC_UPN_DNS_INFO_EX *)pyrpc_export_union(&PAC_UPN_DNS_INFO_EX_Type, pytalloc_get_mem_ctx(py_obj), object->flags & PAC_UPN_DNS_FLAG_HAS_SAM_NAME_AND_SID, value, "union PAC_UPN_DNS_INFO_EX");
    2552           0 :                 if (ex_switch_0 == NULL) {
    2553           0 :                         return -1;
    2554             :                 }
    2555           0 :                 object->ex = *ex_switch_0;
    2556             :         }
    2557           0 :         return 0;
    2558             : }
    2559             : 
    2560             : static PyGetSetDef py_PAC_UPN_DNS_INFO_getsetters[] = {
    2561             :         {
    2562             :                 .name = discard_const_p(char, "upn_name_size"),
    2563             :                 .get = py_PAC_UPN_DNS_INFO_get_upn_name_size,
    2564             :                 .set = py_PAC_UPN_DNS_INFO_set_upn_name_size,
    2565             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2566             :         },
    2567             :         {
    2568             :                 .name = discard_const_p(char, "upn_name"),
    2569             :                 .get = py_PAC_UPN_DNS_INFO_get_upn_name,
    2570             :                 .set = py_PAC_UPN_DNS_INFO_set_upn_name,
    2571             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    2572             :         },
    2573             :         {
    2574             :                 .name = discard_const_p(char, "dns_domain_name_size"),
    2575             :                 .get = py_PAC_UPN_DNS_INFO_get_dns_domain_name_size,
    2576             :                 .set = py_PAC_UPN_DNS_INFO_set_dns_domain_name_size,
    2577             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2578             :         },
    2579             :         {
    2580             :                 .name = discard_const_p(char, "dns_domain_name"),
    2581             :                 .get = py_PAC_UPN_DNS_INFO_get_dns_domain_name,
    2582             :                 .set = py_PAC_UPN_DNS_INFO_set_dns_domain_name,
    2583             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    2584             :         },
    2585             :         {
    2586             :                 .name = discard_const_p(char, "flags"),
    2587             :                 .get = py_PAC_UPN_DNS_INFO_get_flags,
    2588             :                 .set = py_PAC_UPN_DNS_INFO_set_flags,
    2589             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_UPN_DNS_FLAGS")
    2590             :         },
    2591             :         {
    2592             :                 .name = discard_const_p(char, "ex"),
    2593             :                 .get = py_PAC_UPN_DNS_INFO_get_ex,
    2594             :                 .set = py_PAC_UPN_DNS_INFO_set_ex,
    2595             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_UPN_DNS_INFO_EX")
    2596             :         },
    2597             :         { .name = NULL }
    2598             : };
    2599             : 
    2600           0 : static PyObject *py_PAC_UPN_DNS_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2601             : {
    2602           0 :         return pytalloc_new(struct PAC_UPN_DNS_INFO, type);
    2603             : }
    2604             : 
    2605             : 
    2606             : static PyTypeObject PAC_UPN_DNS_INFO_Type = {
    2607             :         PyVarObject_HEAD_INIT(NULL, 0)
    2608             :         .tp_name = "krb5pac.PAC_UPN_DNS_INFO",
    2609             :         .tp_getset = py_PAC_UPN_DNS_INFO_getsetters,
    2610             :         .tp_methods = NULL,
    2611             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2612             :         .tp_new = py_PAC_UPN_DNS_INFO_new,
    2613             : };
    2614             : 
    2615             : 
    2616         807 : static PyObject *py_PAC_ATTRIBUTES_INFO_get_flags_length(PyObject *obj, void *closure)
    2617             : {
    2618         807 :         struct PAC_ATTRIBUTES_INFO *object = (struct PAC_ATTRIBUTES_INFO *)pytalloc_get_ptr(obj);
    2619           0 :         PyObject *py_flags_length;
    2620         807 :         py_flags_length = PyLong_FromUnsignedLongLong((uint32_t)object->flags_length);
    2621         807 :         return py_flags_length;
    2622             : }
    2623             : 
    2624           0 : static int py_PAC_ATTRIBUTES_INFO_set_flags_length(PyObject *py_obj, PyObject *value, void *closure)
    2625             : {
    2626           0 :         struct PAC_ATTRIBUTES_INFO *object = (struct PAC_ATTRIBUTES_INFO *)pytalloc_get_ptr(py_obj);
    2627           0 :         if (value == NULL) {
    2628           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags_length");
    2629           0 :                 return -1;
    2630             :         }
    2631             :         {
    2632           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags_length));
    2633           0 :                 if (PyLong_Check(value)) {
    2634           0 :                         unsigned long long test_var;
    2635           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2636           0 :                         if (PyErr_Occurred() != NULL) {
    2637           0 :                                 return -1;
    2638             :                         }
    2639           0 :                         if (test_var > uint_max) {
    2640           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2641             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2642           0 :                                 return -1;
    2643             :                         }
    2644           0 :                         object->flags_length = test_var;
    2645             :                 } else {
    2646           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2647             :                           PyLong_Type.tp_name);
    2648           0 :                         return -1;
    2649             :                 }
    2650             :         }
    2651           0 :         return 0;
    2652             : }
    2653             : 
    2654         807 : static PyObject *py_PAC_ATTRIBUTES_INFO_get_flags(PyObject *obj, void *closure)
    2655             : {
    2656         807 :         struct PAC_ATTRIBUTES_INFO *object = (struct PAC_ATTRIBUTES_INFO *)pytalloc_get_ptr(obj);
    2657           0 :         PyObject *py_flags;
    2658         807 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
    2659         807 :         return py_flags;
    2660             : }
    2661             : 
    2662           0 : static int py_PAC_ATTRIBUTES_INFO_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    2663             : {
    2664           0 :         struct PAC_ATTRIBUTES_INFO *object = (struct PAC_ATTRIBUTES_INFO *)pytalloc_get_ptr(py_obj);
    2665           0 :         if (value == NULL) {
    2666           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
    2667           0 :                 return -1;
    2668             :         }
    2669             :         {
    2670           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
    2671           0 :                 if (PyLong_Check(value)) {
    2672           0 :                         unsigned long long test_var;
    2673           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2674           0 :                         if (PyErr_Occurred() != NULL) {
    2675           0 :                                 return -1;
    2676             :                         }
    2677           0 :                         if (test_var > uint_max) {
    2678           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    2679             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2680           0 :                                 return -1;
    2681             :                         }
    2682           0 :                         object->flags = test_var;
    2683             :                 } else {
    2684           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    2685             :                           PyLong_Type.tp_name);
    2686           0 :                         return -1;
    2687             :                 }
    2688             :         }
    2689           0 :         return 0;
    2690             : }
    2691             : 
    2692             : static PyGetSetDef py_PAC_ATTRIBUTES_INFO_getsetters[] = {
    2693             :         {
    2694             :                 .name = discard_const_p(char, "flags_length"),
    2695             :                 .get = py_PAC_ATTRIBUTES_INFO_get_flags_length,
    2696             :                 .set = py_PAC_ATTRIBUTES_INFO_set_flags_length,
    2697             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2698             :         },
    2699             :         {
    2700             :                 .name = discard_const_p(char, "flags"),
    2701             :                 .get = py_PAC_ATTRIBUTES_INFO_get_flags,
    2702             :                 .set = py_PAC_ATTRIBUTES_INFO_set_flags,
    2703             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_ATTRIBUTE_INFO_FLAGS")
    2704             :         },
    2705             :         { .name = NULL }
    2706             : };
    2707             : 
    2708           0 : static PyObject *py_PAC_ATTRIBUTES_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2709             : {
    2710           0 :         return pytalloc_new(struct PAC_ATTRIBUTES_INFO, type);
    2711             : }
    2712             : 
    2713             : 
    2714             : static PyTypeObject PAC_ATTRIBUTES_INFO_Type = {
    2715             :         PyVarObject_HEAD_INIT(NULL, 0)
    2716             :         .tp_name = "krb5pac.PAC_ATTRIBUTES_INFO",
    2717             :         .tp_getset = py_PAC_ATTRIBUTES_INFO_getsetters,
    2718             :         .tp_methods = NULL,
    2719             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2720             :         .tp_new = py_PAC_ATTRIBUTES_INFO_new,
    2721             : };
    2722             : 
    2723             : 
    2724         832 : static PyObject *py_PAC_REQUESTER_SID_get_sid(PyObject *obj, void *closure)
    2725             : {
    2726         832 :         struct PAC_REQUESTER_SID *object = (struct PAC_REQUESTER_SID *)pytalloc_get_ptr(obj);
    2727           0 :         PyObject *py_sid;
    2728         832 :         py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
    2729         832 :         return py_sid;
    2730             : }
    2731             : 
    2732          64 : static int py_PAC_REQUESTER_SID_set_sid(PyObject *py_obj, PyObject *value, void *closure)
    2733             : {
    2734          64 :         struct PAC_REQUESTER_SID *object = (struct PAC_REQUESTER_SID *)pytalloc_get_ptr(py_obj);
    2735          64 :         if (value == NULL) {
    2736           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
    2737           0 :                 return -1;
    2738             :         }
    2739          64 :         PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    2740          64 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2741           0 :                 PyErr_NoMemory();
    2742           0 :                 return -1;
    2743             :         }
    2744          64 :         object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
    2745          64 :         return 0;
    2746             : }
    2747             : 
    2748             : static PyGetSetDef py_PAC_REQUESTER_SID_getsetters[] = {
    2749             :         {
    2750             :                 .name = discard_const_p(char, "sid"),
    2751             :                 .get = py_PAC_REQUESTER_SID_get_sid,
    2752             :                 .set = py_PAC_REQUESTER_SID_set_sid,
    2753             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
    2754             :         },
    2755             :         { .name = NULL }
    2756             : };
    2757             : 
    2758           4 : static PyObject *py_PAC_REQUESTER_SID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2759             : {
    2760           4 :         return pytalloc_new(struct PAC_REQUESTER_SID, type);
    2761             : }
    2762             : 
    2763             : 
    2764             : static PyTypeObject PAC_REQUESTER_SID_Type = {
    2765             :         PyVarObject_HEAD_INIT(NULL, 0)
    2766             :         .tp_name = "krb5pac.PAC_REQUESTER_SID",
    2767             :         .tp_getset = py_PAC_REQUESTER_SID_getsetters,
    2768             :         .tp_methods = NULL,
    2769             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2770             :         .tp_new = py_PAC_REQUESTER_SID_new,
    2771             : };
    2772             : 
    2773             : 
    2774       24659 : static PyObject *py_PAC_LOGON_INFO_CTR_get_info(PyObject *obj, void *closure)
    2775             : {
    2776       24659 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(obj);
    2777           2 :         PyObject *py_info;
    2778       24659 :         if (object->info == NULL) {
    2779           0 :                 Py_RETURN_NONE;
    2780             :         }
    2781       24659 :         if (object->info == NULL) {
    2782           0 :                 py_info = Py_None;
    2783           0 :                 Py_INCREF(py_info);
    2784             :         } else {
    2785       24659 :                 py_info = pytalloc_reference_ex(&PAC_LOGON_INFO_Type, object->info, object->info);
    2786             :         }
    2787       24659 :         return py_info;
    2788             : }
    2789             : 
    2790           0 : static int py_PAC_LOGON_INFO_CTR_set_info(PyObject *py_obj, PyObject *value, void *closure)
    2791             : {
    2792           0 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(py_obj);
    2793           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    2794           0 :         if (value == NULL) {
    2795           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    2796           0 :                 return -1;
    2797             :         }
    2798           0 :         if (value == Py_None) {
    2799           0 :                 object->info = NULL;
    2800             :         } else {
    2801           0 :                 object->info = NULL;
    2802           0 :                 PY_CHECK_TYPE(&PAC_LOGON_INFO_Type, value, return -1;);
    2803           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2804           0 :                         PyErr_NoMemory();
    2805           0 :                         return -1;
    2806             :                 }
    2807           0 :                 object->info = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(value);
    2808             :         }
    2809           0 :         return 0;
    2810             : }
    2811             : 
    2812             : static PyGetSetDef py_PAC_LOGON_INFO_CTR_getsetters[] = {
    2813             :         {
    2814             :                 .name = discard_const_p(char, "info"),
    2815             :                 .get = py_PAC_LOGON_INFO_CTR_get_info,
    2816             :                 .set = py_PAC_LOGON_INFO_CTR_set_info,
    2817             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_LOGON_INFO")
    2818             :         },
    2819             :         { .name = NULL }
    2820             : };
    2821             : 
    2822           0 : static PyObject *py_PAC_LOGON_INFO_CTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2823             : {
    2824           0 :         return pytalloc_new(struct PAC_LOGON_INFO_CTR, type);
    2825             : }
    2826             : 
    2827           0 : static PyObject *py_PAC_LOGON_INFO_CTR_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2828             : {
    2829           0 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(py_obj);
    2830           0 :         PyObject *ret = NULL;
    2831           0 :         DATA_BLOB blob;
    2832           0 :         enum ndr_err_code err;
    2833           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2834           0 :         if (tmp_ctx == NULL) {
    2835           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2836           0 :                 return NULL;
    2837             :         }
    2838           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_LOGON_INFO_CTR);
    2839           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2840           0 :                 TALLOC_FREE(tmp_ctx);
    2841           0 :                 PyErr_SetNdrError(err);
    2842           0 :                 return NULL;
    2843             :         }
    2844             : 
    2845           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2846           0 :         TALLOC_FREE(tmp_ctx);
    2847           0 :         return ret;
    2848             : }
    2849             : 
    2850           0 : static PyObject *py_PAC_LOGON_INFO_CTR_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2851             : {
    2852           0 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(py_obj);
    2853           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2854           0 :         Py_ssize_t blob_length = 0;
    2855           0 :         enum ndr_err_code err;
    2856           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2857           0 :         PyObject *allow_remaining_obj = NULL;
    2858           0 :         bool allow_remaining = false;
    2859             : 
    2860           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2861             :                 discard_const_p(char *, kwnames),
    2862             :                 &blob.data, &blob_length,
    2863             :                 &allow_remaining_obj)) {
    2864           0 :                 return NULL;
    2865             :         }
    2866           0 :         blob.length = blob_length;
    2867             : 
    2868           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2869           0 :                 allow_remaining = true;
    2870             :         }
    2871             : 
    2872           0 :         if (allow_remaining) {
    2873           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_LOGON_INFO_CTR);
    2874             :         } else {
    2875           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_LOGON_INFO_CTR);
    2876             :         }
    2877           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2878           0 :                 PyErr_SetNdrError(err);
    2879           0 :                 return NULL;
    2880             :         }
    2881             : 
    2882           0 :         Py_RETURN_NONE;
    2883             : }
    2884             : 
    2885           0 : static PyObject *py_PAC_LOGON_INFO_CTR_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2886             : {
    2887           0 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(py_obj);
    2888           0 :         PyObject *ret;
    2889           0 :         char *retstr;
    2890             : 
    2891           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_LOGON_INFO_CTR, "PAC_LOGON_INFO_CTR", object);
    2892           0 :         ret = PyUnicode_FromString(retstr);
    2893           0 :         talloc_free(retstr);
    2894             : 
    2895           0 :         return ret;
    2896             : }
    2897             : 
    2898             : static PyMethodDef py_PAC_LOGON_INFO_CTR_methods[] = {
    2899             :         { "__ndr_pack__", (PyCFunction)py_PAC_LOGON_INFO_CTR_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2900             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_LOGON_INFO_CTR_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2901             :         { "__ndr_print__", (PyCFunction)py_PAC_LOGON_INFO_CTR_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2902             :         { NULL, NULL, 0, NULL }
    2903             : };
    2904             : 
    2905             : 
    2906             : static PyTypeObject PAC_LOGON_INFO_CTR_Type = {
    2907             :         PyVarObject_HEAD_INIT(NULL, 0)
    2908             :         .tp_name = "krb5pac.PAC_LOGON_INFO_CTR",
    2909             :         .tp_getset = py_PAC_LOGON_INFO_CTR_getsetters,
    2910             :         .tp_methods = py_PAC_LOGON_INFO_CTR_methods,
    2911             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2912             :         .tp_new = py_PAC_LOGON_INFO_CTR_new,
    2913             : };
    2914             : 
    2915             : 
    2916         141 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_get_info(PyObject *obj, void *closure)
    2917             : {
    2918         141 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(obj);
    2919           0 :         PyObject *py_info;
    2920         141 :         if (object->info == NULL) {
    2921           0 :                 Py_RETURN_NONE;
    2922             :         }
    2923         141 :         if (object->info == NULL) {
    2924           0 :                 py_info = Py_None;
    2925           0 :                 Py_INCREF(py_info);
    2926             :         } else {
    2927         141 :                 py_info = pytalloc_reference_ex(&PAC_CONSTRAINED_DELEGATION_Type, object->info, object->info);
    2928             :         }
    2929         141 :         return py_info;
    2930             : }
    2931             : 
    2932           4 : static int py_PAC_CONSTRAINED_DELEGATION_CTR_set_info(PyObject *py_obj, PyObject *value, void *closure)
    2933             : {
    2934           4 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(py_obj);
    2935           4 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    2936           4 :         if (value == NULL) {
    2937           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    2938           0 :                 return -1;
    2939             :         }
    2940           4 :         if (value == Py_None) {
    2941           0 :                 object->info = NULL;
    2942             :         } else {
    2943           4 :                 object->info = NULL;
    2944           4 :                 PY_CHECK_TYPE(&PAC_CONSTRAINED_DELEGATION_Type, value, return -1;);
    2945           4 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2946           0 :                         PyErr_NoMemory();
    2947           0 :                         return -1;
    2948             :                 }
    2949           4 :                 object->info = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(value);
    2950             :         }
    2951           4 :         return 0;
    2952             : }
    2953             : 
    2954             : static PyGetSetDef py_PAC_CONSTRAINED_DELEGATION_CTR_getsetters[] = {
    2955             :         {
    2956             :                 .name = discard_const_p(char, "info"),
    2957             :                 .get = py_PAC_CONSTRAINED_DELEGATION_CTR_get_info,
    2958             :                 .set = py_PAC_CONSTRAINED_DELEGATION_CTR_set_info,
    2959             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CONSTRAINED_DELEGATION")
    2960             :         },
    2961             :         { .name = NULL }
    2962             : };
    2963             : 
    2964           4 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2965             : {
    2966           4 :         return pytalloc_new(struct PAC_CONSTRAINED_DELEGATION_CTR, type);
    2967             : }
    2968             : 
    2969           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2970             : {
    2971           0 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(py_obj);
    2972           0 :         PyObject *ret = NULL;
    2973           0 :         DATA_BLOB blob;
    2974           0 :         enum ndr_err_code err;
    2975           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2976           0 :         if (tmp_ctx == NULL) {
    2977           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2978           0 :                 return NULL;
    2979             :         }
    2980           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CONSTRAINED_DELEGATION_CTR);
    2981           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2982           0 :                 TALLOC_FREE(tmp_ctx);
    2983           0 :                 PyErr_SetNdrError(err);
    2984           0 :                 return NULL;
    2985             :         }
    2986             : 
    2987           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2988           0 :         TALLOC_FREE(tmp_ctx);
    2989           0 :         return ret;
    2990             : }
    2991             : 
    2992           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2993             : {
    2994           0 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(py_obj);
    2995           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2996           0 :         Py_ssize_t blob_length = 0;
    2997           0 :         enum ndr_err_code err;
    2998           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2999           0 :         PyObject *allow_remaining_obj = NULL;
    3000           0 :         bool allow_remaining = false;
    3001             : 
    3002           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    3003             :                 discard_const_p(char *, kwnames),
    3004             :                 &blob.data, &blob_length,
    3005             :                 &allow_remaining_obj)) {
    3006           0 :                 return NULL;
    3007             :         }
    3008           0 :         blob.length = blob_length;
    3009             : 
    3010           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3011           0 :                 allow_remaining = true;
    3012             :         }
    3013             : 
    3014           0 :         if (allow_remaining) {
    3015           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CONSTRAINED_DELEGATION_CTR);
    3016             :         } else {
    3017           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CONSTRAINED_DELEGATION_CTR);
    3018             :         }
    3019           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3020           0 :                 PyErr_SetNdrError(err);
    3021           0 :                 return NULL;
    3022             :         }
    3023             : 
    3024           0 :         Py_RETURN_NONE;
    3025             : }
    3026             : 
    3027           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3028             : {
    3029           0 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(py_obj);
    3030           0 :         PyObject *ret;
    3031           0 :         char *retstr;
    3032             : 
    3033           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CONSTRAINED_DELEGATION_CTR, "PAC_CONSTRAINED_DELEGATION_CTR", object);
    3034           0 :         ret = PyUnicode_FromString(retstr);
    3035           0 :         talloc_free(retstr);
    3036             : 
    3037           0 :         return ret;
    3038             : }
    3039             : 
    3040             : static PyMethodDef py_PAC_CONSTRAINED_DELEGATION_CTR_methods[] = {
    3041             :         { "__ndr_pack__", (PyCFunction)py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    3042             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    3043             :         { "__ndr_print__", (PyCFunction)py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    3044             :         { NULL, NULL, 0, NULL }
    3045             : };
    3046             : 
    3047             : 
    3048             : static PyTypeObject PAC_CONSTRAINED_DELEGATION_CTR_Type = {
    3049             :         PyVarObject_HEAD_INIT(NULL, 0)
    3050             :         .tp_name = "krb5pac.PAC_CONSTRAINED_DELEGATION_CTR",
    3051             :         .tp_getset = py_PAC_CONSTRAINED_DELEGATION_CTR_getsetters,
    3052             :         .tp_methods = py_PAC_CONSTRAINED_DELEGATION_CTR_methods,
    3053             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3054             :         .tp_new = py_PAC_CONSTRAINED_DELEGATION_CTR_new,
    3055             : };
    3056             : 
    3057             : 
    3058          57 : static PyObject *py_PAC_DEVICE_INFO_get_rid(PyObject *obj, void *closure)
    3059             : {
    3060          57 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(obj);
    3061           0 :         PyObject *py_rid;
    3062          57 :         py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
    3063          57 :         return py_rid;
    3064             : }
    3065             : 
    3066          48 : static int py_PAC_DEVICE_INFO_set_rid(PyObject *py_obj, PyObject *value, void *closure)
    3067             : {
    3068          48 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(py_obj);
    3069          48 :         if (value == NULL) {
    3070           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
    3071           0 :                 return -1;
    3072             :         }
    3073             :         {
    3074          48 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
    3075          48 :                 if (PyLong_Check(value)) {
    3076           0 :                         unsigned long long test_var;
    3077          48 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3078          48 :                         if (PyErr_Occurred() != NULL) {
    3079           0 :                                 return -1;
    3080             :                         }
    3081          48 :                         if (test_var > uint_max) {
    3082           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3083             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3084           0 :                                 return -1;
    3085             :                         }
    3086          48 :                         object->rid = test_var;
    3087             :                 } else {
    3088           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3089             :                           PyLong_Type.tp_name);
    3090           0 :                         return -1;
    3091             :                 }
    3092             :         }
    3093          48 :         return 0;
    3094             : }
    3095             : 
    3096          57 : static PyObject *py_PAC_DEVICE_INFO_get_primary_gid(PyObject *obj, void *closure)
    3097             : {
    3098          57 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(obj);
    3099           0 :         PyObject *py_primary_gid;
    3100          57 :         py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid);
    3101          57 :         return py_primary_gid;
    3102             : }
    3103             : 
    3104          48 : static int py_PAC_DEVICE_INFO_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
    3105             : {
    3106          48 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(py_obj);
    3107          48 :         if (value == NULL) {
    3108           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
    3109           0 :                 return -1;
    3110             :         }
    3111             :         {
    3112          48 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
    3113          48 :                 if (PyLong_Check(value)) {
    3114           0 :                         unsigned long long test_var;
    3115          48 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3116          48 :                         if (PyErr_Occurred() != NULL) {
    3117           0 :                                 return -1;
    3118             :                         }
    3119          48 :                         if (test_var > uint_max) {
    3120           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3121             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3122           0 :                                 return -1;
    3123             :                         }
    3124          48 :                         object->primary_gid = test_var;
    3125             :                 } else {
    3126           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3127             :                           PyLong_Type.tp_name);
    3128           0 :                         return -1;
    3129             :                 }
    3130             :         }
    3131          48 :         return 0;
    3132             : }
    3133             : 
    3134          57 : static PyObject *py_PAC_DEVICE_INFO_get_domain_sid(PyObject *obj, void *closure)
    3135             : {
    3136          57 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(obj);
    3137           0 :         PyObject *py_domain_sid;
    3138          57 :         if (object->domain_sid == NULL) {
    3139           0 :                 Py_RETURN_NONE;
    3140             :         }
    3141          57 :         if (object->domain_sid == NULL) {
    3142           0 :                 py_domain_sid = Py_None;
    3143           0 :                 Py_INCREF(py_domain_sid);
    3144             :         } else {
    3145          57 :                 py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
    3146             :         }
    3147          57 :         return py_domain_sid;
    3148             : }
    3149             : 
    3150          48 : static int py_PAC_DEVICE_INFO_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
    3151             : {
    3152          48 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(py_obj);
    3153          48 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
    3154          48 :         if (value == NULL) {
    3155           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid");
    3156           0 :                 return -1;
    3157             :         }
    3158          48 :         if (value == Py_None) {
    3159           0 :                 object->domain_sid = NULL;
    3160             :         } else {
    3161          48 :                 object->domain_sid = NULL;
    3162          48 :                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
    3163          48 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3164           0 :                         PyErr_NoMemory();
    3165           0 :                         return -1;
    3166             :                 }
    3167          48 :                 object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
    3168             :         }
    3169          48 :         return 0;
    3170             : }
    3171             : 
    3172         267 : static PyObject *py_PAC_DEVICE_INFO_get_groups(PyObject *obj, void *closure)
    3173             : {
    3174         267 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(obj);
    3175           0 :         PyObject *py_groups;
    3176         267 :         py_groups = pytalloc_reference_ex(samr_RidWithAttributeArray_Type, pytalloc_get_mem_ctx(obj), &object->groups);
    3177         267 :         return py_groups;
    3178             : }
    3179             : 
    3180           0 : static int py_PAC_DEVICE_INFO_set_groups(PyObject *py_obj, PyObject *value, void *closure)
    3181             : {
    3182           0 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(py_obj);
    3183           0 :         if (value == NULL) {
    3184           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups");
    3185           0 :                 return -1;
    3186             :         }
    3187           0 :         PY_CHECK_TYPE(samr_RidWithAttributeArray_Type, value, return -1;);
    3188           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3189           0 :                 PyErr_NoMemory();
    3190           0 :                 return -1;
    3191             :         }
    3192           0 :         object->groups = *(struct samr_RidWithAttributeArray *)pytalloc_get_ptr(value);
    3193           0 :         return 0;
    3194             : }
    3195             : 
    3196           0 : static PyObject *py_PAC_DEVICE_INFO_get_sid_count(PyObject *obj, void *closure)
    3197             : {
    3198           0 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(obj);
    3199           0 :         PyObject *py_sid_count;
    3200           0 :         py_sid_count = PyLong_FromUnsignedLongLong((uint32_t)object->sid_count);
    3201           0 :         return py_sid_count;
    3202             : }
    3203             : 
    3204          48 : static int py_PAC_DEVICE_INFO_set_sid_count(PyObject *py_obj, PyObject *value, void *closure)
    3205             : {
    3206          48 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(py_obj);
    3207          48 :         if (value == NULL) {
    3208           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_count");
    3209           0 :                 return -1;
    3210             :         }
    3211             :         {
    3212          48 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_count));
    3213          48 :                 if (PyLong_Check(value)) {
    3214           0 :                         unsigned long long test_var;
    3215          48 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3216          48 :                         if (PyErr_Occurred() != NULL) {
    3217           0 :                                 return -1;
    3218             :                         }
    3219          48 :                         if (test_var > uint_max) {
    3220           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3221             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3222           0 :                                 return -1;
    3223             :                         }
    3224          48 :                         object->sid_count = test_var;
    3225             :                 } else {
    3226           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3227             :                           PyLong_Type.tp_name);
    3228           0 :                         return -1;
    3229             :                 }
    3230             :         }
    3231          48 :         return 0;
    3232             : }
    3233             : 
    3234         167 : static PyObject *py_PAC_DEVICE_INFO_get_sids(PyObject *obj, void *closure)
    3235             : {
    3236         167 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(obj);
    3237           0 :         PyObject *py_sids;
    3238         167 :         if (object->sids == NULL) {
    3239           2 :                 Py_RETURN_NONE;
    3240             :         }
    3241         165 :         if (object->sids == NULL) {
    3242           0 :                 py_sids = Py_None;
    3243           0 :                 Py_INCREF(py_sids);
    3244             :         } else {
    3245         165 :                 py_sids = PyList_New(object->sid_count);
    3246         165 :                 if (py_sids == NULL) {
    3247           0 :                         return NULL;
    3248             :                 }
    3249             :                 {
    3250             :                         int sids_cntr_1;
    3251         393 :                         for (sids_cntr_1 = 0; sids_cntr_1 < (object->sid_count); sids_cntr_1++) {
    3252           0 :                                 PyObject *py_sids_1;
    3253         228 :                                 py_sids_1 = pytalloc_reference_ex(netr_SidAttr_Type, object->sids, &object->sids[sids_cntr_1]);
    3254         228 :                                 PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
    3255             :                         }
    3256             :                 }
    3257             :         }
    3258         165 :         return py_sids;
    3259             : }
    3260             : 
    3261          48 : static int py_PAC_DEVICE_INFO_set_sids(PyObject *py_obj, PyObject *value, void *closure)
    3262             : {
    3263          48 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(py_obj);
    3264          48 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
    3265          48 :         if (value == NULL) {
    3266           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
    3267           0 :                 return -1;
    3268             :         }
    3269          48 :         if (value == Py_None) {
    3270           0 :                 object->sids = NULL;
    3271             :         } else {
    3272          48 :                 object->sids = NULL;
    3273          48 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    3274             :                 {
    3275           0 :                         int sids_cntr_1;
    3276          48 :                         object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
    3277          48 :                         if (!object->sids) { return -1; }
    3278          48 :                         talloc_set_name_const(object->sids, "ARRAY: object->sids");
    3279         144 :                         for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
    3280          96 :                                 if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
    3281           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
    3282           0 :                                         return -1;
    3283             :                                 }
    3284          96 :                                 PY_CHECK_TYPE(netr_SidAttr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
    3285          96 :                                 if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
    3286           0 :                                         PyErr_NoMemory();
    3287           0 :                                         return -1;
    3288             :                                 }
    3289          96 :                                 object->sids[sids_cntr_1] = *(struct netr_SidAttr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
    3290             :                         }
    3291             :                 }
    3292             :         }
    3293          48 :         return 0;
    3294             : }
    3295             : 
    3296           0 : static PyObject *py_PAC_DEVICE_INFO_get_domain_group_count(PyObject *obj, void *closure)
    3297             : {
    3298           0 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(obj);
    3299           0 :         PyObject *py_domain_group_count;
    3300           0 :         py_domain_group_count = PyLong_FromUnsignedLongLong((uint32_t)object->domain_group_count);
    3301           0 :         return py_domain_group_count;
    3302             : }
    3303             : 
    3304          48 : static int py_PAC_DEVICE_INFO_set_domain_group_count(PyObject *py_obj, PyObject *value, void *closure)
    3305             : {
    3306          48 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(py_obj);
    3307          48 :         if (value == NULL) {
    3308           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_group_count");
    3309           0 :                 return -1;
    3310             :         }
    3311             :         {
    3312          48 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_group_count));
    3313          48 :                 if (PyLong_Check(value)) {
    3314           0 :                         unsigned long long test_var;
    3315          48 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3316          48 :                         if (PyErr_Occurred() != NULL) {
    3317           0 :                                 return -1;
    3318             :                         }
    3319          48 :                         if (test_var > uint_max) {
    3320           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3321             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3322           0 :                                 return -1;
    3323             :                         }
    3324          48 :                         object->domain_group_count = test_var;
    3325             :                 } else {
    3326           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3327             :                           PyLong_Type.tp_name);
    3328           0 :                         return -1;
    3329             :                 }
    3330             :         }
    3331          48 :         return 0;
    3332             : }
    3333             : 
    3334         149 : static PyObject *py_PAC_DEVICE_INFO_get_domain_groups(PyObject *obj, void *closure)
    3335             : {
    3336         149 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(obj);
    3337           0 :         PyObject *py_domain_groups;
    3338         149 :         if (object->domain_groups == NULL) {
    3339          11 :                 Py_RETURN_NONE;
    3340             :         }
    3341         138 :         if (object->domain_groups == NULL) {
    3342           0 :                 py_domain_groups = Py_None;
    3343           0 :                 Py_INCREF(py_domain_groups);
    3344             :         } else {
    3345         138 :                 py_domain_groups = PyList_New(object->domain_group_count);
    3346         138 :                 if (py_domain_groups == NULL) {
    3347           0 :                         return NULL;
    3348             :                 }
    3349             :                 {
    3350             :                         int domain_groups_cntr_1;
    3351         336 :                         for (domain_groups_cntr_1 = 0; domain_groups_cntr_1 < (object->domain_group_count); domain_groups_cntr_1++) {
    3352           0 :                                 PyObject *py_domain_groups_1;
    3353         198 :                                 py_domain_groups_1 = pytalloc_reference_ex(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type, object->domain_groups, &object->domain_groups[domain_groups_cntr_1]);
    3354         198 :                                 PyList_SetItem(py_domain_groups, domain_groups_cntr_1, py_domain_groups_1);
    3355             :                         }
    3356             :                 }
    3357             :         }
    3358         138 :         return py_domain_groups;
    3359             : }
    3360             : 
    3361          48 : static int py_PAC_DEVICE_INFO_set_domain_groups(PyObject *py_obj, PyObject *value, void *closure)
    3362             : {
    3363          48 :         struct PAC_DEVICE_INFO *object = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(py_obj);
    3364          48 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_groups));
    3365          48 :         if (value == NULL) {
    3366           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_groups");
    3367           0 :                 return -1;
    3368             :         }
    3369          48 :         if (value == Py_None) {
    3370          48 :                 object->domain_groups = NULL;
    3371             :         } else {
    3372           0 :                 object->domain_groups = NULL;
    3373           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    3374             :                 {
    3375           0 :                         int domain_groups_cntr_1;
    3376           0 :                         object->domain_groups = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domain_groups, PyList_GET_SIZE(value));
    3377           0 :                         if (!object->domain_groups) { return -1; }
    3378           0 :                         talloc_set_name_const(object->domain_groups, "ARRAY: object->domain_groups");
    3379           0 :                         for (domain_groups_cntr_1 = 0; domain_groups_cntr_1 < PyList_GET_SIZE(value); domain_groups_cntr_1++) {
    3380           0 :                                 if (PyList_GET_ITEM(value, domain_groups_cntr_1) == NULL) {
    3381           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_groups[domain_groups_cntr_1]");
    3382           0 :                                         return -1;
    3383             :                                 }
    3384           0 :                                 PY_CHECK_TYPE(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type, PyList_GET_ITEM(value, domain_groups_cntr_1), return -1;);
    3385           0 :                                 if (talloc_reference(object->domain_groups, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domain_groups_cntr_1))) == NULL) {
    3386           0 :                                         PyErr_NoMemory();
    3387           0 :                                         return -1;
    3388             :                                 }
    3389           0 :                                 object->domain_groups[domain_groups_cntr_1] = *(struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(PyList_GET_ITEM(value, domain_groups_cntr_1));
    3390             :                         }
    3391             :                 }
    3392             :         }
    3393          48 :         return 0;
    3394             : }
    3395             : 
    3396             : static PyGetSetDef py_PAC_DEVICE_INFO_getsetters[] = {
    3397             :         {
    3398             :                 .name = discard_const_p(char, "rid"),
    3399             :                 .get = py_PAC_DEVICE_INFO_get_rid,
    3400             :                 .set = py_PAC_DEVICE_INFO_set_rid,
    3401             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3402             :         },
    3403             :         {
    3404             :                 .name = discard_const_p(char, "primary_gid"),
    3405             :                 .get = py_PAC_DEVICE_INFO_get_primary_gid,
    3406             :                 .set = py_PAC_DEVICE_INFO_set_primary_gid,
    3407             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3408             :         },
    3409             :         {
    3410             :                 .name = discard_const_p(char, "domain_sid"),
    3411             :                 .get = py_PAC_DEVICE_INFO_get_domain_sid,
    3412             :                 .set = py_PAC_DEVICE_INFO_set_domain_sid,
    3413             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
    3414             :         },
    3415             :         {
    3416             :                 .name = discard_const_p(char, "groups"),
    3417             :                 .get = py_PAC_DEVICE_INFO_get_groups,
    3418             :                 .set = py_PAC_DEVICE_INFO_set_groups,
    3419             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttributeArray")
    3420             :         },
    3421             :         {
    3422             :                 .name = discard_const_p(char, "sid_count"),
    3423             :                 .get = py_PAC_DEVICE_INFO_get_sid_count,
    3424             :                 .set = py_PAC_DEVICE_INFO_set_sid_count,
    3425             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3426             :         },
    3427             :         {
    3428             :                 .name = discard_const_p(char, "sids"),
    3429             :                 .get = py_PAC_DEVICE_INFO_get_sids,
    3430             :                 .set = py_PAC_DEVICE_INFO_set_sids,
    3431             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_SidAttr")
    3432             :         },
    3433             :         {
    3434             :                 .name = discard_const_p(char, "domain_group_count"),
    3435             :                 .get = py_PAC_DEVICE_INFO_get_domain_group_count,
    3436             :                 .set = py_PAC_DEVICE_INFO_set_domain_group_count,
    3437             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3438             :         },
    3439             :         {
    3440             :                 .name = discard_const_p(char, "domain_groups"),
    3441             :                 .get = py_PAC_DEVICE_INFO_get_domain_groups,
    3442             :                 .set = py_PAC_DEVICE_INFO_set_domain_groups,
    3443             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_DOMAIN_GROUP_MEMBERSHIP")
    3444             :         },
    3445             :         { .name = NULL }
    3446             : };
    3447             : 
    3448          48 : static PyObject *py_PAC_DEVICE_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3449             : {
    3450          48 :         return pytalloc_new(struct PAC_DEVICE_INFO, type);
    3451             : }
    3452             : 
    3453             : 
    3454             : static PyTypeObject PAC_DEVICE_INFO_Type = {
    3455             :         PyVarObject_HEAD_INIT(NULL, 0)
    3456             :         .tp_name = "krb5pac.PAC_DEVICE_INFO",
    3457             :         .tp_getset = py_PAC_DEVICE_INFO_getsetters,
    3458             :         .tp_methods = NULL,
    3459             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3460             :         .tp_new = py_PAC_DEVICE_INFO_new,
    3461             : };
    3462             : 
    3463             : 
    3464          57 : static PyObject *py_PAC_DEVICE_INFO_CTR_get_info(PyObject *obj, void *closure)
    3465             : {
    3466          57 :         struct PAC_DEVICE_INFO_CTR *object = (struct PAC_DEVICE_INFO_CTR *)pytalloc_get_ptr(obj);
    3467           0 :         PyObject *py_info;
    3468          57 :         if (object->info == NULL) {
    3469           0 :                 Py_RETURN_NONE;
    3470             :         }
    3471          57 :         if (object->info == NULL) {
    3472           0 :                 py_info = Py_None;
    3473           0 :                 Py_INCREF(py_info);
    3474             :         } else {
    3475          57 :                 py_info = pytalloc_reference_ex(&PAC_DEVICE_INFO_Type, object->info, object->info);
    3476             :         }
    3477          57 :         return py_info;
    3478             : }
    3479             : 
    3480          48 : static int py_PAC_DEVICE_INFO_CTR_set_info(PyObject *py_obj, PyObject *value, void *closure)
    3481             : {
    3482          48 :         struct PAC_DEVICE_INFO_CTR *object = (struct PAC_DEVICE_INFO_CTR *)pytalloc_get_ptr(py_obj);
    3483          48 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    3484          48 :         if (value == NULL) {
    3485           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    3486           0 :                 return -1;
    3487             :         }
    3488          48 :         if (value == Py_None) {
    3489           0 :                 object->info = NULL;
    3490             :         } else {
    3491          48 :                 object->info = NULL;
    3492          48 :                 PY_CHECK_TYPE(&PAC_DEVICE_INFO_Type, value, return -1;);
    3493          48 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3494           0 :                         PyErr_NoMemory();
    3495           0 :                         return -1;
    3496             :                 }
    3497          48 :                 object->info = (struct PAC_DEVICE_INFO *)pytalloc_get_ptr(value);
    3498             :         }
    3499          48 :         return 0;
    3500             : }
    3501             : 
    3502             : static PyGetSetDef py_PAC_DEVICE_INFO_CTR_getsetters[] = {
    3503             :         {
    3504             :                 .name = discard_const_p(char, "info"),
    3505             :                 .get = py_PAC_DEVICE_INFO_CTR_get_info,
    3506             :                 .set = py_PAC_DEVICE_INFO_CTR_set_info,
    3507             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_DEVICE_INFO")
    3508             :         },
    3509             :         { .name = NULL }
    3510             : };
    3511             : 
    3512          48 : static PyObject *py_PAC_DEVICE_INFO_CTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3513             : {
    3514          48 :         return pytalloc_new(struct PAC_DEVICE_INFO_CTR, type);
    3515             : }
    3516             : 
    3517             : 
    3518             : static PyTypeObject PAC_DEVICE_INFO_CTR_Type = {
    3519             :         PyVarObject_HEAD_INIT(NULL, 0)
    3520             :         .tp_name = "krb5pac.PAC_DEVICE_INFO_CTR",
    3521             :         .tp_getset = py_PAC_DEVICE_INFO_CTR_getsetters,
    3522             :         .tp_methods = NULL,
    3523             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3524             :         .tp_new = py_PAC_DEVICE_INFO_CTR_new,
    3525             : };
    3526             : 
    3527             : 
    3528       28617 : static PyObject *py_DATA_BLOB_REM_get_remaining(PyObject *obj, void *closure)
    3529             : {
    3530       28617 :         struct DATA_BLOB_REM *object = (struct DATA_BLOB_REM *)pytalloc_get_ptr(obj);
    3531          11 :         PyObject *py_remaining;
    3532       28617 :         py_remaining = PyBytes_FromStringAndSize((char *)(object->remaining).data, (object->remaining).length);
    3533       28617 :         return py_remaining;
    3534             : }
    3535             : 
    3536       20735 : static int py_DATA_BLOB_REM_set_remaining(PyObject *py_obj, PyObject *value, void *closure)
    3537             : {
    3538       20735 :         struct DATA_BLOB_REM *object = (struct DATA_BLOB_REM *)pytalloc_get_ptr(py_obj);
    3539       20735 :         if (value == NULL) {
    3540           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->remaining");
    3541           0 :                 return -1;
    3542             :         }
    3543       20735 :         object->remaining = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    3544       20735 :         return 0;
    3545             : }
    3546             : 
    3547             : static PyGetSetDef py_DATA_BLOB_REM_getsetters[] = {
    3548             :         {
    3549             :                 .name = discard_const_p(char, "remaining"),
    3550             :                 .get = py_DATA_BLOB_REM_get_remaining,
    3551             :                 .set = py_DATA_BLOB_REM_set_remaining,
    3552             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    3553             :         },
    3554             :         { .name = NULL }
    3555             : };
    3556             : 
    3557          60 : static PyObject *py_DATA_BLOB_REM_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3558             : {
    3559          60 :         return pytalloc_new(struct DATA_BLOB_REM, type);
    3560             : }
    3561             : 
    3562             : 
    3563             : static PyTypeObject DATA_BLOB_REM_Type = {
    3564             :         PyVarObject_HEAD_INIT(NULL, 0)
    3565             :         .tp_name = "krb5pac.DATA_BLOB_REM",
    3566             :         .tp_getset = py_DATA_BLOB_REM_getsetters,
    3567             :         .tp_methods = NULL,
    3568             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3569             :         .tp_new = py_DATA_BLOB_REM_new,
    3570             : };
    3571             : 
    3572      111131 : static PyObject *py_import_PAC_INFO(TALLOC_CTX *mem_ctx, int level, union PAC_INFO *in)
    3573             : {
    3574          13 :         PyObject *ret;
    3575             : 
    3576      111131 :         switch (level) {
    3577       24659 :                 case PAC_TYPE_LOGON_INFO:
    3578       24659 :                         ret = pytalloc_reference_ex(&PAC_LOGON_INFO_CTR_Type, mem_ctx, &in->logon_info);
    3579       24659 :                         return ret;
    3580             : 
    3581          25 :                 case PAC_TYPE_CREDENTIAL_INFO:
    3582          25 :                         ret = pytalloc_reference_ex(&PAC_CREDENTIAL_INFO_Type, mem_ctx, &in->credential_info);
    3583          25 :                         return ret;
    3584             : 
    3585       20784 :                 case PAC_TYPE_SRV_CHECKSUM:
    3586       20784 :                         ret = pytalloc_reference_ex(&PAC_SIGNATURE_DATA_Type, mem_ctx, &in->srv_cksum);
    3587       20784 :                         return ret;
    3588             : 
    3589       20784 :                 case PAC_TYPE_KDC_CHECKSUM:
    3590       20784 :                         ret = pytalloc_reference_ex(&PAC_SIGNATURE_DATA_Type, mem_ctx, &in->kdc_cksum);
    3591       20784 :                         return ret;
    3592             : 
    3593        8462 :                 case PAC_TYPE_LOGON_NAME:
    3594        8462 :                         ret = pytalloc_reference_ex(&PAC_LOGON_NAME_Type, mem_ctx, &in->logon_name);
    3595        8462 :                         return ret;
    3596             : 
    3597         141 :                 case PAC_TYPE_CONSTRAINED_DELEGATION:
    3598         141 :                         ret = pytalloc_reference_ex(&PAC_CONSTRAINED_DELEGATION_CTR_Type, mem_ctx, &in->constrained_delegation);
    3599         141 :                         return ret;
    3600             : 
    3601        8507 :                 case PAC_TYPE_UPN_DNS_INFO:
    3602        8507 :                         ret = pytalloc_reference_ex(&PAC_UPN_DNS_INFO_Type, mem_ctx, &in->upn_dns_info);
    3603        8507 :                         return ret;
    3604             : 
    3605        8698 :                 case PAC_TYPE_TICKET_CHECKSUM:
    3606        8698 :                         ret = pytalloc_reference_ex(&PAC_SIGNATURE_DATA_Type, mem_ctx, &in->ticket_checksum);
    3607        8698 :                         return ret;
    3608             : 
    3609         807 :                 case PAC_TYPE_ATTRIBUTES_INFO:
    3610         807 :                         ret = pytalloc_reference_ex(&PAC_ATTRIBUTES_INFO_Type, mem_ctx, &in->attributes_info);
    3611         807 :                         return ret;
    3612             : 
    3613         892 :                 case PAC_TYPE_REQUESTER_SID:
    3614         892 :                         ret = pytalloc_reference_ex(&PAC_REQUESTER_SID_Type, mem_ctx, &in->requester_sid);
    3615         892 :                         return ret;
    3616             : 
    3617        8315 :                 case PAC_TYPE_CLIENT_CLAIMS_INFO:
    3618        8315 :                         ret = pytalloc_reference_ex(&DATA_BLOB_REM_Type, mem_ctx, &in->client_claims_info);
    3619        8315 :                         return ret;
    3620             : 
    3621          57 :                 case PAC_TYPE_DEVICE_INFO:
    3622          57 :                         ret = pytalloc_reference_ex(&PAC_DEVICE_INFO_CTR_Type, mem_ctx, &in->device_info);
    3623          57 :                         return ret;
    3624             : 
    3625          99 :                 case PAC_TYPE_DEVICE_CLAIMS_INFO:
    3626          99 :                         ret = pytalloc_reference_ex(&DATA_BLOB_REM_Type, mem_ctx, &in->device_claims_info);
    3627          99 :                         return ret;
    3628             : 
    3629        8901 :                 case PAC_TYPE_FULL_CHECKSUM:
    3630        8901 :                         ret = pytalloc_reference_ex(&PAC_SIGNATURE_DATA_Type, mem_ctx, &in->full_checksum);
    3631        8901 :                         return ret;
    3632             : 
    3633           0 :                 default:
    3634           0 :                         ret = pytalloc_reference_ex(&DATA_BLOB_REM_Type, mem_ctx, &in->unknown);
    3635           0 :                         return ret;
    3636             : 
    3637             :         }
    3638             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    3639             :         return NULL;
    3640             : }
    3641             : 
    3642         148 : static union PAC_INFO *py_export_PAC_INFO(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    3643             : {
    3644         148 :         union PAC_INFO *ret = talloc_zero(mem_ctx, union PAC_INFO);
    3645         148 :         switch (level) {
    3646           0 :                 case PAC_TYPE_LOGON_INFO:
    3647           0 :                         if (in == NULL) {
    3648           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->logon_info");
    3649           0 :                                 talloc_free(ret); return NULL;
    3650             :                         }
    3651           0 :                         PY_CHECK_TYPE(&PAC_LOGON_INFO_CTR_Type, in, talloc_free(ret); return NULL;);
    3652           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3653           0 :                                 PyErr_NoMemory();
    3654           0 :                                 talloc_free(ret); return NULL;
    3655             :                         }
    3656           0 :                         ret->logon_info = *(struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(in);
    3657           0 :                         break;
    3658             : 
    3659           0 :                 case PAC_TYPE_CREDENTIAL_INFO:
    3660           0 :                         if (in == NULL) {
    3661           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->credential_info");
    3662           0 :                                 talloc_free(ret); return NULL;
    3663             :                         }
    3664           0 :                         PY_CHECK_TYPE(&PAC_CREDENTIAL_INFO_Type, in, talloc_free(ret); return NULL;);
    3665           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3666           0 :                                 PyErr_NoMemory();
    3667           0 :                                 talloc_free(ret); return NULL;
    3668             :                         }
    3669           0 :                         ret->credential_info = *(struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(in);
    3670           0 :                         break;
    3671             : 
    3672           0 :                 case PAC_TYPE_SRV_CHECKSUM:
    3673           0 :                         if (in == NULL) {
    3674           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->srv_cksum");
    3675           0 :                                 talloc_free(ret); return NULL;
    3676             :                         }
    3677           0 :                         PY_CHECK_TYPE(&PAC_SIGNATURE_DATA_Type, in, talloc_free(ret); return NULL;);
    3678           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3679           0 :                                 PyErr_NoMemory();
    3680           0 :                                 talloc_free(ret); return NULL;
    3681             :                         }
    3682           0 :                         ret->srv_cksum = *(struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(in);
    3683           0 :                         break;
    3684             : 
    3685           0 :                 case PAC_TYPE_KDC_CHECKSUM:
    3686           0 :                         if (in == NULL) {
    3687           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->kdc_cksum");
    3688           0 :                                 talloc_free(ret); return NULL;
    3689             :                         }
    3690           0 :                         PY_CHECK_TYPE(&PAC_SIGNATURE_DATA_Type, in, talloc_free(ret); return NULL;);
    3691           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3692           0 :                                 PyErr_NoMemory();
    3693           0 :                                 talloc_free(ret); return NULL;
    3694             :                         }
    3695           0 :                         ret->kdc_cksum = *(struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(in);
    3696           0 :                         break;
    3697             : 
    3698           0 :                 case PAC_TYPE_LOGON_NAME:
    3699           0 :                         if (in == NULL) {
    3700           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->logon_name");
    3701           0 :                                 talloc_free(ret); return NULL;
    3702             :                         }
    3703           0 :                         PY_CHECK_TYPE(&PAC_LOGON_NAME_Type, in, talloc_free(ret); return NULL;);
    3704           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3705           0 :                                 PyErr_NoMemory();
    3706           0 :                                 talloc_free(ret); return NULL;
    3707             :                         }
    3708           0 :                         ret->logon_name = *(struct PAC_LOGON_NAME *)pytalloc_get_ptr(in);
    3709           0 :                         break;
    3710             : 
    3711           4 :                 case PAC_TYPE_CONSTRAINED_DELEGATION:
    3712           4 :                         if (in == NULL) {
    3713           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->constrained_delegation");
    3714           0 :                                 talloc_free(ret); return NULL;
    3715             :                         }
    3716           4 :                         PY_CHECK_TYPE(&PAC_CONSTRAINED_DELEGATION_CTR_Type, in, talloc_free(ret); return NULL;);
    3717           4 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3718           0 :                                 PyErr_NoMemory();
    3719           0 :                                 talloc_free(ret); return NULL;
    3720             :                         }
    3721           4 :                         ret->constrained_delegation = *(struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(in);
    3722           4 :                         break;
    3723             : 
    3724           0 :                 case PAC_TYPE_UPN_DNS_INFO:
    3725           0 :                         if (in == NULL) {
    3726           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->upn_dns_info");
    3727           0 :                                 talloc_free(ret); return NULL;
    3728             :                         }
    3729           0 :                         PY_CHECK_TYPE(&PAC_UPN_DNS_INFO_Type, in, talloc_free(ret); return NULL;);
    3730           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3731           0 :                                 PyErr_NoMemory();
    3732           0 :                                 talloc_free(ret); return NULL;
    3733             :                         }
    3734           0 :                         ret->upn_dns_info = *(struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(in);
    3735           0 :                         break;
    3736             : 
    3737          16 :                 case PAC_TYPE_TICKET_CHECKSUM:
    3738          16 :                         if (in == NULL) {
    3739           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ticket_checksum");
    3740           0 :                                 talloc_free(ret); return NULL;
    3741             :                         }
    3742          16 :                         PY_CHECK_TYPE(&PAC_SIGNATURE_DATA_Type, in, talloc_free(ret); return NULL;);
    3743          16 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3744           0 :                                 PyErr_NoMemory();
    3745           0 :                                 talloc_free(ret); return NULL;
    3746             :                         }
    3747          16 :                         ret->ticket_checksum = *(struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(in);
    3748          16 :                         break;
    3749             : 
    3750           0 :                 case PAC_TYPE_ATTRIBUTES_INFO:
    3751           0 :                         if (in == NULL) {
    3752           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->attributes_info");
    3753           0 :                                 talloc_free(ret); return NULL;
    3754             :                         }
    3755           0 :                         PY_CHECK_TYPE(&PAC_ATTRIBUTES_INFO_Type, in, talloc_free(ret); return NULL;);
    3756           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3757           0 :                                 PyErr_NoMemory();
    3758           0 :                                 talloc_free(ret); return NULL;
    3759             :                         }
    3760           0 :                         ret->attributes_info = *(struct PAC_ATTRIBUTES_INFO *)pytalloc_get_ptr(in);
    3761           0 :                         break;
    3762             : 
    3763           4 :                 case PAC_TYPE_REQUESTER_SID:
    3764           4 :                         if (in == NULL) {
    3765           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->requester_sid");
    3766           0 :                                 talloc_free(ret); return NULL;
    3767             :                         }
    3768           4 :                         PY_CHECK_TYPE(&PAC_REQUESTER_SID_Type, in, talloc_free(ret); return NULL;);
    3769           4 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3770           0 :                                 PyErr_NoMemory();
    3771           0 :                                 talloc_free(ret); return NULL;
    3772             :                         }
    3773           4 :                         ret->requester_sid = *(struct PAC_REQUESTER_SID *)pytalloc_get_ptr(in);
    3774           4 :                         break;
    3775             : 
    3776           0 :                 case PAC_TYPE_CLIENT_CLAIMS_INFO:
    3777           0 :                         if (in == NULL) {
    3778           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->client_claims_info");
    3779           0 :                                 talloc_free(ret); return NULL;
    3780             :                         }
    3781           0 :                         PY_CHECK_TYPE(&DATA_BLOB_REM_Type, in, talloc_free(ret); return NULL;);
    3782           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3783           0 :                                 PyErr_NoMemory();
    3784           0 :                                 talloc_free(ret); return NULL;
    3785             :                         }
    3786           0 :                         ret->client_claims_info = *(struct DATA_BLOB_REM *)pytalloc_get_ptr(in);
    3787           0 :                         break;
    3788             : 
    3789          48 :                 case PAC_TYPE_DEVICE_INFO:
    3790          48 :                         if (in == NULL) {
    3791           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->device_info");
    3792           0 :                                 talloc_free(ret); return NULL;
    3793             :                         }
    3794          48 :                         PY_CHECK_TYPE(&PAC_DEVICE_INFO_CTR_Type, in, talloc_free(ret); return NULL;);
    3795          48 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3796           0 :                                 PyErr_NoMemory();
    3797           0 :                                 talloc_free(ret); return NULL;
    3798             :                         }
    3799          48 :                         ret->device_info = *(struct PAC_DEVICE_INFO_CTR *)pytalloc_get_ptr(in);
    3800          48 :                         break;
    3801             : 
    3802          48 :                 case PAC_TYPE_DEVICE_CLAIMS_INFO:
    3803          48 :                         if (in == NULL) {
    3804           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->device_claims_info");
    3805           0 :                                 talloc_free(ret); return NULL;
    3806             :                         }
    3807          48 :                         PY_CHECK_TYPE(&DATA_BLOB_REM_Type, in, talloc_free(ret); return NULL;);
    3808          48 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3809           0 :                                 PyErr_NoMemory();
    3810           0 :                                 talloc_free(ret); return NULL;
    3811             :                         }
    3812          48 :                         ret->device_claims_info = *(struct DATA_BLOB_REM *)pytalloc_get_ptr(in);
    3813          48 :                         break;
    3814             : 
    3815          16 :                 case PAC_TYPE_FULL_CHECKSUM:
    3816          16 :                         if (in == NULL) {
    3817           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->full_checksum");
    3818           0 :                                 talloc_free(ret); return NULL;
    3819             :                         }
    3820          16 :                         PY_CHECK_TYPE(&PAC_SIGNATURE_DATA_Type, in, talloc_free(ret); return NULL;);
    3821          16 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3822           0 :                                 PyErr_NoMemory();
    3823           0 :                                 talloc_free(ret); return NULL;
    3824             :                         }
    3825          16 :                         ret->full_checksum = *(struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(in);
    3826          16 :                         break;
    3827             : 
    3828          12 :                 default:
    3829          12 :                         if (in == NULL) {
    3830           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->unknown");
    3831           0 :                                 talloc_free(ret); return NULL;
    3832             :                         }
    3833          12 :                         PY_CHECK_TYPE(&DATA_BLOB_REM_Type, in, talloc_free(ret); return NULL;);
    3834          12 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3835           0 :                                 PyErr_NoMemory();
    3836           0 :                                 talloc_free(ret); return NULL;
    3837             :                         }
    3838          12 :                         ret->unknown = *(struct DATA_BLOB_REM *)pytalloc_get_ptr(in);
    3839          12 :                         break;
    3840             : 
    3841             :         }
    3842             : 
    3843         148 :         return ret;
    3844             : }
    3845             : 
    3846      111131 : static PyObject *py_PAC_INFO_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3847             : {
    3848      111131 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    3849      111131 :         PyObject *mem_ctx_obj = NULL;
    3850      111131 :         TALLOC_CTX *mem_ctx = NULL;
    3851      111131 :         int level = 0;
    3852      111131 :         PyObject *in_obj = NULL;
    3853      111131 :         union PAC_INFO *in = NULL;
    3854             : 
    3855      111131 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    3856             :                 discard_const_p(char *, kwnames),
    3857             :                 &mem_ctx_obj,
    3858             :                 &level,
    3859             :                 &in_obj)) {
    3860           0 :                 return NULL;
    3861             :         }
    3862      111131 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    3863      111131 :         if (mem_ctx == NULL) {
    3864           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    3865           0 :                 return NULL;
    3866             :         }
    3867      111131 :         in = (union PAC_INFO *)pytalloc_get_ptr(in_obj);
    3868      111131 :         if (in == NULL) {
    3869           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union PAC_INFO!");
    3870           0 :                 return NULL;
    3871             :         }
    3872             : 
    3873      111131 :         return py_import_PAC_INFO(mem_ctx, level, in);
    3874             : }
    3875             : 
    3876         148 : static PyObject *py_PAC_INFO_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3877             : {
    3878         148 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    3879         148 :         PyObject *mem_ctx_obj = NULL;
    3880         148 :         TALLOC_CTX *mem_ctx = NULL;
    3881         148 :         int level = 0;
    3882         148 :         PyObject *in = NULL;
    3883         148 :         union PAC_INFO *out = NULL;
    3884             : 
    3885         148 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    3886             :                 discard_const_p(char *, kwnames),
    3887             :                 &mem_ctx_obj,
    3888             :                 &level,
    3889             :                 &in)) {
    3890           0 :                 return NULL;
    3891             :         }
    3892         148 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    3893         148 :         if (mem_ctx == NULL) {
    3894           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    3895           0 :                 return NULL;
    3896             :         }
    3897             : 
    3898         148 :         out = py_export_PAC_INFO(mem_ctx, level, in);
    3899         148 :         if (out == NULL) {
    3900           0 :                 return NULL;
    3901             :         }
    3902             : 
    3903         148 :         return pytalloc_GenericObject_reference(out);
    3904             : }
    3905             : 
    3906             : static PyMethodDef py_PAC_INFO_methods[] = {
    3907             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_INFO_import),
    3908             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    3909             :                 "T.__import__(mem_ctx, level, in) => ret." },
    3910             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_INFO_export),
    3911             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    3912             :                 "T.__export__(mem_ctx, level, in) => ret." },
    3913             :         { NULL, NULL, 0, NULL }
    3914             : };
    3915             : 
    3916           0 : static PyObject *py_PAC_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3917             : {
    3918           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    3919           0 :         return NULL;
    3920             : }
    3921             : 
    3922             : 
    3923             : static PyTypeObject PAC_INFO_Type = {
    3924             :         PyVarObject_HEAD_INIT(NULL, 0)
    3925             :         .tp_name = "krb5pac.PAC_INFO",
    3926             :         .tp_getset = NULL,
    3927             :         .tp_methods = py_PAC_INFO_methods,
    3928             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3929             :         .tp_new = py_PAC_INFO_new,
    3930             : };
    3931             : 
    3932             : 
    3933      520356 : static PyObject *py_PAC_BUFFER_get_type(PyObject *obj, void *closure)
    3934             : {
    3935      520356 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(obj);
    3936           9 :         PyObject *py_type;
    3937      520356 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    3938      520356 :         return py_type;
    3939             : }
    3940             : 
    3941         148 : static int py_PAC_BUFFER_set_type(PyObject *py_obj, PyObject *value, void *closure)
    3942             : {
    3943         148 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    3944         148 :         if (value == NULL) {
    3945           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    3946           0 :                 return -1;
    3947             :         }
    3948             :         {
    3949         148 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    3950         148 :                 if (PyLong_Check(value)) {
    3951           0 :                         unsigned long long test_var;
    3952         148 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3953         148 :                         if (PyErr_Occurred() != NULL) {
    3954           0 :                                 return -1;
    3955             :                         }
    3956         148 :                         if (test_var > uint_max) {
    3957           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3958             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3959           0 :                                 return -1;
    3960             :                         }
    3961         148 :                         object->type = test_var;
    3962             :                 } else {
    3963           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    3964             :                           PyLong_Type.tp_name);
    3965           0 :                         return -1;
    3966             :                 }
    3967             :         }
    3968         148 :         return 0;
    3969             : }
    3970             : 
    3971           0 : static PyObject *py_PAC_BUFFER_get__ndr_size(PyObject *obj, void *closure)
    3972             : {
    3973           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(obj);
    3974           0 :         PyObject *py__ndr_size;
    3975           0 :         py__ndr_size = PyLong_FromUnsignedLongLong((uint32_t)object->_ndr_size);
    3976           0 :         return py__ndr_size;
    3977             : }
    3978             : 
    3979           0 : static int py_PAC_BUFFER_set__ndr_size(PyObject *py_obj, PyObject *value, void *closure)
    3980             : {
    3981           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    3982           0 :         if (value == NULL) {
    3983           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_ndr_size");
    3984           0 :                 return -1;
    3985             :         }
    3986             :         {
    3987           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size));
    3988           0 :                 if (PyLong_Check(value)) {
    3989           0 :                         unsigned long long test_var;
    3990           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3991           0 :                         if (PyErr_Occurred() != NULL) {
    3992           0 :                                 return -1;
    3993             :                         }
    3994           0 :                         if (test_var > uint_max) {
    3995           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    3996             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3997           0 :                                 return -1;
    3998             :                         }
    3999           0 :                         object->_ndr_size = test_var;
    4000             :                 } else {
    4001           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4002             :                           PyLong_Type.tp_name);
    4003           0 :                         return -1;
    4004             :                 }
    4005             :         }
    4006           0 :         return 0;
    4007             : }
    4008             : 
    4009      111131 : static PyObject *py_PAC_BUFFER_get_info(PyObject *obj, void *closure)
    4010             : {
    4011      111131 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(obj);
    4012          13 :         PyObject *py_info;
    4013      111131 :         if (object->info == NULL) {
    4014           0 :                 Py_RETURN_NONE;
    4015             :         }
    4016      111131 :         if (object->info == NULL) {
    4017           0 :                 py_info = Py_None;
    4018           0 :                 Py_INCREF(py_info);
    4019             :         } else {
    4020      111131 :                 py_info = pyrpc_import_union(&PAC_INFO_Type, object->info, object->type, object->info, "union PAC_INFO");
    4021      111131 :                 if (py_info == NULL) {
    4022           0 :                         return NULL;
    4023             :                 }
    4024             :         }
    4025      111118 :         return py_info;
    4026             : }
    4027             : 
    4028         148 : static int py_PAC_BUFFER_set_info(PyObject *py_obj, PyObject *value, void *closure)
    4029             : {
    4030         148 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    4031         148 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    4032         148 :         if (value == NULL) {
    4033           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    4034           0 :                 return -1;
    4035             :         }
    4036         148 :         if (value == Py_None) {
    4037           0 :                 object->info = NULL;
    4038             :         } else {
    4039         148 :                 object->info = NULL;
    4040             :                 {
    4041           0 :                         union PAC_INFO *info_switch_2;
    4042         148 :                         info_switch_2 = (union PAC_INFO *)pyrpc_export_union(&PAC_INFO_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union PAC_INFO");
    4043         148 :                         if (info_switch_2 == NULL) {
    4044           0 :                                 return -1;
    4045             :                         }
    4046         148 :                         object->info = info_switch_2;
    4047             :                 }
    4048             :         }
    4049         148 :         return 0;
    4050             : }
    4051             : 
    4052           0 : static PyObject *py_PAC_BUFFER_get__pad(PyObject *obj, void *closure)
    4053             : {
    4054           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(obj);
    4055           0 :         PyObject *py__pad;
    4056           0 :         py__pad = PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
    4057           0 :         return py__pad;
    4058             : }
    4059             : 
    4060           0 : static int py_PAC_BUFFER_set__pad(PyObject *py_obj, PyObject *value, void *closure)
    4061             : {
    4062           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    4063           0 :         if (value == NULL) {
    4064           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
    4065           0 :                 return -1;
    4066             :         }
    4067             :         {
    4068           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad));
    4069           0 :                 if (PyLong_Check(value)) {
    4070           0 :                         unsigned long long test_var;
    4071           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4072           0 :                         if (PyErr_Occurred() != NULL) {
    4073           0 :                                 return -1;
    4074             :                         }
    4075           0 :                         if (test_var > uint_max) {
    4076           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4077             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4078           0 :                                 return -1;
    4079             :                         }
    4080           0 :                         object->_pad = test_var;
    4081             :                 } else {
    4082           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4083             :                           PyLong_Type.tp_name);
    4084           0 :                         return -1;
    4085             :                 }
    4086             :         }
    4087           0 :         return 0;
    4088             : }
    4089             : 
    4090             : static PyGetSetDef py_PAC_BUFFER_getsetters[] = {
    4091             :         {
    4092             :                 .name = discard_const_p(char, "type"),
    4093             :                 .get = py_PAC_BUFFER_get_type,
    4094             :                 .set = py_PAC_BUFFER_set_type,
    4095             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_TYPE")
    4096             :         },
    4097             :         {
    4098             :                 .name = discard_const_p(char, "_ndr_size"),
    4099             :                 .get = py_PAC_BUFFER_get__ndr_size,
    4100             :                 .set = py_PAC_BUFFER_set__ndr_size,
    4101             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4102             :         },
    4103             :         {
    4104             :                 .name = discard_const_p(char, "info"),
    4105             :                 .get = py_PAC_BUFFER_get_info,
    4106             :                 .set = py_PAC_BUFFER_set_info,
    4107             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_INFO")
    4108             :         },
    4109             :         {
    4110             :                 .name = discard_const_p(char, "_pad"),
    4111             :                 .get = py_PAC_BUFFER_get__pad,
    4112             :                 .set = py_PAC_BUFFER_set__pad,
    4113             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4114             :         },
    4115             :         { .name = NULL }
    4116             : };
    4117             : 
    4118         148 : static PyObject *py_PAC_BUFFER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4119             : {
    4120         148 :         return pytalloc_new(struct PAC_BUFFER, type);
    4121             : }
    4122             : 
    4123           0 : static PyObject *py_PAC_BUFFER_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    4124             : {
    4125           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    4126           0 :         PyObject *ret = NULL;
    4127           0 :         DATA_BLOB blob;
    4128           0 :         enum ndr_err_code err;
    4129           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    4130           0 :         if (tmp_ctx == NULL) {
    4131           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4132           0 :                 return NULL;
    4133             :         }
    4134           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_BUFFER);
    4135           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4136           0 :                 TALLOC_FREE(tmp_ctx);
    4137           0 :                 PyErr_SetNdrError(err);
    4138           0 :                 return NULL;
    4139             :         }
    4140             : 
    4141           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4142           0 :         TALLOC_FREE(tmp_ctx);
    4143           0 :         return ret;
    4144             : }
    4145             : 
    4146           0 : static PyObject *py_PAC_BUFFER_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4147             : {
    4148           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    4149           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    4150           0 :         Py_ssize_t blob_length = 0;
    4151           0 :         enum ndr_err_code err;
    4152           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    4153           0 :         PyObject *allow_remaining_obj = NULL;
    4154           0 :         bool allow_remaining = false;
    4155             : 
    4156           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    4157             :                 discard_const_p(char *, kwnames),
    4158             :                 &blob.data, &blob_length,
    4159             :                 &allow_remaining_obj)) {
    4160           0 :                 return NULL;
    4161             :         }
    4162           0 :         blob.length = blob_length;
    4163             : 
    4164           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4165           0 :                 allow_remaining = true;
    4166             :         }
    4167             : 
    4168           0 :         if (allow_remaining) {
    4169           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_BUFFER);
    4170             :         } else {
    4171           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_BUFFER);
    4172             :         }
    4173           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4174           0 :                 PyErr_SetNdrError(err);
    4175           0 :                 return NULL;
    4176             :         }
    4177             : 
    4178           0 :         Py_RETURN_NONE;
    4179             : }
    4180             : 
    4181           0 : static PyObject *py_PAC_BUFFER_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4182             : {
    4183           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    4184           0 :         PyObject *ret;
    4185           0 :         char *retstr;
    4186             : 
    4187           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_BUFFER, "PAC_BUFFER", object);
    4188           0 :         ret = PyUnicode_FromString(retstr);
    4189           0 :         talloc_free(retstr);
    4190             : 
    4191           0 :         return ret;
    4192             : }
    4193             : 
    4194             : static PyMethodDef py_PAC_BUFFER_methods[] = {
    4195             :         { "__ndr_pack__", (PyCFunction)py_PAC_BUFFER_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    4196             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_BUFFER_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    4197             :         { "__ndr_print__", (PyCFunction)py_PAC_BUFFER_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    4198             :         { NULL, NULL, 0, NULL }
    4199             : };
    4200             : 
    4201             : 
    4202             : static PyTypeObject PAC_BUFFER_Type = {
    4203             :         PyVarObject_HEAD_INIT(NULL, 0)
    4204             :         .tp_name = "krb5pac.PAC_BUFFER",
    4205             :         .tp_getset = py_PAC_BUFFER_getsetters,
    4206             :         .tp_methods = py_PAC_BUFFER_methods,
    4207             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4208             :         .tp_new = py_PAC_BUFFER_new,
    4209             : };
    4210             : 
    4211             : 
    4212         112 : static PyObject *py_PAC_DATA_get_num_buffers(PyObject *obj, void *closure)
    4213             : {
    4214         112 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(obj);
    4215           3 :         PyObject *py_num_buffers;
    4216         112 :         py_num_buffers = PyLong_FromUnsignedLongLong((uint32_t)object->num_buffers);
    4217         112 :         return py_num_buffers;
    4218             : }
    4219             : 
    4220         541 : static int py_PAC_DATA_set_num_buffers(PyObject *py_obj, PyObject *value, void *closure)
    4221             : {
    4222         541 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    4223         541 :         if (value == NULL) {
    4224           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_buffers");
    4225           0 :                 return -1;
    4226             :         }
    4227             :         {
    4228         541 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_buffers));
    4229         541 :                 if (PyLong_Check(value)) {
    4230           0 :                         unsigned long long test_var;
    4231         541 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4232         541 :                         if (PyErr_Occurred() != NULL) {
    4233           0 :                                 return -1;
    4234             :                         }
    4235         541 :                         if (test_var > uint_max) {
    4236           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4237             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4238           0 :                                 return -1;
    4239             :                         }
    4240         541 :                         object->num_buffers = test_var;
    4241             :                 } else {
    4242           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4243             :                           PyLong_Type.tp_name);
    4244           0 :                         return -1;
    4245             :                 }
    4246             :         }
    4247         541 :         return 0;
    4248             : }
    4249             : 
    4250           2 : static PyObject *py_PAC_DATA_get_version(PyObject *obj, void *closure)
    4251             : {
    4252           2 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(obj);
    4253           2 :         PyObject *py_version;
    4254           2 :         py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
    4255           2 :         return py_version;
    4256             : }
    4257             : 
    4258           0 : static int py_PAC_DATA_set_version(PyObject *py_obj, PyObject *value, void *closure)
    4259             : {
    4260           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    4261           0 :         if (value == NULL) {
    4262           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
    4263           0 :                 return -1;
    4264             :         }
    4265             :         {
    4266           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
    4267           0 :                 if (PyLong_Check(value)) {
    4268           0 :                         unsigned long long test_var;
    4269           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4270           0 :                         if (PyErr_Occurred() != NULL) {
    4271           0 :                                 return -1;
    4272             :                         }
    4273           0 :                         if (test_var > uint_max) {
    4274           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4275             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4276           0 :                                 return -1;
    4277             :                         }
    4278           0 :                         object->version = test_var;
    4279             :                 } else {
    4280           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4281             :                           PyLong_Type.tp_name);
    4282           0 :                         return -1;
    4283             :                 }
    4284             :         }
    4285           0 :         return 0;
    4286             : }
    4287             : 
    4288       27341 : static PyObject *py_PAC_DATA_get_buffers(PyObject *obj, void *closure)
    4289             : {
    4290       27341 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(obj);
    4291          21 :         PyObject *py_buffers;
    4292       27341 :         py_buffers = PyList_New(object->num_buffers);
    4293       27341 :         if (py_buffers == NULL) {
    4294           0 :                 return NULL;
    4295             :         }
    4296             :         {
    4297             :                 int buffers_cntr_0;
    4298      232190 :                 for (buffers_cntr_0 = 0; buffers_cntr_0 < (object->num_buffers); buffers_cntr_0++) {
    4299         168 :                         PyObject *py_buffers_0;
    4300      204849 :                         py_buffers_0 = pytalloc_reference_ex(&PAC_BUFFER_Type, object->buffers, &object->buffers[buffers_cntr_0]);
    4301      204849 :                         PyList_SetItem(py_buffers, buffers_cntr_0, py_buffers_0);
    4302             :                 }
    4303             :         }
    4304       27320 :         return py_buffers;
    4305             : }
    4306             : 
    4307        2608 : static int py_PAC_DATA_set_buffers(PyObject *py_obj, PyObject *value, void *closure)
    4308             : {
    4309        2608 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    4310        2608 :         if (value == NULL) {
    4311           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffers");
    4312           0 :                 return -1;
    4313             :         }
    4314        2608 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    4315             :         {
    4316           0 :                 int buffers_cntr_0;
    4317        2608 :                 object->buffers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffers, PyList_GET_SIZE(value));
    4318        2608 :                 if (!object->buffers) { return -1; }
    4319        2608 :                 talloc_set_name_const(object->buffers, "ARRAY: object->buffers");
    4320       23603 :                 for (buffers_cntr_0 = 0; buffers_cntr_0 < PyList_GET_SIZE(value); buffers_cntr_0++) {
    4321       20995 :                         if (PyList_GET_ITEM(value, buffers_cntr_0) == NULL) {
    4322           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffers[buffers_cntr_0]");
    4323           0 :                                 return -1;
    4324             :                         }
    4325       20995 :                         PY_CHECK_TYPE(&PAC_BUFFER_Type, PyList_GET_ITEM(value, buffers_cntr_0), return -1;);
    4326       20995 :                         if (talloc_reference(object->buffers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, buffers_cntr_0))) == NULL) {
    4327           0 :                                 PyErr_NoMemory();
    4328           0 :                                 return -1;
    4329             :                         }
    4330       20995 :                         object->buffers[buffers_cntr_0] = *(struct PAC_BUFFER *)pytalloc_get_ptr(PyList_GET_ITEM(value, buffers_cntr_0));
    4331             :                 }
    4332             :         }
    4333        2608 :         return 0;
    4334             : }
    4335             : 
    4336             : static PyGetSetDef py_PAC_DATA_getsetters[] = {
    4337             :         {
    4338             :                 .name = discard_const_p(char, "num_buffers"),
    4339             :                 .get = py_PAC_DATA_get_num_buffers,
    4340             :                 .set = py_PAC_DATA_set_num_buffers,
    4341             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4342             :         },
    4343             :         {
    4344             :                 .name = discard_const_p(char, "version"),
    4345             :                 .get = py_PAC_DATA_get_version,
    4346             :                 .set = py_PAC_DATA_set_version,
    4347             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4348             :         },
    4349             :         {
    4350             :                 .name = discard_const_p(char, "buffers"),
    4351             :                 .get = py_PAC_DATA_get_buffers,
    4352             :                 .set = py_PAC_DATA_set_buffers,
    4353             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_BUFFER")
    4354             :         },
    4355             :         { .name = NULL }
    4356             : };
    4357             : 
    4358       18256 : static PyObject *py_PAC_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4359             : {
    4360       18256 :         return pytalloc_new(struct PAC_DATA, type);
    4361             : }
    4362             : 
    4363        3268 : static PyObject *py_PAC_DATA_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    4364             : {
    4365        3268 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    4366        3268 :         PyObject *ret = NULL;
    4367           0 :         DATA_BLOB blob;
    4368           0 :         enum ndr_err_code err;
    4369        3268 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    4370        3268 :         if (tmp_ctx == NULL) {
    4371           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4372           0 :                 return NULL;
    4373             :         }
    4374        3268 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_DATA);
    4375        3268 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4376           0 :                 TALLOC_FREE(tmp_ctx);
    4377           0 :                 PyErr_SetNdrError(err);
    4378           0 :                 return NULL;
    4379             :         }
    4380             : 
    4381        3268 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4382        3268 :         TALLOC_FREE(tmp_ctx);
    4383        3268 :         return ret;
    4384             : }
    4385             : 
    4386       18256 : static PyObject *py_PAC_DATA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4387             : {
    4388       18256 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    4389       18256 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    4390       18256 :         Py_ssize_t blob_length = 0;
    4391           9 :         enum ndr_err_code err;
    4392       18256 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    4393       18256 :         PyObject *allow_remaining_obj = NULL;
    4394       18256 :         bool allow_remaining = false;
    4395             : 
    4396       18256 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    4397             :                 discard_const_p(char *, kwnames),
    4398             :                 &blob.data, &blob_length,
    4399             :                 &allow_remaining_obj)) {
    4400           0 :                 return NULL;
    4401             :         }
    4402       18256 :         blob.length = blob_length;
    4403             : 
    4404       18256 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4405           0 :                 allow_remaining = true;
    4406             :         }
    4407             : 
    4408       18247 :         if (allow_remaining) {
    4409           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA);
    4410             :         } else {
    4411       18256 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA);
    4412             :         }
    4413       18256 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4414           0 :                 PyErr_SetNdrError(err);
    4415           0 :                 return NULL;
    4416             :         }
    4417             : 
    4418       18256 :         Py_RETURN_NONE;
    4419             : }
    4420             : 
    4421           0 : static PyObject *py_PAC_DATA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4422             : {
    4423           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    4424           0 :         PyObject *ret;
    4425           0 :         char *retstr;
    4426             : 
    4427           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_DATA, "PAC_DATA", object);
    4428           0 :         ret = PyUnicode_FromString(retstr);
    4429           0 :         talloc_free(retstr);
    4430             : 
    4431           0 :         return ret;
    4432             : }
    4433             : 
    4434             : static PyMethodDef py_PAC_DATA_methods[] = {
    4435             :         { "__ndr_pack__", (PyCFunction)py_PAC_DATA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    4436             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_DATA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    4437             :         { "__ndr_print__", (PyCFunction)py_PAC_DATA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    4438             :         { NULL, NULL, 0, NULL }
    4439             : };
    4440             : 
    4441             : 
    4442             : static PyTypeObject PAC_DATA_Type = {
    4443             :         PyVarObject_HEAD_INIT(NULL, 0)
    4444             :         .tp_name = "krb5pac.PAC_DATA",
    4445             :         .tp_getset = py_PAC_DATA_getsetters,
    4446             :         .tp_methods = py_PAC_DATA_methods,
    4447             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4448             :         .tp_new = py_PAC_DATA_new,
    4449             : };
    4450             : 
    4451             : 
    4452         240 : static PyObject *py_PAC_BUFFER_RAW_get_type(PyObject *obj, void *closure)
    4453             : {
    4454         240 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(obj);
    4455           0 :         PyObject *py_type;
    4456         240 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    4457         240 :         return py_type;
    4458             : }
    4459             : 
    4460           0 : static int py_PAC_BUFFER_RAW_set_type(PyObject *py_obj, PyObject *value, void *closure)
    4461             : {
    4462           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    4463           0 :         if (value == NULL) {
    4464           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    4465           0 :                 return -1;
    4466             :         }
    4467             :         {
    4468           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    4469           0 :                 if (PyLong_Check(value)) {
    4470           0 :                         unsigned long long test_var;
    4471           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4472           0 :                         if (PyErr_Occurred() != NULL) {
    4473           0 :                                 return -1;
    4474             :                         }
    4475           0 :                         if (test_var > uint_max) {
    4476           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4477             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4478           0 :                                 return -1;
    4479             :                         }
    4480           0 :                         object->type = test_var;
    4481             :                 } else {
    4482           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4483             :                           PyLong_Type.tp_name);
    4484           0 :                         return -1;
    4485             :                 }
    4486             :         }
    4487           0 :         return 0;
    4488             : }
    4489             : 
    4490         240 : static PyObject *py_PAC_BUFFER_RAW_get_ndr_size(PyObject *obj, void *closure)
    4491             : {
    4492         240 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(obj);
    4493           0 :         PyObject *py_ndr_size;
    4494         240 :         py_ndr_size = PyLong_FromUnsignedLongLong((uint32_t)object->ndr_size);
    4495         240 :         return py_ndr_size;
    4496             : }
    4497             : 
    4498           0 : static int py_PAC_BUFFER_RAW_set_ndr_size(PyObject *py_obj, PyObject *value, void *closure)
    4499             : {
    4500           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    4501           0 :         if (value == NULL) {
    4502           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ndr_size");
    4503           0 :                 return -1;
    4504             :         }
    4505             :         {
    4506           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ndr_size));
    4507           0 :                 if (PyLong_Check(value)) {
    4508           0 :                         unsigned long long test_var;
    4509           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4510           0 :                         if (PyErr_Occurred() != NULL) {
    4511           0 :                                 return -1;
    4512             :                         }
    4513           0 :                         if (test_var > uint_max) {
    4514           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4515             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4516           0 :                                 return -1;
    4517             :                         }
    4518           0 :                         object->ndr_size = test_var;
    4519             :                 } else {
    4520           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4521             :                           PyLong_Type.tp_name);
    4522           0 :                         return -1;
    4523             :                 }
    4524             :         }
    4525           0 :         return 0;
    4526             : }
    4527             : 
    4528       40926 : static PyObject *py_PAC_BUFFER_RAW_get_info(PyObject *obj, void *closure)
    4529             : {
    4530       40926 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(obj);
    4531           0 :         PyObject *py_info;
    4532       40926 :         if (object->info == NULL) {
    4533           0 :                 Py_RETURN_NONE;
    4534             :         }
    4535       40926 :         if (object->info == NULL) {
    4536           0 :                 py_info = Py_None;
    4537           0 :                 Py_INCREF(py_info);
    4538             :         } else {
    4539       40926 :                 py_info = pytalloc_reference_ex(&DATA_BLOB_REM_Type, object->info, object->info);
    4540             :         }
    4541       40926 :         return py_info;
    4542             : }
    4543             : 
    4544           0 : static int py_PAC_BUFFER_RAW_set_info(PyObject *py_obj, PyObject *value, void *closure)
    4545             : {
    4546           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    4547           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    4548           0 :         if (value == NULL) {
    4549           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    4550           0 :                 return -1;
    4551             :         }
    4552           0 :         if (value == Py_None) {
    4553           0 :                 object->info = NULL;
    4554             :         } else {
    4555           0 :                 object->info = NULL;
    4556           0 :                 PY_CHECK_TYPE(&DATA_BLOB_REM_Type, value, return -1;);
    4557           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4558           0 :                         PyErr_NoMemory();
    4559           0 :                         return -1;
    4560             :                 }
    4561           0 :                 object->info = (struct DATA_BLOB_REM *)pytalloc_get_ptr(value);
    4562             :         }
    4563           0 :         return 0;
    4564             : }
    4565             : 
    4566           0 : static PyObject *py_PAC_BUFFER_RAW_get__pad(PyObject *obj, void *closure)
    4567             : {
    4568           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(obj);
    4569           0 :         PyObject *py__pad;
    4570           0 :         py__pad = PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
    4571           0 :         return py__pad;
    4572             : }
    4573             : 
    4574           0 : static int py_PAC_BUFFER_RAW_set__pad(PyObject *py_obj, PyObject *value, void *closure)
    4575             : {
    4576           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    4577           0 :         if (value == NULL) {
    4578           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
    4579           0 :                 return -1;
    4580             :         }
    4581             :         {
    4582           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad));
    4583           0 :                 if (PyLong_Check(value)) {
    4584           0 :                         unsigned long long test_var;
    4585           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4586           0 :                         if (PyErr_Occurred() != NULL) {
    4587           0 :                                 return -1;
    4588             :                         }
    4589           0 :                         if (test_var > uint_max) {
    4590           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4591             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4592           0 :                                 return -1;
    4593             :                         }
    4594           0 :                         object->_pad = test_var;
    4595             :                 } else {
    4596           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4597             :                           PyLong_Type.tp_name);
    4598           0 :                         return -1;
    4599             :                 }
    4600             :         }
    4601           0 :         return 0;
    4602             : }
    4603             : 
    4604             : static PyGetSetDef py_PAC_BUFFER_RAW_getsetters[] = {
    4605             :         {
    4606             :                 .name = discard_const_p(char, "type"),
    4607             :                 .get = py_PAC_BUFFER_RAW_get_type,
    4608             :                 .set = py_PAC_BUFFER_RAW_set_type,
    4609             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_TYPE")
    4610             :         },
    4611             :         {
    4612             :                 .name = discard_const_p(char, "ndr_size"),
    4613             :                 .get = py_PAC_BUFFER_RAW_get_ndr_size,
    4614             :                 .set = py_PAC_BUFFER_RAW_set_ndr_size,
    4615             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4616             :         },
    4617             :         {
    4618             :                 .name = discard_const_p(char, "info"),
    4619             :                 .get = py_PAC_BUFFER_RAW_get_info,
    4620             :                 .set = py_PAC_BUFFER_RAW_set_info,
    4621             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB_REM")
    4622             :         },
    4623             :         {
    4624             :                 .name = discard_const_p(char, "_pad"),
    4625             :                 .get = py_PAC_BUFFER_RAW_get__pad,
    4626             :                 .set = py_PAC_BUFFER_RAW_set__pad,
    4627             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4628             :         },
    4629             :         { .name = NULL }
    4630             : };
    4631             : 
    4632           0 : static PyObject *py_PAC_BUFFER_RAW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4633             : {
    4634           0 :         return pytalloc_new(struct PAC_BUFFER_RAW, type);
    4635             : }
    4636             : 
    4637           0 : static PyObject *py_PAC_BUFFER_RAW_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    4638             : {
    4639           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    4640           0 :         PyObject *ret = NULL;
    4641           0 :         DATA_BLOB blob;
    4642           0 :         enum ndr_err_code err;
    4643           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    4644           0 :         if (tmp_ctx == NULL) {
    4645           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4646           0 :                 return NULL;
    4647             :         }
    4648           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_BUFFER_RAW);
    4649           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4650           0 :                 TALLOC_FREE(tmp_ctx);
    4651           0 :                 PyErr_SetNdrError(err);
    4652           0 :                 return NULL;
    4653             :         }
    4654             : 
    4655           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4656           0 :         TALLOC_FREE(tmp_ctx);
    4657           0 :         return ret;
    4658             : }
    4659             : 
    4660           0 : static PyObject *py_PAC_BUFFER_RAW_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4661             : {
    4662           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    4663           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    4664           0 :         Py_ssize_t blob_length = 0;
    4665           0 :         enum ndr_err_code err;
    4666           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    4667           0 :         PyObject *allow_remaining_obj = NULL;
    4668           0 :         bool allow_remaining = false;
    4669             : 
    4670           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    4671             :                 discard_const_p(char *, kwnames),
    4672             :                 &blob.data, &blob_length,
    4673             :                 &allow_remaining_obj)) {
    4674           0 :                 return NULL;
    4675             :         }
    4676           0 :         blob.length = blob_length;
    4677             : 
    4678           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4679           0 :                 allow_remaining = true;
    4680             :         }
    4681             : 
    4682           0 :         if (allow_remaining) {
    4683           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_BUFFER_RAW);
    4684             :         } else {
    4685           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_BUFFER_RAW);
    4686             :         }
    4687           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4688           0 :                 PyErr_SetNdrError(err);
    4689           0 :                 return NULL;
    4690             :         }
    4691             : 
    4692           0 :         Py_RETURN_NONE;
    4693             : }
    4694             : 
    4695           0 : static PyObject *py_PAC_BUFFER_RAW_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4696             : {
    4697           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    4698           0 :         PyObject *ret;
    4699           0 :         char *retstr;
    4700             : 
    4701           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_BUFFER_RAW, "PAC_BUFFER_RAW", object);
    4702           0 :         ret = PyUnicode_FromString(retstr);
    4703           0 :         talloc_free(retstr);
    4704             : 
    4705           0 :         return ret;
    4706             : }
    4707             : 
    4708             : static PyMethodDef py_PAC_BUFFER_RAW_methods[] = {
    4709             :         { "__ndr_pack__", (PyCFunction)py_PAC_BUFFER_RAW_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    4710             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_BUFFER_RAW_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    4711             :         { "__ndr_print__", (PyCFunction)py_PAC_BUFFER_RAW_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    4712             :         { NULL, NULL, 0, NULL }
    4713             : };
    4714             : 
    4715             : 
    4716             : static PyTypeObject PAC_BUFFER_RAW_Type = {
    4717             :         PyVarObject_HEAD_INIT(NULL, 0)
    4718             :         .tp_name = "krb5pac.PAC_BUFFER_RAW",
    4719             :         .tp_getset = py_PAC_BUFFER_RAW_getsetters,
    4720             :         .tp_methods = py_PAC_BUFFER_RAW_methods,
    4721             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4722             :         .tp_new = py_PAC_BUFFER_RAW_new,
    4723             : };
    4724             : 
    4725             : 
    4726           1 : static PyObject *py_PAC_DATA_RAW_get_num_buffers(PyObject *obj, void *closure)
    4727             : {
    4728           1 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(obj);
    4729           1 :         PyObject *py_num_buffers;
    4730           1 :         py_num_buffers = PyLong_FromUnsignedLongLong((uint32_t)object->num_buffers);
    4731           1 :         return py_num_buffers;
    4732             : }
    4733             : 
    4734           0 : static int py_PAC_DATA_RAW_set_num_buffers(PyObject *py_obj, PyObject *value, void *closure)
    4735             : {
    4736           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    4737           0 :         if (value == NULL) {
    4738           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_buffers");
    4739           0 :                 return -1;
    4740             :         }
    4741             :         {
    4742           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_buffers));
    4743           0 :                 if (PyLong_Check(value)) {
    4744           0 :                         unsigned long long test_var;
    4745           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4746           0 :                         if (PyErr_Occurred() != NULL) {
    4747           0 :                                 return -1;
    4748             :                         }
    4749           0 :                         if (test_var > uint_max) {
    4750           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4751             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4752           0 :                                 return -1;
    4753             :                         }
    4754           0 :                         object->num_buffers = test_var;
    4755             :                 } else {
    4756           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4757             :                           PyLong_Type.tp_name);
    4758           0 :                         return -1;
    4759             :                 }
    4760             :         }
    4761           0 :         return 0;
    4762             : }
    4763             : 
    4764           1 : static PyObject *py_PAC_DATA_RAW_get_version(PyObject *obj, void *closure)
    4765             : {
    4766           1 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(obj);
    4767           1 :         PyObject *py_version;
    4768           1 :         py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
    4769           1 :         return py_version;
    4770             : }
    4771             : 
    4772           0 : static int py_PAC_DATA_RAW_set_version(PyObject *py_obj, PyObject *value, void *closure)
    4773             : {
    4774           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    4775           0 :         if (value == NULL) {
    4776           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
    4777           0 :                 return -1;
    4778             :         }
    4779             :         {
    4780           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
    4781           0 :                 if (PyLong_Check(value)) {
    4782           0 :                         unsigned long long test_var;
    4783           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4784           0 :                         if (PyErr_Occurred() != NULL) {
    4785           0 :                                 return -1;
    4786             :                         }
    4787           0 :                         if (test_var > uint_max) {
    4788           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4789             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4790           0 :                                 return -1;
    4791             :                         }
    4792           0 :                         object->version = test_var;
    4793             :                 } else {
    4794           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4795             :                           PyLong_Type.tp_name);
    4796           0 :                         return -1;
    4797             :                 }
    4798             :         }
    4799           0 :         return 0;
    4800             : }
    4801             : 
    4802        8127 : static PyObject *py_PAC_DATA_RAW_get_buffers(PyObject *obj, void *closure)
    4803             : {
    4804        8127 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(obj);
    4805           0 :         PyObject *py_buffers;
    4806        8127 :         py_buffers = PyList_New(object->num_buffers);
    4807        8127 :         if (py_buffers == NULL) {
    4808           0 :                 return NULL;
    4809             :         }
    4810             :         {
    4811             :                 int buffers_cntr_0;
    4812       68551 :                 for (buffers_cntr_0 = 0; buffers_cntr_0 < (object->num_buffers); buffers_cntr_0++) {
    4813           0 :                         PyObject *py_buffers_0;
    4814       60424 :                         py_buffers_0 = pytalloc_reference_ex(&PAC_BUFFER_RAW_Type, object->buffers, &object->buffers[buffers_cntr_0]);
    4815       60424 :                         PyList_SetItem(py_buffers, buffers_cntr_0, py_buffers_0);
    4816             :                 }
    4817             :         }
    4818        8127 :         return py_buffers;
    4819             : }
    4820             : 
    4821           0 : static int py_PAC_DATA_RAW_set_buffers(PyObject *py_obj, PyObject *value, void *closure)
    4822             : {
    4823           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    4824           0 :         if (value == NULL) {
    4825           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffers");
    4826           0 :                 return -1;
    4827             :         }
    4828           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    4829             :         {
    4830           0 :                 int buffers_cntr_0;
    4831           0 :                 object->buffers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffers, PyList_GET_SIZE(value));
    4832           0 :                 if (!object->buffers) { return -1; }
    4833           0 :                 talloc_set_name_const(object->buffers, "ARRAY: object->buffers");
    4834           0 :                 for (buffers_cntr_0 = 0; buffers_cntr_0 < PyList_GET_SIZE(value); buffers_cntr_0++) {
    4835           0 :                         if (PyList_GET_ITEM(value, buffers_cntr_0) == NULL) {
    4836           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffers[buffers_cntr_0]");
    4837           0 :                                 return -1;
    4838             :                         }
    4839           0 :                         PY_CHECK_TYPE(&PAC_BUFFER_RAW_Type, PyList_GET_ITEM(value, buffers_cntr_0), return -1;);
    4840           0 :                         if (talloc_reference(object->buffers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, buffers_cntr_0))) == NULL) {
    4841           0 :                                 PyErr_NoMemory();
    4842           0 :                                 return -1;
    4843             :                         }
    4844           0 :                         object->buffers[buffers_cntr_0] = *(struct PAC_BUFFER_RAW *)pytalloc_get_ptr(PyList_GET_ITEM(value, buffers_cntr_0));
    4845             :                 }
    4846             :         }
    4847           0 :         return 0;
    4848             : }
    4849             : 
    4850             : static PyGetSetDef py_PAC_DATA_RAW_getsetters[] = {
    4851             :         {
    4852             :                 .name = discard_const_p(char, "num_buffers"),
    4853             :                 .get = py_PAC_DATA_RAW_get_num_buffers,
    4854             :                 .set = py_PAC_DATA_RAW_set_num_buffers,
    4855             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4856             :         },
    4857             :         {
    4858             :                 .name = discard_const_p(char, "version"),
    4859             :                 .get = py_PAC_DATA_RAW_get_version,
    4860             :                 .set = py_PAC_DATA_RAW_set_version,
    4861             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4862             :         },
    4863             :         {
    4864             :                 .name = discard_const_p(char, "buffers"),
    4865             :                 .get = py_PAC_DATA_RAW_get_buffers,
    4866             :                 .set = py_PAC_DATA_RAW_set_buffers,
    4867             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_BUFFER_RAW")
    4868             :         },
    4869             :         { .name = NULL }
    4870             : };
    4871             : 
    4872        8128 : static PyObject *py_PAC_DATA_RAW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4873             : {
    4874        8128 :         return pytalloc_new(struct PAC_DATA_RAW, type);
    4875             : }
    4876             : 
    4877       12246 : static PyObject *py_PAC_DATA_RAW_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    4878             : {
    4879       12246 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    4880       12246 :         PyObject *ret = NULL;
    4881           0 :         DATA_BLOB blob;
    4882           0 :         enum ndr_err_code err;
    4883       12246 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    4884       12246 :         if (tmp_ctx == NULL) {
    4885           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4886           0 :                 return NULL;
    4887             :         }
    4888       12246 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_DATA_RAW);
    4889       12246 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4890           0 :                 TALLOC_FREE(tmp_ctx);
    4891           0 :                 PyErr_SetNdrError(err);
    4892           0 :                 return NULL;
    4893             :         }
    4894             : 
    4895       12246 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4896       12246 :         TALLOC_FREE(tmp_ctx);
    4897       12246 :         return ret;
    4898             : }
    4899             : 
    4900        8128 : static PyObject *py_PAC_DATA_RAW_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4901             : {
    4902        8128 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    4903        8128 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    4904        8128 :         Py_ssize_t blob_length = 0;
    4905           1 :         enum ndr_err_code err;
    4906        8128 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    4907        8128 :         PyObject *allow_remaining_obj = NULL;
    4908        8128 :         bool allow_remaining = false;
    4909             : 
    4910        8128 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    4911             :                 discard_const_p(char *, kwnames),
    4912             :                 &blob.data, &blob_length,
    4913             :                 &allow_remaining_obj)) {
    4914           0 :                 return NULL;
    4915             :         }
    4916        8128 :         blob.length = blob_length;
    4917             : 
    4918        8128 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4919           0 :                 allow_remaining = true;
    4920             :         }
    4921             : 
    4922        8127 :         if (allow_remaining) {
    4923           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA_RAW);
    4924             :         } else {
    4925        8128 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA_RAW);
    4926             :         }
    4927        8128 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4928           0 :                 PyErr_SetNdrError(err);
    4929           0 :                 return NULL;
    4930             :         }
    4931             : 
    4932        8128 :         Py_RETURN_NONE;
    4933             : }
    4934             : 
    4935           0 : static PyObject *py_PAC_DATA_RAW_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4936             : {
    4937           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    4938           0 :         PyObject *ret;
    4939           0 :         char *retstr;
    4940             : 
    4941           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_DATA_RAW, "PAC_DATA_RAW", object);
    4942           0 :         ret = PyUnicode_FromString(retstr);
    4943           0 :         talloc_free(retstr);
    4944             : 
    4945           0 :         return ret;
    4946             : }
    4947             : 
    4948             : static PyMethodDef py_PAC_DATA_RAW_methods[] = {
    4949             :         { "__ndr_pack__", (PyCFunction)py_PAC_DATA_RAW_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    4950             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_DATA_RAW_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    4951             :         { "__ndr_print__", (PyCFunction)py_PAC_DATA_RAW_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    4952             :         { NULL, NULL, 0, NULL }
    4953             : };
    4954             : 
    4955             : 
    4956             : static PyTypeObject PAC_DATA_RAW_Type = {
    4957             :         PyVarObject_HEAD_INIT(NULL, 0)
    4958             :         .tp_name = "krb5pac.PAC_DATA_RAW",
    4959             :         .tp_getset = py_PAC_DATA_RAW_getsetters,
    4960             :         .tp_methods = py_PAC_DATA_RAW_methods,
    4961             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4962             :         .tp_new = py_PAC_DATA_RAW_new,
    4963             : };
    4964             : 
    4965             : 
    4966           0 : static PyObject *py_PAC_Validate_get_MessageType(PyObject *obj, void *closure)
    4967             : {
    4968           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    4969           0 :         PyObject *py_MessageType;
    4970           0 :         py_MessageType = PyLong_FromUnsignedLongLong((uint32_t)object->MessageType);
    4971           0 :         return py_MessageType;
    4972             : }
    4973             : 
    4974           0 : static int py_PAC_Validate_set_MessageType(PyObject *py_obj, PyObject *value, void *closure)
    4975             : {
    4976           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    4977           0 :         if (value == NULL) {
    4978           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MessageType");
    4979           0 :                 return -1;
    4980             :         }
    4981             :         {
    4982           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MessageType));
    4983           0 :                 if (PyLong_Check(value)) {
    4984           0 :                         unsigned long long test_var;
    4985           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4986           0 :                         if (PyErr_Occurred() != NULL) {
    4987           0 :                                 return -1;
    4988             :                         }
    4989           0 :                         if (test_var > uint_max) {
    4990           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    4991             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4992           0 :                                 return -1;
    4993             :                         }
    4994           0 :                         object->MessageType = test_var;
    4995             :                 } else {
    4996           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    4997             :                           PyLong_Type.tp_name);
    4998           0 :                         return -1;
    4999             :                 }
    5000             :         }
    5001           0 :         return 0;
    5002             : }
    5003             : 
    5004           0 : static PyObject *py_PAC_Validate_get_ChecksumLength(PyObject *obj, void *closure)
    5005             : {
    5006           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    5007           0 :         PyObject *py_ChecksumLength;
    5008           0 :         py_ChecksumLength = PyLong_FromUnsignedLongLong((uint32_t)object->ChecksumLength);
    5009           0 :         return py_ChecksumLength;
    5010             : }
    5011             : 
    5012           0 : static int py_PAC_Validate_set_ChecksumLength(PyObject *py_obj, PyObject *value, void *closure)
    5013             : {
    5014           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    5015           0 :         if (value == NULL) {
    5016           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ChecksumLength");
    5017           0 :                 return -1;
    5018             :         }
    5019             :         {
    5020           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ChecksumLength));
    5021           0 :                 if (PyLong_Check(value)) {
    5022           0 :                         unsigned long long test_var;
    5023           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5024           0 :                         if (PyErr_Occurred() != NULL) {
    5025           0 :                                 return -1;
    5026             :                         }
    5027           0 :                         if (test_var > uint_max) {
    5028           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    5029             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5030           0 :                                 return -1;
    5031             :                         }
    5032           0 :                         object->ChecksumLength = test_var;
    5033             :                 } else {
    5034           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5035             :                           PyLong_Type.tp_name);
    5036           0 :                         return -1;
    5037             :                 }
    5038             :         }
    5039           0 :         return 0;
    5040             : }
    5041             : 
    5042           0 : static PyObject *py_PAC_Validate_get_SignatureType(PyObject *obj, void *closure)
    5043             : {
    5044           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    5045           0 :         PyObject *py_SignatureType;
    5046           0 :         py_SignatureType = PyLong_FromLong(object->SignatureType);
    5047           0 :         return py_SignatureType;
    5048             : }
    5049             : 
    5050           0 : static int py_PAC_Validate_set_SignatureType(PyObject *py_obj, PyObject *value, void *closure)
    5051             : {
    5052           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    5053           0 :         if (value == NULL) {
    5054           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SignatureType");
    5055           0 :                 return -1;
    5056             :         }
    5057             :         {
    5058           0 :                 const long long int_max = ndr_sizeof2intmax(sizeof(object->SignatureType));
    5059           0 :                 const long long int_min = -int_max - 1;
    5060           0 :                 if (PyLong_Check(value)) {
    5061           0 :                         long long test_var;
    5062           0 :                         test_var = PyLong_AsLongLong(value);
    5063           0 :                         if (PyErr_Occurred() != NULL) {
    5064           0 :                                 return -1;
    5065             :                         }
    5066           0 :                         if (test_var < int_min || test_var > int_max) {
    5067           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
    5068             :                                   PyLong_Type.tp_name, int_min, int_max, test_var);
    5069           0 :                                 return -1;
    5070             :                         }
    5071           0 :                         object->SignatureType = test_var;
    5072             :                 } else {
    5073           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5074             :                           PyLong_Type.tp_name);
    5075           0 :                         return -1;
    5076             :                 }
    5077             :         }
    5078           0 :         return 0;
    5079             : }
    5080             : 
    5081           0 : static PyObject *py_PAC_Validate_get_SignatureLength(PyObject *obj, void *closure)
    5082             : {
    5083           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    5084           0 :         PyObject *py_SignatureLength;
    5085           0 :         py_SignatureLength = PyLong_FromUnsignedLongLong((uint32_t)object->SignatureLength);
    5086           0 :         return py_SignatureLength;
    5087             : }
    5088             : 
    5089           0 : static int py_PAC_Validate_set_SignatureLength(PyObject *py_obj, PyObject *value, void *closure)
    5090             : {
    5091           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    5092           0 :         if (value == NULL) {
    5093           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SignatureLength");
    5094           0 :                 return -1;
    5095             :         }
    5096             :         {
    5097           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SignatureLength));
    5098           0 :                 if (PyLong_Check(value)) {
    5099           0 :                         unsigned long long test_var;
    5100           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5101           0 :                         if (PyErr_Occurred() != NULL) {
    5102           0 :                                 return -1;
    5103             :                         }
    5104           0 :                         if (test_var > uint_max) {
    5105           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
    5106             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5107           0 :                                 return -1;
    5108             :                         }
    5109           0 :                         object->SignatureLength = test_var;
    5110             :                 } else {
    5111           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5112             :                           PyLong_Type.tp_name);
    5113           0 :                         return -1;
    5114             :                 }
    5115             :         }
    5116           0 :         return 0;
    5117             : }
    5118             : 
    5119           0 : static PyObject *py_PAC_Validate_get_ChecksumAndSignature(PyObject *obj, void *closure)
    5120             : {
    5121           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    5122           0 :         PyObject *py_ChecksumAndSignature;
    5123           0 :         py_ChecksumAndSignature = PyBytes_FromStringAndSize((char *)(object->ChecksumAndSignature).data, (object->ChecksumAndSignature).length);
    5124           0 :         return py_ChecksumAndSignature;
    5125             : }
    5126             : 
    5127           0 : static int py_PAC_Validate_set_ChecksumAndSignature(PyObject *py_obj, PyObject *value, void *closure)
    5128             : {
    5129           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    5130           0 :         if (value == NULL) {
    5131           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ChecksumAndSignature");
    5132           0 :                 return -1;
    5133             :         }
    5134           0 :         object->ChecksumAndSignature = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    5135           0 :         return 0;
    5136             : }
    5137             : 
    5138             : static PyGetSetDef py_PAC_Validate_getsetters[] = {
    5139             :         {
    5140             :                 .name = discard_const_p(char, "MessageType"),
    5141             :                 .get = py_PAC_Validate_get_MessageType,
    5142             :                 .set = py_PAC_Validate_set_MessageType,
    5143             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5144             :         },
    5145             :         {
    5146             :                 .name = discard_const_p(char, "ChecksumLength"),
    5147             :                 .get = py_PAC_Validate_get_ChecksumLength,
    5148             :                 .set = py_PAC_Validate_set_ChecksumLength,
    5149             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5150             :         },
    5151             :         {
    5152             :                 .name = discard_const_p(char, "SignatureType"),
    5153             :                 .get = py_PAC_Validate_get_SignatureType,
    5154             :                 .set = py_PAC_Validate_set_SignatureType,
    5155             :                 .doc = discard_const_p(char, "PIDL-generated element of base type int32")
    5156             :         },
    5157             :         {
    5158             :                 .name = discard_const_p(char, "SignatureLength"),
    5159             :                 .get = py_PAC_Validate_get_SignatureLength,
    5160             :                 .set = py_PAC_Validate_set_SignatureLength,
    5161             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5162             :         },
    5163             :         {
    5164             :                 .name = discard_const_p(char, "ChecksumAndSignature"),
    5165             :                 .get = py_PAC_Validate_get_ChecksumAndSignature,
    5166             :                 .set = py_PAC_Validate_set_ChecksumAndSignature,
    5167             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    5168             :         },
    5169             :         { .name = NULL }
    5170             : };
    5171             : 
    5172           0 : static PyObject *py_PAC_Validate_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5173             : {
    5174           0 :         return pytalloc_new(struct PAC_Validate, type);
    5175             : }
    5176             : 
    5177           0 : static PyObject *py_PAC_Validate_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    5178             : {
    5179           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    5180           0 :         PyObject *ret = NULL;
    5181           0 :         DATA_BLOB blob;
    5182           0 :         enum ndr_err_code err;
    5183           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    5184           0 :         if (tmp_ctx == NULL) {
    5185           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5186           0 :                 return NULL;
    5187             :         }
    5188           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_Validate);
    5189           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5190           0 :                 TALLOC_FREE(tmp_ctx);
    5191           0 :                 PyErr_SetNdrError(err);
    5192           0 :                 return NULL;
    5193             :         }
    5194             : 
    5195           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5196           0 :         TALLOC_FREE(tmp_ctx);
    5197           0 :         return ret;
    5198             : }
    5199             : 
    5200           0 : static PyObject *py_PAC_Validate_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5201             : {
    5202           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    5203           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    5204           0 :         Py_ssize_t blob_length = 0;
    5205           0 :         enum ndr_err_code err;
    5206           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    5207           0 :         PyObject *allow_remaining_obj = NULL;
    5208           0 :         bool allow_remaining = false;
    5209             : 
    5210           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    5211             :                 discard_const_p(char *, kwnames),
    5212             :                 &blob.data, &blob_length,
    5213             :                 &allow_remaining_obj)) {
    5214           0 :                 return NULL;
    5215             :         }
    5216           0 :         blob.length = blob_length;
    5217             : 
    5218           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5219           0 :                 allow_remaining = true;
    5220             :         }
    5221             : 
    5222           0 :         if (allow_remaining) {
    5223           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_Validate);
    5224             :         } else {
    5225           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_Validate);
    5226             :         }
    5227           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5228           0 :                 PyErr_SetNdrError(err);
    5229           0 :                 return NULL;
    5230             :         }
    5231             : 
    5232           0 :         Py_RETURN_NONE;
    5233             : }
    5234             : 
    5235           0 : static PyObject *py_PAC_Validate_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5236             : {
    5237           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    5238           0 :         PyObject *ret;
    5239           0 :         char *retstr;
    5240             : 
    5241           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_Validate, "PAC_Validate", object);
    5242           0 :         ret = PyUnicode_FromString(retstr);
    5243           0 :         talloc_free(retstr);
    5244             : 
    5245           0 :         return ret;
    5246             : }
    5247             : 
    5248             : static PyMethodDef py_PAC_Validate_methods[] = {
    5249             :         { "__ndr_pack__", (PyCFunction)py_PAC_Validate_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    5250             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_Validate_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    5251             :         { "__ndr_print__", (PyCFunction)py_PAC_Validate_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    5252             :         { NULL, NULL, 0, NULL }
    5253             : };
    5254             : 
    5255             : 
    5256             : static PyTypeObject PAC_Validate_Type = {
    5257             :         PyVarObject_HEAD_INIT(NULL, 0)
    5258             :         .tp_name = "krb5pac.PAC_Validate",
    5259             :         .tp_getset = py_PAC_Validate_getsetters,
    5260             :         .tp_methods = py_PAC_Validate_methods,
    5261             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5262             :         .tp_new = py_PAC_Validate_new,
    5263             : };
    5264             : 
    5265             : 
    5266           0 : static PyObject *py_netsamlogoncache_entry_get_timestamp(PyObject *obj, void *closure)
    5267             : {
    5268           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(obj);
    5269           0 :         PyObject *py_timestamp;
    5270           0 :         py_timestamp = PyLong_FromLong(object->timestamp);
    5271           0 :         return py_timestamp;
    5272             : }
    5273             : 
    5274           0 : static int py_netsamlogoncache_entry_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
    5275             : {
    5276           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    5277           0 :         if (value == NULL) {
    5278           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timestamp");
    5279           0 :                 return -1;
    5280             :         }
    5281             :         {
    5282           0 :                 const long long int_max = ndr_sizeof2intmax(sizeof(object->timestamp));
    5283           0 :                 const long long int_min = -int_max - 1;
    5284           0 :                 if (PyLong_Check(value)) {
    5285           0 :                         long long test_var;
    5286           0 :                         test_var = PyLong_AsLongLong(value);
    5287           0 :                         if (PyErr_Occurred() != NULL) {
    5288           0 :                                 return -1;
    5289             :                         }
    5290           0 :                         if (test_var < int_min || test_var > int_max) {
    5291           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
    5292             :                                   PyLong_Type.tp_name, int_min, int_max, test_var);
    5293           0 :                                 return -1;
    5294             :                         }
    5295           0 :                         object->timestamp = test_var;
    5296             :                 } else {
    5297           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",
    5298             :                           PyLong_Type.tp_name);
    5299           0 :                         return -1;
    5300             :                 }
    5301             :         }
    5302           0 :         return 0;
    5303             : }
    5304             : 
    5305           0 : static PyObject *py_netsamlogoncache_entry_get_info3(PyObject *obj, void *closure)
    5306             : {
    5307           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(obj);
    5308           0 :         PyObject *py_info3;
    5309           0 :         py_info3 = pytalloc_reference_ex(netr_SamInfo3_Type, pytalloc_get_mem_ctx(obj), &object->info3);
    5310           0 :         return py_info3;
    5311             : }
    5312             : 
    5313           0 : static int py_netsamlogoncache_entry_set_info3(PyObject *py_obj, PyObject *value, void *closure)
    5314             : {
    5315           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    5316           0 :         if (value == NULL) {
    5317           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info3");
    5318           0 :                 return -1;
    5319             :         }
    5320           0 :         PY_CHECK_TYPE(netr_SamInfo3_Type, value, return -1;);
    5321           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    5322           0 :                 PyErr_NoMemory();
    5323           0 :                 return -1;
    5324             :         }
    5325           0 :         object->info3 = *(struct netr_SamInfo3 *)pytalloc_get_ptr(value);
    5326           0 :         return 0;
    5327             : }
    5328             : 
    5329             : static PyGetSetDef py_netsamlogoncache_entry_getsetters[] = {
    5330             :         {
    5331             :                 .name = discard_const_p(char, "timestamp"),
    5332             :                 .get = py_netsamlogoncache_entry_get_timestamp,
    5333             :                 .set = py_netsamlogoncache_entry_set_timestamp,
    5334             :                 .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
    5335             :         },
    5336             :         {
    5337             :                 .name = discard_const_p(char, "info3"),
    5338             :                 .get = py_netsamlogoncache_entry_get_info3,
    5339             :                 .set = py_netsamlogoncache_entry_set_info3,
    5340             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamInfo3")
    5341             :         },
    5342             :         { .name = NULL }
    5343             : };
    5344             : 
    5345           0 : static PyObject *py_netsamlogoncache_entry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5346             : {
    5347           0 :         return pytalloc_new(struct netsamlogoncache_entry, type);
    5348             : }
    5349             : 
    5350           0 : static PyObject *py_netsamlogoncache_entry_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    5351             : {
    5352           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    5353           0 :         PyObject *ret = NULL;
    5354           0 :         DATA_BLOB blob;
    5355           0 :         enum ndr_err_code err;
    5356           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    5357           0 :         if (tmp_ctx == NULL) {
    5358           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    5359           0 :                 return NULL;
    5360             :         }
    5361           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netsamlogoncache_entry);
    5362           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5363           0 :                 TALLOC_FREE(tmp_ctx);
    5364           0 :                 PyErr_SetNdrError(err);
    5365           0 :                 return NULL;
    5366             :         }
    5367             : 
    5368           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    5369           0 :         TALLOC_FREE(tmp_ctx);
    5370           0 :         return ret;
    5371             : }
    5372             : 
    5373           0 : static PyObject *py_netsamlogoncache_entry_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    5374             : {
    5375           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    5376           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    5377           0 :         Py_ssize_t blob_length = 0;
    5378           0 :         enum ndr_err_code err;
    5379           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    5380           0 :         PyObject *allow_remaining_obj = NULL;
    5381           0 :         bool allow_remaining = false;
    5382             : 
    5383           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    5384             :                 discard_const_p(char *, kwnames),
    5385             :                 &blob.data, &blob_length,
    5386             :                 &allow_remaining_obj)) {
    5387           0 :                 return NULL;
    5388             :         }
    5389           0 :         blob.length = blob_length;
    5390             : 
    5391           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    5392           0 :                 allow_remaining = true;
    5393             :         }
    5394             : 
    5395           0 :         if (allow_remaining) {
    5396           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netsamlogoncache_entry);
    5397             :         } else {
    5398           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netsamlogoncache_entry);
    5399             :         }
    5400           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    5401           0 :                 PyErr_SetNdrError(err);
    5402           0 :                 return NULL;
    5403             :         }
    5404             : 
    5405           0 :         Py_RETURN_NONE;
    5406             : }
    5407             : 
    5408           0 : static PyObject *py_netsamlogoncache_entry_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    5409             : {
    5410           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    5411           0 :         PyObject *ret;
    5412           0 :         char *retstr;
    5413             : 
    5414           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netsamlogoncache_entry, "netsamlogoncache_entry", object);
    5415           0 :         ret = PyUnicode_FromString(retstr);
    5416           0 :         talloc_free(retstr);
    5417             : 
    5418           0 :         return ret;
    5419             : }
    5420             : 
    5421             : static PyMethodDef py_netsamlogoncache_entry_methods[] = {
    5422             :         { "__ndr_pack__", (PyCFunction)py_netsamlogoncache_entry_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    5423             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netsamlogoncache_entry_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    5424             :         { "__ndr_print__", (PyCFunction)py_netsamlogoncache_entry_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    5425             :         { NULL, NULL, 0, NULL }
    5426             : };
    5427             : 
    5428             : 
    5429             : static PyTypeObject netsamlogoncache_entry_Type = {
    5430             :         PyVarObject_HEAD_INIT(NULL, 0)
    5431             :         .tp_name = "krb5pac.netsamlogoncache_entry",
    5432             :         .tp_getset = py_netsamlogoncache_entry_getsetters,
    5433             :         .tp_methods = py_netsamlogoncache_entry_methods,
    5434             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5435             :         .tp_new = py_netsamlogoncache_entry_new,
    5436             : };
    5437             : 
    5438             : 
    5439             : const struct PyNdrRpcMethodDef py_ndr_krb5pac_methods[] = {
    5440             :         {0}
    5441             : };
    5442             : 
    5443           0 : static PyObject *interface_krb5pac_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5444             : {
    5445           0 :         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_krb5pac);
    5446             : }
    5447             : 
    5448             : #define PY_DOC_KRB5PAC "Active Directory KRB5 PAC"
    5449             : static PyTypeObject krb5pac_InterfaceType = {
    5450             :         PyVarObject_HEAD_INIT(NULL, 0)
    5451             :         .tp_name = "krb5pac.krb5pac",
    5452             :         .tp_basicsize = sizeof(dcerpc_InterfaceObject),
    5453             :         .tp_doc = "krb5pac(binding, lp_ctx=None, credentials=None) -> connection\n"
    5454             : "\n"
    5455             : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
    5456             : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
    5457             : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_KRB5PAC,
    5458             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5459             :         .tp_new = interface_krb5pac_new,
    5460             : };
    5461             : 
    5462           0 : static PyObject *syntax_krb5pac_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5463             : {
    5464           0 :         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_krb5pac.syntax_id);
    5465             : }
    5466             : 
    5467             : #define PY_DOC_KRB5PAC_SYNTAX "Active Directory KRB5 PAC"
    5468             : static PyTypeObject krb5pac_SyntaxType = {
    5469             :         PyVarObject_HEAD_INIT(NULL, 0)
    5470             :         .tp_name = "krb5pac.krb5pac_abstract_syntax",
    5471             :         .tp_doc = "krb5pac_abstract_syntax()\n"PY_DOC_KRB5PAC_SYNTAX,
    5472             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5473             :         .tp_new = syntax_krb5pac_new,
    5474             : };
    5475             : 
    5476             : static PyMethodDef krb5pac_methods[] = {
    5477             :         { NULL, NULL, 0, NULL }
    5478             : };
    5479             : 
    5480             : static struct PyModuleDef moduledef = {
    5481             :         PyModuleDef_HEAD_INIT,
    5482             :         .m_name = "krb5pac",
    5483             :         .m_doc = "krb5pac DCE/RPC",
    5484             :         .m_size = -1,
    5485             :         .m_methods = krb5pac_methods,
    5486             : };
    5487        3437 : MODULE_INIT_FUNC(krb5pac)
    5488             : {
    5489        3437 :         PyObject *m = NULL;
    5490        3437 :         PyObject *dep_samba_dcerpc_security = NULL;
    5491        3437 :         PyObject *dep_samba_dcerpc_lsa = NULL;
    5492        3437 :         PyObject *dep_samba_dcerpc_netlogon = NULL;
    5493        3437 :         PyObject *dep_samba_dcerpc_samr = NULL;
    5494        3437 :         PyObject *dep_talloc = NULL;
    5495        3437 :         PyObject *dep_samba_dcerpc_base = NULL;
    5496        3437 :         PyObject *dep_samba_dcerpc_misc = NULL;
    5497             : 
    5498        3437 :         dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
    5499        3437 :         if (dep_samba_dcerpc_security == NULL)
    5500           0 :                 goto out;
    5501             : 
    5502        3437 :         dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
    5503        3437 :         if (dep_samba_dcerpc_lsa == NULL)
    5504           0 :                 goto out;
    5505             : 
    5506        3437 :         dep_samba_dcerpc_netlogon = PyImport_ImportModule("samba.dcerpc.netlogon");
    5507        3437 :         if (dep_samba_dcerpc_netlogon == NULL)
    5508           0 :                 goto out;
    5509             : 
    5510        3437 :         dep_samba_dcerpc_samr = PyImport_ImportModule("samba.dcerpc.samr");
    5511        3437 :         if (dep_samba_dcerpc_samr == NULL)
    5512           0 :                 goto out;
    5513             : 
    5514        3437 :         dep_talloc = PyImport_ImportModule("talloc");
    5515        3437 :         if (dep_talloc == NULL)
    5516           0 :                 goto out;
    5517             : 
    5518        3437 :         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
    5519        3437 :         if (dep_samba_dcerpc_base == NULL)
    5520           0 :                 goto out;
    5521             : 
    5522        3437 :         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
    5523        3437 :         if (dep_samba_dcerpc_misc == NULL)
    5524           0 :                 goto out;
    5525             : 
    5526        3437 :         BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
    5527        3437 :         if (BaseObject_Type == NULL)
    5528           0 :                 goto out;
    5529             : 
    5530        3437 :         dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
    5531        3437 :         if (dom_sid_Type == NULL)
    5532           0 :                 goto out;
    5533             : 
    5534        3437 :         samr_RidWithAttributeArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "RidWithAttributeArray");
    5535        3437 :         if (samr_RidWithAttributeArray_Type == NULL)
    5536           0 :                 goto out;
    5537             : 
    5538        3437 :         netr_SamInfo3_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_SamInfo3");
    5539        3437 :         if (netr_SamInfo3_Type == NULL)
    5540           0 :                 goto out;
    5541             : 
    5542        3437 :         samr_Password_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "Password");
    5543        3437 :         if (samr_Password_Type == NULL)
    5544           0 :                 goto out;
    5545             : 
    5546        3437 :         lsa_String_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "String");
    5547        3437 :         if (lsa_String_Type == NULL)
    5548           0 :                 goto out;
    5549             : 
    5550        3437 :         netr_SidAttr_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_SidAttr");
    5551        3437 :         if (netr_SidAttr_Type == NULL)
    5552           0 :                 goto out;
    5553             : 
    5554        3437 :         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
    5555        3437 :         if (ClientConnection_Type == NULL)
    5556           0 :                 goto out;
    5557             : 
    5558        3437 :         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
    5559        3437 :         if (ndr_syntax_id_Type == NULL)
    5560           0 :                 goto out;
    5561             : 
    5562        3437 :         PAC_LOGON_NAME_Type.tp_base = BaseObject_Type;
    5563        3437 :         PAC_LOGON_NAME_Type.tp_basicsize = pytalloc_BaseObject_size();
    5564             : 
    5565        3437 :         PAC_SIGNATURE_DATA_Type.tp_base = BaseObject_Type;
    5566        3437 :         PAC_SIGNATURE_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();
    5567             : 
    5568        3437 :         PAC_DOMAIN_GROUP_MEMBERSHIP_Type.tp_base = BaseObject_Type;
    5569        3437 :         PAC_DOMAIN_GROUP_MEMBERSHIP_Type.tp_basicsize = pytalloc_BaseObject_size();
    5570             : 
    5571        3437 :         PAC_LOGON_INFO_Type.tp_base = BaseObject_Type;
    5572        3437 :         PAC_LOGON_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    5573             : 
    5574        3437 :         PAC_CREDENTIAL_NTLM_SECPKG_Type.tp_base = BaseObject_Type;
    5575        3437 :         PAC_CREDENTIAL_NTLM_SECPKG_Type.tp_basicsize = pytalloc_BaseObject_size();
    5576             : 
    5577        3437 :         PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type.tp_base = BaseObject_Type;
    5578        3437 :         PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type.tp_basicsize = pytalloc_BaseObject_size();
    5579             : 
    5580        3437 :         PAC_CREDENTIAL_DATA_Type.tp_base = BaseObject_Type;
    5581        3437 :         PAC_CREDENTIAL_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();
    5582             : 
    5583        3437 :         PAC_CREDENTIAL_DATA_CTR_Type.tp_base = BaseObject_Type;
    5584        3437 :         PAC_CREDENTIAL_DATA_CTR_Type.tp_basicsize = pytalloc_BaseObject_size();
    5585             : 
    5586        3437 :         PAC_CREDENTIAL_DATA_NDR_Type.tp_base = BaseObject_Type;
    5587        3437 :         PAC_CREDENTIAL_DATA_NDR_Type.tp_basicsize = pytalloc_BaseObject_size();
    5588             : 
    5589        3437 :         PAC_CREDENTIAL_INFO_Type.tp_base = BaseObject_Type;
    5590        3437 :         PAC_CREDENTIAL_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    5591             : 
    5592        3437 :         PAC_CONSTRAINED_DELEGATION_Type.tp_base = BaseObject_Type;
    5593        3437 :         PAC_CONSTRAINED_DELEGATION_Type.tp_basicsize = pytalloc_BaseObject_size();
    5594             : 
    5595        3437 :         PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type.tp_base = BaseObject_Type;
    5596        3437 :         PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type.tp_basicsize = pytalloc_BaseObject_size();
    5597             : 
    5598        3437 :         PAC_UPN_DNS_INFO_EX_Type.tp_base = BaseObject_Type;
    5599        3437 :         PAC_UPN_DNS_INFO_EX_Type.tp_basicsize = pytalloc_BaseObject_size();
    5600             : 
    5601        3437 :         PAC_UPN_DNS_INFO_Type.tp_base = BaseObject_Type;
    5602        3437 :         PAC_UPN_DNS_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    5603             : 
    5604        3437 :         PAC_ATTRIBUTES_INFO_Type.tp_base = BaseObject_Type;
    5605        3437 :         PAC_ATTRIBUTES_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    5606             : 
    5607        3437 :         PAC_REQUESTER_SID_Type.tp_base = BaseObject_Type;
    5608        3437 :         PAC_REQUESTER_SID_Type.tp_basicsize = pytalloc_BaseObject_size();
    5609             : 
    5610        3437 :         PAC_LOGON_INFO_CTR_Type.tp_base = BaseObject_Type;
    5611        3437 :         PAC_LOGON_INFO_CTR_Type.tp_basicsize = pytalloc_BaseObject_size();
    5612             : 
    5613        3437 :         PAC_CONSTRAINED_DELEGATION_CTR_Type.tp_base = BaseObject_Type;
    5614        3437 :         PAC_CONSTRAINED_DELEGATION_CTR_Type.tp_basicsize = pytalloc_BaseObject_size();
    5615             : 
    5616        3437 :         PAC_DEVICE_INFO_Type.tp_base = BaseObject_Type;
    5617        3437 :         PAC_DEVICE_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    5618             : 
    5619        3437 :         PAC_DEVICE_INFO_CTR_Type.tp_base = BaseObject_Type;
    5620        3437 :         PAC_DEVICE_INFO_CTR_Type.tp_basicsize = pytalloc_BaseObject_size();
    5621             : 
    5622        3437 :         DATA_BLOB_REM_Type.tp_base = BaseObject_Type;
    5623        3437 :         DATA_BLOB_REM_Type.tp_basicsize = pytalloc_BaseObject_size();
    5624             : 
    5625        3437 :         PAC_INFO_Type.tp_base = BaseObject_Type;
    5626        3437 :         PAC_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    5627             : 
    5628        3437 :         PAC_BUFFER_Type.tp_base = BaseObject_Type;
    5629        3437 :         PAC_BUFFER_Type.tp_basicsize = pytalloc_BaseObject_size();
    5630             : 
    5631        3437 :         PAC_DATA_Type.tp_base = BaseObject_Type;
    5632        3437 :         PAC_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();
    5633             : 
    5634        3437 :         PAC_BUFFER_RAW_Type.tp_base = BaseObject_Type;
    5635        3437 :         PAC_BUFFER_RAW_Type.tp_basicsize = pytalloc_BaseObject_size();
    5636             : 
    5637        3437 :         PAC_DATA_RAW_Type.tp_base = BaseObject_Type;
    5638        3437 :         PAC_DATA_RAW_Type.tp_basicsize = pytalloc_BaseObject_size();
    5639             : 
    5640        3437 :         PAC_Validate_Type.tp_base = BaseObject_Type;
    5641        3437 :         PAC_Validate_Type.tp_basicsize = pytalloc_BaseObject_size();
    5642             : 
    5643        3437 :         netsamlogoncache_entry_Type.tp_base = BaseObject_Type;
    5644        3437 :         netsamlogoncache_entry_Type.tp_basicsize = pytalloc_BaseObject_size();
    5645             : 
    5646        3437 :         krb5pac_InterfaceType.tp_base = ClientConnection_Type;
    5647             : 
    5648        3437 :         krb5pac_SyntaxType.tp_base = ndr_syntax_id_Type;
    5649        3437 :         krb5pac_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
    5650             : 
    5651        3437 :         if (PyType_Ready(&PAC_LOGON_NAME_Type) < 0)
    5652           0 :                 goto out;
    5653        3437 :         if (PyType_Ready(&PAC_SIGNATURE_DATA_Type) < 0)
    5654           0 :                 goto out;
    5655        3437 :         if (PyType_Ready(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type) < 0)
    5656           0 :                 goto out;
    5657        3437 :         if (PyType_Ready(&PAC_LOGON_INFO_Type) < 0)
    5658           0 :                 goto out;
    5659        3437 :         if (PyType_Ready(&PAC_CREDENTIAL_NTLM_SECPKG_Type) < 0)
    5660           0 :                 goto out;
    5661        3437 :         if (PyType_Ready(&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type) < 0)
    5662           0 :                 goto out;
    5663        3437 :         if (PyType_Ready(&PAC_CREDENTIAL_DATA_Type) < 0)
    5664           0 :                 goto out;
    5665        3437 :         if (PyType_Ready(&PAC_CREDENTIAL_DATA_CTR_Type) < 0)
    5666           0 :                 goto out;
    5667        3437 :         if (PyType_Ready(&PAC_CREDENTIAL_DATA_NDR_Type) < 0)
    5668           0 :                 goto out;
    5669        3437 :         if (PyType_Ready(&PAC_CREDENTIAL_INFO_Type) < 0)
    5670           0 :                 goto out;
    5671        3437 :         if (PyType_Ready(&PAC_CONSTRAINED_DELEGATION_Type) < 0)
    5672           0 :                 goto out;
    5673        3437 :         if (PyType_Ready(&PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type) < 0)
    5674           0 :                 goto out;
    5675        3437 :         if (PyType_Ready(&PAC_UPN_DNS_INFO_EX_Type) < 0)
    5676           0 :                 goto out;
    5677        3437 :         if (PyType_Ready(&PAC_UPN_DNS_INFO_Type) < 0)
    5678           0 :                 goto out;
    5679        3437 :         if (PyType_Ready(&PAC_ATTRIBUTES_INFO_Type) < 0)
    5680           0 :                 goto out;
    5681        3437 :         if (PyType_Ready(&PAC_REQUESTER_SID_Type) < 0)
    5682           0 :                 goto out;
    5683        3437 :         if (PyType_Ready(&PAC_LOGON_INFO_CTR_Type) < 0)
    5684           0 :                 goto out;
    5685        3437 :         if (PyType_Ready(&PAC_CONSTRAINED_DELEGATION_CTR_Type) < 0)
    5686           0 :                 goto out;
    5687        3437 :         if (PyType_Ready(&PAC_DEVICE_INFO_Type) < 0)
    5688           0 :                 goto out;
    5689        3437 :         if (PyType_Ready(&PAC_DEVICE_INFO_CTR_Type) < 0)
    5690           0 :                 goto out;
    5691        3437 :         if (PyType_Ready(&DATA_BLOB_REM_Type) < 0)
    5692           0 :                 goto out;
    5693        3437 :         if (PyType_Ready(&PAC_INFO_Type) < 0)
    5694           0 :                 goto out;
    5695        3437 :         if (PyType_Ready(&PAC_BUFFER_Type) < 0)
    5696           0 :                 goto out;
    5697        3437 :         if (PyType_Ready(&PAC_DATA_Type) < 0)
    5698           0 :                 goto out;
    5699        3437 :         if (PyType_Ready(&PAC_BUFFER_RAW_Type) < 0)
    5700           0 :                 goto out;
    5701        3437 :         if (PyType_Ready(&PAC_DATA_RAW_Type) < 0)
    5702           0 :                 goto out;
    5703        3437 :         if (PyType_Ready(&PAC_Validate_Type) < 0)
    5704           0 :                 goto out;
    5705        3437 :         if (PyType_Ready(&netsamlogoncache_entry_Type) < 0)
    5706           0 :                 goto out;
    5707        3437 :         if (PyType_Ready(&krb5pac_InterfaceType) < 0)
    5708           0 :                 goto out;
    5709        3437 :         if (PyType_Ready(&krb5pac_SyntaxType) < 0)
    5710           0 :                 goto out;
    5711        3437 :         if (!PyInterface_AddNdrRpcMethods(&krb5pac_InterfaceType, py_ndr_krb5pac_methods))
    5712           0 :                 return NULL;
    5713             : 
    5714             : #ifdef PY_PAC_LOGON_NAME_PATCH
    5715             :         PY_PAC_LOGON_NAME_PATCH(&PAC_LOGON_NAME_Type);
    5716             : #endif
    5717             : #ifdef PY_PAC_SIGNATURE_DATA_PATCH
    5718             :         PY_PAC_SIGNATURE_DATA_PATCH(&PAC_SIGNATURE_DATA_Type);
    5719             : #endif
    5720             : #ifdef PY_PAC_DOMAIN_GROUP_MEMBERSHIP_PATCH
    5721             :         PY_PAC_DOMAIN_GROUP_MEMBERSHIP_PATCH(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type);
    5722             : #endif
    5723             : #ifdef PY_PAC_LOGON_INFO_PATCH
    5724             :         PY_PAC_LOGON_INFO_PATCH(&PAC_LOGON_INFO_Type);
    5725             : #endif
    5726             : #ifdef PY_PAC_CREDENTIAL_NTLM_SECPKG_PATCH
    5727             :         PY_PAC_CREDENTIAL_NTLM_SECPKG_PATCH(&PAC_CREDENTIAL_NTLM_SECPKG_Type);
    5728             : #endif
    5729             : #ifdef PY_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_PATCH
    5730             :         PY_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_PATCH(&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type);
    5731             : #endif
    5732             : #ifdef PY_PAC_CREDENTIAL_DATA_PATCH
    5733             :         PY_PAC_CREDENTIAL_DATA_PATCH(&PAC_CREDENTIAL_DATA_Type);
    5734             : #endif
    5735             : #ifdef PY_PAC_CREDENTIAL_DATA_CTR_PATCH
    5736             :         PY_PAC_CREDENTIAL_DATA_CTR_PATCH(&PAC_CREDENTIAL_DATA_CTR_Type);
    5737             : #endif
    5738             : #ifdef PY_PAC_CREDENTIAL_DATA_NDR_PATCH
    5739             :         PY_PAC_CREDENTIAL_DATA_NDR_PATCH(&PAC_CREDENTIAL_DATA_NDR_Type);
    5740             : #endif
    5741             : #ifdef PY_PAC_CREDENTIAL_INFO_PATCH
    5742             :         PY_PAC_CREDENTIAL_INFO_PATCH(&PAC_CREDENTIAL_INFO_Type);
    5743             : #endif
    5744             : #ifdef PY_PAC_CONSTRAINED_DELEGATION_PATCH
    5745             :         PY_PAC_CONSTRAINED_DELEGATION_PATCH(&PAC_CONSTRAINED_DELEGATION_Type);
    5746             : #endif
    5747             : #ifdef PY_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_PATCH
    5748             :         PY_PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_PATCH(&PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type);
    5749             : #endif
    5750             : #ifdef PY_PAC_UPN_DNS_INFO_EX_PATCH
    5751             :         PY_PAC_UPN_DNS_INFO_EX_PATCH(&PAC_UPN_DNS_INFO_EX_Type);
    5752             : #endif
    5753             : #ifdef PY_PAC_UPN_DNS_INFO_PATCH
    5754             :         PY_PAC_UPN_DNS_INFO_PATCH(&PAC_UPN_DNS_INFO_Type);
    5755             : #endif
    5756             : #ifdef PY_PAC_ATTRIBUTES_INFO_PATCH
    5757             :         PY_PAC_ATTRIBUTES_INFO_PATCH(&PAC_ATTRIBUTES_INFO_Type);
    5758             : #endif
    5759             : #ifdef PY_PAC_REQUESTER_SID_PATCH
    5760             :         PY_PAC_REQUESTER_SID_PATCH(&PAC_REQUESTER_SID_Type);
    5761             : #endif
    5762             : #ifdef PY_PAC_LOGON_INFO_CTR_PATCH
    5763             :         PY_PAC_LOGON_INFO_CTR_PATCH(&PAC_LOGON_INFO_CTR_Type);
    5764             : #endif
    5765             : #ifdef PY_PAC_CONSTRAINED_DELEGATION_CTR_PATCH
    5766             :         PY_PAC_CONSTRAINED_DELEGATION_CTR_PATCH(&PAC_CONSTRAINED_DELEGATION_CTR_Type);
    5767             : #endif
    5768             : #ifdef PY_PAC_DEVICE_INFO_PATCH
    5769             :         PY_PAC_DEVICE_INFO_PATCH(&PAC_DEVICE_INFO_Type);
    5770             : #endif
    5771             : #ifdef PY_PAC_DEVICE_INFO_CTR_PATCH
    5772             :         PY_PAC_DEVICE_INFO_CTR_PATCH(&PAC_DEVICE_INFO_CTR_Type);
    5773             : #endif
    5774             : #ifdef PY_DATA_BLOB_REM_PATCH
    5775             :         PY_DATA_BLOB_REM_PATCH(&DATA_BLOB_REM_Type);
    5776             : #endif
    5777             : #ifdef PY_PAC_INFO_PATCH
    5778             :         PY_PAC_INFO_PATCH(&PAC_INFO_Type);
    5779             : #endif
    5780             : #ifdef PY_PAC_BUFFER_PATCH
    5781             :         PY_PAC_BUFFER_PATCH(&PAC_BUFFER_Type);
    5782             : #endif
    5783             : #ifdef PY_PAC_DATA_PATCH
    5784             :         PY_PAC_DATA_PATCH(&PAC_DATA_Type);
    5785             : #endif
    5786             : #ifdef PY_PAC_BUFFER_RAW_PATCH
    5787             :         PY_PAC_BUFFER_RAW_PATCH(&PAC_BUFFER_RAW_Type);
    5788             : #endif
    5789             : #ifdef PY_PAC_DATA_RAW_PATCH
    5790             :         PY_PAC_DATA_RAW_PATCH(&PAC_DATA_RAW_Type);
    5791             : #endif
    5792             : #ifdef PY_PAC_VALIDATE_PATCH
    5793             :         PY_PAC_VALIDATE_PATCH(&PAC_Validate_Type);
    5794             : #endif
    5795             : #ifdef PY_NETSAMLOGONCACHE_ENTRY_PATCH
    5796             :         PY_NETSAMLOGONCACHE_ENTRY_PATCH(&netsamlogoncache_entry_Type);
    5797             : #endif
    5798             : #ifdef PY_KRB5PAC_PATCH
    5799             :         PY_KRB5PAC_PATCH(&krb5pac_InterfaceType);
    5800             : #endif
    5801             : #ifdef PY_KRB5PAC_ABSTRACT_SYNTAX_PATCH
    5802             :         PY_KRB5PAC_ABSTRACT_SYNTAX_PATCH(&krb5pac_SyntaxType);
    5803             : #endif
    5804             : #ifdef PY_ABSTRACT_SYNTAX_PATCH
    5805             :         PY_ABSTRACT_SYNTAX_PATCH(&krb5pac_SyntaxType);
    5806             : #endif
    5807             : 
    5808        3437 :         m = PyModule_Create(&moduledef);
    5809        3437 :         if (m == NULL)
    5810           0 :                 goto out;
    5811             : 
    5812        3437 :         PyModule_AddObject(m, "PAC_TYPE_BEGIN", PyLong_FromUnsignedLongLong(1));
    5813        3437 :         PyModule_AddObject(m, "PAC_TYPE_END", PyLong_FromUnsignedLongLong(20));
    5814        3437 :         PyModule_AddObject(m, "PAC_TYPE_COUNT", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_END-PAC_TYPE_BEGIN));
    5815        3437 :         PyModule_AddObject(m, "NETLOGON_GENERIC_KRB5_PAC_VALIDATE", PyLong_FromUnsignedLongLong(3));
    5816        3437 :         PyModule_AddObject(m, "PAC_CREDENTIAL_NTLM_HAS_LM_HASH", PyLong_FromUnsignedLongLong((uint32_t)PAC_CREDENTIAL_NTLM_HAS_LM_HASH));
    5817        3437 :         PyModule_AddObject(m, "PAC_CREDENTIAL_NTLM_HAS_NT_HASH", PyLong_FromUnsignedLongLong((uint32_t)PAC_CREDENTIAL_NTLM_HAS_NT_HASH));
    5818        3437 :         PyModule_AddObject(m, "PAC_UPN_DNS_FLAG_CONSTRUCTED", PyLong_FromUnsignedLongLong((uint32_t)PAC_UPN_DNS_FLAG_CONSTRUCTED));
    5819        3437 :         PyModule_AddObject(m, "PAC_UPN_DNS_FLAG_HAS_SAM_NAME_AND_SID", PyLong_FromUnsignedLongLong((uint32_t)PAC_UPN_DNS_FLAG_HAS_SAM_NAME_AND_SID));
    5820        3437 :         PyModule_AddObject(m, "PAC_ATTRIBUTE_FLAG_PAC_WAS_REQUESTED", PyLong_FromUnsignedLongLong((uint32_t)PAC_ATTRIBUTE_FLAG_PAC_WAS_REQUESTED));
    5821        3437 :         PyModule_AddObject(m, "PAC_ATTRIBUTE_FLAG_PAC_WAS_GIVEN_IMPLICITLY", PyLong_FromUnsignedLongLong((uint32_t)PAC_ATTRIBUTE_FLAG_PAC_WAS_GIVEN_IMPLICITLY));
    5822        3437 :         PyModule_AddObject(m, "PAC_TYPE_LOGON_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_LOGON_INFO));
    5823        3437 :         PyModule_AddObject(m, "PAC_TYPE_CREDENTIAL_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_CREDENTIAL_INFO));
    5824        3437 :         PyModule_AddObject(m, "PAC_TYPE_SRV_CHECKSUM", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_SRV_CHECKSUM));
    5825        3437 :         PyModule_AddObject(m, "PAC_TYPE_KDC_CHECKSUM", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_KDC_CHECKSUM));
    5826        3437 :         PyModule_AddObject(m, "PAC_TYPE_LOGON_NAME", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_LOGON_NAME));
    5827        3437 :         PyModule_AddObject(m, "PAC_TYPE_CONSTRAINED_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_CONSTRAINED_DELEGATION));
    5828        3437 :         PyModule_AddObject(m, "PAC_TYPE_UPN_DNS_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_UPN_DNS_INFO));
    5829        3437 :         PyModule_AddObject(m, "PAC_TYPE_CLIENT_CLAIMS_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_CLIENT_CLAIMS_INFO));
    5830        3437 :         PyModule_AddObject(m, "PAC_TYPE_DEVICE_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_DEVICE_INFO));
    5831        3437 :         PyModule_AddObject(m, "PAC_TYPE_DEVICE_CLAIMS_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_DEVICE_CLAIMS_INFO));
    5832        3437 :         PyModule_AddObject(m, "PAC_TYPE_TICKET_CHECKSUM", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_TICKET_CHECKSUM));
    5833        3437 :         PyModule_AddObject(m, "PAC_TYPE_ATTRIBUTES_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_ATTRIBUTES_INFO));
    5834        3437 :         PyModule_AddObject(m, "PAC_TYPE_REQUESTER_SID", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_REQUESTER_SID));
    5835        3437 :         PyModule_AddObject(m, "PAC_TYPE_FULL_CHECKSUM", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_FULL_CHECKSUM));
    5836        3437 :         Py_INCREF((PyObject *)(void *)&PAC_LOGON_NAME_Type);
    5837        3437 :         PyModule_AddObject(m, "PAC_LOGON_NAME", (PyObject *)(void *)&PAC_LOGON_NAME_Type);
    5838        3437 :         Py_INCREF((PyObject *)(void *)&PAC_SIGNATURE_DATA_Type);
    5839        3437 :         PyModule_AddObject(m, "PAC_SIGNATURE_DATA", (PyObject *)(void *)&PAC_SIGNATURE_DATA_Type);
    5840        3437 :         Py_INCREF((PyObject *)(void *)&PAC_DOMAIN_GROUP_MEMBERSHIP_Type);
    5841        3437 :         PyModule_AddObject(m, "PAC_DOMAIN_GROUP_MEMBERSHIP", (PyObject *)(void *)&PAC_DOMAIN_GROUP_MEMBERSHIP_Type);
    5842        3437 :         Py_INCREF((PyObject *)(void *)&PAC_LOGON_INFO_Type);
    5843        3437 :         PyModule_AddObject(m, "PAC_LOGON_INFO", (PyObject *)(void *)&PAC_LOGON_INFO_Type);
    5844        3437 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_NTLM_SECPKG_Type);
    5845        3437 :         PyModule_AddObject(m, "PAC_CREDENTIAL_NTLM_SECPKG", (PyObject *)(void *)&PAC_CREDENTIAL_NTLM_SECPKG_Type);
    5846        3437 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type);
    5847        3437 :         PyModule_AddObject(m, "PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG", (PyObject *)(void *)&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type);
    5848        3437 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_DATA_Type);
    5849        3437 :         PyModule_AddObject(m, "PAC_CREDENTIAL_DATA", (PyObject *)(void *)&PAC_CREDENTIAL_DATA_Type);
    5850        3437 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_DATA_CTR_Type);
    5851        3437 :         PyModule_AddObject(m, "PAC_CREDENTIAL_DATA_CTR", (PyObject *)(void *)&PAC_CREDENTIAL_DATA_CTR_Type);
    5852        3437 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_DATA_NDR_Type);
    5853        3437 :         PyModule_AddObject(m, "PAC_CREDENTIAL_DATA_NDR", (PyObject *)(void *)&PAC_CREDENTIAL_DATA_NDR_Type);
    5854        3437 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_INFO_Type);
    5855        3437 :         PyModule_AddObject(m, "PAC_CREDENTIAL_INFO", (PyObject *)(void *)&PAC_CREDENTIAL_INFO_Type);
    5856        3437 :         Py_INCREF((PyObject *)(void *)&PAC_CONSTRAINED_DELEGATION_Type);
    5857        3437 :         PyModule_AddObject(m, "PAC_CONSTRAINED_DELEGATION", (PyObject *)(void *)&PAC_CONSTRAINED_DELEGATION_Type);
    5858        3437 :         Py_INCREF((PyObject *)(void *)&PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type);
    5859        3437 :         PyModule_AddObject(m, "PAC_UPN_DNS_INFO_SAM_NAME_AND_SID", (PyObject *)(void *)&PAC_UPN_DNS_INFO_SAM_NAME_AND_SID_Type);
    5860        3437 :         Py_INCREF((PyObject *)(void *)&PAC_UPN_DNS_INFO_EX_Type);
    5861        3437 :         PyModule_AddObject(m, "PAC_UPN_DNS_INFO_EX", (PyObject *)(void *)&PAC_UPN_DNS_INFO_EX_Type);
    5862        3437 :         Py_INCREF((PyObject *)(void *)&PAC_UPN_DNS_INFO_Type);
    5863        3437 :         PyModule_AddObject(m, "PAC_UPN_DNS_INFO", (PyObject *)(void *)&PAC_UPN_DNS_INFO_Type);
    5864        3437 :         Py_INCREF((PyObject *)(void *)&PAC_ATTRIBUTES_INFO_Type);
    5865        3437 :         PyModule_AddObject(m, "PAC_ATTRIBUTES_INFO", (PyObject *)(void *)&PAC_ATTRIBUTES_INFO_Type);
    5866        3437 :         Py_INCREF((PyObject *)(void *)&PAC_REQUESTER_SID_Type);
    5867        3437 :         PyModule_AddObject(m, "PAC_REQUESTER_SID", (PyObject *)(void *)&PAC_REQUESTER_SID_Type);
    5868        3437 :         Py_INCREF((PyObject *)(void *)&PAC_LOGON_INFO_CTR_Type);
    5869        3437 :         PyModule_AddObject(m, "PAC_LOGON_INFO_CTR", (PyObject *)(void *)&PAC_LOGON_INFO_CTR_Type);
    5870        3437 :         Py_INCREF((PyObject *)(void *)&PAC_CONSTRAINED_DELEGATION_CTR_Type);
    5871        3437 :         PyModule_AddObject(m, "PAC_CONSTRAINED_DELEGATION_CTR", (PyObject *)(void *)&PAC_CONSTRAINED_DELEGATION_CTR_Type);
    5872        3437 :         Py_INCREF((PyObject *)(void *)&PAC_DEVICE_INFO_Type);
    5873        3437 :         PyModule_AddObject(m, "PAC_DEVICE_INFO", (PyObject *)(void *)&PAC_DEVICE_INFO_Type);
    5874        3437 :         Py_INCREF((PyObject *)(void *)&PAC_DEVICE_INFO_CTR_Type);
    5875        3437 :         PyModule_AddObject(m, "PAC_DEVICE_INFO_CTR", (PyObject *)(void *)&PAC_DEVICE_INFO_CTR_Type);
    5876        3437 :         Py_INCREF((PyObject *)(void *)&DATA_BLOB_REM_Type);
    5877        3437 :         PyModule_AddObject(m, "DATA_BLOB_REM", (PyObject *)(void *)&DATA_BLOB_REM_Type);
    5878        3437 :         Py_INCREF((PyObject *)(void *)&PAC_INFO_Type);
    5879        3437 :         PyModule_AddObject(m, "PAC_INFO", (PyObject *)(void *)&PAC_INFO_Type);
    5880        3437 :         Py_INCREF((PyObject *)(void *)&PAC_BUFFER_Type);
    5881        3437 :         PyModule_AddObject(m, "PAC_BUFFER", (PyObject *)(void *)&PAC_BUFFER_Type);
    5882        3437 :         Py_INCREF((PyObject *)(void *)&PAC_DATA_Type);
    5883        3437 :         PyModule_AddObject(m, "PAC_DATA", (PyObject *)(void *)&PAC_DATA_Type);
    5884        3437 :         Py_INCREF((PyObject *)(void *)&PAC_BUFFER_RAW_Type);
    5885        3437 :         PyModule_AddObject(m, "PAC_BUFFER_RAW", (PyObject *)(void *)&PAC_BUFFER_RAW_Type);
    5886        3437 :         Py_INCREF((PyObject *)(void *)&PAC_DATA_RAW_Type);
    5887        3437 :         PyModule_AddObject(m, "PAC_DATA_RAW", (PyObject *)(void *)&PAC_DATA_RAW_Type);
    5888        3437 :         Py_INCREF((PyObject *)(void *)&PAC_Validate_Type);
    5889        3437 :         PyModule_AddObject(m, "PAC_Validate", (PyObject *)(void *)&PAC_Validate_Type);
    5890        3437 :         Py_INCREF((PyObject *)(void *)&netsamlogoncache_entry_Type);
    5891        3437 :         PyModule_AddObject(m, "netsamlogoncache_entry", (PyObject *)(void *)&netsamlogoncache_entry_Type);
    5892        3437 :         Py_INCREF((PyObject *)(void *)&krb5pac_InterfaceType);
    5893        3437 :         PyModule_AddObject(m, "krb5pac", (PyObject *)(void *)&krb5pac_InterfaceType);
    5894        3437 :         Py_INCREF((PyObject *)(void *)&krb5pac_SyntaxType);
    5895        3437 :         PyModule_AddObject(m, "krb5pac_abstract_syntax", (PyObject *)(void *)&krb5pac_SyntaxType);
    5896        3437 :         Py_INCREF((PyObject *)(void *)&krb5pac_SyntaxType);
    5897        3437 :         PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&krb5pac_SyntaxType);
    5898             : #ifdef PY_MOD_KRB5PAC_PATCH
    5899             :         PY_MOD_KRB5PAC_PATCH(m);
    5900             : #endif
    5901        3437 :         out:
    5902        3437 :         Py_XDECREF(dep_samba_dcerpc_security);
    5903        3437 :         Py_XDECREF(dep_samba_dcerpc_lsa);
    5904        3437 :         Py_XDECREF(dep_samba_dcerpc_netlogon);
    5905        3437 :         Py_XDECREF(dep_samba_dcerpc_samr);
    5906        3437 :         Py_XDECREF(dep_talloc);
    5907        3437 :         Py_XDECREF(dep_samba_dcerpc_base);
    5908        3437 :         Py_XDECREF(dep_samba_dcerpc_misc);
    5909        3313 :         return m;
    5910             : 
    5911             : }

Generated by: LCOV version 1.14