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_netlogon.h"
12 : #include "bin/default/librpc/gen_ndr/ndr_netlogon_c.h"
13 :
14 : /*
15 : * Suppress compiler warnings if the generated code does not call these
16 : * functions
17 : */
18 : #ifndef _MAYBE_UNUSED_
19 : #ifdef __has_attribute
20 : #if __has_attribute(unused)
21 : #define _MAYBE_UNUSED_ __attribute__ ((unused))
22 : #else
23 : #define _MAYBE_UNUSED_
24 : #endif
25 : #endif
26 : #endif
27 : /*
28 : * These functions are here to ensure they can be optimized out by
29 : * the compiler based on the constant input values
30 : */
31 :
32 4490 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 4490 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 710 : case 4:
38 710 : return UINT32_MAX;
39 36 : case 2:
40 36 : return UINT16_MAX;
41 3744 : case 1:
42 3744 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 43 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 43 : switch (var_size) {
51 43 : case 8:
52 43 : 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/misc.h"
65 : #include "librpc/gen_ndr/lsa.h"
66 : #include "librpc/gen_ndr/samr.h"
67 : #include "librpc/gen_ndr/security.h"
68 : static PyTypeObject netr_UasInfo_Type;
69 : static PyTypeObject netr_UasLogoffInfo_Type;
70 : static PyTypeObject netr_AcctLockStr_Type;
71 : static PyTypeObject netr_IdentityInfo_Type;
72 : static PyTypeObject netr_PasswordInfo_Type;
73 : static PyTypeObject netr_ChallengeResponse_Type;
74 : static PyTypeObject netr_NetworkInfo_Type;
75 : static PyTypeObject netr_GenericInfo_Type;
76 : static PyTypeObject netr_LogonLevel_Type;
77 : static PyTypeObject netr_UserSessionKey_Type;
78 : static PyTypeObject netr_LMSessionKey_Type;
79 : static PyTypeObject netr_SamBaseInfo_Type;
80 : static PyTypeObject netr_SamInfo2_Type;
81 : static PyTypeObject netr_SidAttr_Type;
82 : static PyTypeObject netr_SamInfo3_Type;
83 : static PyTypeObject netr_SamInfo6_Type;
84 : static PyTypeObject netr_PacInfo_Type;
85 : static PyTypeObject netr_GenericInfo2_Type;
86 : static PyTypeObject netr_Validation_Type;
87 : static PyTypeObject netr_Credential_Type;
88 : static PyTypeObject netlogon_server_pipe_state_Type;
89 : static PyTypeObject netr_Authenticator_Type;
90 : static PyTypeObject netr_DELTA_DELETE_USER_Type;
91 : static PyTypeObject netr_USER_KEY16_Type;
92 : static PyTypeObject netr_PasswordHistory_Type;
93 : static PyTypeObject netr_USER_KEYS2_Type;
94 : static PyTypeObject netr_USER_KEY_UNION_Type;
95 : static PyTypeObject netr_USER_KEYS_Type;
96 : static PyTypeObject netr_USER_PRIVATE_INFO_Type;
97 : static PyTypeObject netr_DELTA_USER_Type;
98 : static PyTypeObject netr_DELTA_DOMAIN_Type;
99 : static PyTypeObject netr_DELTA_GROUP_Type;
100 : static PyTypeObject netr_DELTA_RENAME_Type;
101 : static PyTypeObject netr_DELTA_GROUP_MEMBER_Type;
102 : static PyTypeObject netr_DELTA_ALIAS_Type;
103 : static PyTypeObject netr_DELTA_ALIAS_MEMBER_Type;
104 : static PyTypeObject netr_QUOTA_LIMITS_Type;
105 : static PyTypeObject netr_DELTA_POLICY_Type;
106 : static PyTypeObject netr_DELTA_TRUSTED_DOMAIN_Type;
107 : static PyTypeObject netr_DELTA_ACCOUNT_Type;
108 : static PyTypeObject netr_CIPHER_VALUE_Type;
109 : static PyTypeObject netr_DELTA_SECRET_Type;
110 : static PyTypeObject netr_DELTA_UNION_Type;
111 : static PyTypeObject netr_DELTA_ID_UNION_Type;
112 : static PyTypeObject netr_DELTA_ENUM_Type;
113 : static PyTypeObject netr_DELTA_ENUM_ARRAY_Type;
114 : static PyTypeObject netr_UAS_INFO_0_Type;
115 : static PyTypeObject netr_AccountBuffer_Type;
116 : static PyTypeObject netr_NETLOGON_INFO_1_Type;
117 : static PyTypeObject netr_NETLOGON_INFO_2_Type;
118 : static PyTypeObject netr_NETLOGON_INFO_3_Type;
119 : static PyTypeObject netr_NETLOGON_INFO_4_Type;
120 : static PyTypeObject netr_CONTROL_QUERY_INFORMATION_Type;
121 : static PyTypeObject netr_CONTROL_DATA_INFORMATION_Type;
122 : static PyTypeObject netr_ChangeLogObject_Type;
123 : static PyTypeObject netr_ChangeLogEntry_Type;
124 : static PyTypeObject netr_Blob_Type;
125 : static PyTypeObject netr_DsRGetDCNameInfo_Type;
126 : static PyTypeObject netr_Capabilities_Type;
127 : static PyTypeObject netr_LsaPolicyInformation_Type;
128 : static PyTypeObject netr_OsVersionInfoEx_Type;
129 : static PyTypeObject netr_OsVersion_Type;
130 : static PyTypeObject netr_OsVersionContainer_Type;
131 : static PyTypeObject netr_WorkstationInformation_Type;
132 : static PyTypeObject netr_WorkstationInfo_Type;
133 : static PyTypeObject netr_trust_extension_info_Type;
134 : static PyTypeObject netr_trust_extension_Type;
135 : static PyTypeObject netr_trust_extension_container_Type;
136 : static PyTypeObject netr_OneDomainInfo_Type;
137 : static PyTypeObject netr_DomainInformation_Type;
138 : static PyTypeObject netr_DomainInfo_Type;
139 : static PyTypeObject NL_PASSWORD_VERSION_Type;
140 : static PyTypeObject netr_CryptPassword_Type;
141 : static PyTypeObject netr_SendToSamResetBadPasswordCount_Type;
142 : static PyTypeObject netr_SendToSamMessage_Type;
143 : static PyTypeObject netr_SendToSamBase_Type;
144 : static PyTypeObject netr_DsRAddressToSitenamesWCtr_Type;
145 : static PyTypeObject netr_DsRAddress_Type;
146 : static PyTypeObject netr_DomainTrust_Type;
147 : static PyTypeObject netr_DomainTrustList_Type;
148 : static PyTypeObject netr_DsRAddressToSitenamesExWCtr_Type;
149 : static PyTypeObject DcSitesCtr_Type;
150 : static PyTypeObject netr_TrustInfo_Type;
151 : static PyTypeObject NL_DNS_NAME_INFO_Type;
152 : static PyTypeObject NL_DNS_NAME_INFO_ARRAY_Type;
153 : static PyTypeObject netlogon_InterfaceType;
154 : static PyTypeObject netr_LogonUasLogon_Type;
155 : static PyTypeObject netr_LogonUasLogoff_Type;
156 : static PyTypeObject netr_LogonSamLogon_Type;
157 : static PyTypeObject netr_LogonSamLogoff_Type;
158 : static PyTypeObject netr_ServerReqChallenge_Type;
159 : static PyTypeObject netr_ServerAuthenticate_Type;
160 : static PyTypeObject netr_ServerPasswordSet_Type;
161 : static PyTypeObject netr_DatabaseDeltas_Type;
162 : static PyTypeObject netr_DatabaseSync_Type;
163 : static PyTypeObject netr_AccountDeltas_Type;
164 : static PyTypeObject netr_AccountSync_Type;
165 : static PyTypeObject netr_GetDcName_Type;
166 : static PyTypeObject netr_LogonControl_Type;
167 : static PyTypeObject netr_GetAnyDCName_Type;
168 : static PyTypeObject netr_LogonControl2_Type;
169 : static PyTypeObject netr_ServerAuthenticate2_Type;
170 : static PyTypeObject netr_DatabaseSync2_Type;
171 : static PyTypeObject netr_DatabaseRedo_Type;
172 : static PyTypeObject netr_LogonControl2Ex_Type;
173 : static PyTypeObject netr_NetrEnumerateTrustedDomains_Type;
174 : static PyTypeObject netr_DsRGetDCName_Type;
175 : static PyTypeObject netr_LogonGetCapabilities_Type;
176 : static PyTypeObject netr_LogonGetTrustRid_Type;
177 : static PyTypeObject netr_ServerAuthenticate3_Type;
178 : static PyTypeObject netr_DsRGetDCNameEx_Type;
179 : static PyTypeObject netr_DsRGetSiteName_Type;
180 : static PyTypeObject netr_LogonGetDomainInfo_Type;
181 : static PyTypeObject netr_ServerPasswordSet2_Type;
182 : static PyTypeObject netr_ServerPasswordGet_Type;
183 : static PyTypeObject netr_NetrLogonSendToSam_Type;
184 : static PyTypeObject netr_DsRAddressToSitenamesW_Type;
185 : static PyTypeObject netr_DsRGetDCNameEx2_Type;
186 : static PyTypeObject netr_NetrEnumerateTrustedDomainsEx_Type;
187 : static PyTypeObject netr_DsRAddressToSitenamesExW_Type;
188 : static PyTypeObject netr_DsrGetDcSiteCoverageW_Type;
189 : static PyTypeObject netr_LogonSamLogonEx_Type;
190 : static PyTypeObject netr_DsrEnumerateDomainTrusts_Type;
191 : static PyTypeObject netr_DsrDeregisterDNSHostRecords_Type;
192 : static PyTypeObject netr_ServerTrustPasswordsGet_Type;
193 : static PyTypeObject netr_DsRGetForestTrustInformation_Type;
194 : static PyTypeObject netr_GetForestTrustInformation_Type;
195 : static PyTypeObject netr_LogonSamLogonWithFlags_Type;
196 : static PyTypeObject netr_ServerGetTrustInfo_Type;
197 : static PyTypeObject netr_Unused47_Type;
198 : static PyTypeObject netr_DsrUpdateReadOnlyServerDnsRecords_Type;
199 :
200 : static PyTypeObject *BaseObject_Type;
201 : static PyTypeObject *lsa_String_Type;
202 : static PyTypeObject *samr_Password_Type;
203 : static PyTypeObject *samr_RidWithAttributeArray_Type;
204 : static PyTypeObject *lsa_StringLarge_Type;
205 : static PyTypeObject *dom_sid_Type;
206 : static PyTypeObject *samr_LogonHours_Type;
207 : static PyTypeObject *lsa_BinaryString_Type;
208 : static PyTypeObject *sec_desc_buf_Type;
209 : static PyTypeObject *lsa_SidArray_Type;
210 : static PyTypeObject *GUID_Type;
211 : static PyTypeObject *lsa_ForestTrustInformation_Type;
212 : static PyTypeObject *ClientConnection_Type;
213 : static PyTypeObject *ndr_syntax_id_Type;
214 :
215 0 : static PyObject *py_netr_UasInfo_get_account_name(PyObject *obj, void *closure)
216 : {
217 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
218 : PyObject *py_account_name;
219 0 : if (object->account_name == NULL) {
220 0 : Py_RETURN_NONE;
221 : }
222 0 : if (object->account_name == NULL) {
223 0 : py_account_name = Py_None;
224 0 : Py_INCREF(py_account_name);
225 : } else {
226 0 : if (object->account_name == NULL) {
227 0 : py_account_name = Py_None;
228 0 : Py_INCREF(py_account_name);
229 : } else {
230 0 : py_account_name = PyUnicode_Decode(object->account_name, strlen(object->account_name), "utf-8", "ignore");
231 : }
232 : }
233 0 : return py_account_name;
234 : }
235 :
236 0 : static int py_netr_UasInfo_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
237 : {
238 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
239 0 : if (value == NULL) {
240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
241 0 : return -1;
242 : }
243 0 : if (value == Py_None) {
244 0 : object->account_name = NULL;
245 : } else {
246 0 : object->account_name = NULL;
247 : {
248 : const char *test_str;
249 : const char *talloc_str;
250 0 : PyObject *unicode = NULL;
251 0 : if (PyUnicode_Check(value)) {
252 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
253 0 : if (unicode == NULL) {
254 0 : PyErr_NoMemory();
255 0 : return -1;
256 : }
257 0 : test_str = PyBytes_AS_STRING(unicode);
258 0 : } else if (PyBytes_Check(value)) {
259 0 : test_str = PyBytes_AS_STRING(value);
260 : } else {
261 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
262 0 : return -1;
263 : }
264 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
265 0 : if (unicode != NULL) {
266 0 : Py_DECREF(unicode);
267 : }
268 0 : if (talloc_str == NULL) {
269 0 : PyErr_NoMemory();
270 0 : return -1;
271 : }
272 0 : object->account_name = talloc_str;
273 : }
274 : }
275 0 : return 0;
276 : }
277 :
278 0 : static PyObject *py_netr_UasInfo_get_priv(PyObject *obj, void *closure)
279 : {
280 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
281 : PyObject *py_priv;
282 0 : py_priv = PyLong_FromUnsignedLongLong((uint32_t)object->priv);
283 0 : return py_priv;
284 : }
285 :
286 0 : static int py_netr_UasInfo_set_priv(PyObject *py_obj, PyObject *value, void *closure)
287 : {
288 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
289 0 : if (value == NULL) {
290 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->priv");
291 0 : return -1;
292 : }
293 : {
294 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priv));
295 0 : if (PyLong_Check(value)) {
296 : unsigned long long test_var;
297 0 : test_var = PyLong_AsUnsignedLongLong(value);
298 0 : if (PyErr_Occurred() != NULL) {
299 0 : return -1;
300 : }
301 0 : if (test_var > uint_max) {
302 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
303 : PyLong_Type.tp_name, uint_max, test_var);
304 0 : return -1;
305 : }
306 0 : object->priv = test_var;
307 : } else {
308 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
309 : PyLong_Type.tp_name);
310 0 : return -1;
311 : }
312 : }
313 0 : return 0;
314 : }
315 :
316 0 : static PyObject *py_netr_UasInfo_get_auth_flags(PyObject *obj, void *closure)
317 : {
318 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
319 : PyObject *py_auth_flags;
320 0 : py_auth_flags = PyLong_FromUnsignedLongLong((uint32_t)object->auth_flags);
321 0 : return py_auth_flags;
322 : }
323 :
324 0 : static int py_netr_UasInfo_set_auth_flags(PyObject *py_obj, PyObject *value, void *closure)
325 : {
326 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
327 0 : if (value == NULL) {
328 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_flags");
329 0 : return -1;
330 : }
331 : {
332 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_flags));
333 0 : if (PyLong_Check(value)) {
334 : unsigned long long test_var;
335 0 : test_var = PyLong_AsUnsignedLongLong(value);
336 0 : if (PyErr_Occurred() != NULL) {
337 0 : return -1;
338 : }
339 0 : if (test_var > uint_max) {
340 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
341 : PyLong_Type.tp_name, uint_max, test_var);
342 0 : return -1;
343 : }
344 0 : object->auth_flags = test_var;
345 : } else {
346 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
347 : PyLong_Type.tp_name);
348 0 : return -1;
349 : }
350 : }
351 0 : return 0;
352 : }
353 :
354 0 : static PyObject *py_netr_UasInfo_get_logon_count(PyObject *obj, void *closure)
355 : {
356 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
357 : PyObject *py_logon_count;
358 0 : py_logon_count = PyLong_FromUnsignedLongLong((uint32_t)object->logon_count);
359 0 : return py_logon_count;
360 : }
361 :
362 0 : static int py_netr_UasInfo_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
363 : {
364 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
365 0 : if (value == NULL) {
366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count");
367 0 : return -1;
368 : }
369 : {
370 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count));
371 0 : if (PyLong_Check(value)) {
372 : unsigned long long test_var;
373 0 : test_var = PyLong_AsUnsignedLongLong(value);
374 0 : if (PyErr_Occurred() != NULL) {
375 0 : return -1;
376 : }
377 0 : if (test_var > uint_max) {
378 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
379 : PyLong_Type.tp_name, uint_max, test_var);
380 0 : return -1;
381 : }
382 0 : object->logon_count = test_var;
383 : } else {
384 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
385 : PyLong_Type.tp_name);
386 0 : return -1;
387 : }
388 : }
389 0 : return 0;
390 : }
391 :
392 0 : static PyObject *py_netr_UasInfo_get_bad_pw_count(PyObject *obj, void *closure)
393 : {
394 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
395 : PyObject *py_bad_pw_count;
396 0 : py_bad_pw_count = PyLong_FromUnsignedLongLong((uint32_t)object->bad_pw_count);
397 0 : return py_bad_pw_count;
398 : }
399 :
400 0 : static int py_netr_UasInfo_set_bad_pw_count(PyObject *py_obj, PyObject *value, void *closure)
401 : {
402 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
403 0 : if (value == NULL) {
404 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_pw_count");
405 0 : return -1;
406 : }
407 : {
408 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_pw_count));
409 0 : if (PyLong_Check(value)) {
410 : unsigned long long test_var;
411 0 : test_var = PyLong_AsUnsignedLongLong(value);
412 0 : if (PyErr_Occurred() != NULL) {
413 0 : return -1;
414 : }
415 0 : if (test_var > uint_max) {
416 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
417 : PyLong_Type.tp_name, uint_max, test_var);
418 0 : return -1;
419 : }
420 0 : object->bad_pw_count = test_var;
421 : } else {
422 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
423 : PyLong_Type.tp_name);
424 0 : return -1;
425 : }
426 : }
427 0 : return 0;
428 : }
429 :
430 0 : static PyObject *py_netr_UasInfo_get_last_logon(PyObject *obj, void *closure)
431 : {
432 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
433 : PyObject *py_last_logon;
434 0 : py_last_logon = PyLong_FromLong(object->last_logon);
435 0 : return py_last_logon;
436 : }
437 :
438 0 : static int py_netr_UasInfo_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
439 : {
440 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
441 0 : if (value == NULL) {
442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon");
443 0 : return -1;
444 : }
445 : {
446 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->last_logon));
447 0 : const long long int_min = -int_max - 1;
448 0 : if (PyLong_Check(value)) {
449 : long long test_var;
450 0 : test_var = PyLong_AsLongLong(value);
451 0 : if (PyErr_Occurred() != NULL) {
452 0 : return -1;
453 : }
454 0 : if (test_var < int_min || test_var > int_max) {
455 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
456 : PyLong_Type.tp_name, int_min, int_max, test_var);
457 0 : return -1;
458 : }
459 0 : object->last_logon = test_var;
460 : } else {
461 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
462 : PyLong_Type.tp_name);
463 0 : return -1;
464 : }
465 : }
466 0 : return 0;
467 : }
468 :
469 0 : static PyObject *py_netr_UasInfo_get_last_logoff(PyObject *obj, void *closure)
470 : {
471 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
472 : PyObject *py_last_logoff;
473 0 : py_last_logoff = PyLong_FromLong(object->last_logoff);
474 0 : return py_last_logoff;
475 : }
476 :
477 0 : static int py_netr_UasInfo_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
478 : {
479 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
480 0 : if (value == NULL) {
481 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff");
482 0 : return -1;
483 : }
484 : {
485 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->last_logoff));
486 0 : const long long int_min = -int_max - 1;
487 0 : if (PyLong_Check(value)) {
488 : long long test_var;
489 0 : test_var = PyLong_AsLongLong(value);
490 0 : if (PyErr_Occurred() != NULL) {
491 0 : return -1;
492 : }
493 0 : if (test_var < int_min || test_var > int_max) {
494 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
495 : PyLong_Type.tp_name, int_min, int_max, test_var);
496 0 : return -1;
497 : }
498 0 : object->last_logoff = test_var;
499 : } else {
500 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
501 : PyLong_Type.tp_name);
502 0 : return -1;
503 : }
504 : }
505 0 : return 0;
506 : }
507 :
508 0 : static PyObject *py_netr_UasInfo_get_logoff_time(PyObject *obj, void *closure)
509 : {
510 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
511 : PyObject *py_logoff_time;
512 0 : py_logoff_time = PyLong_FromLong(object->logoff_time);
513 0 : return py_logoff_time;
514 : }
515 :
516 0 : static int py_netr_UasInfo_set_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
517 : {
518 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
519 0 : if (value == NULL) {
520 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logoff_time");
521 0 : return -1;
522 : }
523 : {
524 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->logoff_time));
525 0 : const long long int_min = -int_max - 1;
526 0 : if (PyLong_Check(value)) {
527 : long long test_var;
528 0 : test_var = PyLong_AsLongLong(value);
529 0 : if (PyErr_Occurred() != NULL) {
530 0 : return -1;
531 : }
532 0 : if (test_var < int_min || test_var > int_max) {
533 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
534 : PyLong_Type.tp_name, int_min, int_max, test_var);
535 0 : return -1;
536 : }
537 0 : object->logoff_time = test_var;
538 : } else {
539 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
540 : PyLong_Type.tp_name);
541 0 : return -1;
542 : }
543 : }
544 0 : return 0;
545 : }
546 :
547 0 : static PyObject *py_netr_UasInfo_get_kickoff_time(PyObject *obj, void *closure)
548 : {
549 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
550 : PyObject *py_kickoff_time;
551 0 : py_kickoff_time = PyLong_FromLong(object->kickoff_time);
552 0 : return py_kickoff_time;
553 : }
554 :
555 0 : static int py_netr_UasInfo_set_kickoff_time(PyObject *py_obj, PyObject *value, void *closure)
556 : {
557 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
558 0 : if (value == NULL) {
559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->kickoff_time");
560 0 : return -1;
561 : }
562 : {
563 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->kickoff_time));
564 0 : const long long int_min = -int_max - 1;
565 0 : if (PyLong_Check(value)) {
566 : long long test_var;
567 0 : test_var = PyLong_AsLongLong(value);
568 0 : if (PyErr_Occurred() != NULL) {
569 0 : return -1;
570 : }
571 0 : if (test_var < int_min || test_var > int_max) {
572 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
573 : PyLong_Type.tp_name, int_min, int_max, test_var);
574 0 : return -1;
575 : }
576 0 : object->kickoff_time = test_var;
577 : } else {
578 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
579 : PyLong_Type.tp_name);
580 0 : return -1;
581 : }
582 : }
583 0 : return 0;
584 : }
585 :
586 0 : static PyObject *py_netr_UasInfo_get_password_age(PyObject *obj, void *closure)
587 : {
588 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
589 : PyObject *py_password_age;
590 0 : py_password_age = PyLong_FromUnsignedLongLong((uint32_t)object->password_age);
591 0 : return py_password_age;
592 : }
593 :
594 0 : static int py_netr_UasInfo_set_password_age(PyObject *py_obj, PyObject *value, void *closure)
595 : {
596 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
597 0 : if (value == NULL) {
598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_age");
599 0 : return -1;
600 : }
601 : {
602 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_age));
603 0 : if (PyLong_Check(value)) {
604 : unsigned long long test_var;
605 0 : test_var = PyLong_AsUnsignedLongLong(value);
606 0 : if (PyErr_Occurred() != NULL) {
607 0 : return -1;
608 : }
609 0 : if (test_var > uint_max) {
610 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
611 : PyLong_Type.tp_name, uint_max, test_var);
612 0 : return -1;
613 : }
614 0 : object->password_age = test_var;
615 : } else {
616 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
617 : PyLong_Type.tp_name);
618 0 : return -1;
619 : }
620 : }
621 0 : return 0;
622 : }
623 :
624 0 : static PyObject *py_netr_UasInfo_get_pw_can_change(PyObject *obj, void *closure)
625 : {
626 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
627 : PyObject *py_pw_can_change;
628 0 : py_pw_can_change = PyLong_FromLong(object->pw_can_change);
629 0 : return py_pw_can_change;
630 : }
631 :
632 0 : static int py_netr_UasInfo_set_pw_can_change(PyObject *py_obj, PyObject *value, void *closure)
633 : {
634 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
635 0 : if (value == NULL) {
636 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pw_can_change");
637 0 : return -1;
638 : }
639 : {
640 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->pw_can_change));
641 0 : const long long int_min = -int_max - 1;
642 0 : if (PyLong_Check(value)) {
643 : long long test_var;
644 0 : test_var = PyLong_AsLongLong(value);
645 0 : if (PyErr_Occurred() != NULL) {
646 0 : return -1;
647 : }
648 0 : if (test_var < int_min || test_var > int_max) {
649 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
650 : PyLong_Type.tp_name, int_min, int_max, test_var);
651 0 : return -1;
652 : }
653 0 : object->pw_can_change = test_var;
654 : } else {
655 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
656 : PyLong_Type.tp_name);
657 0 : return -1;
658 : }
659 : }
660 0 : return 0;
661 : }
662 :
663 0 : static PyObject *py_netr_UasInfo_get_pw_must_change(PyObject *obj, void *closure)
664 : {
665 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
666 : PyObject *py_pw_must_change;
667 0 : py_pw_must_change = PyLong_FromLong(object->pw_must_change);
668 0 : return py_pw_must_change;
669 : }
670 :
671 0 : static int py_netr_UasInfo_set_pw_must_change(PyObject *py_obj, PyObject *value, void *closure)
672 : {
673 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
674 0 : if (value == NULL) {
675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pw_must_change");
676 0 : return -1;
677 : }
678 : {
679 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->pw_must_change));
680 0 : const long long int_min = -int_max - 1;
681 0 : if (PyLong_Check(value)) {
682 : long long test_var;
683 0 : test_var = PyLong_AsLongLong(value);
684 0 : if (PyErr_Occurred() != NULL) {
685 0 : return -1;
686 : }
687 0 : if (test_var < int_min || test_var > int_max) {
688 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
689 : PyLong_Type.tp_name, int_min, int_max, test_var);
690 0 : return -1;
691 : }
692 0 : object->pw_must_change = test_var;
693 : } else {
694 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
695 : PyLong_Type.tp_name);
696 0 : return -1;
697 : }
698 : }
699 0 : return 0;
700 : }
701 :
702 0 : static PyObject *py_netr_UasInfo_get_computer(PyObject *obj, void *closure)
703 : {
704 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
705 : PyObject *py_computer;
706 0 : if (object->computer == NULL) {
707 0 : Py_RETURN_NONE;
708 : }
709 0 : if (object->computer == NULL) {
710 0 : py_computer = Py_None;
711 0 : Py_INCREF(py_computer);
712 : } else {
713 0 : if (object->computer == NULL) {
714 0 : py_computer = Py_None;
715 0 : Py_INCREF(py_computer);
716 : } else {
717 0 : py_computer = PyUnicode_Decode(object->computer, strlen(object->computer), "utf-8", "ignore");
718 : }
719 : }
720 0 : return py_computer;
721 : }
722 :
723 0 : static int py_netr_UasInfo_set_computer(PyObject *py_obj, PyObject *value, void *closure)
724 : {
725 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
726 0 : if (value == NULL) {
727 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer");
728 0 : return -1;
729 : }
730 0 : if (value == Py_None) {
731 0 : object->computer = NULL;
732 : } else {
733 0 : object->computer = NULL;
734 : {
735 : const char *test_str;
736 : const char *talloc_str;
737 0 : PyObject *unicode = NULL;
738 0 : if (PyUnicode_Check(value)) {
739 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
740 0 : if (unicode == NULL) {
741 0 : PyErr_NoMemory();
742 0 : return -1;
743 : }
744 0 : test_str = PyBytes_AS_STRING(unicode);
745 0 : } else if (PyBytes_Check(value)) {
746 0 : test_str = PyBytes_AS_STRING(value);
747 : } else {
748 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
749 0 : return -1;
750 : }
751 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
752 0 : if (unicode != NULL) {
753 0 : Py_DECREF(unicode);
754 : }
755 0 : if (talloc_str == NULL) {
756 0 : PyErr_NoMemory();
757 0 : return -1;
758 : }
759 0 : object->computer = talloc_str;
760 : }
761 : }
762 0 : return 0;
763 : }
764 :
765 0 : static PyObject *py_netr_UasInfo_get_domain(PyObject *obj, void *closure)
766 : {
767 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
768 : PyObject *py_domain;
769 0 : if (object->domain == NULL) {
770 0 : Py_RETURN_NONE;
771 : }
772 0 : if (object->domain == NULL) {
773 0 : py_domain = Py_None;
774 0 : Py_INCREF(py_domain);
775 : } else {
776 0 : if (object->domain == NULL) {
777 0 : py_domain = Py_None;
778 0 : Py_INCREF(py_domain);
779 : } else {
780 0 : py_domain = PyUnicode_Decode(object->domain, strlen(object->domain), "utf-8", "ignore");
781 : }
782 : }
783 0 : return py_domain;
784 : }
785 :
786 0 : static int py_netr_UasInfo_set_domain(PyObject *py_obj, PyObject *value, void *closure)
787 : {
788 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
789 0 : if (value == NULL) {
790 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain");
791 0 : return -1;
792 : }
793 0 : if (value == Py_None) {
794 0 : object->domain = NULL;
795 : } else {
796 0 : object->domain = NULL;
797 : {
798 : const char *test_str;
799 : const char *talloc_str;
800 0 : PyObject *unicode = NULL;
801 0 : if (PyUnicode_Check(value)) {
802 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
803 0 : if (unicode == NULL) {
804 0 : PyErr_NoMemory();
805 0 : return -1;
806 : }
807 0 : test_str = PyBytes_AS_STRING(unicode);
808 0 : } else if (PyBytes_Check(value)) {
809 0 : test_str = PyBytes_AS_STRING(value);
810 : } else {
811 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
812 0 : return -1;
813 : }
814 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
815 0 : if (unicode != NULL) {
816 0 : Py_DECREF(unicode);
817 : }
818 0 : if (talloc_str == NULL) {
819 0 : PyErr_NoMemory();
820 0 : return -1;
821 : }
822 0 : object->domain = talloc_str;
823 : }
824 : }
825 0 : return 0;
826 : }
827 :
828 0 : static PyObject *py_netr_UasInfo_get_script_path(PyObject *obj, void *closure)
829 : {
830 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
831 : PyObject *py_script_path;
832 0 : if (object->script_path == NULL) {
833 0 : Py_RETURN_NONE;
834 : }
835 0 : if (object->script_path == NULL) {
836 0 : py_script_path = Py_None;
837 0 : Py_INCREF(py_script_path);
838 : } else {
839 0 : if (object->script_path == NULL) {
840 0 : py_script_path = Py_None;
841 0 : Py_INCREF(py_script_path);
842 : } else {
843 0 : py_script_path = PyUnicode_Decode(object->script_path, strlen(object->script_path), "utf-8", "ignore");
844 : }
845 : }
846 0 : return py_script_path;
847 : }
848 :
849 0 : static int py_netr_UasInfo_set_script_path(PyObject *py_obj, PyObject *value, void *closure)
850 : {
851 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
852 0 : if (value == NULL) {
853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->script_path");
854 0 : return -1;
855 : }
856 0 : if (value == Py_None) {
857 0 : object->script_path = NULL;
858 : } else {
859 0 : object->script_path = NULL;
860 : {
861 : const char *test_str;
862 : const char *talloc_str;
863 0 : PyObject *unicode = NULL;
864 0 : if (PyUnicode_Check(value)) {
865 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
866 0 : if (unicode == NULL) {
867 0 : PyErr_NoMemory();
868 0 : return -1;
869 : }
870 0 : test_str = PyBytes_AS_STRING(unicode);
871 0 : } else if (PyBytes_Check(value)) {
872 0 : test_str = PyBytes_AS_STRING(value);
873 : } else {
874 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
875 0 : return -1;
876 : }
877 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
878 0 : if (unicode != NULL) {
879 0 : Py_DECREF(unicode);
880 : }
881 0 : if (talloc_str == NULL) {
882 0 : PyErr_NoMemory();
883 0 : return -1;
884 : }
885 0 : object->script_path = talloc_str;
886 : }
887 : }
888 0 : return 0;
889 : }
890 :
891 0 : static PyObject *py_netr_UasInfo_get_unknown(PyObject *obj, void *closure)
892 : {
893 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(obj);
894 : PyObject *py_unknown;
895 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
896 0 : return py_unknown;
897 : }
898 :
899 0 : static int py_netr_UasInfo_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
900 : {
901 0 : struct netr_UasInfo *object = (struct netr_UasInfo *)pytalloc_get_ptr(py_obj);
902 0 : if (value == NULL) {
903 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
904 0 : return -1;
905 : }
906 : {
907 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
908 0 : if (PyLong_Check(value)) {
909 : unsigned long long test_var;
910 0 : test_var = PyLong_AsUnsignedLongLong(value);
911 0 : if (PyErr_Occurred() != NULL) {
912 0 : return -1;
913 : }
914 0 : if (test_var > uint_max) {
915 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
916 : PyLong_Type.tp_name, uint_max, test_var);
917 0 : return -1;
918 : }
919 0 : object->unknown = test_var;
920 : } else {
921 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
922 : PyLong_Type.tp_name);
923 0 : return -1;
924 : }
925 : }
926 0 : return 0;
927 : }
928 :
929 : static PyGetSetDef py_netr_UasInfo_getsetters[] = {
930 : {
931 : .name = discard_const_p(char, "account_name"),
932 : .get = py_netr_UasInfo_get_account_name,
933 : .set = py_netr_UasInfo_set_account_name,
934 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
935 : },
936 : {
937 : .name = discard_const_p(char, "priv"),
938 : .get = py_netr_UasInfo_get_priv,
939 : .set = py_netr_UasInfo_set_priv,
940 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
941 : },
942 : {
943 : .name = discard_const_p(char, "auth_flags"),
944 : .get = py_netr_UasInfo_get_auth_flags,
945 : .set = py_netr_UasInfo_set_auth_flags,
946 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
947 : },
948 : {
949 : .name = discard_const_p(char, "logon_count"),
950 : .get = py_netr_UasInfo_get_logon_count,
951 : .set = py_netr_UasInfo_set_logon_count,
952 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
953 : },
954 : {
955 : .name = discard_const_p(char, "bad_pw_count"),
956 : .get = py_netr_UasInfo_get_bad_pw_count,
957 : .set = py_netr_UasInfo_set_bad_pw_count,
958 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
959 : },
960 : {
961 : .name = discard_const_p(char, "last_logon"),
962 : .get = py_netr_UasInfo_get_last_logon,
963 : .set = py_netr_UasInfo_set_last_logon,
964 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
965 : },
966 : {
967 : .name = discard_const_p(char, "last_logoff"),
968 : .get = py_netr_UasInfo_get_last_logoff,
969 : .set = py_netr_UasInfo_set_last_logoff,
970 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
971 : },
972 : {
973 : .name = discard_const_p(char, "logoff_time"),
974 : .get = py_netr_UasInfo_get_logoff_time,
975 : .set = py_netr_UasInfo_set_logoff_time,
976 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
977 : },
978 : {
979 : .name = discard_const_p(char, "kickoff_time"),
980 : .get = py_netr_UasInfo_get_kickoff_time,
981 : .set = py_netr_UasInfo_set_kickoff_time,
982 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
983 : },
984 : {
985 : .name = discard_const_p(char, "password_age"),
986 : .get = py_netr_UasInfo_get_password_age,
987 : .set = py_netr_UasInfo_set_password_age,
988 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
989 : },
990 : {
991 : .name = discard_const_p(char, "pw_can_change"),
992 : .get = py_netr_UasInfo_get_pw_can_change,
993 : .set = py_netr_UasInfo_set_pw_can_change,
994 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
995 : },
996 : {
997 : .name = discard_const_p(char, "pw_must_change"),
998 : .get = py_netr_UasInfo_get_pw_must_change,
999 : .set = py_netr_UasInfo_set_pw_must_change,
1000 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
1001 : },
1002 : {
1003 : .name = discard_const_p(char, "computer"),
1004 : .get = py_netr_UasInfo_get_computer,
1005 : .set = py_netr_UasInfo_set_computer,
1006 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1007 : },
1008 : {
1009 : .name = discard_const_p(char, "domain"),
1010 : .get = py_netr_UasInfo_get_domain,
1011 : .set = py_netr_UasInfo_set_domain,
1012 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1013 : },
1014 : {
1015 : .name = discard_const_p(char, "script_path"),
1016 : .get = py_netr_UasInfo_get_script_path,
1017 : .set = py_netr_UasInfo_set_script_path,
1018 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1019 : },
1020 : {
1021 : .name = discard_const_p(char, "unknown"),
1022 : .get = py_netr_UasInfo_get_unknown,
1023 : .set = py_netr_UasInfo_set_unknown,
1024 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1025 : },
1026 : { .name = NULL }
1027 : };
1028 :
1029 0 : static PyObject *py_netr_UasInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1030 : {
1031 0 : return pytalloc_new(struct netr_UasInfo, type);
1032 : }
1033 :
1034 :
1035 : static PyTypeObject netr_UasInfo_Type = {
1036 : PyVarObject_HEAD_INIT(NULL, 0)
1037 : .tp_name = "netlogon.netr_UasInfo",
1038 : .tp_getset = py_netr_UasInfo_getsetters,
1039 : .tp_methods = NULL,
1040 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1041 : .tp_new = py_netr_UasInfo_new,
1042 : };
1043 :
1044 :
1045 0 : static PyObject *py_netr_UasLogoffInfo_get_duration(PyObject *obj, void *closure)
1046 : {
1047 0 : struct netr_UasLogoffInfo *object = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(obj);
1048 : PyObject *py_duration;
1049 0 : py_duration = PyLong_FromUnsignedLongLong((uint32_t)object->duration);
1050 0 : return py_duration;
1051 : }
1052 :
1053 0 : static int py_netr_UasLogoffInfo_set_duration(PyObject *py_obj, PyObject *value, void *closure)
1054 : {
1055 0 : struct netr_UasLogoffInfo *object = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(py_obj);
1056 0 : if (value == NULL) {
1057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->duration");
1058 0 : return -1;
1059 : }
1060 : {
1061 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->duration));
1062 0 : if (PyLong_Check(value)) {
1063 : unsigned long long test_var;
1064 0 : test_var = PyLong_AsUnsignedLongLong(value);
1065 0 : if (PyErr_Occurred() != NULL) {
1066 0 : return -1;
1067 : }
1068 0 : if (test_var > uint_max) {
1069 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1070 : PyLong_Type.tp_name, uint_max, test_var);
1071 0 : return -1;
1072 : }
1073 0 : object->duration = test_var;
1074 : } else {
1075 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1076 : PyLong_Type.tp_name);
1077 0 : return -1;
1078 : }
1079 : }
1080 0 : return 0;
1081 : }
1082 :
1083 0 : static PyObject *py_netr_UasLogoffInfo_get_logon_count(PyObject *obj, void *closure)
1084 : {
1085 0 : struct netr_UasLogoffInfo *object = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(obj);
1086 : PyObject *py_logon_count;
1087 0 : py_logon_count = PyLong_FromLong((uint16_t)object->logon_count);
1088 0 : return py_logon_count;
1089 : }
1090 :
1091 0 : static int py_netr_UasLogoffInfo_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
1092 : {
1093 0 : struct netr_UasLogoffInfo *object = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(py_obj);
1094 0 : if (value == NULL) {
1095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count");
1096 0 : return -1;
1097 : }
1098 : {
1099 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count));
1100 0 : if (PyLong_Check(value)) {
1101 : unsigned long long test_var;
1102 0 : test_var = PyLong_AsUnsignedLongLong(value);
1103 0 : if (PyErr_Occurred() != NULL) {
1104 0 : return -1;
1105 : }
1106 0 : if (test_var > uint_max) {
1107 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1108 : PyLong_Type.tp_name, uint_max, test_var);
1109 0 : return -1;
1110 : }
1111 0 : object->logon_count = test_var;
1112 : } else {
1113 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1114 : PyLong_Type.tp_name);
1115 0 : return -1;
1116 : }
1117 : }
1118 0 : return 0;
1119 : }
1120 :
1121 : static PyGetSetDef py_netr_UasLogoffInfo_getsetters[] = {
1122 : {
1123 : .name = discard_const_p(char, "duration"),
1124 : .get = py_netr_UasLogoffInfo_get_duration,
1125 : .set = py_netr_UasLogoffInfo_set_duration,
1126 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1127 : },
1128 : {
1129 : .name = discard_const_p(char, "logon_count"),
1130 : .get = py_netr_UasLogoffInfo_get_logon_count,
1131 : .set = py_netr_UasLogoffInfo_set_logon_count,
1132 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1133 : },
1134 : { .name = NULL }
1135 : };
1136 :
1137 0 : static PyObject *py_netr_UasLogoffInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1138 : {
1139 0 : return pytalloc_new(struct netr_UasLogoffInfo, type);
1140 : }
1141 :
1142 :
1143 : static PyTypeObject netr_UasLogoffInfo_Type = {
1144 : PyVarObject_HEAD_INIT(NULL, 0)
1145 : .tp_name = "netlogon.netr_UasLogoffInfo",
1146 : .tp_getset = py_netr_UasLogoffInfo_getsetters,
1147 : .tp_methods = NULL,
1148 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1149 : .tp_new = py_netr_UasLogoffInfo_new,
1150 : };
1151 :
1152 :
1153 0 : static PyObject *py_netr_AcctLockStr_get_lockout_duration(PyObject *obj, void *closure)
1154 : {
1155 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(obj);
1156 : PyObject *py_lockout_duration;
1157 0 : py_lockout_duration = PyLong_FromLongLong(object->lockout_duration);
1158 0 : return py_lockout_duration;
1159 : }
1160 :
1161 0 : static int py_netr_AcctLockStr_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure)
1162 : {
1163 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj);
1164 0 : if (value == NULL) {
1165 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_duration");
1166 0 : return -1;
1167 : }
1168 : {
1169 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->lockout_duration));
1170 0 : const long long int_min = -int_max - 1;
1171 0 : if (PyLong_Check(value)) {
1172 : long long test_var;
1173 0 : test_var = PyLong_AsLongLong(value);
1174 0 : if (PyErr_Occurred() != NULL) {
1175 0 : return -1;
1176 : }
1177 0 : if (test_var < int_min || test_var > int_max) {
1178 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
1179 : PyLong_Type.tp_name, int_min, int_max, test_var);
1180 0 : return -1;
1181 : }
1182 0 : object->lockout_duration = test_var;
1183 : } else {
1184 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1185 : PyLong_Type.tp_name);
1186 0 : return -1;
1187 : }
1188 : }
1189 0 : return 0;
1190 : }
1191 :
1192 0 : static PyObject *py_netr_AcctLockStr_get_reset_count(PyObject *obj, void *closure)
1193 : {
1194 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(obj);
1195 : PyObject *py_reset_count;
1196 0 : py_reset_count = PyLong_FromUnsignedLongLong(object->reset_count);
1197 0 : return py_reset_count;
1198 : }
1199 :
1200 0 : static int py_netr_AcctLockStr_set_reset_count(PyObject *py_obj, PyObject *value, void *closure)
1201 : {
1202 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj);
1203 0 : if (value == NULL) {
1204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reset_count");
1205 0 : return -1;
1206 : }
1207 : {
1208 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reset_count));
1209 0 : if (PyLong_Check(value)) {
1210 : unsigned long long test_var;
1211 0 : test_var = PyLong_AsUnsignedLongLong(value);
1212 0 : if (PyErr_Occurred() != NULL) {
1213 0 : return -1;
1214 : }
1215 0 : if (test_var > uint_max) {
1216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1217 : PyLong_Type.tp_name, uint_max, test_var);
1218 0 : return -1;
1219 : }
1220 0 : object->reset_count = test_var;
1221 : } else {
1222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1223 : PyLong_Type.tp_name);
1224 0 : return -1;
1225 : }
1226 : }
1227 0 : return 0;
1228 : }
1229 :
1230 0 : static PyObject *py_netr_AcctLockStr_get_bad_attempt_lockout(PyObject *obj, void *closure)
1231 : {
1232 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(obj);
1233 : PyObject *py_bad_attempt_lockout;
1234 0 : py_bad_attempt_lockout = PyLong_FromUnsignedLongLong((uint32_t)object->bad_attempt_lockout);
1235 0 : return py_bad_attempt_lockout;
1236 : }
1237 :
1238 0 : static int py_netr_AcctLockStr_set_bad_attempt_lockout(PyObject *py_obj, PyObject *value, void *closure)
1239 : {
1240 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj);
1241 0 : if (value == NULL) {
1242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_attempt_lockout");
1243 0 : return -1;
1244 : }
1245 : {
1246 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_attempt_lockout));
1247 0 : if (PyLong_Check(value)) {
1248 : unsigned long long test_var;
1249 0 : test_var = PyLong_AsUnsignedLongLong(value);
1250 0 : if (PyErr_Occurred() != NULL) {
1251 0 : return -1;
1252 : }
1253 0 : if (test_var > uint_max) {
1254 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1255 : PyLong_Type.tp_name, uint_max, test_var);
1256 0 : return -1;
1257 : }
1258 0 : object->bad_attempt_lockout = test_var;
1259 : } else {
1260 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1261 : PyLong_Type.tp_name);
1262 0 : return -1;
1263 : }
1264 : }
1265 0 : return 0;
1266 : }
1267 :
1268 0 : static PyObject *py_netr_AcctLockStr_get_dummy(PyObject *obj, void *closure)
1269 : {
1270 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(obj);
1271 : PyObject *py_dummy;
1272 0 : py_dummy = PyLong_FromUnsignedLongLong((uint32_t)object->dummy);
1273 0 : return py_dummy;
1274 : }
1275 :
1276 0 : static int py_netr_AcctLockStr_set_dummy(PyObject *py_obj, PyObject *value, void *closure)
1277 : {
1278 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj);
1279 0 : if (value == NULL) {
1280 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy");
1281 0 : return -1;
1282 : }
1283 : {
1284 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy));
1285 0 : if (PyLong_Check(value)) {
1286 : unsigned long long test_var;
1287 0 : test_var = PyLong_AsUnsignedLongLong(value);
1288 0 : if (PyErr_Occurred() != NULL) {
1289 0 : return -1;
1290 : }
1291 0 : if (test_var > uint_max) {
1292 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1293 : PyLong_Type.tp_name, uint_max, test_var);
1294 0 : return -1;
1295 : }
1296 0 : object->dummy = test_var;
1297 : } else {
1298 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1299 : PyLong_Type.tp_name);
1300 0 : return -1;
1301 : }
1302 : }
1303 0 : return 0;
1304 : }
1305 :
1306 : static PyGetSetDef py_netr_AcctLockStr_getsetters[] = {
1307 : {
1308 : .name = discard_const_p(char, "lockout_duration"),
1309 : .get = py_netr_AcctLockStr_get_lockout_duration,
1310 : .set = py_netr_AcctLockStr_set_lockout_duration,
1311 : .doc = discard_const_p(char, "PIDL-generated element of base type dlong")
1312 : },
1313 : {
1314 : .name = discard_const_p(char, "reset_count"),
1315 : .get = py_netr_AcctLockStr_get_reset_count,
1316 : .set = py_netr_AcctLockStr_set_reset_count,
1317 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
1318 : },
1319 : {
1320 : .name = discard_const_p(char, "bad_attempt_lockout"),
1321 : .get = py_netr_AcctLockStr_get_bad_attempt_lockout,
1322 : .set = py_netr_AcctLockStr_set_bad_attempt_lockout,
1323 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1324 : },
1325 : {
1326 : .name = discard_const_p(char, "dummy"),
1327 : .get = py_netr_AcctLockStr_get_dummy,
1328 : .set = py_netr_AcctLockStr_set_dummy,
1329 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1330 : },
1331 : { .name = NULL }
1332 : };
1333 :
1334 0 : static PyObject *py_netr_AcctLockStr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1335 : {
1336 0 : return pytalloc_new(struct netr_AcctLockStr, type);
1337 : }
1338 :
1339 0 : static PyObject *py_netr_AcctLockStr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1340 : {
1341 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj);
1342 0 : PyObject *ret = NULL;
1343 : DATA_BLOB blob;
1344 : enum ndr_err_code err;
1345 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1346 0 : if (tmp_ctx == NULL) {
1347 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1348 0 : return NULL;
1349 : }
1350 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_AcctLockStr);
1351 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1352 0 : TALLOC_FREE(tmp_ctx);
1353 0 : PyErr_SetNdrError(err);
1354 0 : return NULL;
1355 : }
1356 :
1357 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1358 0 : TALLOC_FREE(tmp_ctx);
1359 0 : return ret;
1360 : }
1361 :
1362 0 : static PyObject *py_netr_AcctLockStr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1363 : {
1364 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj);
1365 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1366 0 : Py_ssize_t blob_length = 0;
1367 : enum ndr_err_code err;
1368 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1369 0 : PyObject *allow_remaining_obj = NULL;
1370 0 : bool allow_remaining = false;
1371 :
1372 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1373 : discard_const_p(char *, kwnames),
1374 : &blob.data, &blob_length,
1375 : &allow_remaining_obj)) {
1376 0 : return NULL;
1377 : }
1378 0 : blob.length = blob_length;
1379 :
1380 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1381 0 : allow_remaining = true;
1382 : }
1383 :
1384 0 : if (allow_remaining) {
1385 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_AcctLockStr);
1386 : } else {
1387 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_AcctLockStr);
1388 : }
1389 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1390 0 : PyErr_SetNdrError(err);
1391 0 : return NULL;
1392 : }
1393 :
1394 0 : Py_RETURN_NONE;
1395 : }
1396 :
1397 0 : static PyObject *py_netr_AcctLockStr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1398 : {
1399 0 : struct netr_AcctLockStr *object = (struct netr_AcctLockStr *)pytalloc_get_ptr(py_obj);
1400 : PyObject *ret;
1401 : char *retstr;
1402 :
1403 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_AcctLockStr, "netr_AcctLockStr", object);
1404 0 : ret = PyUnicode_FromString(retstr);
1405 0 : talloc_free(retstr);
1406 :
1407 0 : return ret;
1408 : }
1409 :
1410 : static PyMethodDef py_netr_AcctLockStr_methods[] = {
1411 : { "__ndr_pack__", (PyCFunction)py_netr_AcctLockStr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1412 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AcctLockStr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1413 : { "__ndr_print__", (PyCFunction)py_netr_AcctLockStr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1414 : { NULL, NULL, 0, NULL }
1415 : };
1416 :
1417 :
1418 : static PyTypeObject netr_AcctLockStr_Type = {
1419 : PyVarObject_HEAD_INIT(NULL, 0)
1420 : .tp_name = "netlogon.netr_AcctLockStr",
1421 : .tp_getset = py_netr_AcctLockStr_getsetters,
1422 : .tp_methods = py_netr_AcctLockStr_methods,
1423 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1424 : .tp_new = py_netr_AcctLockStr_new,
1425 : };
1426 :
1427 :
1428 18 : static PyObject *py_netr_IdentityInfo_get_domain_name(PyObject *obj, void *closure)
1429 : {
1430 18 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj);
1431 : PyObject *py_domain_name;
1432 18 : py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
1433 18 : return py_domain_name;
1434 : }
1435 :
1436 0 : static int py_netr_IdentityInfo_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
1437 : {
1438 0 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj);
1439 0 : if (value == NULL) {
1440 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
1441 0 : return -1;
1442 : }
1443 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1444 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1445 0 : PyErr_NoMemory();
1446 0 : return -1;
1447 : }
1448 0 : object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
1449 0 : return 0;
1450 : }
1451 :
1452 0 : static PyObject *py_netr_IdentityInfo_get_parameter_control(PyObject *obj, void *closure)
1453 : {
1454 0 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj);
1455 : PyObject *py_parameter_control;
1456 0 : py_parameter_control = PyLong_FromUnsignedLongLong((uint32_t)object->parameter_control);
1457 0 : return py_parameter_control;
1458 : }
1459 :
1460 3 : static int py_netr_IdentityInfo_set_parameter_control(PyObject *py_obj, PyObject *value, void *closure)
1461 : {
1462 3 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj);
1463 3 : if (value == NULL) {
1464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parameter_control");
1465 0 : return -1;
1466 : }
1467 : {
1468 3 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->parameter_control));
1469 3 : if (PyLong_Check(value)) {
1470 : unsigned long long test_var;
1471 3 : test_var = PyLong_AsUnsignedLongLong(value);
1472 3 : if (PyErr_Occurred() != NULL) {
1473 0 : return -1;
1474 : }
1475 3 : if (test_var > uint_max) {
1476 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1477 : PyLong_Type.tp_name, uint_max, test_var);
1478 0 : return -1;
1479 : }
1480 3 : object->parameter_control = test_var;
1481 : } else {
1482 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1483 : PyLong_Type.tp_name);
1484 0 : return -1;
1485 : }
1486 : }
1487 3 : return 0;
1488 : }
1489 :
1490 0 : static PyObject *py_netr_IdentityInfo_get_logon_id(PyObject *obj, void *closure)
1491 : {
1492 0 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj);
1493 : PyObject *py_logon_id;
1494 0 : py_logon_id = PyLong_FromUnsignedLongLong(object->logon_id);
1495 0 : return py_logon_id;
1496 : }
1497 :
1498 0 : static int py_netr_IdentityInfo_set_logon_id(PyObject *py_obj, PyObject *value, void *closure)
1499 : {
1500 0 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj);
1501 0 : if (value == NULL) {
1502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_id");
1503 0 : return -1;
1504 : }
1505 : {
1506 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_id));
1507 0 : if (PyLong_Check(value)) {
1508 : unsigned long long test_var;
1509 0 : test_var = PyLong_AsUnsignedLongLong(value);
1510 0 : if (PyErr_Occurred() != NULL) {
1511 0 : return -1;
1512 : }
1513 0 : if (test_var > uint_max) {
1514 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1515 : PyLong_Type.tp_name, uint_max, test_var);
1516 0 : return -1;
1517 : }
1518 0 : object->logon_id = test_var;
1519 : } else {
1520 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1521 : PyLong_Type.tp_name);
1522 0 : return -1;
1523 : }
1524 : }
1525 0 : return 0;
1526 : }
1527 :
1528 18 : static PyObject *py_netr_IdentityInfo_get_account_name(PyObject *obj, void *closure)
1529 : {
1530 18 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj);
1531 : PyObject *py_account_name;
1532 18 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
1533 18 : return py_account_name;
1534 : }
1535 :
1536 0 : static int py_netr_IdentityInfo_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
1537 : {
1538 0 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj);
1539 0 : if (value == NULL) {
1540 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
1541 0 : return -1;
1542 : }
1543 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1544 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1545 0 : PyErr_NoMemory();
1546 0 : return -1;
1547 : }
1548 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
1549 0 : return 0;
1550 : }
1551 :
1552 18 : static PyObject *py_netr_IdentityInfo_get_workstation(PyObject *obj, void *closure)
1553 : {
1554 18 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(obj);
1555 : PyObject *py_workstation;
1556 18 : py_workstation = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstation);
1557 18 : return py_workstation;
1558 : }
1559 :
1560 0 : static int py_netr_IdentityInfo_set_workstation(PyObject *py_obj, PyObject *value, void *closure)
1561 : {
1562 0 : struct netr_IdentityInfo *object = (struct netr_IdentityInfo *)pytalloc_get_ptr(py_obj);
1563 0 : if (value == NULL) {
1564 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstation");
1565 0 : return -1;
1566 : }
1567 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1568 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1569 0 : PyErr_NoMemory();
1570 0 : return -1;
1571 : }
1572 0 : object->workstation = *(struct lsa_String *)pytalloc_get_ptr(value);
1573 0 : return 0;
1574 : }
1575 :
1576 : static PyGetSetDef py_netr_IdentityInfo_getsetters[] = {
1577 : {
1578 : .name = discard_const_p(char, "domain_name"),
1579 : .get = py_netr_IdentityInfo_get_domain_name,
1580 : .set = py_netr_IdentityInfo_set_domain_name,
1581 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1582 : },
1583 : {
1584 : .name = discard_const_p(char, "parameter_control"),
1585 : .get = py_netr_IdentityInfo_get_parameter_control,
1586 : .set = py_netr_IdentityInfo_set_parameter_control,
1587 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonParameterControl")
1588 : },
1589 : {
1590 : .name = discard_const_p(char, "logon_id"),
1591 : .get = py_netr_IdentityInfo_get_logon_id,
1592 : .set = py_netr_IdentityInfo_set_logon_id,
1593 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
1594 : },
1595 : {
1596 : .name = discard_const_p(char, "account_name"),
1597 : .get = py_netr_IdentityInfo_get_account_name,
1598 : .set = py_netr_IdentityInfo_set_account_name,
1599 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1600 : },
1601 : {
1602 : .name = discard_const_p(char, "workstation"),
1603 : .get = py_netr_IdentityInfo_get_workstation,
1604 : .set = py_netr_IdentityInfo_set_workstation,
1605 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1606 : },
1607 : { .name = NULL }
1608 : };
1609 :
1610 18 : static PyObject *py_netr_IdentityInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1611 : {
1612 18 : return pytalloc_new(struct netr_IdentityInfo, type);
1613 : }
1614 :
1615 :
1616 : static PyTypeObject netr_IdentityInfo_Type = {
1617 : PyVarObject_HEAD_INIT(NULL, 0)
1618 : .tp_name = "netlogon.netr_IdentityInfo",
1619 : .tp_getset = py_netr_IdentityInfo_getsetters,
1620 : .tp_methods = NULL,
1621 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1622 : .tp_new = py_netr_IdentityInfo_new,
1623 : };
1624 :
1625 :
1626 0 : static PyObject *py_netr_PasswordInfo_get_identity_info(PyObject *obj, void *closure)
1627 : {
1628 0 : struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(obj);
1629 : PyObject *py_identity_info;
1630 0 : py_identity_info = pytalloc_reference_ex(&netr_IdentityInfo_Type, pytalloc_get_mem_ctx(obj), &object->identity_info);
1631 0 : return py_identity_info;
1632 : }
1633 :
1634 0 : static int py_netr_PasswordInfo_set_identity_info(PyObject *py_obj, PyObject *value, void *closure)
1635 : {
1636 0 : struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(py_obj);
1637 0 : if (value == NULL) {
1638 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->identity_info");
1639 0 : return -1;
1640 : }
1641 0 : PY_CHECK_TYPE(&netr_IdentityInfo_Type, value, return -1;);
1642 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1643 0 : PyErr_NoMemory();
1644 0 : return -1;
1645 : }
1646 0 : object->identity_info = *(struct netr_IdentityInfo *)pytalloc_get_ptr(value);
1647 0 : return 0;
1648 : }
1649 :
1650 0 : static PyObject *py_netr_PasswordInfo_get_lmpassword(PyObject *obj, void *closure)
1651 : {
1652 0 : struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(obj);
1653 : PyObject *py_lmpassword;
1654 0 : py_lmpassword = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lmpassword);
1655 0 : return py_lmpassword;
1656 : }
1657 :
1658 0 : static int py_netr_PasswordInfo_set_lmpassword(PyObject *py_obj, PyObject *value, void *closure)
1659 : {
1660 0 : struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(py_obj);
1661 0 : if (value == NULL) {
1662 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmpassword");
1663 0 : return -1;
1664 : }
1665 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
1666 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1667 0 : PyErr_NoMemory();
1668 0 : return -1;
1669 : }
1670 0 : object->lmpassword = *(struct samr_Password *)pytalloc_get_ptr(value);
1671 0 : return 0;
1672 : }
1673 :
1674 0 : static PyObject *py_netr_PasswordInfo_get_ntpassword(PyObject *obj, void *closure)
1675 : {
1676 0 : struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(obj);
1677 : PyObject *py_ntpassword;
1678 0 : py_ntpassword = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->ntpassword);
1679 0 : return py_ntpassword;
1680 : }
1681 :
1682 0 : static int py_netr_PasswordInfo_set_ntpassword(PyObject *py_obj, PyObject *value, void *closure)
1683 : {
1684 0 : struct netr_PasswordInfo *object = (struct netr_PasswordInfo *)pytalloc_get_ptr(py_obj);
1685 0 : if (value == NULL) {
1686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntpassword");
1687 0 : return -1;
1688 : }
1689 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
1690 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1691 0 : PyErr_NoMemory();
1692 0 : return -1;
1693 : }
1694 0 : object->ntpassword = *(struct samr_Password *)pytalloc_get_ptr(value);
1695 0 : return 0;
1696 : }
1697 :
1698 : static PyGetSetDef py_netr_PasswordInfo_getsetters[] = {
1699 : {
1700 : .name = discard_const_p(char, "identity_info"),
1701 : .get = py_netr_PasswordInfo_get_identity_info,
1702 : .set = py_netr_PasswordInfo_set_identity_info,
1703 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_IdentityInfo")
1704 : },
1705 : {
1706 : .name = discard_const_p(char, "lmpassword"),
1707 : .get = py_netr_PasswordInfo_get_lmpassword,
1708 : .set = py_netr_PasswordInfo_set_lmpassword,
1709 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
1710 : },
1711 : {
1712 : .name = discard_const_p(char, "ntpassword"),
1713 : .get = py_netr_PasswordInfo_get_ntpassword,
1714 : .set = py_netr_PasswordInfo_set_ntpassword,
1715 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
1716 : },
1717 : { .name = NULL }
1718 : };
1719 :
1720 0 : static PyObject *py_netr_PasswordInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1721 : {
1722 0 : return pytalloc_new(struct netr_PasswordInfo, type);
1723 : }
1724 :
1725 :
1726 : static PyTypeObject netr_PasswordInfo_Type = {
1727 : PyVarObject_HEAD_INIT(NULL, 0)
1728 : .tp_name = "netlogon.netr_PasswordInfo",
1729 : .tp_getset = py_netr_PasswordInfo_getsetters,
1730 : .tp_methods = NULL,
1731 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1732 : .tp_new = py_netr_PasswordInfo_new,
1733 : };
1734 :
1735 :
1736 0 : static PyObject *py_netr_ChallengeResponse_get_length(PyObject *obj, void *closure)
1737 : {
1738 0 : struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(obj);
1739 : PyObject *py_length;
1740 0 : py_length = PyLong_FromLong((uint16_t)object->length);
1741 0 : return py_length;
1742 : }
1743 :
1744 18 : static int py_netr_ChallengeResponse_set_length(PyObject *py_obj, PyObject *value, void *closure)
1745 : {
1746 18 : struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(py_obj);
1747 18 : if (value == NULL) {
1748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
1749 0 : return -1;
1750 : }
1751 : {
1752 18 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1753 18 : if (PyLong_Check(value)) {
1754 : unsigned long long test_var;
1755 18 : test_var = PyLong_AsUnsignedLongLong(value);
1756 18 : if (PyErr_Occurred() != NULL) {
1757 0 : return -1;
1758 : }
1759 18 : if (test_var > uint_max) {
1760 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1761 : PyLong_Type.tp_name, uint_max, test_var);
1762 0 : return -1;
1763 : }
1764 18 : object->length = test_var;
1765 : } else {
1766 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1767 : PyLong_Type.tp_name);
1768 0 : return -1;
1769 : }
1770 : }
1771 18 : return 0;
1772 : }
1773 :
1774 0 : static PyObject *py_netr_ChallengeResponse_get_size(PyObject *obj, void *closure)
1775 : {
1776 0 : struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(obj);
1777 : PyObject *py_size;
1778 0 : py_size = PyLong_FromLong((uint16_t)object->size);
1779 0 : return py_size;
1780 : }
1781 :
1782 0 : static int py_netr_ChallengeResponse_set_size(PyObject *py_obj, PyObject *value, void *closure)
1783 : {
1784 0 : struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(py_obj);
1785 0 : if (value == NULL) {
1786 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
1787 0 : return -1;
1788 : }
1789 : {
1790 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1791 0 : if (PyLong_Check(value)) {
1792 : unsigned long long test_var;
1793 0 : test_var = PyLong_AsUnsignedLongLong(value);
1794 0 : if (PyErr_Occurred() != NULL) {
1795 0 : return -1;
1796 : }
1797 0 : if (test_var > uint_max) {
1798 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1799 : PyLong_Type.tp_name, uint_max, test_var);
1800 0 : return -1;
1801 : }
1802 0 : object->size = test_var;
1803 : } else {
1804 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1805 : PyLong_Type.tp_name);
1806 0 : return -1;
1807 : }
1808 : }
1809 0 : return 0;
1810 : }
1811 :
1812 0 : static PyObject *py_netr_ChallengeResponse_get_data(PyObject *obj, void *closure)
1813 : {
1814 0 : struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(obj);
1815 : PyObject *py_data;
1816 0 : if (object->data == NULL) {
1817 0 : Py_RETURN_NONE;
1818 : }
1819 0 : if (object->data == NULL) {
1820 0 : py_data = Py_None;
1821 0 : Py_INCREF(py_data);
1822 : } else {
1823 0 : py_data = PyList_New(object->length);
1824 0 : if (py_data == NULL) {
1825 0 : return NULL;
1826 : }
1827 : {
1828 : int data_cntr_1;
1829 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
1830 : PyObject *py_data_1;
1831 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
1832 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
1833 : }
1834 : }
1835 : }
1836 0 : return py_data;
1837 : }
1838 :
1839 18 : static int py_netr_ChallengeResponse_set_data(PyObject *py_obj, PyObject *value, void *closure)
1840 : {
1841 18 : struct netr_ChallengeResponse *object = (struct netr_ChallengeResponse *)pytalloc_get_ptr(py_obj);
1842 18 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
1843 18 : if (value == NULL) {
1844 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
1845 0 : return -1;
1846 : }
1847 18 : if (value == Py_None) {
1848 0 : object->data = NULL;
1849 : } else {
1850 18 : object->data = NULL;
1851 18 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1852 : {
1853 : int data_cntr_1;
1854 18 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
1855 18 : if (!object->data) { return -1;; }
1856 18 : talloc_set_name_const(object->data, "ARRAY: object->data");
1857 1226 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
1858 1208 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
1859 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
1860 0 : return -1;
1861 : }
1862 : {
1863 1208 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
1864 1208 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
1865 : unsigned long long test_var;
1866 1208 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
1867 1208 : if (PyErr_Occurred() != NULL) {
1868 0 : return -1;
1869 : }
1870 1208 : if (test_var > uint_max) {
1871 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1872 : PyLong_Type.tp_name, uint_max, test_var);
1873 0 : return -1;
1874 : }
1875 1208 : object->data[data_cntr_1] = test_var;
1876 : } else {
1877 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1878 : PyLong_Type.tp_name);
1879 0 : return -1;
1880 : }
1881 : }
1882 : }
1883 : }
1884 : }
1885 18 : return 0;
1886 : }
1887 :
1888 : static PyGetSetDef py_netr_ChallengeResponse_getsetters[] = {
1889 : {
1890 : .name = discard_const_p(char, "length"),
1891 : .get = py_netr_ChallengeResponse_get_length,
1892 : .set = py_netr_ChallengeResponse_set_length,
1893 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1894 : },
1895 : {
1896 : .name = discard_const_p(char, "size"),
1897 : .get = py_netr_ChallengeResponse_get_size,
1898 : .set = py_netr_ChallengeResponse_set_size,
1899 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1900 : },
1901 : {
1902 : .name = discard_const_p(char, "data"),
1903 : .get = py_netr_ChallengeResponse_get_data,
1904 : .set = py_netr_ChallengeResponse_set_data,
1905 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1906 : },
1907 : { .name = NULL }
1908 : };
1909 :
1910 18 : static PyObject *py_netr_ChallengeResponse_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1911 : {
1912 18 : return pytalloc_new(struct netr_ChallengeResponse, type);
1913 : }
1914 :
1915 :
1916 : static PyTypeObject netr_ChallengeResponse_Type = {
1917 : PyVarObject_HEAD_INIT(NULL, 0)
1918 : .tp_name = "netlogon.netr_ChallengeResponse",
1919 : .tp_getset = py_netr_ChallengeResponse_getsetters,
1920 : .tp_methods = NULL,
1921 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1922 : .tp_new = py_netr_ChallengeResponse_new,
1923 : };
1924 :
1925 :
1926 57 : static PyObject *py_netr_NetworkInfo_get_identity_info(PyObject *obj, void *closure)
1927 : {
1928 57 : struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(obj);
1929 : PyObject *py_identity_info;
1930 57 : py_identity_info = pytalloc_reference_ex(&netr_IdentityInfo_Type, pytalloc_get_mem_ctx(obj), &object->identity_info);
1931 57 : return py_identity_info;
1932 : }
1933 :
1934 18 : static int py_netr_NetworkInfo_set_identity_info(PyObject *py_obj, PyObject *value, void *closure)
1935 : {
1936 18 : struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(py_obj);
1937 18 : if (value == NULL) {
1938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->identity_info");
1939 0 : return -1;
1940 : }
1941 18 : PY_CHECK_TYPE(&netr_IdentityInfo_Type, value, return -1;);
1942 18 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1943 0 : PyErr_NoMemory();
1944 0 : return -1;
1945 : }
1946 18 : object->identity_info = *(struct netr_IdentityInfo *)pytalloc_get_ptr(value);
1947 18 : return 0;
1948 : }
1949 :
1950 0 : static PyObject *py_netr_NetworkInfo_get_challenge(PyObject *obj, void *closure)
1951 : {
1952 0 : struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(obj);
1953 : PyObject *py_challenge;
1954 0 : py_challenge = PyList_New(8);
1955 0 : if (py_challenge == NULL) {
1956 0 : return NULL;
1957 : }
1958 : {
1959 : int challenge_cntr_0;
1960 0 : for (challenge_cntr_0 = 0; challenge_cntr_0 < (8); challenge_cntr_0++) {
1961 : PyObject *py_challenge_0;
1962 0 : py_challenge_0 = PyLong_FromLong((uint16_t)object->challenge[challenge_cntr_0]);
1963 0 : PyList_SetItem(py_challenge, challenge_cntr_0, py_challenge_0);
1964 : }
1965 : }
1966 0 : return py_challenge;
1967 : }
1968 :
1969 18 : static int py_netr_NetworkInfo_set_challenge(PyObject *py_obj, PyObject *value, void *closure)
1970 : {
1971 18 : struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(py_obj);
1972 18 : if (value == NULL) {
1973 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->challenge");
1974 0 : return -1;
1975 : }
1976 18 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1977 : {
1978 : int challenge_cntr_0;
1979 18 : if (ARRAY_SIZE(object->challenge) != PyList_GET_SIZE(value)) {
1980 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->challenge), PyList_GET_SIZE(value));
1981 0 : return -1;
1982 : }
1983 162 : for (challenge_cntr_0 = 0; challenge_cntr_0 < PyList_GET_SIZE(value); challenge_cntr_0++) {
1984 144 : if (PyList_GET_ITEM(value, challenge_cntr_0) == NULL) {
1985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->challenge[challenge_cntr_0]");
1986 0 : return -1;
1987 : }
1988 : {
1989 144 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->challenge[challenge_cntr_0]));
1990 144 : if (PyLong_Check(PyList_GET_ITEM(value, challenge_cntr_0))) {
1991 : unsigned long long test_var;
1992 144 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, challenge_cntr_0));
1993 144 : if (PyErr_Occurred() != NULL) {
1994 0 : return -1;
1995 : }
1996 144 : if (test_var > uint_max) {
1997 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1998 : PyLong_Type.tp_name, uint_max, test_var);
1999 0 : return -1;
2000 : }
2001 144 : object->challenge[challenge_cntr_0] = test_var;
2002 : } else {
2003 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2004 : PyLong_Type.tp_name);
2005 0 : return -1;
2006 : }
2007 : }
2008 : }
2009 : }
2010 18 : return 0;
2011 : }
2012 :
2013 36 : static PyObject *py_netr_NetworkInfo_get_nt(PyObject *obj, void *closure)
2014 : {
2015 36 : struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(obj);
2016 : PyObject *py_nt;
2017 36 : py_nt = pytalloc_reference_ex(&netr_ChallengeResponse_Type, pytalloc_get_mem_ctx(obj), &object->nt);
2018 36 : return py_nt;
2019 : }
2020 :
2021 18 : static int py_netr_NetworkInfo_set_nt(PyObject *py_obj, PyObject *value, void *closure)
2022 : {
2023 18 : struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(py_obj);
2024 18 : if (value == NULL) {
2025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt");
2026 0 : return -1;
2027 : }
2028 18 : PY_CHECK_TYPE(&netr_ChallengeResponse_Type, value, return -1;);
2029 18 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2030 0 : PyErr_NoMemory();
2031 0 : return -1;
2032 : }
2033 18 : object->nt = *(struct netr_ChallengeResponse *)pytalloc_get_ptr(value);
2034 18 : return 0;
2035 : }
2036 :
2037 0 : static PyObject *py_netr_NetworkInfo_get_lm(PyObject *obj, void *closure)
2038 : {
2039 0 : struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(obj);
2040 : PyObject *py_lm;
2041 0 : py_lm = pytalloc_reference_ex(&netr_ChallengeResponse_Type, pytalloc_get_mem_ctx(obj), &object->lm);
2042 0 : return py_lm;
2043 : }
2044 :
2045 0 : static int py_netr_NetworkInfo_set_lm(PyObject *py_obj, PyObject *value, void *closure)
2046 : {
2047 0 : struct netr_NetworkInfo *object = (struct netr_NetworkInfo *)pytalloc_get_ptr(py_obj);
2048 0 : if (value == NULL) {
2049 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm");
2050 0 : return -1;
2051 : }
2052 0 : PY_CHECK_TYPE(&netr_ChallengeResponse_Type, value, return -1;);
2053 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2054 0 : PyErr_NoMemory();
2055 0 : return -1;
2056 : }
2057 0 : object->lm = *(struct netr_ChallengeResponse *)pytalloc_get_ptr(value);
2058 0 : return 0;
2059 : }
2060 :
2061 : static PyGetSetDef py_netr_NetworkInfo_getsetters[] = {
2062 : {
2063 : .name = discard_const_p(char, "identity_info"),
2064 : .get = py_netr_NetworkInfo_get_identity_info,
2065 : .set = py_netr_NetworkInfo_set_identity_info,
2066 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_IdentityInfo")
2067 : },
2068 : {
2069 : .name = discard_const_p(char, "challenge"),
2070 : .get = py_netr_NetworkInfo_get_challenge,
2071 : .set = py_netr_NetworkInfo_set_challenge,
2072 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2073 : },
2074 : {
2075 : .name = discard_const_p(char, "nt"),
2076 : .get = py_netr_NetworkInfo_get_nt,
2077 : .set = py_netr_NetworkInfo_set_nt,
2078 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChallengeResponse")
2079 : },
2080 : {
2081 : .name = discard_const_p(char, "lm"),
2082 : .get = py_netr_NetworkInfo_get_lm,
2083 : .set = py_netr_NetworkInfo_set_lm,
2084 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChallengeResponse")
2085 : },
2086 : { .name = NULL }
2087 : };
2088 :
2089 18 : static PyObject *py_netr_NetworkInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2090 : {
2091 18 : return pytalloc_new(struct netr_NetworkInfo, type);
2092 : }
2093 :
2094 :
2095 : static PyTypeObject netr_NetworkInfo_Type = {
2096 : PyVarObject_HEAD_INIT(NULL, 0)
2097 : .tp_name = "netlogon.netr_NetworkInfo",
2098 : .tp_getset = py_netr_NetworkInfo_getsetters,
2099 : .tp_methods = NULL,
2100 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2101 : .tp_new = py_netr_NetworkInfo_new,
2102 : };
2103 :
2104 :
2105 0 : static PyObject *py_netr_GenericInfo_get_identity_info(PyObject *obj, void *closure)
2106 : {
2107 0 : struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(obj);
2108 : PyObject *py_identity_info;
2109 0 : py_identity_info = pytalloc_reference_ex(&netr_IdentityInfo_Type, pytalloc_get_mem_ctx(obj), &object->identity_info);
2110 0 : return py_identity_info;
2111 : }
2112 :
2113 0 : static int py_netr_GenericInfo_set_identity_info(PyObject *py_obj, PyObject *value, void *closure)
2114 : {
2115 0 : struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(py_obj);
2116 0 : if (value == NULL) {
2117 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->identity_info");
2118 0 : return -1;
2119 : }
2120 0 : PY_CHECK_TYPE(&netr_IdentityInfo_Type, value, return -1;);
2121 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2122 0 : PyErr_NoMemory();
2123 0 : return -1;
2124 : }
2125 0 : object->identity_info = *(struct netr_IdentityInfo *)pytalloc_get_ptr(value);
2126 0 : return 0;
2127 : }
2128 :
2129 0 : static PyObject *py_netr_GenericInfo_get_package_name(PyObject *obj, void *closure)
2130 : {
2131 0 : struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(obj);
2132 : PyObject *py_package_name;
2133 0 : py_package_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->package_name);
2134 0 : return py_package_name;
2135 : }
2136 :
2137 0 : static int py_netr_GenericInfo_set_package_name(PyObject *py_obj, PyObject *value, void *closure)
2138 : {
2139 0 : struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(py_obj);
2140 0 : if (value == NULL) {
2141 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->package_name");
2142 0 : return -1;
2143 : }
2144 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2145 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2146 0 : PyErr_NoMemory();
2147 0 : return -1;
2148 : }
2149 0 : object->package_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2150 0 : return 0;
2151 : }
2152 :
2153 0 : static PyObject *py_netr_GenericInfo_get_length(PyObject *obj, void *closure)
2154 : {
2155 0 : struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(obj);
2156 : PyObject *py_length;
2157 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
2158 0 : return py_length;
2159 : }
2160 :
2161 0 : static int py_netr_GenericInfo_set_length(PyObject *py_obj, PyObject *value, void *closure)
2162 : {
2163 0 : struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(py_obj);
2164 0 : if (value == NULL) {
2165 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
2166 0 : return -1;
2167 : }
2168 : {
2169 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
2170 0 : if (PyLong_Check(value)) {
2171 : unsigned long long test_var;
2172 0 : test_var = PyLong_AsUnsignedLongLong(value);
2173 0 : if (PyErr_Occurred() != NULL) {
2174 0 : return -1;
2175 : }
2176 0 : if (test_var > uint_max) {
2177 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2178 : PyLong_Type.tp_name, uint_max, test_var);
2179 0 : return -1;
2180 : }
2181 0 : object->length = test_var;
2182 : } else {
2183 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2184 : PyLong_Type.tp_name);
2185 0 : return -1;
2186 : }
2187 : }
2188 0 : return 0;
2189 : }
2190 :
2191 0 : static PyObject *py_netr_GenericInfo_get_data(PyObject *obj, void *closure)
2192 : {
2193 0 : struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(obj);
2194 : PyObject *py_data;
2195 0 : if (object->data == NULL) {
2196 0 : Py_RETURN_NONE;
2197 : }
2198 0 : if (object->data == NULL) {
2199 0 : py_data = Py_None;
2200 0 : Py_INCREF(py_data);
2201 : } else {
2202 0 : py_data = PyList_New(object->length);
2203 0 : if (py_data == NULL) {
2204 0 : return NULL;
2205 : }
2206 : {
2207 : int data_cntr_1;
2208 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
2209 : PyObject *py_data_1;
2210 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
2211 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
2212 : }
2213 : }
2214 : }
2215 0 : return py_data;
2216 : }
2217 :
2218 0 : static int py_netr_GenericInfo_set_data(PyObject *py_obj, PyObject *value, void *closure)
2219 : {
2220 0 : struct netr_GenericInfo *object = (struct netr_GenericInfo *)pytalloc_get_ptr(py_obj);
2221 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
2222 0 : if (value == NULL) {
2223 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
2224 0 : return -1;
2225 : }
2226 0 : if (value == Py_None) {
2227 0 : object->data = NULL;
2228 : } else {
2229 0 : object->data = NULL;
2230 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2231 : {
2232 : int data_cntr_1;
2233 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
2234 0 : if (!object->data) { return -1;; }
2235 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
2236 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
2237 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
2238 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
2239 0 : return -1;
2240 : }
2241 : {
2242 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
2243 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
2244 : unsigned long long test_var;
2245 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
2246 0 : if (PyErr_Occurred() != NULL) {
2247 0 : return -1;
2248 : }
2249 0 : if (test_var > uint_max) {
2250 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2251 : PyLong_Type.tp_name, uint_max, test_var);
2252 0 : return -1;
2253 : }
2254 0 : object->data[data_cntr_1] = test_var;
2255 : } else {
2256 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2257 : PyLong_Type.tp_name);
2258 0 : return -1;
2259 : }
2260 : }
2261 : }
2262 : }
2263 : }
2264 0 : return 0;
2265 : }
2266 :
2267 : static PyGetSetDef py_netr_GenericInfo_getsetters[] = {
2268 : {
2269 : .name = discard_const_p(char, "identity_info"),
2270 : .get = py_netr_GenericInfo_get_identity_info,
2271 : .set = py_netr_GenericInfo_set_identity_info,
2272 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_IdentityInfo")
2273 : },
2274 : {
2275 : .name = discard_const_p(char, "package_name"),
2276 : .get = py_netr_GenericInfo_get_package_name,
2277 : .set = py_netr_GenericInfo_set_package_name,
2278 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
2279 : },
2280 : {
2281 : .name = discard_const_p(char, "length"),
2282 : .get = py_netr_GenericInfo_get_length,
2283 : .set = py_netr_GenericInfo_set_length,
2284 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2285 : },
2286 : {
2287 : .name = discard_const_p(char, "data"),
2288 : .get = py_netr_GenericInfo_get_data,
2289 : .set = py_netr_GenericInfo_set_data,
2290 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2291 : },
2292 : { .name = NULL }
2293 : };
2294 :
2295 0 : static PyObject *py_netr_GenericInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2296 : {
2297 0 : return pytalloc_new(struct netr_GenericInfo, type);
2298 : }
2299 :
2300 :
2301 : static PyTypeObject netr_GenericInfo_Type = {
2302 : PyVarObject_HEAD_INIT(NULL, 0)
2303 : .tp_name = "netlogon.netr_GenericInfo",
2304 : .tp_getset = py_netr_GenericInfo_getsetters,
2305 : .tp_methods = NULL,
2306 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2307 : .tp_new = py_netr_GenericInfo_new,
2308 : };
2309 :
2310 0 : static PyObject *py_import_netr_LogonLevel(TALLOC_CTX *mem_ctx, int level, union netr_LogonLevel *in)
2311 : {
2312 : PyObject *ret;
2313 :
2314 0 : switch (level) {
2315 0 : case NetlogonInteractiveInformation:
2316 0 : if (in->password == NULL) {
2317 0 : ret = Py_None;
2318 0 : Py_INCREF(ret);
2319 : } else {
2320 0 : ret = pytalloc_reference_ex(&netr_PasswordInfo_Type, in->password, in->password);
2321 : }
2322 0 : return ret;
2323 :
2324 0 : case NetlogonNetworkInformation:
2325 0 : if (in->network == NULL) {
2326 0 : ret = Py_None;
2327 0 : Py_INCREF(ret);
2328 : } else {
2329 0 : ret = pytalloc_reference_ex(&netr_NetworkInfo_Type, in->network, in->network);
2330 : }
2331 0 : return ret;
2332 :
2333 0 : case NetlogonServiceInformation:
2334 0 : if (in->password == NULL) {
2335 0 : ret = Py_None;
2336 0 : Py_INCREF(ret);
2337 : } else {
2338 0 : ret = pytalloc_reference_ex(&netr_PasswordInfo_Type, in->password, in->password);
2339 : }
2340 0 : return ret;
2341 :
2342 0 : case NetlogonGenericInformation:
2343 0 : if (in->generic == NULL) {
2344 0 : ret = Py_None;
2345 0 : Py_INCREF(ret);
2346 : } else {
2347 0 : ret = pytalloc_reference_ex(&netr_GenericInfo_Type, in->generic, in->generic);
2348 : }
2349 0 : return ret;
2350 :
2351 0 : case NetlogonInteractiveTransitiveInformation:
2352 0 : if (in->password == NULL) {
2353 0 : ret = Py_None;
2354 0 : Py_INCREF(ret);
2355 : } else {
2356 0 : ret = pytalloc_reference_ex(&netr_PasswordInfo_Type, in->password, in->password);
2357 : }
2358 0 : return ret;
2359 :
2360 0 : case NetlogonNetworkTransitiveInformation:
2361 0 : if (in->network == NULL) {
2362 0 : ret = Py_None;
2363 0 : Py_INCREF(ret);
2364 : } else {
2365 0 : ret = pytalloc_reference_ex(&netr_NetworkInfo_Type, in->network, in->network);
2366 : }
2367 0 : return ret;
2368 :
2369 0 : case NetlogonServiceTransitiveInformation:
2370 0 : if (in->password == NULL) {
2371 0 : ret = Py_None;
2372 0 : Py_INCREF(ret);
2373 : } else {
2374 0 : ret = pytalloc_reference_ex(&netr_PasswordInfo_Type, in->password, in->password);
2375 : }
2376 0 : return ret;
2377 :
2378 0 : default:
2379 0 : ret = Py_None;
2380 0 : Py_INCREF(ret);
2381 0 : return ret;
2382 :
2383 : }
2384 : PyErr_SetString(PyExc_TypeError, "unknown union level");
2385 : return NULL;
2386 : }
2387 :
2388 18 : static union netr_LogonLevel *py_export_netr_LogonLevel(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2389 : {
2390 18 : union netr_LogonLevel *ret = talloc_zero(mem_ctx, union netr_LogonLevel);
2391 18 : switch (level) {
2392 0 : case NetlogonInteractiveInformation:
2393 0 : if (in == NULL) {
2394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password");
2395 0 : talloc_free(ret); return NULL;
2396 : }
2397 0 : if (in == Py_None) {
2398 0 : ret->password = NULL;
2399 : } else {
2400 0 : ret->password = NULL;
2401 0 : PY_CHECK_TYPE(&netr_PasswordInfo_Type, in, talloc_free(ret); return NULL;);
2402 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2403 0 : PyErr_NoMemory();
2404 0 : talloc_free(ret); return NULL;
2405 : }
2406 0 : ret->password = (struct netr_PasswordInfo *)pytalloc_get_ptr(in);
2407 : }
2408 0 : break;
2409 :
2410 0 : case NetlogonNetworkInformation:
2411 0 : if (in == NULL) {
2412 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->network");
2413 0 : talloc_free(ret); return NULL;
2414 : }
2415 0 : if (in == Py_None) {
2416 0 : ret->network = NULL;
2417 : } else {
2418 0 : ret->network = NULL;
2419 0 : PY_CHECK_TYPE(&netr_NetworkInfo_Type, in, talloc_free(ret); return NULL;);
2420 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2421 0 : PyErr_NoMemory();
2422 0 : talloc_free(ret); return NULL;
2423 : }
2424 0 : ret->network = (struct netr_NetworkInfo *)pytalloc_get_ptr(in);
2425 : }
2426 0 : break;
2427 :
2428 0 : case NetlogonServiceInformation:
2429 0 : if (in == NULL) {
2430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password");
2431 0 : talloc_free(ret); return NULL;
2432 : }
2433 0 : if (in == Py_None) {
2434 0 : ret->password = NULL;
2435 : } else {
2436 0 : ret->password = NULL;
2437 0 : PY_CHECK_TYPE(&netr_PasswordInfo_Type, in, talloc_free(ret); return NULL;);
2438 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2439 0 : PyErr_NoMemory();
2440 0 : talloc_free(ret); return NULL;
2441 : }
2442 0 : ret->password = (struct netr_PasswordInfo *)pytalloc_get_ptr(in);
2443 : }
2444 0 : break;
2445 :
2446 0 : case NetlogonGenericInformation:
2447 0 : if (in == NULL) {
2448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->generic");
2449 0 : talloc_free(ret); return NULL;
2450 : }
2451 0 : if (in == Py_None) {
2452 0 : ret->generic = NULL;
2453 : } else {
2454 0 : ret->generic = NULL;
2455 0 : PY_CHECK_TYPE(&netr_GenericInfo_Type, in, talloc_free(ret); return NULL;);
2456 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2457 0 : PyErr_NoMemory();
2458 0 : talloc_free(ret); return NULL;
2459 : }
2460 0 : ret->generic = (struct netr_GenericInfo *)pytalloc_get_ptr(in);
2461 : }
2462 0 : break;
2463 :
2464 0 : case NetlogonInteractiveTransitiveInformation:
2465 0 : if (in == NULL) {
2466 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password");
2467 0 : talloc_free(ret); return NULL;
2468 : }
2469 0 : if (in == Py_None) {
2470 0 : ret->password = NULL;
2471 : } else {
2472 0 : ret->password = NULL;
2473 0 : PY_CHECK_TYPE(&netr_PasswordInfo_Type, in, talloc_free(ret); return NULL;);
2474 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2475 0 : PyErr_NoMemory();
2476 0 : talloc_free(ret); return NULL;
2477 : }
2478 0 : ret->password = (struct netr_PasswordInfo *)pytalloc_get_ptr(in);
2479 : }
2480 0 : break;
2481 :
2482 18 : case NetlogonNetworkTransitiveInformation:
2483 18 : if (in == NULL) {
2484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->network");
2485 0 : talloc_free(ret); return NULL;
2486 : }
2487 18 : if (in == Py_None) {
2488 0 : ret->network = NULL;
2489 : } else {
2490 18 : ret->network = NULL;
2491 18 : PY_CHECK_TYPE(&netr_NetworkInfo_Type, in, talloc_free(ret); return NULL;);
2492 18 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2493 0 : PyErr_NoMemory();
2494 0 : talloc_free(ret); return NULL;
2495 : }
2496 18 : ret->network = (struct netr_NetworkInfo *)pytalloc_get_ptr(in);
2497 : }
2498 18 : break;
2499 :
2500 0 : case NetlogonServiceTransitiveInformation:
2501 0 : if (in == NULL) {
2502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password");
2503 0 : talloc_free(ret); return NULL;
2504 : }
2505 0 : if (in == Py_None) {
2506 0 : ret->password = NULL;
2507 : } else {
2508 0 : ret->password = NULL;
2509 0 : PY_CHECK_TYPE(&netr_PasswordInfo_Type, in, talloc_free(ret); return NULL;);
2510 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2511 0 : PyErr_NoMemory();
2512 0 : talloc_free(ret); return NULL;
2513 : }
2514 0 : ret->password = (struct netr_PasswordInfo *)pytalloc_get_ptr(in);
2515 : }
2516 0 : break;
2517 :
2518 0 : default:
2519 0 : break;
2520 :
2521 : }
2522 :
2523 18 : return ret;
2524 : }
2525 :
2526 0 : static PyObject *py_netr_LogonLevel_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2527 : {
2528 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2529 0 : PyObject *mem_ctx_obj = NULL;
2530 0 : TALLOC_CTX *mem_ctx = NULL;
2531 0 : int level = 0;
2532 0 : PyObject *in_obj = NULL;
2533 0 : union netr_LogonLevel *in = NULL;
2534 :
2535 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
2536 : discard_const_p(char *, kwnames),
2537 : &mem_ctx_obj,
2538 : &level,
2539 : &in_obj)) {
2540 0 : return NULL;
2541 : }
2542 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2543 0 : if (mem_ctx == NULL) {
2544 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2545 0 : return NULL;
2546 : }
2547 0 : in = (union netr_LogonLevel *)pytalloc_get_ptr(in_obj);
2548 0 : if (in == NULL) {
2549 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_LogonLevel!");
2550 0 : return NULL;
2551 : }
2552 :
2553 0 : return py_import_netr_LogonLevel(mem_ctx, level, in);
2554 : }
2555 :
2556 18 : static PyObject *py_netr_LogonLevel_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2557 : {
2558 18 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2559 18 : PyObject *mem_ctx_obj = NULL;
2560 18 : TALLOC_CTX *mem_ctx = NULL;
2561 18 : int level = 0;
2562 18 : PyObject *in = NULL;
2563 18 : union netr_LogonLevel *out = NULL;
2564 :
2565 18 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
2566 : discard_const_p(char *, kwnames),
2567 : &mem_ctx_obj,
2568 : &level,
2569 : &in)) {
2570 0 : return NULL;
2571 : }
2572 18 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2573 18 : if (mem_ctx == NULL) {
2574 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2575 0 : return NULL;
2576 : }
2577 :
2578 18 : out = py_export_netr_LogonLevel(mem_ctx, level, in);
2579 18 : if (out == NULL) {
2580 0 : return NULL;
2581 : }
2582 :
2583 18 : return pytalloc_GenericObject_reference(out);
2584 : }
2585 :
2586 : static PyMethodDef py_netr_LogonLevel_methods[] = {
2587 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonLevel_import),
2588 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2589 : "T.__import__(mem_ctx, level, in) => ret." },
2590 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonLevel_export),
2591 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2592 : "T.__export__(mem_ctx, level, in) => ret." },
2593 : { NULL, NULL, 0, NULL }
2594 : };
2595 :
2596 0 : static PyObject *py_netr_LogonLevel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2597 : {
2598 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
2599 0 : return NULL;
2600 : }
2601 :
2602 :
2603 : static PyTypeObject netr_LogonLevel_Type = {
2604 : PyVarObject_HEAD_INIT(NULL, 0)
2605 : .tp_name = "netlogon.netr_LogonLevel",
2606 : .tp_getset = NULL,
2607 : .tp_methods = py_netr_LogonLevel_methods,
2608 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2609 : .tp_new = py_netr_LogonLevel_new,
2610 : };
2611 :
2612 :
2613 0 : static PyObject *py_netr_UserSessionKey_get_key(PyObject *obj, void *closure)
2614 : {
2615 0 : struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)pytalloc_get_ptr(obj);
2616 : PyObject *py_key;
2617 0 : py_key = PyList_New(16);
2618 0 : if (py_key == NULL) {
2619 0 : return NULL;
2620 : }
2621 : {
2622 : int key_cntr_0;
2623 0 : for (key_cntr_0 = 0; key_cntr_0 < (16); key_cntr_0++) {
2624 : PyObject *py_key_0;
2625 0 : py_key_0 = PyLong_FromLong((uint16_t)object->key[key_cntr_0]);
2626 0 : PyList_SetItem(py_key, key_cntr_0, py_key_0);
2627 : }
2628 : }
2629 0 : return py_key;
2630 : }
2631 :
2632 0 : static int py_netr_UserSessionKey_set_key(PyObject *py_obj, PyObject *value, void *closure)
2633 : {
2634 0 : struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)pytalloc_get_ptr(py_obj);
2635 0 : if (value == NULL) {
2636 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key");
2637 0 : return -1;
2638 : }
2639 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2640 : {
2641 : int key_cntr_0;
2642 0 : if (ARRAY_SIZE(object->key) != PyList_GET_SIZE(value)) {
2643 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->key), PyList_GET_SIZE(value));
2644 0 : return -1;
2645 : }
2646 0 : for (key_cntr_0 = 0; key_cntr_0 < PyList_GET_SIZE(value); key_cntr_0++) {
2647 0 : if (PyList_GET_ITEM(value, key_cntr_0) == NULL) {
2648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key[key_cntr_0]");
2649 0 : return -1;
2650 : }
2651 : {
2652 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->key[key_cntr_0]));
2653 0 : if (PyLong_Check(PyList_GET_ITEM(value, key_cntr_0))) {
2654 : unsigned long long test_var;
2655 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, key_cntr_0));
2656 0 : if (PyErr_Occurred() != NULL) {
2657 0 : return -1;
2658 : }
2659 0 : if (test_var > uint_max) {
2660 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2661 : PyLong_Type.tp_name, uint_max, test_var);
2662 0 : return -1;
2663 : }
2664 0 : object->key[key_cntr_0] = test_var;
2665 : } else {
2666 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2667 : PyLong_Type.tp_name);
2668 0 : return -1;
2669 : }
2670 : }
2671 : }
2672 : }
2673 0 : return 0;
2674 : }
2675 :
2676 : static PyGetSetDef py_netr_UserSessionKey_getsetters[] = {
2677 : {
2678 : .name = discard_const_p(char, "key"),
2679 : .get = py_netr_UserSessionKey_get_key,
2680 : .set = py_netr_UserSessionKey_set_key,
2681 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2682 : },
2683 : { .name = NULL }
2684 : };
2685 :
2686 0 : static PyObject *py_netr_UserSessionKey_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2687 : {
2688 0 : return pytalloc_new(struct netr_UserSessionKey, type);
2689 : }
2690 :
2691 0 : static PyObject *py_netr_UserSessionKey_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2692 : {
2693 0 : struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)pytalloc_get_ptr(py_obj);
2694 0 : PyObject *ret = NULL;
2695 : DATA_BLOB blob;
2696 : enum ndr_err_code err;
2697 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2698 0 : if (tmp_ctx == NULL) {
2699 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2700 0 : return NULL;
2701 : }
2702 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_UserSessionKey);
2703 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2704 0 : TALLOC_FREE(tmp_ctx);
2705 0 : PyErr_SetNdrError(err);
2706 0 : return NULL;
2707 : }
2708 :
2709 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2710 0 : TALLOC_FREE(tmp_ctx);
2711 0 : return ret;
2712 : }
2713 :
2714 0 : static PyObject *py_netr_UserSessionKey_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2715 : {
2716 0 : struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)pytalloc_get_ptr(py_obj);
2717 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2718 0 : Py_ssize_t blob_length = 0;
2719 : enum ndr_err_code err;
2720 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2721 0 : PyObject *allow_remaining_obj = NULL;
2722 0 : bool allow_remaining = false;
2723 :
2724 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2725 : discard_const_p(char *, kwnames),
2726 : &blob.data, &blob_length,
2727 : &allow_remaining_obj)) {
2728 0 : return NULL;
2729 : }
2730 0 : blob.length = blob_length;
2731 :
2732 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2733 0 : allow_remaining = true;
2734 : }
2735 :
2736 0 : if (allow_remaining) {
2737 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_UserSessionKey);
2738 : } else {
2739 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_UserSessionKey);
2740 : }
2741 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2742 0 : PyErr_SetNdrError(err);
2743 0 : return NULL;
2744 : }
2745 :
2746 0 : Py_RETURN_NONE;
2747 : }
2748 :
2749 0 : static PyObject *py_netr_UserSessionKey_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2750 : {
2751 0 : struct netr_UserSessionKey *object = (struct netr_UserSessionKey *)pytalloc_get_ptr(py_obj);
2752 : PyObject *ret;
2753 : char *retstr;
2754 :
2755 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_UserSessionKey, "netr_UserSessionKey", object);
2756 0 : ret = PyUnicode_FromString(retstr);
2757 0 : talloc_free(retstr);
2758 :
2759 0 : return ret;
2760 : }
2761 :
2762 : static PyMethodDef py_netr_UserSessionKey_methods[] = {
2763 : { "__ndr_pack__", (PyCFunction)py_netr_UserSessionKey_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2764 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_UserSessionKey_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2765 : { "__ndr_print__", (PyCFunction)py_netr_UserSessionKey_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2766 : { NULL, NULL, 0, NULL }
2767 : };
2768 :
2769 :
2770 : static PyTypeObject netr_UserSessionKey_Type = {
2771 : PyVarObject_HEAD_INIT(NULL, 0)
2772 : .tp_name = "netlogon.netr_UserSessionKey",
2773 : .tp_getset = py_netr_UserSessionKey_getsetters,
2774 : .tp_methods = py_netr_UserSessionKey_methods,
2775 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2776 : .tp_new = py_netr_UserSessionKey_new,
2777 : };
2778 :
2779 :
2780 0 : static PyObject *py_netr_LMSessionKey_get_key(PyObject *obj, void *closure)
2781 : {
2782 0 : struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)pytalloc_get_ptr(obj);
2783 : PyObject *py_key;
2784 0 : py_key = PyList_New(8);
2785 0 : if (py_key == NULL) {
2786 0 : return NULL;
2787 : }
2788 : {
2789 : int key_cntr_0;
2790 0 : for (key_cntr_0 = 0; key_cntr_0 < (8); key_cntr_0++) {
2791 : PyObject *py_key_0;
2792 0 : py_key_0 = PyLong_FromLong((uint16_t)object->key[key_cntr_0]);
2793 0 : PyList_SetItem(py_key, key_cntr_0, py_key_0);
2794 : }
2795 : }
2796 0 : return py_key;
2797 : }
2798 :
2799 0 : static int py_netr_LMSessionKey_set_key(PyObject *py_obj, PyObject *value, void *closure)
2800 : {
2801 0 : struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)pytalloc_get_ptr(py_obj);
2802 0 : if (value == NULL) {
2803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key");
2804 0 : return -1;
2805 : }
2806 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2807 : {
2808 : int key_cntr_0;
2809 0 : if (ARRAY_SIZE(object->key) != PyList_GET_SIZE(value)) {
2810 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->key), PyList_GET_SIZE(value));
2811 0 : return -1;
2812 : }
2813 0 : for (key_cntr_0 = 0; key_cntr_0 < PyList_GET_SIZE(value); key_cntr_0++) {
2814 0 : if (PyList_GET_ITEM(value, key_cntr_0) == NULL) {
2815 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key[key_cntr_0]");
2816 0 : return -1;
2817 : }
2818 : {
2819 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->key[key_cntr_0]));
2820 0 : if (PyLong_Check(PyList_GET_ITEM(value, key_cntr_0))) {
2821 : unsigned long long test_var;
2822 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, key_cntr_0));
2823 0 : if (PyErr_Occurred() != NULL) {
2824 0 : return -1;
2825 : }
2826 0 : if (test_var > uint_max) {
2827 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2828 : PyLong_Type.tp_name, uint_max, test_var);
2829 0 : return -1;
2830 : }
2831 0 : object->key[key_cntr_0] = test_var;
2832 : } else {
2833 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2834 : PyLong_Type.tp_name);
2835 0 : return -1;
2836 : }
2837 : }
2838 : }
2839 : }
2840 0 : return 0;
2841 : }
2842 :
2843 : static PyGetSetDef py_netr_LMSessionKey_getsetters[] = {
2844 : {
2845 : .name = discard_const_p(char, "key"),
2846 : .get = py_netr_LMSessionKey_get_key,
2847 : .set = py_netr_LMSessionKey_set_key,
2848 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2849 : },
2850 : { .name = NULL }
2851 : };
2852 :
2853 0 : static PyObject *py_netr_LMSessionKey_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2854 : {
2855 0 : return pytalloc_new(struct netr_LMSessionKey, type);
2856 : }
2857 :
2858 0 : static PyObject *py_netr_LMSessionKey_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2859 : {
2860 0 : struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)pytalloc_get_ptr(py_obj);
2861 0 : PyObject *ret = NULL;
2862 : DATA_BLOB blob;
2863 : enum ndr_err_code err;
2864 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2865 0 : if (tmp_ctx == NULL) {
2866 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2867 0 : return NULL;
2868 : }
2869 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_LMSessionKey);
2870 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2871 0 : TALLOC_FREE(tmp_ctx);
2872 0 : PyErr_SetNdrError(err);
2873 0 : return NULL;
2874 : }
2875 :
2876 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2877 0 : TALLOC_FREE(tmp_ctx);
2878 0 : return ret;
2879 : }
2880 :
2881 0 : static PyObject *py_netr_LMSessionKey_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2882 : {
2883 0 : struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)pytalloc_get_ptr(py_obj);
2884 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2885 0 : Py_ssize_t blob_length = 0;
2886 : enum ndr_err_code err;
2887 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2888 0 : PyObject *allow_remaining_obj = NULL;
2889 0 : bool allow_remaining = false;
2890 :
2891 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2892 : discard_const_p(char *, kwnames),
2893 : &blob.data, &blob_length,
2894 : &allow_remaining_obj)) {
2895 0 : return NULL;
2896 : }
2897 0 : blob.length = blob_length;
2898 :
2899 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2900 0 : allow_remaining = true;
2901 : }
2902 :
2903 0 : if (allow_remaining) {
2904 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_LMSessionKey);
2905 : } else {
2906 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_LMSessionKey);
2907 : }
2908 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2909 0 : PyErr_SetNdrError(err);
2910 0 : return NULL;
2911 : }
2912 :
2913 0 : Py_RETURN_NONE;
2914 : }
2915 :
2916 0 : static PyObject *py_netr_LMSessionKey_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2917 : {
2918 0 : struct netr_LMSessionKey *object = (struct netr_LMSessionKey *)pytalloc_get_ptr(py_obj);
2919 : PyObject *ret;
2920 : char *retstr;
2921 :
2922 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_LMSessionKey, "netr_LMSessionKey", object);
2923 0 : ret = PyUnicode_FromString(retstr);
2924 0 : talloc_free(retstr);
2925 :
2926 0 : return ret;
2927 : }
2928 :
2929 : static PyMethodDef py_netr_LMSessionKey_methods[] = {
2930 : { "__ndr_pack__", (PyCFunction)py_netr_LMSessionKey_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2931 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LMSessionKey_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2932 : { "__ndr_print__", (PyCFunction)py_netr_LMSessionKey_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2933 : { NULL, NULL, 0, NULL }
2934 : };
2935 :
2936 :
2937 : static PyTypeObject netr_LMSessionKey_Type = {
2938 : PyVarObject_HEAD_INIT(NULL, 0)
2939 : .tp_name = "netlogon.netr_LMSessionKey",
2940 : .tp_getset = py_netr_LMSessionKey_getsetters,
2941 : .tp_methods = py_netr_LMSessionKey_methods,
2942 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2943 : .tp_new = py_netr_LMSessionKey_new,
2944 : };
2945 :
2946 :
2947 0 : static PyObject *py_netr_SamBaseInfo_get_logon_time(PyObject *obj, void *closure)
2948 : {
2949 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
2950 : PyObject *py_logon_time;
2951 0 : py_logon_time = PyLong_FromUnsignedLongLong(object->logon_time);
2952 0 : return py_logon_time;
2953 : }
2954 :
2955 0 : static int py_netr_SamBaseInfo_set_logon_time(PyObject *py_obj, PyObject *value, void *closure)
2956 : {
2957 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
2958 0 : if (value == NULL) {
2959 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_time");
2960 0 : return -1;
2961 : }
2962 : {
2963 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_time));
2964 0 : if (PyLong_Check(value)) {
2965 : unsigned long long test_var;
2966 0 : test_var = PyLong_AsUnsignedLongLong(value);
2967 0 : if (PyErr_Occurred() != NULL) {
2968 0 : return -1;
2969 : }
2970 0 : if (test_var > uint_max) {
2971 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2972 : PyLong_Type.tp_name, uint_max, test_var);
2973 0 : return -1;
2974 : }
2975 0 : object->logon_time = test_var;
2976 : } else {
2977 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2978 : PyLong_Type.tp_name);
2979 0 : return -1;
2980 : }
2981 : }
2982 0 : return 0;
2983 : }
2984 :
2985 0 : static PyObject *py_netr_SamBaseInfo_get_logoff_time(PyObject *obj, void *closure)
2986 : {
2987 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
2988 : PyObject *py_logoff_time;
2989 0 : py_logoff_time = PyLong_FromUnsignedLongLong(object->logoff_time);
2990 0 : return py_logoff_time;
2991 : }
2992 :
2993 0 : static int py_netr_SamBaseInfo_set_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
2994 : {
2995 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
2996 0 : if (value == NULL) {
2997 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logoff_time");
2998 0 : return -1;
2999 : }
3000 : {
3001 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logoff_time));
3002 0 : if (PyLong_Check(value)) {
3003 : unsigned long long test_var;
3004 0 : test_var = PyLong_AsUnsignedLongLong(value);
3005 0 : if (PyErr_Occurred() != NULL) {
3006 0 : return -1;
3007 : }
3008 0 : if (test_var > uint_max) {
3009 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3010 : PyLong_Type.tp_name, uint_max, test_var);
3011 0 : return -1;
3012 : }
3013 0 : object->logoff_time = test_var;
3014 : } else {
3015 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3016 : PyLong_Type.tp_name);
3017 0 : return -1;
3018 : }
3019 : }
3020 0 : return 0;
3021 : }
3022 :
3023 0 : static PyObject *py_netr_SamBaseInfo_get_kickoff_time(PyObject *obj, void *closure)
3024 : {
3025 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3026 : PyObject *py_kickoff_time;
3027 0 : py_kickoff_time = PyLong_FromUnsignedLongLong(object->kickoff_time);
3028 0 : return py_kickoff_time;
3029 : }
3030 :
3031 0 : static int py_netr_SamBaseInfo_set_kickoff_time(PyObject *py_obj, PyObject *value, void *closure)
3032 : {
3033 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3034 0 : if (value == NULL) {
3035 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->kickoff_time");
3036 0 : return -1;
3037 : }
3038 : {
3039 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->kickoff_time));
3040 0 : if (PyLong_Check(value)) {
3041 : unsigned long long test_var;
3042 0 : test_var = PyLong_AsUnsignedLongLong(value);
3043 0 : if (PyErr_Occurred() != NULL) {
3044 0 : return -1;
3045 : }
3046 0 : if (test_var > uint_max) {
3047 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3048 : PyLong_Type.tp_name, uint_max, test_var);
3049 0 : return -1;
3050 : }
3051 0 : object->kickoff_time = test_var;
3052 : } else {
3053 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3054 : PyLong_Type.tp_name);
3055 0 : return -1;
3056 : }
3057 : }
3058 0 : return 0;
3059 : }
3060 :
3061 0 : static PyObject *py_netr_SamBaseInfo_get_last_password_change(PyObject *obj, void *closure)
3062 : {
3063 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3064 : PyObject *py_last_password_change;
3065 0 : py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change);
3066 0 : return py_last_password_change;
3067 : }
3068 :
3069 0 : static int py_netr_SamBaseInfo_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
3070 : {
3071 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3072 0 : if (value == NULL) {
3073 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change");
3074 0 : return -1;
3075 : }
3076 : {
3077 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change));
3078 0 : if (PyLong_Check(value)) {
3079 : unsigned long long test_var;
3080 0 : test_var = PyLong_AsUnsignedLongLong(value);
3081 0 : if (PyErr_Occurred() != NULL) {
3082 0 : return -1;
3083 : }
3084 0 : if (test_var > uint_max) {
3085 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3086 : PyLong_Type.tp_name, uint_max, test_var);
3087 0 : return -1;
3088 : }
3089 0 : object->last_password_change = test_var;
3090 : } else {
3091 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3092 : PyLong_Type.tp_name);
3093 0 : return -1;
3094 : }
3095 : }
3096 0 : return 0;
3097 : }
3098 :
3099 0 : static PyObject *py_netr_SamBaseInfo_get_allow_password_change(PyObject *obj, void *closure)
3100 : {
3101 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3102 : PyObject *py_allow_password_change;
3103 0 : py_allow_password_change = PyLong_FromUnsignedLongLong(object->allow_password_change);
3104 0 : return py_allow_password_change;
3105 : }
3106 :
3107 0 : static int py_netr_SamBaseInfo_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure)
3108 : {
3109 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3110 0 : if (value == NULL) {
3111 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->allow_password_change");
3112 0 : return -1;
3113 : }
3114 : {
3115 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->allow_password_change));
3116 0 : if (PyLong_Check(value)) {
3117 : unsigned long long test_var;
3118 0 : test_var = PyLong_AsUnsignedLongLong(value);
3119 0 : if (PyErr_Occurred() != NULL) {
3120 0 : return -1;
3121 : }
3122 0 : if (test_var > uint_max) {
3123 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3124 : PyLong_Type.tp_name, uint_max, test_var);
3125 0 : return -1;
3126 : }
3127 0 : object->allow_password_change = test_var;
3128 : } else {
3129 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3130 : PyLong_Type.tp_name);
3131 0 : return -1;
3132 : }
3133 : }
3134 0 : return 0;
3135 : }
3136 :
3137 0 : static PyObject *py_netr_SamBaseInfo_get_force_password_change(PyObject *obj, void *closure)
3138 : {
3139 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3140 : PyObject *py_force_password_change;
3141 0 : py_force_password_change = PyLong_FromUnsignedLongLong(object->force_password_change);
3142 0 : return py_force_password_change;
3143 : }
3144 :
3145 0 : static int py_netr_SamBaseInfo_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure)
3146 : {
3147 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3148 0 : if (value == NULL) {
3149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_password_change");
3150 0 : return -1;
3151 : }
3152 : {
3153 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_password_change));
3154 0 : if (PyLong_Check(value)) {
3155 : unsigned long long test_var;
3156 0 : test_var = PyLong_AsUnsignedLongLong(value);
3157 0 : if (PyErr_Occurred() != NULL) {
3158 0 : return -1;
3159 : }
3160 0 : if (test_var > uint_max) {
3161 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3162 : PyLong_Type.tp_name, uint_max, test_var);
3163 0 : return -1;
3164 : }
3165 0 : object->force_password_change = test_var;
3166 : } else {
3167 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3168 : PyLong_Type.tp_name);
3169 0 : return -1;
3170 : }
3171 : }
3172 0 : return 0;
3173 : }
3174 :
3175 201 : static PyObject *py_netr_SamBaseInfo_get_account_name(PyObject *obj, void *closure)
3176 : {
3177 201 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3178 : PyObject *py_account_name;
3179 201 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
3180 201 : return py_account_name;
3181 : }
3182 :
3183 0 : static int py_netr_SamBaseInfo_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
3184 : {
3185 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3186 0 : if (value == NULL) {
3187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
3188 0 : return -1;
3189 : }
3190 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3191 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3192 0 : PyErr_NoMemory();
3193 0 : return -1;
3194 : }
3195 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3196 0 : return 0;
3197 : }
3198 :
3199 0 : static PyObject *py_netr_SamBaseInfo_get_full_name(PyObject *obj, void *closure)
3200 : {
3201 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3202 : PyObject *py_full_name;
3203 0 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
3204 0 : return py_full_name;
3205 : }
3206 :
3207 0 : static int py_netr_SamBaseInfo_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
3208 : {
3209 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3210 0 : if (value == NULL) {
3211 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
3212 0 : return -1;
3213 : }
3214 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3215 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3216 0 : PyErr_NoMemory();
3217 0 : return -1;
3218 : }
3219 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3220 0 : return 0;
3221 : }
3222 :
3223 0 : static PyObject *py_netr_SamBaseInfo_get_logon_script(PyObject *obj, void *closure)
3224 : {
3225 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3226 : PyObject *py_logon_script;
3227 0 : py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
3228 0 : return py_logon_script;
3229 : }
3230 :
3231 0 : static int py_netr_SamBaseInfo_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
3232 : {
3233 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3234 0 : if (value == NULL) {
3235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script");
3236 0 : return -1;
3237 : }
3238 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3239 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3240 0 : PyErr_NoMemory();
3241 0 : return -1;
3242 : }
3243 0 : object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
3244 0 : return 0;
3245 : }
3246 :
3247 0 : static PyObject *py_netr_SamBaseInfo_get_profile_path(PyObject *obj, void *closure)
3248 : {
3249 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3250 : PyObject *py_profile_path;
3251 0 : py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
3252 0 : return py_profile_path;
3253 : }
3254 :
3255 0 : static int py_netr_SamBaseInfo_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
3256 : {
3257 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3258 0 : if (value == NULL) {
3259 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path");
3260 0 : return -1;
3261 : }
3262 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3263 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3264 0 : PyErr_NoMemory();
3265 0 : return -1;
3266 : }
3267 0 : object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
3268 0 : return 0;
3269 : }
3270 :
3271 0 : static PyObject *py_netr_SamBaseInfo_get_home_directory(PyObject *obj, void *closure)
3272 : {
3273 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3274 : PyObject *py_home_directory;
3275 0 : py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
3276 0 : return py_home_directory;
3277 : }
3278 :
3279 0 : static int py_netr_SamBaseInfo_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
3280 : {
3281 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3282 0 : if (value == NULL) {
3283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory");
3284 0 : return -1;
3285 : }
3286 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3287 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3288 0 : PyErr_NoMemory();
3289 0 : return -1;
3290 : }
3291 0 : object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
3292 0 : return 0;
3293 : }
3294 :
3295 0 : static PyObject *py_netr_SamBaseInfo_get_home_drive(PyObject *obj, void *closure)
3296 : {
3297 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3298 : PyObject *py_home_drive;
3299 0 : py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
3300 0 : return py_home_drive;
3301 : }
3302 :
3303 0 : static int py_netr_SamBaseInfo_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
3304 : {
3305 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3306 0 : if (value == NULL) {
3307 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive");
3308 0 : return -1;
3309 : }
3310 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3311 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3312 0 : PyErr_NoMemory();
3313 0 : return -1;
3314 : }
3315 0 : object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
3316 0 : return 0;
3317 : }
3318 :
3319 0 : static PyObject *py_netr_SamBaseInfo_get_logon_count(PyObject *obj, void *closure)
3320 : {
3321 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3322 : PyObject *py_logon_count;
3323 0 : py_logon_count = PyLong_FromLong((uint16_t)object->logon_count);
3324 0 : return py_logon_count;
3325 : }
3326 :
3327 0 : static int py_netr_SamBaseInfo_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
3328 : {
3329 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3330 0 : if (value == NULL) {
3331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count");
3332 0 : return -1;
3333 : }
3334 : {
3335 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count));
3336 0 : if (PyLong_Check(value)) {
3337 : unsigned long long test_var;
3338 0 : test_var = PyLong_AsUnsignedLongLong(value);
3339 0 : if (PyErr_Occurred() != NULL) {
3340 0 : return -1;
3341 : }
3342 0 : if (test_var > uint_max) {
3343 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3344 : PyLong_Type.tp_name, uint_max, test_var);
3345 0 : return -1;
3346 : }
3347 0 : object->logon_count = test_var;
3348 : } else {
3349 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3350 : PyLong_Type.tp_name);
3351 0 : return -1;
3352 : }
3353 : }
3354 0 : return 0;
3355 : }
3356 :
3357 0 : static PyObject *py_netr_SamBaseInfo_get_bad_password_count(PyObject *obj, void *closure)
3358 : {
3359 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3360 : PyObject *py_bad_password_count;
3361 0 : py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count);
3362 0 : return py_bad_password_count;
3363 : }
3364 :
3365 0 : static int py_netr_SamBaseInfo_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
3366 : {
3367 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3368 0 : if (value == NULL) {
3369 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count");
3370 0 : return -1;
3371 : }
3372 : {
3373 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count));
3374 0 : if (PyLong_Check(value)) {
3375 : unsigned long long test_var;
3376 0 : test_var = PyLong_AsUnsignedLongLong(value);
3377 0 : if (PyErr_Occurred() != NULL) {
3378 0 : return -1;
3379 : }
3380 0 : if (test_var > uint_max) {
3381 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3382 : PyLong_Type.tp_name, uint_max, test_var);
3383 0 : return -1;
3384 : }
3385 0 : object->bad_password_count = test_var;
3386 : } else {
3387 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3388 : PyLong_Type.tp_name);
3389 0 : return -1;
3390 : }
3391 : }
3392 0 : return 0;
3393 : }
3394 :
3395 53 : static PyObject *py_netr_SamBaseInfo_get_rid(PyObject *obj, void *closure)
3396 : {
3397 53 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3398 : PyObject *py_rid;
3399 53 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
3400 53 : return py_rid;
3401 : }
3402 :
3403 0 : static int py_netr_SamBaseInfo_set_rid(PyObject *py_obj, PyObject *value, void *closure)
3404 : {
3405 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3406 0 : if (value == NULL) {
3407 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
3408 0 : return -1;
3409 : }
3410 : {
3411 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
3412 0 : if (PyLong_Check(value)) {
3413 : unsigned long long test_var;
3414 0 : test_var = PyLong_AsUnsignedLongLong(value);
3415 0 : if (PyErr_Occurred() != NULL) {
3416 0 : return -1;
3417 : }
3418 0 : if (test_var > uint_max) {
3419 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3420 : PyLong_Type.tp_name, uint_max, test_var);
3421 0 : return -1;
3422 : }
3423 0 : object->rid = test_var;
3424 : } else {
3425 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3426 : PyLong_Type.tp_name);
3427 0 : return -1;
3428 : }
3429 : }
3430 0 : return 0;
3431 : }
3432 :
3433 0 : static PyObject *py_netr_SamBaseInfo_get_primary_gid(PyObject *obj, void *closure)
3434 : {
3435 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3436 : PyObject *py_primary_gid;
3437 0 : py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid);
3438 0 : return py_primary_gid;
3439 : }
3440 :
3441 0 : static int py_netr_SamBaseInfo_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
3442 : {
3443 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3444 0 : if (value == NULL) {
3445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
3446 0 : return -1;
3447 : }
3448 : {
3449 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
3450 0 : if (PyLong_Check(value)) {
3451 : unsigned long long test_var;
3452 0 : test_var = PyLong_AsUnsignedLongLong(value);
3453 0 : if (PyErr_Occurred() != NULL) {
3454 0 : return -1;
3455 : }
3456 0 : if (test_var > uint_max) {
3457 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3458 : PyLong_Type.tp_name, uint_max, test_var);
3459 0 : return -1;
3460 : }
3461 0 : object->primary_gid = test_var;
3462 : } else {
3463 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3464 : PyLong_Type.tp_name);
3465 0 : return -1;
3466 : }
3467 : }
3468 0 : return 0;
3469 : }
3470 :
3471 0 : static PyObject *py_netr_SamBaseInfo_get_groups(PyObject *obj, void *closure)
3472 : {
3473 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3474 : PyObject *py_groups;
3475 0 : py_groups = pytalloc_reference_ex(samr_RidWithAttributeArray_Type, pytalloc_get_mem_ctx(obj), &object->groups);
3476 0 : return py_groups;
3477 : }
3478 :
3479 0 : static int py_netr_SamBaseInfo_set_groups(PyObject *py_obj, PyObject *value, void *closure)
3480 : {
3481 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3482 0 : if (value == NULL) {
3483 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups");
3484 0 : return -1;
3485 : }
3486 0 : PY_CHECK_TYPE(samr_RidWithAttributeArray_Type, value, return -1;);
3487 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3488 0 : PyErr_NoMemory();
3489 0 : return -1;
3490 : }
3491 0 : object->groups = *(struct samr_RidWithAttributeArray *)pytalloc_get_ptr(value);
3492 0 : return 0;
3493 : }
3494 :
3495 0 : static PyObject *py_netr_SamBaseInfo_get_user_flags(PyObject *obj, void *closure)
3496 : {
3497 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3498 : PyObject *py_user_flags;
3499 0 : py_user_flags = PyLong_FromUnsignedLongLong((uint32_t)object->user_flags);
3500 0 : return py_user_flags;
3501 : }
3502 :
3503 0 : static int py_netr_SamBaseInfo_set_user_flags(PyObject *py_obj, PyObject *value, void *closure)
3504 : {
3505 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3506 0 : if (value == NULL) {
3507 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_flags");
3508 0 : return -1;
3509 : }
3510 : {
3511 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_flags));
3512 0 : if (PyLong_Check(value)) {
3513 : unsigned long long test_var;
3514 0 : test_var = PyLong_AsUnsignedLongLong(value);
3515 0 : if (PyErr_Occurred() != NULL) {
3516 0 : return -1;
3517 : }
3518 0 : if (test_var > uint_max) {
3519 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3520 : PyLong_Type.tp_name, uint_max, test_var);
3521 0 : return -1;
3522 : }
3523 0 : object->user_flags = test_var;
3524 : } else {
3525 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3526 : PyLong_Type.tp_name);
3527 0 : return -1;
3528 : }
3529 : }
3530 0 : return 0;
3531 : }
3532 :
3533 0 : static PyObject *py_netr_SamBaseInfo_get_key(PyObject *obj, void *closure)
3534 : {
3535 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3536 : PyObject *py_key;
3537 0 : py_key = pytalloc_reference_ex(&netr_UserSessionKey_Type, pytalloc_get_mem_ctx(obj), &object->key);
3538 0 : return py_key;
3539 : }
3540 :
3541 0 : static int py_netr_SamBaseInfo_set_key(PyObject *py_obj, PyObject *value, void *closure)
3542 : {
3543 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3544 0 : if (value == NULL) {
3545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->key");
3546 0 : return -1;
3547 : }
3548 0 : PY_CHECK_TYPE(&netr_UserSessionKey_Type, value, return -1;);
3549 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3550 0 : PyErr_NoMemory();
3551 0 : return -1;
3552 : }
3553 0 : object->key = *(struct netr_UserSessionKey *)pytalloc_get_ptr(value);
3554 0 : return 0;
3555 : }
3556 :
3557 0 : static PyObject *py_netr_SamBaseInfo_get_logon_server(PyObject *obj, void *closure)
3558 : {
3559 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3560 : PyObject *py_logon_server;
3561 0 : py_logon_server = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->logon_server);
3562 0 : return py_logon_server;
3563 : }
3564 :
3565 0 : static int py_netr_SamBaseInfo_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
3566 : {
3567 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3568 0 : if (value == NULL) {
3569 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_server");
3570 0 : return -1;
3571 : }
3572 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
3573 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3574 0 : PyErr_NoMemory();
3575 0 : return -1;
3576 : }
3577 0 : object->logon_server = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3578 0 : return 0;
3579 : }
3580 :
3581 0 : static PyObject *py_netr_SamBaseInfo_get_logon_domain(PyObject *obj, void *closure)
3582 : {
3583 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3584 : PyObject *py_logon_domain;
3585 0 : py_logon_domain = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->logon_domain);
3586 0 : return py_logon_domain;
3587 : }
3588 :
3589 0 : static int py_netr_SamBaseInfo_set_logon_domain(PyObject *py_obj, PyObject *value, void *closure)
3590 : {
3591 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3592 0 : if (value == NULL) {
3593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_domain");
3594 0 : return -1;
3595 : }
3596 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
3597 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3598 0 : PyErr_NoMemory();
3599 0 : return -1;
3600 : }
3601 0 : object->logon_domain = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3602 0 : return 0;
3603 : }
3604 :
3605 0 : static PyObject *py_netr_SamBaseInfo_get_domain_sid(PyObject *obj, void *closure)
3606 : {
3607 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3608 : PyObject *py_domain_sid;
3609 0 : if (object->domain_sid == NULL) {
3610 0 : Py_RETURN_NONE;
3611 : }
3612 0 : if (object->domain_sid == NULL) {
3613 0 : py_domain_sid = Py_None;
3614 0 : Py_INCREF(py_domain_sid);
3615 : } else {
3616 0 : py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
3617 : }
3618 0 : return py_domain_sid;
3619 : }
3620 :
3621 0 : static int py_netr_SamBaseInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
3622 : {
3623 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3624 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
3625 0 : if (value == NULL) {
3626 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid");
3627 0 : return -1;
3628 : }
3629 0 : if (value == Py_None) {
3630 0 : object->domain_sid = NULL;
3631 : } else {
3632 0 : object->domain_sid = NULL;
3633 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3634 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3635 0 : PyErr_NoMemory();
3636 0 : return -1;
3637 : }
3638 0 : object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
3639 : }
3640 0 : return 0;
3641 : }
3642 :
3643 0 : static PyObject *py_netr_SamBaseInfo_get_LMSessKey(PyObject *obj, void *closure)
3644 : {
3645 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3646 : PyObject *py_LMSessKey;
3647 0 : py_LMSessKey = pytalloc_reference_ex(&netr_LMSessionKey_Type, pytalloc_get_mem_ctx(obj), &object->LMSessKey);
3648 0 : return py_LMSessKey;
3649 : }
3650 :
3651 0 : static int py_netr_SamBaseInfo_set_LMSessKey(PyObject *py_obj, PyObject *value, void *closure)
3652 : {
3653 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3654 0 : if (value == NULL) {
3655 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->LMSessKey");
3656 0 : return -1;
3657 : }
3658 0 : PY_CHECK_TYPE(&netr_LMSessionKey_Type, value, return -1;);
3659 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3660 0 : PyErr_NoMemory();
3661 0 : return -1;
3662 : }
3663 0 : object->LMSessKey = *(struct netr_LMSessionKey *)pytalloc_get_ptr(value);
3664 0 : return 0;
3665 : }
3666 :
3667 0 : static PyObject *py_netr_SamBaseInfo_get_acct_flags(PyObject *obj, void *closure)
3668 : {
3669 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3670 : PyObject *py_acct_flags;
3671 0 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
3672 0 : return py_acct_flags;
3673 : }
3674 :
3675 0 : static int py_netr_SamBaseInfo_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
3676 : {
3677 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3678 0 : if (value == NULL) {
3679 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
3680 0 : return -1;
3681 : }
3682 : {
3683 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
3684 0 : if (PyLong_Check(value)) {
3685 : unsigned long long test_var;
3686 0 : test_var = PyLong_AsUnsignedLongLong(value);
3687 0 : if (PyErr_Occurred() != NULL) {
3688 0 : return -1;
3689 : }
3690 0 : if (test_var > uint_max) {
3691 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3692 : PyLong_Type.tp_name, uint_max, test_var);
3693 0 : return -1;
3694 : }
3695 0 : object->acct_flags = test_var;
3696 : } else {
3697 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3698 : PyLong_Type.tp_name);
3699 0 : return -1;
3700 : }
3701 : }
3702 0 : return 0;
3703 : }
3704 :
3705 0 : static PyObject *py_netr_SamBaseInfo_get_sub_auth_status(PyObject *obj, void *closure)
3706 : {
3707 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3708 : PyObject *py_sub_auth_status;
3709 0 : py_sub_auth_status = PyLong_FromUnsignedLongLong((uint32_t)object->sub_auth_status);
3710 0 : return py_sub_auth_status;
3711 : }
3712 :
3713 0 : static int py_netr_SamBaseInfo_set_sub_auth_status(PyObject *py_obj, PyObject *value, void *closure)
3714 : {
3715 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3716 0 : if (value == NULL) {
3717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sub_auth_status");
3718 0 : return -1;
3719 : }
3720 : {
3721 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sub_auth_status));
3722 0 : if (PyLong_Check(value)) {
3723 : unsigned long long test_var;
3724 0 : test_var = PyLong_AsUnsignedLongLong(value);
3725 0 : if (PyErr_Occurred() != NULL) {
3726 0 : return -1;
3727 : }
3728 0 : if (test_var > uint_max) {
3729 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3730 : PyLong_Type.tp_name, uint_max, test_var);
3731 0 : return -1;
3732 : }
3733 0 : object->sub_auth_status = test_var;
3734 : } else {
3735 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3736 : PyLong_Type.tp_name);
3737 0 : return -1;
3738 : }
3739 : }
3740 0 : return 0;
3741 : }
3742 :
3743 0 : static PyObject *py_netr_SamBaseInfo_get_last_successful_logon(PyObject *obj, void *closure)
3744 : {
3745 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3746 : PyObject *py_last_successful_logon;
3747 0 : py_last_successful_logon = PyLong_FromUnsignedLongLong(object->last_successful_logon);
3748 0 : return py_last_successful_logon;
3749 : }
3750 :
3751 0 : static int py_netr_SamBaseInfo_set_last_successful_logon(PyObject *py_obj, PyObject *value, void *closure)
3752 : {
3753 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3754 0 : if (value == NULL) {
3755 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_successful_logon");
3756 0 : return -1;
3757 : }
3758 : {
3759 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_successful_logon));
3760 0 : if (PyLong_Check(value)) {
3761 : unsigned long long test_var;
3762 0 : test_var = PyLong_AsUnsignedLongLong(value);
3763 0 : if (PyErr_Occurred() != NULL) {
3764 0 : return -1;
3765 : }
3766 0 : if (test_var > uint_max) {
3767 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3768 : PyLong_Type.tp_name, uint_max, test_var);
3769 0 : return -1;
3770 : }
3771 0 : object->last_successful_logon = test_var;
3772 : } else {
3773 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3774 : PyLong_Type.tp_name);
3775 0 : return -1;
3776 : }
3777 : }
3778 0 : return 0;
3779 : }
3780 :
3781 0 : static PyObject *py_netr_SamBaseInfo_get_last_failed_logon(PyObject *obj, void *closure)
3782 : {
3783 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3784 : PyObject *py_last_failed_logon;
3785 0 : py_last_failed_logon = PyLong_FromUnsignedLongLong(object->last_failed_logon);
3786 0 : return py_last_failed_logon;
3787 : }
3788 :
3789 0 : static int py_netr_SamBaseInfo_set_last_failed_logon(PyObject *py_obj, PyObject *value, void *closure)
3790 : {
3791 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3792 0 : if (value == NULL) {
3793 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_failed_logon");
3794 0 : return -1;
3795 : }
3796 : {
3797 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_failed_logon));
3798 0 : if (PyLong_Check(value)) {
3799 : unsigned long long test_var;
3800 0 : test_var = PyLong_AsUnsignedLongLong(value);
3801 0 : if (PyErr_Occurred() != NULL) {
3802 0 : return -1;
3803 : }
3804 0 : if (test_var > uint_max) {
3805 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3806 : PyLong_Type.tp_name, uint_max, test_var);
3807 0 : return -1;
3808 : }
3809 0 : object->last_failed_logon = test_var;
3810 : } else {
3811 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3812 : PyLong_Type.tp_name);
3813 0 : return -1;
3814 : }
3815 : }
3816 0 : return 0;
3817 : }
3818 :
3819 0 : static PyObject *py_netr_SamBaseInfo_get_failed_logon_count(PyObject *obj, void *closure)
3820 : {
3821 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3822 : PyObject *py_failed_logon_count;
3823 0 : py_failed_logon_count = PyLong_FromUnsignedLongLong((uint32_t)object->failed_logon_count);
3824 0 : return py_failed_logon_count;
3825 : }
3826 :
3827 0 : static int py_netr_SamBaseInfo_set_failed_logon_count(PyObject *py_obj, PyObject *value, void *closure)
3828 : {
3829 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3830 0 : if (value == NULL) {
3831 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->failed_logon_count");
3832 0 : return -1;
3833 : }
3834 : {
3835 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->failed_logon_count));
3836 0 : if (PyLong_Check(value)) {
3837 : unsigned long long test_var;
3838 0 : test_var = PyLong_AsUnsignedLongLong(value);
3839 0 : if (PyErr_Occurred() != NULL) {
3840 0 : return -1;
3841 : }
3842 0 : if (test_var > uint_max) {
3843 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3844 : PyLong_Type.tp_name, uint_max, test_var);
3845 0 : return -1;
3846 : }
3847 0 : object->failed_logon_count = test_var;
3848 : } else {
3849 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3850 : PyLong_Type.tp_name);
3851 0 : return -1;
3852 : }
3853 : }
3854 0 : return 0;
3855 : }
3856 :
3857 0 : static PyObject *py_netr_SamBaseInfo_get_reserved(PyObject *obj, void *closure)
3858 : {
3859 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(obj);
3860 : PyObject *py_reserved;
3861 0 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
3862 0 : return py_reserved;
3863 : }
3864 :
3865 0 : static int py_netr_SamBaseInfo_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
3866 : {
3867 0 : struct netr_SamBaseInfo *object = (struct netr_SamBaseInfo *)pytalloc_get_ptr(py_obj);
3868 0 : if (value == NULL) {
3869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
3870 0 : return -1;
3871 : }
3872 : {
3873 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
3874 0 : if (PyLong_Check(value)) {
3875 : unsigned long long test_var;
3876 0 : test_var = PyLong_AsUnsignedLongLong(value);
3877 0 : if (PyErr_Occurred() != NULL) {
3878 0 : return -1;
3879 : }
3880 0 : if (test_var > uint_max) {
3881 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3882 : PyLong_Type.tp_name, uint_max, test_var);
3883 0 : return -1;
3884 : }
3885 0 : object->reserved = test_var;
3886 : } else {
3887 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3888 : PyLong_Type.tp_name);
3889 0 : return -1;
3890 : }
3891 : }
3892 0 : return 0;
3893 : }
3894 :
3895 : static PyGetSetDef py_netr_SamBaseInfo_getsetters[] = {
3896 : {
3897 : .name = discard_const_p(char, "logon_time"),
3898 : .get = py_netr_SamBaseInfo_get_logon_time,
3899 : .set = py_netr_SamBaseInfo_set_logon_time,
3900 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
3901 : },
3902 : {
3903 : .name = discard_const_p(char, "logoff_time"),
3904 : .get = py_netr_SamBaseInfo_get_logoff_time,
3905 : .set = py_netr_SamBaseInfo_set_logoff_time,
3906 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
3907 : },
3908 : {
3909 : .name = discard_const_p(char, "kickoff_time"),
3910 : .get = py_netr_SamBaseInfo_get_kickoff_time,
3911 : .set = py_netr_SamBaseInfo_set_kickoff_time,
3912 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
3913 : },
3914 : {
3915 : .name = discard_const_p(char, "last_password_change"),
3916 : .get = py_netr_SamBaseInfo_get_last_password_change,
3917 : .set = py_netr_SamBaseInfo_set_last_password_change,
3918 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
3919 : },
3920 : {
3921 : .name = discard_const_p(char, "allow_password_change"),
3922 : .get = py_netr_SamBaseInfo_get_allow_password_change,
3923 : .set = py_netr_SamBaseInfo_set_allow_password_change,
3924 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
3925 : },
3926 : {
3927 : .name = discard_const_p(char, "force_password_change"),
3928 : .get = py_netr_SamBaseInfo_get_force_password_change,
3929 : .set = py_netr_SamBaseInfo_set_force_password_change,
3930 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
3931 : },
3932 : {
3933 : .name = discard_const_p(char, "account_name"),
3934 : .get = py_netr_SamBaseInfo_get_account_name,
3935 : .set = py_netr_SamBaseInfo_set_account_name,
3936 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3937 : },
3938 : {
3939 : .name = discard_const_p(char, "full_name"),
3940 : .get = py_netr_SamBaseInfo_get_full_name,
3941 : .set = py_netr_SamBaseInfo_set_full_name,
3942 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3943 : },
3944 : {
3945 : .name = discard_const_p(char, "logon_script"),
3946 : .get = py_netr_SamBaseInfo_get_logon_script,
3947 : .set = py_netr_SamBaseInfo_set_logon_script,
3948 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3949 : },
3950 : {
3951 : .name = discard_const_p(char, "profile_path"),
3952 : .get = py_netr_SamBaseInfo_get_profile_path,
3953 : .set = py_netr_SamBaseInfo_set_profile_path,
3954 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3955 : },
3956 : {
3957 : .name = discard_const_p(char, "home_directory"),
3958 : .get = py_netr_SamBaseInfo_get_home_directory,
3959 : .set = py_netr_SamBaseInfo_set_home_directory,
3960 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3961 : },
3962 : {
3963 : .name = discard_const_p(char, "home_drive"),
3964 : .get = py_netr_SamBaseInfo_get_home_drive,
3965 : .set = py_netr_SamBaseInfo_set_home_drive,
3966 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3967 : },
3968 : {
3969 : .name = discard_const_p(char, "logon_count"),
3970 : .get = py_netr_SamBaseInfo_get_logon_count,
3971 : .set = py_netr_SamBaseInfo_set_logon_count,
3972 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3973 : },
3974 : {
3975 : .name = discard_const_p(char, "bad_password_count"),
3976 : .get = py_netr_SamBaseInfo_get_bad_password_count,
3977 : .set = py_netr_SamBaseInfo_set_bad_password_count,
3978 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3979 : },
3980 : {
3981 : .name = discard_const_p(char, "rid"),
3982 : .get = py_netr_SamBaseInfo_get_rid,
3983 : .set = py_netr_SamBaseInfo_set_rid,
3984 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3985 : },
3986 : {
3987 : .name = discard_const_p(char, "primary_gid"),
3988 : .get = py_netr_SamBaseInfo_get_primary_gid,
3989 : .set = py_netr_SamBaseInfo_set_primary_gid,
3990 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3991 : },
3992 : {
3993 : .name = discard_const_p(char, "groups"),
3994 : .get = py_netr_SamBaseInfo_get_groups,
3995 : .set = py_netr_SamBaseInfo_set_groups,
3996 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttributeArray")
3997 : },
3998 : {
3999 : .name = discard_const_p(char, "user_flags"),
4000 : .get = py_netr_SamBaseInfo_get_user_flags,
4001 : .set = py_netr_SamBaseInfo_set_user_flags,
4002 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UserFlags")
4003 : },
4004 : {
4005 : .name = discard_const_p(char, "key"),
4006 : .get = py_netr_SamBaseInfo_get_key,
4007 : .set = py_netr_SamBaseInfo_set_key,
4008 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UserSessionKey")
4009 : },
4010 : {
4011 : .name = discard_const_p(char, "logon_server"),
4012 : .get = py_netr_SamBaseInfo_get_logon_server,
4013 : .set = py_netr_SamBaseInfo_set_logon_server,
4014 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4015 : },
4016 : {
4017 : .name = discard_const_p(char, "logon_domain"),
4018 : .get = py_netr_SamBaseInfo_get_logon_domain,
4019 : .set = py_netr_SamBaseInfo_set_logon_domain,
4020 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4021 : },
4022 : {
4023 : .name = discard_const_p(char, "domain_sid"),
4024 : .get = py_netr_SamBaseInfo_get_domain_sid,
4025 : .set = py_netr_SamBaseInfo_set_domain_sid,
4026 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
4027 : },
4028 : {
4029 : .name = discard_const_p(char, "LMSessKey"),
4030 : .get = py_netr_SamBaseInfo_get_LMSessKey,
4031 : .set = py_netr_SamBaseInfo_set_LMSessKey,
4032 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LMSessionKey")
4033 : },
4034 : {
4035 : .name = discard_const_p(char, "acct_flags"),
4036 : .get = py_netr_SamBaseInfo_get_acct_flags,
4037 : .set = py_netr_SamBaseInfo_set_acct_flags,
4038 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
4039 : },
4040 : {
4041 : .name = discard_const_p(char, "sub_auth_status"),
4042 : .get = py_netr_SamBaseInfo_get_sub_auth_status,
4043 : .set = py_netr_SamBaseInfo_set_sub_auth_status,
4044 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4045 : },
4046 : {
4047 : .name = discard_const_p(char, "last_successful_logon"),
4048 : .get = py_netr_SamBaseInfo_get_last_successful_logon,
4049 : .set = py_netr_SamBaseInfo_set_last_successful_logon,
4050 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
4051 : },
4052 : {
4053 : .name = discard_const_p(char, "last_failed_logon"),
4054 : .get = py_netr_SamBaseInfo_get_last_failed_logon,
4055 : .set = py_netr_SamBaseInfo_set_last_failed_logon,
4056 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
4057 : },
4058 : {
4059 : .name = discard_const_p(char, "failed_logon_count"),
4060 : .get = py_netr_SamBaseInfo_get_failed_logon_count,
4061 : .set = py_netr_SamBaseInfo_set_failed_logon_count,
4062 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4063 : },
4064 : {
4065 : .name = discard_const_p(char, "reserved"),
4066 : .get = py_netr_SamBaseInfo_get_reserved,
4067 : .set = py_netr_SamBaseInfo_set_reserved,
4068 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4069 : },
4070 : { .name = NULL }
4071 : };
4072 :
4073 0 : static PyObject *py_netr_SamBaseInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4074 : {
4075 0 : return pytalloc_new(struct netr_SamBaseInfo, type);
4076 : }
4077 :
4078 :
4079 : static PyTypeObject netr_SamBaseInfo_Type = {
4080 : PyVarObject_HEAD_INIT(NULL, 0)
4081 : .tp_name = "netlogon.netr_SamBaseInfo",
4082 : .tp_getset = py_netr_SamBaseInfo_getsetters,
4083 : .tp_methods = NULL,
4084 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4085 : .tp_new = py_netr_SamBaseInfo_new,
4086 : };
4087 :
4088 :
4089 0 : static PyObject *py_netr_SamInfo2_get_base(PyObject *obj, void *closure)
4090 : {
4091 0 : struct netr_SamInfo2 *object = (struct netr_SamInfo2 *)pytalloc_get_ptr(obj);
4092 : PyObject *py_base;
4093 0 : py_base = pytalloc_reference_ex(&netr_SamBaseInfo_Type, pytalloc_get_mem_ctx(obj), &object->base);
4094 0 : return py_base;
4095 : }
4096 :
4097 0 : static int py_netr_SamInfo2_set_base(PyObject *py_obj, PyObject *value, void *closure)
4098 : {
4099 0 : struct netr_SamInfo2 *object = (struct netr_SamInfo2 *)pytalloc_get_ptr(py_obj);
4100 0 : if (value == NULL) {
4101 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->base");
4102 0 : return -1;
4103 : }
4104 0 : PY_CHECK_TYPE(&netr_SamBaseInfo_Type, value, return -1;);
4105 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4106 0 : PyErr_NoMemory();
4107 0 : return -1;
4108 : }
4109 0 : object->base = *(struct netr_SamBaseInfo *)pytalloc_get_ptr(value);
4110 0 : return 0;
4111 : }
4112 :
4113 : static PyGetSetDef py_netr_SamInfo2_getsetters[] = {
4114 : {
4115 : .name = discard_const_p(char, "base"),
4116 : .get = py_netr_SamInfo2_get_base,
4117 : .set = py_netr_SamInfo2_set_base,
4118 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamBaseInfo")
4119 : },
4120 : { .name = NULL }
4121 : };
4122 :
4123 0 : static PyObject *py_netr_SamInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4124 : {
4125 0 : return pytalloc_new(struct netr_SamInfo2, type);
4126 : }
4127 :
4128 :
4129 : static PyTypeObject netr_SamInfo2_Type = {
4130 : PyVarObject_HEAD_INIT(NULL, 0)
4131 : .tp_name = "netlogon.netr_SamInfo2",
4132 : .tp_getset = py_netr_SamInfo2_getsetters,
4133 : .tp_methods = NULL,
4134 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4135 : .tp_new = py_netr_SamInfo2_new,
4136 : };
4137 :
4138 :
4139 20 : static PyObject *py_netr_SidAttr_get_sid(PyObject *obj, void *closure)
4140 : {
4141 20 : struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(obj);
4142 : PyObject *py_sid;
4143 20 : if (object->sid == NULL) {
4144 0 : Py_RETURN_NONE;
4145 : }
4146 20 : if (object->sid == NULL) {
4147 0 : py_sid = Py_None;
4148 0 : Py_INCREF(py_sid);
4149 : } else {
4150 20 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
4151 : }
4152 20 : return py_sid;
4153 : }
4154 :
4155 0 : static int py_netr_SidAttr_set_sid(PyObject *py_obj, PyObject *value, void *closure)
4156 : {
4157 0 : struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(py_obj);
4158 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
4159 0 : if (value == NULL) {
4160 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
4161 0 : return -1;
4162 : }
4163 0 : if (value == Py_None) {
4164 0 : object->sid = NULL;
4165 : } else {
4166 0 : object->sid = NULL;
4167 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
4168 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4169 0 : PyErr_NoMemory();
4170 0 : return -1;
4171 : }
4172 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
4173 : }
4174 0 : return 0;
4175 : }
4176 :
4177 0 : static PyObject *py_netr_SidAttr_get_attributes(PyObject *obj, void *closure)
4178 : {
4179 0 : struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(obj);
4180 : PyObject *py_attributes;
4181 0 : py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes);
4182 0 : return py_attributes;
4183 : }
4184 :
4185 0 : static int py_netr_SidAttr_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
4186 : {
4187 0 : struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(py_obj);
4188 0 : if (value == NULL) {
4189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes");
4190 0 : return -1;
4191 : }
4192 : {
4193 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
4194 0 : if (PyLong_Check(value)) {
4195 : unsigned long long test_var;
4196 0 : test_var = PyLong_AsUnsignedLongLong(value);
4197 0 : if (PyErr_Occurred() != NULL) {
4198 0 : return -1;
4199 : }
4200 0 : if (test_var > uint_max) {
4201 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4202 : PyLong_Type.tp_name, uint_max, test_var);
4203 0 : return -1;
4204 : }
4205 0 : object->attributes = test_var;
4206 : } else {
4207 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4208 : PyLong_Type.tp_name);
4209 0 : return -1;
4210 : }
4211 : }
4212 0 : return 0;
4213 : }
4214 :
4215 : static PyGetSetDef py_netr_SidAttr_getsetters[] = {
4216 : {
4217 : .name = discard_const_p(char, "sid"),
4218 : .get = py_netr_SidAttr_get_sid,
4219 : .set = py_netr_SidAttr_set_sid,
4220 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
4221 : },
4222 : {
4223 : .name = discard_const_p(char, "attributes"),
4224 : .get = py_netr_SidAttr_get_attributes,
4225 : .set = py_netr_SidAttr_set_attributes,
4226 : .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs")
4227 : },
4228 : { .name = NULL }
4229 : };
4230 :
4231 0 : static PyObject *py_netr_SidAttr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4232 : {
4233 0 : return pytalloc_new(struct netr_SidAttr, type);
4234 : }
4235 :
4236 0 : static PyObject *py_netr_SidAttr_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4237 : {
4238 0 : struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(py_obj);
4239 0 : PyObject *ret = NULL;
4240 : DATA_BLOB blob;
4241 : enum ndr_err_code err;
4242 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4243 0 : if (tmp_ctx == NULL) {
4244 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4245 0 : return NULL;
4246 : }
4247 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_SidAttr);
4248 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4249 0 : TALLOC_FREE(tmp_ctx);
4250 0 : PyErr_SetNdrError(err);
4251 0 : return NULL;
4252 : }
4253 :
4254 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4255 0 : TALLOC_FREE(tmp_ctx);
4256 0 : return ret;
4257 : }
4258 :
4259 0 : static PyObject *py_netr_SidAttr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4260 : {
4261 0 : struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(py_obj);
4262 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4263 0 : Py_ssize_t blob_length = 0;
4264 : enum ndr_err_code err;
4265 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4266 0 : PyObject *allow_remaining_obj = NULL;
4267 0 : bool allow_remaining = false;
4268 :
4269 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4270 : discard_const_p(char *, kwnames),
4271 : &blob.data, &blob_length,
4272 : &allow_remaining_obj)) {
4273 0 : return NULL;
4274 : }
4275 0 : blob.length = blob_length;
4276 :
4277 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4278 0 : allow_remaining = true;
4279 : }
4280 :
4281 0 : if (allow_remaining) {
4282 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SidAttr);
4283 : } else {
4284 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SidAttr);
4285 : }
4286 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4287 0 : PyErr_SetNdrError(err);
4288 0 : return NULL;
4289 : }
4290 :
4291 0 : Py_RETURN_NONE;
4292 : }
4293 :
4294 0 : static PyObject *py_netr_SidAttr_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4295 : {
4296 0 : struct netr_SidAttr *object = (struct netr_SidAttr *)pytalloc_get_ptr(py_obj);
4297 : PyObject *ret;
4298 : char *retstr;
4299 :
4300 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_SidAttr, "netr_SidAttr", object);
4301 0 : ret = PyUnicode_FromString(retstr);
4302 0 : talloc_free(retstr);
4303 :
4304 0 : return ret;
4305 : }
4306 :
4307 : static PyMethodDef py_netr_SidAttr_methods[] = {
4308 : { "__ndr_pack__", (PyCFunction)py_netr_SidAttr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4309 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SidAttr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4310 : { "__ndr_print__", (PyCFunction)py_netr_SidAttr_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4311 : { NULL, NULL, 0, NULL }
4312 : };
4313 :
4314 :
4315 : static PyTypeObject netr_SidAttr_Type = {
4316 : PyVarObject_HEAD_INIT(NULL, 0)
4317 : .tp_name = "netlogon.netr_SidAttr",
4318 : .tp_getset = py_netr_SidAttr_getsetters,
4319 : .tp_methods = py_netr_SidAttr_methods,
4320 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4321 : .tp_new = py_netr_SidAttr_new,
4322 : };
4323 :
4324 :
4325 2602 : static PyObject *py_netr_SamInfo3_get_base(PyObject *obj, void *closure)
4326 : {
4327 2602 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(obj);
4328 : PyObject *py_base;
4329 2602 : py_base = pytalloc_reference_ex(&netr_SamBaseInfo_Type, pytalloc_get_mem_ctx(obj), &object->base);
4330 2602 : return py_base;
4331 : }
4332 :
4333 0 : static int py_netr_SamInfo3_set_base(PyObject *py_obj, PyObject *value, void *closure)
4334 : {
4335 0 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj);
4336 0 : if (value == NULL) {
4337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->base");
4338 0 : return -1;
4339 : }
4340 0 : PY_CHECK_TYPE(&netr_SamBaseInfo_Type, value, return -1;);
4341 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4342 0 : PyErr_NoMemory();
4343 0 : return -1;
4344 : }
4345 0 : object->base = *(struct netr_SamBaseInfo *)pytalloc_get_ptr(value);
4346 0 : return 0;
4347 : }
4348 :
4349 6 : static PyObject *py_netr_SamInfo3_get_sidcount(PyObject *obj, void *closure)
4350 : {
4351 6 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(obj);
4352 : PyObject *py_sidcount;
4353 6 : py_sidcount = PyLong_FromUnsignedLongLong((uint32_t)object->sidcount);
4354 6 : return py_sidcount;
4355 : }
4356 :
4357 0 : static int py_netr_SamInfo3_set_sidcount(PyObject *py_obj, PyObject *value, void *closure)
4358 : {
4359 0 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj);
4360 0 : if (value == NULL) {
4361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sidcount");
4362 0 : return -1;
4363 : }
4364 : {
4365 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sidcount));
4366 0 : if (PyLong_Check(value)) {
4367 : unsigned long long test_var;
4368 0 : test_var = PyLong_AsUnsignedLongLong(value);
4369 0 : if (PyErr_Occurred() != NULL) {
4370 0 : return -1;
4371 : }
4372 0 : if (test_var > uint_max) {
4373 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4374 : PyLong_Type.tp_name, uint_max, test_var);
4375 0 : return -1;
4376 : }
4377 0 : object->sidcount = test_var;
4378 : } else {
4379 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4380 : PyLong_Type.tp_name);
4381 0 : return -1;
4382 : }
4383 : }
4384 0 : return 0;
4385 : }
4386 :
4387 34 : static PyObject *py_netr_SamInfo3_get_sids(PyObject *obj, void *closure)
4388 : {
4389 34 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(obj);
4390 : PyObject *py_sids;
4391 34 : if (object->sids == NULL) {
4392 0 : Py_RETURN_NONE;
4393 : }
4394 34 : if (object->sids == NULL) {
4395 0 : py_sids = Py_None;
4396 0 : Py_INCREF(py_sids);
4397 : } else {
4398 34 : py_sids = PyList_New(object->sidcount);
4399 34 : if (py_sids == NULL) {
4400 0 : return NULL;
4401 : }
4402 : {
4403 : int sids_cntr_1;
4404 68 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->sidcount); sids_cntr_1++) {
4405 : PyObject *py_sids_1;
4406 34 : py_sids_1 = pytalloc_reference_ex(&netr_SidAttr_Type, object->sids, &object->sids[sids_cntr_1]);
4407 34 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
4408 : }
4409 : }
4410 : }
4411 34 : return py_sids;
4412 : }
4413 :
4414 0 : static int py_netr_SamInfo3_set_sids(PyObject *py_obj, PyObject *value, void *closure)
4415 : {
4416 0 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj);
4417 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
4418 0 : if (value == NULL) {
4419 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
4420 0 : return -1;
4421 : }
4422 0 : if (value == Py_None) {
4423 0 : object->sids = NULL;
4424 : } else {
4425 0 : object->sids = NULL;
4426 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4427 : {
4428 : int sids_cntr_1;
4429 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
4430 0 : if (!object->sids) { return -1;; }
4431 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
4432 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
4433 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
4434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
4435 0 : return -1;
4436 : }
4437 0 : PY_CHECK_TYPE(&netr_SidAttr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
4438 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
4439 0 : PyErr_NoMemory();
4440 0 : return -1;
4441 : }
4442 0 : object->sids[sids_cntr_1] = *(struct netr_SidAttr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
4443 : }
4444 : }
4445 : }
4446 0 : return 0;
4447 : }
4448 :
4449 : static PyGetSetDef py_netr_SamInfo3_getsetters[] = {
4450 : {
4451 : .name = discard_const_p(char, "base"),
4452 : .get = py_netr_SamInfo3_get_base,
4453 : .set = py_netr_SamInfo3_set_base,
4454 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamBaseInfo")
4455 : },
4456 : {
4457 : .name = discard_const_p(char, "sidcount"),
4458 : .get = py_netr_SamInfo3_get_sidcount,
4459 : .set = py_netr_SamInfo3_set_sidcount,
4460 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4461 : },
4462 : {
4463 : .name = discard_const_p(char, "sids"),
4464 : .get = py_netr_SamInfo3_get_sids,
4465 : .set = py_netr_SamInfo3_set_sids,
4466 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SidAttr")
4467 : },
4468 : { .name = NULL }
4469 : };
4470 :
4471 0 : static PyObject *py_netr_SamInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4472 : {
4473 0 : return pytalloc_new(struct netr_SamInfo3, type);
4474 : }
4475 :
4476 0 : static PyObject *py_netr_SamInfo3_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4477 : {
4478 0 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj);
4479 0 : PyObject *ret = NULL;
4480 : DATA_BLOB blob;
4481 : enum ndr_err_code err;
4482 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4483 0 : if (tmp_ctx == NULL) {
4484 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4485 0 : return NULL;
4486 : }
4487 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_SamInfo3);
4488 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4489 0 : TALLOC_FREE(tmp_ctx);
4490 0 : PyErr_SetNdrError(err);
4491 0 : return NULL;
4492 : }
4493 :
4494 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4495 0 : TALLOC_FREE(tmp_ctx);
4496 0 : return ret;
4497 : }
4498 :
4499 0 : static PyObject *py_netr_SamInfo3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4500 : {
4501 0 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj);
4502 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4503 0 : Py_ssize_t blob_length = 0;
4504 : enum ndr_err_code err;
4505 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4506 0 : PyObject *allow_remaining_obj = NULL;
4507 0 : bool allow_remaining = false;
4508 :
4509 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4510 : discard_const_p(char *, kwnames),
4511 : &blob.data, &blob_length,
4512 : &allow_remaining_obj)) {
4513 0 : return NULL;
4514 : }
4515 0 : blob.length = blob_length;
4516 :
4517 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4518 0 : allow_remaining = true;
4519 : }
4520 :
4521 0 : if (allow_remaining) {
4522 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SamInfo3);
4523 : } else {
4524 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SamInfo3);
4525 : }
4526 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4527 0 : PyErr_SetNdrError(err);
4528 0 : return NULL;
4529 : }
4530 :
4531 0 : Py_RETURN_NONE;
4532 : }
4533 :
4534 0 : static PyObject *py_netr_SamInfo3_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4535 : {
4536 0 : struct netr_SamInfo3 *object = (struct netr_SamInfo3 *)pytalloc_get_ptr(py_obj);
4537 : PyObject *ret;
4538 : char *retstr;
4539 :
4540 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_SamInfo3, "netr_SamInfo3", object);
4541 0 : ret = PyUnicode_FromString(retstr);
4542 0 : talloc_free(retstr);
4543 :
4544 0 : return ret;
4545 : }
4546 :
4547 : static PyMethodDef py_netr_SamInfo3_methods[] = {
4548 : { "__ndr_pack__", (PyCFunction)py_netr_SamInfo3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4549 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SamInfo3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4550 : { "__ndr_print__", (PyCFunction)py_netr_SamInfo3_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4551 : { NULL, NULL, 0, NULL }
4552 : };
4553 :
4554 :
4555 : static PyTypeObject netr_SamInfo3_Type = {
4556 : PyVarObject_HEAD_INIT(NULL, 0)
4557 : .tp_name = "netlogon.netr_SamInfo3",
4558 : .tp_getset = py_netr_SamInfo3_getsetters,
4559 : .tp_methods = py_netr_SamInfo3_methods,
4560 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4561 : .tp_new = py_netr_SamInfo3_new,
4562 : };
4563 :
4564 :
4565 0 : static PyObject *py_netr_SamInfo6_get_base(PyObject *obj, void *closure)
4566 : {
4567 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj);
4568 : PyObject *py_base;
4569 0 : py_base = pytalloc_reference_ex(&netr_SamBaseInfo_Type, pytalloc_get_mem_ctx(obj), &object->base);
4570 0 : return py_base;
4571 : }
4572 :
4573 0 : static int py_netr_SamInfo6_set_base(PyObject *py_obj, PyObject *value, void *closure)
4574 : {
4575 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj);
4576 0 : if (value == NULL) {
4577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->base");
4578 0 : return -1;
4579 : }
4580 0 : PY_CHECK_TYPE(&netr_SamBaseInfo_Type, value, return -1;);
4581 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4582 0 : PyErr_NoMemory();
4583 0 : return -1;
4584 : }
4585 0 : object->base = *(struct netr_SamBaseInfo *)pytalloc_get_ptr(value);
4586 0 : return 0;
4587 : }
4588 :
4589 0 : static PyObject *py_netr_SamInfo6_get_sidcount(PyObject *obj, void *closure)
4590 : {
4591 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj);
4592 : PyObject *py_sidcount;
4593 0 : py_sidcount = PyLong_FromUnsignedLongLong((uint32_t)object->sidcount);
4594 0 : return py_sidcount;
4595 : }
4596 :
4597 0 : static int py_netr_SamInfo6_set_sidcount(PyObject *py_obj, PyObject *value, void *closure)
4598 : {
4599 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj);
4600 0 : if (value == NULL) {
4601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sidcount");
4602 0 : return -1;
4603 : }
4604 : {
4605 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sidcount));
4606 0 : if (PyLong_Check(value)) {
4607 : unsigned long long test_var;
4608 0 : test_var = PyLong_AsUnsignedLongLong(value);
4609 0 : if (PyErr_Occurred() != NULL) {
4610 0 : return -1;
4611 : }
4612 0 : if (test_var > uint_max) {
4613 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4614 : PyLong_Type.tp_name, uint_max, test_var);
4615 0 : return -1;
4616 : }
4617 0 : object->sidcount = test_var;
4618 : } else {
4619 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4620 : PyLong_Type.tp_name);
4621 0 : return -1;
4622 : }
4623 : }
4624 0 : return 0;
4625 : }
4626 :
4627 0 : static PyObject *py_netr_SamInfo6_get_sids(PyObject *obj, void *closure)
4628 : {
4629 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj);
4630 : PyObject *py_sids;
4631 0 : if (object->sids == NULL) {
4632 0 : Py_RETURN_NONE;
4633 : }
4634 0 : if (object->sids == NULL) {
4635 0 : py_sids = Py_None;
4636 0 : Py_INCREF(py_sids);
4637 : } else {
4638 0 : py_sids = PyList_New(object->sidcount);
4639 0 : if (py_sids == NULL) {
4640 0 : return NULL;
4641 : }
4642 : {
4643 : int sids_cntr_1;
4644 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->sidcount); sids_cntr_1++) {
4645 : PyObject *py_sids_1;
4646 0 : py_sids_1 = pytalloc_reference_ex(&netr_SidAttr_Type, object->sids, &object->sids[sids_cntr_1]);
4647 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
4648 : }
4649 : }
4650 : }
4651 0 : return py_sids;
4652 : }
4653 :
4654 0 : static int py_netr_SamInfo6_set_sids(PyObject *py_obj, PyObject *value, void *closure)
4655 : {
4656 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj);
4657 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
4658 0 : if (value == NULL) {
4659 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
4660 0 : return -1;
4661 : }
4662 0 : if (value == Py_None) {
4663 0 : object->sids = NULL;
4664 : } else {
4665 0 : object->sids = NULL;
4666 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4667 : {
4668 : int sids_cntr_1;
4669 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
4670 0 : if (!object->sids) { return -1;; }
4671 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
4672 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
4673 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
4674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
4675 0 : return -1;
4676 : }
4677 0 : PY_CHECK_TYPE(&netr_SidAttr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
4678 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
4679 0 : PyErr_NoMemory();
4680 0 : return -1;
4681 : }
4682 0 : object->sids[sids_cntr_1] = *(struct netr_SidAttr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
4683 : }
4684 : }
4685 : }
4686 0 : return 0;
4687 : }
4688 :
4689 0 : static PyObject *py_netr_SamInfo6_get_dns_domainname(PyObject *obj, void *closure)
4690 : {
4691 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj);
4692 : PyObject *py_dns_domainname;
4693 0 : py_dns_domainname = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->dns_domainname);
4694 0 : return py_dns_domainname;
4695 : }
4696 :
4697 0 : static int py_netr_SamInfo6_set_dns_domainname(PyObject *py_obj, PyObject *value, void *closure)
4698 : {
4699 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj);
4700 0 : if (value == NULL) {
4701 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domainname");
4702 0 : return -1;
4703 : }
4704 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4705 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4706 0 : PyErr_NoMemory();
4707 0 : return -1;
4708 : }
4709 0 : object->dns_domainname = *(struct lsa_String *)pytalloc_get_ptr(value);
4710 0 : return 0;
4711 : }
4712 :
4713 0 : static PyObject *py_netr_SamInfo6_get_principal_name(PyObject *obj, void *closure)
4714 : {
4715 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj);
4716 : PyObject *py_principal_name;
4717 0 : py_principal_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->principal_name);
4718 0 : return py_principal_name;
4719 : }
4720 :
4721 0 : static int py_netr_SamInfo6_set_principal_name(PyObject *py_obj, PyObject *value, void *closure)
4722 : {
4723 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj);
4724 0 : if (value == NULL) {
4725 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principal_name");
4726 0 : return -1;
4727 : }
4728 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4729 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4730 0 : PyErr_NoMemory();
4731 0 : return -1;
4732 : }
4733 0 : object->principal_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4734 0 : return 0;
4735 : }
4736 :
4737 0 : static PyObject *py_netr_SamInfo6_get_unknown4(PyObject *obj, void *closure)
4738 : {
4739 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(obj);
4740 : PyObject *py_unknown4;
4741 0 : py_unknown4 = PyList_New(20);
4742 0 : if (py_unknown4 == NULL) {
4743 0 : return NULL;
4744 : }
4745 : {
4746 : int unknown4_cntr_0;
4747 0 : for (unknown4_cntr_0 = 0; unknown4_cntr_0 < (20); unknown4_cntr_0++) {
4748 : PyObject *py_unknown4_0;
4749 0 : py_unknown4_0 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown4[unknown4_cntr_0]);
4750 0 : PyList_SetItem(py_unknown4, unknown4_cntr_0, py_unknown4_0);
4751 : }
4752 : }
4753 0 : return py_unknown4;
4754 : }
4755 :
4756 0 : static int py_netr_SamInfo6_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
4757 : {
4758 0 : struct netr_SamInfo6 *object = (struct netr_SamInfo6 *)pytalloc_get_ptr(py_obj);
4759 0 : if (value == NULL) {
4760 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
4761 0 : return -1;
4762 : }
4763 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4764 : {
4765 : int unknown4_cntr_0;
4766 0 : if (ARRAY_SIZE(object->unknown4) != PyList_GET_SIZE(value)) {
4767 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->unknown4), PyList_GET_SIZE(value));
4768 0 : return -1;
4769 : }
4770 0 : for (unknown4_cntr_0 = 0; unknown4_cntr_0 < PyList_GET_SIZE(value); unknown4_cntr_0++) {
4771 0 : if (PyList_GET_ITEM(value, unknown4_cntr_0) == NULL) {
4772 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4[unknown4_cntr_0]");
4773 0 : return -1;
4774 : }
4775 : {
4776 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown4[unknown4_cntr_0]));
4777 0 : if (PyLong_Check(PyList_GET_ITEM(value, unknown4_cntr_0))) {
4778 : unsigned long long test_var;
4779 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, unknown4_cntr_0));
4780 0 : if (PyErr_Occurred() != NULL) {
4781 0 : return -1;
4782 : }
4783 0 : if (test_var > uint_max) {
4784 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4785 : PyLong_Type.tp_name, uint_max, test_var);
4786 0 : return -1;
4787 : }
4788 0 : object->unknown4[unknown4_cntr_0] = test_var;
4789 : } else {
4790 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4791 : PyLong_Type.tp_name);
4792 0 : return -1;
4793 : }
4794 : }
4795 : }
4796 : }
4797 0 : return 0;
4798 : }
4799 :
4800 : static PyGetSetDef py_netr_SamInfo6_getsetters[] = {
4801 : {
4802 : .name = discard_const_p(char, "base"),
4803 : .get = py_netr_SamInfo6_get_base,
4804 : .set = py_netr_SamInfo6_set_base,
4805 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamBaseInfo")
4806 : },
4807 : {
4808 : .name = discard_const_p(char, "sidcount"),
4809 : .get = py_netr_SamInfo6_get_sidcount,
4810 : .set = py_netr_SamInfo6_set_sidcount,
4811 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4812 : },
4813 : {
4814 : .name = discard_const_p(char, "sids"),
4815 : .get = py_netr_SamInfo6_get_sids,
4816 : .set = py_netr_SamInfo6_set_sids,
4817 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SidAttr")
4818 : },
4819 : {
4820 : .name = discard_const_p(char, "dns_domainname"),
4821 : .get = py_netr_SamInfo6_get_dns_domainname,
4822 : .set = py_netr_SamInfo6_set_dns_domainname,
4823 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4824 : },
4825 : {
4826 : .name = discard_const_p(char, "principal_name"),
4827 : .get = py_netr_SamInfo6_get_principal_name,
4828 : .set = py_netr_SamInfo6_set_principal_name,
4829 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4830 : },
4831 : {
4832 : .name = discard_const_p(char, "unknown4"),
4833 : .get = py_netr_SamInfo6_get_unknown4,
4834 : .set = py_netr_SamInfo6_set_unknown4,
4835 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4836 : },
4837 : { .name = NULL }
4838 : };
4839 :
4840 0 : static PyObject *py_netr_SamInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4841 : {
4842 0 : return pytalloc_new(struct netr_SamInfo6, type);
4843 : }
4844 :
4845 :
4846 : static PyTypeObject netr_SamInfo6_Type = {
4847 : PyVarObject_HEAD_INIT(NULL, 0)
4848 : .tp_name = "netlogon.netr_SamInfo6",
4849 : .tp_getset = py_netr_SamInfo6_getsetters,
4850 : .tp_methods = NULL,
4851 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4852 : .tp_new = py_netr_SamInfo6_new,
4853 : };
4854 :
4855 :
4856 0 : static PyObject *py_netr_PacInfo_get_pac_size(PyObject *obj, void *closure)
4857 : {
4858 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
4859 : PyObject *py_pac_size;
4860 0 : py_pac_size = PyLong_FromUnsignedLongLong((uint32_t)object->pac_size);
4861 0 : return py_pac_size;
4862 : }
4863 :
4864 0 : static int py_netr_PacInfo_set_pac_size(PyObject *py_obj, PyObject *value, void *closure)
4865 : {
4866 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
4867 0 : if (value == NULL) {
4868 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pac_size");
4869 0 : return -1;
4870 : }
4871 : {
4872 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pac_size));
4873 0 : if (PyLong_Check(value)) {
4874 : unsigned long long test_var;
4875 0 : test_var = PyLong_AsUnsignedLongLong(value);
4876 0 : if (PyErr_Occurred() != NULL) {
4877 0 : return -1;
4878 : }
4879 0 : if (test_var > uint_max) {
4880 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4881 : PyLong_Type.tp_name, uint_max, test_var);
4882 0 : return -1;
4883 : }
4884 0 : object->pac_size = test_var;
4885 : } else {
4886 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4887 : PyLong_Type.tp_name);
4888 0 : return -1;
4889 : }
4890 : }
4891 0 : return 0;
4892 : }
4893 :
4894 0 : static PyObject *py_netr_PacInfo_get_pac(PyObject *obj, void *closure)
4895 : {
4896 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
4897 : PyObject *py_pac;
4898 0 : if (object->pac == NULL) {
4899 0 : Py_RETURN_NONE;
4900 : }
4901 0 : if (object->pac == NULL) {
4902 0 : py_pac = Py_None;
4903 0 : Py_INCREF(py_pac);
4904 : } else {
4905 0 : py_pac = PyList_New(object->pac_size);
4906 0 : if (py_pac == NULL) {
4907 0 : return NULL;
4908 : }
4909 : {
4910 : int pac_cntr_1;
4911 0 : for (pac_cntr_1 = 0; pac_cntr_1 < (object->pac_size); pac_cntr_1++) {
4912 : PyObject *py_pac_1;
4913 0 : py_pac_1 = PyLong_FromLong((uint16_t)object->pac[pac_cntr_1]);
4914 0 : PyList_SetItem(py_pac, pac_cntr_1, py_pac_1);
4915 : }
4916 : }
4917 : }
4918 0 : return py_pac;
4919 : }
4920 :
4921 0 : static int py_netr_PacInfo_set_pac(PyObject *py_obj, PyObject *value, void *closure)
4922 : {
4923 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
4924 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pac));
4925 0 : if (value == NULL) {
4926 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pac");
4927 0 : return -1;
4928 : }
4929 0 : if (value == Py_None) {
4930 0 : object->pac = NULL;
4931 : } else {
4932 0 : object->pac = NULL;
4933 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4934 : {
4935 : int pac_cntr_1;
4936 0 : object->pac = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pac, PyList_GET_SIZE(value));
4937 0 : if (!object->pac) { return -1;; }
4938 0 : talloc_set_name_const(object->pac, "ARRAY: object->pac");
4939 0 : for (pac_cntr_1 = 0; pac_cntr_1 < PyList_GET_SIZE(value); pac_cntr_1++) {
4940 0 : if (PyList_GET_ITEM(value, pac_cntr_1) == NULL) {
4941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pac[pac_cntr_1]");
4942 0 : return -1;
4943 : }
4944 : {
4945 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pac[pac_cntr_1]));
4946 0 : if (PyLong_Check(PyList_GET_ITEM(value, pac_cntr_1))) {
4947 : unsigned long long test_var;
4948 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pac_cntr_1));
4949 0 : if (PyErr_Occurred() != NULL) {
4950 0 : return -1;
4951 : }
4952 0 : if (test_var > uint_max) {
4953 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4954 : PyLong_Type.tp_name, uint_max, test_var);
4955 0 : return -1;
4956 : }
4957 0 : object->pac[pac_cntr_1] = test_var;
4958 : } else {
4959 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4960 : PyLong_Type.tp_name);
4961 0 : return -1;
4962 : }
4963 : }
4964 : }
4965 : }
4966 : }
4967 0 : return 0;
4968 : }
4969 :
4970 0 : static PyObject *py_netr_PacInfo_get_logon_domain(PyObject *obj, void *closure)
4971 : {
4972 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
4973 : PyObject *py_logon_domain;
4974 0 : py_logon_domain = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_domain);
4975 0 : return py_logon_domain;
4976 : }
4977 :
4978 0 : static int py_netr_PacInfo_set_logon_domain(PyObject *py_obj, PyObject *value, void *closure)
4979 : {
4980 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
4981 0 : if (value == NULL) {
4982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_domain");
4983 0 : return -1;
4984 : }
4985 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4986 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4987 0 : PyErr_NoMemory();
4988 0 : return -1;
4989 : }
4990 0 : object->logon_domain = *(struct lsa_String *)pytalloc_get_ptr(value);
4991 0 : return 0;
4992 : }
4993 :
4994 0 : static PyObject *py_netr_PacInfo_get_logon_server(PyObject *obj, void *closure)
4995 : {
4996 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
4997 : PyObject *py_logon_server;
4998 0 : py_logon_server = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_server);
4999 0 : return py_logon_server;
5000 : }
5001 :
5002 0 : static int py_netr_PacInfo_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
5003 : {
5004 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5005 0 : if (value == NULL) {
5006 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_server");
5007 0 : return -1;
5008 : }
5009 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5010 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5011 0 : PyErr_NoMemory();
5012 0 : return -1;
5013 : }
5014 0 : object->logon_server = *(struct lsa_String *)pytalloc_get_ptr(value);
5015 0 : return 0;
5016 : }
5017 :
5018 0 : static PyObject *py_netr_PacInfo_get_principal_name(PyObject *obj, void *closure)
5019 : {
5020 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5021 : PyObject *py_principal_name;
5022 0 : py_principal_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->principal_name);
5023 0 : return py_principal_name;
5024 : }
5025 :
5026 0 : static int py_netr_PacInfo_set_principal_name(PyObject *py_obj, PyObject *value, void *closure)
5027 : {
5028 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5029 0 : if (value == NULL) {
5030 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->principal_name");
5031 0 : return -1;
5032 : }
5033 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5034 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5035 0 : PyErr_NoMemory();
5036 0 : return -1;
5037 : }
5038 0 : object->principal_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5039 0 : return 0;
5040 : }
5041 :
5042 0 : static PyObject *py_netr_PacInfo_get_auth_size(PyObject *obj, void *closure)
5043 : {
5044 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5045 : PyObject *py_auth_size;
5046 0 : py_auth_size = PyLong_FromUnsignedLongLong((uint32_t)object->auth_size);
5047 0 : return py_auth_size;
5048 : }
5049 :
5050 0 : static int py_netr_PacInfo_set_auth_size(PyObject *py_obj, PyObject *value, void *closure)
5051 : {
5052 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5053 0 : if (value == NULL) {
5054 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_size");
5055 0 : return -1;
5056 : }
5057 : {
5058 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_size));
5059 0 : if (PyLong_Check(value)) {
5060 : unsigned long long test_var;
5061 0 : test_var = PyLong_AsUnsignedLongLong(value);
5062 0 : if (PyErr_Occurred() != NULL) {
5063 0 : return -1;
5064 : }
5065 0 : if (test_var > uint_max) {
5066 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5067 : PyLong_Type.tp_name, uint_max, test_var);
5068 0 : return -1;
5069 : }
5070 0 : object->auth_size = test_var;
5071 : } else {
5072 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5073 : PyLong_Type.tp_name);
5074 0 : return -1;
5075 : }
5076 : }
5077 0 : return 0;
5078 : }
5079 :
5080 0 : static PyObject *py_netr_PacInfo_get_auth(PyObject *obj, void *closure)
5081 : {
5082 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5083 : PyObject *py_auth;
5084 0 : if (object->auth == NULL) {
5085 0 : Py_RETURN_NONE;
5086 : }
5087 0 : if (object->auth == NULL) {
5088 0 : py_auth = Py_None;
5089 0 : Py_INCREF(py_auth);
5090 : } else {
5091 0 : py_auth = PyList_New(object->auth_size);
5092 0 : if (py_auth == NULL) {
5093 0 : return NULL;
5094 : }
5095 : {
5096 : int auth_cntr_1;
5097 0 : for (auth_cntr_1 = 0; auth_cntr_1 < (object->auth_size); auth_cntr_1++) {
5098 : PyObject *py_auth_1;
5099 0 : py_auth_1 = PyLong_FromLong((uint16_t)object->auth[auth_cntr_1]);
5100 0 : PyList_SetItem(py_auth, auth_cntr_1, py_auth_1);
5101 : }
5102 : }
5103 : }
5104 0 : return py_auth;
5105 : }
5106 :
5107 0 : static int py_netr_PacInfo_set_auth(PyObject *py_obj, PyObject *value, void *closure)
5108 : {
5109 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5110 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->auth));
5111 0 : if (value == NULL) {
5112 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth");
5113 0 : return -1;
5114 : }
5115 0 : if (value == Py_None) {
5116 0 : object->auth = NULL;
5117 : } else {
5118 0 : object->auth = NULL;
5119 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5120 : {
5121 : int auth_cntr_1;
5122 0 : object->auth = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->auth, PyList_GET_SIZE(value));
5123 0 : if (!object->auth) { return -1;; }
5124 0 : talloc_set_name_const(object->auth, "ARRAY: object->auth");
5125 0 : for (auth_cntr_1 = 0; auth_cntr_1 < PyList_GET_SIZE(value); auth_cntr_1++) {
5126 0 : if (PyList_GET_ITEM(value, auth_cntr_1) == NULL) {
5127 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth[auth_cntr_1]");
5128 0 : return -1;
5129 : }
5130 : {
5131 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth[auth_cntr_1]));
5132 0 : if (PyLong_Check(PyList_GET_ITEM(value, auth_cntr_1))) {
5133 : unsigned long long test_var;
5134 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, auth_cntr_1));
5135 0 : if (PyErr_Occurred() != NULL) {
5136 0 : return -1;
5137 : }
5138 0 : if (test_var > uint_max) {
5139 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5140 : PyLong_Type.tp_name, uint_max, test_var);
5141 0 : return -1;
5142 : }
5143 0 : object->auth[auth_cntr_1] = test_var;
5144 : } else {
5145 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5146 : PyLong_Type.tp_name);
5147 0 : return -1;
5148 : }
5149 : }
5150 : }
5151 : }
5152 : }
5153 0 : return 0;
5154 : }
5155 :
5156 0 : static PyObject *py_netr_PacInfo_get_user_session_key(PyObject *obj, void *closure)
5157 : {
5158 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5159 : PyObject *py_user_session_key;
5160 0 : py_user_session_key = pytalloc_reference_ex(&netr_UserSessionKey_Type, pytalloc_get_mem_ctx(obj), &object->user_session_key);
5161 0 : return py_user_session_key;
5162 : }
5163 :
5164 0 : static int py_netr_PacInfo_set_user_session_key(PyObject *py_obj, PyObject *value, void *closure)
5165 : {
5166 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5167 0 : if (value == NULL) {
5168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_session_key");
5169 0 : return -1;
5170 : }
5171 0 : PY_CHECK_TYPE(&netr_UserSessionKey_Type, value, return -1;);
5172 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5173 0 : PyErr_NoMemory();
5174 0 : return -1;
5175 : }
5176 0 : object->user_session_key = *(struct netr_UserSessionKey *)pytalloc_get_ptr(value);
5177 0 : return 0;
5178 : }
5179 :
5180 0 : static PyObject *py_netr_PacInfo_get_expansionroom(PyObject *obj, void *closure)
5181 : {
5182 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5183 : PyObject *py_expansionroom;
5184 0 : py_expansionroom = PyList_New(10);
5185 0 : if (py_expansionroom == NULL) {
5186 0 : return NULL;
5187 : }
5188 : {
5189 : int expansionroom_cntr_0;
5190 0 : for (expansionroom_cntr_0 = 0; expansionroom_cntr_0 < (10); expansionroom_cntr_0++) {
5191 : PyObject *py_expansionroom_0;
5192 0 : py_expansionroom_0 = PyLong_FromUnsignedLongLong((uint32_t)object->expansionroom[expansionroom_cntr_0]);
5193 0 : PyList_SetItem(py_expansionroom, expansionroom_cntr_0, py_expansionroom_0);
5194 : }
5195 : }
5196 0 : return py_expansionroom;
5197 : }
5198 :
5199 0 : static int py_netr_PacInfo_set_expansionroom(PyObject *py_obj, PyObject *value, void *closure)
5200 : {
5201 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5202 0 : if (value == NULL) {
5203 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->expansionroom");
5204 0 : return -1;
5205 : }
5206 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5207 : {
5208 : int expansionroom_cntr_0;
5209 0 : if (ARRAY_SIZE(object->expansionroom) != PyList_GET_SIZE(value)) {
5210 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->expansionroom), PyList_GET_SIZE(value));
5211 0 : return -1;
5212 : }
5213 0 : for (expansionroom_cntr_0 = 0; expansionroom_cntr_0 < PyList_GET_SIZE(value); expansionroom_cntr_0++) {
5214 0 : if (PyList_GET_ITEM(value, expansionroom_cntr_0) == NULL) {
5215 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->expansionroom[expansionroom_cntr_0]");
5216 0 : return -1;
5217 : }
5218 : {
5219 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->expansionroom[expansionroom_cntr_0]));
5220 0 : if (PyLong_Check(PyList_GET_ITEM(value, expansionroom_cntr_0))) {
5221 : unsigned long long test_var;
5222 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, expansionroom_cntr_0));
5223 0 : if (PyErr_Occurred() != NULL) {
5224 0 : return -1;
5225 : }
5226 0 : if (test_var > uint_max) {
5227 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5228 : PyLong_Type.tp_name, uint_max, test_var);
5229 0 : return -1;
5230 : }
5231 0 : object->expansionroom[expansionroom_cntr_0] = test_var;
5232 : } else {
5233 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5234 : PyLong_Type.tp_name);
5235 0 : return -1;
5236 : }
5237 : }
5238 : }
5239 : }
5240 0 : return 0;
5241 : }
5242 :
5243 0 : static PyObject *py_netr_PacInfo_get_unknown1(PyObject *obj, void *closure)
5244 : {
5245 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5246 : PyObject *py_unknown1;
5247 0 : py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1);
5248 0 : return py_unknown1;
5249 : }
5250 :
5251 0 : static int py_netr_PacInfo_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
5252 : {
5253 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5254 0 : if (value == NULL) {
5255 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
5256 0 : return -1;
5257 : }
5258 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5259 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5260 0 : PyErr_NoMemory();
5261 0 : return -1;
5262 : }
5263 0 : object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value);
5264 0 : return 0;
5265 : }
5266 :
5267 0 : static PyObject *py_netr_PacInfo_get_unknown2(PyObject *obj, void *closure)
5268 : {
5269 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5270 : PyObject *py_unknown2;
5271 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
5272 0 : return py_unknown2;
5273 : }
5274 :
5275 0 : static int py_netr_PacInfo_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
5276 : {
5277 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5278 0 : if (value == NULL) {
5279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
5280 0 : return -1;
5281 : }
5282 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5283 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5284 0 : PyErr_NoMemory();
5285 0 : return -1;
5286 : }
5287 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
5288 0 : return 0;
5289 : }
5290 :
5291 0 : static PyObject *py_netr_PacInfo_get_unknown3(PyObject *obj, void *closure)
5292 : {
5293 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5294 : PyObject *py_unknown3;
5295 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
5296 0 : return py_unknown3;
5297 : }
5298 :
5299 0 : static int py_netr_PacInfo_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
5300 : {
5301 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5302 0 : if (value == NULL) {
5303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
5304 0 : return -1;
5305 : }
5306 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5307 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5308 0 : PyErr_NoMemory();
5309 0 : return -1;
5310 : }
5311 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
5312 0 : return 0;
5313 : }
5314 :
5315 0 : static PyObject *py_netr_PacInfo_get_unknown4(PyObject *obj, void *closure)
5316 : {
5317 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(obj);
5318 : PyObject *py_unknown4;
5319 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
5320 0 : return py_unknown4;
5321 : }
5322 :
5323 0 : static int py_netr_PacInfo_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
5324 : {
5325 0 : struct netr_PacInfo *object = (struct netr_PacInfo *)pytalloc_get_ptr(py_obj);
5326 0 : if (value == NULL) {
5327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
5328 0 : return -1;
5329 : }
5330 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5331 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5332 0 : PyErr_NoMemory();
5333 0 : return -1;
5334 : }
5335 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
5336 0 : return 0;
5337 : }
5338 :
5339 : static PyGetSetDef py_netr_PacInfo_getsetters[] = {
5340 : {
5341 : .name = discard_const_p(char, "pac_size"),
5342 : .get = py_netr_PacInfo_get_pac_size,
5343 : .set = py_netr_PacInfo_set_pac_size,
5344 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5345 : },
5346 : {
5347 : .name = discard_const_p(char, "pac"),
5348 : .get = py_netr_PacInfo_get_pac,
5349 : .set = py_netr_PacInfo_set_pac,
5350 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5351 : },
5352 : {
5353 : .name = discard_const_p(char, "logon_domain"),
5354 : .get = py_netr_PacInfo_get_logon_domain,
5355 : .set = py_netr_PacInfo_set_logon_domain,
5356 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5357 : },
5358 : {
5359 : .name = discard_const_p(char, "logon_server"),
5360 : .get = py_netr_PacInfo_get_logon_server,
5361 : .set = py_netr_PacInfo_set_logon_server,
5362 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5363 : },
5364 : {
5365 : .name = discard_const_p(char, "principal_name"),
5366 : .get = py_netr_PacInfo_get_principal_name,
5367 : .set = py_netr_PacInfo_set_principal_name,
5368 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5369 : },
5370 : {
5371 : .name = discard_const_p(char, "auth_size"),
5372 : .get = py_netr_PacInfo_get_auth_size,
5373 : .set = py_netr_PacInfo_set_auth_size,
5374 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5375 : },
5376 : {
5377 : .name = discard_const_p(char, "auth"),
5378 : .get = py_netr_PacInfo_get_auth,
5379 : .set = py_netr_PacInfo_set_auth,
5380 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5381 : },
5382 : {
5383 : .name = discard_const_p(char, "user_session_key"),
5384 : .get = py_netr_PacInfo_get_user_session_key,
5385 : .set = py_netr_PacInfo_set_user_session_key,
5386 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UserSessionKey")
5387 : },
5388 : {
5389 : .name = discard_const_p(char, "expansionroom"),
5390 : .get = py_netr_PacInfo_get_expansionroom,
5391 : .set = py_netr_PacInfo_set_expansionroom,
5392 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5393 : },
5394 : {
5395 : .name = discard_const_p(char, "unknown1"),
5396 : .get = py_netr_PacInfo_get_unknown1,
5397 : .set = py_netr_PacInfo_set_unknown1,
5398 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5399 : },
5400 : {
5401 : .name = discard_const_p(char, "unknown2"),
5402 : .get = py_netr_PacInfo_get_unknown2,
5403 : .set = py_netr_PacInfo_set_unknown2,
5404 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5405 : },
5406 : {
5407 : .name = discard_const_p(char, "unknown3"),
5408 : .get = py_netr_PacInfo_get_unknown3,
5409 : .set = py_netr_PacInfo_set_unknown3,
5410 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5411 : },
5412 : {
5413 : .name = discard_const_p(char, "unknown4"),
5414 : .get = py_netr_PacInfo_get_unknown4,
5415 : .set = py_netr_PacInfo_set_unknown4,
5416 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5417 : },
5418 : { .name = NULL }
5419 : };
5420 :
5421 0 : static PyObject *py_netr_PacInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5422 : {
5423 0 : return pytalloc_new(struct netr_PacInfo, type);
5424 : }
5425 :
5426 :
5427 : static PyTypeObject netr_PacInfo_Type = {
5428 : PyVarObject_HEAD_INIT(NULL, 0)
5429 : .tp_name = "netlogon.netr_PacInfo",
5430 : .tp_getset = py_netr_PacInfo_getsetters,
5431 : .tp_methods = NULL,
5432 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5433 : .tp_new = py_netr_PacInfo_new,
5434 : };
5435 :
5436 :
5437 0 : static PyObject *py_netr_GenericInfo2_get_length(PyObject *obj, void *closure)
5438 : {
5439 0 : struct netr_GenericInfo2 *object = (struct netr_GenericInfo2 *)pytalloc_get_ptr(obj);
5440 : PyObject *py_length;
5441 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
5442 0 : return py_length;
5443 : }
5444 :
5445 0 : static int py_netr_GenericInfo2_set_length(PyObject *py_obj, PyObject *value, void *closure)
5446 : {
5447 0 : struct netr_GenericInfo2 *object = (struct netr_GenericInfo2 *)pytalloc_get_ptr(py_obj);
5448 0 : if (value == NULL) {
5449 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
5450 0 : return -1;
5451 : }
5452 : {
5453 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
5454 0 : if (PyLong_Check(value)) {
5455 : unsigned long long test_var;
5456 0 : test_var = PyLong_AsUnsignedLongLong(value);
5457 0 : if (PyErr_Occurred() != NULL) {
5458 0 : return -1;
5459 : }
5460 0 : if (test_var > uint_max) {
5461 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5462 : PyLong_Type.tp_name, uint_max, test_var);
5463 0 : return -1;
5464 : }
5465 0 : object->length = test_var;
5466 : } else {
5467 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5468 : PyLong_Type.tp_name);
5469 0 : return -1;
5470 : }
5471 : }
5472 0 : return 0;
5473 : }
5474 :
5475 0 : static PyObject *py_netr_GenericInfo2_get_data(PyObject *obj, void *closure)
5476 : {
5477 0 : struct netr_GenericInfo2 *object = (struct netr_GenericInfo2 *)pytalloc_get_ptr(obj);
5478 : PyObject *py_data;
5479 0 : if (object->data == NULL) {
5480 0 : Py_RETURN_NONE;
5481 : }
5482 0 : if (object->data == NULL) {
5483 0 : py_data = Py_None;
5484 0 : Py_INCREF(py_data);
5485 : } else {
5486 0 : py_data = PyList_New(object->length);
5487 0 : if (py_data == NULL) {
5488 0 : return NULL;
5489 : }
5490 : {
5491 : int data_cntr_1;
5492 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
5493 : PyObject *py_data_1;
5494 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
5495 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
5496 : }
5497 : }
5498 : }
5499 0 : return py_data;
5500 : }
5501 :
5502 0 : static int py_netr_GenericInfo2_set_data(PyObject *py_obj, PyObject *value, void *closure)
5503 : {
5504 0 : struct netr_GenericInfo2 *object = (struct netr_GenericInfo2 *)pytalloc_get_ptr(py_obj);
5505 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
5506 0 : if (value == NULL) {
5507 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
5508 0 : return -1;
5509 : }
5510 0 : if (value == Py_None) {
5511 0 : object->data = NULL;
5512 : } else {
5513 0 : object->data = NULL;
5514 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5515 : {
5516 : int data_cntr_1;
5517 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
5518 0 : if (!object->data) { return -1;; }
5519 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
5520 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
5521 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
5522 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
5523 0 : return -1;
5524 : }
5525 : {
5526 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
5527 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
5528 : unsigned long long test_var;
5529 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
5530 0 : if (PyErr_Occurred() != NULL) {
5531 0 : return -1;
5532 : }
5533 0 : if (test_var > uint_max) {
5534 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5535 : PyLong_Type.tp_name, uint_max, test_var);
5536 0 : return -1;
5537 : }
5538 0 : object->data[data_cntr_1] = test_var;
5539 : } else {
5540 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5541 : PyLong_Type.tp_name);
5542 0 : return -1;
5543 : }
5544 : }
5545 : }
5546 : }
5547 : }
5548 0 : return 0;
5549 : }
5550 :
5551 : static PyGetSetDef py_netr_GenericInfo2_getsetters[] = {
5552 : {
5553 : .name = discard_const_p(char, "length"),
5554 : .get = py_netr_GenericInfo2_get_length,
5555 : .set = py_netr_GenericInfo2_set_length,
5556 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5557 : },
5558 : {
5559 : .name = discard_const_p(char, "data"),
5560 : .get = py_netr_GenericInfo2_get_data,
5561 : .set = py_netr_GenericInfo2_set_data,
5562 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5563 : },
5564 : { .name = NULL }
5565 : };
5566 :
5567 0 : static PyObject *py_netr_GenericInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5568 : {
5569 0 : return pytalloc_new(struct netr_GenericInfo2, type);
5570 : }
5571 :
5572 :
5573 : static PyTypeObject netr_GenericInfo2_Type = {
5574 : PyVarObject_HEAD_INIT(NULL, 0)
5575 : .tp_name = "netlogon.netr_GenericInfo2",
5576 : .tp_getset = py_netr_GenericInfo2_getsetters,
5577 : .tp_methods = NULL,
5578 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5579 : .tp_new = py_netr_GenericInfo2_new,
5580 : };
5581 :
5582 18 : static PyObject *py_import_netr_Validation(TALLOC_CTX *mem_ctx, int level, union netr_Validation *in)
5583 : {
5584 : PyObject *ret;
5585 :
5586 18 : switch (level) {
5587 0 : case NetlogonValidationSamInfo:
5588 0 : if (in->sam2 == NULL) {
5589 0 : ret = Py_None;
5590 0 : Py_INCREF(ret);
5591 : } else {
5592 0 : ret = pytalloc_reference_ex(&netr_SamInfo2_Type, in->sam2, in->sam2);
5593 : }
5594 0 : return ret;
5595 :
5596 0 : case NetlogonValidationSamInfo2:
5597 0 : if (in->sam3 == NULL) {
5598 0 : ret = Py_None;
5599 0 : Py_INCREF(ret);
5600 : } else {
5601 0 : ret = pytalloc_reference_ex(&netr_SamInfo3_Type, in->sam3, in->sam3);
5602 : }
5603 0 : return ret;
5604 :
5605 0 : case 4:
5606 0 : if (in->pac == NULL) {
5607 0 : ret = Py_None;
5608 0 : Py_INCREF(ret);
5609 : } else {
5610 0 : ret = pytalloc_reference_ex(&netr_PacInfo_Type, in->pac, in->pac);
5611 : }
5612 0 : return ret;
5613 :
5614 0 : case NetlogonValidationGenericInfo2:
5615 0 : if (in->generic == NULL) {
5616 0 : ret = Py_None;
5617 0 : Py_INCREF(ret);
5618 : } else {
5619 0 : ret = pytalloc_reference_ex(&netr_GenericInfo2_Type, in->generic, in->generic);
5620 : }
5621 0 : return ret;
5622 :
5623 18 : case NetlogonValidationSamInfo4:
5624 18 : if (in->sam6 == NULL) {
5625 3 : ret = Py_None;
5626 3 : Py_INCREF(ret);
5627 : } else {
5628 15 : ret = pytalloc_reference_ex(&netr_SamInfo6_Type, in->sam6, in->sam6);
5629 : }
5630 18 : return ret;
5631 :
5632 0 : default:
5633 0 : ret = Py_None;
5634 0 : Py_INCREF(ret);
5635 0 : return ret;
5636 :
5637 : }
5638 : PyErr_SetString(PyExc_TypeError, "unknown union level");
5639 : return NULL;
5640 : }
5641 :
5642 0 : static union netr_Validation *py_export_netr_Validation(TALLOC_CTX *mem_ctx, int level, PyObject *in)
5643 : {
5644 0 : union netr_Validation *ret = talloc_zero(mem_ctx, union netr_Validation);
5645 0 : switch (level) {
5646 0 : case NetlogonValidationSamInfo:
5647 0 : if (in == NULL) {
5648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sam2");
5649 0 : talloc_free(ret); return NULL;
5650 : }
5651 0 : if (in == Py_None) {
5652 0 : ret->sam2 = NULL;
5653 : } else {
5654 0 : ret->sam2 = NULL;
5655 0 : PY_CHECK_TYPE(&netr_SamInfo2_Type, in, talloc_free(ret); return NULL;);
5656 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5657 0 : PyErr_NoMemory();
5658 0 : talloc_free(ret); return NULL;
5659 : }
5660 0 : ret->sam2 = (struct netr_SamInfo2 *)pytalloc_get_ptr(in);
5661 : }
5662 0 : break;
5663 :
5664 0 : case NetlogonValidationSamInfo2:
5665 0 : if (in == NULL) {
5666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sam3");
5667 0 : talloc_free(ret); return NULL;
5668 : }
5669 0 : if (in == Py_None) {
5670 0 : ret->sam3 = NULL;
5671 : } else {
5672 0 : ret->sam3 = NULL;
5673 0 : PY_CHECK_TYPE(&netr_SamInfo3_Type, in, talloc_free(ret); return NULL;);
5674 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5675 0 : PyErr_NoMemory();
5676 0 : talloc_free(ret); return NULL;
5677 : }
5678 0 : ret->sam3 = (struct netr_SamInfo3 *)pytalloc_get_ptr(in);
5679 : }
5680 0 : break;
5681 :
5682 0 : case 4:
5683 0 : if (in == NULL) {
5684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pac");
5685 0 : talloc_free(ret); return NULL;
5686 : }
5687 0 : if (in == Py_None) {
5688 0 : ret->pac = NULL;
5689 : } else {
5690 0 : ret->pac = NULL;
5691 0 : PY_CHECK_TYPE(&netr_PacInfo_Type, in, talloc_free(ret); return NULL;);
5692 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5693 0 : PyErr_NoMemory();
5694 0 : talloc_free(ret); return NULL;
5695 : }
5696 0 : ret->pac = (struct netr_PacInfo *)pytalloc_get_ptr(in);
5697 : }
5698 0 : break;
5699 :
5700 0 : case NetlogonValidationGenericInfo2:
5701 0 : if (in == NULL) {
5702 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->generic");
5703 0 : talloc_free(ret); return NULL;
5704 : }
5705 0 : if (in == Py_None) {
5706 0 : ret->generic = NULL;
5707 : } else {
5708 0 : ret->generic = NULL;
5709 0 : PY_CHECK_TYPE(&netr_GenericInfo2_Type, in, talloc_free(ret); return NULL;);
5710 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5711 0 : PyErr_NoMemory();
5712 0 : talloc_free(ret); return NULL;
5713 : }
5714 0 : ret->generic = (struct netr_GenericInfo2 *)pytalloc_get_ptr(in);
5715 : }
5716 0 : break;
5717 :
5718 0 : case NetlogonValidationSamInfo4:
5719 0 : if (in == NULL) {
5720 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sam6");
5721 0 : talloc_free(ret); return NULL;
5722 : }
5723 0 : if (in == Py_None) {
5724 0 : ret->sam6 = NULL;
5725 : } else {
5726 0 : ret->sam6 = NULL;
5727 0 : PY_CHECK_TYPE(&netr_SamInfo6_Type, in, talloc_free(ret); return NULL;);
5728 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5729 0 : PyErr_NoMemory();
5730 0 : talloc_free(ret); return NULL;
5731 : }
5732 0 : ret->sam6 = (struct netr_SamInfo6 *)pytalloc_get_ptr(in);
5733 : }
5734 0 : break;
5735 :
5736 0 : default:
5737 0 : break;
5738 :
5739 : }
5740 :
5741 0 : return ret;
5742 : }
5743 :
5744 18 : static PyObject *py_netr_Validation_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5745 : {
5746 18 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5747 18 : PyObject *mem_ctx_obj = NULL;
5748 18 : TALLOC_CTX *mem_ctx = NULL;
5749 18 : int level = 0;
5750 18 : PyObject *in_obj = NULL;
5751 18 : union netr_Validation *in = NULL;
5752 :
5753 18 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
5754 : discard_const_p(char *, kwnames),
5755 : &mem_ctx_obj,
5756 : &level,
5757 : &in_obj)) {
5758 0 : return NULL;
5759 : }
5760 18 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5761 18 : if (mem_ctx == NULL) {
5762 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5763 0 : return NULL;
5764 : }
5765 18 : in = (union netr_Validation *)pytalloc_get_ptr(in_obj);
5766 18 : if (in == NULL) {
5767 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_Validation!");
5768 0 : return NULL;
5769 : }
5770 :
5771 18 : return py_import_netr_Validation(mem_ctx, level, in);
5772 : }
5773 :
5774 0 : static PyObject *py_netr_Validation_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5775 : {
5776 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
5777 0 : PyObject *mem_ctx_obj = NULL;
5778 0 : TALLOC_CTX *mem_ctx = NULL;
5779 0 : int level = 0;
5780 0 : PyObject *in = NULL;
5781 0 : union netr_Validation *out = NULL;
5782 :
5783 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
5784 : discard_const_p(char *, kwnames),
5785 : &mem_ctx_obj,
5786 : &level,
5787 : &in)) {
5788 0 : return NULL;
5789 : }
5790 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5791 0 : if (mem_ctx == NULL) {
5792 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5793 0 : return NULL;
5794 : }
5795 :
5796 0 : out = py_export_netr_Validation(mem_ctx, level, in);
5797 0 : if (out == NULL) {
5798 0 : return NULL;
5799 : }
5800 :
5801 0 : return pytalloc_GenericObject_reference(out);
5802 : }
5803 :
5804 : static PyMethodDef py_netr_Validation_methods[] = {
5805 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Validation_import),
5806 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5807 : "T.__import__(mem_ctx, level, in) => ret." },
5808 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Validation_export),
5809 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5810 : "T.__export__(mem_ctx, level, in) => ret." },
5811 : { NULL, NULL, 0, NULL }
5812 : };
5813 :
5814 0 : static PyObject *py_netr_Validation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5815 : {
5816 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5817 0 : return NULL;
5818 : }
5819 :
5820 :
5821 : static PyTypeObject netr_Validation_Type = {
5822 : PyVarObject_HEAD_INIT(NULL, 0)
5823 : .tp_name = "netlogon.netr_Validation",
5824 : .tp_getset = NULL,
5825 : .tp_methods = py_netr_Validation_methods,
5826 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5827 : .tp_new = py_netr_Validation_new,
5828 : };
5829 :
5830 :
5831 0 : static PyObject *py_netr_Credential_get_data(PyObject *obj, void *closure)
5832 : {
5833 0 : struct netr_Credential *object = (struct netr_Credential *)pytalloc_get_ptr(obj);
5834 : PyObject *py_data;
5835 0 : py_data = PyList_New(8);
5836 0 : if (py_data == NULL) {
5837 0 : return NULL;
5838 : }
5839 : {
5840 : int data_cntr_0;
5841 0 : for (data_cntr_0 = 0; data_cntr_0 < (8); data_cntr_0++) {
5842 : PyObject *py_data_0;
5843 0 : py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]);
5844 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
5845 : }
5846 : }
5847 0 : return py_data;
5848 : }
5849 :
5850 43 : static int py_netr_Credential_set_data(PyObject *py_obj, PyObject *value, void *closure)
5851 : {
5852 43 : struct netr_Credential *object = (struct netr_Credential *)pytalloc_get_ptr(py_obj);
5853 43 : if (value == NULL) {
5854 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
5855 0 : return -1;
5856 : }
5857 43 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5858 : {
5859 : int data_cntr_0;
5860 43 : if (ARRAY_SIZE(object->data) != PyList_GET_SIZE(value)) {
5861 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->data), PyList_GET_SIZE(value));
5862 0 : return -1;
5863 : }
5864 387 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
5865 344 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
5866 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
5867 0 : return -1;
5868 : }
5869 : {
5870 344 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0]));
5871 344 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
5872 : unsigned long long test_var;
5873 344 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
5874 344 : if (PyErr_Occurred() != NULL) {
5875 0 : return -1;
5876 : }
5877 344 : if (test_var > uint_max) {
5878 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5879 : PyLong_Type.tp_name, uint_max, test_var);
5880 0 : return -1;
5881 : }
5882 344 : object->data[data_cntr_0] = test_var;
5883 : } else {
5884 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5885 : PyLong_Type.tp_name);
5886 0 : return -1;
5887 : }
5888 : }
5889 : }
5890 : }
5891 43 : return 0;
5892 : }
5893 :
5894 : static PyGetSetDef py_netr_Credential_getsetters[] = {
5895 : {
5896 : .name = discard_const_p(char, "data"),
5897 : .get = py_netr_Credential_get_data,
5898 : .set = py_netr_Credential_set_data,
5899 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5900 : },
5901 : { .name = NULL }
5902 : };
5903 :
5904 2 : static PyObject *py_netr_Credential_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5905 : {
5906 2 : return pytalloc_new(struct netr_Credential, type);
5907 : }
5908 :
5909 0 : static PyObject *py_netr_Credential_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5910 : {
5911 0 : struct netr_Credential *object = (struct netr_Credential *)pytalloc_get_ptr(py_obj);
5912 0 : PyObject *ret = NULL;
5913 : DATA_BLOB blob;
5914 : enum ndr_err_code err;
5915 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5916 0 : if (tmp_ctx == NULL) {
5917 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5918 0 : return NULL;
5919 : }
5920 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_Credential);
5921 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5922 0 : TALLOC_FREE(tmp_ctx);
5923 0 : PyErr_SetNdrError(err);
5924 0 : return NULL;
5925 : }
5926 :
5927 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5928 0 : TALLOC_FREE(tmp_ctx);
5929 0 : return ret;
5930 : }
5931 :
5932 0 : static PyObject *py_netr_Credential_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5933 : {
5934 0 : struct netr_Credential *object = (struct netr_Credential *)pytalloc_get_ptr(py_obj);
5935 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5936 0 : Py_ssize_t blob_length = 0;
5937 : enum ndr_err_code err;
5938 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5939 0 : PyObject *allow_remaining_obj = NULL;
5940 0 : bool allow_remaining = false;
5941 :
5942 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5943 : discard_const_p(char *, kwnames),
5944 : &blob.data, &blob_length,
5945 : &allow_remaining_obj)) {
5946 0 : return NULL;
5947 : }
5948 0 : blob.length = blob_length;
5949 :
5950 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5951 0 : allow_remaining = true;
5952 : }
5953 :
5954 0 : if (allow_remaining) {
5955 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_Credential);
5956 : } else {
5957 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_Credential);
5958 : }
5959 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5960 0 : PyErr_SetNdrError(err);
5961 0 : return NULL;
5962 : }
5963 :
5964 0 : Py_RETURN_NONE;
5965 : }
5966 :
5967 0 : static PyObject *py_netr_Credential_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5968 : {
5969 0 : struct netr_Credential *object = (struct netr_Credential *)pytalloc_get_ptr(py_obj);
5970 : PyObject *ret;
5971 : char *retstr;
5972 :
5973 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_Credential, "netr_Credential", object);
5974 0 : ret = PyUnicode_FromString(retstr);
5975 0 : talloc_free(retstr);
5976 :
5977 0 : return ret;
5978 : }
5979 :
5980 : static PyMethodDef py_netr_Credential_methods[] = {
5981 : { "__ndr_pack__", (PyCFunction)py_netr_Credential_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5982 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Credential_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5983 : { "__ndr_print__", (PyCFunction)py_netr_Credential_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5984 : { NULL, NULL, 0, NULL }
5985 : };
5986 :
5987 :
5988 : static PyTypeObject netr_Credential_Type = {
5989 : PyVarObject_HEAD_INIT(NULL, 0)
5990 : .tp_name = "netlogon.netr_Credential",
5991 : .tp_getset = py_netr_Credential_getsetters,
5992 : .tp_methods = py_netr_Credential_methods,
5993 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5994 : .tp_new = py_netr_Credential_new,
5995 : };
5996 :
5997 :
5998 0 : static PyObject *py_netlogon_server_pipe_state_get_client_challenge(PyObject *obj, void *closure)
5999 : {
6000 0 : struct netlogon_server_pipe_state *object = (struct netlogon_server_pipe_state *)pytalloc_get_ptr(obj);
6001 : PyObject *py_client_challenge;
6002 0 : py_client_challenge = pytalloc_reference_ex(&netr_Credential_Type, pytalloc_get_mem_ctx(obj), &object->client_challenge);
6003 0 : return py_client_challenge;
6004 : }
6005 :
6006 0 : static int py_netlogon_server_pipe_state_set_client_challenge(PyObject *py_obj, PyObject *value, void *closure)
6007 : {
6008 0 : struct netlogon_server_pipe_state *object = (struct netlogon_server_pipe_state *)pytalloc_get_ptr(py_obj);
6009 0 : if (value == NULL) {
6010 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_challenge");
6011 0 : return -1;
6012 : }
6013 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
6014 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6015 0 : PyErr_NoMemory();
6016 0 : return -1;
6017 : }
6018 0 : object->client_challenge = *(struct netr_Credential *)pytalloc_get_ptr(value);
6019 0 : return 0;
6020 : }
6021 :
6022 0 : static PyObject *py_netlogon_server_pipe_state_get_server_challenge(PyObject *obj, void *closure)
6023 : {
6024 0 : struct netlogon_server_pipe_state *object = (struct netlogon_server_pipe_state *)pytalloc_get_ptr(obj);
6025 : PyObject *py_server_challenge;
6026 0 : py_server_challenge = pytalloc_reference_ex(&netr_Credential_Type, pytalloc_get_mem_ctx(obj), &object->server_challenge);
6027 0 : return py_server_challenge;
6028 : }
6029 :
6030 0 : static int py_netlogon_server_pipe_state_set_server_challenge(PyObject *py_obj, PyObject *value, void *closure)
6031 : {
6032 0 : struct netlogon_server_pipe_state *object = (struct netlogon_server_pipe_state *)pytalloc_get_ptr(py_obj);
6033 0 : if (value == NULL) {
6034 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->server_challenge");
6035 0 : return -1;
6036 : }
6037 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
6038 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6039 0 : PyErr_NoMemory();
6040 0 : return -1;
6041 : }
6042 0 : object->server_challenge = *(struct netr_Credential *)pytalloc_get_ptr(value);
6043 0 : return 0;
6044 : }
6045 :
6046 : static PyGetSetDef py_netlogon_server_pipe_state_getsetters[] = {
6047 : {
6048 : .name = discard_const_p(char, "client_challenge"),
6049 : .get = py_netlogon_server_pipe_state_get_client_challenge,
6050 : .set = py_netlogon_server_pipe_state_set_client_challenge,
6051 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
6052 : },
6053 : {
6054 : .name = discard_const_p(char, "server_challenge"),
6055 : .get = py_netlogon_server_pipe_state_get_server_challenge,
6056 : .set = py_netlogon_server_pipe_state_set_server_challenge,
6057 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
6058 : },
6059 : { .name = NULL }
6060 : };
6061 :
6062 0 : static PyObject *py_netlogon_server_pipe_state_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6063 : {
6064 0 : return pytalloc_new(struct netlogon_server_pipe_state, type);
6065 : }
6066 :
6067 0 : static PyObject *py_netlogon_server_pipe_state_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6068 : {
6069 0 : struct netlogon_server_pipe_state *object = (struct netlogon_server_pipe_state *)pytalloc_get_ptr(py_obj);
6070 0 : PyObject *ret = NULL;
6071 : DATA_BLOB blob;
6072 : enum ndr_err_code err;
6073 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6074 0 : if (tmp_ctx == NULL) {
6075 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6076 0 : return NULL;
6077 : }
6078 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netlogon_server_pipe_state);
6079 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6080 0 : TALLOC_FREE(tmp_ctx);
6081 0 : PyErr_SetNdrError(err);
6082 0 : return NULL;
6083 : }
6084 :
6085 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6086 0 : TALLOC_FREE(tmp_ctx);
6087 0 : return ret;
6088 : }
6089 :
6090 0 : static PyObject *py_netlogon_server_pipe_state_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6091 : {
6092 0 : struct netlogon_server_pipe_state *object = (struct netlogon_server_pipe_state *)pytalloc_get_ptr(py_obj);
6093 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6094 0 : Py_ssize_t blob_length = 0;
6095 : enum ndr_err_code err;
6096 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6097 0 : PyObject *allow_remaining_obj = NULL;
6098 0 : bool allow_remaining = false;
6099 :
6100 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6101 : discard_const_p(char *, kwnames),
6102 : &blob.data, &blob_length,
6103 : &allow_remaining_obj)) {
6104 0 : return NULL;
6105 : }
6106 0 : blob.length = blob_length;
6107 :
6108 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6109 0 : allow_remaining = true;
6110 : }
6111 :
6112 0 : if (allow_remaining) {
6113 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netlogon_server_pipe_state);
6114 : } else {
6115 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netlogon_server_pipe_state);
6116 : }
6117 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6118 0 : PyErr_SetNdrError(err);
6119 0 : return NULL;
6120 : }
6121 :
6122 0 : Py_RETURN_NONE;
6123 : }
6124 :
6125 0 : static PyObject *py_netlogon_server_pipe_state_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6126 : {
6127 0 : struct netlogon_server_pipe_state *object = (struct netlogon_server_pipe_state *)pytalloc_get_ptr(py_obj);
6128 : PyObject *ret;
6129 : char *retstr;
6130 :
6131 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netlogon_server_pipe_state, "netlogon_server_pipe_state", object);
6132 0 : ret = PyUnicode_FromString(retstr);
6133 0 : talloc_free(retstr);
6134 :
6135 0 : return ret;
6136 : }
6137 :
6138 : static PyMethodDef py_netlogon_server_pipe_state_methods[] = {
6139 : { "__ndr_pack__", (PyCFunction)py_netlogon_server_pipe_state_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6140 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netlogon_server_pipe_state_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6141 : { "__ndr_print__", (PyCFunction)py_netlogon_server_pipe_state_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6142 : { NULL, NULL, 0, NULL }
6143 : };
6144 :
6145 :
6146 : static PyTypeObject netlogon_server_pipe_state_Type = {
6147 : PyVarObject_HEAD_INIT(NULL, 0)
6148 : .tp_name = "netlogon.server_pipe_state",
6149 : .tp_getset = py_netlogon_server_pipe_state_getsetters,
6150 : .tp_methods = py_netlogon_server_pipe_state_methods,
6151 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6152 : .tp_new = py_netlogon_server_pipe_state_new,
6153 : };
6154 :
6155 :
6156 43 : static PyObject *py_netr_Authenticator_get_cred(PyObject *obj, void *closure)
6157 : {
6158 43 : struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(obj);
6159 : PyObject *py_cred;
6160 43 : py_cred = pytalloc_reference_ex(&netr_Credential_Type, pytalloc_get_mem_ctx(obj), &object->cred);
6161 43 : return py_cred;
6162 : }
6163 :
6164 0 : static int py_netr_Authenticator_set_cred(PyObject *py_obj, PyObject *value, void *closure)
6165 : {
6166 0 : struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(py_obj);
6167 0 : if (value == NULL) {
6168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cred");
6169 0 : return -1;
6170 : }
6171 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
6172 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6173 0 : PyErr_NoMemory();
6174 0 : return -1;
6175 : }
6176 0 : object->cred = *(struct netr_Credential *)pytalloc_get_ptr(value);
6177 0 : return 0;
6178 : }
6179 :
6180 0 : static PyObject *py_netr_Authenticator_get_timestamp(PyObject *obj, void *closure)
6181 : {
6182 0 : struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(obj);
6183 : PyObject *py_timestamp;
6184 0 : py_timestamp = PyLong_FromLong(object->timestamp);
6185 0 : return py_timestamp;
6186 : }
6187 :
6188 43 : static int py_netr_Authenticator_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
6189 : {
6190 43 : struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(py_obj);
6191 43 : if (value == NULL) {
6192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timestamp");
6193 0 : return -1;
6194 : }
6195 : {
6196 43 : const long long int_max = ndr_sizeof2intmax(sizeof(object->timestamp));
6197 43 : const long long int_min = -int_max - 1;
6198 43 : if (PyLong_Check(value)) {
6199 : long long test_var;
6200 43 : test_var = PyLong_AsLongLong(value);
6201 43 : if (PyErr_Occurred() != NULL) {
6202 0 : return -1;
6203 : }
6204 43 : if (test_var < int_min || test_var > int_max) {
6205 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
6206 : PyLong_Type.tp_name, int_min, int_max, test_var);
6207 0 : return -1;
6208 : }
6209 43 : object->timestamp = test_var;
6210 : } else {
6211 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6212 : PyLong_Type.tp_name);
6213 0 : return -1;
6214 : }
6215 : }
6216 43 : return 0;
6217 : }
6218 :
6219 : static PyGetSetDef py_netr_Authenticator_getsetters[] = {
6220 : {
6221 : .name = discard_const_p(char, "cred"),
6222 : .get = py_netr_Authenticator_get_cred,
6223 : .set = py_netr_Authenticator_set_cred,
6224 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
6225 : },
6226 : {
6227 : .name = discard_const_p(char, "timestamp"),
6228 : .get = py_netr_Authenticator_get_timestamp,
6229 : .set = py_netr_Authenticator_set_timestamp,
6230 : .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
6231 : },
6232 : { .name = NULL }
6233 : };
6234 :
6235 86 : static PyObject *py_netr_Authenticator_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6236 : {
6237 86 : return pytalloc_new(struct netr_Authenticator, type);
6238 : }
6239 :
6240 0 : static PyObject *py_netr_Authenticator_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6241 : {
6242 0 : struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(py_obj);
6243 0 : PyObject *ret = NULL;
6244 : DATA_BLOB blob;
6245 : enum ndr_err_code err;
6246 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6247 0 : if (tmp_ctx == NULL) {
6248 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6249 0 : return NULL;
6250 : }
6251 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_Authenticator);
6252 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6253 0 : TALLOC_FREE(tmp_ctx);
6254 0 : PyErr_SetNdrError(err);
6255 0 : return NULL;
6256 : }
6257 :
6258 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6259 0 : TALLOC_FREE(tmp_ctx);
6260 0 : return ret;
6261 : }
6262 :
6263 0 : static PyObject *py_netr_Authenticator_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6264 : {
6265 0 : struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(py_obj);
6266 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6267 0 : Py_ssize_t blob_length = 0;
6268 : enum ndr_err_code err;
6269 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6270 0 : PyObject *allow_remaining_obj = NULL;
6271 0 : bool allow_remaining = false;
6272 :
6273 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6274 : discard_const_p(char *, kwnames),
6275 : &blob.data, &blob_length,
6276 : &allow_remaining_obj)) {
6277 0 : return NULL;
6278 : }
6279 0 : blob.length = blob_length;
6280 :
6281 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6282 0 : allow_remaining = true;
6283 : }
6284 :
6285 0 : if (allow_remaining) {
6286 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_Authenticator);
6287 : } else {
6288 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_Authenticator);
6289 : }
6290 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6291 0 : PyErr_SetNdrError(err);
6292 0 : return NULL;
6293 : }
6294 :
6295 0 : Py_RETURN_NONE;
6296 : }
6297 :
6298 0 : static PyObject *py_netr_Authenticator_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6299 : {
6300 0 : struct netr_Authenticator *object = (struct netr_Authenticator *)pytalloc_get_ptr(py_obj);
6301 : PyObject *ret;
6302 : char *retstr;
6303 :
6304 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_Authenticator, "netr_Authenticator", object);
6305 0 : ret = PyUnicode_FromString(retstr);
6306 0 : talloc_free(retstr);
6307 :
6308 0 : return ret;
6309 : }
6310 :
6311 : static PyMethodDef py_netr_Authenticator_methods[] = {
6312 : { "__ndr_pack__", (PyCFunction)py_netr_Authenticator_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6313 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Authenticator_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6314 : { "__ndr_print__", (PyCFunction)py_netr_Authenticator_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6315 : { NULL, NULL, 0, NULL }
6316 : };
6317 :
6318 :
6319 : static PyTypeObject netr_Authenticator_Type = {
6320 : PyVarObject_HEAD_INIT(NULL, 0)
6321 : .tp_name = "netlogon.netr_Authenticator",
6322 : .tp_getset = py_netr_Authenticator_getsetters,
6323 : .tp_methods = py_netr_Authenticator_methods,
6324 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6325 : .tp_new = py_netr_Authenticator_new,
6326 : };
6327 :
6328 :
6329 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_account_name(PyObject *obj, void *closure)
6330 : {
6331 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6332 : PyObject *py_account_name;
6333 0 : if (object->account_name == NULL) {
6334 0 : Py_RETURN_NONE;
6335 : }
6336 0 : if (object->account_name == NULL) {
6337 0 : py_account_name = Py_None;
6338 0 : Py_INCREF(py_account_name);
6339 : } else {
6340 0 : if (object->account_name == NULL) {
6341 0 : py_account_name = Py_None;
6342 0 : Py_INCREF(py_account_name);
6343 : } else {
6344 0 : py_account_name = PyUnicode_Decode(object->account_name, strlen(object->account_name), "utf-8", "ignore");
6345 : }
6346 : }
6347 0 : return py_account_name;
6348 : }
6349 :
6350 0 : static int py_netr_DELTA_DELETE_USER_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
6351 : {
6352 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6353 0 : if (value == NULL) {
6354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
6355 0 : return -1;
6356 : }
6357 0 : if (value == Py_None) {
6358 0 : object->account_name = NULL;
6359 : } else {
6360 0 : object->account_name = NULL;
6361 : {
6362 : const char *test_str;
6363 : const char *talloc_str;
6364 0 : PyObject *unicode = NULL;
6365 0 : if (PyUnicode_Check(value)) {
6366 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6367 0 : if (unicode == NULL) {
6368 0 : PyErr_NoMemory();
6369 0 : return -1;
6370 : }
6371 0 : test_str = PyBytes_AS_STRING(unicode);
6372 0 : } else if (PyBytes_Check(value)) {
6373 0 : test_str = PyBytes_AS_STRING(value);
6374 : } else {
6375 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
6376 0 : return -1;
6377 : }
6378 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
6379 0 : if (unicode != NULL) {
6380 0 : Py_DECREF(unicode);
6381 : }
6382 0 : if (talloc_str == NULL) {
6383 0 : PyErr_NoMemory();
6384 0 : return -1;
6385 : }
6386 0 : object->account_name = talloc_str;
6387 : }
6388 : }
6389 0 : return 0;
6390 : }
6391 :
6392 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_unknown1(PyObject *obj, void *closure)
6393 : {
6394 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6395 : PyObject *py_unknown1;
6396 0 : py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1);
6397 0 : return py_unknown1;
6398 : }
6399 :
6400 0 : static int py_netr_DELTA_DELETE_USER_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
6401 : {
6402 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6403 0 : if (value == NULL) {
6404 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
6405 0 : return -1;
6406 : }
6407 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6408 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6409 0 : PyErr_NoMemory();
6410 0 : return -1;
6411 : }
6412 0 : object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value);
6413 0 : return 0;
6414 : }
6415 :
6416 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_unknown2(PyObject *obj, void *closure)
6417 : {
6418 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6419 : PyObject *py_unknown2;
6420 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
6421 0 : return py_unknown2;
6422 : }
6423 :
6424 0 : static int py_netr_DELTA_DELETE_USER_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
6425 : {
6426 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6427 0 : if (value == NULL) {
6428 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
6429 0 : return -1;
6430 : }
6431 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6432 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6433 0 : PyErr_NoMemory();
6434 0 : return -1;
6435 : }
6436 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
6437 0 : return 0;
6438 : }
6439 :
6440 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_unknown3(PyObject *obj, void *closure)
6441 : {
6442 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6443 : PyObject *py_unknown3;
6444 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
6445 0 : return py_unknown3;
6446 : }
6447 :
6448 0 : static int py_netr_DELTA_DELETE_USER_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
6449 : {
6450 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6451 0 : if (value == NULL) {
6452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
6453 0 : return -1;
6454 : }
6455 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6456 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6457 0 : PyErr_NoMemory();
6458 0 : return -1;
6459 : }
6460 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
6461 0 : return 0;
6462 : }
6463 :
6464 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_unknown4(PyObject *obj, void *closure)
6465 : {
6466 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6467 : PyObject *py_unknown4;
6468 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
6469 0 : return py_unknown4;
6470 : }
6471 :
6472 0 : static int py_netr_DELTA_DELETE_USER_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
6473 : {
6474 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6475 0 : if (value == NULL) {
6476 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
6477 0 : return -1;
6478 : }
6479 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6480 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6481 0 : PyErr_NoMemory();
6482 0 : return -1;
6483 : }
6484 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
6485 0 : return 0;
6486 : }
6487 :
6488 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_unknown5(PyObject *obj, void *closure)
6489 : {
6490 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6491 : PyObject *py_unknown5;
6492 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
6493 0 : return py_unknown5;
6494 : }
6495 :
6496 0 : static int py_netr_DELTA_DELETE_USER_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
6497 : {
6498 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6499 0 : if (value == NULL) {
6500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
6501 0 : return -1;
6502 : }
6503 : {
6504 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
6505 0 : if (PyLong_Check(value)) {
6506 : unsigned long long test_var;
6507 0 : test_var = PyLong_AsUnsignedLongLong(value);
6508 0 : if (PyErr_Occurred() != NULL) {
6509 0 : return -1;
6510 : }
6511 0 : if (test_var > uint_max) {
6512 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6513 : PyLong_Type.tp_name, uint_max, test_var);
6514 0 : return -1;
6515 : }
6516 0 : object->unknown5 = test_var;
6517 : } else {
6518 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6519 : PyLong_Type.tp_name);
6520 0 : return -1;
6521 : }
6522 : }
6523 0 : return 0;
6524 : }
6525 :
6526 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_unknown6(PyObject *obj, void *closure)
6527 : {
6528 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6529 : PyObject *py_unknown6;
6530 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
6531 0 : return py_unknown6;
6532 : }
6533 :
6534 0 : static int py_netr_DELTA_DELETE_USER_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
6535 : {
6536 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6537 0 : if (value == NULL) {
6538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
6539 0 : return -1;
6540 : }
6541 : {
6542 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
6543 0 : if (PyLong_Check(value)) {
6544 : unsigned long long test_var;
6545 0 : test_var = PyLong_AsUnsignedLongLong(value);
6546 0 : if (PyErr_Occurred() != NULL) {
6547 0 : return -1;
6548 : }
6549 0 : if (test_var > uint_max) {
6550 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6551 : PyLong_Type.tp_name, uint_max, test_var);
6552 0 : return -1;
6553 : }
6554 0 : object->unknown6 = test_var;
6555 : } else {
6556 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6557 : PyLong_Type.tp_name);
6558 0 : return -1;
6559 : }
6560 : }
6561 0 : return 0;
6562 : }
6563 :
6564 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_unknown7(PyObject *obj, void *closure)
6565 : {
6566 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6567 : PyObject *py_unknown7;
6568 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
6569 0 : return py_unknown7;
6570 : }
6571 :
6572 0 : static int py_netr_DELTA_DELETE_USER_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
6573 : {
6574 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6575 0 : if (value == NULL) {
6576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
6577 0 : return -1;
6578 : }
6579 : {
6580 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
6581 0 : if (PyLong_Check(value)) {
6582 : unsigned long long test_var;
6583 0 : test_var = PyLong_AsUnsignedLongLong(value);
6584 0 : if (PyErr_Occurred() != NULL) {
6585 0 : return -1;
6586 : }
6587 0 : if (test_var > uint_max) {
6588 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6589 : PyLong_Type.tp_name, uint_max, test_var);
6590 0 : return -1;
6591 : }
6592 0 : object->unknown7 = test_var;
6593 : } else {
6594 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6595 : PyLong_Type.tp_name);
6596 0 : return -1;
6597 : }
6598 : }
6599 0 : return 0;
6600 : }
6601 :
6602 0 : static PyObject *py_netr_DELTA_DELETE_USER_get_unknown8(PyObject *obj, void *closure)
6603 : {
6604 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(obj);
6605 : PyObject *py_unknown8;
6606 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
6607 0 : return py_unknown8;
6608 : }
6609 :
6610 0 : static int py_netr_DELTA_DELETE_USER_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
6611 : {
6612 0 : struct netr_DELTA_DELETE_USER *object = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(py_obj);
6613 0 : if (value == NULL) {
6614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
6615 0 : return -1;
6616 : }
6617 : {
6618 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
6619 0 : if (PyLong_Check(value)) {
6620 : unsigned long long test_var;
6621 0 : test_var = PyLong_AsUnsignedLongLong(value);
6622 0 : if (PyErr_Occurred() != NULL) {
6623 0 : return -1;
6624 : }
6625 0 : if (test_var > uint_max) {
6626 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6627 : PyLong_Type.tp_name, uint_max, test_var);
6628 0 : return -1;
6629 : }
6630 0 : object->unknown8 = test_var;
6631 : } else {
6632 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6633 : PyLong_Type.tp_name);
6634 0 : return -1;
6635 : }
6636 : }
6637 0 : return 0;
6638 : }
6639 :
6640 : static PyGetSetDef py_netr_DELTA_DELETE_USER_getsetters[] = {
6641 : {
6642 : .name = discard_const_p(char, "account_name"),
6643 : .get = py_netr_DELTA_DELETE_USER_get_account_name,
6644 : .set = py_netr_DELTA_DELETE_USER_set_account_name,
6645 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6646 : },
6647 : {
6648 : .name = discard_const_p(char, "unknown1"),
6649 : .get = py_netr_DELTA_DELETE_USER_get_unknown1,
6650 : .set = py_netr_DELTA_DELETE_USER_set_unknown1,
6651 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6652 : },
6653 : {
6654 : .name = discard_const_p(char, "unknown2"),
6655 : .get = py_netr_DELTA_DELETE_USER_get_unknown2,
6656 : .set = py_netr_DELTA_DELETE_USER_set_unknown2,
6657 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6658 : },
6659 : {
6660 : .name = discard_const_p(char, "unknown3"),
6661 : .get = py_netr_DELTA_DELETE_USER_get_unknown3,
6662 : .set = py_netr_DELTA_DELETE_USER_set_unknown3,
6663 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6664 : },
6665 : {
6666 : .name = discard_const_p(char, "unknown4"),
6667 : .get = py_netr_DELTA_DELETE_USER_get_unknown4,
6668 : .set = py_netr_DELTA_DELETE_USER_set_unknown4,
6669 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6670 : },
6671 : {
6672 : .name = discard_const_p(char, "unknown5"),
6673 : .get = py_netr_DELTA_DELETE_USER_get_unknown5,
6674 : .set = py_netr_DELTA_DELETE_USER_set_unknown5,
6675 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6676 : },
6677 : {
6678 : .name = discard_const_p(char, "unknown6"),
6679 : .get = py_netr_DELTA_DELETE_USER_get_unknown6,
6680 : .set = py_netr_DELTA_DELETE_USER_set_unknown6,
6681 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6682 : },
6683 : {
6684 : .name = discard_const_p(char, "unknown7"),
6685 : .get = py_netr_DELTA_DELETE_USER_get_unknown7,
6686 : .set = py_netr_DELTA_DELETE_USER_set_unknown7,
6687 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6688 : },
6689 : {
6690 : .name = discard_const_p(char, "unknown8"),
6691 : .get = py_netr_DELTA_DELETE_USER_get_unknown8,
6692 : .set = py_netr_DELTA_DELETE_USER_set_unknown8,
6693 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6694 : },
6695 : { .name = NULL }
6696 : };
6697 :
6698 0 : static PyObject *py_netr_DELTA_DELETE_USER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6699 : {
6700 0 : return pytalloc_new(struct netr_DELTA_DELETE_USER, type);
6701 : }
6702 :
6703 :
6704 : static PyTypeObject netr_DELTA_DELETE_USER_Type = {
6705 : PyVarObject_HEAD_INIT(NULL, 0)
6706 : .tp_name = "netlogon.netr_DELTA_DELETE_USER",
6707 : .tp_getset = py_netr_DELTA_DELETE_USER_getsetters,
6708 : .tp_methods = NULL,
6709 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6710 : .tp_new = py_netr_DELTA_DELETE_USER_new,
6711 : };
6712 :
6713 :
6714 0 : static PyObject *py_netr_USER_KEY16_get_length(PyObject *obj, void *closure)
6715 : {
6716 0 : struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(obj);
6717 : PyObject *py_length;
6718 0 : py_length = PyLong_FromLong((uint16_t)object->length);
6719 0 : return py_length;
6720 : }
6721 :
6722 0 : static int py_netr_USER_KEY16_set_length(PyObject *py_obj, PyObject *value, void *closure)
6723 : {
6724 0 : struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(py_obj);
6725 0 : if (value == NULL) {
6726 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
6727 0 : return -1;
6728 : }
6729 : {
6730 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
6731 0 : if (PyLong_Check(value)) {
6732 : unsigned long long test_var;
6733 0 : test_var = PyLong_AsUnsignedLongLong(value);
6734 0 : if (PyErr_Occurred() != NULL) {
6735 0 : return -1;
6736 : }
6737 0 : if (test_var > uint_max) {
6738 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6739 : PyLong_Type.tp_name, uint_max, test_var);
6740 0 : return -1;
6741 : }
6742 0 : object->length = test_var;
6743 : } else {
6744 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6745 : PyLong_Type.tp_name);
6746 0 : return -1;
6747 : }
6748 : }
6749 0 : return 0;
6750 : }
6751 :
6752 0 : static PyObject *py_netr_USER_KEY16_get_size(PyObject *obj, void *closure)
6753 : {
6754 0 : struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(obj);
6755 : PyObject *py_size;
6756 0 : py_size = PyLong_FromLong((uint16_t)object->size);
6757 0 : return py_size;
6758 : }
6759 :
6760 0 : static int py_netr_USER_KEY16_set_size(PyObject *py_obj, PyObject *value, void *closure)
6761 : {
6762 0 : struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(py_obj);
6763 0 : if (value == NULL) {
6764 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
6765 0 : return -1;
6766 : }
6767 : {
6768 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
6769 0 : if (PyLong_Check(value)) {
6770 : unsigned long long test_var;
6771 0 : test_var = PyLong_AsUnsignedLongLong(value);
6772 0 : if (PyErr_Occurred() != NULL) {
6773 0 : return -1;
6774 : }
6775 0 : if (test_var > uint_max) {
6776 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6777 : PyLong_Type.tp_name, uint_max, test_var);
6778 0 : return -1;
6779 : }
6780 0 : object->size = test_var;
6781 : } else {
6782 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6783 : PyLong_Type.tp_name);
6784 0 : return -1;
6785 : }
6786 : }
6787 0 : return 0;
6788 : }
6789 :
6790 0 : static PyObject *py_netr_USER_KEY16_get_flags(PyObject *obj, void *closure)
6791 : {
6792 0 : struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(obj);
6793 : PyObject *py_flags;
6794 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
6795 0 : return py_flags;
6796 : }
6797 :
6798 0 : static int py_netr_USER_KEY16_set_flags(PyObject *py_obj, PyObject *value, void *closure)
6799 : {
6800 0 : struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(py_obj);
6801 0 : if (value == NULL) {
6802 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
6803 0 : return -1;
6804 : }
6805 : {
6806 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
6807 0 : if (PyLong_Check(value)) {
6808 : unsigned long long test_var;
6809 0 : test_var = PyLong_AsUnsignedLongLong(value);
6810 0 : if (PyErr_Occurred() != NULL) {
6811 0 : return -1;
6812 : }
6813 0 : if (test_var > uint_max) {
6814 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6815 : PyLong_Type.tp_name, uint_max, test_var);
6816 0 : return -1;
6817 : }
6818 0 : object->flags = test_var;
6819 : } else {
6820 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6821 : PyLong_Type.tp_name);
6822 0 : return -1;
6823 : }
6824 : }
6825 0 : return 0;
6826 : }
6827 :
6828 0 : static PyObject *py_netr_USER_KEY16_get_pwd(PyObject *obj, void *closure)
6829 : {
6830 0 : struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(obj);
6831 : PyObject *py_pwd;
6832 0 : py_pwd = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->pwd);
6833 0 : return py_pwd;
6834 : }
6835 :
6836 0 : static int py_netr_USER_KEY16_set_pwd(PyObject *py_obj, PyObject *value, void *closure)
6837 : {
6838 0 : struct netr_USER_KEY16 *object = (struct netr_USER_KEY16 *)pytalloc_get_ptr(py_obj);
6839 0 : if (value == NULL) {
6840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd");
6841 0 : return -1;
6842 : }
6843 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
6844 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6845 0 : PyErr_NoMemory();
6846 0 : return -1;
6847 : }
6848 0 : object->pwd = *(struct samr_Password *)pytalloc_get_ptr(value);
6849 0 : return 0;
6850 : }
6851 :
6852 : static PyGetSetDef py_netr_USER_KEY16_getsetters[] = {
6853 : {
6854 : .name = discard_const_p(char, "length"),
6855 : .get = py_netr_USER_KEY16_get_length,
6856 : .set = py_netr_USER_KEY16_set_length,
6857 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6858 : },
6859 : {
6860 : .name = discard_const_p(char, "size"),
6861 : .get = py_netr_USER_KEY16_get_size,
6862 : .set = py_netr_USER_KEY16_set_size,
6863 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
6864 : },
6865 : {
6866 : .name = discard_const_p(char, "flags"),
6867 : .get = py_netr_USER_KEY16_get_flags,
6868 : .set = py_netr_USER_KEY16_set_flags,
6869 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6870 : },
6871 : {
6872 : .name = discard_const_p(char, "pwd"),
6873 : .get = py_netr_USER_KEY16_get_pwd,
6874 : .set = py_netr_USER_KEY16_set_pwd,
6875 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
6876 : },
6877 : { .name = NULL }
6878 : };
6879 :
6880 0 : static PyObject *py_netr_USER_KEY16_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6881 : {
6882 0 : return pytalloc_new(struct netr_USER_KEY16, type);
6883 : }
6884 :
6885 :
6886 : static PyTypeObject netr_USER_KEY16_Type = {
6887 : PyVarObject_HEAD_INIT(NULL, 0)
6888 : .tp_name = "netlogon.netr_USER_KEY16",
6889 : .tp_getset = py_netr_USER_KEY16_getsetters,
6890 : .tp_methods = NULL,
6891 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6892 : .tp_new = py_netr_USER_KEY16_new,
6893 : };
6894 :
6895 :
6896 0 : static PyObject *py_netr_PasswordHistory_get_nt_length(PyObject *obj, void *closure)
6897 : {
6898 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj);
6899 : PyObject *py_nt_length;
6900 0 : py_nt_length = PyLong_FromLong((uint16_t)object->nt_length);
6901 0 : return py_nt_length;
6902 : }
6903 :
6904 0 : static int py_netr_PasswordHistory_set_nt_length(PyObject *py_obj, PyObject *value, void *closure)
6905 : {
6906 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj);
6907 0 : if (value == NULL) {
6908 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_length");
6909 0 : return -1;
6910 : }
6911 : {
6912 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_length));
6913 0 : if (PyLong_Check(value)) {
6914 : unsigned long long test_var;
6915 0 : test_var = PyLong_AsUnsignedLongLong(value);
6916 0 : if (PyErr_Occurred() != NULL) {
6917 0 : return -1;
6918 : }
6919 0 : if (test_var > uint_max) {
6920 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6921 : PyLong_Type.tp_name, uint_max, test_var);
6922 0 : return -1;
6923 : }
6924 0 : object->nt_length = test_var;
6925 : } else {
6926 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6927 : PyLong_Type.tp_name);
6928 0 : return -1;
6929 : }
6930 : }
6931 0 : return 0;
6932 : }
6933 :
6934 0 : static PyObject *py_netr_PasswordHistory_get_nt_size(PyObject *obj, void *closure)
6935 : {
6936 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj);
6937 : PyObject *py_nt_size;
6938 0 : py_nt_size = PyLong_FromLong((uint16_t)object->nt_size);
6939 0 : return py_nt_size;
6940 : }
6941 :
6942 0 : static int py_netr_PasswordHistory_set_nt_size(PyObject *py_obj, PyObject *value, void *closure)
6943 : {
6944 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj);
6945 0 : if (value == NULL) {
6946 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_size");
6947 0 : return -1;
6948 : }
6949 : {
6950 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_size));
6951 0 : if (PyLong_Check(value)) {
6952 : unsigned long long test_var;
6953 0 : test_var = PyLong_AsUnsignedLongLong(value);
6954 0 : if (PyErr_Occurred() != NULL) {
6955 0 : return -1;
6956 : }
6957 0 : if (test_var > uint_max) {
6958 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6959 : PyLong_Type.tp_name, uint_max, test_var);
6960 0 : return -1;
6961 : }
6962 0 : object->nt_size = test_var;
6963 : } else {
6964 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6965 : PyLong_Type.tp_name);
6966 0 : return -1;
6967 : }
6968 : }
6969 0 : return 0;
6970 : }
6971 :
6972 0 : static PyObject *py_netr_PasswordHistory_get_nt_flags(PyObject *obj, void *closure)
6973 : {
6974 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj);
6975 : PyObject *py_nt_flags;
6976 0 : py_nt_flags = PyLong_FromUnsignedLongLong((uint32_t)object->nt_flags);
6977 0 : return py_nt_flags;
6978 : }
6979 :
6980 0 : static int py_netr_PasswordHistory_set_nt_flags(PyObject *py_obj, PyObject *value, void *closure)
6981 : {
6982 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj);
6983 0 : if (value == NULL) {
6984 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_flags");
6985 0 : return -1;
6986 : }
6987 : {
6988 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_flags));
6989 0 : if (PyLong_Check(value)) {
6990 : unsigned long long test_var;
6991 0 : test_var = PyLong_AsUnsignedLongLong(value);
6992 0 : if (PyErr_Occurred() != NULL) {
6993 0 : return -1;
6994 : }
6995 0 : if (test_var > uint_max) {
6996 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6997 : PyLong_Type.tp_name, uint_max, test_var);
6998 0 : return -1;
6999 : }
7000 0 : object->nt_flags = test_var;
7001 : } else {
7002 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7003 : PyLong_Type.tp_name);
7004 0 : return -1;
7005 : }
7006 : }
7007 0 : return 0;
7008 : }
7009 :
7010 0 : static PyObject *py_netr_PasswordHistory_get_lm_length(PyObject *obj, void *closure)
7011 : {
7012 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj);
7013 : PyObject *py_lm_length;
7014 0 : py_lm_length = PyLong_FromLong((uint16_t)object->lm_length);
7015 0 : return py_lm_length;
7016 : }
7017 :
7018 0 : static int py_netr_PasswordHistory_set_lm_length(PyObject *py_obj, PyObject *value, void *closure)
7019 : {
7020 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj);
7021 0 : if (value == NULL) {
7022 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_length");
7023 0 : return -1;
7024 : }
7025 : {
7026 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_length));
7027 0 : if (PyLong_Check(value)) {
7028 : unsigned long long test_var;
7029 0 : test_var = PyLong_AsUnsignedLongLong(value);
7030 0 : if (PyErr_Occurred() != NULL) {
7031 0 : return -1;
7032 : }
7033 0 : if (test_var > uint_max) {
7034 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7035 : PyLong_Type.tp_name, uint_max, test_var);
7036 0 : return -1;
7037 : }
7038 0 : object->lm_length = test_var;
7039 : } else {
7040 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7041 : PyLong_Type.tp_name);
7042 0 : return -1;
7043 : }
7044 : }
7045 0 : return 0;
7046 : }
7047 :
7048 0 : static PyObject *py_netr_PasswordHistory_get_lm_size(PyObject *obj, void *closure)
7049 : {
7050 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj);
7051 : PyObject *py_lm_size;
7052 0 : py_lm_size = PyLong_FromLong((uint16_t)object->lm_size);
7053 0 : return py_lm_size;
7054 : }
7055 :
7056 0 : static int py_netr_PasswordHistory_set_lm_size(PyObject *py_obj, PyObject *value, void *closure)
7057 : {
7058 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj);
7059 0 : if (value == NULL) {
7060 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_size");
7061 0 : return -1;
7062 : }
7063 : {
7064 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_size));
7065 0 : if (PyLong_Check(value)) {
7066 : unsigned long long test_var;
7067 0 : test_var = PyLong_AsUnsignedLongLong(value);
7068 0 : if (PyErr_Occurred() != NULL) {
7069 0 : return -1;
7070 : }
7071 0 : if (test_var > uint_max) {
7072 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7073 : PyLong_Type.tp_name, uint_max, test_var);
7074 0 : return -1;
7075 : }
7076 0 : object->lm_size = test_var;
7077 : } else {
7078 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7079 : PyLong_Type.tp_name);
7080 0 : return -1;
7081 : }
7082 : }
7083 0 : return 0;
7084 : }
7085 :
7086 0 : static PyObject *py_netr_PasswordHistory_get_lm_flags(PyObject *obj, void *closure)
7087 : {
7088 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj);
7089 : PyObject *py_lm_flags;
7090 0 : py_lm_flags = PyLong_FromUnsignedLongLong((uint32_t)object->lm_flags);
7091 0 : return py_lm_flags;
7092 : }
7093 :
7094 0 : static int py_netr_PasswordHistory_set_lm_flags(PyObject *py_obj, PyObject *value, void *closure)
7095 : {
7096 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj);
7097 0 : if (value == NULL) {
7098 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_flags");
7099 0 : return -1;
7100 : }
7101 : {
7102 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_flags));
7103 0 : if (PyLong_Check(value)) {
7104 : unsigned long long test_var;
7105 0 : test_var = PyLong_AsUnsignedLongLong(value);
7106 0 : if (PyErr_Occurred() != NULL) {
7107 0 : return -1;
7108 : }
7109 0 : if (test_var > uint_max) {
7110 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7111 : PyLong_Type.tp_name, uint_max, test_var);
7112 0 : return -1;
7113 : }
7114 0 : object->lm_flags = test_var;
7115 : } else {
7116 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7117 : PyLong_Type.tp_name);
7118 0 : return -1;
7119 : }
7120 : }
7121 0 : return 0;
7122 : }
7123 :
7124 0 : static PyObject *py_netr_PasswordHistory_get_nt_history(PyObject *obj, void *closure)
7125 : {
7126 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj);
7127 : PyObject *py_nt_history;
7128 0 : py_nt_history = PyList_New(object->nt_length);
7129 0 : if (py_nt_history == NULL) {
7130 0 : return NULL;
7131 : }
7132 : {
7133 : int nt_history_cntr_0;
7134 0 : for (nt_history_cntr_0 = 0; nt_history_cntr_0 < (object->nt_length); nt_history_cntr_0++) {
7135 : PyObject *py_nt_history_0;
7136 0 : py_nt_history_0 = PyLong_FromLong((uint16_t)object->nt_history[nt_history_cntr_0]);
7137 0 : PyList_SetItem(py_nt_history, nt_history_cntr_0, py_nt_history_0);
7138 : }
7139 : }
7140 0 : return py_nt_history;
7141 : }
7142 :
7143 0 : static int py_netr_PasswordHistory_set_nt_history(PyObject *py_obj, PyObject *value, void *closure)
7144 : {
7145 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj);
7146 0 : if (value == NULL) {
7147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_history");
7148 0 : return -1;
7149 : }
7150 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7151 : {
7152 : int nt_history_cntr_0;
7153 0 : object->nt_history = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->nt_history, PyList_GET_SIZE(value));
7154 0 : if (!object->nt_history) { return -1;; }
7155 0 : talloc_set_name_const(object->nt_history, "ARRAY: object->nt_history");
7156 0 : for (nt_history_cntr_0 = 0; nt_history_cntr_0 < PyList_GET_SIZE(value); nt_history_cntr_0++) {
7157 0 : if (PyList_GET_ITEM(value, nt_history_cntr_0) == NULL) {
7158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_history[nt_history_cntr_0]");
7159 0 : return -1;
7160 : }
7161 : {
7162 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_history[nt_history_cntr_0]));
7163 0 : if (PyLong_Check(PyList_GET_ITEM(value, nt_history_cntr_0))) {
7164 : unsigned long long test_var;
7165 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, nt_history_cntr_0));
7166 0 : if (PyErr_Occurred() != NULL) {
7167 0 : return -1;
7168 : }
7169 0 : if (test_var > uint_max) {
7170 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7171 : PyLong_Type.tp_name, uint_max, test_var);
7172 0 : return -1;
7173 : }
7174 0 : object->nt_history[nt_history_cntr_0] = test_var;
7175 : } else {
7176 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7177 : PyLong_Type.tp_name);
7178 0 : return -1;
7179 : }
7180 : }
7181 : }
7182 : }
7183 0 : return 0;
7184 : }
7185 :
7186 0 : static PyObject *py_netr_PasswordHistory_get_lm_history(PyObject *obj, void *closure)
7187 : {
7188 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(obj);
7189 : PyObject *py_lm_history;
7190 0 : py_lm_history = PyList_New(object->lm_length);
7191 0 : if (py_lm_history == NULL) {
7192 0 : return NULL;
7193 : }
7194 : {
7195 : int lm_history_cntr_0;
7196 0 : for (lm_history_cntr_0 = 0; lm_history_cntr_0 < (object->lm_length); lm_history_cntr_0++) {
7197 : PyObject *py_lm_history_0;
7198 0 : py_lm_history_0 = PyLong_FromLong((uint16_t)object->lm_history[lm_history_cntr_0]);
7199 0 : PyList_SetItem(py_lm_history, lm_history_cntr_0, py_lm_history_0);
7200 : }
7201 : }
7202 0 : return py_lm_history;
7203 : }
7204 :
7205 0 : static int py_netr_PasswordHistory_set_lm_history(PyObject *py_obj, PyObject *value, void *closure)
7206 : {
7207 0 : struct netr_PasswordHistory *object = (struct netr_PasswordHistory *)pytalloc_get_ptr(py_obj);
7208 0 : if (value == NULL) {
7209 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_history");
7210 0 : return -1;
7211 : }
7212 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7213 : {
7214 : int lm_history_cntr_0;
7215 0 : object->lm_history = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->lm_history, PyList_GET_SIZE(value));
7216 0 : if (!object->lm_history) { return -1;; }
7217 0 : talloc_set_name_const(object->lm_history, "ARRAY: object->lm_history");
7218 0 : for (lm_history_cntr_0 = 0; lm_history_cntr_0 < PyList_GET_SIZE(value); lm_history_cntr_0++) {
7219 0 : if (PyList_GET_ITEM(value, lm_history_cntr_0) == NULL) {
7220 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_history[lm_history_cntr_0]");
7221 0 : return -1;
7222 : }
7223 : {
7224 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_history[lm_history_cntr_0]));
7225 0 : if (PyLong_Check(PyList_GET_ITEM(value, lm_history_cntr_0))) {
7226 : unsigned long long test_var;
7227 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, lm_history_cntr_0));
7228 0 : if (PyErr_Occurred() != NULL) {
7229 0 : return -1;
7230 : }
7231 0 : if (test_var > uint_max) {
7232 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7233 : PyLong_Type.tp_name, uint_max, test_var);
7234 0 : return -1;
7235 : }
7236 0 : object->lm_history[lm_history_cntr_0] = test_var;
7237 : } else {
7238 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7239 : PyLong_Type.tp_name);
7240 0 : return -1;
7241 : }
7242 : }
7243 : }
7244 : }
7245 0 : return 0;
7246 : }
7247 :
7248 : static PyGetSetDef py_netr_PasswordHistory_getsetters[] = {
7249 : {
7250 : .name = discard_const_p(char, "nt_length"),
7251 : .get = py_netr_PasswordHistory_get_nt_length,
7252 : .set = py_netr_PasswordHistory_set_nt_length,
7253 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7254 : },
7255 : {
7256 : .name = discard_const_p(char, "nt_size"),
7257 : .get = py_netr_PasswordHistory_get_nt_size,
7258 : .set = py_netr_PasswordHistory_set_nt_size,
7259 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7260 : },
7261 : {
7262 : .name = discard_const_p(char, "nt_flags"),
7263 : .get = py_netr_PasswordHistory_get_nt_flags,
7264 : .set = py_netr_PasswordHistory_set_nt_flags,
7265 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7266 : },
7267 : {
7268 : .name = discard_const_p(char, "lm_length"),
7269 : .get = py_netr_PasswordHistory_get_lm_length,
7270 : .set = py_netr_PasswordHistory_set_lm_length,
7271 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7272 : },
7273 : {
7274 : .name = discard_const_p(char, "lm_size"),
7275 : .get = py_netr_PasswordHistory_get_lm_size,
7276 : .set = py_netr_PasswordHistory_set_lm_size,
7277 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7278 : },
7279 : {
7280 : .name = discard_const_p(char, "lm_flags"),
7281 : .get = py_netr_PasswordHistory_get_lm_flags,
7282 : .set = py_netr_PasswordHistory_set_lm_flags,
7283 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7284 : },
7285 : {
7286 : .name = discard_const_p(char, "nt_history"),
7287 : .get = py_netr_PasswordHistory_get_nt_history,
7288 : .set = py_netr_PasswordHistory_set_nt_history,
7289 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
7290 : },
7291 : {
7292 : .name = discard_const_p(char, "lm_history"),
7293 : .get = py_netr_PasswordHistory_get_lm_history,
7294 : .set = py_netr_PasswordHistory_set_lm_history,
7295 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
7296 : },
7297 : { .name = NULL }
7298 : };
7299 :
7300 0 : static PyObject *py_netr_PasswordHistory_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7301 : {
7302 0 : return pytalloc_new(struct netr_PasswordHistory, type);
7303 : }
7304 :
7305 :
7306 : static PyTypeObject netr_PasswordHistory_Type = {
7307 : PyVarObject_HEAD_INIT(NULL, 0)
7308 : .tp_name = "netlogon.netr_PasswordHistory",
7309 : .tp_getset = py_netr_PasswordHistory_getsetters,
7310 : .tp_methods = NULL,
7311 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7312 : .tp_new = py_netr_PasswordHistory_new,
7313 : };
7314 :
7315 :
7316 0 : static PyObject *py_netr_USER_KEYS2_get_lmpassword(PyObject *obj, void *closure)
7317 : {
7318 0 : struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(obj);
7319 : PyObject *py_lmpassword;
7320 0 : py_lmpassword = pytalloc_reference_ex(&netr_USER_KEY16_Type, pytalloc_get_mem_ctx(obj), &object->lmpassword);
7321 0 : return py_lmpassword;
7322 : }
7323 :
7324 0 : static int py_netr_USER_KEYS2_set_lmpassword(PyObject *py_obj, PyObject *value, void *closure)
7325 : {
7326 0 : struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(py_obj);
7327 0 : if (value == NULL) {
7328 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmpassword");
7329 0 : return -1;
7330 : }
7331 0 : PY_CHECK_TYPE(&netr_USER_KEY16_Type, value, return -1;);
7332 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7333 0 : PyErr_NoMemory();
7334 0 : return -1;
7335 : }
7336 0 : object->lmpassword = *(struct netr_USER_KEY16 *)pytalloc_get_ptr(value);
7337 0 : return 0;
7338 : }
7339 :
7340 0 : static PyObject *py_netr_USER_KEYS2_get_ntpassword(PyObject *obj, void *closure)
7341 : {
7342 0 : struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(obj);
7343 : PyObject *py_ntpassword;
7344 0 : py_ntpassword = pytalloc_reference_ex(&netr_USER_KEY16_Type, pytalloc_get_mem_ctx(obj), &object->ntpassword);
7345 0 : return py_ntpassword;
7346 : }
7347 :
7348 0 : static int py_netr_USER_KEYS2_set_ntpassword(PyObject *py_obj, PyObject *value, void *closure)
7349 : {
7350 0 : struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(py_obj);
7351 0 : if (value == NULL) {
7352 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntpassword");
7353 0 : return -1;
7354 : }
7355 0 : PY_CHECK_TYPE(&netr_USER_KEY16_Type, value, return -1;);
7356 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7357 0 : PyErr_NoMemory();
7358 0 : return -1;
7359 : }
7360 0 : object->ntpassword = *(struct netr_USER_KEY16 *)pytalloc_get_ptr(value);
7361 0 : return 0;
7362 : }
7363 :
7364 0 : static PyObject *py_netr_USER_KEYS2_get_history(PyObject *obj, void *closure)
7365 : {
7366 0 : struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(obj);
7367 : PyObject *py_history;
7368 0 : py_history = pytalloc_reference_ex(&netr_PasswordHistory_Type, pytalloc_get_mem_ctx(obj), &object->history);
7369 0 : return py_history;
7370 : }
7371 :
7372 0 : static int py_netr_USER_KEYS2_set_history(PyObject *py_obj, PyObject *value, void *closure)
7373 : {
7374 0 : struct netr_USER_KEYS2 *object = (struct netr_USER_KEYS2 *)pytalloc_get_ptr(py_obj);
7375 0 : if (value == NULL) {
7376 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->history");
7377 0 : return -1;
7378 : }
7379 0 : PY_CHECK_TYPE(&netr_PasswordHistory_Type, value, return -1;);
7380 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7381 0 : PyErr_NoMemory();
7382 0 : return -1;
7383 : }
7384 0 : object->history = *(struct netr_PasswordHistory *)pytalloc_get_ptr(value);
7385 0 : return 0;
7386 : }
7387 :
7388 : static PyGetSetDef py_netr_USER_KEYS2_getsetters[] = {
7389 : {
7390 : .name = discard_const_p(char, "lmpassword"),
7391 : .get = py_netr_USER_KEYS2_get_lmpassword,
7392 : .set = py_netr_USER_KEYS2_set_lmpassword,
7393 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_KEY16")
7394 : },
7395 : {
7396 : .name = discard_const_p(char, "ntpassword"),
7397 : .get = py_netr_USER_KEYS2_get_ntpassword,
7398 : .set = py_netr_USER_KEYS2_set_ntpassword,
7399 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_KEY16")
7400 : },
7401 : {
7402 : .name = discard_const_p(char, "history"),
7403 : .get = py_netr_USER_KEYS2_get_history,
7404 : .set = py_netr_USER_KEYS2_set_history,
7405 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_PasswordHistory")
7406 : },
7407 : { .name = NULL }
7408 : };
7409 :
7410 0 : static PyObject *py_netr_USER_KEYS2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7411 : {
7412 0 : return pytalloc_new(struct netr_USER_KEYS2, type);
7413 : }
7414 :
7415 :
7416 : static PyTypeObject netr_USER_KEYS2_Type = {
7417 : PyVarObject_HEAD_INIT(NULL, 0)
7418 : .tp_name = "netlogon.netr_USER_KEYS2",
7419 : .tp_getset = py_netr_USER_KEYS2_getsetters,
7420 : .tp_methods = NULL,
7421 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7422 : .tp_new = py_netr_USER_KEYS2_new,
7423 : };
7424 :
7425 :
7426 0 : static PyObject *py_netr_USER_KEY_UNION_get_keys2(PyObject *obj, void *closure)
7427 : {
7428 0 : struct netr_USER_KEY_UNION *object = (struct netr_USER_KEY_UNION *)pytalloc_get_ptr(obj);
7429 : PyObject *py_keys2;
7430 0 : py_keys2 = pytalloc_reference_ex(&netr_USER_KEYS2_Type, pytalloc_get_mem_ctx(obj), &object->keys2);
7431 0 : return py_keys2;
7432 : }
7433 :
7434 0 : static int py_netr_USER_KEY_UNION_set_keys2(PyObject *py_obj, PyObject *value, void *closure)
7435 : {
7436 0 : struct netr_USER_KEY_UNION *object = (struct netr_USER_KEY_UNION *)pytalloc_get_ptr(py_obj);
7437 0 : if (value == NULL) {
7438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keys2");
7439 0 : return -1;
7440 : }
7441 0 : PY_CHECK_TYPE(&netr_USER_KEYS2_Type, value, return -1;);
7442 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7443 0 : PyErr_NoMemory();
7444 0 : return -1;
7445 : }
7446 0 : object->keys2 = *(struct netr_USER_KEYS2 *)pytalloc_get_ptr(value);
7447 0 : return 0;
7448 : }
7449 :
7450 : static PyGetSetDef py_netr_USER_KEY_UNION_getsetters[] = {
7451 : {
7452 : .name = discard_const_p(char, "keys2"),
7453 : .get = py_netr_USER_KEY_UNION_get_keys2,
7454 : .set = py_netr_USER_KEY_UNION_set_keys2,
7455 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_KEYS2")
7456 : },
7457 : { .name = NULL }
7458 : };
7459 :
7460 0 : static PyObject *py_netr_USER_KEY_UNION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7461 : {
7462 0 : return pytalloc_new(struct netr_USER_KEY_UNION, type);
7463 : }
7464 :
7465 :
7466 : static PyTypeObject netr_USER_KEY_UNION_Type = {
7467 : PyVarObject_HEAD_INIT(NULL, 0)
7468 : .tp_name = "netlogon.netr_USER_KEY_UNION",
7469 : .tp_getset = py_netr_USER_KEY_UNION_getsetters,
7470 : .tp_methods = NULL,
7471 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7472 : .tp_new = py_netr_USER_KEY_UNION_new,
7473 : };
7474 :
7475 :
7476 0 : static PyObject *py_netr_USER_KEYS_get_version(PyObject *obj, void *closure)
7477 : {
7478 0 : struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(obj);
7479 : PyObject *py_version;
7480 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
7481 0 : return py_version;
7482 : }
7483 :
7484 0 : static int py_netr_USER_KEYS_set_version(PyObject *py_obj, PyObject *value, void *closure)
7485 : {
7486 0 : struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(py_obj);
7487 0 : if (value == NULL) {
7488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
7489 0 : return -1;
7490 : }
7491 : {
7492 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
7493 0 : if (PyLong_Check(value)) {
7494 : unsigned long long test_var;
7495 0 : test_var = PyLong_AsUnsignedLongLong(value);
7496 0 : if (PyErr_Occurred() != NULL) {
7497 0 : return -1;
7498 : }
7499 0 : if (test_var > uint_max) {
7500 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7501 : PyLong_Type.tp_name, uint_max, test_var);
7502 0 : return -1;
7503 : }
7504 0 : object->version = test_var;
7505 : } else {
7506 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7507 : PyLong_Type.tp_name);
7508 0 : return -1;
7509 : }
7510 : }
7511 0 : return 0;
7512 : }
7513 :
7514 0 : static PyObject *py_netr_USER_KEYS_get_keys(PyObject *obj, void *closure)
7515 : {
7516 0 : struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(obj);
7517 : PyObject *py_keys;
7518 0 : py_keys = pytalloc_reference_ex(&netr_USER_KEY_UNION_Type, pytalloc_get_mem_ctx(obj), &object->keys);
7519 0 : return py_keys;
7520 : }
7521 :
7522 0 : static int py_netr_USER_KEYS_set_keys(PyObject *py_obj, PyObject *value, void *closure)
7523 : {
7524 0 : struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(py_obj);
7525 0 : if (value == NULL) {
7526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->keys");
7527 0 : return -1;
7528 : }
7529 0 : PY_CHECK_TYPE(&netr_USER_KEY_UNION_Type, value, return -1;);
7530 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7531 0 : PyErr_NoMemory();
7532 0 : return -1;
7533 : }
7534 0 : object->keys = *(struct netr_USER_KEY_UNION *)pytalloc_get_ptr(value);
7535 0 : return 0;
7536 : }
7537 :
7538 : static PyGetSetDef py_netr_USER_KEYS_getsetters[] = {
7539 : {
7540 : .name = discard_const_p(char, "version"),
7541 : .get = py_netr_USER_KEYS_get_version,
7542 : .set = py_netr_USER_KEYS_set_version,
7543 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7544 : },
7545 : {
7546 : .name = discard_const_p(char, "keys"),
7547 : .get = py_netr_USER_KEYS_get_keys,
7548 : .set = py_netr_USER_KEYS_set_keys,
7549 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_KEY_UNION")
7550 : },
7551 : { .name = NULL }
7552 : };
7553 :
7554 0 : static PyObject *py_netr_USER_KEYS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7555 : {
7556 0 : return pytalloc_new(struct netr_USER_KEYS, type);
7557 : }
7558 :
7559 0 : static PyObject *py_netr_USER_KEYS_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7560 : {
7561 0 : struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(py_obj);
7562 0 : PyObject *ret = NULL;
7563 : DATA_BLOB blob;
7564 : enum ndr_err_code err;
7565 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7566 0 : if (tmp_ctx == NULL) {
7567 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7568 0 : return NULL;
7569 : }
7570 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_USER_KEYS);
7571 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7572 0 : TALLOC_FREE(tmp_ctx);
7573 0 : PyErr_SetNdrError(err);
7574 0 : return NULL;
7575 : }
7576 :
7577 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7578 0 : TALLOC_FREE(tmp_ctx);
7579 0 : return ret;
7580 : }
7581 :
7582 0 : static PyObject *py_netr_USER_KEYS_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7583 : {
7584 0 : struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(py_obj);
7585 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7586 0 : Py_ssize_t blob_length = 0;
7587 : enum ndr_err_code err;
7588 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7589 0 : PyObject *allow_remaining_obj = NULL;
7590 0 : bool allow_remaining = false;
7591 :
7592 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7593 : discard_const_p(char *, kwnames),
7594 : &blob.data, &blob_length,
7595 : &allow_remaining_obj)) {
7596 0 : return NULL;
7597 : }
7598 0 : blob.length = blob_length;
7599 :
7600 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7601 0 : allow_remaining = true;
7602 : }
7603 :
7604 0 : if (allow_remaining) {
7605 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS);
7606 : } else {
7607 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS);
7608 : }
7609 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7610 0 : PyErr_SetNdrError(err);
7611 0 : return NULL;
7612 : }
7613 :
7614 0 : Py_RETURN_NONE;
7615 : }
7616 :
7617 0 : static PyObject *py_netr_USER_KEYS_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7618 : {
7619 0 : struct netr_USER_KEYS *object = (struct netr_USER_KEYS *)pytalloc_get_ptr(py_obj);
7620 : PyObject *ret;
7621 : char *retstr;
7622 :
7623 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_USER_KEYS, "netr_USER_KEYS", object);
7624 0 : ret = PyUnicode_FromString(retstr);
7625 0 : talloc_free(retstr);
7626 :
7627 0 : return ret;
7628 : }
7629 :
7630 : static PyMethodDef py_netr_USER_KEYS_methods[] = {
7631 : { "__ndr_pack__", (PyCFunction)py_netr_USER_KEYS_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7632 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_USER_KEYS_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7633 : { "__ndr_print__", (PyCFunction)py_netr_USER_KEYS_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7634 : { NULL, NULL, 0, NULL }
7635 : };
7636 :
7637 :
7638 : static PyTypeObject netr_USER_KEYS_Type = {
7639 : PyVarObject_HEAD_INIT(NULL, 0)
7640 : .tp_name = "netlogon.netr_USER_KEYS",
7641 : .tp_getset = py_netr_USER_KEYS_getsetters,
7642 : .tp_methods = py_netr_USER_KEYS_methods,
7643 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7644 : .tp_new = py_netr_USER_KEYS_new,
7645 : };
7646 :
7647 :
7648 0 : static PyObject *py_netr_USER_PRIVATE_INFO_get_SensitiveDataFlag(PyObject *obj, void *closure)
7649 : {
7650 0 : struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(obj);
7651 : PyObject *py_SensitiveDataFlag;
7652 0 : py_SensitiveDataFlag = PyLong_FromLong((uint16_t)object->SensitiveDataFlag);
7653 0 : return py_SensitiveDataFlag;
7654 : }
7655 :
7656 0 : static int py_netr_USER_PRIVATE_INFO_set_SensitiveDataFlag(PyObject *py_obj, PyObject *value, void *closure)
7657 : {
7658 0 : struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(py_obj);
7659 0 : if (value == NULL) {
7660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SensitiveDataFlag");
7661 0 : return -1;
7662 : }
7663 : {
7664 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SensitiveDataFlag));
7665 0 : if (PyLong_Check(value)) {
7666 : unsigned long long test_var;
7667 0 : test_var = PyLong_AsUnsignedLongLong(value);
7668 0 : if (PyErr_Occurred() != NULL) {
7669 0 : return -1;
7670 : }
7671 0 : if (test_var > uint_max) {
7672 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7673 : PyLong_Type.tp_name, uint_max, test_var);
7674 0 : return -1;
7675 : }
7676 0 : object->SensitiveDataFlag = test_var;
7677 : } else {
7678 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7679 : PyLong_Type.tp_name);
7680 0 : return -1;
7681 : }
7682 : }
7683 0 : return 0;
7684 : }
7685 :
7686 0 : static PyObject *py_netr_USER_PRIVATE_INFO_get_DataLength(PyObject *obj, void *closure)
7687 : {
7688 0 : struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(obj);
7689 : PyObject *py_DataLength;
7690 0 : py_DataLength = PyLong_FromUnsignedLongLong((uint32_t)object->DataLength);
7691 0 : return py_DataLength;
7692 : }
7693 :
7694 0 : static int py_netr_USER_PRIVATE_INFO_set_DataLength(PyObject *py_obj, PyObject *value, void *closure)
7695 : {
7696 0 : struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(py_obj);
7697 0 : if (value == NULL) {
7698 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->DataLength");
7699 0 : return -1;
7700 : }
7701 : {
7702 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->DataLength));
7703 0 : if (PyLong_Check(value)) {
7704 : unsigned long long test_var;
7705 0 : test_var = PyLong_AsUnsignedLongLong(value);
7706 0 : if (PyErr_Occurred() != NULL) {
7707 0 : return -1;
7708 : }
7709 0 : if (test_var > uint_max) {
7710 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7711 : PyLong_Type.tp_name, uint_max, test_var);
7712 0 : return -1;
7713 : }
7714 0 : object->DataLength = test_var;
7715 : } else {
7716 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7717 : PyLong_Type.tp_name);
7718 0 : return -1;
7719 : }
7720 : }
7721 0 : return 0;
7722 : }
7723 :
7724 0 : static PyObject *py_netr_USER_PRIVATE_INFO_get_SensitiveData(PyObject *obj, void *closure)
7725 : {
7726 0 : struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(obj);
7727 : PyObject *py_SensitiveData;
7728 0 : if (object->SensitiveData == NULL) {
7729 0 : Py_RETURN_NONE;
7730 : }
7731 0 : if (object->SensitiveData == NULL) {
7732 0 : py_SensitiveData = Py_None;
7733 0 : Py_INCREF(py_SensitiveData);
7734 : } else {
7735 0 : py_SensitiveData = PyList_New(object->DataLength);
7736 0 : if (py_SensitiveData == NULL) {
7737 0 : return NULL;
7738 : }
7739 : {
7740 : int SensitiveData_cntr_1;
7741 0 : for (SensitiveData_cntr_1 = 0; SensitiveData_cntr_1 < (object->DataLength); SensitiveData_cntr_1++) {
7742 : PyObject *py_SensitiveData_1;
7743 0 : py_SensitiveData_1 = PyLong_FromLong((uint16_t)object->SensitiveData[SensitiveData_cntr_1]);
7744 0 : PyList_SetItem(py_SensitiveData, SensitiveData_cntr_1, py_SensitiveData_1);
7745 : }
7746 : }
7747 : }
7748 0 : return py_SensitiveData;
7749 : }
7750 :
7751 0 : static int py_netr_USER_PRIVATE_INFO_set_SensitiveData(PyObject *py_obj, PyObject *value, void *closure)
7752 : {
7753 0 : struct netr_USER_PRIVATE_INFO *object = (struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(py_obj);
7754 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->SensitiveData));
7755 0 : if (value == NULL) {
7756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SensitiveData");
7757 0 : return -1;
7758 : }
7759 0 : if (value == Py_None) {
7760 0 : object->SensitiveData = NULL;
7761 : } else {
7762 0 : object->SensitiveData = NULL;
7763 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7764 : {
7765 : int SensitiveData_cntr_1;
7766 0 : object->SensitiveData = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->SensitiveData, PyList_GET_SIZE(value));
7767 0 : if (!object->SensitiveData) { return -1;; }
7768 0 : talloc_set_name_const(object->SensitiveData, "ARRAY: object->SensitiveData");
7769 0 : for (SensitiveData_cntr_1 = 0; SensitiveData_cntr_1 < PyList_GET_SIZE(value); SensitiveData_cntr_1++) {
7770 0 : if (PyList_GET_ITEM(value, SensitiveData_cntr_1) == NULL) {
7771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SensitiveData[SensitiveData_cntr_1]");
7772 0 : return -1;
7773 : }
7774 : {
7775 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SensitiveData[SensitiveData_cntr_1]));
7776 0 : if (PyLong_Check(PyList_GET_ITEM(value, SensitiveData_cntr_1))) {
7777 : unsigned long long test_var;
7778 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, SensitiveData_cntr_1));
7779 0 : if (PyErr_Occurred() != NULL) {
7780 0 : return -1;
7781 : }
7782 0 : if (test_var > uint_max) {
7783 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7784 : PyLong_Type.tp_name, uint_max, test_var);
7785 0 : return -1;
7786 : }
7787 0 : object->SensitiveData[SensitiveData_cntr_1] = test_var;
7788 : } else {
7789 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7790 : PyLong_Type.tp_name);
7791 0 : return -1;
7792 : }
7793 : }
7794 : }
7795 : }
7796 : }
7797 0 : return 0;
7798 : }
7799 :
7800 : static PyGetSetDef py_netr_USER_PRIVATE_INFO_getsetters[] = {
7801 : {
7802 : .name = discard_const_p(char, "SensitiveDataFlag"),
7803 : .get = py_netr_USER_PRIVATE_INFO_get_SensitiveDataFlag,
7804 : .set = py_netr_USER_PRIVATE_INFO_set_SensitiveDataFlag,
7805 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
7806 : },
7807 : {
7808 : .name = discard_const_p(char, "DataLength"),
7809 : .get = py_netr_USER_PRIVATE_INFO_get_DataLength,
7810 : .set = py_netr_USER_PRIVATE_INFO_set_DataLength,
7811 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7812 : },
7813 : {
7814 : .name = discard_const_p(char, "SensitiveData"),
7815 : .get = py_netr_USER_PRIVATE_INFO_get_SensitiveData,
7816 : .set = py_netr_USER_PRIVATE_INFO_set_SensitiveData,
7817 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
7818 : },
7819 : { .name = NULL }
7820 : };
7821 :
7822 0 : static PyObject *py_netr_USER_PRIVATE_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7823 : {
7824 0 : return pytalloc_new(struct netr_USER_PRIVATE_INFO, type);
7825 : }
7826 :
7827 :
7828 : static PyTypeObject netr_USER_PRIVATE_INFO_Type = {
7829 : PyVarObject_HEAD_INIT(NULL, 0)
7830 : .tp_name = "netlogon.netr_USER_PRIVATE_INFO",
7831 : .tp_getset = py_netr_USER_PRIVATE_INFO_getsetters,
7832 : .tp_methods = NULL,
7833 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7834 : .tp_new = py_netr_USER_PRIVATE_INFO_new,
7835 : };
7836 :
7837 :
7838 0 : static PyObject *py_netr_DELTA_USER_get_account_name(PyObject *obj, void *closure)
7839 : {
7840 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
7841 : PyObject *py_account_name;
7842 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
7843 0 : return py_account_name;
7844 : }
7845 :
7846 0 : static int py_netr_DELTA_USER_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
7847 : {
7848 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
7849 0 : if (value == NULL) {
7850 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
7851 0 : return -1;
7852 : }
7853 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7854 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7855 0 : PyErr_NoMemory();
7856 0 : return -1;
7857 : }
7858 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
7859 0 : return 0;
7860 : }
7861 :
7862 0 : static PyObject *py_netr_DELTA_USER_get_full_name(PyObject *obj, void *closure)
7863 : {
7864 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
7865 : PyObject *py_full_name;
7866 0 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
7867 0 : return py_full_name;
7868 : }
7869 :
7870 0 : static int py_netr_DELTA_USER_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
7871 : {
7872 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
7873 0 : if (value == NULL) {
7874 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
7875 0 : return -1;
7876 : }
7877 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7878 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7879 0 : PyErr_NoMemory();
7880 0 : return -1;
7881 : }
7882 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
7883 0 : return 0;
7884 : }
7885 :
7886 0 : static PyObject *py_netr_DELTA_USER_get_rid(PyObject *obj, void *closure)
7887 : {
7888 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
7889 : PyObject *py_rid;
7890 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
7891 0 : return py_rid;
7892 : }
7893 :
7894 0 : static int py_netr_DELTA_USER_set_rid(PyObject *py_obj, PyObject *value, void *closure)
7895 : {
7896 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
7897 0 : if (value == NULL) {
7898 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
7899 0 : return -1;
7900 : }
7901 : {
7902 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
7903 0 : if (PyLong_Check(value)) {
7904 : unsigned long long test_var;
7905 0 : test_var = PyLong_AsUnsignedLongLong(value);
7906 0 : if (PyErr_Occurred() != NULL) {
7907 0 : return -1;
7908 : }
7909 0 : if (test_var > uint_max) {
7910 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7911 : PyLong_Type.tp_name, uint_max, test_var);
7912 0 : return -1;
7913 : }
7914 0 : object->rid = test_var;
7915 : } else {
7916 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7917 : PyLong_Type.tp_name);
7918 0 : return -1;
7919 : }
7920 : }
7921 0 : return 0;
7922 : }
7923 :
7924 0 : static PyObject *py_netr_DELTA_USER_get_primary_gid(PyObject *obj, void *closure)
7925 : {
7926 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
7927 : PyObject *py_primary_gid;
7928 0 : py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid);
7929 0 : return py_primary_gid;
7930 : }
7931 :
7932 0 : static int py_netr_DELTA_USER_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
7933 : {
7934 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
7935 0 : if (value == NULL) {
7936 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
7937 0 : return -1;
7938 : }
7939 : {
7940 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
7941 0 : if (PyLong_Check(value)) {
7942 : unsigned long long test_var;
7943 0 : test_var = PyLong_AsUnsignedLongLong(value);
7944 0 : if (PyErr_Occurred() != NULL) {
7945 0 : return -1;
7946 : }
7947 0 : if (test_var > uint_max) {
7948 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7949 : PyLong_Type.tp_name, uint_max, test_var);
7950 0 : return -1;
7951 : }
7952 0 : object->primary_gid = test_var;
7953 : } else {
7954 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7955 : PyLong_Type.tp_name);
7956 0 : return -1;
7957 : }
7958 : }
7959 0 : return 0;
7960 : }
7961 :
7962 0 : static PyObject *py_netr_DELTA_USER_get_home_directory(PyObject *obj, void *closure)
7963 : {
7964 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
7965 : PyObject *py_home_directory;
7966 0 : py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
7967 0 : return py_home_directory;
7968 : }
7969 :
7970 0 : static int py_netr_DELTA_USER_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
7971 : {
7972 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
7973 0 : if (value == NULL) {
7974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory");
7975 0 : return -1;
7976 : }
7977 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7978 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7979 0 : PyErr_NoMemory();
7980 0 : return -1;
7981 : }
7982 0 : object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
7983 0 : return 0;
7984 : }
7985 :
7986 0 : static PyObject *py_netr_DELTA_USER_get_home_drive(PyObject *obj, void *closure)
7987 : {
7988 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
7989 : PyObject *py_home_drive;
7990 0 : py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
7991 0 : return py_home_drive;
7992 : }
7993 :
7994 0 : static int py_netr_DELTA_USER_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
7995 : {
7996 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
7997 0 : if (value == NULL) {
7998 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive");
7999 0 : return -1;
8000 : }
8001 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8002 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8003 0 : PyErr_NoMemory();
8004 0 : return -1;
8005 : }
8006 0 : object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
8007 0 : return 0;
8008 : }
8009 :
8010 0 : static PyObject *py_netr_DELTA_USER_get_logon_script(PyObject *obj, void *closure)
8011 : {
8012 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8013 : PyObject *py_logon_script;
8014 0 : py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
8015 0 : return py_logon_script;
8016 : }
8017 :
8018 0 : static int py_netr_DELTA_USER_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
8019 : {
8020 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8021 0 : if (value == NULL) {
8022 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script");
8023 0 : return -1;
8024 : }
8025 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8026 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8027 0 : PyErr_NoMemory();
8028 0 : return -1;
8029 : }
8030 0 : object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
8031 0 : return 0;
8032 : }
8033 :
8034 0 : static PyObject *py_netr_DELTA_USER_get_description(PyObject *obj, void *closure)
8035 : {
8036 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8037 : PyObject *py_description;
8038 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
8039 0 : return py_description;
8040 : }
8041 :
8042 0 : static int py_netr_DELTA_USER_set_description(PyObject *py_obj, PyObject *value, void *closure)
8043 : {
8044 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8045 0 : if (value == NULL) {
8046 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
8047 0 : return -1;
8048 : }
8049 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8050 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8051 0 : PyErr_NoMemory();
8052 0 : return -1;
8053 : }
8054 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
8055 0 : return 0;
8056 : }
8057 :
8058 0 : static PyObject *py_netr_DELTA_USER_get_workstations(PyObject *obj, void *closure)
8059 : {
8060 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8061 : PyObject *py_workstations;
8062 0 : py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
8063 0 : return py_workstations;
8064 : }
8065 :
8066 0 : static int py_netr_DELTA_USER_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
8067 : {
8068 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8069 0 : if (value == NULL) {
8070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations");
8071 0 : return -1;
8072 : }
8073 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8074 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8075 0 : PyErr_NoMemory();
8076 0 : return -1;
8077 : }
8078 0 : object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
8079 0 : return 0;
8080 : }
8081 :
8082 0 : static PyObject *py_netr_DELTA_USER_get_last_logon(PyObject *obj, void *closure)
8083 : {
8084 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8085 : PyObject *py_last_logon;
8086 0 : py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon);
8087 0 : return py_last_logon;
8088 : }
8089 :
8090 0 : static int py_netr_DELTA_USER_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
8091 : {
8092 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8093 0 : if (value == NULL) {
8094 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon");
8095 0 : return -1;
8096 : }
8097 : {
8098 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon));
8099 0 : if (PyLong_Check(value)) {
8100 : unsigned long long test_var;
8101 0 : test_var = PyLong_AsUnsignedLongLong(value);
8102 0 : if (PyErr_Occurred() != NULL) {
8103 0 : return -1;
8104 : }
8105 0 : if (test_var > uint_max) {
8106 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8107 : PyLong_Type.tp_name, uint_max, test_var);
8108 0 : return -1;
8109 : }
8110 0 : object->last_logon = test_var;
8111 : } else {
8112 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8113 : PyLong_Type.tp_name);
8114 0 : return -1;
8115 : }
8116 : }
8117 0 : return 0;
8118 : }
8119 :
8120 0 : static PyObject *py_netr_DELTA_USER_get_last_logoff(PyObject *obj, void *closure)
8121 : {
8122 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8123 : PyObject *py_last_logoff;
8124 0 : py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff);
8125 0 : return py_last_logoff;
8126 : }
8127 :
8128 0 : static int py_netr_DELTA_USER_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
8129 : {
8130 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8131 0 : if (value == NULL) {
8132 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff");
8133 0 : return -1;
8134 : }
8135 : {
8136 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff));
8137 0 : if (PyLong_Check(value)) {
8138 : unsigned long long test_var;
8139 0 : test_var = PyLong_AsUnsignedLongLong(value);
8140 0 : if (PyErr_Occurred() != NULL) {
8141 0 : return -1;
8142 : }
8143 0 : if (test_var > uint_max) {
8144 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8145 : PyLong_Type.tp_name, uint_max, test_var);
8146 0 : return -1;
8147 : }
8148 0 : object->last_logoff = test_var;
8149 : } else {
8150 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8151 : PyLong_Type.tp_name);
8152 0 : return -1;
8153 : }
8154 : }
8155 0 : return 0;
8156 : }
8157 :
8158 0 : static PyObject *py_netr_DELTA_USER_get_logon_hours(PyObject *obj, void *closure)
8159 : {
8160 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8161 : PyObject *py_logon_hours;
8162 0 : py_logon_hours = pytalloc_reference_ex(samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
8163 0 : return py_logon_hours;
8164 : }
8165 :
8166 0 : static int py_netr_DELTA_USER_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
8167 : {
8168 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8169 0 : if (value == NULL) {
8170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours");
8171 0 : return -1;
8172 : }
8173 0 : PY_CHECK_TYPE(samr_LogonHours_Type, value, return -1;);
8174 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8175 0 : PyErr_NoMemory();
8176 0 : return -1;
8177 : }
8178 0 : object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
8179 0 : return 0;
8180 : }
8181 :
8182 0 : static PyObject *py_netr_DELTA_USER_get_bad_password_count(PyObject *obj, void *closure)
8183 : {
8184 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8185 : PyObject *py_bad_password_count;
8186 0 : py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count);
8187 0 : return py_bad_password_count;
8188 : }
8189 :
8190 0 : static int py_netr_DELTA_USER_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
8191 : {
8192 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8193 0 : if (value == NULL) {
8194 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count");
8195 0 : return -1;
8196 : }
8197 : {
8198 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count));
8199 0 : if (PyLong_Check(value)) {
8200 : unsigned long long test_var;
8201 0 : test_var = PyLong_AsUnsignedLongLong(value);
8202 0 : if (PyErr_Occurred() != NULL) {
8203 0 : return -1;
8204 : }
8205 0 : if (test_var > uint_max) {
8206 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8207 : PyLong_Type.tp_name, uint_max, test_var);
8208 0 : return -1;
8209 : }
8210 0 : object->bad_password_count = test_var;
8211 : } else {
8212 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8213 : PyLong_Type.tp_name);
8214 0 : return -1;
8215 : }
8216 : }
8217 0 : return 0;
8218 : }
8219 :
8220 0 : static PyObject *py_netr_DELTA_USER_get_logon_count(PyObject *obj, void *closure)
8221 : {
8222 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8223 : PyObject *py_logon_count;
8224 0 : py_logon_count = PyLong_FromLong((uint16_t)object->logon_count);
8225 0 : return py_logon_count;
8226 : }
8227 :
8228 0 : static int py_netr_DELTA_USER_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
8229 : {
8230 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8231 0 : if (value == NULL) {
8232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count");
8233 0 : return -1;
8234 : }
8235 : {
8236 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count));
8237 0 : if (PyLong_Check(value)) {
8238 : unsigned long long test_var;
8239 0 : test_var = PyLong_AsUnsignedLongLong(value);
8240 0 : if (PyErr_Occurred() != NULL) {
8241 0 : return -1;
8242 : }
8243 0 : if (test_var > uint_max) {
8244 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8245 : PyLong_Type.tp_name, uint_max, test_var);
8246 0 : return -1;
8247 : }
8248 0 : object->logon_count = test_var;
8249 : } else {
8250 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8251 : PyLong_Type.tp_name);
8252 0 : return -1;
8253 : }
8254 : }
8255 0 : return 0;
8256 : }
8257 :
8258 0 : static PyObject *py_netr_DELTA_USER_get_last_password_change(PyObject *obj, void *closure)
8259 : {
8260 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8261 : PyObject *py_last_password_change;
8262 0 : py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change);
8263 0 : return py_last_password_change;
8264 : }
8265 :
8266 0 : static int py_netr_DELTA_USER_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
8267 : {
8268 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8269 0 : if (value == NULL) {
8270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change");
8271 0 : return -1;
8272 : }
8273 : {
8274 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change));
8275 0 : if (PyLong_Check(value)) {
8276 : unsigned long long test_var;
8277 0 : test_var = PyLong_AsUnsignedLongLong(value);
8278 0 : if (PyErr_Occurred() != NULL) {
8279 0 : return -1;
8280 : }
8281 0 : if (test_var > uint_max) {
8282 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8283 : PyLong_Type.tp_name, uint_max, test_var);
8284 0 : return -1;
8285 : }
8286 0 : object->last_password_change = test_var;
8287 : } else {
8288 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8289 : PyLong_Type.tp_name);
8290 0 : return -1;
8291 : }
8292 : }
8293 0 : return 0;
8294 : }
8295 :
8296 0 : static PyObject *py_netr_DELTA_USER_get_acct_expiry(PyObject *obj, void *closure)
8297 : {
8298 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8299 : PyObject *py_acct_expiry;
8300 0 : py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry);
8301 0 : return py_acct_expiry;
8302 : }
8303 :
8304 0 : static int py_netr_DELTA_USER_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
8305 : {
8306 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8307 0 : if (value == NULL) {
8308 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry");
8309 0 : return -1;
8310 : }
8311 : {
8312 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry));
8313 0 : if (PyLong_Check(value)) {
8314 : unsigned long long test_var;
8315 0 : test_var = PyLong_AsUnsignedLongLong(value);
8316 0 : if (PyErr_Occurred() != NULL) {
8317 0 : return -1;
8318 : }
8319 0 : if (test_var > uint_max) {
8320 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8321 : PyLong_Type.tp_name, uint_max, test_var);
8322 0 : return -1;
8323 : }
8324 0 : object->acct_expiry = test_var;
8325 : } else {
8326 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8327 : PyLong_Type.tp_name);
8328 0 : return -1;
8329 : }
8330 : }
8331 0 : return 0;
8332 : }
8333 :
8334 0 : static PyObject *py_netr_DELTA_USER_get_acct_flags(PyObject *obj, void *closure)
8335 : {
8336 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8337 : PyObject *py_acct_flags;
8338 0 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
8339 0 : return py_acct_flags;
8340 : }
8341 :
8342 0 : static int py_netr_DELTA_USER_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
8343 : {
8344 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8345 0 : if (value == NULL) {
8346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
8347 0 : return -1;
8348 : }
8349 : {
8350 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
8351 0 : if (PyLong_Check(value)) {
8352 : unsigned long long test_var;
8353 0 : test_var = PyLong_AsUnsignedLongLong(value);
8354 0 : if (PyErr_Occurred() != NULL) {
8355 0 : return -1;
8356 : }
8357 0 : if (test_var > uint_max) {
8358 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8359 : PyLong_Type.tp_name, uint_max, test_var);
8360 0 : return -1;
8361 : }
8362 0 : object->acct_flags = test_var;
8363 : } else {
8364 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8365 : PyLong_Type.tp_name);
8366 0 : return -1;
8367 : }
8368 : }
8369 0 : return 0;
8370 : }
8371 :
8372 0 : static PyObject *py_netr_DELTA_USER_get_lmpassword(PyObject *obj, void *closure)
8373 : {
8374 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8375 : PyObject *py_lmpassword;
8376 0 : py_lmpassword = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lmpassword);
8377 0 : return py_lmpassword;
8378 : }
8379 :
8380 0 : static int py_netr_DELTA_USER_set_lmpassword(PyObject *py_obj, PyObject *value, void *closure)
8381 : {
8382 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8383 0 : if (value == NULL) {
8384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lmpassword");
8385 0 : return -1;
8386 : }
8387 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
8388 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8389 0 : PyErr_NoMemory();
8390 0 : return -1;
8391 : }
8392 0 : object->lmpassword = *(struct samr_Password *)pytalloc_get_ptr(value);
8393 0 : return 0;
8394 : }
8395 :
8396 0 : static PyObject *py_netr_DELTA_USER_get_ntpassword(PyObject *obj, void *closure)
8397 : {
8398 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8399 : PyObject *py_ntpassword;
8400 0 : py_ntpassword = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->ntpassword);
8401 0 : return py_ntpassword;
8402 : }
8403 :
8404 0 : static int py_netr_DELTA_USER_set_ntpassword(PyObject *py_obj, PyObject *value, void *closure)
8405 : {
8406 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8407 0 : if (value == NULL) {
8408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ntpassword");
8409 0 : return -1;
8410 : }
8411 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
8412 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8413 0 : PyErr_NoMemory();
8414 0 : return -1;
8415 : }
8416 0 : object->ntpassword = *(struct samr_Password *)pytalloc_get_ptr(value);
8417 0 : return 0;
8418 : }
8419 :
8420 0 : static PyObject *py_netr_DELTA_USER_get_nt_password_present(PyObject *obj, void *closure)
8421 : {
8422 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8423 : PyObject *py_nt_password_present;
8424 0 : py_nt_password_present = PyLong_FromLong((uint16_t)object->nt_password_present);
8425 0 : return py_nt_password_present;
8426 : }
8427 :
8428 0 : static int py_netr_DELTA_USER_set_nt_password_present(PyObject *py_obj, PyObject *value, void *closure)
8429 : {
8430 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8431 0 : if (value == NULL) {
8432 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_password_present");
8433 0 : return -1;
8434 : }
8435 : {
8436 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_password_present));
8437 0 : if (PyLong_Check(value)) {
8438 : unsigned long long test_var;
8439 0 : test_var = PyLong_AsUnsignedLongLong(value);
8440 0 : if (PyErr_Occurred() != NULL) {
8441 0 : return -1;
8442 : }
8443 0 : if (test_var > uint_max) {
8444 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8445 : PyLong_Type.tp_name, uint_max, test_var);
8446 0 : return -1;
8447 : }
8448 0 : object->nt_password_present = test_var;
8449 : } else {
8450 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8451 : PyLong_Type.tp_name);
8452 0 : return -1;
8453 : }
8454 : }
8455 0 : return 0;
8456 : }
8457 :
8458 0 : static PyObject *py_netr_DELTA_USER_get_lm_password_present(PyObject *obj, void *closure)
8459 : {
8460 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8461 : PyObject *py_lm_password_present;
8462 0 : py_lm_password_present = PyLong_FromLong((uint16_t)object->lm_password_present);
8463 0 : return py_lm_password_present;
8464 : }
8465 :
8466 0 : static int py_netr_DELTA_USER_set_lm_password_present(PyObject *py_obj, PyObject *value, void *closure)
8467 : {
8468 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8469 0 : if (value == NULL) {
8470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_password_present");
8471 0 : return -1;
8472 : }
8473 : {
8474 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_password_present));
8475 0 : if (PyLong_Check(value)) {
8476 : unsigned long long test_var;
8477 0 : test_var = PyLong_AsUnsignedLongLong(value);
8478 0 : if (PyErr_Occurred() != NULL) {
8479 0 : return -1;
8480 : }
8481 0 : if (test_var > uint_max) {
8482 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8483 : PyLong_Type.tp_name, uint_max, test_var);
8484 0 : return -1;
8485 : }
8486 0 : object->lm_password_present = test_var;
8487 : } else {
8488 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8489 : PyLong_Type.tp_name);
8490 0 : return -1;
8491 : }
8492 : }
8493 0 : return 0;
8494 : }
8495 :
8496 0 : static PyObject *py_netr_DELTA_USER_get_password_expired(PyObject *obj, void *closure)
8497 : {
8498 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8499 : PyObject *py_password_expired;
8500 0 : py_password_expired = PyLong_FromLong((uint16_t)object->password_expired);
8501 0 : return py_password_expired;
8502 : }
8503 :
8504 0 : static int py_netr_DELTA_USER_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
8505 : {
8506 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8507 0 : if (value == NULL) {
8508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired");
8509 0 : return -1;
8510 : }
8511 : {
8512 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired));
8513 0 : if (PyLong_Check(value)) {
8514 : unsigned long long test_var;
8515 0 : test_var = PyLong_AsUnsignedLongLong(value);
8516 0 : if (PyErr_Occurred() != NULL) {
8517 0 : return -1;
8518 : }
8519 0 : if (test_var > uint_max) {
8520 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8521 : PyLong_Type.tp_name, uint_max, test_var);
8522 0 : return -1;
8523 : }
8524 0 : object->password_expired = test_var;
8525 : } else {
8526 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8527 : PyLong_Type.tp_name);
8528 0 : return -1;
8529 : }
8530 : }
8531 0 : return 0;
8532 : }
8533 :
8534 0 : static PyObject *py_netr_DELTA_USER_get_comment(PyObject *obj, void *closure)
8535 : {
8536 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8537 : PyObject *py_comment;
8538 0 : py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment);
8539 0 : return py_comment;
8540 : }
8541 :
8542 0 : static int py_netr_DELTA_USER_set_comment(PyObject *py_obj, PyObject *value, void *closure)
8543 : {
8544 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8545 0 : if (value == NULL) {
8546 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
8547 0 : return -1;
8548 : }
8549 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8550 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8551 0 : PyErr_NoMemory();
8552 0 : return -1;
8553 : }
8554 0 : object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
8555 0 : return 0;
8556 : }
8557 :
8558 0 : static PyObject *py_netr_DELTA_USER_get_parameters(PyObject *obj, void *closure)
8559 : {
8560 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8561 : PyObject *py_parameters;
8562 0 : py_parameters = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->parameters);
8563 0 : return py_parameters;
8564 : }
8565 :
8566 0 : static int py_netr_DELTA_USER_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
8567 : {
8568 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8569 0 : if (value == NULL) {
8570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parameters");
8571 0 : return -1;
8572 : }
8573 0 : PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
8574 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8575 0 : PyErr_NoMemory();
8576 0 : return -1;
8577 : }
8578 0 : object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
8579 0 : return 0;
8580 : }
8581 :
8582 0 : static PyObject *py_netr_DELTA_USER_get_country_code(PyObject *obj, void *closure)
8583 : {
8584 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8585 : PyObject *py_country_code;
8586 0 : py_country_code = PyLong_FromLong((uint16_t)object->country_code);
8587 0 : return py_country_code;
8588 : }
8589 :
8590 0 : static int py_netr_DELTA_USER_set_country_code(PyObject *py_obj, PyObject *value, void *closure)
8591 : {
8592 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8593 0 : if (value == NULL) {
8594 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->country_code");
8595 0 : return -1;
8596 : }
8597 : {
8598 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->country_code));
8599 0 : if (PyLong_Check(value)) {
8600 : unsigned long long test_var;
8601 0 : test_var = PyLong_AsUnsignedLongLong(value);
8602 0 : if (PyErr_Occurred() != NULL) {
8603 0 : return -1;
8604 : }
8605 0 : if (test_var > uint_max) {
8606 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8607 : PyLong_Type.tp_name, uint_max, test_var);
8608 0 : return -1;
8609 : }
8610 0 : object->country_code = test_var;
8611 : } else {
8612 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8613 : PyLong_Type.tp_name);
8614 0 : return -1;
8615 : }
8616 : }
8617 0 : return 0;
8618 : }
8619 :
8620 0 : static PyObject *py_netr_DELTA_USER_get_code_page(PyObject *obj, void *closure)
8621 : {
8622 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8623 : PyObject *py_code_page;
8624 0 : py_code_page = PyLong_FromLong((uint16_t)object->code_page);
8625 0 : return py_code_page;
8626 : }
8627 :
8628 0 : static int py_netr_DELTA_USER_set_code_page(PyObject *py_obj, PyObject *value, void *closure)
8629 : {
8630 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8631 0 : if (value == NULL) {
8632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->code_page");
8633 0 : return -1;
8634 : }
8635 : {
8636 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->code_page));
8637 0 : if (PyLong_Check(value)) {
8638 : unsigned long long test_var;
8639 0 : test_var = PyLong_AsUnsignedLongLong(value);
8640 0 : if (PyErr_Occurred() != NULL) {
8641 0 : return -1;
8642 : }
8643 0 : if (test_var > uint_max) {
8644 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8645 : PyLong_Type.tp_name, uint_max, test_var);
8646 0 : return -1;
8647 : }
8648 0 : object->code_page = test_var;
8649 : } else {
8650 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8651 : PyLong_Type.tp_name);
8652 0 : return -1;
8653 : }
8654 : }
8655 0 : return 0;
8656 : }
8657 :
8658 0 : static PyObject *py_netr_DELTA_USER_get_user_private_info(PyObject *obj, void *closure)
8659 : {
8660 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8661 : PyObject *py_user_private_info;
8662 0 : py_user_private_info = pytalloc_reference_ex(&netr_USER_PRIVATE_INFO_Type, pytalloc_get_mem_ctx(obj), &object->user_private_info);
8663 0 : return py_user_private_info;
8664 : }
8665 :
8666 0 : static int py_netr_DELTA_USER_set_user_private_info(PyObject *py_obj, PyObject *value, void *closure)
8667 : {
8668 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8669 0 : if (value == NULL) {
8670 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_private_info");
8671 0 : return -1;
8672 : }
8673 0 : PY_CHECK_TYPE(&netr_USER_PRIVATE_INFO_Type, value, return -1;);
8674 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8675 0 : PyErr_NoMemory();
8676 0 : return -1;
8677 : }
8678 0 : object->user_private_info = *(struct netr_USER_PRIVATE_INFO *)pytalloc_get_ptr(value);
8679 0 : return 0;
8680 : }
8681 :
8682 0 : static PyObject *py_netr_DELTA_USER_get_SecurityInformation(PyObject *obj, void *closure)
8683 : {
8684 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8685 : PyObject *py_SecurityInformation;
8686 0 : py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation);
8687 0 : return py_SecurityInformation;
8688 : }
8689 :
8690 0 : static int py_netr_DELTA_USER_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure)
8691 : {
8692 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8693 0 : if (value == NULL) {
8694 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation");
8695 0 : return -1;
8696 : }
8697 : {
8698 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation));
8699 0 : if (PyLong_Check(value)) {
8700 : unsigned long long test_var;
8701 0 : test_var = PyLong_AsUnsignedLongLong(value);
8702 0 : if (PyErr_Occurred() != NULL) {
8703 0 : return -1;
8704 : }
8705 0 : if (test_var > uint_max) {
8706 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8707 : PyLong_Type.tp_name, uint_max, test_var);
8708 0 : return -1;
8709 : }
8710 0 : object->SecurityInformation = test_var;
8711 : } else {
8712 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8713 : PyLong_Type.tp_name);
8714 0 : return -1;
8715 : }
8716 : }
8717 0 : return 0;
8718 : }
8719 :
8720 0 : static PyObject *py_netr_DELTA_USER_get_sdbuf(PyObject *obj, void *closure)
8721 : {
8722 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8723 : PyObject *py_sdbuf;
8724 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf);
8725 0 : return py_sdbuf;
8726 : }
8727 :
8728 0 : static int py_netr_DELTA_USER_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
8729 : {
8730 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8731 0 : if (value == NULL) {
8732 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf");
8733 0 : return -1;
8734 : }
8735 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
8736 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8737 0 : PyErr_NoMemory();
8738 0 : return -1;
8739 : }
8740 0 : object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
8741 0 : return 0;
8742 : }
8743 :
8744 0 : static PyObject *py_netr_DELTA_USER_get_profile_path(PyObject *obj, void *closure)
8745 : {
8746 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8747 : PyObject *py_profile_path;
8748 0 : py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
8749 0 : return py_profile_path;
8750 : }
8751 :
8752 0 : static int py_netr_DELTA_USER_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
8753 : {
8754 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8755 0 : if (value == NULL) {
8756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path");
8757 0 : return -1;
8758 : }
8759 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8760 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8761 0 : PyErr_NoMemory();
8762 0 : return -1;
8763 : }
8764 0 : object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
8765 0 : return 0;
8766 : }
8767 :
8768 0 : static PyObject *py_netr_DELTA_USER_get_unknown2(PyObject *obj, void *closure)
8769 : {
8770 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8771 : PyObject *py_unknown2;
8772 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
8773 0 : return py_unknown2;
8774 : }
8775 :
8776 0 : static int py_netr_DELTA_USER_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
8777 : {
8778 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8779 0 : if (value == NULL) {
8780 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
8781 0 : return -1;
8782 : }
8783 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8784 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8785 0 : PyErr_NoMemory();
8786 0 : return -1;
8787 : }
8788 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
8789 0 : return 0;
8790 : }
8791 :
8792 0 : static PyObject *py_netr_DELTA_USER_get_unknown3(PyObject *obj, void *closure)
8793 : {
8794 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8795 : PyObject *py_unknown3;
8796 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
8797 0 : return py_unknown3;
8798 : }
8799 :
8800 0 : static int py_netr_DELTA_USER_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
8801 : {
8802 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8803 0 : if (value == NULL) {
8804 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
8805 0 : return -1;
8806 : }
8807 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8808 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8809 0 : PyErr_NoMemory();
8810 0 : return -1;
8811 : }
8812 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
8813 0 : return 0;
8814 : }
8815 :
8816 0 : static PyObject *py_netr_DELTA_USER_get_unknown4(PyObject *obj, void *closure)
8817 : {
8818 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8819 : PyObject *py_unknown4;
8820 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
8821 0 : return py_unknown4;
8822 : }
8823 :
8824 0 : static int py_netr_DELTA_USER_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
8825 : {
8826 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8827 0 : if (value == NULL) {
8828 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
8829 0 : return -1;
8830 : }
8831 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
8832 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8833 0 : PyErr_NoMemory();
8834 0 : return -1;
8835 : }
8836 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
8837 0 : return 0;
8838 : }
8839 :
8840 0 : static PyObject *py_netr_DELTA_USER_get_unknown5(PyObject *obj, void *closure)
8841 : {
8842 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8843 : PyObject *py_unknown5;
8844 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
8845 0 : return py_unknown5;
8846 : }
8847 :
8848 0 : static int py_netr_DELTA_USER_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
8849 : {
8850 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8851 0 : if (value == NULL) {
8852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
8853 0 : return -1;
8854 : }
8855 : {
8856 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
8857 0 : if (PyLong_Check(value)) {
8858 : unsigned long long test_var;
8859 0 : test_var = PyLong_AsUnsignedLongLong(value);
8860 0 : if (PyErr_Occurred() != NULL) {
8861 0 : return -1;
8862 : }
8863 0 : if (test_var > uint_max) {
8864 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8865 : PyLong_Type.tp_name, uint_max, test_var);
8866 0 : return -1;
8867 : }
8868 0 : object->unknown5 = test_var;
8869 : } else {
8870 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8871 : PyLong_Type.tp_name);
8872 0 : return -1;
8873 : }
8874 : }
8875 0 : return 0;
8876 : }
8877 :
8878 0 : static PyObject *py_netr_DELTA_USER_get_unknown6(PyObject *obj, void *closure)
8879 : {
8880 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8881 : PyObject *py_unknown6;
8882 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
8883 0 : return py_unknown6;
8884 : }
8885 :
8886 0 : static int py_netr_DELTA_USER_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
8887 : {
8888 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8889 0 : if (value == NULL) {
8890 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
8891 0 : return -1;
8892 : }
8893 : {
8894 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
8895 0 : if (PyLong_Check(value)) {
8896 : unsigned long long test_var;
8897 0 : test_var = PyLong_AsUnsignedLongLong(value);
8898 0 : if (PyErr_Occurred() != NULL) {
8899 0 : return -1;
8900 : }
8901 0 : if (test_var > uint_max) {
8902 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8903 : PyLong_Type.tp_name, uint_max, test_var);
8904 0 : return -1;
8905 : }
8906 0 : object->unknown6 = test_var;
8907 : } else {
8908 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8909 : PyLong_Type.tp_name);
8910 0 : return -1;
8911 : }
8912 : }
8913 0 : return 0;
8914 : }
8915 :
8916 0 : static PyObject *py_netr_DELTA_USER_get_unknown7(PyObject *obj, void *closure)
8917 : {
8918 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8919 : PyObject *py_unknown7;
8920 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
8921 0 : return py_unknown7;
8922 : }
8923 :
8924 0 : static int py_netr_DELTA_USER_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
8925 : {
8926 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8927 0 : if (value == NULL) {
8928 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
8929 0 : return -1;
8930 : }
8931 : {
8932 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
8933 0 : if (PyLong_Check(value)) {
8934 : unsigned long long test_var;
8935 0 : test_var = PyLong_AsUnsignedLongLong(value);
8936 0 : if (PyErr_Occurred() != NULL) {
8937 0 : return -1;
8938 : }
8939 0 : if (test_var > uint_max) {
8940 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8941 : PyLong_Type.tp_name, uint_max, test_var);
8942 0 : return -1;
8943 : }
8944 0 : object->unknown7 = test_var;
8945 : } else {
8946 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8947 : PyLong_Type.tp_name);
8948 0 : return -1;
8949 : }
8950 : }
8951 0 : return 0;
8952 : }
8953 :
8954 0 : static PyObject *py_netr_DELTA_USER_get_unknown8(PyObject *obj, void *closure)
8955 : {
8956 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(obj);
8957 : PyObject *py_unknown8;
8958 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
8959 0 : return py_unknown8;
8960 : }
8961 :
8962 0 : static int py_netr_DELTA_USER_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
8963 : {
8964 0 : struct netr_DELTA_USER *object = (struct netr_DELTA_USER *)pytalloc_get_ptr(py_obj);
8965 0 : if (value == NULL) {
8966 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
8967 0 : return -1;
8968 : }
8969 : {
8970 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
8971 0 : if (PyLong_Check(value)) {
8972 : unsigned long long test_var;
8973 0 : test_var = PyLong_AsUnsignedLongLong(value);
8974 0 : if (PyErr_Occurred() != NULL) {
8975 0 : return -1;
8976 : }
8977 0 : if (test_var > uint_max) {
8978 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8979 : PyLong_Type.tp_name, uint_max, test_var);
8980 0 : return -1;
8981 : }
8982 0 : object->unknown8 = test_var;
8983 : } else {
8984 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8985 : PyLong_Type.tp_name);
8986 0 : return -1;
8987 : }
8988 : }
8989 0 : return 0;
8990 : }
8991 :
8992 : static PyGetSetDef py_netr_DELTA_USER_getsetters[] = {
8993 : {
8994 : .name = discard_const_p(char, "account_name"),
8995 : .get = py_netr_DELTA_USER_get_account_name,
8996 : .set = py_netr_DELTA_USER_set_account_name,
8997 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
8998 : },
8999 : {
9000 : .name = discard_const_p(char, "full_name"),
9001 : .get = py_netr_DELTA_USER_get_full_name,
9002 : .set = py_netr_DELTA_USER_set_full_name,
9003 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9004 : },
9005 : {
9006 : .name = discard_const_p(char, "rid"),
9007 : .get = py_netr_DELTA_USER_get_rid,
9008 : .set = py_netr_DELTA_USER_set_rid,
9009 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9010 : },
9011 : {
9012 : .name = discard_const_p(char, "primary_gid"),
9013 : .get = py_netr_DELTA_USER_get_primary_gid,
9014 : .set = py_netr_DELTA_USER_set_primary_gid,
9015 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9016 : },
9017 : {
9018 : .name = discard_const_p(char, "home_directory"),
9019 : .get = py_netr_DELTA_USER_get_home_directory,
9020 : .set = py_netr_DELTA_USER_set_home_directory,
9021 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9022 : },
9023 : {
9024 : .name = discard_const_p(char, "home_drive"),
9025 : .get = py_netr_DELTA_USER_get_home_drive,
9026 : .set = py_netr_DELTA_USER_set_home_drive,
9027 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9028 : },
9029 : {
9030 : .name = discard_const_p(char, "logon_script"),
9031 : .get = py_netr_DELTA_USER_get_logon_script,
9032 : .set = py_netr_DELTA_USER_set_logon_script,
9033 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9034 : },
9035 : {
9036 : .name = discard_const_p(char, "description"),
9037 : .get = py_netr_DELTA_USER_get_description,
9038 : .set = py_netr_DELTA_USER_set_description,
9039 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9040 : },
9041 : {
9042 : .name = discard_const_p(char, "workstations"),
9043 : .get = py_netr_DELTA_USER_get_workstations,
9044 : .set = py_netr_DELTA_USER_set_workstations,
9045 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9046 : },
9047 : {
9048 : .name = discard_const_p(char, "last_logon"),
9049 : .get = py_netr_DELTA_USER_get_last_logon,
9050 : .set = py_netr_DELTA_USER_set_last_logon,
9051 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
9052 : },
9053 : {
9054 : .name = discard_const_p(char, "last_logoff"),
9055 : .get = py_netr_DELTA_USER_get_last_logoff,
9056 : .set = py_netr_DELTA_USER_set_last_logoff,
9057 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
9058 : },
9059 : {
9060 : .name = discard_const_p(char, "logon_hours"),
9061 : .get = py_netr_DELTA_USER_get_logon_hours,
9062 : .set = py_netr_DELTA_USER_set_logon_hours,
9063 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours")
9064 : },
9065 : {
9066 : .name = discard_const_p(char, "bad_password_count"),
9067 : .get = py_netr_DELTA_USER_get_bad_password_count,
9068 : .set = py_netr_DELTA_USER_set_bad_password_count,
9069 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9070 : },
9071 : {
9072 : .name = discard_const_p(char, "logon_count"),
9073 : .get = py_netr_DELTA_USER_get_logon_count,
9074 : .set = py_netr_DELTA_USER_set_logon_count,
9075 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9076 : },
9077 : {
9078 : .name = discard_const_p(char, "last_password_change"),
9079 : .get = py_netr_DELTA_USER_get_last_password_change,
9080 : .set = py_netr_DELTA_USER_set_last_password_change,
9081 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
9082 : },
9083 : {
9084 : .name = discard_const_p(char, "acct_expiry"),
9085 : .get = py_netr_DELTA_USER_get_acct_expiry,
9086 : .set = py_netr_DELTA_USER_set_acct_expiry,
9087 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
9088 : },
9089 : {
9090 : .name = discard_const_p(char, "acct_flags"),
9091 : .get = py_netr_DELTA_USER_get_acct_flags,
9092 : .set = py_netr_DELTA_USER_set_acct_flags,
9093 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
9094 : },
9095 : {
9096 : .name = discard_const_p(char, "lmpassword"),
9097 : .get = py_netr_DELTA_USER_get_lmpassword,
9098 : .set = py_netr_DELTA_USER_set_lmpassword,
9099 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
9100 : },
9101 : {
9102 : .name = discard_const_p(char, "ntpassword"),
9103 : .get = py_netr_DELTA_USER_get_ntpassword,
9104 : .set = py_netr_DELTA_USER_set_ntpassword,
9105 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
9106 : },
9107 : {
9108 : .name = discard_const_p(char, "nt_password_present"),
9109 : .get = py_netr_DELTA_USER_get_nt_password_present,
9110 : .set = py_netr_DELTA_USER_set_nt_password_present,
9111 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9112 : },
9113 : {
9114 : .name = discard_const_p(char, "lm_password_present"),
9115 : .get = py_netr_DELTA_USER_get_lm_password_present,
9116 : .set = py_netr_DELTA_USER_set_lm_password_present,
9117 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9118 : },
9119 : {
9120 : .name = discard_const_p(char, "password_expired"),
9121 : .get = py_netr_DELTA_USER_get_password_expired,
9122 : .set = py_netr_DELTA_USER_set_password_expired,
9123 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9124 : },
9125 : {
9126 : .name = discard_const_p(char, "comment"),
9127 : .get = py_netr_DELTA_USER_get_comment,
9128 : .set = py_netr_DELTA_USER_set_comment,
9129 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9130 : },
9131 : {
9132 : .name = discard_const_p(char, "parameters"),
9133 : .get = py_netr_DELTA_USER_get_parameters,
9134 : .set = py_netr_DELTA_USER_set_parameters,
9135 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString")
9136 : },
9137 : {
9138 : .name = discard_const_p(char, "country_code"),
9139 : .get = py_netr_DELTA_USER_get_country_code,
9140 : .set = py_netr_DELTA_USER_set_country_code,
9141 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9142 : },
9143 : {
9144 : .name = discard_const_p(char, "code_page"),
9145 : .get = py_netr_DELTA_USER_get_code_page,
9146 : .set = py_netr_DELTA_USER_set_code_page,
9147 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9148 : },
9149 : {
9150 : .name = discard_const_p(char, "user_private_info"),
9151 : .get = py_netr_DELTA_USER_get_user_private_info,
9152 : .set = py_netr_DELTA_USER_set_user_private_info,
9153 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_USER_PRIVATE_INFO")
9154 : },
9155 : {
9156 : .name = discard_const_p(char, "SecurityInformation"),
9157 : .get = py_netr_DELTA_USER_get_SecurityInformation,
9158 : .set = py_netr_DELTA_USER_set_SecurityInformation,
9159 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9160 : },
9161 : {
9162 : .name = discard_const_p(char, "sdbuf"),
9163 : .get = py_netr_DELTA_USER_get_sdbuf,
9164 : .set = py_netr_DELTA_USER_set_sdbuf,
9165 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
9166 : },
9167 : {
9168 : .name = discard_const_p(char, "profile_path"),
9169 : .get = py_netr_DELTA_USER_get_profile_path,
9170 : .set = py_netr_DELTA_USER_set_profile_path,
9171 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9172 : },
9173 : {
9174 : .name = discard_const_p(char, "unknown2"),
9175 : .get = py_netr_DELTA_USER_get_unknown2,
9176 : .set = py_netr_DELTA_USER_set_unknown2,
9177 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9178 : },
9179 : {
9180 : .name = discard_const_p(char, "unknown3"),
9181 : .get = py_netr_DELTA_USER_get_unknown3,
9182 : .set = py_netr_DELTA_USER_set_unknown3,
9183 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9184 : },
9185 : {
9186 : .name = discard_const_p(char, "unknown4"),
9187 : .get = py_netr_DELTA_USER_get_unknown4,
9188 : .set = py_netr_DELTA_USER_set_unknown4,
9189 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9190 : },
9191 : {
9192 : .name = discard_const_p(char, "unknown5"),
9193 : .get = py_netr_DELTA_USER_get_unknown5,
9194 : .set = py_netr_DELTA_USER_set_unknown5,
9195 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9196 : },
9197 : {
9198 : .name = discard_const_p(char, "unknown6"),
9199 : .get = py_netr_DELTA_USER_get_unknown6,
9200 : .set = py_netr_DELTA_USER_set_unknown6,
9201 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9202 : },
9203 : {
9204 : .name = discard_const_p(char, "unknown7"),
9205 : .get = py_netr_DELTA_USER_get_unknown7,
9206 : .set = py_netr_DELTA_USER_set_unknown7,
9207 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9208 : },
9209 : {
9210 : .name = discard_const_p(char, "unknown8"),
9211 : .get = py_netr_DELTA_USER_get_unknown8,
9212 : .set = py_netr_DELTA_USER_set_unknown8,
9213 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9214 : },
9215 : { .name = NULL }
9216 : };
9217 :
9218 0 : static PyObject *py_netr_DELTA_USER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9219 : {
9220 0 : return pytalloc_new(struct netr_DELTA_USER, type);
9221 : }
9222 :
9223 :
9224 : static PyTypeObject netr_DELTA_USER_Type = {
9225 : PyVarObject_HEAD_INIT(NULL, 0)
9226 : .tp_name = "netlogon.netr_DELTA_USER",
9227 : .tp_getset = py_netr_DELTA_USER_getsetters,
9228 : .tp_methods = NULL,
9229 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9230 : .tp_new = py_netr_DELTA_USER_new,
9231 : };
9232 :
9233 :
9234 0 : static PyObject *py_netr_DELTA_DOMAIN_get_domain_name(PyObject *obj, void *closure)
9235 : {
9236 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9237 : PyObject *py_domain_name;
9238 0 : py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
9239 0 : return py_domain_name;
9240 : }
9241 :
9242 0 : static int py_netr_DELTA_DOMAIN_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
9243 : {
9244 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9245 0 : if (value == NULL) {
9246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
9247 0 : return -1;
9248 : }
9249 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
9250 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9251 0 : PyErr_NoMemory();
9252 0 : return -1;
9253 : }
9254 0 : object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
9255 0 : return 0;
9256 : }
9257 :
9258 0 : static PyObject *py_netr_DELTA_DOMAIN_get_oem_information(PyObject *obj, void *closure)
9259 : {
9260 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9261 : PyObject *py_oem_information;
9262 0 : py_oem_information = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->oem_information);
9263 0 : return py_oem_information;
9264 : }
9265 :
9266 0 : static int py_netr_DELTA_DOMAIN_set_oem_information(PyObject *py_obj, PyObject *value, void *closure)
9267 : {
9268 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9269 0 : if (value == NULL) {
9270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->oem_information");
9271 0 : return -1;
9272 : }
9273 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
9274 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9275 0 : PyErr_NoMemory();
9276 0 : return -1;
9277 : }
9278 0 : object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value);
9279 0 : return 0;
9280 : }
9281 :
9282 0 : static PyObject *py_netr_DELTA_DOMAIN_get_force_logoff_time(PyObject *obj, void *closure)
9283 : {
9284 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9285 : PyObject *py_force_logoff_time;
9286 0 : py_force_logoff_time = PyLong_FromLongLong(object->force_logoff_time);
9287 0 : return py_force_logoff_time;
9288 : }
9289 :
9290 0 : static int py_netr_DELTA_DOMAIN_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
9291 : {
9292 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9293 0 : if (value == NULL) {
9294 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_logoff_time");
9295 0 : return -1;
9296 : }
9297 : {
9298 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->force_logoff_time));
9299 0 : const long long int_min = -int_max - 1;
9300 0 : if (PyLong_Check(value)) {
9301 : long long test_var;
9302 0 : test_var = PyLong_AsLongLong(value);
9303 0 : if (PyErr_Occurred() != NULL) {
9304 0 : return -1;
9305 : }
9306 0 : if (test_var < int_min || test_var > int_max) {
9307 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
9308 : PyLong_Type.tp_name, int_min, int_max, test_var);
9309 0 : return -1;
9310 : }
9311 0 : object->force_logoff_time = test_var;
9312 : } else {
9313 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9314 : PyLong_Type.tp_name);
9315 0 : return -1;
9316 : }
9317 : }
9318 0 : return 0;
9319 : }
9320 :
9321 0 : static PyObject *py_netr_DELTA_DOMAIN_get_min_password_length(PyObject *obj, void *closure)
9322 : {
9323 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9324 : PyObject *py_min_password_length;
9325 0 : py_min_password_length = PyLong_FromLong((uint16_t)object->min_password_length);
9326 0 : return py_min_password_length;
9327 : }
9328 :
9329 0 : static int py_netr_DELTA_DOMAIN_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure)
9330 : {
9331 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9332 0 : if (value == NULL) {
9333 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_length");
9334 0 : return -1;
9335 : }
9336 : {
9337 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_password_length));
9338 0 : if (PyLong_Check(value)) {
9339 : unsigned long long test_var;
9340 0 : test_var = PyLong_AsUnsignedLongLong(value);
9341 0 : if (PyErr_Occurred() != NULL) {
9342 0 : return -1;
9343 : }
9344 0 : if (test_var > uint_max) {
9345 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9346 : PyLong_Type.tp_name, uint_max, test_var);
9347 0 : return -1;
9348 : }
9349 0 : object->min_password_length = test_var;
9350 : } else {
9351 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9352 : PyLong_Type.tp_name);
9353 0 : return -1;
9354 : }
9355 : }
9356 0 : return 0;
9357 : }
9358 :
9359 0 : static PyObject *py_netr_DELTA_DOMAIN_get_password_history_length(PyObject *obj, void *closure)
9360 : {
9361 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9362 : PyObject *py_password_history_length;
9363 0 : py_password_history_length = PyLong_FromLong((uint16_t)object->password_history_length);
9364 0 : return py_password_history_length;
9365 : }
9366 :
9367 0 : static int py_netr_DELTA_DOMAIN_set_password_history_length(PyObject *py_obj, PyObject *value, void *closure)
9368 : {
9369 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9370 0 : if (value == NULL) {
9371 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_history_length");
9372 0 : return -1;
9373 : }
9374 : {
9375 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_history_length));
9376 0 : if (PyLong_Check(value)) {
9377 : unsigned long long test_var;
9378 0 : test_var = PyLong_AsUnsignedLongLong(value);
9379 0 : if (PyErr_Occurred() != NULL) {
9380 0 : return -1;
9381 : }
9382 0 : if (test_var > uint_max) {
9383 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9384 : PyLong_Type.tp_name, uint_max, test_var);
9385 0 : return -1;
9386 : }
9387 0 : object->password_history_length = test_var;
9388 : } else {
9389 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9390 : PyLong_Type.tp_name);
9391 0 : return -1;
9392 : }
9393 : }
9394 0 : return 0;
9395 : }
9396 :
9397 0 : static PyObject *py_netr_DELTA_DOMAIN_get_max_password_age(PyObject *obj, void *closure)
9398 : {
9399 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9400 : PyObject *py_max_password_age;
9401 0 : py_max_password_age = PyLong_FromLongLong(object->max_password_age);
9402 0 : return py_max_password_age;
9403 : }
9404 :
9405 0 : static int py_netr_DELTA_DOMAIN_set_max_password_age(PyObject *py_obj, PyObject *value, void *closure)
9406 : {
9407 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9408 0 : if (value == NULL) {
9409 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_password_age");
9410 0 : return -1;
9411 : }
9412 : {
9413 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->max_password_age));
9414 0 : const long long int_min = -int_max - 1;
9415 0 : if (PyLong_Check(value)) {
9416 : long long test_var;
9417 0 : test_var = PyLong_AsLongLong(value);
9418 0 : if (PyErr_Occurred() != NULL) {
9419 0 : return -1;
9420 : }
9421 0 : if (test_var < int_min || test_var > int_max) {
9422 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
9423 : PyLong_Type.tp_name, int_min, int_max, test_var);
9424 0 : return -1;
9425 : }
9426 0 : object->max_password_age = test_var;
9427 : } else {
9428 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9429 : PyLong_Type.tp_name);
9430 0 : return -1;
9431 : }
9432 : }
9433 0 : return 0;
9434 : }
9435 :
9436 0 : static PyObject *py_netr_DELTA_DOMAIN_get_min_password_age(PyObject *obj, void *closure)
9437 : {
9438 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9439 : PyObject *py_min_password_age;
9440 0 : py_min_password_age = PyLong_FromLongLong(object->min_password_age);
9441 0 : return py_min_password_age;
9442 : }
9443 :
9444 0 : static int py_netr_DELTA_DOMAIN_set_min_password_age(PyObject *py_obj, PyObject *value, void *closure)
9445 : {
9446 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9447 0 : if (value == NULL) {
9448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_age");
9449 0 : return -1;
9450 : }
9451 : {
9452 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->min_password_age));
9453 0 : const long long int_min = -int_max - 1;
9454 0 : if (PyLong_Check(value)) {
9455 : long long test_var;
9456 0 : test_var = PyLong_AsLongLong(value);
9457 0 : if (PyErr_Occurred() != NULL) {
9458 0 : return -1;
9459 : }
9460 0 : if (test_var < int_min || test_var > int_max) {
9461 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
9462 : PyLong_Type.tp_name, int_min, int_max, test_var);
9463 0 : return -1;
9464 : }
9465 0 : object->min_password_age = test_var;
9466 : } else {
9467 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9468 : PyLong_Type.tp_name);
9469 0 : return -1;
9470 : }
9471 : }
9472 0 : return 0;
9473 : }
9474 :
9475 0 : static PyObject *py_netr_DELTA_DOMAIN_get_sequence_num(PyObject *obj, void *closure)
9476 : {
9477 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9478 : PyObject *py_sequence_num;
9479 0 : py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num);
9480 0 : return py_sequence_num;
9481 : }
9482 :
9483 0 : static int py_netr_DELTA_DOMAIN_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
9484 : {
9485 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9486 0 : if (value == NULL) {
9487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num");
9488 0 : return -1;
9489 : }
9490 : {
9491 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num));
9492 0 : if (PyLong_Check(value)) {
9493 : unsigned long long test_var;
9494 0 : test_var = PyLong_AsUnsignedLongLong(value);
9495 0 : if (PyErr_Occurred() != NULL) {
9496 0 : return -1;
9497 : }
9498 0 : if (test_var > uint_max) {
9499 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9500 : PyLong_Type.tp_name, uint_max, test_var);
9501 0 : return -1;
9502 : }
9503 0 : object->sequence_num = test_var;
9504 : } else {
9505 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9506 : PyLong_Type.tp_name);
9507 0 : return -1;
9508 : }
9509 : }
9510 0 : return 0;
9511 : }
9512 :
9513 0 : static PyObject *py_netr_DELTA_DOMAIN_get_domain_create_time(PyObject *obj, void *closure)
9514 : {
9515 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9516 : PyObject *py_domain_create_time;
9517 0 : py_domain_create_time = PyLong_FromUnsignedLongLong(object->domain_create_time);
9518 0 : return py_domain_create_time;
9519 : }
9520 :
9521 0 : static int py_netr_DELTA_DOMAIN_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure)
9522 : {
9523 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9524 0 : if (value == NULL) {
9525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_create_time");
9526 0 : return -1;
9527 : }
9528 : {
9529 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_create_time));
9530 0 : if (PyLong_Check(value)) {
9531 : unsigned long long test_var;
9532 0 : test_var = PyLong_AsUnsignedLongLong(value);
9533 0 : if (PyErr_Occurred() != NULL) {
9534 0 : return -1;
9535 : }
9536 0 : if (test_var > uint_max) {
9537 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9538 : PyLong_Type.tp_name, uint_max, test_var);
9539 0 : return -1;
9540 : }
9541 0 : object->domain_create_time = test_var;
9542 : } else {
9543 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9544 : PyLong_Type.tp_name);
9545 0 : return -1;
9546 : }
9547 : }
9548 0 : return 0;
9549 : }
9550 :
9551 0 : static PyObject *py_netr_DELTA_DOMAIN_get_SecurityInformation(PyObject *obj, void *closure)
9552 : {
9553 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9554 : PyObject *py_SecurityInformation;
9555 0 : py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation);
9556 0 : return py_SecurityInformation;
9557 : }
9558 :
9559 0 : static int py_netr_DELTA_DOMAIN_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure)
9560 : {
9561 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9562 0 : if (value == NULL) {
9563 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation");
9564 0 : return -1;
9565 : }
9566 : {
9567 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation));
9568 0 : if (PyLong_Check(value)) {
9569 : unsigned long long test_var;
9570 0 : test_var = PyLong_AsUnsignedLongLong(value);
9571 0 : if (PyErr_Occurred() != NULL) {
9572 0 : return -1;
9573 : }
9574 0 : if (test_var > uint_max) {
9575 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9576 : PyLong_Type.tp_name, uint_max, test_var);
9577 0 : return -1;
9578 : }
9579 0 : object->SecurityInformation = test_var;
9580 : } else {
9581 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9582 : PyLong_Type.tp_name);
9583 0 : return -1;
9584 : }
9585 : }
9586 0 : return 0;
9587 : }
9588 :
9589 0 : static PyObject *py_netr_DELTA_DOMAIN_get_sdbuf(PyObject *obj, void *closure)
9590 : {
9591 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9592 : PyObject *py_sdbuf;
9593 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf);
9594 0 : return py_sdbuf;
9595 : }
9596 :
9597 0 : static int py_netr_DELTA_DOMAIN_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
9598 : {
9599 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9600 0 : if (value == NULL) {
9601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf");
9602 0 : return -1;
9603 : }
9604 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
9605 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9606 0 : PyErr_NoMemory();
9607 0 : return -1;
9608 : }
9609 0 : object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
9610 0 : return 0;
9611 : }
9612 :
9613 0 : static PyObject *py_netr_DELTA_DOMAIN_get_account_lockout(PyObject *obj, void *closure)
9614 : {
9615 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9616 : PyObject *py_account_lockout;
9617 0 : py_account_lockout = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->account_lockout);
9618 0 : return py_account_lockout;
9619 : }
9620 :
9621 0 : static int py_netr_DELTA_DOMAIN_set_account_lockout(PyObject *py_obj, PyObject *value, void *closure)
9622 : {
9623 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9624 0 : if (value == NULL) {
9625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_lockout");
9626 0 : return -1;
9627 : }
9628 0 : PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
9629 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9630 0 : PyErr_NoMemory();
9631 0 : return -1;
9632 : }
9633 0 : object->account_lockout = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
9634 0 : return 0;
9635 : }
9636 :
9637 0 : static PyObject *py_netr_DELTA_DOMAIN_get_unknown2(PyObject *obj, void *closure)
9638 : {
9639 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9640 : PyObject *py_unknown2;
9641 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
9642 0 : return py_unknown2;
9643 : }
9644 :
9645 0 : static int py_netr_DELTA_DOMAIN_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
9646 : {
9647 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9648 0 : if (value == NULL) {
9649 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
9650 0 : return -1;
9651 : }
9652 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
9653 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9654 0 : PyErr_NoMemory();
9655 0 : return -1;
9656 : }
9657 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
9658 0 : return 0;
9659 : }
9660 :
9661 0 : static PyObject *py_netr_DELTA_DOMAIN_get_unknown3(PyObject *obj, void *closure)
9662 : {
9663 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9664 : PyObject *py_unknown3;
9665 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
9666 0 : return py_unknown3;
9667 : }
9668 :
9669 0 : static int py_netr_DELTA_DOMAIN_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
9670 : {
9671 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9672 0 : if (value == NULL) {
9673 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
9674 0 : return -1;
9675 : }
9676 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
9677 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9678 0 : PyErr_NoMemory();
9679 0 : return -1;
9680 : }
9681 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
9682 0 : return 0;
9683 : }
9684 :
9685 0 : static PyObject *py_netr_DELTA_DOMAIN_get_unknown4(PyObject *obj, void *closure)
9686 : {
9687 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9688 : PyObject *py_unknown4;
9689 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
9690 0 : return py_unknown4;
9691 : }
9692 :
9693 0 : static int py_netr_DELTA_DOMAIN_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
9694 : {
9695 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9696 0 : if (value == NULL) {
9697 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
9698 0 : return -1;
9699 : }
9700 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
9701 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9702 0 : PyErr_NoMemory();
9703 0 : return -1;
9704 : }
9705 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
9706 0 : return 0;
9707 : }
9708 :
9709 0 : static PyObject *py_netr_DELTA_DOMAIN_get_logon_to_chgpass(PyObject *obj, void *closure)
9710 : {
9711 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9712 : PyObject *py_logon_to_chgpass;
9713 0 : py_logon_to_chgpass = PyLong_FromUnsignedLongLong((uint32_t)object->logon_to_chgpass);
9714 0 : return py_logon_to_chgpass;
9715 : }
9716 :
9717 0 : static int py_netr_DELTA_DOMAIN_set_logon_to_chgpass(PyObject *py_obj, PyObject *value, void *closure)
9718 : {
9719 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9720 0 : if (value == NULL) {
9721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_to_chgpass");
9722 0 : return -1;
9723 : }
9724 : {
9725 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_to_chgpass));
9726 0 : if (PyLong_Check(value)) {
9727 : unsigned long long test_var;
9728 0 : test_var = PyLong_AsUnsignedLongLong(value);
9729 0 : if (PyErr_Occurred() != NULL) {
9730 0 : return -1;
9731 : }
9732 0 : if (test_var > uint_max) {
9733 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9734 : PyLong_Type.tp_name, uint_max, test_var);
9735 0 : return -1;
9736 : }
9737 0 : object->logon_to_chgpass = test_var;
9738 : } else {
9739 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9740 : PyLong_Type.tp_name);
9741 0 : return -1;
9742 : }
9743 : }
9744 0 : return 0;
9745 : }
9746 :
9747 0 : static PyObject *py_netr_DELTA_DOMAIN_get_unknown6(PyObject *obj, void *closure)
9748 : {
9749 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9750 : PyObject *py_unknown6;
9751 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
9752 0 : return py_unknown6;
9753 : }
9754 :
9755 0 : static int py_netr_DELTA_DOMAIN_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
9756 : {
9757 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9758 0 : if (value == NULL) {
9759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
9760 0 : return -1;
9761 : }
9762 : {
9763 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
9764 0 : if (PyLong_Check(value)) {
9765 : unsigned long long test_var;
9766 0 : test_var = PyLong_AsUnsignedLongLong(value);
9767 0 : if (PyErr_Occurred() != NULL) {
9768 0 : return -1;
9769 : }
9770 0 : if (test_var > uint_max) {
9771 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9772 : PyLong_Type.tp_name, uint_max, test_var);
9773 0 : return -1;
9774 : }
9775 0 : object->unknown6 = test_var;
9776 : } else {
9777 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9778 : PyLong_Type.tp_name);
9779 0 : return -1;
9780 : }
9781 : }
9782 0 : return 0;
9783 : }
9784 :
9785 0 : static PyObject *py_netr_DELTA_DOMAIN_get_unknown7(PyObject *obj, void *closure)
9786 : {
9787 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9788 : PyObject *py_unknown7;
9789 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
9790 0 : return py_unknown7;
9791 : }
9792 :
9793 0 : static int py_netr_DELTA_DOMAIN_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
9794 : {
9795 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9796 0 : if (value == NULL) {
9797 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
9798 0 : return -1;
9799 : }
9800 : {
9801 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
9802 0 : if (PyLong_Check(value)) {
9803 : unsigned long long test_var;
9804 0 : test_var = PyLong_AsUnsignedLongLong(value);
9805 0 : if (PyErr_Occurred() != NULL) {
9806 0 : return -1;
9807 : }
9808 0 : if (test_var > uint_max) {
9809 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9810 : PyLong_Type.tp_name, uint_max, test_var);
9811 0 : return -1;
9812 : }
9813 0 : object->unknown7 = test_var;
9814 : } else {
9815 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9816 : PyLong_Type.tp_name);
9817 0 : return -1;
9818 : }
9819 : }
9820 0 : return 0;
9821 : }
9822 :
9823 0 : static PyObject *py_netr_DELTA_DOMAIN_get_unknown8(PyObject *obj, void *closure)
9824 : {
9825 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(obj);
9826 : PyObject *py_unknown8;
9827 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
9828 0 : return py_unknown8;
9829 : }
9830 :
9831 0 : static int py_netr_DELTA_DOMAIN_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
9832 : {
9833 0 : struct netr_DELTA_DOMAIN *object = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(py_obj);
9834 0 : if (value == NULL) {
9835 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
9836 0 : return -1;
9837 : }
9838 : {
9839 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
9840 0 : if (PyLong_Check(value)) {
9841 : unsigned long long test_var;
9842 0 : test_var = PyLong_AsUnsignedLongLong(value);
9843 0 : if (PyErr_Occurred() != NULL) {
9844 0 : return -1;
9845 : }
9846 0 : if (test_var > uint_max) {
9847 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9848 : PyLong_Type.tp_name, uint_max, test_var);
9849 0 : return -1;
9850 : }
9851 0 : object->unknown8 = test_var;
9852 : } else {
9853 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9854 : PyLong_Type.tp_name);
9855 0 : return -1;
9856 : }
9857 : }
9858 0 : return 0;
9859 : }
9860 :
9861 : static PyGetSetDef py_netr_DELTA_DOMAIN_getsetters[] = {
9862 : {
9863 : .name = discard_const_p(char, "domain_name"),
9864 : .get = py_netr_DELTA_DOMAIN_get_domain_name,
9865 : .set = py_netr_DELTA_DOMAIN_set_domain_name,
9866 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9867 : },
9868 : {
9869 : .name = discard_const_p(char, "oem_information"),
9870 : .get = py_netr_DELTA_DOMAIN_get_oem_information,
9871 : .set = py_netr_DELTA_DOMAIN_set_oem_information,
9872 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9873 : },
9874 : {
9875 : .name = discard_const_p(char, "force_logoff_time"),
9876 : .get = py_netr_DELTA_DOMAIN_get_force_logoff_time,
9877 : .set = py_netr_DELTA_DOMAIN_set_force_logoff_time,
9878 : .doc = discard_const_p(char, "PIDL-generated element of base type dlong")
9879 : },
9880 : {
9881 : .name = discard_const_p(char, "min_password_length"),
9882 : .get = py_netr_DELTA_DOMAIN_get_min_password_length,
9883 : .set = py_netr_DELTA_DOMAIN_set_min_password_length,
9884 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9885 : },
9886 : {
9887 : .name = discard_const_p(char, "password_history_length"),
9888 : .get = py_netr_DELTA_DOMAIN_get_password_history_length,
9889 : .set = py_netr_DELTA_DOMAIN_set_password_history_length,
9890 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9891 : },
9892 : {
9893 : .name = discard_const_p(char, "max_password_age"),
9894 : .get = py_netr_DELTA_DOMAIN_get_max_password_age,
9895 : .set = py_netr_DELTA_DOMAIN_set_max_password_age,
9896 : .doc = discard_const_p(char, "PIDL-generated element of base type dlong")
9897 : },
9898 : {
9899 : .name = discard_const_p(char, "min_password_age"),
9900 : .get = py_netr_DELTA_DOMAIN_get_min_password_age,
9901 : .set = py_netr_DELTA_DOMAIN_set_min_password_age,
9902 : .doc = discard_const_p(char, "PIDL-generated element of base type dlong")
9903 : },
9904 : {
9905 : .name = discard_const_p(char, "sequence_num"),
9906 : .get = py_netr_DELTA_DOMAIN_get_sequence_num,
9907 : .set = py_netr_DELTA_DOMAIN_set_sequence_num,
9908 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
9909 : },
9910 : {
9911 : .name = discard_const_p(char, "domain_create_time"),
9912 : .get = py_netr_DELTA_DOMAIN_get_domain_create_time,
9913 : .set = py_netr_DELTA_DOMAIN_set_domain_create_time,
9914 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
9915 : },
9916 : {
9917 : .name = discard_const_p(char, "SecurityInformation"),
9918 : .get = py_netr_DELTA_DOMAIN_get_SecurityInformation,
9919 : .set = py_netr_DELTA_DOMAIN_set_SecurityInformation,
9920 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9921 : },
9922 : {
9923 : .name = discard_const_p(char, "sdbuf"),
9924 : .get = py_netr_DELTA_DOMAIN_get_sdbuf,
9925 : .set = py_netr_DELTA_DOMAIN_set_sdbuf,
9926 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
9927 : },
9928 : {
9929 : .name = discard_const_p(char, "account_lockout"),
9930 : .get = py_netr_DELTA_DOMAIN_get_account_lockout,
9931 : .set = py_netr_DELTA_DOMAIN_set_account_lockout,
9932 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString")
9933 : },
9934 : {
9935 : .name = discard_const_p(char, "unknown2"),
9936 : .get = py_netr_DELTA_DOMAIN_get_unknown2,
9937 : .set = py_netr_DELTA_DOMAIN_set_unknown2,
9938 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9939 : },
9940 : {
9941 : .name = discard_const_p(char, "unknown3"),
9942 : .get = py_netr_DELTA_DOMAIN_get_unknown3,
9943 : .set = py_netr_DELTA_DOMAIN_set_unknown3,
9944 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9945 : },
9946 : {
9947 : .name = discard_const_p(char, "unknown4"),
9948 : .get = py_netr_DELTA_DOMAIN_get_unknown4,
9949 : .set = py_netr_DELTA_DOMAIN_set_unknown4,
9950 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9951 : },
9952 : {
9953 : .name = discard_const_p(char, "logon_to_chgpass"),
9954 : .get = py_netr_DELTA_DOMAIN_get_logon_to_chgpass,
9955 : .set = py_netr_DELTA_DOMAIN_set_logon_to_chgpass,
9956 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9957 : },
9958 : {
9959 : .name = discard_const_p(char, "unknown6"),
9960 : .get = py_netr_DELTA_DOMAIN_get_unknown6,
9961 : .set = py_netr_DELTA_DOMAIN_set_unknown6,
9962 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9963 : },
9964 : {
9965 : .name = discard_const_p(char, "unknown7"),
9966 : .get = py_netr_DELTA_DOMAIN_get_unknown7,
9967 : .set = py_netr_DELTA_DOMAIN_set_unknown7,
9968 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9969 : },
9970 : {
9971 : .name = discard_const_p(char, "unknown8"),
9972 : .get = py_netr_DELTA_DOMAIN_get_unknown8,
9973 : .set = py_netr_DELTA_DOMAIN_set_unknown8,
9974 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9975 : },
9976 : { .name = NULL }
9977 : };
9978 :
9979 0 : static PyObject *py_netr_DELTA_DOMAIN_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9980 : {
9981 0 : return pytalloc_new(struct netr_DELTA_DOMAIN, type);
9982 : }
9983 :
9984 :
9985 : static PyTypeObject netr_DELTA_DOMAIN_Type = {
9986 : PyVarObject_HEAD_INIT(NULL, 0)
9987 : .tp_name = "netlogon.netr_DELTA_DOMAIN",
9988 : .tp_getset = py_netr_DELTA_DOMAIN_getsetters,
9989 : .tp_methods = NULL,
9990 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9991 : .tp_new = py_netr_DELTA_DOMAIN_new,
9992 : };
9993 :
9994 :
9995 0 : static PyObject *py_netr_DELTA_GROUP_get_group_name(PyObject *obj, void *closure)
9996 : {
9997 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
9998 : PyObject *py_group_name;
9999 0 : py_group_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->group_name);
10000 0 : return py_group_name;
10001 : }
10002 :
10003 0 : static int py_netr_DELTA_GROUP_set_group_name(PyObject *py_obj, PyObject *value, void *closure)
10004 : {
10005 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10006 0 : if (value == NULL) {
10007 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group_name");
10008 0 : return -1;
10009 : }
10010 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10011 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10012 0 : PyErr_NoMemory();
10013 0 : return -1;
10014 : }
10015 0 : object->group_name = *(struct lsa_String *)pytalloc_get_ptr(value);
10016 0 : return 0;
10017 : }
10018 :
10019 0 : static PyObject *py_netr_DELTA_GROUP_get_rid(PyObject *obj, void *closure)
10020 : {
10021 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10022 : PyObject *py_rid;
10023 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
10024 0 : return py_rid;
10025 : }
10026 :
10027 0 : static int py_netr_DELTA_GROUP_set_rid(PyObject *py_obj, PyObject *value, void *closure)
10028 : {
10029 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10030 0 : if (value == NULL) {
10031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
10032 0 : return -1;
10033 : }
10034 : {
10035 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
10036 0 : if (PyLong_Check(value)) {
10037 : unsigned long long test_var;
10038 0 : test_var = PyLong_AsUnsignedLongLong(value);
10039 0 : if (PyErr_Occurred() != NULL) {
10040 0 : return -1;
10041 : }
10042 0 : if (test_var > uint_max) {
10043 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10044 : PyLong_Type.tp_name, uint_max, test_var);
10045 0 : return -1;
10046 : }
10047 0 : object->rid = test_var;
10048 : } else {
10049 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10050 : PyLong_Type.tp_name);
10051 0 : return -1;
10052 : }
10053 : }
10054 0 : return 0;
10055 : }
10056 :
10057 0 : static PyObject *py_netr_DELTA_GROUP_get_attributes(PyObject *obj, void *closure)
10058 : {
10059 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10060 : PyObject *py_attributes;
10061 0 : py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes);
10062 0 : return py_attributes;
10063 : }
10064 :
10065 0 : static int py_netr_DELTA_GROUP_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
10066 : {
10067 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10068 0 : if (value == NULL) {
10069 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes");
10070 0 : return -1;
10071 : }
10072 : {
10073 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
10074 0 : if (PyLong_Check(value)) {
10075 : unsigned long long test_var;
10076 0 : test_var = PyLong_AsUnsignedLongLong(value);
10077 0 : if (PyErr_Occurred() != NULL) {
10078 0 : return -1;
10079 : }
10080 0 : if (test_var > uint_max) {
10081 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10082 : PyLong_Type.tp_name, uint_max, test_var);
10083 0 : return -1;
10084 : }
10085 0 : object->attributes = test_var;
10086 : } else {
10087 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10088 : PyLong_Type.tp_name);
10089 0 : return -1;
10090 : }
10091 : }
10092 0 : return 0;
10093 : }
10094 :
10095 0 : static PyObject *py_netr_DELTA_GROUP_get_description(PyObject *obj, void *closure)
10096 : {
10097 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10098 : PyObject *py_description;
10099 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
10100 0 : return py_description;
10101 : }
10102 :
10103 0 : static int py_netr_DELTA_GROUP_set_description(PyObject *py_obj, PyObject *value, void *closure)
10104 : {
10105 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10106 0 : if (value == NULL) {
10107 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
10108 0 : return -1;
10109 : }
10110 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10111 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10112 0 : PyErr_NoMemory();
10113 0 : return -1;
10114 : }
10115 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
10116 0 : return 0;
10117 : }
10118 :
10119 0 : static PyObject *py_netr_DELTA_GROUP_get_SecurityInformation(PyObject *obj, void *closure)
10120 : {
10121 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10122 : PyObject *py_SecurityInformation;
10123 0 : py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation);
10124 0 : return py_SecurityInformation;
10125 : }
10126 :
10127 0 : static int py_netr_DELTA_GROUP_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure)
10128 : {
10129 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10130 0 : if (value == NULL) {
10131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation");
10132 0 : return -1;
10133 : }
10134 : {
10135 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation));
10136 0 : if (PyLong_Check(value)) {
10137 : unsigned long long test_var;
10138 0 : test_var = PyLong_AsUnsignedLongLong(value);
10139 0 : if (PyErr_Occurred() != NULL) {
10140 0 : return -1;
10141 : }
10142 0 : if (test_var > uint_max) {
10143 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10144 : PyLong_Type.tp_name, uint_max, test_var);
10145 0 : return -1;
10146 : }
10147 0 : object->SecurityInformation = test_var;
10148 : } else {
10149 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10150 : PyLong_Type.tp_name);
10151 0 : return -1;
10152 : }
10153 : }
10154 0 : return 0;
10155 : }
10156 :
10157 0 : static PyObject *py_netr_DELTA_GROUP_get_sdbuf(PyObject *obj, void *closure)
10158 : {
10159 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10160 : PyObject *py_sdbuf;
10161 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf);
10162 0 : return py_sdbuf;
10163 : }
10164 :
10165 0 : static int py_netr_DELTA_GROUP_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
10166 : {
10167 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10168 0 : if (value == NULL) {
10169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf");
10170 0 : return -1;
10171 : }
10172 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
10173 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10174 0 : PyErr_NoMemory();
10175 0 : return -1;
10176 : }
10177 0 : object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
10178 0 : return 0;
10179 : }
10180 :
10181 0 : static PyObject *py_netr_DELTA_GROUP_get_unknown1(PyObject *obj, void *closure)
10182 : {
10183 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10184 : PyObject *py_unknown1;
10185 0 : py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1);
10186 0 : return py_unknown1;
10187 : }
10188 :
10189 0 : static int py_netr_DELTA_GROUP_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
10190 : {
10191 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10192 0 : if (value == NULL) {
10193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
10194 0 : return -1;
10195 : }
10196 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10197 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10198 0 : PyErr_NoMemory();
10199 0 : return -1;
10200 : }
10201 0 : object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value);
10202 0 : return 0;
10203 : }
10204 :
10205 0 : static PyObject *py_netr_DELTA_GROUP_get_unknown2(PyObject *obj, void *closure)
10206 : {
10207 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10208 : PyObject *py_unknown2;
10209 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
10210 0 : return py_unknown2;
10211 : }
10212 :
10213 0 : static int py_netr_DELTA_GROUP_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
10214 : {
10215 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10216 0 : if (value == NULL) {
10217 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
10218 0 : return -1;
10219 : }
10220 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10221 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10222 0 : PyErr_NoMemory();
10223 0 : return -1;
10224 : }
10225 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
10226 0 : return 0;
10227 : }
10228 :
10229 0 : static PyObject *py_netr_DELTA_GROUP_get_unknown3(PyObject *obj, void *closure)
10230 : {
10231 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10232 : PyObject *py_unknown3;
10233 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
10234 0 : return py_unknown3;
10235 : }
10236 :
10237 0 : static int py_netr_DELTA_GROUP_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
10238 : {
10239 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10240 0 : if (value == NULL) {
10241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
10242 0 : return -1;
10243 : }
10244 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10245 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10246 0 : PyErr_NoMemory();
10247 0 : return -1;
10248 : }
10249 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
10250 0 : return 0;
10251 : }
10252 :
10253 0 : static PyObject *py_netr_DELTA_GROUP_get_unknown4(PyObject *obj, void *closure)
10254 : {
10255 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10256 : PyObject *py_unknown4;
10257 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
10258 0 : return py_unknown4;
10259 : }
10260 :
10261 0 : static int py_netr_DELTA_GROUP_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
10262 : {
10263 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10264 0 : if (value == NULL) {
10265 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
10266 0 : return -1;
10267 : }
10268 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10269 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10270 0 : PyErr_NoMemory();
10271 0 : return -1;
10272 : }
10273 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
10274 0 : return 0;
10275 : }
10276 :
10277 0 : static PyObject *py_netr_DELTA_GROUP_get_unknown5(PyObject *obj, void *closure)
10278 : {
10279 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10280 : PyObject *py_unknown5;
10281 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
10282 0 : return py_unknown5;
10283 : }
10284 :
10285 0 : static int py_netr_DELTA_GROUP_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
10286 : {
10287 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10288 0 : if (value == NULL) {
10289 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
10290 0 : return -1;
10291 : }
10292 : {
10293 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
10294 0 : if (PyLong_Check(value)) {
10295 : unsigned long long test_var;
10296 0 : test_var = PyLong_AsUnsignedLongLong(value);
10297 0 : if (PyErr_Occurred() != NULL) {
10298 0 : return -1;
10299 : }
10300 0 : if (test_var > uint_max) {
10301 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10302 : PyLong_Type.tp_name, uint_max, test_var);
10303 0 : return -1;
10304 : }
10305 0 : object->unknown5 = test_var;
10306 : } else {
10307 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10308 : PyLong_Type.tp_name);
10309 0 : return -1;
10310 : }
10311 : }
10312 0 : return 0;
10313 : }
10314 :
10315 0 : static PyObject *py_netr_DELTA_GROUP_get_unknown6(PyObject *obj, void *closure)
10316 : {
10317 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10318 : PyObject *py_unknown6;
10319 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
10320 0 : return py_unknown6;
10321 : }
10322 :
10323 0 : static int py_netr_DELTA_GROUP_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
10324 : {
10325 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10326 0 : if (value == NULL) {
10327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
10328 0 : return -1;
10329 : }
10330 : {
10331 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
10332 0 : if (PyLong_Check(value)) {
10333 : unsigned long long test_var;
10334 0 : test_var = PyLong_AsUnsignedLongLong(value);
10335 0 : if (PyErr_Occurred() != NULL) {
10336 0 : return -1;
10337 : }
10338 0 : if (test_var > uint_max) {
10339 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10340 : PyLong_Type.tp_name, uint_max, test_var);
10341 0 : return -1;
10342 : }
10343 0 : object->unknown6 = test_var;
10344 : } else {
10345 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10346 : PyLong_Type.tp_name);
10347 0 : return -1;
10348 : }
10349 : }
10350 0 : return 0;
10351 : }
10352 :
10353 0 : static PyObject *py_netr_DELTA_GROUP_get_unknown7(PyObject *obj, void *closure)
10354 : {
10355 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10356 : PyObject *py_unknown7;
10357 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
10358 0 : return py_unknown7;
10359 : }
10360 :
10361 0 : static int py_netr_DELTA_GROUP_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
10362 : {
10363 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10364 0 : if (value == NULL) {
10365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
10366 0 : return -1;
10367 : }
10368 : {
10369 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
10370 0 : if (PyLong_Check(value)) {
10371 : unsigned long long test_var;
10372 0 : test_var = PyLong_AsUnsignedLongLong(value);
10373 0 : if (PyErr_Occurred() != NULL) {
10374 0 : return -1;
10375 : }
10376 0 : if (test_var > uint_max) {
10377 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10378 : PyLong_Type.tp_name, uint_max, test_var);
10379 0 : return -1;
10380 : }
10381 0 : object->unknown7 = test_var;
10382 : } else {
10383 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10384 : PyLong_Type.tp_name);
10385 0 : return -1;
10386 : }
10387 : }
10388 0 : return 0;
10389 : }
10390 :
10391 0 : static PyObject *py_netr_DELTA_GROUP_get_unknown8(PyObject *obj, void *closure)
10392 : {
10393 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(obj);
10394 : PyObject *py_unknown8;
10395 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
10396 0 : return py_unknown8;
10397 : }
10398 :
10399 0 : static int py_netr_DELTA_GROUP_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
10400 : {
10401 0 : struct netr_DELTA_GROUP *object = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(py_obj);
10402 0 : if (value == NULL) {
10403 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
10404 0 : return -1;
10405 : }
10406 : {
10407 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
10408 0 : if (PyLong_Check(value)) {
10409 : unsigned long long test_var;
10410 0 : test_var = PyLong_AsUnsignedLongLong(value);
10411 0 : if (PyErr_Occurred() != NULL) {
10412 0 : return -1;
10413 : }
10414 0 : if (test_var > uint_max) {
10415 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10416 : PyLong_Type.tp_name, uint_max, test_var);
10417 0 : return -1;
10418 : }
10419 0 : object->unknown8 = test_var;
10420 : } else {
10421 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10422 : PyLong_Type.tp_name);
10423 0 : return -1;
10424 : }
10425 : }
10426 0 : return 0;
10427 : }
10428 :
10429 : static PyGetSetDef py_netr_DELTA_GROUP_getsetters[] = {
10430 : {
10431 : .name = discard_const_p(char, "group_name"),
10432 : .get = py_netr_DELTA_GROUP_get_group_name,
10433 : .set = py_netr_DELTA_GROUP_set_group_name,
10434 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10435 : },
10436 : {
10437 : .name = discard_const_p(char, "rid"),
10438 : .get = py_netr_DELTA_GROUP_get_rid,
10439 : .set = py_netr_DELTA_GROUP_set_rid,
10440 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10441 : },
10442 : {
10443 : .name = discard_const_p(char, "attributes"),
10444 : .get = py_netr_DELTA_GROUP_get_attributes,
10445 : .set = py_netr_DELTA_GROUP_set_attributes,
10446 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10447 : },
10448 : {
10449 : .name = discard_const_p(char, "description"),
10450 : .get = py_netr_DELTA_GROUP_get_description,
10451 : .set = py_netr_DELTA_GROUP_set_description,
10452 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10453 : },
10454 : {
10455 : .name = discard_const_p(char, "SecurityInformation"),
10456 : .get = py_netr_DELTA_GROUP_get_SecurityInformation,
10457 : .set = py_netr_DELTA_GROUP_set_SecurityInformation,
10458 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10459 : },
10460 : {
10461 : .name = discard_const_p(char, "sdbuf"),
10462 : .get = py_netr_DELTA_GROUP_get_sdbuf,
10463 : .set = py_netr_DELTA_GROUP_set_sdbuf,
10464 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
10465 : },
10466 : {
10467 : .name = discard_const_p(char, "unknown1"),
10468 : .get = py_netr_DELTA_GROUP_get_unknown1,
10469 : .set = py_netr_DELTA_GROUP_set_unknown1,
10470 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10471 : },
10472 : {
10473 : .name = discard_const_p(char, "unknown2"),
10474 : .get = py_netr_DELTA_GROUP_get_unknown2,
10475 : .set = py_netr_DELTA_GROUP_set_unknown2,
10476 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10477 : },
10478 : {
10479 : .name = discard_const_p(char, "unknown3"),
10480 : .get = py_netr_DELTA_GROUP_get_unknown3,
10481 : .set = py_netr_DELTA_GROUP_set_unknown3,
10482 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10483 : },
10484 : {
10485 : .name = discard_const_p(char, "unknown4"),
10486 : .get = py_netr_DELTA_GROUP_get_unknown4,
10487 : .set = py_netr_DELTA_GROUP_set_unknown4,
10488 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10489 : },
10490 : {
10491 : .name = discard_const_p(char, "unknown5"),
10492 : .get = py_netr_DELTA_GROUP_get_unknown5,
10493 : .set = py_netr_DELTA_GROUP_set_unknown5,
10494 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10495 : },
10496 : {
10497 : .name = discard_const_p(char, "unknown6"),
10498 : .get = py_netr_DELTA_GROUP_get_unknown6,
10499 : .set = py_netr_DELTA_GROUP_set_unknown6,
10500 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10501 : },
10502 : {
10503 : .name = discard_const_p(char, "unknown7"),
10504 : .get = py_netr_DELTA_GROUP_get_unknown7,
10505 : .set = py_netr_DELTA_GROUP_set_unknown7,
10506 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10507 : },
10508 : {
10509 : .name = discard_const_p(char, "unknown8"),
10510 : .get = py_netr_DELTA_GROUP_get_unknown8,
10511 : .set = py_netr_DELTA_GROUP_set_unknown8,
10512 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10513 : },
10514 : { .name = NULL }
10515 : };
10516 :
10517 0 : static PyObject *py_netr_DELTA_GROUP_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10518 : {
10519 0 : return pytalloc_new(struct netr_DELTA_GROUP, type);
10520 : }
10521 :
10522 :
10523 : static PyTypeObject netr_DELTA_GROUP_Type = {
10524 : PyVarObject_HEAD_INIT(NULL, 0)
10525 : .tp_name = "netlogon.netr_DELTA_GROUP",
10526 : .tp_getset = py_netr_DELTA_GROUP_getsetters,
10527 : .tp_methods = NULL,
10528 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10529 : .tp_new = py_netr_DELTA_GROUP_new,
10530 : };
10531 :
10532 :
10533 0 : static PyObject *py_netr_DELTA_RENAME_get_OldName(PyObject *obj, void *closure)
10534 : {
10535 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10536 : PyObject *py_OldName;
10537 0 : py_OldName = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->OldName);
10538 0 : return py_OldName;
10539 : }
10540 :
10541 0 : static int py_netr_DELTA_RENAME_set_OldName(PyObject *py_obj, PyObject *value, void *closure)
10542 : {
10543 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10544 0 : if (value == NULL) {
10545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OldName");
10546 0 : return -1;
10547 : }
10548 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10549 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10550 0 : PyErr_NoMemory();
10551 0 : return -1;
10552 : }
10553 0 : object->OldName = *(struct lsa_String *)pytalloc_get_ptr(value);
10554 0 : return 0;
10555 : }
10556 :
10557 0 : static PyObject *py_netr_DELTA_RENAME_get_NewName(PyObject *obj, void *closure)
10558 : {
10559 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10560 : PyObject *py_NewName;
10561 0 : py_NewName = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->NewName);
10562 0 : return py_NewName;
10563 : }
10564 :
10565 0 : static int py_netr_DELTA_RENAME_set_NewName(PyObject *py_obj, PyObject *value, void *closure)
10566 : {
10567 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10568 0 : if (value == NULL) {
10569 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->NewName");
10570 0 : return -1;
10571 : }
10572 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10573 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10574 0 : PyErr_NoMemory();
10575 0 : return -1;
10576 : }
10577 0 : object->NewName = *(struct lsa_String *)pytalloc_get_ptr(value);
10578 0 : return 0;
10579 : }
10580 :
10581 0 : static PyObject *py_netr_DELTA_RENAME_get_unknown1(PyObject *obj, void *closure)
10582 : {
10583 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10584 : PyObject *py_unknown1;
10585 0 : py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1);
10586 0 : return py_unknown1;
10587 : }
10588 :
10589 0 : static int py_netr_DELTA_RENAME_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
10590 : {
10591 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10592 0 : if (value == NULL) {
10593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
10594 0 : return -1;
10595 : }
10596 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10597 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10598 0 : PyErr_NoMemory();
10599 0 : return -1;
10600 : }
10601 0 : object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value);
10602 0 : return 0;
10603 : }
10604 :
10605 0 : static PyObject *py_netr_DELTA_RENAME_get_unknown2(PyObject *obj, void *closure)
10606 : {
10607 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10608 : PyObject *py_unknown2;
10609 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
10610 0 : return py_unknown2;
10611 : }
10612 :
10613 0 : static int py_netr_DELTA_RENAME_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
10614 : {
10615 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10616 0 : if (value == NULL) {
10617 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
10618 0 : return -1;
10619 : }
10620 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10621 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10622 0 : PyErr_NoMemory();
10623 0 : return -1;
10624 : }
10625 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
10626 0 : return 0;
10627 : }
10628 :
10629 0 : static PyObject *py_netr_DELTA_RENAME_get_unknown3(PyObject *obj, void *closure)
10630 : {
10631 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10632 : PyObject *py_unknown3;
10633 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
10634 0 : return py_unknown3;
10635 : }
10636 :
10637 0 : static int py_netr_DELTA_RENAME_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
10638 : {
10639 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10640 0 : if (value == NULL) {
10641 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
10642 0 : return -1;
10643 : }
10644 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10645 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10646 0 : PyErr_NoMemory();
10647 0 : return -1;
10648 : }
10649 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
10650 0 : return 0;
10651 : }
10652 :
10653 0 : static PyObject *py_netr_DELTA_RENAME_get_unknown4(PyObject *obj, void *closure)
10654 : {
10655 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10656 : PyObject *py_unknown4;
10657 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
10658 0 : return py_unknown4;
10659 : }
10660 :
10661 0 : static int py_netr_DELTA_RENAME_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
10662 : {
10663 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10664 0 : if (value == NULL) {
10665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
10666 0 : return -1;
10667 : }
10668 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10669 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10670 0 : PyErr_NoMemory();
10671 0 : return -1;
10672 : }
10673 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
10674 0 : return 0;
10675 : }
10676 :
10677 0 : static PyObject *py_netr_DELTA_RENAME_get_unknown5(PyObject *obj, void *closure)
10678 : {
10679 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10680 : PyObject *py_unknown5;
10681 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
10682 0 : return py_unknown5;
10683 : }
10684 :
10685 0 : static int py_netr_DELTA_RENAME_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
10686 : {
10687 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10688 0 : if (value == NULL) {
10689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
10690 0 : return -1;
10691 : }
10692 : {
10693 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
10694 0 : if (PyLong_Check(value)) {
10695 : unsigned long long test_var;
10696 0 : test_var = PyLong_AsUnsignedLongLong(value);
10697 0 : if (PyErr_Occurred() != NULL) {
10698 0 : return -1;
10699 : }
10700 0 : if (test_var > uint_max) {
10701 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10702 : PyLong_Type.tp_name, uint_max, test_var);
10703 0 : return -1;
10704 : }
10705 0 : object->unknown5 = test_var;
10706 : } else {
10707 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10708 : PyLong_Type.tp_name);
10709 0 : return -1;
10710 : }
10711 : }
10712 0 : return 0;
10713 : }
10714 :
10715 0 : static PyObject *py_netr_DELTA_RENAME_get_unknown6(PyObject *obj, void *closure)
10716 : {
10717 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10718 : PyObject *py_unknown6;
10719 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
10720 0 : return py_unknown6;
10721 : }
10722 :
10723 0 : static int py_netr_DELTA_RENAME_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
10724 : {
10725 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10726 0 : if (value == NULL) {
10727 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
10728 0 : return -1;
10729 : }
10730 : {
10731 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
10732 0 : if (PyLong_Check(value)) {
10733 : unsigned long long test_var;
10734 0 : test_var = PyLong_AsUnsignedLongLong(value);
10735 0 : if (PyErr_Occurred() != NULL) {
10736 0 : return -1;
10737 : }
10738 0 : if (test_var > uint_max) {
10739 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10740 : PyLong_Type.tp_name, uint_max, test_var);
10741 0 : return -1;
10742 : }
10743 0 : object->unknown6 = test_var;
10744 : } else {
10745 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10746 : PyLong_Type.tp_name);
10747 0 : return -1;
10748 : }
10749 : }
10750 0 : return 0;
10751 : }
10752 :
10753 0 : static PyObject *py_netr_DELTA_RENAME_get_unknown7(PyObject *obj, void *closure)
10754 : {
10755 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10756 : PyObject *py_unknown7;
10757 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
10758 0 : return py_unknown7;
10759 : }
10760 :
10761 0 : static int py_netr_DELTA_RENAME_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
10762 : {
10763 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10764 0 : if (value == NULL) {
10765 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
10766 0 : return -1;
10767 : }
10768 : {
10769 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
10770 0 : if (PyLong_Check(value)) {
10771 : unsigned long long test_var;
10772 0 : test_var = PyLong_AsUnsignedLongLong(value);
10773 0 : if (PyErr_Occurred() != NULL) {
10774 0 : return -1;
10775 : }
10776 0 : if (test_var > uint_max) {
10777 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10778 : PyLong_Type.tp_name, uint_max, test_var);
10779 0 : return -1;
10780 : }
10781 0 : object->unknown7 = test_var;
10782 : } else {
10783 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10784 : PyLong_Type.tp_name);
10785 0 : return -1;
10786 : }
10787 : }
10788 0 : return 0;
10789 : }
10790 :
10791 0 : static PyObject *py_netr_DELTA_RENAME_get_unknown8(PyObject *obj, void *closure)
10792 : {
10793 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(obj);
10794 : PyObject *py_unknown8;
10795 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
10796 0 : return py_unknown8;
10797 : }
10798 :
10799 0 : static int py_netr_DELTA_RENAME_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
10800 : {
10801 0 : struct netr_DELTA_RENAME *object = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(py_obj);
10802 0 : if (value == NULL) {
10803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
10804 0 : return -1;
10805 : }
10806 : {
10807 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
10808 0 : if (PyLong_Check(value)) {
10809 : unsigned long long test_var;
10810 0 : test_var = PyLong_AsUnsignedLongLong(value);
10811 0 : if (PyErr_Occurred() != NULL) {
10812 0 : return -1;
10813 : }
10814 0 : if (test_var > uint_max) {
10815 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10816 : PyLong_Type.tp_name, uint_max, test_var);
10817 0 : return -1;
10818 : }
10819 0 : object->unknown8 = test_var;
10820 : } else {
10821 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10822 : PyLong_Type.tp_name);
10823 0 : return -1;
10824 : }
10825 : }
10826 0 : return 0;
10827 : }
10828 :
10829 : static PyGetSetDef py_netr_DELTA_RENAME_getsetters[] = {
10830 : {
10831 : .name = discard_const_p(char, "OldName"),
10832 : .get = py_netr_DELTA_RENAME_get_OldName,
10833 : .set = py_netr_DELTA_RENAME_set_OldName,
10834 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10835 : },
10836 : {
10837 : .name = discard_const_p(char, "NewName"),
10838 : .get = py_netr_DELTA_RENAME_get_NewName,
10839 : .set = py_netr_DELTA_RENAME_set_NewName,
10840 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10841 : },
10842 : {
10843 : .name = discard_const_p(char, "unknown1"),
10844 : .get = py_netr_DELTA_RENAME_get_unknown1,
10845 : .set = py_netr_DELTA_RENAME_set_unknown1,
10846 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10847 : },
10848 : {
10849 : .name = discard_const_p(char, "unknown2"),
10850 : .get = py_netr_DELTA_RENAME_get_unknown2,
10851 : .set = py_netr_DELTA_RENAME_set_unknown2,
10852 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10853 : },
10854 : {
10855 : .name = discard_const_p(char, "unknown3"),
10856 : .get = py_netr_DELTA_RENAME_get_unknown3,
10857 : .set = py_netr_DELTA_RENAME_set_unknown3,
10858 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10859 : },
10860 : {
10861 : .name = discard_const_p(char, "unknown4"),
10862 : .get = py_netr_DELTA_RENAME_get_unknown4,
10863 : .set = py_netr_DELTA_RENAME_set_unknown4,
10864 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10865 : },
10866 : {
10867 : .name = discard_const_p(char, "unknown5"),
10868 : .get = py_netr_DELTA_RENAME_get_unknown5,
10869 : .set = py_netr_DELTA_RENAME_set_unknown5,
10870 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10871 : },
10872 : {
10873 : .name = discard_const_p(char, "unknown6"),
10874 : .get = py_netr_DELTA_RENAME_get_unknown6,
10875 : .set = py_netr_DELTA_RENAME_set_unknown6,
10876 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10877 : },
10878 : {
10879 : .name = discard_const_p(char, "unknown7"),
10880 : .get = py_netr_DELTA_RENAME_get_unknown7,
10881 : .set = py_netr_DELTA_RENAME_set_unknown7,
10882 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10883 : },
10884 : {
10885 : .name = discard_const_p(char, "unknown8"),
10886 : .get = py_netr_DELTA_RENAME_get_unknown8,
10887 : .set = py_netr_DELTA_RENAME_set_unknown8,
10888 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10889 : },
10890 : { .name = NULL }
10891 : };
10892 :
10893 0 : static PyObject *py_netr_DELTA_RENAME_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10894 : {
10895 0 : return pytalloc_new(struct netr_DELTA_RENAME, type);
10896 : }
10897 :
10898 :
10899 : static PyTypeObject netr_DELTA_RENAME_Type = {
10900 : PyVarObject_HEAD_INIT(NULL, 0)
10901 : .tp_name = "netlogon.netr_DELTA_RENAME",
10902 : .tp_getset = py_netr_DELTA_RENAME_getsetters,
10903 : .tp_methods = NULL,
10904 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10905 : .tp_new = py_netr_DELTA_RENAME_new,
10906 : };
10907 :
10908 :
10909 0 : static PyObject *py_netr_DELTA_GROUP_MEMBER_get_rids(PyObject *obj, void *closure)
10910 : {
10911 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj);
10912 : PyObject *py_rids;
10913 0 : if (object->rids == NULL) {
10914 0 : Py_RETURN_NONE;
10915 : }
10916 0 : if (object->rids == NULL) {
10917 0 : py_rids = Py_None;
10918 0 : Py_INCREF(py_rids);
10919 : } else {
10920 0 : py_rids = PyList_New(object->num_rids);
10921 0 : if (py_rids == NULL) {
10922 0 : return NULL;
10923 : }
10924 : {
10925 : int rids_cntr_1;
10926 0 : for (rids_cntr_1 = 0; rids_cntr_1 < (object->num_rids); rids_cntr_1++) {
10927 : PyObject *py_rids_1;
10928 0 : py_rids_1 = PyLong_FromUnsignedLongLong((uint32_t)object->rids[rids_cntr_1]);
10929 0 : PyList_SetItem(py_rids, rids_cntr_1, py_rids_1);
10930 : }
10931 : }
10932 : }
10933 0 : return py_rids;
10934 : }
10935 :
10936 0 : static int py_netr_DELTA_GROUP_MEMBER_set_rids(PyObject *py_obj, PyObject *value, void *closure)
10937 : {
10938 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj);
10939 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->rids));
10940 0 : if (value == NULL) {
10941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids");
10942 0 : return -1;
10943 : }
10944 0 : if (value == Py_None) {
10945 0 : object->rids = NULL;
10946 : } else {
10947 0 : object->rids = NULL;
10948 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10949 : {
10950 : int rids_cntr_1;
10951 0 : object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value));
10952 0 : if (!object->rids) { return -1;; }
10953 0 : talloc_set_name_const(object->rids, "ARRAY: object->rids");
10954 0 : for (rids_cntr_1 = 0; rids_cntr_1 < PyList_GET_SIZE(value); rids_cntr_1++) {
10955 0 : if (PyList_GET_ITEM(value, rids_cntr_1) == NULL) {
10956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_1]");
10957 0 : return -1;
10958 : }
10959 : {
10960 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rids[rids_cntr_1]));
10961 0 : if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_1))) {
10962 : unsigned long long test_var;
10963 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_1));
10964 0 : if (PyErr_Occurred() != NULL) {
10965 0 : return -1;
10966 : }
10967 0 : if (test_var > uint_max) {
10968 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10969 : PyLong_Type.tp_name, uint_max, test_var);
10970 0 : return -1;
10971 : }
10972 0 : object->rids[rids_cntr_1] = test_var;
10973 : } else {
10974 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10975 : PyLong_Type.tp_name);
10976 0 : return -1;
10977 : }
10978 : }
10979 : }
10980 : }
10981 : }
10982 0 : return 0;
10983 : }
10984 :
10985 0 : static PyObject *py_netr_DELTA_GROUP_MEMBER_get_attribs(PyObject *obj, void *closure)
10986 : {
10987 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj);
10988 : PyObject *py_attribs;
10989 0 : if (object->attribs == NULL) {
10990 0 : Py_RETURN_NONE;
10991 : }
10992 0 : if (object->attribs == NULL) {
10993 0 : py_attribs = Py_None;
10994 0 : Py_INCREF(py_attribs);
10995 : } else {
10996 0 : py_attribs = PyList_New(object->num_rids);
10997 0 : if (py_attribs == NULL) {
10998 0 : return NULL;
10999 : }
11000 : {
11001 : int attribs_cntr_1;
11002 0 : for (attribs_cntr_1 = 0; attribs_cntr_1 < (object->num_rids); attribs_cntr_1++) {
11003 : PyObject *py_attribs_1;
11004 0 : py_attribs_1 = PyLong_FromUnsignedLongLong((uint32_t)object->attribs[attribs_cntr_1]);
11005 0 : PyList_SetItem(py_attribs, attribs_cntr_1, py_attribs_1);
11006 : }
11007 : }
11008 : }
11009 0 : return py_attribs;
11010 : }
11011 :
11012 0 : static int py_netr_DELTA_GROUP_MEMBER_set_attribs(PyObject *py_obj, PyObject *value, void *closure)
11013 : {
11014 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj);
11015 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->attribs));
11016 0 : if (value == NULL) {
11017 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attribs");
11018 0 : return -1;
11019 : }
11020 0 : if (value == Py_None) {
11021 0 : object->attribs = NULL;
11022 : } else {
11023 0 : object->attribs = NULL;
11024 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11025 : {
11026 : int attribs_cntr_1;
11027 0 : object->attribs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->attribs, PyList_GET_SIZE(value));
11028 0 : if (!object->attribs) { return -1;; }
11029 0 : talloc_set_name_const(object->attribs, "ARRAY: object->attribs");
11030 0 : for (attribs_cntr_1 = 0; attribs_cntr_1 < PyList_GET_SIZE(value); attribs_cntr_1++) {
11031 0 : if (PyList_GET_ITEM(value, attribs_cntr_1) == NULL) {
11032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attribs[attribs_cntr_1]");
11033 0 : return -1;
11034 : }
11035 : {
11036 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attribs[attribs_cntr_1]));
11037 0 : if (PyLong_Check(PyList_GET_ITEM(value, attribs_cntr_1))) {
11038 : unsigned long long test_var;
11039 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, attribs_cntr_1));
11040 0 : if (PyErr_Occurred() != NULL) {
11041 0 : return -1;
11042 : }
11043 0 : if (test_var > uint_max) {
11044 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11045 : PyLong_Type.tp_name, uint_max, test_var);
11046 0 : return -1;
11047 : }
11048 0 : object->attribs[attribs_cntr_1] = test_var;
11049 : } else {
11050 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11051 : PyLong_Type.tp_name);
11052 0 : return -1;
11053 : }
11054 : }
11055 : }
11056 : }
11057 : }
11058 0 : return 0;
11059 : }
11060 :
11061 0 : static PyObject *py_netr_DELTA_GROUP_MEMBER_get_num_rids(PyObject *obj, void *closure)
11062 : {
11063 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj);
11064 : PyObject *py_num_rids;
11065 0 : py_num_rids = PyLong_FromUnsignedLongLong((uint32_t)object->num_rids);
11066 0 : return py_num_rids;
11067 : }
11068 :
11069 0 : static int py_netr_DELTA_GROUP_MEMBER_set_num_rids(PyObject *py_obj, PyObject *value, void *closure)
11070 : {
11071 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj);
11072 0 : if (value == NULL) {
11073 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_rids");
11074 0 : return -1;
11075 : }
11076 : {
11077 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_rids));
11078 0 : if (PyLong_Check(value)) {
11079 : unsigned long long test_var;
11080 0 : test_var = PyLong_AsUnsignedLongLong(value);
11081 0 : if (PyErr_Occurred() != NULL) {
11082 0 : return -1;
11083 : }
11084 0 : if (test_var > uint_max) {
11085 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11086 : PyLong_Type.tp_name, uint_max, test_var);
11087 0 : return -1;
11088 : }
11089 0 : object->num_rids = test_var;
11090 : } else {
11091 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11092 : PyLong_Type.tp_name);
11093 0 : return -1;
11094 : }
11095 : }
11096 0 : return 0;
11097 : }
11098 :
11099 0 : static PyObject *py_netr_DELTA_GROUP_MEMBER_get_unknown1(PyObject *obj, void *closure)
11100 : {
11101 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj);
11102 : PyObject *py_unknown1;
11103 0 : py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown1);
11104 0 : return py_unknown1;
11105 : }
11106 :
11107 0 : static int py_netr_DELTA_GROUP_MEMBER_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
11108 : {
11109 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj);
11110 0 : if (value == NULL) {
11111 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
11112 0 : return -1;
11113 : }
11114 : {
11115 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1));
11116 0 : if (PyLong_Check(value)) {
11117 : unsigned long long test_var;
11118 0 : test_var = PyLong_AsUnsignedLongLong(value);
11119 0 : if (PyErr_Occurred() != NULL) {
11120 0 : return -1;
11121 : }
11122 0 : if (test_var > uint_max) {
11123 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11124 : PyLong_Type.tp_name, uint_max, test_var);
11125 0 : return -1;
11126 : }
11127 0 : object->unknown1 = test_var;
11128 : } else {
11129 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11130 : PyLong_Type.tp_name);
11131 0 : return -1;
11132 : }
11133 : }
11134 0 : return 0;
11135 : }
11136 :
11137 0 : static PyObject *py_netr_DELTA_GROUP_MEMBER_get_unknown2(PyObject *obj, void *closure)
11138 : {
11139 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj);
11140 : PyObject *py_unknown2;
11141 0 : py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown2);
11142 0 : return py_unknown2;
11143 : }
11144 :
11145 0 : static int py_netr_DELTA_GROUP_MEMBER_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
11146 : {
11147 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj);
11148 0 : if (value == NULL) {
11149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
11150 0 : return -1;
11151 : }
11152 : {
11153 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2));
11154 0 : if (PyLong_Check(value)) {
11155 : unsigned long long test_var;
11156 0 : test_var = PyLong_AsUnsignedLongLong(value);
11157 0 : if (PyErr_Occurred() != NULL) {
11158 0 : return -1;
11159 : }
11160 0 : if (test_var > uint_max) {
11161 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11162 : PyLong_Type.tp_name, uint_max, test_var);
11163 0 : return -1;
11164 : }
11165 0 : object->unknown2 = test_var;
11166 : } else {
11167 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11168 : PyLong_Type.tp_name);
11169 0 : return -1;
11170 : }
11171 : }
11172 0 : return 0;
11173 : }
11174 :
11175 0 : static PyObject *py_netr_DELTA_GROUP_MEMBER_get_unknown3(PyObject *obj, void *closure)
11176 : {
11177 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj);
11178 : PyObject *py_unknown3;
11179 0 : py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3);
11180 0 : return py_unknown3;
11181 : }
11182 :
11183 0 : static int py_netr_DELTA_GROUP_MEMBER_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
11184 : {
11185 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj);
11186 0 : if (value == NULL) {
11187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
11188 0 : return -1;
11189 : }
11190 : {
11191 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3));
11192 0 : if (PyLong_Check(value)) {
11193 : unsigned long long test_var;
11194 0 : test_var = PyLong_AsUnsignedLongLong(value);
11195 0 : if (PyErr_Occurred() != NULL) {
11196 0 : return -1;
11197 : }
11198 0 : if (test_var > uint_max) {
11199 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11200 : PyLong_Type.tp_name, uint_max, test_var);
11201 0 : return -1;
11202 : }
11203 0 : object->unknown3 = test_var;
11204 : } else {
11205 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11206 : PyLong_Type.tp_name);
11207 0 : return -1;
11208 : }
11209 : }
11210 0 : return 0;
11211 : }
11212 :
11213 0 : static PyObject *py_netr_DELTA_GROUP_MEMBER_get_unknown4(PyObject *obj, void *closure)
11214 : {
11215 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(obj);
11216 : PyObject *py_unknown4;
11217 0 : py_unknown4 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown4);
11218 0 : return py_unknown4;
11219 : }
11220 :
11221 0 : static int py_netr_DELTA_GROUP_MEMBER_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
11222 : {
11223 0 : struct netr_DELTA_GROUP_MEMBER *object = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(py_obj);
11224 0 : if (value == NULL) {
11225 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
11226 0 : return -1;
11227 : }
11228 : {
11229 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown4));
11230 0 : if (PyLong_Check(value)) {
11231 : unsigned long long test_var;
11232 0 : test_var = PyLong_AsUnsignedLongLong(value);
11233 0 : if (PyErr_Occurred() != NULL) {
11234 0 : return -1;
11235 : }
11236 0 : if (test_var > uint_max) {
11237 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11238 : PyLong_Type.tp_name, uint_max, test_var);
11239 0 : return -1;
11240 : }
11241 0 : object->unknown4 = test_var;
11242 : } else {
11243 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11244 : PyLong_Type.tp_name);
11245 0 : return -1;
11246 : }
11247 : }
11248 0 : return 0;
11249 : }
11250 :
11251 : static PyGetSetDef py_netr_DELTA_GROUP_MEMBER_getsetters[] = {
11252 : {
11253 : .name = discard_const_p(char, "rids"),
11254 : .get = py_netr_DELTA_GROUP_MEMBER_get_rids,
11255 : .set = py_netr_DELTA_GROUP_MEMBER_set_rids,
11256 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11257 : },
11258 : {
11259 : .name = discard_const_p(char, "attribs"),
11260 : .get = py_netr_DELTA_GROUP_MEMBER_get_attribs,
11261 : .set = py_netr_DELTA_GROUP_MEMBER_set_attribs,
11262 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11263 : },
11264 : {
11265 : .name = discard_const_p(char, "num_rids"),
11266 : .get = py_netr_DELTA_GROUP_MEMBER_get_num_rids,
11267 : .set = py_netr_DELTA_GROUP_MEMBER_set_num_rids,
11268 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11269 : },
11270 : {
11271 : .name = discard_const_p(char, "unknown1"),
11272 : .get = py_netr_DELTA_GROUP_MEMBER_get_unknown1,
11273 : .set = py_netr_DELTA_GROUP_MEMBER_set_unknown1,
11274 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11275 : },
11276 : {
11277 : .name = discard_const_p(char, "unknown2"),
11278 : .get = py_netr_DELTA_GROUP_MEMBER_get_unknown2,
11279 : .set = py_netr_DELTA_GROUP_MEMBER_set_unknown2,
11280 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11281 : },
11282 : {
11283 : .name = discard_const_p(char, "unknown3"),
11284 : .get = py_netr_DELTA_GROUP_MEMBER_get_unknown3,
11285 : .set = py_netr_DELTA_GROUP_MEMBER_set_unknown3,
11286 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11287 : },
11288 : {
11289 : .name = discard_const_p(char, "unknown4"),
11290 : .get = py_netr_DELTA_GROUP_MEMBER_get_unknown4,
11291 : .set = py_netr_DELTA_GROUP_MEMBER_set_unknown4,
11292 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11293 : },
11294 : { .name = NULL }
11295 : };
11296 :
11297 0 : static PyObject *py_netr_DELTA_GROUP_MEMBER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11298 : {
11299 0 : return pytalloc_new(struct netr_DELTA_GROUP_MEMBER, type);
11300 : }
11301 :
11302 :
11303 : static PyTypeObject netr_DELTA_GROUP_MEMBER_Type = {
11304 : PyVarObject_HEAD_INIT(NULL, 0)
11305 : .tp_name = "netlogon.netr_DELTA_GROUP_MEMBER",
11306 : .tp_getset = py_netr_DELTA_GROUP_MEMBER_getsetters,
11307 : .tp_methods = NULL,
11308 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11309 : .tp_new = py_netr_DELTA_GROUP_MEMBER_new,
11310 : };
11311 :
11312 :
11313 0 : static PyObject *py_netr_DELTA_ALIAS_get_alias_name(PyObject *obj, void *closure)
11314 : {
11315 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11316 : PyObject *py_alias_name;
11317 0 : py_alias_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->alias_name);
11318 0 : return py_alias_name;
11319 : }
11320 :
11321 0 : static int py_netr_DELTA_ALIAS_set_alias_name(PyObject *py_obj, PyObject *value, void *closure)
11322 : {
11323 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11324 0 : if (value == NULL) {
11325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->alias_name");
11326 0 : return -1;
11327 : }
11328 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
11329 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11330 0 : PyErr_NoMemory();
11331 0 : return -1;
11332 : }
11333 0 : object->alias_name = *(struct lsa_String *)pytalloc_get_ptr(value);
11334 0 : return 0;
11335 : }
11336 :
11337 0 : static PyObject *py_netr_DELTA_ALIAS_get_rid(PyObject *obj, void *closure)
11338 : {
11339 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11340 : PyObject *py_rid;
11341 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
11342 0 : return py_rid;
11343 : }
11344 :
11345 0 : static int py_netr_DELTA_ALIAS_set_rid(PyObject *py_obj, PyObject *value, void *closure)
11346 : {
11347 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11348 0 : if (value == NULL) {
11349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
11350 0 : return -1;
11351 : }
11352 : {
11353 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
11354 0 : if (PyLong_Check(value)) {
11355 : unsigned long long test_var;
11356 0 : test_var = PyLong_AsUnsignedLongLong(value);
11357 0 : if (PyErr_Occurred() != NULL) {
11358 0 : return -1;
11359 : }
11360 0 : if (test_var > uint_max) {
11361 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11362 : PyLong_Type.tp_name, uint_max, test_var);
11363 0 : return -1;
11364 : }
11365 0 : object->rid = test_var;
11366 : } else {
11367 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11368 : PyLong_Type.tp_name);
11369 0 : return -1;
11370 : }
11371 : }
11372 0 : return 0;
11373 : }
11374 :
11375 0 : static PyObject *py_netr_DELTA_ALIAS_get_SecurityInformation(PyObject *obj, void *closure)
11376 : {
11377 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11378 : PyObject *py_SecurityInformation;
11379 0 : py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation);
11380 0 : return py_SecurityInformation;
11381 : }
11382 :
11383 0 : static int py_netr_DELTA_ALIAS_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure)
11384 : {
11385 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11386 0 : if (value == NULL) {
11387 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation");
11388 0 : return -1;
11389 : }
11390 : {
11391 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation));
11392 0 : if (PyLong_Check(value)) {
11393 : unsigned long long test_var;
11394 0 : test_var = PyLong_AsUnsignedLongLong(value);
11395 0 : if (PyErr_Occurred() != NULL) {
11396 0 : return -1;
11397 : }
11398 0 : if (test_var > uint_max) {
11399 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11400 : PyLong_Type.tp_name, uint_max, test_var);
11401 0 : return -1;
11402 : }
11403 0 : object->SecurityInformation = test_var;
11404 : } else {
11405 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11406 : PyLong_Type.tp_name);
11407 0 : return -1;
11408 : }
11409 : }
11410 0 : return 0;
11411 : }
11412 :
11413 0 : static PyObject *py_netr_DELTA_ALIAS_get_sdbuf(PyObject *obj, void *closure)
11414 : {
11415 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11416 : PyObject *py_sdbuf;
11417 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf);
11418 0 : return py_sdbuf;
11419 : }
11420 :
11421 0 : static int py_netr_DELTA_ALIAS_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
11422 : {
11423 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11424 0 : if (value == NULL) {
11425 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf");
11426 0 : return -1;
11427 : }
11428 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
11429 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11430 0 : PyErr_NoMemory();
11431 0 : return -1;
11432 : }
11433 0 : object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
11434 0 : return 0;
11435 : }
11436 :
11437 0 : static PyObject *py_netr_DELTA_ALIAS_get_description(PyObject *obj, void *closure)
11438 : {
11439 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11440 : PyObject *py_description;
11441 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
11442 0 : return py_description;
11443 : }
11444 :
11445 0 : static int py_netr_DELTA_ALIAS_set_description(PyObject *py_obj, PyObject *value, void *closure)
11446 : {
11447 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11448 0 : if (value == NULL) {
11449 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
11450 0 : return -1;
11451 : }
11452 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
11453 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11454 0 : PyErr_NoMemory();
11455 0 : return -1;
11456 : }
11457 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
11458 0 : return 0;
11459 : }
11460 :
11461 0 : static PyObject *py_netr_DELTA_ALIAS_get_unknown2(PyObject *obj, void *closure)
11462 : {
11463 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11464 : PyObject *py_unknown2;
11465 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
11466 0 : return py_unknown2;
11467 : }
11468 :
11469 0 : static int py_netr_DELTA_ALIAS_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
11470 : {
11471 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11472 0 : if (value == NULL) {
11473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
11474 0 : return -1;
11475 : }
11476 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
11477 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11478 0 : PyErr_NoMemory();
11479 0 : return -1;
11480 : }
11481 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
11482 0 : return 0;
11483 : }
11484 :
11485 0 : static PyObject *py_netr_DELTA_ALIAS_get_unknown3(PyObject *obj, void *closure)
11486 : {
11487 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11488 : PyObject *py_unknown3;
11489 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
11490 0 : return py_unknown3;
11491 : }
11492 :
11493 0 : static int py_netr_DELTA_ALIAS_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
11494 : {
11495 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11496 0 : if (value == NULL) {
11497 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
11498 0 : return -1;
11499 : }
11500 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
11501 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11502 0 : PyErr_NoMemory();
11503 0 : return -1;
11504 : }
11505 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
11506 0 : return 0;
11507 : }
11508 :
11509 0 : static PyObject *py_netr_DELTA_ALIAS_get_unknown4(PyObject *obj, void *closure)
11510 : {
11511 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11512 : PyObject *py_unknown4;
11513 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
11514 0 : return py_unknown4;
11515 : }
11516 :
11517 0 : static int py_netr_DELTA_ALIAS_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
11518 : {
11519 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11520 0 : if (value == NULL) {
11521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
11522 0 : return -1;
11523 : }
11524 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
11525 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11526 0 : PyErr_NoMemory();
11527 0 : return -1;
11528 : }
11529 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
11530 0 : return 0;
11531 : }
11532 :
11533 0 : static PyObject *py_netr_DELTA_ALIAS_get_unknown5(PyObject *obj, void *closure)
11534 : {
11535 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11536 : PyObject *py_unknown5;
11537 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
11538 0 : return py_unknown5;
11539 : }
11540 :
11541 0 : static int py_netr_DELTA_ALIAS_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
11542 : {
11543 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11544 0 : if (value == NULL) {
11545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
11546 0 : return -1;
11547 : }
11548 : {
11549 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
11550 0 : if (PyLong_Check(value)) {
11551 : unsigned long long test_var;
11552 0 : test_var = PyLong_AsUnsignedLongLong(value);
11553 0 : if (PyErr_Occurred() != NULL) {
11554 0 : return -1;
11555 : }
11556 0 : if (test_var > uint_max) {
11557 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11558 : PyLong_Type.tp_name, uint_max, test_var);
11559 0 : return -1;
11560 : }
11561 0 : object->unknown5 = test_var;
11562 : } else {
11563 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11564 : PyLong_Type.tp_name);
11565 0 : return -1;
11566 : }
11567 : }
11568 0 : return 0;
11569 : }
11570 :
11571 0 : static PyObject *py_netr_DELTA_ALIAS_get_unknown6(PyObject *obj, void *closure)
11572 : {
11573 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11574 : PyObject *py_unknown6;
11575 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
11576 0 : return py_unknown6;
11577 : }
11578 :
11579 0 : static int py_netr_DELTA_ALIAS_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
11580 : {
11581 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11582 0 : if (value == NULL) {
11583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
11584 0 : return -1;
11585 : }
11586 : {
11587 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
11588 0 : if (PyLong_Check(value)) {
11589 : unsigned long long test_var;
11590 0 : test_var = PyLong_AsUnsignedLongLong(value);
11591 0 : if (PyErr_Occurred() != NULL) {
11592 0 : return -1;
11593 : }
11594 0 : if (test_var > uint_max) {
11595 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11596 : PyLong_Type.tp_name, uint_max, test_var);
11597 0 : return -1;
11598 : }
11599 0 : object->unknown6 = test_var;
11600 : } else {
11601 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11602 : PyLong_Type.tp_name);
11603 0 : return -1;
11604 : }
11605 : }
11606 0 : return 0;
11607 : }
11608 :
11609 0 : static PyObject *py_netr_DELTA_ALIAS_get_unknown7(PyObject *obj, void *closure)
11610 : {
11611 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11612 : PyObject *py_unknown7;
11613 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
11614 0 : return py_unknown7;
11615 : }
11616 :
11617 0 : static int py_netr_DELTA_ALIAS_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
11618 : {
11619 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11620 0 : if (value == NULL) {
11621 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
11622 0 : return -1;
11623 : }
11624 : {
11625 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
11626 0 : if (PyLong_Check(value)) {
11627 : unsigned long long test_var;
11628 0 : test_var = PyLong_AsUnsignedLongLong(value);
11629 0 : if (PyErr_Occurred() != NULL) {
11630 0 : return -1;
11631 : }
11632 0 : if (test_var > uint_max) {
11633 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11634 : PyLong_Type.tp_name, uint_max, test_var);
11635 0 : return -1;
11636 : }
11637 0 : object->unknown7 = test_var;
11638 : } else {
11639 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11640 : PyLong_Type.tp_name);
11641 0 : return -1;
11642 : }
11643 : }
11644 0 : return 0;
11645 : }
11646 :
11647 0 : static PyObject *py_netr_DELTA_ALIAS_get_unknown8(PyObject *obj, void *closure)
11648 : {
11649 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(obj);
11650 : PyObject *py_unknown8;
11651 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
11652 0 : return py_unknown8;
11653 : }
11654 :
11655 0 : static int py_netr_DELTA_ALIAS_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
11656 : {
11657 0 : struct netr_DELTA_ALIAS *object = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(py_obj);
11658 0 : if (value == NULL) {
11659 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
11660 0 : return -1;
11661 : }
11662 : {
11663 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
11664 0 : if (PyLong_Check(value)) {
11665 : unsigned long long test_var;
11666 0 : test_var = PyLong_AsUnsignedLongLong(value);
11667 0 : if (PyErr_Occurred() != NULL) {
11668 0 : return -1;
11669 : }
11670 0 : if (test_var > uint_max) {
11671 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11672 : PyLong_Type.tp_name, uint_max, test_var);
11673 0 : return -1;
11674 : }
11675 0 : object->unknown8 = test_var;
11676 : } else {
11677 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11678 : PyLong_Type.tp_name);
11679 0 : return -1;
11680 : }
11681 : }
11682 0 : return 0;
11683 : }
11684 :
11685 : static PyGetSetDef py_netr_DELTA_ALIAS_getsetters[] = {
11686 : {
11687 : .name = discard_const_p(char, "alias_name"),
11688 : .get = py_netr_DELTA_ALIAS_get_alias_name,
11689 : .set = py_netr_DELTA_ALIAS_set_alias_name,
11690 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11691 : },
11692 : {
11693 : .name = discard_const_p(char, "rid"),
11694 : .get = py_netr_DELTA_ALIAS_get_rid,
11695 : .set = py_netr_DELTA_ALIAS_set_rid,
11696 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11697 : },
11698 : {
11699 : .name = discard_const_p(char, "SecurityInformation"),
11700 : .get = py_netr_DELTA_ALIAS_get_SecurityInformation,
11701 : .set = py_netr_DELTA_ALIAS_set_SecurityInformation,
11702 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11703 : },
11704 : {
11705 : .name = discard_const_p(char, "sdbuf"),
11706 : .get = py_netr_DELTA_ALIAS_get_sdbuf,
11707 : .set = py_netr_DELTA_ALIAS_set_sdbuf,
11708 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
11709 : },
11710 : {
11711 : .name = discard_const_p(char, "description"),
11712 : .get = py_netr_DELTA_ALIAS_get_description,
11713 : .set = py_netr_DELTA_ALIAS_set_description,
11714 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11715 : },
11716 : {
11717 : .name = discard_const_p(char, "unknown2"),
11718 : .get = py_netr_DELTA_ALIAS_get_unknown2,
11719 : .set = py_netr_DELTA_ALIAS_set_unknown2,
11720 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11721 : },
11722 : {
11723 : .name = discard_const_p(char, "unknown3"),
11724 : .get = py_netr_DELTA_ALIAS_get_unknown3,
11725 : .set = py_netr_DELTA_ALIAS_set_unknown3,
11726 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11727 : },
11728 : {
11729 : .name = discard_const_p(char, "unknown4"),
11730 : .get = py_netr_DELTA_ALIAS_get_unknown4,
11731 : .set = py_netr_DELTA_ALIAS_set_unknown4,
11732 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11733 : },
11734 : {
11735 : .name = discard_const_p(char, "unknown5"),
11736 : .get = py_netr_DELTA_ALIAS_get_unknown5,
11737 : .set = py_netr_DELTA_ALIAS_set_unknown5,
11738 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11739 : },
11740 : {
11741 : .name = discard_const_p(char, "unknown6"),
11742 : .get = py_netr_DELTA_ALIAS_get_unknown6,
11743 : .set = py_netr_DELTA_ALIAS_set_unknown6,
11744 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11745 : },
11746 : {
11747 : .name = discard_const_p(char, "unknown7"),
11748 : .get = py_netr_DELTA_ALIAS_get_unknown7,
11749 : .set = py_netr_DELTA_ALIAS_set_unknown7,
11750 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11751 : },
11752 : {
11753 : .name = discard_const_p(char, "unknown8"),
11754 : .get = py_netr_DELTA_ALIAS_get_unknown8,
11755 : .set = py_netr_DELTA_ALIAS_set_unknown8,
11756 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11757 : },
11758 : { .name = NULL }
11759 : };
11760 :
11761 0 : static PyObject *py_netr_DELTA_ALIAS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11762 : {
11763 0 : return pytalloc_new(struct netr_DELTA_ALIAS, type);
11764 : }
11765 :
11766 :
11767 : static PyTypeObject netr_DELTA_ALIAS_Type = {
11768 : PyVarObject_HEAD_INIT(NULL, 0)
11769 : .tp_name = "netlogon.netr_DELTA_ALIAS",
11770 : .tp_getset = py_netr_DELTA_ALIAS_getsetters,
11771 : .tp_methods = NULL,
11772 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11773 : .tp_new = py_netr_DELTA_ALIAS_new,
11774 : };
11775 :
11776 :
11777 0 : static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_sids(PyObject *obj, void *closure)
11778 : {
11779 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj);
11780 : PyObject *py_sids;
11781 0 : py_sids = pytalloc_reference_ex(lsa_SidArray_Type, pytalloc_get_mem_ctx(obj), &object->sids);
11782 0 : return py_sids;
11783 : }
11784 :
11785 0 : static int py_netr_DELTA_ALIAS_MEMBER_set_sids(PyObject *py_obj, PyObject *value, void *closure)
11786 : {
11787 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj);
11788 0 : if (value == NULL) {
11789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
11790 0 : return -1;
11791 : }
11792 0 : PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;);
11793 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11794 0 : PyErr_NoMemory();
11795 0 : return -1;
11796 : }
11797 0 : object->sids = *(struct lsa_SidArray *)pytalloc_get_ptr(value);
11798 0 : return 0;
11799 : }
11800 :
11801 0 : static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_unknown1(PyObject *obj, void *closure)
11802 : {
11803 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj);
11804 : PyObject *py_unknown1;
11805 0 : py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown1);
11806 0 : return py_unknown1;
11807 : }
11808 :
11809 0 : static int py_netr_DELTA_ALIAS_MEMBER_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
11810 : {
11811 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj);
11812 0 : if (value == NULL) {
11813 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
11814 0 : return -1;
11815 : }
11816 : {
11817 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1));
11818 0 : if (PyLong_Check(value)) {
11819 : unsigned long long test_var;
11820 0 : test_var = PyLong_AsUnsignedLongLong(value);
11821 0 : if (PyErr_Occurred() != NULL) {
11822 0 : return -1;
11823 : }
11824 0 : if (test_var > uint_max) {
11825 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11826 : PyLong_Type.tp_name, uint_max, test_var);
11827 0 : return -1;
11828 : }
11829 0 : object->unknown1 = test_var;
11830 : } else {
11831 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11832 : PyLong_Type.tp_name);
11833 0 : return -1;
11834 : }
11835 : }
11836 0 : return 0;
11837 : }
11838 :
11839 0 : static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_unknown2(PyObject *obj, void *closure)
11840 : {
11841 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj);
11842 : PyObject *py_unknown2;
11843 0 : py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown2);
11844 0 : return py_unknown2;
11845 : }
11846 :
11847 0 : static int py_netr_DELTA_ALIAS_MEMBER_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
11848 : {
11849 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj);
11850 0 : if (value == NULL) {
11851 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
11852 0 : return -1;
11853 : }
11854 : {
11855 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2));
11856 0 : if (PyLong_Check(value)) {
11857 : unsigned long long test_var;
11858 0 : test_var = PyLong_AsUnsignedLongLong(value);
11859 0 : if (PyErr_Occurred() != NULL) {
11860 0 : return -1;
11861 : }
11862 0 : if (test_var > uint_max) {
11863 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11864 : PyLong_Type.tp_name, uint_max, test_var);
11865 0 : return -1;
11866 : }
11867 0 : object->unknown2 = test_var;
11868 : } else {
11869 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11870 : PyLong_Type.tp_name);
11871 0 : return -1;
11872 : }
11873 : }
11874 0 : return 0;
11875 : }
11876 :
11877 0 : static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_unknown3(PyObject *obj, void *closure)
11878 : {
11879 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj);
11880 : PyObject *py_unknown3;
11881 0 : py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3);
11882 0 : return py_unknown3;
11883 : }
11884 :
11885 0 : static int py_netr_DELTA_ALIAS_MEMBER_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
11886 : {
11887 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj);
11888 0 : if (value == NULL) {
11889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
11890 0 : return -1;
11891 : }
11892 : {
11893 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3));
11894 0 : if (PyLong_Check(value)) {
11895 : unsigned long long test_var;
11896 0 : test_var = PyLong_AsUnsignedLongLong(value);
11897 0 : if (PyErr_Occurred() != NULL) {
11898 0 : return -1;
11899 : }
11900 0 : if (test_var > uint_max) {
11901 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11902 : PyLong_Type.tp_name, uint_max, test_var);
11903 0 : return -1;
11904 : }
11905 0 : object->unknown3 = test_var;
11906 : } else {
11907 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11908 : PyLong_Type.tp_name);
11909 0 : return -1;
11910 : }
11911 : }
11912 0 : return 0;
11913 : }
11914 :
11915 0 : static PyObject *py_netr_DELTA_ALIAS_MEMBER_get_unknown4(PyObject *obj, void *closure)
11916 : {
11917 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(obj);
11918 : PyObject *py_unknown4;
11919 0 : py_unknown4 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown4);
11920 0 : return py_unknown4;
11921 : }
11922 :
11923 0 : static int py_netr_DELTA_ALIAS_MEMBER_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
11924 : {
11925 0 : struct netr_DELTA_ALIAS_MEMBER *object = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(py_obj);
11926 0 : if (value == NULL) {
11927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
11928 0 : return -1;
11929 : }
11930 : {
11931 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown4));
11932 0 : if (PyLong_Check(value)) {
11933 : unsigned long long test_var;
11934 0 : test_var = PyLong_AsUnsignedLongLong(value);
11935 0 : if (PyErr_Occurred() != NULL) {
11936 0 : return -1;
11937 : }
11938 0 : if (test_var > uint_max) {
11939 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11940 : PyLong_Type.tp_name, uint_max, test_var);
11941 0 : return -1;
11942 : }
11943 0 : object->unknown4 = test_var;
11944 : } else {
11945 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11946 : PyLong_Type.tp_name);
11947 0 : return -1;
11948 : }
11949 : }
11950 0 : return 0;
11951 : }
11952 :
11953 : static PyGetSetDef py_netr_DELTA_ALIAS_MEMBER_getsetters[] = {
11954 : {
11955 : .name = discard_const_p(char, "sids"),
11956 : .get = py_netr_DELTA_ALIAS_MEMBER_get_sids,
11957 : .set = py_netr_DELTA_ALIAS_MEMBER_set_sids,
11958 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
11959 : },
11960 : {
11961 : .name = discard_const_p(char, "unknown1"),
11962 : .get = py_netr_DELTA_ALIAS_MEMBER_get_unknown1,
11963 : .set = py_netr_DELTA_ALIAS_MEMBER_set_unknown1,
11964 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11965 : },
11966 : {
11967 : .name = discard_const_p(char, "unknown2"),
11968 : .get = py_netr_DELTA_ALIAS_MEMBER_get_unknown2,
11969 : .set = py_netr_DELTA_ALIAS_MEMBER_set_unknown2,
11970 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11971 : },
11972 : {
11973 : .name = discard_const_p(char, "unknown3"),
11974 : .get = py_netr_DELTA_ALIAS_MEMBER_get_unknown3,
11975 : .set = py_netr_DELTA_ALIAS_MEMBER_set_unknown3,
11976 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11977 : },
11978 : {
11979 : .name = discard_const_p(char, "unknown4"),
11980 : .get = py_netr_DELTA_ALIAS_MEMBER_get_unknown4,
11981 : .set = py_netr_DELTA_ALIAS_MEMBER_set_unknown4,
11982 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11983 : },
11984 : { .name = NULL }
11985 : };
11986 :
11987 0 : static PyObject *py_netr_DELTA_ALIAS_MEMBER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11988 : {
11989 0 : return pytalloc_new(struct netr_DELTA_ALIAS_MEMBER, type);
11990 : }
11991 :
11992 :
11993 : static PyTypeObject netr_DELTA_ALIAS_MEMBER_Type = {
11994 : PyVarObject_HEAD_INIT(NULL, 0)
11995 : .tp_name = "netlogon.netr_DELTA_ALIAS_MEMBER",
11996 : .tp_getset = py_netr_DELTA_ALIAS_MEMBER_getsetters,
11997 : .tp_methods = NULL,
11998 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11999 : .tp_new = py_netr_DELTA_ALIAS_MEMBER_new,
12000 : };
12001 :
12002 :
12003 0 : static PyObject *py_netr_QUOTA_LIMITS_get_pagedpoollimit(PyObject *obj, void *closure)
12004 : {
12005 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj);
12006 : PyObject *py_pagedpoollimit;
12007 0 : py_pagedpoollimit = PyLong_FromUnsignedLongLong((uint32_t)object->pagedpoollimit);
12008 0 : return py_pagedpoollimit;
12009 : }
12010 :
12011 0 : static int py_netr_QUOTA_LIMITS_set_pagedpoollimit(PyObject *py_obj, PyObject *value, void *closure)
12012 : {
12013 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj);
12014 0 : if (value == NULL) {
12015 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pagedpoollimit");
12016 0 : return -1;
12017 : }
12018 : {
12019 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pagedpoollimit));
12020 0 : if (PyLong_Check(value)) {
12021 : unsigned long long test_var;
12022 0 : test_var = PyLong_AsUnsignedLongLong(value);
12023 0 : if (PyErr_Occurred() != NULL) {
12024 0 : return -1;
12025 : }
12026 0 : if (test_var > uint_max) {
12027 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12028 : PyLong_Type.tp_name, uint_max, test_var);
12029 0 : return -1;
12030 : }
12031 0 : object->pagedpoollimit = test_var;
12032 : } else {
12033 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12034 : PyLong_Type.tp_name);
12035 0 : return -1;
12036 : }
12037 : }
12038 0 : return 0;
12039 : }
12040 :
12041 0 : static PyObject *py_netr_QUOTA_LIMITS_get_nonpagedpoollimit(PyObject *obj, void *closure)
12042 : {
12043 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj);
12044 : PyObject *py_nonpagedpoollimit;
12045 0 : py_nonpagedpoollimit = PyLong_FromUnsignedLongLong((uint32_t)object->nonpagedpoollimit);
12046 0 : return py_nonpagedpoollimit;
12047 : }
12048 :
12049 0 : static int py_netr_QUOTA_LIMITS_set_nonpagedpoollimit(PyObject *py_obj, PyObject *value, void *closure)
12050 : {
12051 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj);
12052 0 : if (value == NULL) {
12053 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nonpagedpoollimit");
12054 0 : return -1;
12055 : }
12056 : {
12057 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nonpagedpoollimit));
12058 0 : if (PyLong_Check(value)) {
12059 : unsigned long long test_var;
12060 0 : test_var = PyLong_AsUnsignedLongLong(value);
12061 0 : if (PyErr_Occurred() != NULL) {
12062 0 : return -1;
12063 : }
12064 0 : if (test_var > uint_max) {
12065 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12066 : PyLong_Type.tp_name, uint_max, test_var);
12067 0 : return -1;
12068 : }
12069 0 : object->nonpagedpoollimit = test_var;
12070 : } else {
12071 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12072 : PyLong_Type.tp_name);
12073 0 : return -1;
12074 : }
12075 : }
12076 0 : return 0;
12077 : }
12078 :
12079 0 : static PyObject *py_netr_QUOTA_LIMITS_get_minimumworkingsetsize(PyObject *obj, void *closure)
12080 : {
12081 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj);
12082 : PyObject *py_minimumworkingsetsize;
12083 0 : py_minimumworkingsetsize = PyLong_FromUnsignedLongLong((uint32_t)object->minimumworkingsetsize);
12084 0 : return py_minimumworkingsetsize;
12085 : }
12086 :
12087 0 : static int py_netr_QUOTA_LIMITS_set_minimumworkingsetsize(PyObject *py_obj, PyObject *value, void *closure)
12088 : {
12089 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj);
12090 0 : if (value == NULL) {
12091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->minimumworkingsetsize");
12092 0 : return -1;
12093 : }
12094 : {
12095 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minimumworkingsetsize));
12096 0 : if (PyLong_Check(value)) {
12097 : unsigned long long test_var;
12098 0 : test_var = PyLong_AsUnsignedLongLong(value);
12099 0 : if (PyErr_Occurred() != NULL) {
12100 0 : return -1;
12101 : }
12102 0 : if (test_var > uint_max) {
12103 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12104 : PyLong_Type.tp_name, uint_max, test_var);
12105 0 : return -1;
12106 : }
12107 0 : object->minimumworkingsetsize = test_var;
12108 : } else {
12109 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12110 : PyLong_Type.tp_name);
12111 0 : return -1;
12112 : }
12113 : }
12114 0 : return 0;
12115 : }
12116 :
12117 0 : static PyObject *py_netr_QUOTA_LIMITS_get_maximumworkingsetsize(PyObject *obj, void *closure)
12118 : {
12119 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj);
12120 : PyObject *py_maximumworkingsetsize;
12121 0 : py_maximumworkingsetsize = PyLong_FromUnsignedLongLong((uint32_t)object->maximumworkingsetsize);
12122 0 : return py_maximumworkingsetsize;
12123 : }
12124 :
12125 0 : static int py_netr_QUOTA_LIMITS_set_maximumworkingsetsize(PyObject *py_obj, PyObject *value, void *closure)
12126 : {
12127 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj);
12128 0 : if (value == NULL) {
12129 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maximumworkingsetsize");
12130 0 : return -1;
12131 : }
12132 : {
12133 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maximumworkingsetsize));
12134 0 : if (PyLong_Check(value)) {
12135 : unsigned long long test_var;
12136 0 : test_var = PyLong_AsUnsignedLongLong(value);
12137 0 : if (PyErr_Occurred() != NULL) {
12138 0 : return -1;
12139 : }
12140 0 : if (test_var > uint_max) {
12141 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12142 : PyLong_Type.tp_name, uint_max, test_var);
12143 0 : return -1;
12144 : }
12145 0 : object->maximumworkingsetsize = test_var;
12146 : } else {
12147 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12148 : PyLong_Type.tp_name);
12149 0 : return -1;
12150 : }
12151 : }
12152 0 : return 0;
12153 : }
12154 :
12155 0 : static PyObject *py_netr_QUOTA_LIMITS_get_pagefilelimit(PyObject *obj, void *closure)
12156 : {
12157 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj);
12158 : PyObject *py_pagefilelimit;
12159 0 : py_pagefilelimit = PyLong_FromUnsignedLongLong((uint32_t)object->pagefilelimit);
12160 0 : return py_pagefilelimit;
12161 : }
12162 :
12163 0 : static int py_netr_QUOTA_LIMITS_set_pagefilelimit(PyObject *py_obj, PyObject *value, void *closure)
12164 : {
12165 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj);
12166 0 : if (value == NULL) {
12167 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pagefilelimit");
12168 0 : return -1;
12169 : }
12170 : {
12171 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pagefilelimit));
12172 0 : if (PyLong_Check(value)) {
12173 : unsigned long long test_var;
12174 0 : test_var = PyLong_AsUnsignedLongLong(value);
12175 0 : if (PyErr_Occurred() != NULL) {
12176 0 : return -1;
12177 : }
12178 0 : if (test_var > uint_max) {
12179 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12180 : PyLong_Type.tp_name, uint_max, test_var);
12181 0 : return -1;
12182 : }
12183 0 : object->pagefilelimit = test_var;
12184 : } else {
12185 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12186 : PyLong_Type.tp_name);
12187 0 : return -1;
12188 : }
12189 : }
12190 0 : return 0;
12191 : }
12192 :
12193 0 : static PyObject *py_netr_QUOTA_LIMITS_get_timelimit(PyObject *obj, void *closure)
12194 : {
12195 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(obj);
12196 : PyObject *py_timelimit;
12197 0 : py_timelimit = PyLong_FromUnsignedLongLong(object->timelimit);
12198 0 : return py_timelimit;
12199 : }
12200 :
12201 0 : static int py_netr_QUOTA_LIMITS_set_timelimit(PyObject *py_obj, PyObject *value, void *closure)
12202 : {
12203 0 : struct netr_QUOTA_LIMITS *object = (struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(py_obj);
12204 0 : if (value == NULL) {
12205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timelimit");
12206 0 : return -1;
12207 : }
12208 : {
12209 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timelimit));
12210 0 : if (PyLong_Check(value)) {
12211 : unsigned long long test_var;
12212 0 : test_var = PyLong_AsUnsignedLongLong(value);
12213 0 : if (PyErr_Occurred() != NULL) {
12214 0 : return -1;
12215 : }
12216 0 : if (test_var > uint_max) {
12217 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12218 : PyLong_Type.tp_name, uint_max, test_var);
12219 0 : return -1;
12220 : }
12221 0 : object->timelimit = test_var;
12222 : } else {
12223 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12224 : PyLong_Type.tp_name);
12225 0 : return -1;
12226 : }
12227 : }
12228 0 : return 0;
12229 : }
12230 :
12231 : static PyGetSetDef py_netr_QUOTA_LIMITS_getsetters[] = {
12232 : {
12233 : .name = discard_const_p(char, "pagedpoollimit"),
12234 : .get = py_netr_QUOTA_LIMITS_get_pagedpoollimit,
12235 : .set = py_netr_QUOTA_LIMITS_set_pagedpoollimit,
12236 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12237 : },
12238 : {
12239 : .name = discard_const_p(char, "nonpagedpoollimit"),
12240 : .get = py_netr_QUOTA_LIMITS_get_nonpagedpoollimit,
12241 : .set = py_netr_QUOTA_LIMITS_set_nonpagedpoollimit,
12242 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12243 : },
12244 : {
12245 : .name = discard_const_p(char, "minimumworkingsetsize"),
12246 : .get = py_netr_QUOTA_LIMITS_get_minimumworkingsetsize,
12247 : .set = py_netr_QUOTA_LIMITS_set_minimumworkingsetsize,
12248 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12249 : },
12250 : {
12251 : .name = discard_const_p(char, "maximumworkingsetsize"),
12252 : .get = py_netr_QUOTA_LIMITS_get_maximumworkingsetsize,
12253 : .set = py_netr_QUOTA_LIMITS_set_maximumworkingsetsize,
12254 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12255 : },
12256 : {
12257 : .name = discard_const_p(char, "pagefilelimit"),
12258 : .get = py_netr_QUOTA_LIMITS_get_pagefilelimit,
12259 : .set = py_netr_QUOTA_LIMITS_set_pagefilelimit,
12260 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12261 : },
12262 : {
12263 : .name = discard_const_p(char, "timelimit"),
12264 : .get = py_netr_QUOTA_LIMITS_get_timelimit,
12265 : .set = py_netr_QUOTA_LIMITS_set_timelimit,
12266 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
12267 : },
12268 : { .name = NULL }
12269 : };
12270 :
12271 0 : static PyObject *py_netr_QUOTA_LIMITS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12272 : {
12273 0 : return pytalloc_new(struct netr_QUOTA_LIMITS, type);
12274 : }
12275 :
12276 :
12277 : static PyTypeObject netr_QUOTA_LIMITS_Type = {
12278 : PyVarObject_HEAD_INIT(NULL, 0)
12279 : .tp_name = "netlogon.netr_QUOTA_LIMITS",
12280 : .tp_getset = py_netr_QUOTA_LIMITS_getsetters,
12281 : .tp_methods = NULL,
12282 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12283 : .tp_new = py_netr_QUOTA_LIMITS_new,
12284 : };
12285 :
12286 :
12287 0 : static PyObject *py_netr_DELTA_POLICY_get_maxlogsize(PyObject *obj, void *closure)
12288 : {
12289 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12290 : PyObject *py_maxlogsize;
12291 0 : py_maxlogsize = PyLong_FromUnsignedLongLong((uint32_t)object->maxlogsize);
12292 0 : return py_maxlogsize;
12293 : }
12294 :
12295 0 : static int py_netr_DELTA_POLICY_set_maxlogsize(PyObject *py_obj, PyObject *value, void *closure)
12296 : {
12297 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12298 0 : if (value == NULL) {
12299 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maxlogsize");
12300 0 : return -1;
12301 : }
12302 : {
12303 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxlogsize));
12304 0 : if (PyLong_Check(value)) {
12305 : unsigned long long test_var;
12306 0 : test_var = PyLong_AsUnsignedLongLong(value);
12307 0 : if (PyErr_Occurred() != NULL) {
12308 0 : return -1;
12309 : }
12310 0 : if (test_var > uint_max) {
12311 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12312 : PyLong_Type.tp_name, uint_max, test_var);
12313 0 : return -1;
12314 : }
12315 0 : object->maxlogsize = test_var;
12316 : } else {
12317 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12318 : PyLong_Type.tp_name);
12319 0 : return -1;
12320 : }
12321 : }
12322 0 : return 0;
12323 : }
12324 :
12325 0 : static PyObject *py_netr_DELTA_POLICY_get_auditretentionperiod(PyObject *obj, void *closure)
12326 : {
12327 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12328 : PyObject *py_auditretentionperiod;
12329 0 : py_auditretentionperiod = PyLong_FromUnsignedLongLong(object->auditretentionperiod);
12330 0 : return py_auditretentionperiod;
12331 : }
12332 :
12333 0 : static int py_netr_DELTA_POLICY_set_auditretentionperiod(PyObject *py_obj, PyObject *value, void *closure)
12334 : {
12335 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12336 0 : if (value == NULL) {
12337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auditretentionperiod");
12338 0 : return -1;
12339 : }
12340 : {
12341 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditretentionperiod));
12342 0 : if (PyLong_Check(value)) {
12343 : unsigned long long test_var;
12344 0 : test_var = PyLong_AsUnsignedLongLong(value);
12345 0 : if (PyErr_Occurred() != NULL) {
12346 0 : return -1;
12347 : }
12348 0 : if (test_var > uint_max) {
12349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12350 : PyLong_Type.tp_name, uint_max, test_var);
12351 0 : return -1;
12352 : }
12353 0 : object->auditretentionperiod = test_var;
12354 : } else {
12355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12356 : PyLong_Type.tp_name);
12357 0 : return -1;
12358 : }
12359 : }
12360 0 : return 0;
12361 : }
12362 :
12363 0 : static PyObject *py_netr_DELTA_POLICY_get_auditingmode(PyObject *obj, void *closure)
12364 : {
12365 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12366 : PyObject *py_auditingmode;
12367 0 : py_auditingmode = PyLong_FromLong((uint16_t)object->auditingmode);
12368 0 : return py_auditingmode;
12369 : }
12370 :
12371 0 : static int py_netr_DELTA_POLICY_set_auditingmode(PyObject *py_obj, PyObject *value, void *closure)
12372 : {
12373 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12374 0 : if (value == NULL) {
12375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auditingmode");
12376 0 : return -1;
12377 : }
12378 : {
12379 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditingmode));
12380 0 : if (PyLong_Check(value)) {
12381 : unsigned long long test_var;
12382 0 : test_var = PyLong_AsUnsignedLongLong(value);
12383 0 : if (PyErr_Occurred() != NULL) {
12384 0 : return -1;
12385 : }
12386 0 : if (test_var > uint_max) {
12387 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12388 : PyLong_Type.tp_name, uint_max, test_var);
12389 0 : return -1;
12390 : }
12391 0 : object->auditingmode = test_var;
12392 : } else {
12393 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12394 : PyLong_Type.tp_name);
12395 0 : return -1;
12396 : }
12397 : }
12398 0 : return 0;
12399 : }
12400 :
12401 0 : static PyObject *py_netr_DELTA_POLICY_get_maxauditeventcount(PyObject *obj, void *closure)
12402 : {
12403 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12404 : PyObject *py_maxauditeventcount;
12405 0 : py_maxauditeventcount = PyLong_FromUnsignedLongLong((uint32_t)object->maxauditeventcount);
12406 0 : return py_maxauditeventcount;
12407 : }
12408 :
12409 0 : static int py_netr_DELTA_POLICY_set_maxauditeventcount(PyObject *py_obj, PyObject *value, void *closure)
12410 : {
12411 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12412 0 : if (value == NULL) {
12413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maxauditeventcount");
12414 0 : return -1;
12415 : }
12416 : {
12417 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxauditeventcount));
12418 0 : if (PyLong_Check(value)) {
12419 : unsigned long long test_var;
12420 0 : test_var = PyLong_AsUnsignedLongLong(value);
12421 0 : if (PyErr_Occurred() != NULL) {
12422 0 : return -1;
12423 : }
12424 0 : if (test_var > uint_max) {
12425 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12426 : PyLong_Type.tp_name, uint_max, test_var);
12427 0 : return -1;
12428 : }
12429 0 : object->maxauditeventcount = test_var;
12430 : } else {
12431 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12432 : PyLong_Type.tp_name);
12433 0 : return -1;
12434 : }
12435 : }
12436 0 : return 0;
12437 : }
12438 :
12439 0 : static PyObject *py_netr_DELTA_POLICY_get_eventauditoptions(PyObject *obj, void *closure)
12440 : {
12441 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12442 : PyObject *py_eventauditoptions;
12443 0 : if (object->eventauditoptions == NULL) {
12444 0 : Py_RETURN_NONE;
12445 : }
12446 0 : if (object->eventauditoptions == NULL) {
12447 0 : py_eventauditoptions = Py_None;
12448 0 : Py_INCREF(py_eventauditoptions);
12449 : } else {
12450 0 : py_eventauditoptions = PyList_New(object->maxauditeventcount + 1);
12451 0 : if (py_eventauditoptions == NULL) {
12452 0 : return NULL;
12453 : }
12454 : {
12455 : int eventauditoptions_cntr_1;
12456 0 : for (eventauditoptions_cntr_1 = 0; eventauditoptions_cntr_1 < (object->maxauditeventcount + 1); eventauditoptions_cntr_1++) {
12457 : PyObject *py_eventauditoptions_1;
12458 0 : py_eventauditoptions_1 = PyLong_FromUnsignedLongLong((uint32_t)object->eventauditoptions[eventauditoptions_cntr_1]);
12459 0 : PyList_SetItem(py_eventauditoptions, eventauditoptions_cntr_1, py_eventauditoptions_1);
12460 : }
12461 : }
12462 : }
12463 0 : return py_eventauditoptions;
12464 : }
12465 :
12466 0 : static int py_netr_DELTA_POLICY_set_eventauditoptions(PyObject *py_obj, PyObject *value, void *closure)
12467 : {
12468 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12469 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->eventauditoptions));
12470 0 : if (value == NULL) {
12471 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->eventauditoptions");
12472 0 : return -1;
12473 : }
12474 0 : if (value == Py_None) {
12475 0 : object->eventauditoptions = NULL;
12476 : } else {
12477 0 : object->eventauditoptions = NULL;
12478 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
12479 : {
12480 : int eventauditoptions_cntr_1;
12481 0 : object->eventauditoptions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->eventauditoptions, PyList_GET_SIZE(value));
12482 0 : if (!object->eventauditoptions) { return -1;; }
12483 0 : talloc_set_name_const(object->eventauditoptions, "ARRAY: object->eventauditoptions");
12484 0 : for (eventauditoptions_cntr_1 = 0; eventauditoptions_cntr_1 < PyList_GET_SIZE(value); eventauditoptions_cntr_1++) {
12485 0 : if (PyList_GET_ITEM(value, eventauditoptions_cntr_1) == NULL) {
12486 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->eventauditoptions[eventauditoptions_cntr_1]");
12487 0 : return -1;
12488 : }
12489 : {
12490 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->eventauditoptions[eventauditoptions_cntr_1]));
12491 0 : if (PyLong_Check(PyList_GET_ITEM(value, eventauditoptions_cntr_1))) {
12492 : unsigned long long test_var;
12493 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, eventauditoptions_cntr_1));
12494 0 : if (PyErr_Occurred() != NULL) {
12495 0 : return -1;
12496 : }
12497 0 : if (test_var > uint_max) {
12498 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12499 : PyLong_Type.tp_name, uint_max, test_var);
12500 0 : return -1;
12501 : }
12502 0 : object->eventauditoptions[eventauditoptions_cntr_1] = test_var;
12503 : } else {
12504 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12505 : PyLong_Type.tp_name);
12506 0 : return -1;
12507 : }
12508 : }
12509 : }
12510 : }
12511 : }
12512 0 : return 0;
12513 : }
12514 :
12515 0 : static PyObject *py_netr_DELTA_POLICY_get_primary_domain_name(PyObject *obj, void *closure)
12516 : {
12517 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12518 : PyObject *py_primary_domain_name;
12519 0 : py_primary_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->primary_domain_name);
12520 0 : return py_primary_domain_name;
12521 : }
12522 :
12523 0 : static int py_netr_DELTA_POLICY_set_primary_domain_name(PyObject *py_obj, PyObject *value, void *closure)
12524 : {
12525 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12526 0 : if (value == NULL) {
12527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_domain_name");
12528 0 : return -1;
12529 : }
12530 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
12531 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12532 0 : PyErr_NoMemory();
12533 0 : return -1;
12534 : }
12535 0 : object->primary_domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
12536 0 : return 0;
12537 : }
12538 :
12539 0 : static PyObject *py_netr_DELTA_POLICY_get_sid(PyObject *obj, void *closure)
12540 : {
12541 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12542 : PyObject *py_sid;
12543 0 : if (object->sid == NULL) {
12544 0 : Py_RETURN_NONE;
12545 : }
12546 0 : if (object->sid == NULL) {
12547 0 : py_sid = Py_None;
12548 0 : Py_INCREF(py_sid);
12549 : } else {
12550 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
12551 : }
12552 0 : return py_sid;
12553 : }
12554 :
12555 0 : static int py_netr_DELTA_POLICY_set_sid(PyObject *py_obj, PyObject *value, void *closure)
12556 : {
12557 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12558 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
12559 0 : if (value == NULL) {
12560 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
12561 0 : return -1;
12562 : }
12563 0 : if (value == Py_None) {
12564 0 : object->sid = NULL;
12565 : } else {
12566 0 : object->sid = NULL;
12567 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
12568 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12569 0 : PyErr_NoMemory();
12570 0 : return -1;
12571 : }
12572 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
12573 : }
12574 0 : return 0;
12575 : }
12576 :
12577 0 : static PyObject *py_netr_DELTA_POLICY_get_quota_limits(PyObject *obj, void *closure)
12578 : {
12579 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12580 : PyObject *py_quota_limits;
12581 0 : py_quota_limits = pytalloc_reference_ex(&netr_QUOTA_LIMITS_Type, pytalloc_get_mem_ctx(obj), &object->quota_limits);
12582 0 : return py_quota_limits;
12583 : }
12584 :
12585 0 : static int py_netr_DELTA_POLICY_set_quota_limits(PyObject *py_obj, PyObject *value, void *closure)
12586 : {
12587 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12588 0 : if (value == NULL) {
12589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->quota_limits");
12590 0 : return -1;
12591 : }
12592 0 : PY_CHECK_TYPE(&netr_QUOTA_LIMITS_Type, value, return -1;);
12593 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12594 0 : PyErr_NoMemory();
12595 0 : return -1;
12596 : }
12597 0 : object->quota_limits = *(struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(value);
12598 0 : return 0;
12599 : }
12600 :
12601 0 : static PyObject *py_netr_DELTA_POLICY_get_sequence_num(PyObject *obj, void *closure)
12602 : {
12603 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12604 : PyObject *py_sequence_num;
12605 0 : py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num);
12606 0 : return py_sequence_num;
12607 : }
12608 :
12609 0 : static int py_netr_DELTA_POLICY_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
12610 : {
12611 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12612 0 : if (value == NULL) {
12613 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num");
12614 0 : return -1;
12615 : }
12616 : {
12617 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num));
12618 0 : if (PyLong_Check(value)) {
12619 : unsigned long long test_var;
12620 0 : test_var = PyLong_AsUnsignedLongLong(value);
12621 0 : if (PyErr_Occurred() != NULL) {
12622 0 : return -1;
12623 : }
12624 0 : if (test_var > uint_max) {
12625 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12626 : PyLong_Type.tp_name, uint_max, test_var);
12627 0 : return -1;
12628 : }
12629 0 : object->sequence_num = test_var;
12630 : } else {
12631 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12632 : PyLong_Type.tp_name);
12633 0 : return -1;
12634 : }
12635 : }
12636 0 : return 0;
12637 : }
12638 :
12639 0 : static PyObject *py_netr_DELTA_POLICY_get_db_create_time(PyObject *obj, void *closure)
12640 : {
12641 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12642 : PyObject *py_db_create_time;
12643 0 : py_db_create_time = PyLong_FromUnsignedLongLong(object->db_create_time);
12644 0 : return py_db_create_time;
12645 : }
12646 :
12647 0 : static int py_netr_DELTA_POLICY_set_db_create_time(PyObject *py_obj, PyObject *value, void *closure)
12648 : {
12649 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12650 0 : if (value == NULL) {
12651 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_create_time");
12652 0 : return -1;
12653 : }
12654 : {
12655 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_create_time));
12656 0 : if (PyLong_Check(value)) {
12657 : unsigned long long test_var;
12658 0 : test_var = PyLong_AsUnsignedLongLong(value);
12659 0 : if (PyErr_Occurred() != NULL) {
12660 0 : return -1;
12661 : }
12662 0 : if (test_var > uint_max) {
12663 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12664 : PyLong_Type.tp_name, uint_max, test_var);
12665 0 : return -1;
12666 : }
12667 0 : object->db_create_time = test_var;
12668 : } else {
12669 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12670 : PyLong_Type.tp_name);
12671 0 : return -1;
12672 : }
12673 : }
12674 0 : return 0;
12675 : }
12676 :
12677 0 : static PyObject *py_netr_DELTA_POLICY_get_SecurityInformation(PyObject *obj, void *closure)
12678 : {
12679 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12680 : PyObject *py_SecurityInformation;
12681 0 : py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation);
12682 0 : return py_SecurityInformation;
12683 : }
12684 :
12685 0 : static int py_netr_DELTA_POLICY_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure)
12686 : {
12687 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12688 0 : if (value == NULL) {
12689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation");
12690 0 : return -1;
12691 : }
12692 : {
12693 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation));
12694 0 : if (PyLong_Check(value)) {
12695 : unsigned long long test_var;
12696 0 : test_var = PyLong_AsUnsignedLongLong(value);
12697 0 : if (PyErr_Occurred() != NULL) {
12698 0 : return -1;
12699 : }
12700 0 : if (test_var > uint_max) {
12701 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12702 : PyLong_Type.tp_name, uint_max, test_var);
12703 0 : return -1;
12704 : }
12705 0 : object->SecurityInformation = test_var;
12706 : } else {
12707 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12708 : PyLong_Type.tp_name);
12709 0 : return -1;
12710 : }
12711 : }
12712 0 : return 0;
12713 : }
12714 :
12715 0 : static PyObject *py_netr_DELTA_POLICY_get_sdbuf(PyObject *obj, void *closure)
12716 : {
12717 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12718 : PyObject *py_sdbuf;
12719 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf);
12720 0 : return py_sdbuf;
12721 : }
12722 :
12723 0 : static int py_netr_DELTA_POLICY_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
12724 : {
12725 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12726 0 : if (value == NULL) {
12727 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf");
12728 0 : return -1;
12729 : }
12730 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
12731 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12732 0 : PyErr_NoMemory();
12733 0 : return -1;
12734 : }
12735 0 : object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
12736 0 : return 0;
12737 : }
12738 :
12739 0 : static PyObject *py_netr_DELTA_POLICY_get_unknown1(PyObject *obj, void *closure)
12740 : {
12741 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12742 : PyObject *py_unknown1;
12743 0 : py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1);
12744 0 : return py_unknown1;
12745 : }
12746 :
12747 0 : static int py_netr_DELTA_POLICY_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
12748 : {
12749 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12750 0 : if (value == NULL) {
12751 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
12752 0 : return -1;
12753 : }
12754 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
12755 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12756 0 : PyErr_NoMemory();
12757 0 : return -1;
12758 : }
12759 0 : object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value);
12760 0 : return 0;
12761 : }
12762 :
12763 0 : static PyObject *py_netr_DELTA_POLICY_get_unknown2(PyObject *obj, void *closure)
12764 : {
12765 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12766 : PyObject *py_unknown2;
12767 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
12768 0 : return py_unknown2;
12769 : }
12770 :
12771 0 : static int py_netr_DELTA_POLICY_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
12772 : {
12773 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12774 0 : if (value == NULL) {
12775 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
12776 0 : return -1;
12777 : }
12778 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
12779 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12780 0 : PyErr_NoMemory();
12781 0 : return -1;
12782 : }
12783 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
12784 0 : return 0;
12785 : }
12786 :
12787 0 : static PyObject *py_netr_DELTA_POLICY_get_unknown3(PyObject *obj, void *closure)
12788 : {
12789 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12790 : PyObject *py_unknown3;
12791 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
12792 0 : return py_unknown3;
12793 : }
12794 :
12795 0 : static int py_netr_DELTA_POLICY_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
12796 : {
12797 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12798 0 : if (value == NULL) {
12799 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
12800 0 : return -1;
12801 : }
12802 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
12803 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12804 0 : PyErr_NoMemory();
12805 0 : return -1;
12806 : }
12807 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
12808 0 : return 0;
12809 : }
12810 :
12811 0 : static PyObject *py_netr_DELTA_POLICY_get_unknown4(PyObject *obj, void *closure)
12812 : {
12813 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12814 : PyObject *py_unknown4;
12815 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
12816 0 : return py_unknown4;
12817 : }
12818 :
12819 0 : static int py_netr_DELTA_POLICY_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
12820 : {
12821 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12822 0 : if (value == NULL) {
12823 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
12824 0 : return -1;
12825 : }
12826 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
12827 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12828 0 : PyErr_NoMemory();
12829 0 : return -1;
12830 : }
12831 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
12832 0 : return 0;
12833 : }
12834 :
12835 0 : static PyObject *py_netr_DELTA_POLICY_get_unknown5(PyObject *obj, void *closure)
12836 : {
12837 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12838 : PyObject *py_unknown5;
12839 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
12840 0 : return py_unknown5;
12841 : }
12842 :
12843 0 : static int py_netr_DELTA_POLICY_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
12844 : {
12845 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12846 0 : if (value == NULL) {
12847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
12848 0 : return -1;
12849 : }
12850 : {
12851 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
12852 0 : if (PyLong_Check(value)) {
12853 : unsigned long long test_var;
12854 0 : test_var = PyLong_AsUnsignedLongLong(value);
12855 0 : if (PyErr_Occurred() != NULL) {
12856 0 : return -1;
12857 : }
12858 0 : if (test_var > uint_max) {
12859 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12860 : PyLong_Type.tp_name, uint_max, test_var);
12861 0 : return -1;
12862 : }
12863 0 : object->unknown5 = test_var;
12864 : } else {
12865 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12866 : PyLong_Type.tp_name);
12867 0 : return -1;
12868 : }
12869 : }
12870 0 : return 0;
12871 : }
12872 :
12873 0 : static PyObject *py_netr_DELTA_POLICY_get_unknown6(PyObject *obj, void *closure)
12874 : {
12875 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12876 : PyObject *py_unknown6;
12877 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
12878 0 : return py_unknown6;
12879 : }
12880 :
12881 0 : static int py_netr_DELTA_POLICY_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
12882 : {
12883 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12884 0 : if (value == NULL) {
12885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
12886 0 : return -1;
12887 : }
12888 : {
12889 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
12890 0 : if (PyLong_Check(value)) {
12891 : unsigned long long test_var;
12892 0 : test_var = PyLong_AsUnsignedLongLong(value);
12893 0 : if (PyErr_Occurred() != NULL) {
12894 0 : return -1;
12895 : }
12896 0 : if (test_var > uint_max) {
12897 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12898 : PyLong_Type.tp_name, uint_max, test_var);
12899 0 : return -1;
12900 : }
12901 0 : object->unknown6 = test_var;
12902 : } else {
12903 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12904 : PyLong_Type.tp_name);
12905 0 : return -1;
12906 : }
12907 : }
12908 0 : return 0;
12909 : }
12910 :
12911 0 : static PyObject *py_netr_DELTA_POLICY_get_unknown7(PyObject *obj, void *closure)
12912 : {
12913 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12914 : PyObject *py_unknown7;
12915 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
12916 0 : return py_unknown7;
12917 : }
12918 :
12919 0 : static int py_netr_DELTA_POLICY_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
12920 : {
12921 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12922 0 : if (value == NULL) {
12923 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
12924 0 : return -1;
12925 : }
12926 : {
12927 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
12928 0 : if (PyLong_Check(value)) {
12929 : unsigned long long test_var;
12930 0 : test_var = PyLong_AsUnsignedLongLong(value);
12931 0 : if (PyErr_Occurred() != NULL) {
12932 0 : return -1;
12933 : }
12934 0 : if (test_var > uint_max) {
12935 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12936 : PyLong_Type.tp_name, uint_max, test_var);
12937 0 : return -1;
12938 : }
12939 0 : object->unknown7 = test_var;
12940 : } else {
12941 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12942 : PyLong_Type.tp_name);
12943 0 : return -1;
12944 : }
12945 : }
12946 0 : return 0;
12947 : }
12948 :
12949 0 : static PyObject *py_netr_DELTA_POLICY_get_unknown8(PyObject *obj, void *closure)
12950 : {
12951 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(obj);
12952 : PyObject *py_unknown8;
12953 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
12954 0 : return py_unknown8;
12955 : }
12956 :
12957 0 : static int py_netr_DELTA_POLICY_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
12958 : {
12959 0 : struct netr_DELTA_POLICY *object = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(py_obj);
12960 0 : if (value == NULL) {
12961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
12962 0 : return -1;
12963 : }
12964 : {
12965 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
12966 0 : if (PyLong_Check(value)) {
12967 : unsigned long long test_var;
12968 0 : test_var = PyLong_AsUnsignedLongLong(value);
12969 0 : if (PyErr_Occurred() != NULL) {
12970 0 : return -1;
12971 : }
12972 0 : if (test_var > uint_max) {
12973 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12974 : PyLong_Type.tp_name, uint_max, test_var);
12975 0 : return -1;
12976 : }
12977 0 : object->unknown8 = test_var;
12978 : } else {
12979 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12980 : PyLong_Type.tp_name);
12981 0 : return -1;
12982 : }
12983 : }
12984 0 : return 0;
12985 : }
12986 :
12987 : static PyGetSetDef py_netr_DELTA_POLICY_getsetters[] = {
12988 : {
12989 : .name = discard_const_p(char, "maxlogsize"),
12990 : .get = py_netr_DELTA_POLICY_get_maxlogsize,
12991 : .set = py_netr_DELTA_POLICY_set_maxlogsize,
12992 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12993 : },
12994 : {
12995 : .name = discard_const_p(char, "auditretentionperiod"),
12996 : .get = py_netr_DELTA_POLICY_get_auditretentionperiod,
12997 : .set = py_netr_DELTA_POLICY_set_auditretentionperiod,
12998 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
12999 : },
13000 : {
13001 : .name = discard_const_p(char, "auditingmode"),
13002 : .get = py_netr_DELTA_POLICY_get_auditingmode,
13003 : .set = py_netr_DELTA_POLICY_set_auditingmode,
13004 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13005 : },
13006 : {
13007 : .name = discard_const_p(char, "maxauditeventcount"),
13008 : .get = py_netr_DELTA_POLICY_get_maxauditeventcount,
13009 : .set = py_netr_DELTA_POLICY_set_maxauditeventcount,
13010 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13011 : },
13012 : {
13013 : .name = discard_const_p(char, "eventauditoptions"),
13014 : .get = py_netr_DELTA_POLICY_get_eventauditoptions,
13015 : .set = py_netr_DELTA_POLICY_set_eventauditoptions,
13016 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13017 : },
13018 : {
13019 : .name = discard_const_p(char, "primary_domain_name"),
13020 : .get = py_netr_DELTA_POLICY_get_primary_domain_name,
13021 : .set = py_netr_DELTA_POLICY_set_primary_domain_name,
13022 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13023 : },
13024 : {
13025 : .name = discard_const_p(char, "sid"),
13026 : .get = py_netr_DELTA_POLICY_get_sid,
13027 : .set = py_netr_DELTA_POLICY_set_sid,
13028 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
13029 : },
13030 : {
13031 : .name = discard_const_p(char, "quota_limits"),
13032 : .get = py_netr_DELTA_POLICY_get_quota_limits,
13033 : .set = py_netr_DELTA_POLICY_set_quota_limits,
13034 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_QUOTA_LIMITS")
13035 : },
13036 : {
13037 : .name = discard_const_p(char, "sequence_num"),
13038 : .get = py_netr_DELTA_POLICY_get_sequence_num,
13039 : .set = py_netr_DELTA_POLICY_set_sequence_num,
13040 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
13041 : },
13042 : {
13043 : .name = discard_const_p(char, "db_create_time"),
13044 : .get = py_netr_DELTA_POLICY_get_db_create_time,
13045 : .set = py_netr_DELTA_POLICY_set_db_create_time,
13046 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
13047 : },
13048 : {
13049 : .name = discard_const_p(char, "SecurityInformation"),
13050 : .get = py_netr_DELTA_POLICY_get_SecurityInformation,
13051 : .set = py_netr_DELTA_POLICY_set_SecurityInformation,
13052 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13053 : },
13054 : {
13055 : .name = discard_const_p(char, "sdbuf"),
13056 : .get = py_netr_DELTA_POLICY_get_sdbuf,
13057 : .set = py_netr_DELTA_POLICY_set_sdbuf,
13058 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
13059 : },
13060 : {
13061 : .name = discard_const_p(char, "unknown1"),
13062 : .get = py_netr_DELTA_POLICY_get_unknown1,
13063 : .set = py_netr_DELTA_POLICY_set_unknown1,
13064 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13065 : },
13066 : {
13067 : .name = discard_const_p(char, "unknown2"),
13068 : .get = py_netr_DELTA_POLICY_get_unknown2,
13069 : .set = py_netr_DELTA_POLICY_set_unknown2,
13070 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13071 : },
13072 : {
13073 : .name = discard_const_p(char, "unknown3"),
13074 : .get = py_netr_DELTA_POLICY_get_unknown3,
13075 : .set = py_netr_DELTA_POLICY_set_unknown3,
13076 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13077 : },
13078 : {
13079 : .name = discard_const_p(char, "unknown4"),
13080 : .get = py_netr_DELTA_POLICY_get_unknown4,
13081 : .set = py_netr_DELTA_POLICY_set_unknown4,
13082 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13083 : },
13084 : {
13085 : .name = discard_const_p(char, "unknown5"),
13086 : .get = py_netr_DELTA_POLICY_get_unknown5,
13087 : .set = py_netr_DELTA_POLICY_set_unknown5,
13088 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13089 : },
13090 : {
13091 : .name = discard_const_p(char, "unknown6"),
13092 : .get = py_netr_DELTA_POLICY_get_unknown6,
13093 : .set = py_netr_DELTA_POLICY_set_unknown6,
13094 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13095 : },
13096 : {
13097 : .name = discard_const_p(char, "unknown7"),
13098 : .get = py_netr_DELTA_POLICY_get_unknown7,
13099 : .set = py_netr_DELTA_POLICY_set_unknown7,
13100 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13101 : },
13102 : {
13103 : .name = discard_const_p(char, "unknown8"),
13104 : .get = py_netr_DELTA_POLICY_get_unknown8,
13105 : .set = py_netr_DELTA_POLICY_set_unknown8,
13106 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13107 : },
13108 : { .name = NULL }
13109 : };
13110 :
13111 0 : static PyObject *py_netr_DELTA_POLICY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13112 : {
13113 0 : return pytalloc_new(struct netr_DELTA_POLICY, type);
13114 : }
13115 :
13116 :
13117 : static PyTypeObject netr_DELTA_POLICY_Type = {
13118 : PyVarObject_HEAD_INIT(NULL, 0)
13119 : .tp_name = "netlogon.netr_DELTA_POLICY",
13120 : .tp_getset = py_netr_DELTA_POLICY_getsetters,
13121 : .tp_methods = NULL,
13122 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13123 : .tp_new = py_netr_DELTA_POLICY_new,
13124 : };
13125 :
13126 :
13127 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_domain_name(PyObject *obj, void *closure)
13128 : {
13129 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13130 : PyObject *py_domain_name;
13131 0 : py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
13132 0 : return py_domain_name;
13133 : }
13134 :
13135 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
13136 : {
13137 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13138 0 : if (value == NULL) {
13139 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
13140 0 : return -1;
13141 : }
13142 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
13143 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13144 0 : PyErr_NoMemory();
13145 0 : return -1;
13146 : }
13147 0 : object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
13148 0 : return 0;
13149 : }
13150 :
13151 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_num_controllers(PyObject *obj, void *closure)
13152 : {
13153 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13154 : PyObject *py_num_controllers;
13155 0 : py_num_controllers = PyLong_FromUnsignedLongLong((uint32_t)object->num_controllers);
13156 0 : return py_num_controllers;
13157 : }
13158 :
13159 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_num_controllers(PyObject *py_obj, PyObject *value, void *closure)
13160 : {
13161 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13162 0 : if (value == NULL) {
13163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_controllers");
13164 0 : return -1;
13165 : }
13166 : {
13167 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_controllers));
13168 0 : if (PyLong_Check(value)) {
13169 : unsigned long long test_var;
13170 0 : test_var = PyLong_AsUnsignedLongLong(value);
13171 0 : if (PyErr_Occurred() != NULL) {
13172 0 : return -1;
13173 : }
13174 0 : if (test_var > uint_max) {
13175 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13176 : PyLong_Type.tp_name, uint_max, test_var);
13177 0 : return -1;
13178 : }
13179 0 : object->num_controllers = test_var;
13180 : } else {
13181 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13182 : PyLong_Type.tp_name);
13183 0 : return -1;
13184 : }
13185 : }
13186 0 : return 0;
13187 : }
13188 :
13189 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_controller_names(PyObject *obj, void *closure)
13190 : {
13191 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13192 : PyObject *py_controller_names;
13193 0 : if (object->controller_names == NULL) {
13194 0 : Py_RETURN_NONE;
13195 : }
13196 0 : if (object->controller_names == NULL) {
13197 0 : py_controller_names = Py_None;
13198 0 : Py_INCREF(py_controller_names);
13199 : } else {
13200 0 : py_controller_names = PyList_New(object->num_controllers);
13201 0 : if (py_controller_names == NULL) {
13202 0 : return NULL;
13203 : }
13204 : {
13205 : int controller_names_cntr_1;
13206 0 : for (controller_names_cntr_1 = 0; controller_names_cntr_1 < (object->num_controllers); controller_names_cntr_1++) {
13207 : PyObject *py_controller_names_1;
13208 0 : py_controller_names_1 = pytalloc_reference_ex(lsa_String_Type, object->controller_names, &object->controller_names[controller_names_cntr_1]);
13209 0 : PyList_SetItem(py_controller_names, controller_names_cntr_1, py_controller_names_1);
13210 : }
13211 : }
13212 : }
13213 0 : return py_controller_names;
13214 : }
13215 :
13216 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_controller_names(PyObject *py_obj, PyObject *value, void *closure)
13217 : {
13218 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13219 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->controller_names));
13220 0 : if (value == NULL) {
13221 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->controller_names");
13222 0 : return -1;
13223 : }
13224 0 : if (value == Py_None) {
13225 0 : object->controller_names = NULL;
13226 : } else {
13227 0 : object->controller_names = NULL;
13228 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
13229 : {
13230 : int controller_names_cntr_1;
13231 0 : object->controller_names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->controller_names, PyList_GET_SIZE(value));
13232 0 : if (!object->controller_names) { return -1;; }
13233 0 : talloc_set_name_const(object->controller_names, "ARRAY: object->controller_names");
13234 0 : for (controller_names_cntr_1 = 0; controller_names_cntr_1 < PyList_GET_SIZE(value); controller_names_cntr_1++) {
13235 0 : if (PyList_GET_ITEM(value, controller_names_cntr_1) == NULL) {
13236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->controller_names[controller_names_cntr_1]");
13237 0 : return -1;
13238 : }
13239 0 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, controller_names_cntr_1), return -1;);
13240 0 : if (talloc_reference(object->controller_names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, controller_names_cntr_1))) == NULL) {
13241 0 : PyErr_NoMemory();
13242 0 : return -1;
13243 : }
13244 0 : object->controller_names[controller_names_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, controller_names_cntr_1));
13245 : }
13246 : }
13247 : }
13248 0 : return 0;
13249 : }
13250 :
13251 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_SecurityInformation(PyObject *obj, void *closure)
13252 : {
13253 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13254 : PyObject *py_SecurityInformation;
13255 0 : py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation);
13256 0 : return py_SecurityInformation;
13257 : }
13258 :
13259 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure)
13260 : {
13261 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13262 0 : if (value == NULL) {
13263 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation");
13264 0 : return -1;
13265 : }
13266 : {
13267 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation));
13268 0 : if (PyLong_Check(value)) {
13269 : unsigned long long test_var;
13270 0 : test_var = PyLong_AsUnsignedLongLong(value);
13271 0 : if (PyErr_Occurred() != NULL) {
13272 0 : return -1;
13273 : }
13274 0 : if (test_var > uint_max) {
13275 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13276 : PyLong_Type.tp_name, uint_max, test_var);
13277 0 : return -1;
13278 : }
13279 0 : object->SecurityInformation = test_var;
13280 : } else {
13281 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13282 : PyLong_Type.tp_name);
13283 0 : return -1;
13284 : }
13285 : }
13286 0 : return 0;
13287 : }
13288 :
13289 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_sdbuf(PyObject *obj, void *closure)
13290 : {
13291 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13292 : PyObject *py_sdbuf;
13293 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf);
13294 0 : return py_sdbuf;
13295 : }
13296 :
13297 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
13298 : {
13299 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13300 0 : if (value == NULL) {
13301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf");
13302 0 : return -1;
13303 : }
13304 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
13305 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13306 0 : PyErr_NoMemory();
13307 0 : return -1;
13308 : }
13309 0 : object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
13310 0 : return 0;
13311 : }
13312 :
13313 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown1(PyObject *obj, void *closure)
13314 : {
13315 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13316 : PyObject *py_unknown1;
13317 0 : py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1);
13318 0 : return py_unknown1;
13319 : }
13320 :
13321 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
13322 : {
13323 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13324 0 : if (value == NULL) {
13325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
13326 0 : return -1;
13327 : }
13328 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
13329 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13330 0 : PyErr_NoMemory();
13331 0 : return -1;
13332 : }
13333 0 : object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value);
13334 0 : return 0;
13335 : }
13336 :
13337 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown2(PyObject *obj, void *closure)
13338 : {
13339 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13340 : PyObject *py_unknown2;
13341 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
13342 0 : return py_unknown2;
13343 : }
13344 :
13345 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
13346 : {
13347 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13348 0 : if (value == NULL) {
13349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
13350 0 : return -1;
13351 : }
13352 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
13353 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13354 0 : PyErr_NoMemory();
13355 0 : return -1;
13356 : }
13357 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
13358 0 : return 0;
13359 : }
13360 :
13361 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown3(PyObject *obj, void *closure)
13362 : {
13363 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13364 : PyObject *py_unknown3;
13365 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
13366 0 : return py_unknown3;
13367 : }
13368 :
13369 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
13370 : {
13371 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13372 0 : if (value == NULL) {
13373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
13374 0 : return -1;
13375 : }
13376 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
13377 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13378 0 : PyErr_NoMemory();
13379 0 : return -1;
13380 : }
13381 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
13382 0 : return 0;
13383 : }
13384 :
13385 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown4(PyObject *obj, void *closure)
13386 : {
13387 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13388 : PyObject *py_unknown4;
13389 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
13390 0 : return py_unknown4;
13391 : }
13392 :
13393 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
13394 : {
13395 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13396 0 : if (value == NULL) {
13397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
13398 0 : return -1;
13399 : }
13400 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
13401 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13402 0 : PyErr_NoMemory();
13403 0 : return -1;
13404 : }
13405 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
13406 0 : return 0;
13407 : }
13408 :
13409 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_posix_offset(PyObject *obj, void *closure)
13410 : {
13411 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13412 : PyObject *py_posix_offset;
13413 0 : py_posix_offset = PyLong_FromUnsignedLongLong((uint32_t)object->posix_offset);
13414 0 : return py_posix_offset;
13415 : }
13416 :
13417 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
13418 : {
13419 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13420 0 : if (value == NULL) {
13421 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
13422 0 : return -1;
13423 : }
13424 : {
13425 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->posix_offset));
13426 0 : if (PyLong_Check(value)) {
13427 : unsigned long long test_var;
13428 0 : test_var = PyLong_AsUnsignedLongLong(value);
13429 0 : if (PyErr_Occurred() != NULL) {
13430 0 : return -1;
13431 : }
13432 0 : if (test_var > uint_max) {
13433 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13434 : PyLong_Type.tp_name, uint_max, test_var);
13435 0 : return -1;
13436 : }
13437 0 : object->posix_offset = test_var;
13438 : } else {
13439 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13440 : PyLong_Type.tp_name);
13441 0 : return -1;
13442 : }
13443 : }
13444 0 : return 0;
13445 : }
13446 :
13447 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown6(PyObject *obj, void *closure)
13448 : {
13449 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13450 : PyObject *py_unknown6;
13451 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
13452 0 : return py_unknown6;
13453 : }
13454 :
13455 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
13456 : {
13457 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13458 0 : if (value == NULL) {
13459 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
13460 0 : return -1;
13461 : }
13462 : {
13463 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
13464 0 : if (PyLong_Check(value)) {
13465 : unsigned long long test_var;
13466 0 : test_var = PyLong_AsUnsignedLongLong(value);
13467 0 : if (PyErr_Occurred() != NULL) {
13468 0 : return -1;
13469 : }
13470 0 : if (test_var > uint_max) {
13471 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13472 : PyLong_Type.tp_name, uint_max, test_var);
13473 0 : return -1;
13474 : }
13475 0 : object->unknown6 = test_var;
13476 : } else {
13477 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13478 : PyLong_Type.tp_name);
13479 0 : return -1;
13480 : }
13481 : }
13482 0 : return 0;
13483 : }
13484 :
13485 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown7(PyObject *obj, void *closure)
13486 : {
13487 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13488 : PyObject *py_unknown7;
13489 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
13490 0 : return py_unknown7;
13491 : }
13492 :
13493 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
13494 : {
13495 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13496 0 : if (value == NULL) {
13497 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
13498 0 : return -1;
13499 : }
13500 : {
13501 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
13502 0 : if (PyLong_Check(value)) {
13503 : unsigned long long test_var;
13504 0 : test_var = PyLong_AsUnsignedLongLong(value);
13505 0 : if (PyErr_Occurred() != NULL) {
13506 0 : return -1;
13507 : }
13508 0 : if (test_var > uint_max) {
13509 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13510 : PyLong_Type.tp_name, uint_max, test_var);
13511 0 : return -1;
13512 : }
13513 0 : object->unknown7 = test_var;
13514 : } else {
13515 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13516 : PyLong_Type.tp_name);
13517 0 : return -1;
13518 : }
13519 : }
13520 0 : return 0;
13521 : }
13522 :
13523 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_get_unknown8(PyObject *obj, void *closure)
13524 : {
13525 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(obj);
13526 : PyObject *py_unknown8;
13527 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
13528 0 : return py_unknown8;
13529 : }
13530 :
13531 0 : static int py_netr_DELTA_TRUSTED_DOMAIN_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
13532 : {
13533 0 : struct netr_DELTA_TRUSTED_DOMAIN *object = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(py_obj);
13534 0 : if (value == NULL) {
13535 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
13536 0 : return -1;
13537 : }
13538 : {
13539 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
13540 0 : if (PyLong_Check(value)) {
13541 : unsigned long long test_var;
13542 0 : test_var = PyLong_AsUnsignedLongLong(value);
13543 0 : if (PyErr_Occurred() != NULL) {
13544 0 : return -1;
13545 : }
13546 0 : if (test_var > uint_max) {
13547 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13548 : PyLong_Type.tp_name, uint_max, test_var);
13549 0 : return -1;
13550 : }
13551 0 : object->unknown8 = test_var;
13552 : } else {
13553 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13554 : PyLong_Type.tp_name);
13555 0 : return -1;
13556 : }
13557 : }
13558 0 : return 0;
13559 : }
13560 :
13561 : static PyGetSetDef py_netr_DELTA_TRUSTED_DOMAIN_getsetters[] = {
13562 : {
13563 : .name = discard_const_p(char, "domain_name"),
13564 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_domain_name,
13565 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_domain_name,
13566 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13567 : },
13568 : {
13569 : .name = discard_const_p(char, "num_controllers"),
13570 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_num_controllers,
13571 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_num_controllers,
13572 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13573 : },
13574 : {
13575 : .name = discard_const_p(char, "controller_names"),
13576 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_controller_names,
13577 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_controller_names,
13578 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13579 : },
13580 : {
13581 : .name = discard_const_p(char, "SecurityInformation"),
13582 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_SecurityInformation,
13583 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_SecurityInformation,
13584 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13585 : },
13586 : {
13587 : .name = discard_const_p(char, "sdbuf"),
13588 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_sdbuf,
13589 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_sdbuf,
13590 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
13591 : },
13592 : {
13593 : .name = discard_const_p(char, "unknown1"),
13594 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown1,
13595 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown1,
13596 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13597 : },
13598 : {
13599 : .name = discard_const_p(char, "unknown2"),
13600 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown2,
13601 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown2,
13602 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13603 : },
13604 : {
13605 : .name = discard_const_p(char, "unknown3"),
13606 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown3,
13607 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown3,
13608 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13609 : },
13610 : {
13611 : .name = discard_const_p(char, "unknown4"),
13612 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown4,
13613 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown4,
13614 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
13615 : },
13616 : {
13617 : .name = discard_const_p(char, "posix_offset"),
13618 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_posix_offset,
13619 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_posix_offset,
13620 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13621 : },
13622 : {
13623 : .name = discard_const_p(char, "unknown6"),
13624 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown6,
13625 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown6,
13626 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13627 : },
13628 : {
13629 : .name = discard_const_p(char, "unknown7"),
13630 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown7,
13631 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown7,
13632 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13633 : },
13634 : {
13635 : .name = discard_const_p(char, "unknown8"),
13636 : .get = py_netr_DELTA_TRUSTED_DOMAIN_get_unknown8,
13637 : .set = py_netr_DELTA_TRUSTED_DOMAIN_set_unknown8,
13638 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13639 : },
13640 : { .name = NULL }
13641 : };
13642 :
13643 0 : static PyObject *py_netr_DELTA_TRUSTED_DOMAIN_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13644 : {
13645 0 : return pytalloc_new(struct netr_DELTA_TRUSTED_DOMAIN, type);
13646 : }
13647 :
13648 :
13649 : static PyTypeObject netr_DELTA_TRUSTED_DOMAIN_Type = {
13650 : PyVarObject_HEAD_INIT(NULL, 0)
13651 : .tp_name = "netlogon.netr_DELTA_TRUSTED_DOMAIN",
13652 : .tp_getset = py_netr_DELTA_TRUSTED_DOMAIN_getsetters,
13653 : .tp_methods = NULL,
13654 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13655 : .tp_new = py_netr_DELTA_TRUSTED_DOMAIN_new,
13656 : };
13657 :
13658 :
13659 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_privilege_entries(PyObject *obj, void *closure)
13660 : {
13661 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
13662 : PyObject *py_privilege_entries;
13663 0 : py_privilege_entries = PyLong_FromUnsignedLongLong((uint32_t)object->privilege_entries);
13664 0 : return py_privilege_entries;
13665 : }
13666 :
13667 0 : static int py_netr_DELTA_ACCOUNT_set_privilege_entries(PyObject *py_obj, PyObject *value, void *closure)
13668 : {
13669 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
13670 0 : if (value == NULL) {
13671 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_entries");
13672 0 : return -1;
13673 : }
13674 : {
13675 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_entries));
13676 0 : if (PyLong_Check(value)) {
13677 : unsigned long long test_var;
13678 0 : test_var = PyLong_AsUnsignedLongLong(value);
13679 0 : if (PyErr_Occurred() != NULL) {
13680 0 : return -1;
13681 : }
13682 0 : if (test_var > uint_max) {
13683 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13684 : PyLong_Type.tp_name, uint_max, test_var);
13685 0 : return -1;
13686 : }
13687 0 : object->privilege_entries = test_var;
13688 : } else {
13689 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13690 : PyLong_Type.tp_name);
13691 0 : return -1;
13692 : }
13693 : }
13694 0 : return 0;
13695 : }
13696 :
13697 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_privilege_control(PyObject *obj, void *closure)
13698 : {
13699 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
13700 : PyObject *py_privilege_control;
13701 0 : py_privilege_control = PyLong_FromUnsignedLongLong((uint32_t)object->privilege_control);
13702 0 : return py_privilege_control;
13703 : }
13704 :
13705 0 : static int py_netr_DELTA_ACCOUNT_set_privilege_control(PyObject *py_obj, PyObject *value, void *closure)
13706 : {
13707 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
13708 0 : if (value == NULL) {
13709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_control");
13710 0 : return -1;
13711 : }
13712 : {
13713 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_control));
13714 0 : if (PyLong_Check(value)) {
13715 : unsigned long long test_var;
13716 0 : test_var = PyLong_AsUnsignedLongLong(value);
13717 0 : if (PyErr_Occurred() != NULL) {
13718 0 : return -1;
13719 : }
13720 0 : if (test_var > uint_max) {
13721 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13722 : PyLong_Type.tp_name, uint_max, test_var);
13723 0 : return -1;
13724 : }
13725 0 : object->privilege_control = test_var;
13726 : } else {
13727 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13728 : PyLong_Type.tp_name);
13729 0 : return -1;
13730 : }
13731 : }
13732 0 : return 0;
13733 : }
13734 :
13735 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_privilege_attrib(PyObject *obj, void *closure)
13736 : {
13737 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
13738 : PyObject *py_privilege_attrib;
13739 0 : if (object->privilege_attrib == NULL) {
13740 0 : Py_RETURN_NONE;
13741 : }
13742 0 : if (object->privilege_attrib == NULL) {
13743 0 : py_privilege_attrib = Py_None;
13744 0 : Py_INCREF(py_privilege_attrib);
13745 : } else {
13746 0 : py_privilege_attrib = PyList_New(object->privilege_entries);
13747 0 : if (py_privilege_attrib == NULL) {
13748 0 : return NULL;
13749 : }
13750 : {
13751 : int privilege_attrib_cntr_1;
13752 0 : for (privilege_attrib_cntr_1 = 0; privilege_attrib_cntr_1 < (object->privilege_entries); privilege_attrib_cntr_1++) {
13753 : PyObject *py_privilege_attrib_1;
13754 0 : py_privilege_attrib_1 = PyLong_FromUnsignedLongLong((uint32_t)object->privilege_attrib[privilege_attrib_cntr_1]);
13755 0 : PyList_SetItem(py_privilege_attrib, privilege_attrib_cntr_1, py_privilege_attrib_1);
13756 : }
13757 : }
13758 : }
13759 0 : return py_privilege_attrib;
13760 : }
13761 :
13762 0 : static int py_netr_DELTA_ACCOUNT_set_privilege_attrib(PyObject *py_obj, PyObject *value, void *closure)
13763 : {
13764 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
13765 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->privilege_attrib));
13766 0 : if (value == NULL) {
13767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_attrib");
13768 0 : return -1;
13769 : }
13770 0 : if (value == Py_None) {
13771 0 : object->privilege_attrib = NULL;
13772 : } else {
13773 0 : object->privilege_attrib = NULL;
13774 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
13775 : {
13776 : int privilege_attrib_cntr_1;
13777 0 : object->privilege_attrib = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->privilege_attrib, PyList_GET_SIZE(value));
13778 0 : if (!object->privilege_attrib) { return -1;; }
13779 0 : talloc_set_name_const(object->privilege_attrib, "ARRAY: object->privilege_attrib");
13780 0 : for (privilege_attrib_cntr_1 = 0; privilege_attrib_cntr_1 < PyList_GET_SIZE(value); privilege_attrib_cntr_1++) {
13781 0 : if (PyList_GET_ITEM(value, privilege_attrib_cntr_1) == NULL) {
13782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_attrib[privilege_attrib_cntr_1]");
13783 0 : return -1;
13784 : }
13785 : {
13786 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->privilege_attrib[privilege_attrib_cntr_1]));
13787 0 : if (PyLong_Check(PyList_GET_ITEM(value, privilege_attrib_cntr_1))) {
13788 : unsigned long long test_var;
13789 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, privilege_attrib_cntr_1));
13790 0 : if (PyErr_Occurred() != NULL) {
13791 0 : return -1;
13792 : }
13793 0 : if (test_var > uint_max) {
13794 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13795 : PyLong_Type.tp_name, uint_max, test_var);
13796 0 : return -1;
13797 : }
13798 0 : object->privilege_attrib[privilege_attrib_cntr_1] = test_var;
13799 : } else {
13800 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13801 : PyLong_Type.tp_name);
13802 0 : return -1;
13803 : }
13804 : }
13805 : }
13806 : }
13807 : }
13808 0 : return 0;
13809 : }
13810 :
13811 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_privilege_name(PyObject *obj, void *closure)
13812 : {
13813 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
13814 : PyObject *py_privilege_name;
13815 0 : if (object->privilege_name == NULL) {
13816 0 : Py_RETURN_NONE;
13817 : }
13818 0 : if (object->privilege_name == NULL) {
13819 0 : py_privilege_name = Py_None;
13820 0 : Py_INCREF(py_privilege_name);
13821 : } else {
13822 0 : py_privilege_name = PyList_New(object->privilege_entries);
13823 0 : if (py_privilege_name == NULL) {
13824 0 : return NULL;
13825 : }
13826 : {
13827 : int privilege_name_cntr_1;
13828 0 : for (privilege_name_cntr_1 = 0; privilege_name_cntr_1 < (object->privilege_entries); privilege_name_cntr_1++) {
13829 : PyObject *py_privilege_name_1;
13830 0 : py_privilege_name_1 = pytalloc_reference_ex(lsa_String_Type, object->privilege_name, &object->privilege_name[privilege_name_cntr_1]);
13831 0 : PyList_SetItem(py_privilege_name, privilege_name_cntr_1, py_privilege_name_1);
13832 : }
13833 : }
13834 : }
13835 0 : return py_privilege_name;
13836 : }
13837 :
13838 0 : static int py_netr_DELTA_ACCOUNT_set_privilege_name(PyObject *py_obj, PyObject *value, void *closure)
13839 : {
13840 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
13841 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->privilege_name));
13842 0 : if (value == NULL) {
13843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_name");
13844 0 : return -1;
13845 : }
13846 0 : if (value == Py_None) {
13847 0 : object->privilege_name = NULL;
13848 : } else {
13849 0 : object->privilege_name = NULL;
13850 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
13851 : {
13852 : int privilege_name_cntr_1;
13853 0 : object->privilege_name = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->privilege_name, PyList_GET_SIZE(value));
13854 0 : if (!object->privilege_name) { return -1;; }
13855 0 : talloc_set_name_const(object->privilege_name, "ARRAY: object->privilege_name");
13856 0 : for (privilege_name_cntr_1 = 0; privilege_name_cntr_1 < PyList_GET_SIZE(value); privilege_name_cntr_1++) {
13857 0 : if (PyList_GET_ITEM(value, privilege_name_cntr_1) == NULL) {
13858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privilege_name[privilege_name_cntr_1]");
13859 0 : return -1;
13860 : }
13861 0 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, privilege_name_cntr_1), return -1;);
13862 0 : if (talloc_reference(object->privilege_name, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, privilege_name_cntr_1))) == NULL) {
13863 0 : PyErr_NoMemory();
13864 0 : return -1;
13865 : }
13866 0 : object->privilege_name[privilege_name_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, privilege_name_cntr_1));
13867 : }
13868 : }
13869 : }
13870 0 : return 0;
13871 : }
13872 :
13873 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_quotalimits(PyObject *obj, void *closure)
13874 : {
13875 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
13876 : PyObject *py_quotalimits;
13877 0 : py_quotalimits = pytalloc_reference_ex(&netr_QUOTA_LIMITS_Type, pytalloc_get_mem_ctx(obj), &object->quotalimits);
13878 0 : return py_quotalimits;
13879 : }
13880 :
13881 0 : static int py_netr_DELTA_ACCOUNT_set_quotalimits(PyObject *py_obj, PyObject *value, void *closure)
13882 : {
13883 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
13884 0 : if (value == NULL) {
13885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->quotalimits");
13886 0 : return -1;
13887 : }
13888 0 : PY_CHECK_TYPE(&netr_QUOTA_LIMITS_Type, value, return -1;);
13889 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13890 0 : PyErr_NoMemory();
13891 0 : return -1;
13892 : }
13893 0 : object->quotalimits = *(struct netr_QUOTA_LIMITS *)pytalloc_get_ptr(value);
13894 0 : return 0;
13895 : }
13896 :
13897 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_system_flags(PyObject *obj, void *closure)
13898 : {
13899 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
13900 : PyObject *py_system_flags;
13901 0 : py_system_flags = PyLong_FromUnsignedLongLong((uint32_t)object->system_flags);
13902 0 : return py_system_flags;
13903 : }
13904 :
13905 0 : static int py_netr_DELTA_ACCOUNT_set_system_flags(PyObject *py_obj, PyObject *value, void *closure)
13906 : {
13907 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
13908 0 : if (value == NULL) {
13909 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->system_flags");
13910 0 : return -1;
13911 : }
13912 : {
13913 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->system_flags));
13914 0 : if (PyLong_Check(value)) {
13915 : unsigned long long test_var;
13916 0 : test_var = PyLong_AsUnsignedLongLong(value);
13917 0 : if (PyErr_Occurred() != NULL) {
13918 0 : return -1;
13919 : }
13920 0 : if (test_var > uint_max) {
13921 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13922 : PyLong_Type.tp_name, uint_max, test_var);
13923 0 : return -1;
13924 : }
13925 0 : object->system_flags = test_var;
13926 : } else {
13927 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13928 : PyLong_Type.tp_name);
13929 0 : return -1;
13930 : }
13931 : }
13932 0 : return 0;
13933 : }
13934 :
13935 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_SecurityInformation(PyObject *obj, void *closure)
13936 : {
13937 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
13938 : PyObject *py_SecurityInformation;
13939 0 : py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation);
13940 0 : return py_SecurityInformation;
13941 : }
13942 :
13943 0 : static int py_netr_DELTA_ACCOUNT_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure)
13944 : {
13945 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
13946 0 : if (value == NULL) {
13947 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation");
13948 0 : return -1;
13949 : }
13950 : {
13951 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation));
13952 0 : if (PyLong_Check(value)) {
13953 : unsigned long long test_var;
13954 0 : test_var = PyLong_AsUnsignedLongLong(value);
13955 0 : if (PyErr_Occurred() != NULL) {
13956 0 : return -1;
13957 : }
13958 0 : if (test_var > uint_max) {
13959 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13960 : PyLong_Type.tp_name, uint_max, test_var);
13961 0 : return -1;
13962 : }
13963 0 : object->SecurityInformation = test_var;
13964 : } else {
13965 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13966 : PyLong_Type.tp_name);
13967 0 : return -1;
13968 : }
13969 : }
13970 0 : return 0;
13971 : }
13972 :
13973 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_sdbuf(PyObject *obj, void *closure)
13974 : {
13975 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
13976 : PyObject *py_sdbuf;
13977 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf);
13978 0 : return py_sdbuf;
13979 : }
13980 :
13981 0 : static int py_netr_DELTA_ACCOUNT_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
13982 : {
13983 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
13984 0 : if (value == NULL) {
13985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf");
13986 0 : return -1;
13987 : }
13988 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
13989 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13990 0 : PyErr_NoMemory();
13991 0 : return -1;
13992 : }
13993 0 : object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
13994 0 : return 0;
13995 : }
13996 :
13997 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_unknown1(PyObject *obj, void *closure)
13998 : {
13999 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
14000 : PyObject *py_unknown1;
14001 0 : py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1);
14002 0 : return py_unknown1;
14003 : }
14004 :
14005 0 : static int py_netr_DELTA_ACCOUNT_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
14006 : {
14007 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
14008 0 : if (value == NULL) {
14009 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
14010 0 : return -1;
14011 : }
14012 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
14013 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14014 0 : PyErr_NoMemory();
14015 0 : return -1;
14016 : }
14017 0 : object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value);
14018 0 : return 0;
14019 : }
14020 :
14021 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_unknown2(PyObject *obj, void *closure)
14022 : {
14023 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
14024 : PyObject *py_unknown2;
14025 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
14026 0 : return py_unknown2;
14027 : }
14028 :
14029 0 : static int py_netr_DELTA_ACCOUNT_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
14030 : {
14031 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
14032 0 : if (value == NULL) {
14033 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
14034 0 : return -1;
14035 : }
14036 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
14037 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14038 0 : PyErr_NoMemory();
14039 0 : return -1;
14040 : }
14041 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
14042 0 : return 0;
14043 : }
14044 :
14045 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_unknown3(PyObject *obj, void *closure)
14046 : {
14047 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
14048 : PyObject *py_unknown3;
14049 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
14050 0 : return py_unknown3;
14051 : }
14052 :
14053 0 : static int py_netr_DELTA_ACCOUNT_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
14054 : {
14055 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
14056 0 : if (value == NULL) {
14057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
14058 0 : return -1;
14059 : }
14060 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
14061 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14062 0 : PyErr_NoMemory();
14063 0 : return -1;
14064 : }
14065 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
14066 0 : return 0;
14067 : }
14068 :
14069 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_unknown4(PyObject *obj, void *closure)
14070 : {
14071 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
14072 : PyObject *py_unknown4;
14073 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
14074 0 : return py_unknown4;
14075 : }
14076 :
14077 0 : static int py_netr_DELTA_ACCOUNT_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
14078 : {
14079 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
14080 0 : if (value == NULL) {
14081 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
14082 0 : return -1;
14083 : }
14084 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
14085 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14086 0 : PyErr_NoMemory();
14087 0 : return -1;
14088 : }
14089 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
14090 0 : return 0;
14091 : }
14092 :
14093 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_unknown5(PyObject *obj, void *closure)
14094 : {
14095 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
14096 : PyObject *py_unknown5;
14097 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
14098 0 : return py_unknown5;
14099 : }
14100 :
14101 0 : static int py_netr_DELTA_ACCOUNT_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
14102 : {
14103 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
14104 0 : if (value == NULL) {
14105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
14106 0 : return -1;
14107 : }
14108 : {
14109 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
14110 0 : if (PyLong_Check(value)) {
14111 : unsigned long long test_var;
14112 0 : test_var = PyLong_AsUnsignedLongLong(value);
14113 0 : if (PyErr_Occurred() != NULL) {
14114 0 : return -1;
14115 : }
14116 0 : if (test_var > uint_max) {
14117 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14118 : PyLong_Type.tp_name, uint_max, test_var);
14119 0 : return -1;
14120 : }
14121 0 : object->unknown5 = test_var;
14122 : } else {
14123 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14124 : PyLong_Type.tp_name);
14125 0 : return -1;
14126 : }
14127 : }
14128 0 : return 0;
14129 : }
14130 :
14131 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_unknown6(PyObject *obj, void *closure)
14132 : {
14133 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
14134 : PyObject *py_unknown6;
14135 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
14136 0 : return py_unknown6;
14137 : }
14138 :
14139 0 : static int py_netr_DELTA_ACCOUNT_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
14140 : {
14141 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
14142 0 : if (value == NULL) {
14143 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
14144 0 : return -1;
14145 : }
14146 : {
14147 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
14148 0 : if (PyLong_Check(value)) {
14149 : unsigned long long test_var;
14150 0 : test_var = PyLong_AsUnsignedLongLong(value);
14151 0 : if (PyErr_Occurred() != NULL) {
14152 0 : return -1;
14153 : }
14154 0 : if (test_var > uint_max) {
14155 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14156 : PyLong_Type.tp_name, uint_max, test_var);
14157 0 : return -1;
14158 : }
14159 0 : object->unknown6 = test_var;
14160 : } else {
14161 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14162 : PyLong_Type.tp_name);
14163 0 : return -1;
14164 : }
14165 : }
14166 0 : return 0;
14167 : }
14168 :
14169 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_unknown7(PyObject *obj, void *closure)
14170 : {
14171 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
14172 : PyObject *py_unknown7;
14173 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
14174 0 : return py_unknown7;
14175 : }
14176 :
14177 0 : static int py_netr_DELTA_ACCOUNT_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
14178 : {
14179 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
14180 0 : if (value == NULL) {
14181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
14182 0 : return -1;
14183 : }
14184 : {
14185 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
14186 0 : if (PyLong_Check(value)) {
14187 : unsigned long long test_var;
14188 0 : test_var = PyLong_AsUnsignedLongLong(value);
14189 0 : if (PyErr_Occurred() != NULL) {
14190 0 : return -1;
14191 : }
14192 0 : if (test_var > uint_max) {
14193 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14194 : PyLong_Type.tp_name, uint_max, test_var);
14195 0 : return -1;
14196 : }
14197 0 : object->unknown7 = test_var;
14198 : } else {
14199 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14200 : PyLong_Type.tp_name);
14201 0 : return -1;
14202 : }
14203 : }
14204 0 : return 0;
14205 : }
14206 :
14207 0 : static PyObject *py_netr_DELTA_ACCOUNT_get_unknown8(PyObject *obj, void *closure)
14208 : {
14209 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(obj);
14210 : PyObject *py_unknown8;
14211 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
14212 0 : return py_unknown8;
14213 : }
14214 :
14215 0 : static int py_netr_DELTA_ACCOUNT_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
14216 : {
14217 0 : struct netr_DELTA_ACCOUNT *object = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(py_obj);
14218 0 : if (value == NULL) {
14219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
14220 0 : return -1;
14221 : }
14222 : {
14223 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
14224 0 : if (PyLong_Check(value)) {
14225 : unsigned long long test_var;
14226 0 : test_var = PyLong_AsUnsignedLongLong(value);
14227 0 : if (PyErr_Occurred() != NULL) {
14228 0 : return -1;
14229 : }
14230 0 : if (test_var > uint_max) {
14231 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14232 : PyLong_Type.tp_name, uint_max, test_var);
14233 0 : return -1;
14234 : }
14235 0 : object->unknown8 = test_var;
14236 : } else {
14237 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14238 : PyLong_Type.tp_name);
14239 0 : return -1;
14240 : }
14241 : }
14242 0 : return 0;
14243 : }
14244 :
14245 : static PyGetSetDef py_netr_DELTA_ACCOUNT_getsetters[] = {
14246 : {
14247 : .name = discard_const_p(char, "privilege_entries"),
14248 : .get = py_netr_DELTA_ACCOUNT_get_privilege_entries,
14249 : .set = py_netr_DELTA_ACCOUNT_set_privilege_entries,
14250 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14251 : },
14252 : {
14253 : .name = discard_const_p(char, "privilege_control"),
14254 : .get = py_netr_DELTA_ACCOUNT_get_privilege_control,
14255 : .set = py_netr_DELTA_ACCOUNT_set_privilege_control,
14256 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14257 : },
14258 : {
14259 : .name = discard_const_p(char, "privilege_attrib"),
14260 : .get = py_netr_DELTA_ACCOUNT_get_privilege_attrib,
14261 : .set = py_netr_DELTA_ACCOUNT_set_privilege_attrib,
14262 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14263 : },
14264 : {
14265 : .name = discard_const_p(char, "privilege_name"),
14266 : .get = py_netr_DELTA_ACCOUNT_get_privilege_name,
14267 : .set = py_netr_DELTA_ACCOUNT_set_privilege_name,
14268 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
14269 : },
14270 : {
14271 : .name = discard_const_p(char, "quotalimits"),
14272 : .get = py_netr_DELTA_ACCOUNT_get_quotalimits,
14273 : .set = py_netr_DELTA_ACCOUNT_set_quotalimits,
14274 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_QUOTA_LIMITS")
14275 : },
14276 : {
14277 : .name = discard_const_p(char, "system_flags"),
14278 : .get = py_netr_DELTA_ACCOUNT_get_system_flags,
14279 : .set = py_netr_DELTA_ACCOUNT_set_system_flags,
14280 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14281 : },
14282 : {
14283 : .name = discard_const_p(char, "SecurityInformation"),
14284 : .get = py_netr_DELTA_ACCOUNT_get_SecurityInformation,
14285 : .set = py_netr_DELTA_ACCOUNT_set_SecurityInformation,
14286 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14287 : },
14288 : {
14289 : .name = discard_const_p(char, "sdbuf"),
14290 : .get = py_netr_DELTA_ACCOUNT_get_sdbuf,
14291 : .set = py_netr_DELTA_ACCOUNT_set_sdbuf,
14292 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
14293 : },
14294 : {
14295 : .name = discard_const_p(char, "unknown1"),
14296 : .get = py_netr_DELTA_ACCOUNT_get_unknown1,
14297 : .set = py_netr_DELTA_ACCOUNT_set_unknown1,
14298 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
14299 : },
14300 : {
14301 : .name = discard_const_p(char, "unknown2"),
14302 : .get = py_netr_DELTA_ACCOUNT_get_unknown2,
14303 : .set = py_netr_DELTA_ACCOUNT_set_unknown2,
14304 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
14305 : },
14306 : {
14307 : .name = discard_const_p(char, "unknown3"),
14308 : .get = py_netr_DELTA_ACCOUNT_get_unknown3,
14309 : .set = py_netr_DELTA_ACCOUNT_set_unknown3,
14310 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
14311 : },
14312 : {
14313 : .name = discard_const_p(char, "unknown4"),
14314 : .get = py_netr_DELTA_ACCOUNT_get_unknown4,
14315 : .set = py_netr_DELTA_ACCOUNT_set_unknown4,
14316 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
14317 : },
14318 : {
14319 : .name = discard_const_p(char, "unknown5"),
14320 : .get = py_netr_DELTA_ACCOUNT_get_unknown5,
14321 : .set = py_netr_DELTA_ACCOUNT_set_unknown5,
14322 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14323 : },
14324 : {
14325 : .name = discard_const_p(char, "unknown6"),
14326 : .get = py_netr_DELTA_ACCOUNT_get_unknown6,
14327 : .set = py_netr_DELTA_ACCOUNT_set_unknown6,
14328 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14329 : },
14330 : {
14331 : .name = discard_const_p(char, "unknown7"),
14332 : .get = py_netr_DELTA_ACCOUNT_get_unknown7,
14333 : .set = py_netr_DELTA_ACCOUNT_set_unknown7,
14334 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14335 : },
14336 : {
14337 : .name = discard_const_p(char, "unknown8"),
14338 : .get = py_netr_DELTA_ACCOUNT_get_unknown8,
14339 : .set = py_netr_DELTA_ACCOUNT_set_unknown8,
14340 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14341 : },
14342 : { .name = NULL }
14343 : };
14344 :
14345 0 : static PyObject *py_netr_DELTA_ACCOUNT_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14346 : {
14347 0 : return pytalloc_new(struct netr_DELTA_ACCOUNT, type);
14348 : }
14349 :
14350 :
14351 : static PyTypeObject netr_DELTA_ACCOUNT_Type = {
14352 : PyVarObject_HEAD_INIT(NULL, 0)
14353 : .tp_name = "netlogon.netr_DELTA_ACCOUNT",
14354 : .tp_getset = py_netr_DELTA_ACCOUNT_getsetters,
14355 : .tp_methods = NULL,
14356 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14357 : .tp_new = py_netr_DELTA_ACCOUNT_new,
14358 : };
14359 :
14360 :
14361 0 : static PyObject *py_netr_CIPHER_VALUE_get_len(PyObject *obj, void *closure)
14362 : {
14363 0 : struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(obj);
14364 : PyObject *py_len;
14365 0 : py_len = PyLong_FromUnsignedLongLong((uint32_t)object->len);
14366 0 : return py_len;
14367 : }
14368 :
14369 0 : static int py_netr_CIPHER_VALUE_set_len(PyObject *py_obj, PyObject *value, void *closure)
14370 : {
14371 0 : struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(py_obj);
14372 0 : if (value == NULL) {
14373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->len");
14374 0 : return -1;
14375 : }
14376 : {
14377 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
14378 0 : if (PyLong_Check(value)) {
14379 : unsigned long long test_var;
14380 0 : test_var = PyLong_AsUnsignedLongLong(value);
14381 0 : if (PyErr_Occurred() != NULL) {
14382 0 : return -1;
14383 : }
14384 0 : if (test_var > uint_max) {
14385 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14386 : PyLong_Type.tp_name, uint_max, test_var);
14387 0 : return -1;
14388 : }
14389 0 : object->len = test_var;
14390 : } else {
14391 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14392 : PyLong_Type.tp_name);
14393 0 : return -1;
14394 : }
14395 : }
14396 0 : return 0;
14397 : }
14398 :
14399 0 : static PyObject *py_netr_CIPHER_VALUE_get_maxlen(PyObject *obj, void *closure)
14400 : {
14401 0 : struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(obj);
14402 : PyObject *py_maxlen;
14403 0 : py_maxlen = PyLong_FromUnsignedLongLong((uint32_t)object->maxlen);
14404 0 : return py_maxlen;
14405 : }
14406 :
14407 0 : static int py_netr_CIPHER_VALUE_set_maxlen(PyObject *py_obj, PyObject *value, void *closure)
14408 : {
14409 0 : struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(py_obj);
14410 0 : if (value == NULL) {
14411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maxlen");
14412 0 : return -1;
14413 : }
14414 : {
14415 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maxlen));
14416 0 : if (PyLong_Check(value)) {
14417 : unsigned long long test_var;
14418 0 : test_var = PyLong_AsUnsignedLongLong(value);
14419 0 : if (PyErr_Occurred() != NULL) {
14420 0 : return -1;
14421 : }
14422 0 : if (test_var > uint_max) {
14423 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14424 : PyLong_Type.tp_name, uint_max, test_var);
14425 0 : return -1;
14426 : }
14427 0 : object->maxlen = test_var;
14428 : } else {
14429 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14430 : PyLong_Type.tp_name);
14431 0 : return -1;
14432 : }
14433 : }
14434 0 : return 0;
14435 : }
14436 :
14437 0 : static PyObject *py_netr_CIPHER_VALUE_get_cipher_data(PyObject *obj, void *closure)
14438 : {
14439 0 : struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(obj);
14440 : PyObject *py_cipher_data;
14441 0 : if (object->cipher_data == NULL) {
14442 0 : Py_RETURN_NONE;
14443 : }
14444 0 : if (object->cipher_data == NULL) {
14445 0 : py_cipher_data = Py_None;
14446 0 : Py_INCREF(py_cipher_data);
14447 : } else {
14448 0 : py_cipher_data = PyList_New(object->len);
14449 0 : if (py_cipher_data == NULL) {
14450 0 : return NULL;
14451 : }
14452 : {
14453 : int cipher_data_cntr_1;
14454 0 : for (cipher_data_cntr_1 = 0; cipher_data_cntr_1 < (object->len); cipher_data_cntr_1++) {
14455 : PyObject *py_cipher_data_1;
14456 0 : py_cipher_data_1 = PyLong_FromLong((uint16_t)object->cipher_data[cipher_data_cntr_1]);
14457 0 : PyList_SetItem(py_cipher_data, cipher_data_cntr_1, py_cipher_data_1);
14458 : }
14459 : }
14460 : }
14461 0 : return py_cipher_data;
14462 : }
14463 :
14464 0 : static int py_netr_CIPHER_VALUE_set_cipher_data(PyObject *py_obj, PyObject *value, void *closure)
14465 : {
14466 0 : struct netr_CIPHER_VALUE *object = (struct netr_CIPHER_VALUE *)pytalloc_get_ptr(py_obj);
14467 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->cipher_data));
14468 0 : if (value == NULL) {
14469 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cipher_data");
14470 0 : return -1;
14471 : }
14472 0 : if (value == Py_None) {
14473 0 : object->cipher_data = NULL;
14474 : } else {
14475 0 : object->cipher_data = NULL;
14476 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
14477 : {
14478 : int cipher_data_cntr_1;
14479 0 : object->cipher_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->cipher_data, PyList_GET_SIZE(value));
14480 0 : if (!object->cipher_data) { return -1;; }
14481 0 : talloc_set_name_const(object->cipher_data, "ARRAY: object->cipher_data");
14482 0 : for (cipher_data_cntr_1 = 0; cipher_data_cntr_1 < PyList_GET_SIZE(value); cipher_data_cntr_1++) {
14483 0 : if (PyList_GET_ITEM(value, cipher_data_cntr_1) == NULL) {
14484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cipher_data[cipher_data_cntr_1]");
14485 0 : return -1;
14486 : }
14487 : {
14488 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cipher_data[cipher_data_cntr_1]));
14489 0 : if (PyLong_Check(PyList_GET_ITEM(value, cipher_data_cntr_1))) {
14490 : unsigned long long test_var;
14491 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, cipher_data_cntr_1));
14492 0 : if (PyErr_Occurred() != NULL) {
14493 0 : return -1;
14494 : }
14495 0 : if (test_var > uint_max) {
14496 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14497 : PyLong_Type.tp_name, uint_max, test_var);
14498 0 : return -1;
14499 : }
14500 0 : object->cipher_data[cipher_data_cntr_1] = test_var;
14501 : } else {
14502 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14503 : PyLong_Type.tp_name);
14504 0 : return -1;
14505 : }
14506 : }
14507 : }
14508 : }
14509 : }
14510 0 : return 0;
14511 : }
14512 :
14513 : static PyGetSetDef py_netr_CIPHER_VALUE_getsetters[] = {
14514 : {
14515 : .name = discard_const_p(char, "len"),
14516 : .get = py_netr_CIPHER_VALUE_get_len,
14517 : .set = py_netr_CIPHER_VALUE_set_len,
14518 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14519 : },
14520 : {
14521 : .name = discard_const_p(char, "maxlen"),
14522 : .get = py_netr_CIPHER_VALUE_get_maxlen,
14523 : .set = py_netr_CIPHER_VALUE_set_maxlen,
14524 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14525 : },
14526 : {
14527 : .name = discard_const_p(char, "cipher_data"),
14528 : .get = py_netr_CIPHER_VALUE_get_cipher_data,
14529 : .set = py_netr_CIPHER_VALUE_set_cipher_data,
14530 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14531 : },
14532 : { .name = NULL }
14533 : };
14534 :
14535 0 : static PyObject *py_netr_CIPHER_VALUE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14536 : {
14537 0 : return pytalloc_new(struct netr_CIPHER_VALUE, type);
14538 : }
14539 :
14540 :
14541 : static PyTypeObject netr_CIPHER_VALUE_Type = {
14542 : PyVarObject_HEAD_INIT(NULL, 0)
14543 : .tp_name = "netlogon.netr_CIPHER_VALUE",
14544 : .tp_getset = py_netr_CIPHER_VALUE_getsetters,
14545 : .tp_methods = NULL,
14546 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14547 : .tp_new = py_netr_CIPHER_VALUE_new,
14548 : };
14549 :
14550 :
14551 0 : static PyObject *py_netr_DELTA_SECRET_get_current_cipher(PyObject *obj, void *closure)
14552 : {
14553 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14554 : PyObject *py_current_cipher;
14555 0 : py_current_cipher = pytalloc_reference_ex(&netr_CIPHER_VALUE_Type, pytalloc_get_mem_ctx(obj), &object->current_cipher);
14556 0 : return py_current_cipher;
14557 : }
14558 :
14559 0 : static int py_netr_DELTA_SECRET_set_current_cipher(PyObject *py_obj, PyObject *value, void *closure)
14560 : {
14561 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14562 0 : if (value == NULL) {
14563 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current_cipher");
14564 0 : return -1;
14565 : }
14566 0 : PY_CHECK_TYPE(&netr_CIPHER_VALUE_Type, value, return -1;);
14567 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14568 0 : PyErr_NoMemory();
14569 0 : return -1;
14570 : }
14571 0 : object->current_cipher = *(struct netr_CIPHER_VALUE *)pytalloc_get_ptr(value);
14572 0 : return 0;
14573 : }
14574 :
14575 0 : static PyObject *py_netr_DELTA_SECRET_get_current_cipher_set_time(PyObject *obj, void *closure)
14576 : {
14577 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14578 : PyObject *py_current_cipher_set_time;
14579 0 : py_current_cipher_set_time = PyLong_FromUnsignedLongLong(object->current_cipher_set_time);
14580 0 : return py_current_cipher_set_time;
14581 : }
14582 :
14583 0 : static int py_netr_DELTA_SECRET_set_current_cipher_set_time(PyObject *py_obj, PyObject *value, void *closure)
14584 : {
14585 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14586 0 : if (value == NULL) {
14587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current_cipher_set_time");
14588 0 : return -1;
14589 : }
14590 : {
14591 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->current_cipher_set_time));
14592 0 : if (PyLong_Check(value)) {
14593 : unsigned long long test_var;
14594 0 : test_var = PyLong_AsUnsignedLongLong(value);
14595 0 : if (PyErr_Occurred() != NULL) {
14596 0 : return -1;
14597 : }
14598 0 : if (test_var > uint_max) {
14599 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14600 : PyLong_Type.tp_name, uint_max, test_var);
14601 0 : return -1;
14602 : }
14603 0 : object->current_cipher_set_time = test_var;
14604 : } else {
14605 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14606 : PyLong_Type.tp_name);
14607 0 : return -1;
14608 : }
14609 : }
14610 0 : return 0;
14611 : }
14612 :
14613 0 : static PyObject *py_netr_DELTA_SECRET_get_old_cipher(PyObject *obj, void *closure)
14614 : {
14615 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14616 : PyObject *py_old_cipher;
14617 0 : py_old_cipher = pytalloc_reference_ex(&netr_CIPHER_VALUE_Type, pytalloc_get_mem_ctx(obj), &object->old_cipher);
14618 0 : return py_old_cipher;
14619 : }
14620 :
14621 0 : static int py_netr_DELTA_SECRET_set_old_cipher(PyObject *py_obj, PyObject *value, void *closure)
14622 : {
14623 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14624 0 : if (value == NULL) {
14625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_cipher");
14626 0 : return -1;
14627 : }
14628 0 : PY_CHECK_TYPE(&netr_CIPHER_VALUE_Type, value, return -1;);
14629 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14630 0 : PyErr_NoMemory();
14631 0 : return -1;
14632 : }
14633 0 : object->old_cipher = *(struct netr_CIPHER_VALUE *)pytalloc_get_ptr(value);
14634 0 : return 0;
14635 : }
14636 :
14637 0 : static PyObject *py_netr_DELTA_SECRET_get_old_cipher_set_time(PyObject *obj, void *closure)
14638 : {
14639 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14640 : PyObject *py_old_cipher_set_time;
14641 0 : py_old_cipher_set_time = PyLong_FromUnsignedLongLong(object->old_cipher_set_time);
14642 0 : return py_old_cipher_set_time;
14643 : }
14644 :
14645 0 : static int py_netr_DELTA_SECRET_set_old_cipher_set_time(PyObject *py_obj, PyObject *value, void *closure)
14646 : {
14647 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14648 0 : if (value == NULL) {
14649 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_cipher_set_time");
14650 0 : return -1;
14651 : }
14652 : {
14653 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->old_cipher_set_time));
14654 0 : if (PyLong_Check(value)) {
14655 : unsigned long long test_var;
14656 0 : test_var = PyLong_AsUnsignedLongLong(value);
14657 0 : if (PyErr_Occurred() != NULL) {
14658 0 : return -1;
14659 : }
14660 0 : if (test_var > uint_max) {
14661 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14662 : PyLong_Type.tp_name, uint_max, test_var);
14663 0 : return -1;
14664 : }
14665 0 : object->old_cipher_set_time = test_var;
14666 : } else {
14667 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14668 : PyLong_Type.tp_name);
14669 0 : return -1;
14670 : }
14671 : }
14672 0 : return 0;
14673 : }
14674 :
14675 0 : static PyObject *py_netr_DELTA_SECRET_get_SecurityInformation(PyObject *obj, void *closure)
14676 : {
14677 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14678 : PyObject *py_SecurityInformation;
14679 0 : py_SecurityInformation = PyLong_FromUnsignedLongLong((uint32_t)object->SecurityInformation);
14680 0 : return py_SecurityInformation;
14681 : }
14682 :
14683 0 : static int py_netr_DELTA_SECRET_set_SecurityInformation(PyObject *py_obj, PyObject *value, void *closure)
14684 : {
14685 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14686 0 : if (value == NULL) {
14687 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SecurityInformation");
14688 0 : return -1;
14689 : }
14690 : {
14691 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SecurityInformation));
14692 0 : if (PyLong_Check(value)) {
14693 : unsigned long long test_var;
14694 0 : test_var = PyLong_AsUnsignedLongLong(value);
14695 0 : if (PyErr_Occurred() != NULL) {
14696 0 : return -1;
14697 : }
14698 0 : if (test_var > uint_max) {
14699 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14700 : PyLong_Type.tp_name, uint_max, test_var);
14701 0 : return -1;
14702 : }
14703 0 : object->SecurityInformation = test_var;
14704 : } else {
14705 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14706 : PyLong_Type.tp_name);
14707 0 : return -1;
14708 : }
14709 : }
14710 0 : return 0;
14711 : }
14712 :
14713 0 : static PyObject *py_netr_DELTA_SECRET_get_sdbuf(PyObject *obj, void *closure)
14714 : {
14715 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14716 : PyObject *py_sdbuf;
14717 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sdbuf);
14718 0 : return py_sdbuf;
14719 : }
14720 :
14721 0 : static int py_netr_DELTA_SECRET_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
14722 : {
14723 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14724 0 : if (value == NULL) {
14725 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sdbuf");
14726 0 : return -1;
14727 : }
14728 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
14729 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14730 0 : PyErr_NoMemory();
14731 0 : return -1;
14732 : }
14733 0 : object->sdbuf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
14734 0 : return 0;
14735 : }
14736 :
14737 0 : static PyObject *py_netr_DELTA_SECRET_get_unknown1(PyObject *obj, void *closure)
14738 : {
14739 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14740 : PyObject *py_unknown1;
14741 0 : py_unknown1 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown1);
14742 0 : return py_unknown1;
14743 : }
14744 :
14745 0 : static int py_netr_DELTA_SECRET_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
14746 : {
14747 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14748 0 : if (value == NULL) {
14749 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
14750 0 : return -1;
14751 : }
14752 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
14753 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14754 0 : PyErr_NoMemory();
14755 0 : return -1;
14756 : }
14757 0 : object->unknown1 = *(struct lsa_String *)pytalloc_get_ptr(value);
14758 0 : return 0;
14759 : }
14760 :
14761 0 : static PyObject *py_netr_DELTA_SECRET_get_unknown2(PyObject *obj, void *closure)
14762 : {
14763 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14764 : PyObject *py_unknown2;
14765 0 : py_unknown2 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown2);
14766 0 : return py_unknown2;
14767 : }
14768 :
14769 0 : static int py_netr_DELTA_SECRET_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
14770 : {
14771 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14772 0 : if (value == NULL) {
14773 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
14774 0 : return -1;
14775 : }
14776 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
14777 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14778 0 : PyErr_NoMemory();
14779 0 : return -1;
14780 : }
14781 0 : object->unknown2 = *(struct lsa_String *)pytalloc_get_ptr(value);
14782 0 : return 0;
14783 : }
14784 :
14785 0 : static PyObject *py_netr_DELTA_SECRET_get_unknown3(PyObject *obj, void *closure)
14786 : {
14787 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14788 : PyObject *py_unknown3;
14789 0 : py_unknown3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown3);
14790 0 : return py_unknown3;
14791 : }
14792 :
14793 0 : static int py_netr_DELTA_SECRET_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
14794 : {
14795 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14796 0 : if (value == NULL) {
14797 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
14798 0 : return -1;
14799 : }
14800 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
14801 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14802 0 : PyErr_NoMemory();
14803 0 : return -1;
14804 : }
14805 0 : object->unknown3 = *(struct lsa_String *)pytalloc_get_ptr(value);
14806 0 : return 0;
14807 : }
14808 :
14809 0 : static PyObject *py_netr_DELTA_SECRET_get_unknown4(PyObject *obj, void *closure)
14810 : {
14811 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14812 : PyObject *py_unknown4;
14813 0 : py_unknown4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->unknown4);
14814 0 : return py_unknown4;
14815 : }
14816 :
14817 0 : static int py_netr_DELTA_SECRET_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
14818 : {
14819 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14820 0 : if (value == NULL) {
14821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
14822 0 : return -1;
14823 : }
14824 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
14825 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14826 0 : PyErr_NoMemory();
14827 0 : return -1;
14828 : }
14829 0 : object->unknown4 = *(struct lsa_String *)pytalloc_get_ptr(value);
14830 0 : return 0;
14831 : }
14832 :
14833 0 : static PyObject *py_netr_DELTA_SECRET_get_unknown5(PyObject *obj, void *closure)
14834 : {
14835 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14836 : PyObject *py_unknown5;
14837 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
14838 0 : return py_unknown5;
14839 : }
14840 :
14841 0 : static int py_netr_DELTA_SECRET_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
14842 : {
14843 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14844 0 : if (value == NULL) {
14845 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
14846 0 : return -1;
14847 : }
14848 : {
14849 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
14850 0 : if (PyLong_Check(value)) {
14851 : unsigned long long test_var;
14852 0 : test_var = PyLong_AsUnsignedLongLong(value);
14853 0 : if (PyErr_Occurred() != NULL) {
14854 0 : return -1;
14855 : }
14856 0 : if (test_var > uint_max) {
14857 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14858 : PyLong_Type.tp_name, uint_max, test_var);
14859 0 : return -1;
14860 : }
14861 0 : object->unknown5 = test_var;
14862 : } else {
14863 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14864 : PyLong_Type.tp_name);
14865 0 : return -1;
14866 : }
14867 : }
14868 0 : return 0;
14869 : }
14870 :
14871 0 : static PyObject *py_netr_DELTA_SECRET_get_unknown6(PyObject *obj, void *closure)
14872 : {
14873 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14874 : PyObject *py_unknown6;
14875 0 : py_unknown6 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown6);
14876 0 : return py_unknown6;
14877 : }
14878 :
14879 0 : static int py_netr_DELTA_SECRET_set_unknown6(PyObject *py_obj, PyObject *value, void *closure)
14880 : {
14881 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14882 0 : if (value == NULL) {
14883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown6");
14884 0 : return -1;
14885 : }
14886 : {
14887 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown6));
14888 0 : if (PyLong_Check(value)) {
14889 : unsigned long long test_var;
14890 0 : test_var = PyLong_AsUnsignedLongLong(value);
14891 0 : if (PyErr_Occurred() != NULL) {
14892 0 : return -1;
14893 : }
14894 0 : if (test_var > uint_max) {
14895 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14896 : PyLong_Type.tp_name, uint_max, test_var);
14897 0 : return -1;
14898 : }
14899 0 : object->unknown6 = test_var;
14900 : } else {
14901 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14902 : PyLong_Type.tp_name);
14903 0 : return -1;
14904 : }
14905 : }
14906 0 : return 0;
14907 : }
14908 :
14909 0 : static PyObject *py_netr_DELTA_SECRET_get_unknown7(PyObject *obj, void *closure)
14910 : {
14911 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14912 : PyObject *py_unknown7;
14913 0 : py_unknown7 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown7);
14914 0 : return py_unknown7;
14915 : }
14916 :
14917 0 : static int py_netr_DELTA_SECRET_set_unknown7(PyObject *py_obj, PyObject *value, void *closure)
14918 : {
14919 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14920 0 : if (value == NULL) {
14921 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown7");
14922 0 : return -1;
14923 : }
14924 : {
14925 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown7));
14926 0 : if (PyLong_Check(value)) {
14927 : unsigned long long test_var;
14928 0 : test_var = PyLong_AsUnsignedLongLong(value);
14929 0 : if (PyErr_Occurred() != NULL) {
14930 0 : return -1;
14931 : }
14932 0 : if (test_var > uint_max) {
14933 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14934 : PyLong_Type.tp_name, uint_max, test_var);
14935 0 : return -1;
14936 : }
14937 0 : object->unknown7 = test_var;
14938 : } else {
14939 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14940 : PyLong_Type.tp_name);
14941 0 : return -1;
14942 : }
14943 : }
14944 0 : return 0;
14945 : }
14946 :
14947 0 : static PyObject *py_netr_DELTA_SECRET_get_unknown8(PyObject *obj, void *closure)
14948 : {
14949 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(obj);
14950 : PyObject *py_unknown8;
14951 0 : py_unknown8 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown8);
14952 0 : return py_unknown8;
14953 : }
14954 :
14955 0 : static int py_netr_DELTA_SECRET_set_unknown8(PyObject *py_obj, PyObject *value, void *closure)
14956 : {
14957 0 : struct netr_DELTA_SECRET *object = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(py_obj);
14958 0 : if (value == NULL) {
14959 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown8");
14960 0 : return -1;
14961 : }
14962 : {
14963 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown8));
14964 0 : if (PyLong_Check(value)) {
14965 : unsigned long long test_var;
14966 0 : test_var = PyLong_AsUnsignedLongLong(value);
14967 0 : if (PyErr_Occurred() != NULL) {
14968 0 : return -1;
14969 : }
14970 0 : if (test_var > uint_max) {
14971 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14972 : PyLong_Type.tp_name, uint_max, test_var);
14973 0 : return -1;
14974 : }
14975 0 : object->unknown8 = test_var;
14976 : } else {
14977 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14978 : PyLong_Type.tp_name);
14979 0 : return -1;
14980 : }
14981 : }
14982 0 : return 0;
14983 : }
14984 :
14985 : static PyGetSetDef py_netr_DELTA_SECRET_getsetters[] = {
14986 : {
14987 : .name = discard_const_p(char, "current_cipher"),
14988 : .get = py_netr_DELTA_SECRET_get_current_cipher,
14989 : .set = py_netr_DELTA_SECRET_set_current_cipher,
14990 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CIPHER_VALUE")
14991 : },
14992 : {
14993 : .name = discard_const_p(char, "current_cipher_set_time"),
14994 : .get = py_netr_DELTA_SECRET_get_current_cipher_set_time,
14995 : .set = py_netr_DELTA_SECRET_set_current_cipher_set_time,
14996 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
14997 : },
14998 : {
14999 : .name = discard_const_p(char, "old_cipher"),
15000 : .get = py_netr_DELTA_SECRET_get_old_cipher,
15001 : .set = py_netr_DELTA_SECRET_set_old_cipher,
15002 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CIPHER_VALUE")
15003 : },
15004 : {
15005 : .name = discard_const_p(char, "old_cipher_set_time"),
15006 : .get = py_netr_DELTA_SECRET_get_old_cipher_set_time,
15007 : .set = py_netr_DELTA_SECRET_set_old_cipher_set_time,
15008 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
15009 : },
15010 : {
15011 : .name = discard_const_p(char, "SecurityInformation"),
15012 : .get = py_netr_DELTA_SECRET_get_SecurityInformation,
15013 : .set = py_netr_DELTA_SECRET_set_SecurityInformation,
15014 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15015 : },
15016 : {
15017 : .name = discard_const_p(char, "sdbuf"),
15018 : .get = py_netr_DELTA_SECRET_get_sdbuf,
15019 : .set = py_netr_DELTA_SECRET_set_sdbuf,
15020 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
15021 : },
15022 : {
15023 : .name = discard_const_p(char, "unknown1"),
15024 : .get = py_netr_DELTA_SECRET_get_unknown1,
15025 : .set = py_netr_DELTA_SECRET_set_unknown1,
15026 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
15027 : },
15028 : {
15029 : .name = discard_const_p(char, "unknown2"),
15030 : .get = py_netr_DELTA_SECRET_get_unknown2,
15031 : .set = py_netr_DELTA_SECRET_set_unknown2,
15032 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
15033 : },
15034 : {
15035 : .name = discard_const_p(char, "unknown3"),
15036 : .get = py_netr_DELTA_SECRET_get_unknown3,
15037 : .set = py_netr_DELTA_SECRET_set_unknown3,
15038 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
15039 : },
15040 : {
15041 : .name = discard_const_p(char, "unknown4"),
15042 : .get = py_netr_DELTA_SECRET_get_unknown4,
15043 : .set = py_netr_DELTA_SECRET_set_unknown4,
15044 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
15045 : },
15046 : {
15047 : .name = discard_const_p(char, "unknown5"),
15048 : .get = py_netr_DELTA_SECRET_get_unknown5,
15049 : .set = py_netr_DELTA_SECRET_set_unknown5,
15050 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15051 : },
15052 : {
15053 : .name = discard_const_p(char, "unknown6"),
15054 : .get = py_netr_DELTA_SECRET_get_unknown6,
15055 : .set = py_netr_DELTA_SECRET_set_unknown6,
15056 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15057 : },
15058 : {
15059 : .name = discard_const_p(char, "unknown7"),
15060 : .get = py_netr_DELTA_SECRET_get_unknown7,
15061 : .set = py_netr_DELTA_SECRET_set_unknown7,
15062 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15063 : },
15064 : {
15065 : .name = discard_const_p(char, "unknown8"),
15066 : .get = py_netr_DELTA_SECRET_get_unknown8,
15067 : .set = py_netr_DELTA_SECRET_set_unknown8,
15068 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15069 : },
15070 : { .name = NULL }
15071 : };
15072 :
15073 0 : static PyObject *py_netr_DELTA_SECRET_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15074 : {
15075 0 : return pytalloc_new(struct netr_DELTA_SECRET, type);
15076 : }
15077 :
15078 :
15079 : static PyTypeObject netr_DELTA_SECRET_Type = {
15080 : PyVarObject_HEAD_INIT(NULL, 0)
15081 : .tp_name = "netlogon.netr_DELTA_SECRET",
15082 : .tp_getset = py_netr_DELTA_SECRET_getsetters,
15083 : .tp_methods = NULL,
15084 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15085 : .tp_new = py_netr_DELTA_SECRET_new,
15086 : };
15087 :
15088 0 : static PyObject *py_import_netr_DELTA_UNION(TALLOC_CTX *mem_ctx, int level, union netr_DELTA_UNION *in)
15089 : {
15090 : PyObject *ret;
15091 :
15092 0 : switch (level) {
15093 0 : case NETR_DELTA_DOMAIN:
15094 0 : if (in->domain == NULL) {
15095 0 : ret = Py_None;
15096 0 : Py_INCREF(ret);
15097 : } else {
15098 0 : ret = pytalloc_reference_ex(&netr_DELTA_DOMAIN_Type, in->domain, in->domain);
15099 : }
15100 0 : return ret;
15101 :
15102 0 : case NETR_DELTA_GROUP:
15103 0 : if (in->group == NULL) {
15104 0 : ret = Py_None;
15105 0 : Py_INCREF(ret);
15106 : } else {
15107 0 : ret = pytalloc_reference_ex(&netr_DELTA_GROUP_Type, in->group, in->group);
15108 : }
15109 0 : return ret;
15110 :
15111 0 : case NETR_DELTA_DELETE_GROUP:
15112 0 : ret = Py_None;
15113 0 : Py_INCREF(ret);
15114 0 : return ret;
15115 :
15116 0 : case NETR_DELTA_RENAME_GROUP:
15117 0 : if (in->rename_group == NULL) {
15118 0 : ret = Py_None;
15119 0 : Py_INCREF(ret);
15120 : } else {
15121 0 : ret = pytalloc_reference_ex(&netr_DELTA_RENAME_Type, in->rename_group, in->rename_group);
15122 : }
15123 0 : return ret;
15124 :
15125 0 : case NETR_DELTA_USER:
15126 0 : if (in->user == NULL) {
15127 0 : ret = Py_None;
15128 0 : Py_INCREF(ret);
15129 : } else {
15130 0 : ret = pytalloc_reference_ex(&netr_DELTA_USER_Type, in->user, in->user);
15131 : }
15132 0 : return ret;
15133 :
15134 0 : case NETR_DELTA_DELETE_USER:
15135 0 : ret = Py_None;
15136 0 : Py_INCREF(ret);
15137 0 : return ret;
15138 :
15139 0 : case NETR_DELTA_RENAME_USER:
15140 0 : if (in->rename_user == NULL) {
15141 0 : ret = Py_None;
15142 0 : Py_INCREF(ret);
15143 : } else {
15144 0 : ret = pytalloc_reference_ex(&netr_DELTA_RENAME_Type, in->rename_user, in->rename_user);
15145 : }
15146 0 : return ret;
15147 :
15148 0 : case NETR_DELTA_GROUP_MEMBER:
15149 0 : if (in->group_member == NULL) {
15150 0 : ret = Py_None;
15151 0 : Py_INCREF(ret);
15152 : } else {
15153 0 : ret = pytalloc_reference_ex(&netr_DELTA_GROUP_MEMBER_Type, in->group_member, in->group_member);
15154 : }
15155 0 : return ret;
15156 :
15157 0 : case NETR_DELTA_ALIAS:
15158 0 : if (in->alias == NULL) {
15159 0 : ret = Py_None;
15160 0 : Py_INCREF(ret);
15161 : } else {
15162 0 : ret = pytalloc_reference_ex(&netr_DELTA_ALIAS_Type, in->alias, in->alias);
15163 : }
15164 0 : return ret;
15165 :
15166 0 : case NETR_DELTA_DELETE_ALIAS:
15167 0 : ret = Py_None;
15168 0 : Py_INCREF(ret);
15169 0 : return ret;
15170 :
15171 0 : case NETR_DELTA_RENAME_ALIAS:
15172 0 : if (in->rename_alias == NULL) {
15173 0 : ret = Py_None;
15174 0 : Py_INCREF(ret);
15175 : } else {
15176 0 : ret = pytalloc_reference_ex(&netr_DELTA_RENAME_Type, in->rename_alias, in->rename_alias);
15177 : }
15178 0 : return ret;
15179 :
15180 0 : case NETR_DELTA_ALIAS_MEMBER:
15181 0 : if (in->alias_member == NULL) {
15182 0 : ret = Py_None;
15183 0 : Py_INCREF(ret);
15184 : } else {
15185 0 : ret = pytalloc_reference_ex(&netr_DELTA_ALIAS_MEMBER_Type, in->alias_member, in->alias_member);
15186 : }
15187 0 : return ret;
15188 :
15189 0 : case NETR_DELTA_POLICY:
15190 0 : if (in->policy == NULL) {
15191 0 : ret = Py_None;
15192 0 : Py_INCREF(ret);
15193 : } else {
15194 0 : ret = pytalloc_reference_ex(&netr_DELTA_POLICY_Type, in->policy, in->policy);
15195 : }
15196 0 : return ret;
15197 :
15198 0 : case NETR_DELTA_TRUSTED_DOMAIN:
15199 0 : if (in->trusted_domain == NULL) {
15200 0 : ret = Py_None;
15201 0 : Py_INCREF(ret);
15202 : } else {
15203 0 : ret = pytalloc_reference_ex(&netr_DELTA_TRUSTED_DOMAIN_Type, in->trusted_domain, in->trusted_domain);
15204 : }
15205 0 : return ret;
15206 :
15207 0 : case NETR_DELTA_DELETE_TRUST:
15208 0 : ret = Py_None;
15209 0 : Py_INCREF(ret);
15210 0 : return ret;
15211 :
15212 0 : case NETR_DELTA_ACCOUNT:
15213 0 : if (in->account == NULL) {
15214 0 : ret = Py_None;
15215 0 : Py_INCREF(ret);
15216 : } else {
15217 0 : ret = pytalloc_reference_ex(&netr_DELTA_ACCOUNT_Type, in->account, in->account);
15218 : }
15219 0 : return ret;
15220 :
15221 0 : case NETR_DELTA_DELETE_ACCOUNT:
15222 0 : ret = Py_None;
15223 0 : Py_INCREF(ret);
15224 0 : return ret;
15225 :
15226 0 : case NETR_DELTA_SECRET:
15227 0 : if (in->secret == NULL) {
15228 0 : ret = Py_None;
15229 0 : Py_INCREF(ret);
15230 : } else {
15231 0 : ret = pytalloc_reference_ex(&netr_DELTA_SECRET_Type, in->secret, in->secret);
15232 : }
15233 0 : return ret;
15234 :
15235 0 : case NETR_DELTA_DELETE_SECRET:
15236 0 : ret = Py_None;
15237 0 : Py_INCREF(ret);
15238 0 : return ret;
15239 :
15240 0 : case NETR_DELTA_DELETE_GROUP2:
15241 0 : if (in->delete_group == NULL) {
15242 0 : ret = Py_None;
15243 0 : Py_INCREF(ret);
15244 : } else {
15245 0 : ret = pytalloc_reference_ex(&netr_DELTA_DELETE_USER_Type, in->delete_group, in->delete_group);
15246 : }
15247 0 : return ret;
15248 :
15249 0 : case NETR_DELTA_DELETE_USER2:
15250 0 : if (in->delete_user == NULL) {
15251 0 : ret = Py_None;
15252 0 : Py_INCREF(ret);
15253 : } else {
15254 0 : ret = pytalloc_reference_ex(&netr_DELTA_DELETE_USER_Type, in->delete_user, in->delete_user);
15255 : }
15256 0 : return ret;
15257 :
15258 0 : case NETR_DELTA_MODIFY_COUNT:
15259 0 : if (in->modified_count == NULL) {
15260 0 : ret = Py_None;
15261 0 : Py_INCREF(ret);
15262 : } else {
15263 0 : ret = PyLong_FromUnsignedLongLong(*in->modified_count);
15264 : }
15265 0 : return ret;
15266 :
15267 0 : default:
15268 0 : ret = Py_None;
15269 0 : Py_INCREF(ret);
15270 0 : return ret;
15271 :
15272 : }
15273 : PyErr_SetString(PyExc_TypeError, "unknown union level");
15274 : return NULL;
15275 : }
15276 :
15277 0 : static union netr_DELTA_UNION *py_export_netr_DELTA_UNION(TALLOC_CTX *mem_ctx, int level, PyObject *in)
15278 : {
15279 0 : union netr_DELTA_UNION *ret = talloc_zero(mem_ctx, union netr_DELTA_UNION);
15280 0 : switch (level) {
15281 0 : case NETR_DELTA_DOMAIN:
15282 0 : if (in == NULL) {
15283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain");
15284 0 : talloc_free(ret); return NULL;
15285 : }
15286 0 : if (in == Py_None) {
15287 0 : ret->domain = NULL;
15288 : } else {
15289 0 : ret->domain = NULL;
15290 0 : PY_CHECK_TYPE(&netr_DELTA_DOMAIN_Type, in, talloc_free(ret); return NULL;);
15291 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15292 0 : PyErr_NoMemory();
15293 0 : talloc_free(ret); return NULL;
15294 : }
15295 0 : ret->domain = (struct netr_DELTA_DOMAIN *)pytalloc_get_ptr(in);
15296 : }
15297 0 : break;
15298 :
15299 0 : case NETR_DELTA_GROUP:
15300 0 : if (in == NULL) {
15301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->group");
15302 0 : talloc_free(ret); return NULL;
15303 : }
15304 0 : if (in == Py_None) {
15305 0 : ret->group = NULL;
15306 : } else {
15307 0 : ret->group = NULL;
15308 0 : PY_CHECK_TYPE(&netr_DELTA_GROUP_Type, in, talloc_free(ret); return NULL;);
15309 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15310 0 : PyErr_NoMemory();
15311 0 : talloc_free(ret); return NULL;
15312 : }
15313 0 : ret->group = (struct netr_DELTA_GROUP *)pytalloc_get_ptr(in);
15314 : }
15315 0 : break;
15316 :
15317 0 : case NETR_DELTA_DELETE_GROUP:
15318 0 : break;
15319 :
15320 0 : case NETR_DELTA_RENAME_GROUP:
15321 0 : if (in == NULL) {
15322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rename_group");
15323 0 : talloc_free(ret); return NULL;
15324 : }
15325 0 : if (in == Py_None) {
15326 0 : ret->rename_group = NULL;
15327 : } else {
15328 0 : ret->rename_group = NULL;
15329 0 : PY_CHECK_TYPE(&netr_DELTA_RENAME_Type, in, talloc_free(ret); return NULL;);
15330 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15331 0 : PyErr_NoMemory();
15332 0 : talloc_free(ret); return NULL;
15333 : }
15334 0 : ret->rename_group = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(in);
15335 : }
15336 0 : break;
15337 :
15338 0 : case NETR_DELTA_USER:
15339 0 : if (in == NULL) {
15340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->user");
15341 0 : talloc_free(ret); return NULL;
15342 : }
15343 0 : if (in == Py_None) {
15344 0 : ret->user = NULL;
15345 : } else {
15346 0 : ret->user = NULL;
15347 0 : PY_CHECK_TYPE(&netr_DELTA_USER_Type, in, talloc_free(ret); return NULL;);
15348 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15349 0 : PyErr_NoMemory();
15350 0 : talloc_free(ret); return NULL;
15351 : }
15352 0 : ret->user = (struct netr_DELTA_USER *)pytalloc_get_ptr(in);
15353 : }
15354 0 : break;
15355 :
15356 0 : case NETR_DELTA_DELETE_USER:
15357 0 : break;
15358 :
15359 0 : case NETR_DELTA_RENAME_USER:
15360 0 : if (in == NULL) {
15361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rename_user");
15362 0 : talloc_free(ret); return NULL;
15363 : }
15364 0 : if (in == Py_None) {
15365 0 : ret->rename_user = NULL;
15366 : } else {
15367 0 : ret->rename_user = NULL;
15368 0 : PY_CHECK_TYPE(&netr_DELTA_RENAME_Type, in, talloc_free(ret); return NULL;);
15369 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15370 0 : PyErr_NoMemory();
15371 0 : talloc_free(ret); return NULL;
15372 : }
15373 0 : ret->rename_user = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(in);
15374 : }
15375 0 : break;
15376 :
15377 0 : case NETR_DELTA_GROUP_MEMBER:
15378 0 : if (in == NULL) {
15379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->group_member");
15380 0 : talloc_free(ret); return NULL;
15381 : }
15382 0 : if (in == Py_None) {
15383 0 : ret->group_member = NULL;
15384 : } else {
15385 0 : ret->group_member = NULL;
15386 0 : PY_CHECK_TYPE(&netr_DELTA_GROUP_MEMBER_Type, in, talloc_free(ret); return NULL;);
15387 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15388 0 : PyErr_NoMemory();
15389 0 : talloc_free(ret); return NULL;
15390 : }
15391 0 : ret->group_member = (struct netr_DELTA_GROUP_MEMBER *)pytalloc_get_ptr(in);
15392 : }
15393 0 : break;
15394 :
15395 0 : case NETR_DELTA_ALIAS:
15396 0 : if (in == NULL) {
15397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->alias");
15398 0 : talloc_free(ret); return NULL;
15399 : }
15400 0 : if (in == Py_None) {
15401 0 : ret->alias = NULL;
15402 : } else {
15403 0 : ret->alias = NULL;
15404 0 : PY_CHECK_TYPE(&netr_DELTA_ALIAS_Type, in, talloc_free(ret); return NULL;);
15405 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15406 0 : PyErr_NoMemory();
15407 0 : talloc_free(ret); return NULL;
15408 : }
15409 0 : ret->alias = (struct netr_DELTA_ALIAS *)pytalloc_get_ptr(in);
15410 : }
15411 0 : break;
15412 :
15413 0 : case NETR_DELTA_DELETE_ALIAS:
15414 0 : break;
15415 :
15416 0 : case NETR_DELTA_RENAME_ALIAS:
15417 0 : if (in == NULL) {
15418 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rename_alias");
15419 0 : talloc_free(ret); return NULL;
15420 : }
15421 0 : if (in == Py_None) {
15422 0 : ret->rename_alias = NULL;
15423 : } else {
15424 0 : ret->rename_alias = NULL;
15425 0 : PY_CHECK_TYPE(&netr_DELTA_RENAME_Type, in, talloc_free(ret); return NULL;);
15426 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15427 0 : PyErr_NoMemory();
15428 0 : talloc_free(ret); return NULL;
15429 : }
15430 0 : ret->rename_alias = (struct netr_DELTA_RENAME *)pytalloc_get_ptr(in);
15431 : }
15432 0 : break;
15433 :
15434 0 : case NETR_DELTA_ALIAS_MEMBER:
15435 0 : if (in == NULL) {
15436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->alias_member");
15437 0 : talloc_free(ret); return NULL;
15438 : }
15439 0 : if (in == Py_None) {
15440 0 : ret->alias_member = NULL;
15441 : } else {
15442 0 : ret->alias_member = NULL;
15443 0 : PY_CHECK_TYPE(&netr_DELTA_ALIAS_MEMBER_Type, in, talloc_free(ret); return NULL;);
15444 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15445 0 : PyErr_NoMemory();
15446 0 : talloc_free(ret); return NULL;
15447 : }
15448 0 : ret->alias_member = (struct netr_DELTA_ALIAS_MEMBER *)pytalloc_get_ptr(in);
15449 : }
15450 0 : break;
15451 :
15452 0 : case NETR_DELTA_POLICY:
15453 0 : if (in == NULL) {
15454 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->policy");
15455 0 : talloc_free(ret); return NULL;
15456 : }
15457 0 : if (in == Py_None) {
15458 0 : ret->policy = NULL;
15459 : } else {
15460 0 : ret->policy = NULL;
15461 0 : PY_CHECK_TYPE(&netr_DELTA_POLICY_Type, in, talloc_free(ret); return NULL;);
15462 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15463 0 : PyErr_NoMemory();
15464 0 : talloc_free(ret); return NULL;
15465 : }
15466 0 : ret->policy = (struct netr_DELTA_POLICY *)pytalloc_get_ptr(in);
15467 : }
15468 0 : break;
15469 :
15470 0 : case NETR_DELTA_TRUSTED_DOMAIN:
15471 0 : if (in == NULL) {
15472 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->trusted_domain");
15473 0 : talloc_free(ret); return NULL;
15474 : }
15475 0 : if (in == Py_None) {
15476 0 : ret->trusted_domain = NULL;
15477 : } else {
15478 0 : ret->trusted_domain = NULL;
15479 0 : PY_CHECK_TYPE(&netr_DELTA_TRUSTED_DOMAIN_Type, in, talloc_free(ret); return NULL;);
15480 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15481 0 : PyErr_NoMemory();
15482 0 : talloc_free(ret); return NULL;
15483 : }
15484 0 : ret->trusted_domain = (struct netr_DELTA_TRUSTED_DOMAIN *)pytalloc_get_ptr(in);
15485 : }
15486 0 : break;
15487 :
15488 0 : case NETR_DELTA_DELETE_TRUST:
15489 0 : break;
15490 :
15491 0 : case NETR_DELTA_ACCOUNT:
15492 0 : if (in == NULL) {
15493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->account");
15494 0 : talloc_free(ret); return NULL;
15495 : }
15496 0 : if (in == Py_None) {
15497 0 : ret->account = NULL;
15498 : } else {
15499 0 : ret->account = NULL;
15500 0 : PY_CHECK_TYPE(&netr_DELTA_ACCOUNT_Type, in, talloc_free(ret); return NULL;);
15501 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15502 0 : PyErr_NoMemory();
15503 0 : talloc_free(ret); return NULL;
15504 : }
15505 0 : ret->account = (struct netr_DELTA_ACCOUNT *)pytalloc_get_ptr(in);
15506 : }
15507 0 : break;
15508 :
15509 0 : case NETR_DELTA_DELETE_ACCOUNT:
15510 0 : break;
15511 :
15512 0 : case NETR_DELTA_SECRET:
15513 0 : if (in == NULL) {
15514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->secret");
15515 0 : talloc_free(ret); return NULL;
15516 : }
15517 0 : if (in == Py_None) {
15518 0 : ret->secret = NULL;
15519 : } else {
15520 0 : ret->secret = NULL;
15521 0 : PY_CHECK_TYPE(&netr_DELTA_SECRET_Type, in, talloc_free(ret); return NULL;);
15522 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15523 0 : PyErr_NoMemory();
15524 0 : talloc_free(ret); return NULL;
15525 : }
15526 0 : ret->secret = (struct netr_DELTA_SECRET *)pytalloc_get_ptr(in);
15527 : }
15528 0 : break;
15529 :
15530 0 : case NETR_DELTA_DELETE_SECRET:
15531 0 : break;
15532 :
15533 0 : case NETR_DELTA_DELETE_GROUP2:
15534 0 : if (in == NULL) {
15535 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->delete_group");
15536 0 : talloc_free(ret); return NULL;
15537 : }
15538 0 : if (in == Py_None) {
15539 0 : ret->delete_group = NULL;
15540 : } else {
15541 0 : ret->delete_group = NULL;
15542 0 : PY_CHECK_TYPE(&netr_DELTA_DELETE_USER_Type, in, talloc_free(ret); return NULL;);
15543 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15544 0 : PyErr_NoMemory();
15545 0 : talloc_free(ret); return NULL;
15546 : }
15547 0 : ret->delete_group = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(in);
15548 : }
15549 0 : break;
15550 :
15551 0 : case NETR_DELTA_DELETE_USER2:
15552 0 : if (in == NULL) {
15553 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->delete_user");
15554 0 : talloc_free(ret); return NULL;
15555 : }
15556 0 : if (in == Py_None) {
15557 0 : ret->delete_user = NULL;
15558 : } else {
15559 0 : ret->delete_user = NULL;
15560 0 : PY_CHECK_TYPE(&netr_DELTA_DELETE_USER_Type, in, talloc_free(ret); return NULL;);
15561 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
15562 0 : PyErr_NoMemory();
15563 0 : talloc_free(ret); return NULL;
15564 : }
15565 0 : ret->delete_user = (struct netr_DELTA_DELETE_USER *)pytalloc_get_ptr(in);
15566 : }
15567 0 : break;
15568 :
15569 0 : case NETR_DELTA_MODIFY_COUNT:
15570 0 : if (in == NULL) {
15571 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->modified_count");
15572 0 : talloc_free(ret); return NULL;
15573 : }
15574 0 : if (in == Py_None) {
15575 0 : ret->modified_count = NULL;
15576 : } else {
15577 0 : ret->modified_count = talloc_ptrtype(mem_ctx, ret->modified_count);
15578 0 : if (ret->modified_count == NULL) {
15579 0 : PyErr_NoMemory();
15580 0 : talloc_free(ret); return NULL;
15581 : }
15582 : {
15583 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*ret->modified_count));
15584 0 : if (PyLong_Check(in)) {
15585 : unsigned long long test_var;
15586 0 : test_var = PyLong_AsUnsignedLongLong(in);
15587 0 : if (PyErr_Occurred() != NULL) {
15588 0 : talloc_free(ret); return NULL;
15589 : }
15590 0 : if (test_var > uint_max) {
15591 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15592 : PyLong_Type.tp_name, uint_max, test_var);
15593 0 : talloc_free(ret); return NULL;
15594 : }
15595 0 : *ret->modified_count = test_var;
15596 : } else {
15597 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15598 : PyLong_Type.tp_name);
15599 0 : talloc_free(ret); return NULL;
15600 : }
15601 : }
15602 : }
15603 0 : break;
15604 :
15605 0 : default:
15606 0 : break;
15607 :
15608 : }
15609 :
15610 0 : return ret;
15611 : }
15612 :
15613 0 : static PyObject *py_netr_DELTA_UNION_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15614 : {
15615 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
15616 0 : PyObject *mem_ctx_obj = NULL;
15617 0 : TALLOC_CTX *mem_ctx = NULL;
15618 0 : int level = 0;
15619 0 : PyObject *in_obj = NULL;
15620 0 : union netr_DELTA_UNION *in = NULL;
15621 :
15622 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
15623 : discard_const_p(char *, kwnames),
15624 : &mem_ctx_obj,
15625 : &level,
15626 : &in_obj)) {
15627 0 : return NULL;
15628 : }
15629 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
15630 0 : if (mem_ctx == NULL) {
15631 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
15632 0 : return NULL;
15633 : }
15634 0 : in = (union netr_DELTA_UNION *)pytalloc_get_ptr(in_obj);
15635 0 : if (in == NULL) {
15636 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_DELTA_UNION!");
15637 0 : return NULL;
15638 : }
15639 :
15640 0 : return py_import_netr_DELTA_UNION(mem_ctx, level, in);
15641 : }
15642 :
15643 0 : static PyObject *py_netr_DELTA_UNION_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15644 : {
15645 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
15646 0 : PyObject *mem_ctx_obj = NULL;
15647 0 : TALLOC_CTX *mem_ctx = NULL;
15648 0 : int level = 0;
15649 0 : PyObject *in = NULL;
15650 0 : union netr_DELTA_UNION *out = NULL;
15651 :
15652 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
15653 : discard_const_p(char *, kwnames),
15654 : &mem_ctx_obj,
15655 : &level,
15656 : &in)) {
15657 0 : return NULL;
15658 : }
15659 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
15660 0 : if (mem_ctx == NULL) {
15661 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
15662 0 : return NULL;
15663 : }
15664 :
15665 0 : out = py_export_netr_DELTA_UNION(mem_ctx, level, in);
15666 0 : if (out == NULL) {
15667 0 : return NULL;
15668 : }
15669 :
15670 0 : return pytalloc_GenericObject_reference(out);
15671 : }
15672 :
15673 : static PyMethodDef py_netr_DELTA_UNION_methods[] = {
15674 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DELTA_UNION_import),
15675 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
15676 : "T.__import__(mem_ctx, level, in) => ret." },
15677 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DELTA_UNION_export),
15678 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
15679 : "T.__export__(mem_ctx, level, in) => ret." },
15680 : { NULL, NULL, 0, NULL }
15681 : };
15682 :
15683 0 : static PyObject *py_netr_DELTA_UNION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15684 : {
15685 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
15686 0 : return NULL;
15687 : }
15688 :
15689 :
15690 : static PyTypeObject netr_DELTA_UNION_Type = {
15691 : PyVarObject_HEAD_INIT(NULL, 0)
15692 : .tp_name = "netlogon.netr_DELTA_UNION",
15693 : .tp_getset = NULL,
15694 : .tp_methods = py_netr_DELTA_UNION_methods,
15695 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15696 : .tp_new = py_netr_DELTA_UNION_new,
15697 : };
15698 :
15699 0 : static PyObject *py_import_netr_DELTA_ID_UNION(TALLOC_CTX *mem_ctx, int level, union netr_DELTA_ID_UNION *in)
15700 : {
15701 : PyObject *ret;
15702 :
15703 0 : switch (level) {
15704 0 : case NETR_DELTA_DOMAIN:
15705 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15706 0 : return ret;
15707 :
15708 0 : case NETR_DELTA_GROUP:
15709 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15710 0 : return ret;
15711 :
15712 0 : case NETR_DELTA_DELETE_GROUP:
15713 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15714 0 : return ret;
15715 :
15716 0 : case NETR_DELTA_RENAME_GROUP:
15717 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15718 0 : return ret;
15719 :
15720 0 : case NETR_DELTA_USER:
15721 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15722 0 : return ret;
15723 :
15724 0 : case NETR_DELTA_DELETE_USER:
15725 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15726 0 : return ret;
15727 :
15728 0 : case NETR_DELTA_RENAME_USER:
15729 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15730 0 : return ret;
15731 :
15732 0 : case NETR_DELTA_GROUP_MEMBER:
15733 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15734 0 : return ret;
15735 :
15736 0 : case NETR_DELTA_ALIAS:
15737 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15738 0 : return ret;
15739 :
15740 0 : case NETR_DELTA_DELETE_ALIAS:
15741 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15742 0 : return ret;
15743 :
15744 0 : case NETR_DELTA_RENAME_ALIAS:
15745 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15746 0 : return ret;
15747 :
15748 0 : case NETR_DELTA_ALIAS_MEMBER:
15749 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15750 0 : return ret;
15751 :
15752 0 : case NETR_DELTA_POLICY:
15753 0 : if (in->sid == NULL) {
15754 0 : ret = Py_None;
15755 0 : Py_INCREF(ret);
15756 : } else {
15757 0 : ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid);
15758 : }
15759 0 : return ret;
15760 :
15761 0 : case NETR_DELTA_TRUSTED_DOMAIN:
15762 0 : if (in->sid == NULL) {
15763 0 : ret = Py_None;
15764 0 : Py_INCREF(ret);
15765 : } else {
15766 0 : ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid);
15767 : }
15768 0 : return ret;
15769 :
15770 0 : case NETR_DELTA_DELETE_TRUST:
15771 0 : if (in->sid == NULL) {
15772 0 : ret = Py_None;
15773 0 : Py_INCREF(ret);
15774 : } else {
15775 0 : ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid);
15776 : }
15777 0 : return ret;
15778 :
15779 0 : case NETR_DELTA_ACCOUNT:
15780 0 : if (in->sid == NULL) {
15781 0 : ret = Py_None;
15782 0 : Py_INCREF(ret);
15783 : } else {
15784 0 : ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid);
15785 : }
15786 0 : return ret;
15787 :
15788 0 : case NETR_DELTA_DELETE_ACCOUNT:
15789 0 : if (in->sid == NULL) {
15790 0 : ret = Py_None;
15791 0 : Py_INCREF(ret);
15792 : } else {
15793 0 : ret = pytalloc_reference_ex(dom_sid_Type, in->sid, in->sid);
15794 : }
15795 0 : return ret;
15796 :
15797 0 : case NETR_DELTA_SECRET:
15798 0 : if (in->name == NULL) {
15799 0 : ret = Py_None;
15800 0 : Py_INCREF(ret);
15801 : } else {
15802 0 : if (in->name == NULL) {
15803 0 : ret = Py_None;
15804 0 : Py_INCREF(ret);
15805 : } else {
15806 0 : ret = PyUnicode_Decode(in->name, strlen(in->name), "utf-8", "ignore");
15807 : }
15808 : }
15809 0 : return ret;
15810 :
15811 0 : case NETR_DELTA_DELETE_SECRET:
15812 0 : if (in->name == NULL) {
15813 0 : ret = Py_None;
15814 0 : Py_INCREF(ret);
15815 : } else {
15816 0 : if (in->name == NULL) {
15817 0 : ret = Py_None;
15818 0 : Py_INCREF(ret);
15819 : } else {
15820 0 : ret = PyUnicode_Decode(in->name, strlen(in->name), "utf-8", "ignore");
15821 : }
15822 : }
15823 0 : return ret;
15824 :
15825 0 : case NETR_DELTA_DELETE_GROUP2:
15826 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15827 0 : return ret;
15828 :
15829 0 : case NETR_DELTA_DELETE_USER2:
15830 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->rid);
15831 0 : return ret;
15832 :
15833 0 : case NETR_DELTA_MODIFY_COUNT:
15834 0 : ret = Py_None;
15835 0 : Py_INCREF(ret);
15836 0 : return ret;
15837 :
15838 0 : default:
15839 0 : ret = Py_None;
15840 0 : Py_INCREF(ret);
15841 0 : return ret;
15842 :
15843 : }
15844 : PyErr_SetString(PyExc_TypeError, "unknown union level");
15845 : return NULL;
15846 : }
15847 :
15848 0 : static union netr_DELTA_ID_UNION *py_export_netr_DELTA_ID_UNION(TALLOC_CTX *mem_ctx, int level, PyObject *in)
15849 : {
15850 0 : union netr_DELTA_ID_UNION *ret = talloc_zero(mem_ctx, union netr_DELTA_ID_UNION);
15851 0 : switch (level) {
15852 0 : case NETR_DELTA_DOMAIN:
15853 0 : if (in == NULL) {
15854 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
15855 0 : talloc_free(ret); return NULL;
15856 : }
15857 : {
15858 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
15859 0 : if (PyLong_Check(in)) {
15860 : unsigned long long test_var;
15861 0 : test_var = PyLong_AsUnsignedLongLong(in);
15862 0 : if (PyErr_Occurred() != NULL) {
15863 0 : talloc_free(ret); return NULL;
15864 : }
15865 0 : if (test_var > uint_max) {
15866 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15867 : PyLong_Type.tp_name, uint_max, test_var);
15868 0 : talloc_free(ret); return NULL;
15869 : }
15870 0 : ret->rid = test_var;
15871 : } else {
15872 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15873 : PyLong_Type.tp_name);
15874 0 : talloc_free(ret); return NULL;
15875 : }
15876 : }
15877 0 : break;
15878 :
15879 0 : case NETR_DELTA_GROUP:
15880 0 : if (in == NULL) {
15881 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
15882 0 : talloc_free(ret); return NULL;
15883 : }
15884 : {
15885 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
15886 0 : if (PyLong_Check(in)) {
15887 : unsigned long long test_var;
15888 0 : test_var = PyLong_AsUnsignedLongLong(in);
15889 0 : if (PyErr_Occurred() != NULL) {
15890 0 : talloc_free(ret); return NULL;
15891 : }
15892 0 : if (test_var > uint_max) {
15893 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15894 : PyLong_Type.tp_name, uint_max, test_var);
15895 0 : talloc_free(ret); return NULL;
15896 : }
15897 0 : ret->rid = test_var;
15898 : } else {
15899 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15900 : PyLong_Type.tp_name);
15901 0 : talloc_free(ret); return NULL;
15902 : }
15903 : }
15904 0 : break;
15905 :
15906 0 : case NETR_DELTA_DELETE_GROUP:
15907 0 : if (in == NULL) {
15908 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
15909 0 : talloc_free(ret); return NULL;
15910 : }
15911 : {
15912 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
15913 0 : if (PyLong_Check(in)) {
15914 : unsigned long long test_var;
15915 0 : test_var = PyLong_AsUnsignedLongLong(in);
15916 0 : if (PyErr_Occurred() != NULL) {
15917 0 : talloc_free(ret); return NULL;
15918 : }
15919 0 : if (test_var > uint_max) {
15920 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15921 : PyLong_Type.tp_name, uint_max, test_var);
15922 0 : talloc_free(ret); return NULL;
15923 : }
15924 0 : ret->rid = test_var;
15925 : } else {
15926 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15927 : PyLong_Type.tp_name);
15928 0 : talloc_free(ret); return NULL;
15929 : }
15930 : }
15931 0 : break;
15932 :
15933 0 : case NETR_DELTA_RENAME_GROUP:
15934 0 : if (in == NULL) {
15935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
15936 0 : talloc_free(ret); return NULL;
15937 : }
15938 : {
15939 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
15940 0 : if (PyLong_Check(in)) {
15941 : unsigned long long test_var;
15942 0 : test_var = PyLong_AsUnsignedLongLong(in);
15943 0 : if (PyErr_Occurred() != NULL) {
15944 0 : talloc_free(ret); return NULL;
15945 : }
15946 0 : if (test_var > uint_max) {
15947 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15948 : PyLong_Type.tp_name, uint_max, test_var);
15949 0 : talloc_free(ret); return NULL;
15950 : }
15951 0 : ret->rid = test_var;
15952 : } else {
15953 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15954 : PyLong_Type.tp_name);
15955 0 : talloc_free(ret); return NULL;
15956 : }
15957 : }
15958 0 : break;
15959 :
15960 0 : case NETR_DELTA_USER:
15961 0 : if (in == NULL) {
15962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
15963 0 : talloc_free(ret); return NULL;
15964 : }
15965 : {
15966 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
15967 0 : if (PyLong_Check(in)) {
15968 : unsigned long long test_var;
15969 0 : test_var = PyLong_AsUnsignedLongLong(in);
15970 0 : if (PyErr_Occurred() != NULL) {
15971 0 : talloc_free(ret); return NULL;
15972 : }
15973 0 : if (test_var > uint_max) {
15974 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15975 : PyLong_Type.tp_name, uint_max, test_var);
15976 0 : talloc_free(ret); return NULL;
15977 : }
15978 0 : ret->rid = test_var;
15979 : } else {
15980 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15981 : PyLong_Type.tp_name);
15982 0 : talloc_free(ret); return NULL;
15983 : }
15984 : }
15985 0 : break;
15986 :
15987 0 : case NETR_DELTA_DELETE_USER:
15988 0 : if (in == NULL) {
15989 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
15990 0 : talloc_free(ret); return NULL;
15991 : }
15992 : {
15993 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
15994 0 : if (PyLong_Check(in)) {
15995 : unsigned long long test_var;
15996 0 : test_var = PyLong_AsUnsignedLongLong(in);
15997 0 : if (PyErr_Occurred() != NULL) {
15998 0 : talloc_free(ret); return NULL;
15999 : }
16000 0 : if (test_var > uint_max) {
16001 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16002 : PyLong_Type.tp_name, uint_max, test_var);
16003 0 : talloc_free(ret); return NULL;
16004 : }
16005 0 : ret->rid = test_var;
16006 : } else {
16007 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16008 : PyLong_Type.tp_name);
16009 0 : talloc_free(ret); return NULL;
16010 : }
16011 : }
16012 0 : break;
16013 :
16014 0 : case NETR_DELTA_RENAME_USER:
16015 0 : if (in == NULL) {
16016 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
16017 0 : talloc_free(ret); return NULL;
16018 : }
16019 : {
16020 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
16021 0 : if (PyLong_Check(in)) {
16022 : unsigned long long test_var;
16023 0 : test_var = PyLong_AsUnsignedLongLong(in);
16024 0 : if (PyErr_Occurred() != NULL) {
16025 0 : talloc_free(ret); return NULL;
16026 : }
16027 0 : if (test_var > uint_max) {
16028 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16029 : PyLong_Type.tp_name, uint_max, test_var);
16030 0 : talloc_free(ret); return NULL;
16031 : }
16032 0 : ret->rid = test_var;
16033 : } else {
16034 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16035 : PyLong_Type.tp_name);
16036 0 : talloc_free(ret); return NULL;
16037 : }
16038 : }
16039 0 : break;
16040 :
16041 0 : case NETR_DELTA_GROUP_MEMBER:
16042 0 : if (in == NULL) {
16043 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
16044 0 : talloc_free(ret); return NULL;
16045 : }
16046 : {
16047 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
16048 0 : if (PyLong_Check(in)) {
16049 : unsigned long long test_var;
16050 0 : test_var = PyLong_AsUnsignedLongLong(in);
16051 0 : if (PyErr_Occurred() != NULL) {
16052 0 : talloc_free(ret); return NULL;
16053 : }
16054 0 : if (test_var > uint_max) {
16055 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16056 : PyLong_Type.tp_name, uint_max, test_var);
16057 0 : talloc_free(ret); return NULL;
16058 : }
16059 0 : ret->rid = test_var;
16060 : } else {
16061 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16062 : PyLong_Type.tp_name);
16063 0 : talloc_free(ret); return NULL;
16064 : }
16065 : }
16066 0 : break;
16067 :
16068 0 : case NETR_DELTA_ALIAS:
16069 0 : if (in == NULL) {
16070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
16071 0 : talloc_free(ret); return NULL;
16072 : }
16073 : {
16074 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
16075 0 : if (PyLong_Check(in)) {
16076 : unsigned long long test_var;
16077 0 : test_var = PyLong_AsUnsignedLongLong(in);
16078 0 : if (PyErr_Occurred() != NULL) {
16079 0 : talloc_free(ret); return NULL;
16080 : }
16081 0 : if (test_var > uint_max) {
16082 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16083 : PyLong_Type.tp_name, uint_max, test_var);
16084 0 : talloc_free(ret); return NULL;
16085 : }
16086 0 : ret->rid = test_var;
16087 : } else {
16088 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16089 : PyLong_Type.tp_name);
16090 0 : talloc_free(ret); return NULL;
16091 : }
16092 : }
16093 0 : break;
16094 :
16095 0 : case NETR_DELTA_DELETE_ALIAS:
16096 0 : if (in == NULL) {
16097 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
16098 0 : talloc_free(ret); return NULL;
16099 : }
16100 : {
16101 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
16102 0 : if (PyLong_Check(in)) {
16103 : unsigned long long test_var;
16104 0 : test_var = PyLong_AsUnsignedLongLong(in);
16105 0 : if (PyErr_Occurred() != NULL) {
16106 0 : talloc_free(ret); return NULL;
16107 : }
16108 0 : if (test_var > uint_max) {
16109 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16110 : PyLong_Type.tp_name, uint_max, test_var);
16111 0 : talloc_free(ret); return NULL;
16112 : }
16113 0 : ret->rid = test_var;
16114 : } else {
16115 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16116 : PyLong_Type.tp_name);
16117 0 : talloc_free(ret); return NULL;
16118 : }
16119 : }
16120 0 : break;
16121 :
16122 0 : case NETR_DELTA_RENAME_ALIAS:
16123 0 : if (in == NULL) {
16124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
16125 0 : talloc_free(ret); return NULL;
16126 : }
16127 : {
16128 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
16129 0 : if (PyLong_Check(in)) {
16130 : unsigned long long test_var;
16131 0 : test_var = PyLong_AsUnsignedLongLong(in);
16132 0 : if (PyErr_Occurred() != NULL) {
16133 0 : talloc_free(ret); return NULL;
16134 : }
16135 0 : if (test_var > uint_max) {
16136 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16137 : PyLong_Type.tp_name, uint_max, test_var);
16138 0 : talloc_free(ret); return NULL;
16139 : }
16140 0 : ret->rid = test_var;
16141 : } else {
16142 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16143 : PyLong_Type.tp_name);
16144 0 : talloc_free(ret); return NULL;
16145 : }
16146 : }
16147 0 : break;
16148 :
16149 0 : case NETR_DELTA_ALIAS_MEMBER:
16150 0 : if (in == NULL) {
16151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
16152 0 : talloc_free(ret); return NULL;
16153 : }
16154 : {
16155 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
16156 0 : if (PyLong_Check(in)) {
16157 : unsigned long long test_var;
16158 0 : test_var = PyLong_AsUnsignedLongLong(in);
16159 0 : if (PyErr_Occurred() != NULL) {
16160 0 : talloc_free(ret); return NULL;
16161 : }
16162 0 : if (test_var > uint_max) {
16163 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16164 : PyLong_Type.tp_name, uint_max, test_var);
16165 0 : talloc_free(ret); return NULL;
16166 : }
16167 0 : ret->rid = test_var;
16168 : } else {
16169 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16170 : PyLong_Type.tp_name);
16171 0 : talloc_free(ret); return NULL;
16172 : }
16173 : }
16174 0 : break;
16175 :
16176 0 : case NETR_DELTA_POLICY:
16177 0 : if (in == NULL) {
16178 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid");
16179 0 : talloc_free(ret); return NULL;
16180 : }
16181 0 : if (in == Py_None) {
16182 0 : ret->sid = NULL;
16183 : } else {
16184 0 : ret->sid = NULL;
16185 0 : PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;);
16186 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
16187 0 : PyErr_NoMemory();
16188 0 : talloc_free(ret); return NULL;
16189 : }
16190 0 : ret->sid = (struct dom_sid *)pytalloc_get_ptr(in);
16191 : }
16192 0 : break;
16193 :
16194 0 : case NETR_DELTA_TRUSTED_DOMAIN:
16195 0 : if (in == NULL) {
16196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid");
16197 0 : talloc_free(ret); return NULL;
16198 : }
16199 0 : if (in == Py_None) {
16200 0 : ret->sid = NULL;
16201 : } else {
16202 0 : ret->sid = NULL;
16203 0 : PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;);
16204 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
16205 0 : PyErr_NoMemory();
16206 0 : talloc_free(ret); return NULL;
16207 : }
16208 0 : ret->sid = (struct dom_sid *)pytalloc_get_ptr(in);
16209 : }
16210 0 : break;
16211 :
16212 0 : case NETR_DELTA_DELETE_TRUST:
16213 0 : if (in == NULL) {
16214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid");
16215 0 : talloc_free(ret); return NULL;
16216 : }
16217 0 : if (in == Py_None) {
16218 0 : ret->sid = NULL;
16219 : } else {
16220 0 : ret->sid = NULL;
16221 0 : PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;);
16222 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
16223 0 : PyErr_NoMemory();
16224 0 : talloc_free(ret); return NULL;
16225 : }
16226 0 : ret->sid = (struct dom_sid *)pytalloc_get_ptr(in);
16227 : }
16228 0 : break;
16229 :
16230 0 : case NETR_DELTA_ACCOUNT:
16231 0 : if (in == NULL) {
16232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid");
16233 0 : talloc_free(ret); return NULL;
16234 : }
16235 0 : if (in == Py_None) {
16236 0 : ret->sid = NULL;
16237 : } else {
16238 0 : ret->sid = NULL;
16239 0 : PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;);
16240 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
16241 0 : PyErr_NoMemory();
16242 0 : talloc_free(ret); return NULL;
16243 : }
16244 0 : ret->sid = (struct dom_sid *)pytalloc_get_ptr(in);
16245 : }
16246 0 : break;
16247 :
16248 0 : case NETR_DELTA_DELETE_ACCOUNT:
16249 0 : if (in == NULL) {
16250 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->sid");
16251 0 : talloc_free(ret); return NULL;
16252 : }
16253 0 : if (in == Py_None) {
16254 0 : ret->sid = NULL;
16255 : } else {
16256 0 : ret->sid = NULL;
16257 0 : PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;);
16258 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
16259 0 : PyErr_NoMemory();
16260 0 : talloc_free(ret); return NULL;
16261 : }
16262 0 : ret->sid = (struct dom_sid *)pytalloc_get_ptr(in);
16263 : }
16264 0 : break;
16265 :
16266 0 : case NETR_DELTA_SECRET:
16267 0 : if (in == NULL) {
16268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
16269 0 : talloc_free(ret); return NULL;
16270 : }
16271 0 : if (in == Py_None) {
16272 0 : ret->name = NULL;
16273 : } else {
16274 0 : ret->name = NULL;
16275 : {
16276 : const char *test_str;
16277 : const char *talloc_str;
16278 0 : PyObject *unicode = NULL;
16279 0 : if (PyUnicode_Check(in)) {
16280 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
16281 0 : if (unicode == NULL) {
16282 0 : PyErr_NoMemory();
16283 0 : talloc_free(ret); return NULL;
16284 : }
16285 0 : test_str = PyBytes_AS_STRING(unicode);
16286 0 : } else if (PyBytes_Check(in)) {
16287 0 : test_str = PyBytes_AS_STRING(in);
16288 : } else {
16289 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
16290 0 : talloc_free(ret); return NULL;
16291 : }
16292 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
16293 0 : if (unicode != NULL) {
16294 0 : Py_DECREF(unicode);
16295 : }
16296 0 : if (talloc_str == NULL) {
16297 0 : PyErr_NoMemory();
16298 0 : talloc_free(ret); return NULL;
16299 : }
16300 0 : ret->name = talloc_str;
16301 : }
16302 : }
16303 0 : break;
16304 :
16305 0 : case NETR_DELTA_DELETE_SECRET:
16306 0 : if (in == NULL) {
16307 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
16308 0 : talloc_free(ret); return NULL;
16309 : }
16310 0 : if (in == Py_None) {
16311 0 : ret->name = NULL;
16312 : } else {
16313 0 : ret->name = NULL;
16314 : {
16315 : const char *test_str;
16316 : const char *talloc_str;
16317 0 : PyObject *unicode = NULL;
16318 0 : if (PyUnicode_Check(in)) {
16319 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
16320 0 : if (unicode == NULL) {
16321 0 : PyErr_NoMemory();
16322 0 : talloc_free(ret); return NULL;
16323 : }
16324 0 : test_str = PyBytes_AS_STRING(unicode);
16325 0 : } else if (PyBytes_Check(in)) {
16326 0 : test_str = PyBytes_AS_STRING(in);
16327 : } else {
16328 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
16329 0 : talloc_free(ret); return NULL;
16330 : }
16331 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
16332 0 : if (unicode != NULL) {
16333 0 : Py_DECREF(unicode);
16334 : }
16335 0 : if (talloc_str == NULL) {
16336 0 : PyErr_NoMemory();
16337 0 : talloc_free(ret); return NULL;
16338 : }
16339 0 : ret->name = talloc_str;
16340 : }
16341 : }
16342 0 : break;
16343 :
16344 0 : case NETR_DELTA_DELETE_GROUP2:
16345 0 : if (in == NULL) {
16346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
16347 0 : talloc_free(ret); return NULL;
16348 : }
16349 : {
16350 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
16351 0 : if (PyLong_Check(in)) {
16352 : unsigned long long test_var;
16353 0 : test_var = PyLong_AsUnsignedLongLong(in);
16354 0 : if (PyErr_Occurred() != NULL) {
16355 0 : talloc_free(ret); return NULL;
16356 : }
16357 0 : if (test_var > uint_max) {
16358 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16359 : PyLong_Type.tp_name, uint_max, test_var);
16360 0 : talloc_free(ret); return NULL;
16361 : }
16362 0 : ret->rid = test_var;
16363 : } else {
16364 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16365 : PyLong_Type.tp_name);
16366 0 : talloc_free(ret); return NULL;
16367 : }
16368 : }
16369 0 : break;
16370 :
16371 0 : case NETR_DELTA_DELETE_USER2:
16372 0 : if (in == NULL) {
16373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->rid");
16374 0 : talloc_free(ret); return NULL;
16375 : }
16376 : {
16377 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->rid));
16378 0 : if (PyLong_Check(in)) {
16379 : unsigned long long test_var;
16380 0 : test_var = PyLong_AsUnsignedLongLong(in);
16381 0 : if (PyErr_Occurred() != NULL) {
16382 0 : talloc_free(ret); return NULL;
16383 : }
16384 0 : if (test_var > uint_max) {
16385 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16386 : PyLong_Type.tp_name, uint_max, test_var);
16387 0 : talloc_free(ret); return NULL;
16388 : }
16389 0 : ret->rid = test_var;
16390 : } else {
16391 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16392 : PyLong_Type.tp_name);
16393 0 : talloc_free(ret); return NULL;
16394 : }
16395 : }
16396 0 : break;
16397 :
16398 0 : case NETR_DELTA_MODIFY_COUNT:
16399 0 : break;
16400 :
16401 0 : default:
16402 0 : break;
16403 :
16404 : }
16405 :
16406 0 : return ret;
16407 : }
16408 :
16409 0 : static PyObject *py_netr_DELTA_ID_UNION_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16410 : {
16411 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
16412 0 : PyObject *mem_ctx_obj = NULL;
16413 0 : TALLOC_CTX *mem_ctx = NULL;
16414 0 : int level = 0;
16415 0 : PyObject *in_obj = NULL;
16416 0 : union netr_DELTA_ID_UNION *in = NULL;
16417 :
16418 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
16419 : discard_const_p(char *, kwnames),
16420 : &mem_ctx_obj,
16421 : &level,
16422 : &in_obj)) {
16423 0 : return NULL;
16424 : }
16425 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
16426 0 : if (mem_ctx == NULL) {
16427 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
16428 0 : return NULL;
16429 : }
16430 0 : in = (union netr_DELTA_ID_UNION *)pytalloc_get_ptr(in_obj);
16431 0 : if (in == NULL) {
16432 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_DELTA_ID_UNION!");
16433 0 : return NULL;
16434 : }
16435 :
16436 0 : return py_import_netr_DELTA_ID_UNION(mem_ctx, level, in);
16437 : }
16438 :
16439 0 : static PyObject *py_netr_DELTA_ID_UNION_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16440 : {
16441 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
16442 0 : PyObject *mem_ctx_obj = NULL;
16443 0 : TALLOC_CTX *mem_ctx = NULL;
16444 0 : int level = 0;
16445 0 : PyObject *in = NULL;
16446 0 : union netr_DELTA_ID_UNION *out = NULL;
16447 :
16448 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
16449 : discard_const_p(char *, kwnames),
16450 : &mem_ctx_obj,
16451 : &level,
16452 : &in)) {
16453 0 : return NULL;
16454 : }
16455 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
16456 0 : if (mem_ctx == NULL) {
16457 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
16458 0 : return NULL;
16459 : }
16460 :
16461 0 : out = py_export_netr_DELTA_ID_UNION(mem_ctx, level, in);
16462 0 : if (out == NULL) {
16463 0 : return NULL;
16464 : }
16465 :
16466 0 : return pytalloc_GenericObject_reference(out);
16467 : }
16468 :
16469 : static PyMethodDef py_netr_DELTA_ID_UNION_methods[] = {
16470 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DELTA_ID_UNION_import),
16471 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
16472 : "T.__import__(mem_ctx, level, in) => ret." },
16473 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DELTA_ID_UNION_export),
16474 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
16475 : "T.__export__(mem_ctx, level, in) => ret." },
16476 : { NULL, NULL, 0, NULL }
16477 : };
16478 :
16479 0 : static PyObject *py_netr_DELTA_ID_UNION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16480 : {
16481 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
16482 0 : return NULL;
16483 : }
16484 :
16485 :
16486 : static PyTypeObject netr_DELTA_ID_UNION_Type = {
16487 : PyVarObject_HEAD_INIT(NULL, 0)
16488 : .tp_name = "netlogon.netr_DELTA_ID_UNION",
16489 : .tp_getset = NULL,
16490 : .tp_methods = py_netr_DELTA_ID_UNION_methods,
16491 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16492 : .tp_new = py_netr_DELTA_ID_UNION_new,
16493 : };
16494 :
16495 :
16496 0 : static PyObject *py_netr_DELTA_ENUM_get_delta_type(PyObject *obj, void *closure)
16497 : {
16498 0 : struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(obj);
16499 : PyObject *py_delta_type;
16500 0 : py_delta_type = PyLong_FromLong((uint16_t)object->delta_type);
16501 0 : return py_delta_type;
16502 : }
16503 :
16504 0 : static int py_netr_DELTA_ENUM_set_delta_type(PyObject *py_obj, PyObject *value, void *closure)
16505 : {
16506 0 : struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(py_obj);
16507 0 : if (value == NULL) {
16508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_type");
16509 0 : return -1;
16510 : }
16511 : {
16512 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->delta_type));
16513 0 : if (PyLong_Check(value)) {
16514 : unsigned long long test_var;
16515 0 : test_var = PyLong_AsUnsignedLongLong(value);
16516 0 : if (PyErr_Occurred() != NULL) {
16517 0 : return -1;
16518 : }
16519 0 : if (test_var > uint_max) {
16520 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16521 : PyLong_Type.tp_name, uint_max, test_var);
16522 0 : return -1;
16523 : }
16524 0 : object->delta_type = test_var;
16525 : } else {
16526 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16527 : PyLong_Type.tp_name);
16528 0 : return -1;
16529 : }
16530 : }
16531 0 : return 0;
16532 : }
16533 :
16534 0 : static PyObject *py_netr_DELTA_ENUM_get_delta_id_union(PyObject *obj, void *closure)
16535 : {
16536 0 : struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(obj);
16537 : PyObject *py_delta_id_union;
16538 0 : py_delta_id_union = pyrpc_import_union(&netr_DELTA_ID_UNION_Type, pytalloc_get_mem_ctx(obj), object->delta_type, &object->delta_id_union, "union netr_DELTA_ID_UNION");
16539 0 : if (py_delta_id_union == NULL) {
16540 0 : return NULL;
16541 : }
16542 0 : return py_delta_id_union;
16543 : }
16544 :
16545 0 : static int py_netr_DELTA_ENUM_set_delta_id_union(PyObject *py_obj, PyObject *value, void *closure)
16546 : {
16547 0 : struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(py_obj);
16548 0 : if (value == NULL) {
16549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_id_union");
16550 0 : return -1;
16551 : }
16552 : {
16553 : union netr_DELTA_ID_UNION *delta_id_union_switch_0;
16554 0 : delta_id_union_switch_0 = (union netr_DELTA_ID_UNION *)pyrpc_export_union(&netr_DELTA_ID_UNION_Type, pytalloc_get_mem_ctx(py_obj), object->delta_type, value, "union netr_DELTA_ID_UNION");
16555 0 : if (delta_id_union_switch_0 == NULL) {
16556 0 : return -1;
16557 : }
16558 0 : object->delta_id_union = *delta_id_union_switch_0;
16559 : }
16560 0 : return 0;
16561 : }
16562 :
16563 0 : static PyObject *py_netr_DELTA_ENUM_get_delta_union(PyObject *obj, void *closure)
16564 : {
16565 0 : struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(obj);
16566 : PyObject *py_delta_union;
16567 0 : py_delta_union = pyrpc_import_union(&netr_DELTA_UNION_Type, pytalloc_get_mem_ctx(obj), object->delta_type, &object->delta_union, "union netr_DELTA_UNION");
16568 0 : if (py_delta_union == NULL) {
16569 0 : return NULL;
16570 : }
16571 0 : return py_delta_union;
16572 : }
16573 :
16574 0 : static int py_netr_DELTA_ENUM_set_delta_union(PyObject *py_obj, PyObject *value, void *closure)
16575 : {
16576 0 : struct netr_DELTA_ENUM *object = (struct netr_DELTA_ENUM *)pytalloc_get_ptr(py_obj);
16577 0 : if (value == NULL) {
16578 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_union");
16579 0 : return -1;
16580 : }
16581 : {
16582 : union netr_DELTA_UNION *delta_union_switch_0;
16583 0 : delta_union_switch_0 = (union netr_DELTA_UNION *)pyrpc_export_union(&netr_DELTA_UNION_Type, pytalloc_get_mem_ctx(py_obj), object->delta_type, value, "union netr_DELTA_UNION");
16584 0 : if (delta_union_switch_0 == NULL) {
16585 0 : return -1;
16586 : }
16587 0 : object->delta_union = *delta_union_switch_0;
16588 : }
16589 0 : return 0;
16590 : }
16591 :
16592 : static PyGetSetDef py_netr_DELTA_ENUM_getsetters[] = {
16593 : {
16594 : .name = discard_const_p(char, "delta_type"),
16595 : .get = py_netr_DELTA_ENUM_get_delta_type,
16596 : .set = py_netr_DELTA_ENUM_set_delta_type,
16597 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DeltaEnum")
16598 : },
16599 : {
16600 : .name = discard_const_p(char, "delta_id_union"),
16601 : .get = py_netr_DELTA_ENUM_get_delta_id_union,
16602 : .set = py_netr_DELTA_ENUM_set_delta_id_union,
16603 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ID_UNION")
16604 : },
16605 : {
16606 : .name = discard_const_p(char, "delta_union"),
16607 : .get = py_netr_DELTA_ENUM_get_delta_union,
16608 : .set = py_netr_DELTA_ENUM_set_delta_union,
16609 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_UNION")
16610 : },
16611 : { .name = NULL }
16612 : };
16613 :
16614 0 : static PyObject *py_netr_DELTA_ENUM_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16615 : {
16616 0 : return pytalloc_new(struct netr_DELTA_ENUM, type);
16617 : }
16618 :
16619 :
16620 : static PyTypeObject netr_DELTA_ENUM_Type = {
16621 : PyVarObject_HEAD_INIT(NULL, 0)
16622 : .tp_name = "netlogon.netr_DELTA_ENUM",
16623 : .tp_getset = py_netr_DELTA_ENUM_getsetters,
16624 : .tp_methods = NULL,
16625 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16626 : .tp_new = py_netr_DELTA_ENUM_new,
16627 : };
16628 :
16629 :
16630 0 : static PyObject *py_netr_DELTA_ENUM_ARRAY_get_num_deltas(PyObject *obj, void *closure)
16631 : {
16632 0 : struct netr_DELTA_ENUM_ARRAY *object = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(obj);
16633 : PyObject *py_num_deltas;
16634 0 : py_num_deltas = PyLong_FromUnsignedLongLong((uint32_t)object->num_deltas);
16635 0 : return py_num_deltas;
16636 : }
16637 :
16638 0 : static int py_netr_DELTA_ENUM_ARRAY_set_num_deltas(PyObject *py_obj, PyObject *value, void *closure)
16639 : {
16640 0 : struct netr_DELTA_ENUM_ARRAY *object = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(py_obj);
16641 0 : if (value == NULL) {
16642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_deltas");
16643 0 : return -1;
16644 : }
16645 : {
16646 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_deltas));
16647 0 : if (PyLong_Check(value)) {
16648 : unsigned long long test_var;
16649 0 : test_var = PyLong_AsUnsignedLongLong(value);
16650 0 : if (PyErr_Occurred() != NULL) {
16651 0 : return -1;
16652 : }
16653 0 : if (test_var > uint_max) {
16654 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16655 : PyLong_Type.tp_name, uint_max, test_var);
16656 0 : return -1;
16657 : }
16658 0 : object->num_deltas = test_var;
16659 : } else {
16660 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16661 : PyLong_Type.tp_name);
16662 0 : return -1;
16663 : }
16664 : }
16665 0 : return 0;
16666 : }
16667 :
16668 0 : static PyObject *py_netr_DELTA_ENUM_ARRAY_get_delta_enum(PyObject *obj, void *closure)
16669 : {
16670 0 : struct netr_DELTA_ENUM_ARRAY *object = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(obj);
16671 : PyObject *py_delta_enum;
16672 0 : if (object->delta_enum == NULL) {
16673 0 : Py_RETURN_NONE;
16674 : }
16675 0 : if (object->delta_enum == NULL) {
16676 0 : py_delta_enum = Py_None;
16677 0 : Py_INCREF(py_delta_enum);
16678 : } else {
16679 0 : py_delta_enum = PyList_New(object->num_deltas);
16680 0 : if (py_delta_enum == NULL) {
16681 0 : return NULL;
16682 : }
16683 : {
16684 : int delta_enum_cntr_1;
16685 0 : for (delta_enum_cntr_1 = 0; delta_enum_cntr_1 < (object->num_deltas); delta_enum_cntr_1++) {
16686 : PyObject *py_delta_enum_1;
16687 0 : py_delta_enum_1 = pytalloc_reference_ex(&netr_DELTA_ENUM_Type, object->delta_enum, &object->delta_enum[delta_enum_cntr_1]);
16688 0 : PyList_SetItem(py_delta_enum, delta_enum_cntr_1, py_delta_enum_1);
16689 : }
16690 : }
16691 : }
16692 0 : return py_delta_enum;
16693 : }
16694 :
16695 0 : static int py_netr_DELTA_ENUM_ARRAY_set_delta_enum(PyObject *py_obj, PyObject *value, void *closure)
16696 : {
16697 0 : struct netr_DELTA_ENUM_ARRAY *object = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(py_obj);
16698 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->delta_enum));
16699 0 : if (value == NULL) {
16700 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_enum");
16701 0 : return -1;
16702 : }
16703 0 : if (value == Py_None) {
16704 0 : object->delta_enum = NULL;
16705 : } else {
16706 0 : object->delta_enum = NULL;
16707 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
16708 : {
16709 : int delta_enum_cntr_1;
16710 0 : object->delta_enum = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->delta_enum, PyList_GET_SIZE(value));
16711 0 : if (!object->delta_enum) { return -1;; }
16712 0 : talloc_set_name_const(object->delta_enum, "ARRAY: object->delta_enum");
16713 0 : for (delta_enum_cntr_1 = 0; delta_enum_cntr_1 < PyList_GET_SIZE(value); delta_enum_cntr_1++) {
16714 0 : if (PyList_GET_ITEM(value, delta_enum_cntr_1) == NULL) {
16715 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_enum[delta_enum_cntr_1]");
16716 0 : return -1;
16717 : }
16718 0 : PY_CHECK_TYPE(&netr_DELTA_ENUM_Type, PyList_GET_ITEM(value, delta_enum_cntr_1), return -1;);
16719 0 : if (talloc_reference(object->delta_enum, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, delta_enum_cntr_1))) == NULL) {
16720 0 : PyErr_NoMemory();
16721 0 : return -1;
16722 : }
16723 0 : object->delta_enum[delta_enum_cntr_1] = *(struct netr_DELTA_ENUM *)pytalloc_get_ptr(PyList_GET_ITEM(value, delta_enum_cntr_1));
16724 : }
16725 : }
16726 : }
16727 0 : return 0;
16728 : }
16729 :
16730 : static PyGetSetDef py_netr_DELTA_ENUM_ARRAY_getsetters[] = {
16731 : {
16732 : .name = discard_const_p(char, "num_deltas"),
16733 : .get = py_netr_DELTA_ENUM_ARRAY_get_num_deltas,
16734 : .set = py_netr_DELTA_ENUM_ARRAY_set_num_deltas,
16735 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16736 : },
16737 : {
16738 : .name = discard_const_p(char, "delta_enum"),
16739 : .get = py_netr_DELTA_ENUM_ARRAY_get_delta_enum,
16740 : .set = py_netr_DELTA_ENUM_ARRAY_set_delta_enum,
16741 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM")
16742 : },
16743 : { .name = NULL }
16744 : };
16745 :
16746 0 : static PyObject *py_netr_DELTA_ENUM_ARRAY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16747 : {
16748 0 : return pytalloc_new(struct netr_DELTA_ENUM_ARRAY, type);
16749 : }
16750 :
16751 :
16752 : static PyTypeObject netr_DELTA_ENUM_ARRAY_Type = {
16753 : PyVarObject_HEAD_INIT(NULL, 0)
16754 : .tp_name = "netlogon.netr_DELTA_ENUM_ARRAY",
16755 : .tp_getset = py_netr_DELTA_ENUM_ARRAY_getsetters,
16756 : .tp_methods = NULL,
16757 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16758 : .tp_new = py_netr_DELTA_ENUM_ARRAY_new,
16759 : };
16760 :
16761 :
16762 0 : static PyObject *py_netr_UAS_INFO_0_get_computer_name(PyObject *obj, void *closure)
16763 : {
16764 0 : struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(obj);
16765 : PyObject *py_computer_name;
16766 0 : py_computer_name = PyList_New(16);
16767 0 : if (py_computer_name == NULL) {
16768 0 : return NULL;
16769 : }
16770 : {
16771 : int computer_name_cntr_0;
16772 0 : for (computer_name_cntr_0 = 0; computer_name_cntr_0 < (16); computer_name_cntr_0++) {
16773 : PyObject *py_computer_name_0;
16774 0 : py_computer_name_0 = PyLong_FromLong((uint16_t)object->computer_name[computer_name_cntr_0]);
16775 0 : PyList_SetItem(py_computer_name, computer_name_cntr_0, py_computer_name_0);
16776 : }
16777 : }
16778 0 : return py_computer_name;
16779 : }
16780 :
16781 0 : static int py_netr_UAS_INFO_0_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
16782 : {
16783 0 : struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_obj);
16784 0 : if (value == NULL) {
16785 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name");
16786 0 : return -1;
16787 : }
16788 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
16789 : {
16790 : int computer_name_cntr_0;
16791 0 : if (ARRAY_SIZE(object->computer_name) != PyList_GET_SIZE(value)) {
16792 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->computer_name), PyList_GET_SIZE(value));
16793 0 : return -1;
16794 : }
16795 0 : for (computer_name_cntr_0 = 0; computer_name_cntr_0 < PyList_GET_SIZE(value); computer_name_cntr_0++) {
16796 0 : if (PyList_GET_ITEM(value, computer_name_cntr_0) == NULL) {
16797 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->computer_name[computer_name_cntr_0]");
16798 0 : return -1;
16799 : }
16800 : {
16801 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->computer_name[computer_name_cntr_0]));
16802 0 : if (PyLong_Check(PyList_GET_ITEM(value, computer_name_cntr_0))) {
16803 : unsigned long long test_var;
16804 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, computer_name_cntr_0));
16805 0 : if (PyErr_Occurred() != NULL) {
16806 0 : return -1;
16807 : }
16808 0 : if (test_var > uint_max) {
16809 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16810 : PyLong_Type.tp_name, uint_max, test_var);
16811 0 : return -1;
16812 : }
16813 0 : object->computer_name[computer_name_cntr_0] = test_var;
16814 : } else {
16815 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16816 : PyLong_Type.tp_name);
16817 0 : return -1;
16818 : }
16819 : }
16820 : }
16821 : }
16822 0 : return 0;
16823 : }
16824 :
16825 0 : static PyObject *py_netr_UAS_INFO_0_get_timecreated(PyObject *obj, void *closure)
16826 : {
16827 0 : struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(obj);
16828 : PyObject *py_timecreated;
16829 0 : py_timecreated = PyLong_FromUnsignedLongLong((uint32_t)object->timecreated);
16830 0 : return py_timecreated;
16831 : }
16832 :
16833 0 : static int py_netr_UAS_INFO_0_set_timecreated(PyObject *py_obj, PyObject *value, void *closure)
16834 : {
16835 0 : struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_obj);
16836 0 : if (value == NULL) {
16837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timecreated");
16838 0 : return -1;
16839 : }
16840 : {
16841 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->timecreated));
16842 0 : if (PyLong_Check(value)) {
16843 : unsigned long long test_var;
16844 0 : test_var = PyLong_AsUnsignedLongLong(value);
16845 0 : if (PyErr_Occurred() != NULL) {
16846 0 : return -1;
16847 : }
16848 0 : if (test_var > uint_max) {
16849 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16850 : PyLong_Type.tp_name, uint_max, test_var);
16851 0 : return -1;
16852 : }
16853 0 : object->timecreated = test_var;
16854 : } else {
16855 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16856 : PyLong_Type.tp_name);
16857 0 : return -1;
16858 : }
16859 : }
16860 0 : return 0;
16861 : }
16862 :
16863 0 : static PyObject *py_netr_UAS_INFO_0_get_serial_number(PyObject *obj, void *closure)
16864 : {
16865 0 : struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(obj);
16866 : PyObject *py_serial_number;
16867 0 : py_serial_number = PyLong_FromUnsignedLongLong((uint32_t)object->serial_number);
16868 0 : return py_serial_number;
16869 : }
16870 :
16871 0 : static int py_netr_UAS_INFO_0_set_serial_number(PyObject *py_obj, PyObject *value, void *closure)
16872 : {
16873 0 : struct netr_UAS_INFO_0 *object = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_obj);
16874 0 : if (value == NULL) {
16875 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial_number");
16876 0 : return -1;
16877 : }
16878 : {
16879 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_number));
16880 0 : if (PyLong_Check(value)) {
16881 : unsigned long long test_var;
16882 0 : test_var = PyLong_AsUnsignedLongLong(value);
16883 0 : if (PyErr_Occurred() != NULL) {
16884 0 : return -1;
16885 : }
16886 0 : if (test_var > uint_max) {
16887 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16888 : PyLong_Type.tp_name, uint_max, test_var);
16889 0 : return -1;
16890 : }
16891 0 : object->serial_number = test_var;
16892 : } else {
16893 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16894 : PyLong_Type.tp_name);
16895 0 : return -1;
16896 : }
16897 : }
16898 0 : return 0;
16899 : }
16900 :
16901 : static PyGetSetDef py_netr_UAS_INFO_0_getsetters[] = {
16902 : {
16903 : .name = discard_const_p(char, "computer_name"),
16904 : .get = py_netr_UAS_INFO_0_get_computer_name,
16905 : .set = py_netr_UAS_INFO_0_set_computer_name,
16906 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
16907 : },
16908 : {
16909 : .name = discard_const_p(char, "timecreated"),
16910 : .get = py_netr_UAS_INFO_0_get_timecreated,
16911 : .set = py_netr_UAS_INFO_0_set_timecreated,
16912 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16913 : },
16914 : {
16915 : .name = discard_const_p(char, "serial_number"),
16916 : .get = py_netr_UAS_INFO_0_get_serial_number,
16917 : .set = py_netr_UAS_INFO_0_set_serial_number,
16918 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16919 : },
16920 : { .name = NULL }
16921 : };
16922 :
16923 0 : static PyObject *py_netr_UAS_INFO_0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16924 : {
16925 0 : return pytalloc_new(struct netr_UAS_INFO_0, type);
16926 : }
16927 :
16928 :
16929 : static PyTypeObject netr_UAS_INFO_0_Type = {
16930 : PyVarObject_HEAD_INIT(NULL, 0)
16931 : .tp_name = "netlogon.netr_UAS_INFO_0",
16932 : .tp_getset = py_netr_UAS_INFO_0_getsetters,
16933 : .tp_methods = NULL,
16934 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16935 : .tp_new = py_netr_UAS_INFO_0_new,
16936 : };
16937 :
16938 :
16939 0 : static PyObject *py_netr_AccountBuffer_get_blob(PyObject *obj, void *closure)
16940 : {
16941 0 : struct netr_AccountBuffer *object = (struct netr_AccountBuffer *)pytalloc_get_ptr(obj);
16942 : PyObject *py_blob;
16943 0 : py_blob = PyBytes_FromStringAndSize((char *)(object->blob).data, (object->blob).length);
16944 0 : return py_blob;
16945 : }
16946 :
16947 0 : static int py_netr_AccountBuffer_set_blob(PyObject *py_obj, PyObject *value, void *closure)
16948 : {
16949 0 : struct netr_AccountBuffer *object = (struct netr_AccountBuffer *)pytalloc_get_ptr(py_obj);
16950 0 : if (value == NULL) {
16951 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->blob");
16952 0 : return -1;
16953 : }
16954 0 : object->blob = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
16955 0 : return 0;
16956 : }
16957 :
16958 : static PyGetSetDef py_netr_AccountBuffer_getsetters[] = {
16959 : {
16960 : .name = discard_const_p(char, "blob"),
16961 : .get = py_netr_AccountBuffer_get_blob,
16962 : .set = py_netr_AccountBuffer_set_blob,
16963 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
16964 : },
16965 : { .name = NULL }
16966 : };
16967 :
16968 0 : static PyObject *py_netr_AccountBuffer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16969 : {
16970 0 : return pytalloc_new(struct netr_AccountBuffer, type);
16971 : }
16972 :
16973 :
16974 : static PyTypeObject netr_AccountBuffer_Type = {
16975 : PyVarObject_HEAD_INIT(NULL, 0)
16976 : .tp_name = "netlogon.netr_AccountBuffer",
16977 : .tp_getset = py_netr_AccountBuffer_getsetters,
16978 : .tp_methods = NULL,
16979 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16980 : .tp_new = py_netr_AccountBuffer_new,
16981 : };
16982 :
16983 :
16984 0 : static PyObject *py_netr_NETLOGON_INFO_1_get_flags(PyObject *obj, void *closure)
16985 : {
16986 0 : struct netr_NETLOGON_INFO_1 *object = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(obj);
16987 : PyObject *py_flags;
16988 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
16989 0 : return py_flags;
16990 : }
16991 :
16992 0 : static int py_netr_NETLOGON_INFO_1_set_flags(PyObject *py_obj, PyObject *value, void *closure)
16993 : {
16994 0 : struct netr_NETLOGON_INFO_1 *object = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(py_obj);
16995 0 : if (value == NULL) {
16996 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
16997 0 : return -1;
16998 : }
16999 : {
17000 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
17001 0 : if (PyLong_Check(value)) {
17002 : unsigned long long test_var;
17003 0 : test_var = PyLong_AsUnsignedLongLong(value);
17004 0 : if (PyErr_Occurred() != NULL) {
17005 0 : return -1;
17006 : }
17007 0 : if (test_var > uint_max) {
17008 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17009 : PyLong_Type.tp_name, uint_max, test_var);
17010 0 : return -1;
17011 : }
17012 0 : object->flags = test_var;
17013 : } else {
17014 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17015 : PyLong_Type.tp_name);
17016 0 : return -1;
17017 : }
17018 : }
17019 0 : return 0;
17020 : }
17021 :
17022 0 : static PyObject *py_netr_NETLOGON_INFO_1_get_pdc_connection_status(PyObject *obj, void *closure)
17023 : {
17024 0 : struct netr_NETLOGON_INFO_1 *object = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(obj);
17025 : PyObject *py_pdc_connection_status;
17026 0 : py_pdc_connection_status = PyErr_FromWERROR(object->pdc_connection_status);
17027 0 : return py_pdc_connection_status;
17028 : }
17029 :
17030 0 : static int py_netr_NETLOGON_INFO_1_set_pdc_connection_status(PyObject *py_obj, PyObject *value, void *closure)
17031 : {
17032 0 : struct netr_NETLOGON_INFO_1 *object = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(py_obj);
17033 0 : if (value == NULL) {
17034 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_connection_status");
17035 0 : return -1;
17036 : }
17037 0 : object->pdc_connection_status = W_ERROR(PyLong_AsLong(value));
17038 0 : return 0;
17039 : }
17040 :
17041 : static PyGetSetDef py_netr_NETLOGON_INFO_1_getsetters[] = {
17042 : {
17043 : .name = discard_const_p(char, "flags"),
17044 : .get = py_netr_NETLOGON_INFO_1_get_flags,
17045 : .set = py_netr_NETLOGON_INFO_1_set_flags,
17046 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_InfoFlags")
17047 : },
17048 : {
17049 : .name = discard_const_p(char, "pdc_connection_status"),
17050 : .get = py_netr_NETLOGON_INFO_1_get_pdc_connection_status,
17051 : .set = py_netr_NETLOGON_INFO_1_set_pdc_connection_status,
17052 : .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
17053 : },
17054 : { .name = NULL }
17055 : };
17056 :
17057 0 : static PyObject *py_netr_NETLOGON_INFO_1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17058 : {
17059 0 : return pytalloc_new(struct netr_NETLOGON_INFO_1, type);
17060 : }
17061 :
17062 :
17063 : static PyTypeObject netr_NETLOGON_INFO_1_Type = {
17064 : PyVarObject_HEAD_INIT(NULL, 0)
17065 : .tp_name = "netlogon.netr_NETLOGON_INFO_1",
17066 : .tp_getset = py_netr_NETLOGON_INFO_1_getsetters,
17067 : .tp_methods = NULL,
17068 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17069 : .tp_new = py_netr_NETLOGON_INFO_1_new,
17070 : };
17071 :
17072 :
17073 53 : static PyObject *py_netr_NETLOGON_INFO_2_get_flags(PyObject *obj, void *closure)
17074 : {
17075 53 : struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(obj);
17076 : PyObject *py_flags;
17077 53 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
17078 53 : return py_flags;
17079 : }
17080 :
17081 0 : static int py_netr_NETLOGON_INFO_2_set_flags(PyObject *py_obj, PyObject *value, void *closure)
17082 : {
17083 0 : struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(py_obj);
17084 0 : if (value == NULL) {
17085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
17086 0 : return -1;
17087 : }
17088 : {
17089 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
17090 0 : if (PyLong_Check(value)) {
17091 : unsigned long long test_var;
17092 0 : test_var = PyLong_AsUnsignedLongLong(value);
17093 0 : if (PyErr_Occurred() != NULL) {
17094 0 : return -1;
17095 : }
17096 0 : if (test_var > uint_max) {
17097 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17098 : PyLong_Type.tp_name, uint_max, test_var);
17099 0 : return -1;
17100 : }
17101 0 : object->flags = test_var;
17102 : } else {
17103 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17104 : PyLong_Type.tp_name);
17105 0 : return -1;
17106 : }
17107 : }
17108 0 : return 0;
17109 : }
17110 :
17111 106 : static PyObject *py_netr_NETLOGON_INFO_2_get_pdc_connection_status(PyObject *obj, void *closure)
17112 : {
17113 106 : struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(obj);
17114 : PyObject *py_pdc_connection_status;
17115 106 : py_pdc_connection_status = PyErr_FromWERROR(object->pdc_connection_status);
17116 106 : return py_pdc_connection_status;
17117 : }
17118 :
17119 0 : static int py_netr_NETLOGON_INFO_2_set_pdc_connection_status(PyObject *py_obj, PyObject *value, void *closure)
17120 : {
17121 0 : struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(py_obj);
17122 0 : if (value == NULL) {
17123 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pdc_connection_status");
17124 0 : return -1;
17125 : }
17126 0 : object->pdc_connection_status = W_ERROR(PyLong_AsLong(value));
17127 0 : return 0;
17128 : }
17129 :
17130 109 : static PyObject *py_netr_NETLOGON_INFO_2_get_trusted_dc_name(PyObject *obj, void *closure)
17131 : {
17132 109 : struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(obj);
17133 : PyObject *py_trusted_dc_name;
17134 109 : if (object->trusted_dc_name == NULL) {
17135 0 : Py_RETURN_NONE;
17136 : }
17137 109 : if (object->trusted_dc_name == NULL) {
17138 0 : py_trusted_dc_name = Py_None;
17139 0 : Py_INCREF(py_trusted_dc_name);
17140 : } else {
17141 109 : if (object->trusted_dc_name == NULL) {
17142 0 : py_trusted_dc_name = Py_None;
17143 0 : Py_INCREF(py_trusted_dc_name);
17144 : } else {
17145 109 : py_trusted_dc_name = PyUnicode_Decode(object->trusted_dc_name, strlen(object->trusted_dc_name), "utf-8", "ignore");
17146 : }
17147 : }
17148 109 : return py_trusted_dc_name;
17149 : }
17150 :
17151 0 : static int py_netr_NETLOGON_INFO_2_set_trusted_dc_name(PyObject *py_obj, PyObject *value, void *closure)
17152 : {
17153 0 : struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(py_obj);
17154 0 : if (value == NULL) {
17155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_dc_name");
17156 0 : return -1;
17157 : }
17158 0 : if (value == Py_None) {
17159 0 : object->trusted_dc_name = NULL;
17160 : } else {
17161 0 : object->trusted_dc_name = NULL;
17162 : {
17163 : const char *test_str;
17164 : const char *talloc_str;
17165 0 : PyObject *unicode = NULL;
17166 0 : if (PyUnicode_Check(value)) {
17167 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17168 0 : if (unicode == NULL) {
17169 0 : PyErr_NoMemory();
17170 0 : return -1;
17171 : }
17172 0 : test_str = PyBytes_AS_STRING(unicode);
17173 0 : } else if (PyBytes_Check(value)) {
17174 0 : test_str = PyBytes_AS_STRING(value);
17175 : } else {
17176 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17177 0 : return -1;
17178 : }
17179 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17180 0 : if (unicode != NULL) {
17181 0 : Py_DECREF(unicode);
17182 : }
17183 0 : if (talloc_str == NULL) {
17184 0 : PyErr_NoMemory();
17185 0 : return -1;
17186 : }
17187 0 : object->trusted_dc_name = talloc_str;
17188 : }
17189 : }
17190 0 : return 0;
17191 : }
17192 :
17193 162 : static PyObject *py_netr_NETLOGON_INFO_2_get_tc_connection_status(PyObject *obj, void *closure)
17194 : {
17195 162 : struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(obj);
17196 : PyObject *py_tc_connection_status;
17197 162 : py_tc_connection_status = PyErr_FromWERROR(object->tc_connection_status);
17198 162 : return py_tc_connection_status;
17199 : }
17200 :
17201 0 : static int py_netr_NETLOGON_INFO_2_set_tc_connection_status(PyObject *py_obj, PyObject *value, void *closure)
17202 : {
17203 0 : struct netr_NETLOGON_INFO_2 *object = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(py_obj);
17204 0 : if (value == NULL) {
17205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tc_connection_status");
17206 0 : return -1;
17207 : }
17208 0 : object->tc_connection_status = W_ERROR(PyLong_AsLong(value));
17209 0 : return 0;
17210 : }
17211 :
17212 : static PyGetSetDef py_netr_NETLOGON_INFO_2_getsetters[] = {
17213 : {
17214 : .name = discard_const_p(char, "flags"),
17215 : .get = py_netr_NETLOGON_INFO_2_get_flags,
17216 : .set = py_netr_NETLOGON_INFO_2_set_flags,
17217 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_InfoFlags")
17218 : },
17219 : {
17220 : .name = discard_const_p(char, "pdc_connection_status"),
17221 : .get = py_netr_NETLOGON_INFO_2_get_pdc_connection_status,
17222 : .set = py_netr_NETLOGON_INFO_2_set_pdc_connection_status,
17223 : .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
17224 : },
17225 : {
17226 : .name = discard_const_p(char, "trusted_dc_name"),
17227 : .get = py_netr_NETLOGON_INFO_2_get_trusted_dc_name,
17228 : .set = py_netr_NETLOGON_INFO_2_set_trusted_dc_name,
17229 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17230 : },
17231 : {
17232 : .name = discard_const_p(char, "tc_connection_status"),
17233 : .get = py_netr_NETLOGON_INFO_2_get_tc_connection_status,
17234 : .set = py_netr_NETLOGON_INFO_2_set_tc_connection_status,
17235 : .doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
17236 : },
17237 : { .name = NULL }
17238 : };
17239 :
17240 0 : static PyObject *py_netr_NETLOGON_INFO_2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17241 : {
17242 0 : return pytalloc_new(struct netr_NETLOGON_INFO_2, type);
17243 : }
17244 :
17245 :
17246 : static PyTypeObject netr_NETLOGON_INFO_2_Type = {
17247 : PyVarObject_HEAD_INIT(NULL, 0)
17248 : .tp_name = "netlogon.netr_NETLOGON_INFO_2",
17249 : .tp_getset = py_netr_NETLOGON_INFO_2_getsetters,
17250 : .tp_methods = NULL,
17251 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17252 : .tp_new = py_netr_NETLOGON_INFO_2_new,
17253 : };
17254 :
17255 :
17256 0 : static PyObject *py_netr_NETLOGON_INFO_3_get_flags(PyObject *obj, void *closure)
17257 : {
17258 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj);
17259 : PyObject *py_flags;
17260 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
17261 0 : return py_flags;
17262 : }
17263 :
17264 0 : static int py_netr_NETLOGON_INFO_3_set_flags(PyObject *py_obj, PyObject *value, void *closure)
17265 : {
17266 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj);
17267 0 : if (value == NULL) {
17268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
17269 0 : return -1;
17270 : }
17271 : {
17272 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
17273 0 : if (PyLong_Check(value)) {
17274 : unsigned long long test_var;
17275 0 : test_var = PyLong_AsUnsignedLongLong(value);
17276 0 : if (PyErr_Occurred() != NULL) {
17277 0 : return -1;
17278 : }
17279 0 : if (test_var > uint_max) {
17280 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17281 : PyLong_Type.tp_name, uint_max, test_var);
17282 0 : return -1;
17283 : }
17284 0 : object->flags = test_var;
17285 : } else {
17286 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17287 : PyLong_Type.tp_name);
17288 0 : return -1;
17289 : }
17290 : }
17291 0 : return 0;
17292 : }
17293 :
17294 0 : static PyObject *py_netr_NETLOGON_INFO_3_get_logon_attempts(PyObject *obj, void *closure)
17295 : {
17296 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj);
17297 : PyObject *py_logon_attempts;
17298 0 : py_logon_attempts = PyLong_FromUnsignedLongLong((uint32_t)object->logon_attempts);
17299 0 : return py_logon_attempts;
17300 : }
17301 :
17302 0 : static int py_netr_NETLOGON_INFO_3_set_logon_attempts(PyObject *py_obj, PyObject *value, void *closure)
17303 : {
17304 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj);
17305 0 : if (value == NULL) {
17306 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_attempts");
17307 0 : return -1;
17308 : }
17309 : {
17310 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_attempts));
17311 0 : if (PyLong_Check(value)) {
17312 : unsigned long long test_var;
17313 0 : test_var = PyLong_AsUnsignedLongLong(value);
17314 0 : if (PyErr_Occurred() != NULL) {
17315 0 : return -1;
17316 : }
17317 0 : if (test_var > uint_max) {
17318 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17319 : PyLong_Type.tp_name, uint_max, test_var);
17320 0 : return -1;
17321 : }
17322 0 : object->logon_attempts = test_var;
17323 : } else {
17324 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17325 : PyLong_Type.tp_name);
17326 0 : return -1;
17327 : }
17328 : }
17329 0 : return 0;
17330 : }
17331 :
17332 0 : static PyObject *py_netr_NETLOGON_INFO_3_get_unknown1(PyObject *obj, void *closure)
17333 : {
17334 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj);
17335 : PyObject *py_unknown1;
17336 0 : py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown1);
17337 0 : return py_unknown1;
17338 : }
17339 :
17340 0 : static int py_netr_NETLOGON_INFO_3_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
17341 : {
17342 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj);
17343 0 : if (value == NULL) {
17344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown1");
17345 0 : return -1;
17346 : }
17347 : {
17348 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown1));
17349 0 : if (PyLong_Check(value)) {
17350 : unsigned long long test_var;
17351 0 : test_var = PyLong_AsUnsignedLongLong(value);
17352 0 : if (PyErr_Occurred() != NULL) {
17353 0 : return -1;
17354 : }
17355 0 : if (test_var > uint_max) {
17356 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17357 : PyLong_Type.tp_name, uint_max, test_var);
17358 0 : return -1;
17359 : }
17360 0 : object->unknown1 = test_var;
17361 : } else {
17362 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17363 : PyLong_Type.tp_name);
17364 0 : return -1;
17365 : }
17366 : }
17367 0 : return 0;
17368 : }
17369 :
17370 0 : static PyObject *py_netr_NETLOGON_INFO_3_get_unknown2(PyObject *obj, void *closure)
17371 : {
17372 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj);
17373 : PyObject *py_unknown2;
17374 0 : py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown2);
17375 0 : return py_unknown2;
17376 : }
17377 :
17378 0 : static int py_netr_NETLOGON_INFO_3_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
17379 : {
17380 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj);
17381 0 : if (value == NULL) {
17382 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown2");
17383 0 : return -1;
17384 : }
17385 : {
17386 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown2));
17387 0 : if (PyLong_Check(value)) {
17388 : unsigned long long test_var;
17389 0 : test_var = PyLong_AsUnsignedLongLong(value);
17390 0 : if (PyErr_Occurred() != NULL) {
17391 0 : return -1;
17392 : }
17393 0 : if (test_var > uint_max) {
17394 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17395 : PyLong_Type.tp_name, uint_max, test_var);
17396 0 : return -1;
17397 : }
17398 0 : object->unknown2 = test_var;
17399 : } else {
17400 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17401 : PyLong_Type.tp_name);
17402 0 : return -1;
17403 : }
17404 : }
17405 0 : return 0;
17406 : }
17407 :
17408 0 : static PyObject *py_netr_NETLOGON_INFO_3_get_unknown3(PyObject *obj, void *closure)
17409 : {
17410 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj);
17411 : PyObject *py_unknown3;
17412 0 : py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3);
17413 0 : return py_unknown3;
17414 : }
17415 :
17416 0 : static int py_netr_NETLOGON_INFO_3_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
17417 : {
17418 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj);
17419 0 : if (value == NULL) {
17420 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
17421 0 : return -1;
17422 : }
17423 : {
17424 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3));
17425 0 : if (PyLong_Check(value)) {
17426 : unsigned long long test_var;
17427 0 : test_var = PyLong_AsUnsignedLongLong(value);
17428 0 : if (PyErr_Occurred() != NULL) {
17429 0 : return -1;
17430 : }
17431 0 : if (test_var > uint_max) {
17432 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17433 : PyLong_Type.tp_name, uint_max, test_var);
17434 0 : return -1;
17435 : }
17436 0 : object->unknown3 = test_var;
17437 : } else {
17438 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17439 : PyLong_Type.tp_name);
17440 0 : return -1;
17441 : }
17442 : }
17443 0 : return 0;
17444 : }
17445 :
17446 0 : static PyObject *py_netr_NETLOGON_INFO_3_get_unknown4(PyObject *obj, void *closure)
17447 : {
17448 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj);
17449 : PyObject *py_unknown4;
17450 0 : py_unknown4 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown4);
17451 0 : return py_unknown4;
17452 : }
17453 :
17454 0 : static int py_netr_NETLOGON_INFO_3_set_unknown4(PyObject *py_obj, PyObject *value, void *closure)
17455 : {
17456 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj);
17457 0 : if (value == NULL) {
17458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown4");
17459 0 : return -1;
17460 : }
17461 : {
17462 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown4));
17463 0 : if (PyLong_Check(value)) {
17464 : unsigned long long test_var;
17465 0 : test_var = PyLong_AsUnsignedLongLong(value);
17466 0 : if (PyErr_Occurred() != NULL) {
17467 0 : return -1;
17468 : }
17469 0 : if (test_var > uint_max) {
17470 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17471 : PyLong_Type.tp_name, uint_max, test_var);
17472 0 : return -1;
17473 : }
17474 0 : object->unknown4 = test_var;
17475 : } else {
17476 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17477 : PyLong_Type.tp_name);
17478 0 : return -1;
17479 : }
17480 : }
17481 0 : return 0;
17482 : }
17483 :
17484 0 : static PyObject *py_netr_NETLOGON_INFO_3_get_unknown5(PyObject *obj, void *closure)
17485 : {
17486 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(obj);
17487 : PyObject *py_unknown5;
17488 0 : py_unknown5 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown5);
17489 0 : return py_unknown5;
17490 : }
17491 :
17492 0 : static int py_netr_NETLOGON_INFO_3_set_unknown5(PyObject *py_obj, PyObject *value, void *closure)
17493 : {
17494 0 : struct netr_NETLOGON_INFO_3 *object = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(py_obj);
17495 0 : if (value == NULL) {
17496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown5");
17497 0 : return -1;
17498 : }
17499 : {
17500 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown5));
17501 0 : if (PyLong_Check(value)) {
17502 : unsigned long long test_var;
17503 0 : test_var = PyLong_AsUnsignedLongLong(value);
17504 0 : if (PyErr_Occurred() != NULL) {
17505 0 : return -1;
17506 : }
17507 0 : if (test_var > uint_max) {
17508 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17509 : PyLong_Type.tp_name, uint_max, test_var);
17510 0 : return -1;
17511 : }
17512 0 : object->unknown5 = test_var;
17513 : } else {
17514 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17515 : PyLong_Type.tp_name);
17516 0 : return -1;
17517 : }
17518 : }
17519 0 : return 0;
17520 : }
17521 :
17522 : static PyGetSetDef py_netr_NETLOGON_INFO_3_getsetters[] = {
17523 : {
17524 : .name = discard_const_p(char, "flags"),
17525 : .get = py_netr_NETLOGON_INFO_3_get_flags,
17526 : .set = py_netr_NETLOGON_INFO_3_set_flags,
17527 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_InfoFlags")
17528 : },
17529 : {
17530 : .name = discard_const_p(char, "logon_attempts"),
17531 : .get = py_netr_NETLOGON_INFO_3_get_logon_attempts,
17532 : .set = py_netr_NETLOGON_INFO_3_set_logon_attempts,
17533 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17534 : },
17535 : {
17536 : .name = discard_const_p(char, "unknown1"),
17537 : .get = py_netr_NETLOGON_INFO_3_get_unknown1,
17538 : .set = py_netr_NETLOGON_INFO_3_set_unknown1,
17539 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17540 : },
17541 : {
17542 : .name = discard_const_p(char, "unknown2"),
17543 : .get = py_netr_NETLOGON_INFO_3_get_unknown2,
17544 : .set = py_netr_NETLOGON_INFO_3_set_unknown2,
17545 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17546 : },
17547 : {
17548 : .name = discard_const_p(char, "unknown3"),
17549 : .get = py_netr_NETLOGON_INFO_3_get_unknown3,
17550 : .set = py_netr_NETLOGON_INFO_3_set_unknown3,
17551 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17552 : },
17553 : {
17554 : .name = discard_const_p(char, "unknown4"),
17555 : .get = py_netr_NETLOGON_INFO_3_get_unknown4,
17556 : .set = py_netr_NETLOGON_INFO_3_set_unknown4,
17557 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17558 : },
17559 : {
17560 : .name = discard_const_p(char, "unknown5"),
17561 : .get = py_netr_NETLOGON_INFO_3_get_unknown5,
17562 : .set = py_netr_NETLOGON_INFO_3_set_unknown5,
17563 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17564 : },
17565 : { .name = NULL }
17566 : };
17567 :
17568 0 : static PyObject *py_netr_NETLOGON_INFO_3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17569 : {
17570 0 : return pytalloc_new(struct netr_NETLOGON_INFO_3, type);
17571 : }
17572 :
17573 :
17574 : static PyTypeObject netr_NETLOGON_INFO_3_Type = {
17575 : PyVarObject_HEAD_INIT(NULL, 0)
17576 : .tp_name = "netlogon.netr_NETLOGON_INFO_3",
17577 : .tp_getset = py_netr_NETLOGON_INFO_3_getsetters,
17578 : .tp_methods = NULL,
17579 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17580 : .tp_new = py_netr_NETLOGON_INFO_3_new,
17581 : };
17582 :
17583 :
17584 0 : static PyObject *py_netr_NETLOGON_INFO_4_get_trusted_dc_name(PyObject *obj, void *closure)
17585 : {
17586 0 : struct netr_NETLOGON_INFO_4 *object = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(obj);
17587 : PyObject *py_trusted_dc_name;
17588 0 : if (object->trusted_dc_name == NULL) {
17589 0 : Py_RETURN_NONE;
17590 : }
17591 0 : if (object->trusted_dc_name == NULL) {
17592 0 : py_trusted_dc_name = Py_None;
17593 0 : Py_INCREF(py_trusted_dc_name);
17594 : } else {
17595 0 : if (object->trusted_dc_name == NULL) {
17596 0 : py_trusted_dc_name = Py_None;
17597 0 : Py_INCREF(py_trusted_dc_name);
17598 : } else {
17599 0 : py_trusted_dc_name = PyUnicode_Decode(object->trusted_dc_name, strlen(object->trusted_dc_name), "utf-8", "ignore");
17600 : }
17601 : }
17602 0 : return py_trusted_dc_name;
17603 : }
17604 :
17605 0 : static int py_netr_NETLOGON_INFO_4_set_trusted_dc_name(PyObject *py_obj, PyObject *value, void *closure)
17606 : {
17607 0 : struct netr_NETLOGON_INFO_4 *object = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(py_obj);
17608 0 : if (value == NULL) {
17609 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_dc_name");
17610 0 : return -1;
17611 : }
17612 0 : if (value == Py_None) {
17613 0 : object->trusted_dc_name = NULL;
17614 : } else {
17615 0 : object->trusted_dc_name = NULL;
17616 : {
17617 : const char *test_str;
17618 : const char *talloc_str;
17619 0 : PyObject *unicode = NULL;
17620 0 : if (PyUnicode_Check(value)) {
17621 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17622 0 : if (unicode == NULL) {
17623 0 : PyErr_NoMemory();
17624 0 : return -1;
17625 : }
17626 0 : test_str = PyBytes_AS_STRING(unicode);
17627 0 : } else if (PyBytes_Check(value)) {
17628 0 : test_str = PyBytes_AS_STRING(value);
17629 : } else {
17630 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17631 0 : return -1;
17632 : }
17633 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17634 0 : if (unicode != NULL) {
17635 0 : Py_DECREF(unicode);
17636 : }
17637 0 : if (talloc_str == NULL) {
17638 0 : PyErr_NoMemory();
17639 0 : return -1;
17640 : }
17641 0 : object->trusted_dc_name = talloc_str;
17642 : }
17643 : }
17644 0 : return 0;
17645 : }
17646 :
17647 0 : static PyObject *py_netr_NETLOGON_INFO_4_get_trusted_domain_name(PyObject *obj, void *closure)
17648 : {
17649 0 : struct netr_NETLOGON_INFO_4 *object = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(obj);
17650 : PyObject *py_trusted_domain_name;
17651 0 : if (object->trusted_domain_name == NULL) {
17652 0 : Py_RETURN_NONE;
17653 : }
17654 0 : if (object->trusted_domain_name == NULL) {
17655 0 : py_trusted_domain_name = Py_None;
17656 0 : Py_INCREF(py_trusted_domain_name);
17657 : } else {
17658 0 : if (object->trusted_domain_name == NULL) {
17659 0 : py_trusted_domain_name = Py_None;
17660 0 : Py_INCREF(py_trusted_domain_name);
17661 : } else {
17662 0 : py_trusted_domain_name = PyUnicode_Decode(object->trusted_domain_name, strlen(object->trusted_domain_name), "utf-8", "ignore");
17663 : }
17664 : }
17665 0 : return py_trusted_domain_name;
17666 : }
17667 :
17668 0 : static int py_netr_NETLOGON_INFO_4_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
17669 : {
17670 0 : struct netr_NETLOGON_INFO_4 *object = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(py_obj);
17671 0 : if (value == NULL) {
17672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_domain_name");
17673 0 : return -1;
17674 : }
17675 0 : if (value == Py_None) {
17676 0 : object->trusted_domain_name = NULL;
17677 : } else {
17678 0 : object->trusted_domain_name = NULL;
17679 : {
17680 : const char *test_str;
17681 : const char *talloc_str;
17682 0 : PyObject *unicode = NULL;
17683 0 : if (PyUnicode_Check(value)) {
17684 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17685 0 : if (unicode == NULL) {
17686 0 : PyErr_NoMemory();
17687 0 : return -1;
17688 : }
17689 0 : test_str = PyBytes_AS_STRING(unicode);
17690 0 : } else if (PyBytes_Check(value)) {
17691 0 : test_str = PyBytes_AS_STRING(value);
17692 : } else {
17693 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17694 0 : return -1;
17695 : }
17696 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17697 0 : if (unicode != NULL) {
17698 0 : Py_DECREF(unicode);
17699 : }
17700 0 : if (talloc_str == NULL) {
17701 0 : PyErr_NoMemory();
17702 0 : return -1;
17703 : }
17704 0 : object->trusted_domain_name = talloc_str;
17705 : }
17706 : }
17707 0 : return 0;
17708 : }
17709 :
17710 : static PyGetSetDef py_netr_NETLOGON_INFO_4_getsetters[] = {
17711 : {
17712 : .name = discard_const_p(char, "trusted_dc_name"),
17713 : .get = py_netr_NETLOGON_INFO_4_get_trusted_dc_name,
17714 : .set = py_netr_NETLOGON_INFO_4_set_trusted_dc_name,
17715 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17716 : },
17717 : {
17718 : .name = discard_const_p(char, "trusted_domain_name"),
17719 : .get = py_netr_NETLOGON_INFO_4_get_trusted_domain_name,
17720 : .set = py_netr_NETLOGON_INFO_4_set_trusted_domain_name,
17721 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
17722 : },
17723 : { .name = NULL }
17724 : };
17725 :
17726 0 : static PyObject *py_netr_NETLOGON_INFO_4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17727 : {
17728 0 : return pytalloc_new(struct netr_NETLOGON_INFO_4, type);
17729 : }
17730 :
17731 :
17732 : static PyTypeObject netr_NETLOGON_INFO_4_Type = {
17733 : PyVarObject_HEAD_INIT(NULL, 0)
17734 : .tp_name = "netlogon.netr_NETLOGON_INFO_4",
17735 : .tp_getset = py_netr_NETLOGON_INFO_4_getsetters,
17736 : .tp_methods = NULL,
17737 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17738 : .tp_new = py_netr_NETLOGON_INFO_4_new,
17739 : };
17740 :
17741 81 : static PyObject *py_import_netr_CONTROL_QUERY_INFORMATION(TALLOC_CTX *mem_ctx, int level, union netr_CONTROL_QUERY_INFORMATION *in)
17742 : {
17743 : PyObject *ret;
17744 :
17745 81 : switch (level) {
17746 0 : case 1:
17747 0 : if (in->info1 == NULL) {
17748 0 : ret = Py_None;
17749 0 : Py_INCREF(ret);
17750 : } else {
17751 0 : ret = pytalloc_reference_ex(&netr_NETLOGON_INFO_1_Type, in->info1, in->info1);
17752 : }
17753 0 : return ret;
17754 :
17755 81 : case 2:
17756 81 : if (in->info2 == NULL) {
17757 0 : ret = Py_None;
17758 0 : Py_INCREF(ret);
17759 : } else {
17760 81 : ret = pytalloc_reference_ex(&netr_NETLOGON_INFO_2_Type, in->info2, in->info2);
17761 : }
17762 81 : return ret;
17763 :
17764 0 : case 3:
17765 0 : if (in->info3 == NULL) {
17766 0 : ret = Py_None;
17767 0 : Py_INCREF(ret);
17768 : } else {
17769 0 : ret = pytalloc_reference_ex(&netr_NETLOGON_INFO_3_Type, in->info3, in->info3);
17770 : }
17771 0 : return ret;
17772 :
17773 0 : case 4:
17774 0 : if (in->info4 == NULL) {
17775 0 : ret = Py_None;
17776 0 : Py_INCREF(ret);
17777 : } else {
17778 0 : ret = pytalloc_reference_ex(&netr_NETLOGON_INFO_4_Type, in->info4, in->info4);
17779 : }
17780 0 : return ret;
17781 :
17782 0 : default:
17783 0 : ret = Py_None;
17784 0 : Py_INCREF(ret);
17785 0 : return ret;
17786 :
17787 : }
17788 : PyErr_SetString(PyExc_TypeError, "unknown union level");
17789 : return NULL;
17790 : }
17791 :
17792 0 : static union netr_CONTROL_QUERY_INFORMATION *py_export_netr_CONTROL_QUERY_INFORMATION(TALLOC_CTX *mem_ctx, int level, PyObject *in)
17793 : {
17794 0 : union netr_CONTROL_QUERY_INFORMATION *ret = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
17795 0 : switch (level) {
17796 0 : case 1:
17797 0 : if (in == NULL) {
17798 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
17799 0 : talloc_free(ret); return NULL;
17800 : }
17801 0 : if (in == Py_None) {
17802 0 : ret->info1 = NULL;
17803 : } else {
17804 0 : ret->info1 = NULL;
17805 0 : PY_CHECK_TYPE(&netr_NETLOGON_INFO_1_Type, in, talloc_free(ret); return NULL;);
17806 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
17807 0 : PyErr_NoMemory();
17808 0 : talloc_free(ret); return NULL;
17809 : }
17810 0 : ret->info1 = (struct netr_NETLOGON_INFO_1 *)pytalloc_get_ptr(in);
17811 : }
17812 0 : break;
17813 :
17814 0 : case 2:
17815 0 : if (in == NULL) {
17816 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info2");
17817 0 : talloc_free(ret); return NULL;
17818 : }
17819 0 : if (in == Py_None) {
17820 0 : ret->info2 = NULL;
17821 : } else {
17822 0 : ret->info2 = NULL;
17823 0 : PY_CHECK_TYPE(&netr_NETLOGON_INFO_2_Type, in, talloc_free(ret); return NULL;);
17824 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
17825 0 : PyErr_NoMemory();
17826 0 : talloc_free(ret); return NULL;
17827 : }
17828 0 : ret->info2 = (struct netr_NETLOGON_INFO_2 *)pytalloc_get_ptr(in);
17829 : }
17830 0 : break;
17831 :
17832 0 : case 3:
17833 0 : if (in == NULL) {
17834 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3");
17835 0 : talloc_free(ret); return NULL;
17836 : }
17837 0 : if (in == Py_None) {
17838 0 : ret->info3 = NULL;
17839 : } else {
17840 0 : ret->info3 = NULL;
17841 0 : PY_CHECK_TYPE(&netr_NETLOGON_INFO_3_Type, in, talloc_free(ret); return NULL;);
17842 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
17843 0 : PyErr_NoMemory();
17844 0 : talloc_free(ret); return NULL;
17845 : }
17846 0 : ret->info3 = (struct netr_NETLOGON_INFO_3 *)pytalloc_get_ptr(in);
17847 : }
17848 0 : break;
17849 :
17850 0 : case 4:
17851 0 : if (in == NULL) {
17852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info4");
17853 0 : talloc_free(ret); return NULL;
17854 : }
17855 0 : if (in == Py_None) {
17856 0 : ret->info4 = NULL;
17857 : } else {
17858 0 : ret->info4 = NULL;
17859 0 : PY_CHECK_TYPE(&netr_NETLOGON_INFO_4_Type, in, talloc_free(ret); return NULL;);
17860 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
17861 0 : PyErr_NoMemory();
17862 0 : talloc_free(ret); return NULL;
17863 : }
17864 0 : ret->info4 = (struct netr_NETLOGON_INFO_4 *)pytalloc_get_ptr(in);
17865 : }
17866 0 : break;
17867 :
17868 0 : default:
17869 0 : break;
17870 :
17871 : }
17872 :
17873 0 : return ret;
17874 : }
17875 :
17876 81 : static PyObject *py_netr_CONTROL_QUERY_INFORMATION_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17877 : {
17878 81 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
17879 81 : PyObject *mem_ctx_obj = NULL;
17880 81 : TALLOC_CTX *mem_ctx = NULL;
17881 81 : int level = 0;
17882 81 : PyObject *in_obj = NULL;
17883 81 : union netr_CONTROL_QUERY_INFORMATION *in = NULL;
17884 :
17885 81 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
17886 : discard_const_p(char *, kwnames),
17887 : &mem_ctx_obj,
17888 : &level,
17889 : &in_obj)) {
17890 0 : return NULL;
17891 : }
17892 81 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
17893 81 : if (mem_ctx == NULL) {
17894 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
17895 0 : return NULL;
17896 : }
17897 81 : in = (union netr_CONTROL_QUERY_INFORMATION *)pytalloc_get_ptr(in_obj);
17898 81 : if (in == NULL) {
17899 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_CONTROL_QUERY_INFORMATION!");
17900 0 : return NULL;
17901 : }
17902 :
17903 81 : return py_import_netr_CONTROL_QUERY_INFORMATION(mem_ctx, level, in);
17904 : }
17905 :
17906 0 : static PyObject *py_netr_CONTROL_QUERY_INFORMATION_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17907 : {
17908 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
17909 0 : PyObject *mem_ctx_obj = NULL;
17910 0 : TALLOC_CTX *mem_ctx = NULL;
17911 0 : int level = 0;
17912 0 : PyObject *in = NULL;
17913 0 : union netr_CONTROL_QUERY_INFORMATION *out = NULL;
17914 :
17915 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
17916 : discard_const_p(char *, kwnames),
17917 : &mem_ctx_obj,
17918 : &level,
17919 : &in)) {
17920 0 : return NULL;
17921 : }
17922 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
17923 0 : if (mem_ctx == NULL) {
17924 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
17925 0 : return NULL;
17926 : }
17927 :
17928 0 : out = py_export_netr_CONTROL_QUERY_INFORMATION(mem_ctx, level, in);
17929 0 : if (out == NULL) {
17930 0 : return NULL;
17931 : }
17932 :
17933 0 : return pytalloc_GenericObject_reference(out);
17934 : }
17935 :
17936 : static PyMethodDef py_netr_CONTROL_QUERY_INFORMATION_methods[] = {
17937 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_CONTROL_QUERY_INFORMATION_import),
17938 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
17939 : "T.__import__(mem_ctx, level, in) => ret." },
17940 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_CONTROL_QUERY_INFORMATION_export),
17941 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
17942 : "T.__export__(mem_ctx, level, in) => ret." },
17943 : { NULL, NULL, 0, NULL }
17944 : };
17945 :
17946 0 : static PyObject *py_netr_CONTROL_QUERY_INFORMATION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17947 : {
17948 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
17949 0 : return NULL;
17950 : }
17951 :
17952 :
17953 : static PyTypeObject netr_CONTROL_QUERY_INFORMATION_Type = {
17954 : PyVarObject_HEAD_INIT(NULL, 0)
17955 : .tp_name = "netlogon.netr_CONTROL_QUERY_INFORMATION",
17956 : .tp_getset = NULL,
17957 : .tp_methods = py_netr_CONTROL_QUERY_INFORMATION_methods,
17958 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17959 : .tp_new = py_netr_CONTROL_QUERY_INFORMATION_new,
17960 : };
17961 :
17962 0 : static PyObject *py_import_netr_CONTROL_DATA_INFORMATION(TALLOC_CTX *mem_ctx, int level, union netr_CONTROL_DATA_INFORMATION *in)
17963 : {
17964 : PyObject *ret;
17965 :
17966 0 : switch (level) {
17967 0 : case NETLOGON_CONTROL_REDISCOVER:
17968 0 : if (in->domain == NULL) {
17969 0 : ret = Py_None;
17970 0 : Py_INCREF(ret);
17971 : } else {
17972 0 : if (in->domain == NULL) {
17973 0 : ret = Py_None;
17974 0 : Py_INCREF(ret);
17975 : } else {
17976 0 : ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore");
17977 : }
17978 : }
17979 0 : return ret;
17980 :
17981 0 : case NETLOGON_CONTROL_TC_QUERY:
17982 0 : if (in->domain == NULL) {
17983 0 : ret = Py_None;
17984 0 : Py_INCREF(ret);
17985 : } else {
17986 0 : if (in->domain == NULL) {
17987 0 : ret = Py_None;
17988 0 : Py_INCREF(ret);
17989 : } else {
17990 0 : ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore");
17991 : }
17992 : }
17993 0 : return ret;
17994 :
17995 0 : case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
17996 0 : if (in->domain == NULL) {
17997 0 : ret = Py_None;
17998 0 : Py_INCREF(ret);
17999 : } else {
18000 0 : if (in->domain == NULL) {
18001 0 : ret = Py_None;
18002 0 : Py_INCREF(ret);
18003 : } else {
18004 0 : ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore");
18005 : }
18006 : }
18007 0 : return ret;
18008 :
18009 0 : case NETLOGON_CONTROL_CHANGE_PASSWORD:
18010 0 : if (in->domain == NULL) {
18011 0 : ret = Py_None;
18012 0 : Py_INCREF(ret);
18013 : } else {
18014 0 : if (in->domain == NULL) {
18015 0 : ret = Py_None;
18016 0 : Py_INCREF(ret);
18017 : } else {
18018 0 : ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore");
18019 : }
18020 : }
18021 0 : return ret;
18022 :
18023 0 : case NETLOGON_CONTROL_TC_VERIFY:
18024 0 : if (in->domain == NULL) {
18025 0 : ret = Py_None;
18026 0 : Py_INCREF(ret);
18027 : } else {
18028 0 : if (in->domain == NULL) {
18029 0 : ret = Py_None;
18030 0 : Py_INCREF(ret);
18031 : } else {
18032 0 : ret = PyUnicode_Decode(in->domain, strlen(in->domain), "utf-8", "ignore");
18033 : }
18034 : }
18035 0 : return ret;
18036 :
18037 0 : case NETLOGON_CONTROL_FIND_USER:
18038 0 : if (in->user == NULL) {
18039 0 : ret = Py_None;
18040 0 : Py_INCREF(ret);
18041 : } else {
18042 0 : if (in->user == NULL) {
18043 0 : ret = Py_None;
18044 0 : Py_INCREF(ret);
18045 : } else {
18046 0 : ret = PyUnicode_Decode(in->user, strlen(in->user), "utf-8", "ignore");
18047 : }
18048 : }
18049 0 : return ret;
18050 :
18051 0 : case NETLOGON_CONTROL_SET_DBFLAG:
18052 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->debug_level);
18053 0 : return ret;
18054 :
18055 0 : default:
18056 0 : ret = Py_None;
18057 0 : Py_INCREF(ret);
18058 0 : return ret;
18059 :
18060 : }
18061 : PyErr_SetString(PyExc_TypeError, "unknown union level");
18062 : return NULL;
18063 : }
18064 :
18065 81 : static union netr_CONTROL_DATA_INFORMATION *py_export_netr_CONTROL_DATA_INFORMATION(TALLOC_CTX *mem_ctx, int level, PyObject *in)
18066 : {
18067 81 : union netr_CONTROL_DATA_INFORMATION *ret = talloc_zero(mem_ctx, union netr_CONTROL_DATA_INFORMATION);
18068 81 : switch (level) {
18069 28 : case NETLOGON_CONTROL_REDISCOVER:
18070 28 : if (in == NULL) {
18071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain");
18072 0 : talloc_free(ret); return NULL;
18073 : }
18074 28 : if (in == Py_None) {
18075 0 : ret->domain = NULL;
18076 : } else {
18077 28 : ret->domain = NULL;
18078 : {
18079 : const char *test_str;
18080 : const char *talloc_str;
18081 28 : PyObject *unicode = NULL;
18082 28 : if (PyUnicode_Check(in)) {
18083 28 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
18084 28 : if (unicode == NULL) {
18085 0 : PyErr_NoMemory();
18086 0 : talloc_free(ret); return NULL;
18087 : }
18088 28 : test_str = PyBytes_AS_STRING(unicode);
18089 0 : } else if (PyBytes_Check(in)) {
18090 0 : test_str = PyBytes_AS_STRING(in);
18091 : } else {
18092 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
18093 0 : talloc_free(ret); return NULL;
18094 : }
18095 28 : talloc_str = talloc_strdup(mem_ctx, test_str);
18096 28 : if (unicode != NULL) {
18097 28 : Py_DECREF(unicode);
18098 : }
18099 28 : if (talloc_str == NULL) {
18100 0 : PyErr_NoMemory();
18101 0 : talloc_free(ret); return NULL;
18102 : }
18103 28 : ret->domain = talloc_str;
18104 : }
18105 : }
18106 28 : break;
18107 :
18108 0 : case NETLOGON_CONTROL_TC_QUERY:
18109 0 : if (in == NULL) {
18110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain");
18111 0 : talloc_free(ret); return NULL;
18112 : }
18113 0 : if (in == Py_None) {
18114 0 : ret->domain = NULL;
18115 : } else {
18116 0 : ret->domain = NULL;
18117 : {
18118 : const char *test_str;
18119 : const char *talloc_str;
18120 0 : PyObject *unicode = NULL;
18121 0 : if (PyUnicode_Check(in)) {
18122 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
18123 0 : if (unicode == NULL) {
18124 0 : PyErr_NoMemory();
18125 0 : talloc_free(ret); return NULL;
18126 : }
18127 0 : test_str = PyBytes_AS_STRING(unicode);
18128 0 : } else if (PyBytes_Check(in)) {
18129 0 : test_str = PyBytes_AS_STRING(in);
18130 : } else {
18131 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
18132 0 : talloc_free(ret); return NULL;
18133 : }
18134 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
18135 0 : if (unicode != NULL) {
18136 0 : Py_DECREF(unicode);
18137 : }
18138 0 : if (talloc_str == NULL) {
18139 0 : PyErr_NoMemory();
18140 0 : talloc_free(ret); return NULL;
18141 : }
18142 0 : ret->domain = talloc_str;
18143 : }
18144 : }
18145 0 : break;
18146 :
18147 0 : case NETLOGON_CONTROL_TRANSPORT_NOTIFY:
18148 0 : if (in == NULL) {
18149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain");
18150 0 : talloc_free(ret); return NULL;
18151 : }
18152 0 : if (in == Py_None) {
18153 0 : ret->domain = NULL;
18154 : } else {
18155 0 : ret->domain = NULL;
18156 : {
18157 : const char *test_str;
18158 : const char *talloc_str;
18159 0 : PyObject *unicode = NULL;
18160 0 : if (PyUnicode_Check(in)) {
18161 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
18162 0 : if (unicode == NULL) {
18163 0 : PyErr_NoMemory();
18164 0 : talloc_free(ret); return NULL;
18165 : }
18166 0 : test_str = PyBytes_AS_STRING(unicode);
18167 0 : } else if (PyBytes_Check(in)) {
18168 0 : test_str = PyBytes_AS_STRING(in);
18169 : } else {
18170 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
18171 0 : talloc_free(ret); return NULL;
18172 : }
18173 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
18174 0 : if (unicode != NULL) {
18175 0 : Py_DECREF(unicode);
18176 : }
18177 0 : if (talloc_str == NULL) {
18178 0 : PyErr_NoMemory();
18179 0 : talloc_free(ret); return NULL;
18180 : }
18181 0 : ret->domain = talloc_str;
18182 : }
18183 : }
18184 0 : break;
18185 :
18186 0 : case NETLOGON_CONTROL_CHANGE_PASSWORD:
18187 0 : if (in == NULL) {
18188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain");
18189 0 : talloc_free(ret); return NULL;
18190 : }
18191 0 : if (in == Py_None) {
18192 0 : ret->domain = NULL;
18193 : } else {
18194 0 : ret->domain = NULL;
18195 : {
18196 : const char *test_str;
18197 : const char *talloc_str;
18198 0 : PyObject *unicode = NULL;
18199 0 : if (PyUnicode_Check(in)) {
18200 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
18201 0 : if (unicode == NULL) {
18202 0 : PyErr_NoMemory();
18203 0 : talloc_free(ret); return NULL;
18204 : }
18205 0 : test_str = PyBytes_AS_STRING(unicode);
18206 0 : } else if (PyBytes_Check(in)) {
18207 0 : test_str = PyBytes_AS_STRING(in);
18208 : } else {
18209 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
18210 0 : talloc_free(ret); return NULL;
18211 : }
18212 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
18213 0 : if (unicode != NULL) {
18214 0 : Py_DECREF(unicode);
18215 : }
18216 0 : if (talloc_str == NULL) {
18217 0 : PyErr_NoMemory();
18218 0 : talloc_free(ret); return NULL;
18219 : }
18220 0 : ret->domain = talloc_str;
18221 : }
18222 : }
18223 0 : break;
18224 :
18225 53 : case NETLOGON_CONTROL_TC_VERIFY:
18226 53 : if (in == NULL) {
18227 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain");
18228 0 : talloc_free(ret); return NULL;
18229 : }
18230 53 : if (in == Py_None) {
18231 0 : ret->domain = NULL;
18232 : } else {
18233 53 : ret->domain = NULL;
18234 : {
18235 : const char *test_str;
18236 : const char *talloc_str;
18237 53 : PyObject *unicode = NULL;
18238 53 : if (PyUnicode_Check(in)) {
18239 53 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
18240 53 : if (unicode == NULL) {
18241 0 : PyErr_NoMemory();
18242 0 : talloc_free(ret); return NULL;
18243 : }
18244 53 : test_str = PyBytes_AS_STRING(unicode);
18245 0 : } else if (PyBytes_Check(in)) {
18246 0 : test_str = PyBytes_AS_STRING(in);
18247 : } else {
18248 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
18249 0 : talloc_free(ret); return NULL;
18250 : }
18251 53 : talloc_str = talloc_strdup(mem_ctx, test_str);
18252 53 : if (unicode != NULL) {
18253 53 : Py_DECREF(unicode);
18254 : }
18255 53 : if (talloc_str == NULL) {
18256 0 : PyErr_NoMemory();
18257 0 : talloc_free(ret); return NULL;
18258 : }
18259 53 : ret->domain = talloc_str;
18260 : }
18261 : }
18262 53 : break;
18263 :
18264 0 : case NETLOGON_CONTROL_FIND_USER:
18265 0 : if (in == NULL) {
18266 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->user");
18267 0 : talloc_free(ret); return NULL;
18268 : }
18269 0 : if (in == Py_None) {
18270 0 : ret->user = NULL;
18271 : } else {
18272 0 : ret->user = NULL;
18273 : {
18274 : const char *test_str;
18275 : const char *talloc_str;
18276 0 : PyObject *unicode = NULL;
18277 0 : if (PyUnicode_Check(in)) {
18278 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
18279 0 : if (unicode == NULL) {
18280 0 : PyErr_NoMemory();
18281 0 : talloc_free(ret); return NULL;
18282 : }
18283 0 : test_str = PyBytes_AS_STRING(unicode);
18284 0 : } else if (PyBytes_Check(in)) {
18285 0 : test_str = PyBytes_AS_STRING(in);
18286 : } else {
18287 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
18288 0 : talloc_free(ret); return NULL;
18289 : }
18290 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
18291 0 : if (unicode != NULL) {
18292 0 : Py_DECREF(unicode);
18293 : }
18294 0 : if (talloc_str == NULL) {
18295 0 : PyErr_NoMemory();
18296 0 : talloc_free(ret); return NULL;
18297 : }
18298 0 : ret->user = talloc_str;
18299 : }
18300 : }
18301 0 : break;
18302 :
18303 0 : case NETLOGON_CONTROL_SET_DBFLAG:
18304 0 : if (in == NULL) {
18305 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->debug_level");
18306 0 : talloc_free(ret); return NULL;
18307 : }
18308 : {
18309 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->debug_level));
18310 0 : if (PyLong_Check(in)) {
18311 : unsigned long long test_var;
18312 0 : test_var = PyLong_AsUnsignedLongLong(in);
18313 0 : if (PyErr_Occurred() != NULL) {
18314 0 : talloc_free(ret); return NULL;
18315 : }
18316 0 : if (test_var > uint_max) {
18317 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18318 : PyLong_Type.tp_name, uint_max, test_var);
18319 0 : talloc_free(ret); return NULL;
18320 : }
18321 0 : ret->debug_level = test_var;
18322 : } else {
18323 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18324 : PyLong_Type.tp_name);
18325 0 : talloc_free(ret); return NULL;
18326 : }
18327 : }
18328 0 : break;
18329 :
18330 0 : default:
18331 0 : break;
18332 :
18333 : }
18334 :
18335 81 : return ret;
18336 : }
18337 :
18338 0 : static PyObject *py_netr_CONTROL_DATA_INFORMATION_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18339 : {
18340 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
18341 0 : PyObject *mem_ctx_obj = NULL;
18342 0 : TALLOC_CTX *mem_ctx = NULL;
18343 0 : int level = 0;
18344 0 : PyObject *in_obj = NULL;
18345 0 : union netr_CONTROL_DATA_INFORMATION *in = NULL;
18346 :
18347 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
18348 : discard_const_p(char *, kwnames),
18349 : &mem_ctx_obj,
18350 : &level,
18351 : &in_obj)) {
18352 0 : return NULL;
18353 : }
18354 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
18355 0 : if (mem_ctx == NULL) {
18356 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
18357 0 : return NULL;
18358 : }
18359 0 : in = (union netr_CONTROL_DATA_INFORMATION *)pytalloc_get_ptr(in_obj);
18360 0 : if (in == NULL) {
18361 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_CONTROL_DATA_INFORMATION!");
18362 0 : return NULL;
18363 : }
18364 :
18365 0 : return py_import_netr_CONTROL_DATA_INFORMATION(mem_ctx, level, in);
18366 : }
18367 :
18368 81 : static PyObject *py_netr_CONTROL_DATA_INFORMATION_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18369 : {
18370 81 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
18371 81 : PyObject *mem_ctx_obj = NULL;
18372 81 : TALLOC_CTX *mem_ctx = NULL;
18373 81 : int level = 0;
18374 81 : PyObject *in = NULL;
18375 81 : union netr_CONTROL_DATA_INFORMATION *out = NULL;
18376 :
18377 81 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
18378 : discard_const_p(char *, kwnames),
18379 : &mem_ctx_obj,
18380 : &level,
18381 : &in)) {
18382 0 : return NULL;
18383 : }
18384 81 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
18385 81 : if (mem_ctx == NULL) {
18386 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
18387 0 : return NULL;
18388 : }
18389 :
18390 81 : out = py_export_netr_CONTROL_DATA_INFORMATION(mem_ctx, level, in);
18391 81 : if (out == NULL) {
18392 0 : return NULL;
18393 : }
18394 :
18395 81 : return pytalloc_GenericObject_reference(out);
18396 : }
18397 :
18398 : static PyMethodDef py_netr_CONTROL_DATA_INFORMATION_methods[] = {
18399 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_CONTROL_DATA_INFORMATION_import),
18400 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
18401 : "T.__import__(mem_ctx, level, in) => ret." },
18402 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_CONTROL_DATA_INFORMATION_export),
18403 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
18404 : "T.__export__(mem_ctx, level, in) => ret." },
18405 : { NULL, NULL, 0, NULL }
18406 : };
18407 :
18408 0 : static PyObject *py_netr_CONTROL_DATA_INFORMATION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18409 : {
18410 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
18411 0 : return NULL;
18412 : }
18413 :
18414 :
18415 : static PyTypeObject netr_CONTROL_DATA_INFORMATION_Type = {
18416 : PyVarObject_HEAD_INIT(NULL, 0)
18417 : .tp_name = "netlogon.netr_CONTROL_DATA_INFORMATION",
18418 : .tp_getset = NULL,
18419 : .tp_methods = py_netr_CONTROL_DATA_INFORMATION_methods,
18420 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18421 : .tp_new = py_netr_CONTROL_DATA_INFORMATION_new,
18422 : };
18423 :
18424 0 : static PyObject *py_import_netr_ChangeLogObject(TALLOC_CTX *mem_ctx, int level, union netr_ChangeLogObject *in)
18425 : {
18426 : PyObject *ret;
18427 :
18428 0 : switch (level) {
18429 0 : case NETR_CHANGELOG_SID_INCLUDED:
18430 0 : ret = pytalloc_reference_ex(dom_sid_Type, mem_ctx, &in->object_sid);
18431 0 : return ret;
18432 :
18433 0 : case NETR_CHANGELOG_NAME_INCLUDED:
18434 0 : ret = PyString_FromStringOrNULL(in->object_name);
18435 0 : return ret;
18436 :
18437 0 : default:
18438 0 : ret = Py_None;
18439 0 : Py_INCREF(ret);
18440 0 : return ret;
18441 :
18442 : }
18443 : PyErr_SetString(PyExc_TypeError, "unknown union level");
18444 : return NULL;
18445 : }
18446 :
18447 0 : static union netr_ChangeLogObject *py_export_netr_ChangeLogObject(TALLOC_CTX *mem_ctx, int level, PyObject *in)
18448 : {
18449 0 : union netr_ChangeLogObject *ret = talloc_zero(mem_ctx, union netr_ChangeLogObject);
18450 0 : switch (level) {
18451 0 : case NETR_CHANGELOG_SID_INCLUDED:
18452 0 : if (in == NULL) {
18453 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object_sid");
18454 0 : talloc_free(ret); return NULL;
18455 : }
18456 0 : PY_CHECK_TYPE(dom_sid_Type, in, talloc_free(ret); return NULL;);
18457 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
18458 0 : PyErr_NoMemory();
18459 0 : talloc_free(ret); return NULL;
18460 : }
18461 0 : ret->object_sid = *(struct dom_sid *)pytalloc_get_ptr(in);
18462 0 : break;
18463 :
18464 0 : case NETR_CHANGELOG_NAME_INCLUDED:
18465 0 : if (in == NULL) {
18466 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->object_name");
18467 0 : talloc_free(ret); return NULL;
18468 : }
18469 : {
18470 : const char *test_str;
18471 : const char *talloc_str;
18472 0 : PyObject *unicode = NULL;
18473 0 : if (PyUnicode_Check(in)) {
18474 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
18475 0 : if (unicode == NULL) {
18476 0 : PyErr_NoMemory();
18477 0 : talloc_free(ret); return NULL;
18478 : }
18479 0 : test_str = PyBytes_AS_STRING(unicode);
18480 0 : } else if (PyBytes_Check(in)) {
18481 0 : test_str = PyBytes_AS_STRING(in);
18482 : } else {
18483 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
18484 0 : talloc_free(ret); return NULL;
18485 : }
18486 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
18487 0 : if (unicode != NULL) {
18488 0 : Py_DECREF(unicode);
18489 : }
18490 0 : if (talloc_str == NULL) {
18491 0 : PyErr_NoMemory();
18492 0 : talloc_free(ret); return NULL;
18493 : }
18494 0 : ret->object_name = talloc_str;
18495 : }
18496 0 : break;
18497 :
18498 0 : default:
18499 0 : break;
18500 :
18501 : }
18502 :
18503 0 : return ret;
18504 : }
18505 :
18506 0 : static PyObject *py_netr_ChangeLogObject_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18507 : {
18508 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
18509 0 : PyObject *mem_ctx_obj = NULL;
18510 0 : TALLOC_CTX *mem_ctx = NULL;
18511 0 : int level = 0;
18512 0 : PyObject *in_obj = NULL;
18513 0 : union netr_ChangeLogObject *in = NULL;
18514 :
18515 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
18516 : discard_const_p(char *, kwnames),
18517 : &mem_ctx_obj,
18518 : &level,
18519 : &in_obj)) {
18520 0 : return NULL;
18521 : }
18522 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
18523 0 : if (mem_ctx == NULL) {
18524 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
18525 0 : return NULL;
18526 : }
18527 0 : in = (union netr_ChangeLogObject *)pytalloc_get_ptr(in_obj);
18528 0 : if (in == NULL) {
18529 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_ChangeLogObject!");
18530 0 : return NULL;
18531 : }
18532 :
18533 0 : return py_import_netr_ChangeLogObject(mem_ctx, level, in);
18534 : }
18535 :
18536 0 : static PyObject *py_netr_ChangeLogObject_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18537 : {
18538 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
18539 0 : PyObject *mem_ctx_obj = NULL;
18540 0 : TALLOC_CTX *mem_ctx = NULL;
18541 0 : int level = 0;
18542 0 : PyObject *in = NULL;
18543 0 : union netr_ChangeLogObject *out = NULL;
18544 :
18545 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
18546 : discard_const_p(char *, kwnames),
18547 : &mem_ctx_obj,
18548 : &level,
18549 : &in)) {
18550 0 : return NULL;
18551 : }
18552 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
18553 0 : if (mem_ctx == NULL) {
18554 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
18555 0 : return NULL;
18556 : }
18557 :
18558 0 : out = py_export_netr_ChangeLogObject(mem_ctx, level, in);
18559 0 : if (out == NULL) {
18560 0 : return NULL;
18561 : }
18562 :
18563 0 : return pytalloc_GenericObject_reference(out);
18564 : }
18565 :
18566 : static PyMethodDef py_netr_ChangeLogObject_methods[] = {
18567 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ChangeLogObject_import),
18568 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
18569 : "T.__import__(mem_ctx, level, in) => ret." },
18570 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ChangeLogObject_export),
18571 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
18572 : "T.__export__(mem_ctx, level, in) => ret." },
18573 : { NULL, NULL, 0, NULL }
18574 : };
18575 :
18576 0 : static PyObject *py_netr_ChangeLogObject_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18577 : {
18578 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
18579 0 : return NULL;
18580 : }
18581 :
18582 :
18583 : static PyTypeObject netr_ChangeLogObject_Type = {
18584 : PyVarObject_HEAD_INIT(NULL, 0)
18585 : .tp_name = "netlogon.netr_ChangeLogObject",
18586 : .tp_getset = NULL,
18587 : .tp_methods = py_netr_ChangeLogObject_methods,
18588 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18589 : .tp_new = py_netr_ChangeLogObject_new,
18590 : };
18591 :
18592 :
18593 0 : static PyObject *py_netr_ChangeLogEntry_get_serial_number1(PyObject *obj, void *closure)
18594 : {
18595 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj);
18596 : PyObject *py_serial_number1;
18597 0 : py_serial_number1 = PyLong_FromUnsignedLongLong((uint32_t)object->serial_number1);
18598 0 : return py_serial_number1;
18599 : }
18600 :
18601 0 : static int py_netr_ChangeLogEntry_set_serial_number1(PyObject *py_obj, PyObject *value, void *closure)
18602 : {
18603 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18604 0 : if (value == NULL) {
18605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial_number1");
18606 0 : return -1;
18607 : }
18608 : {
18609 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_number1));
18610 0 : if (PyLong_Check(value)) {
18611 : unsigned long long test_var;
18612 0 : test_var = PyLong_AsUnsignedLongLong(value);
18613 0 : if (PyErr_Occurred() != NULL) {
18614 0 : return -1;
18615 : }
18616 0 : if (test_var > uint_max) {
18617 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18618 : PyLong_Type.tp_name, uint_max, test_var);
18619 0 : return -1;
18620 : }
18621 0 : object->serial_number1 = test_var;
18622 : } else {
18623 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18624 : PyLong_Type.tp_name);
18625 0 : return -1;
18626 : }
18627 : }
18628 0 : return 0;
18629 : }
18630 :
18631 0 : static PyObject *py_netr_ChangeLogEntry_get_serial_number2(PyObject *obj, void *closure)
18632 : {
18633 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj);
18634 : PyObject *py_serial_number2;
18635 0 : py_serial_number2 = PyLong_FromUnsignedLongLong((uint32_t)object->serial_number2);
18636 0 : return py_serial_number2;
18637 : }
18638 :
18639 0 : static int py_netr_ChangeLogEntry_set_serial_number2(PyObject *py_obj, PyObject *value, void *closure)
18640 : {
18641 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18642 0 : if (value == NULL) {
18643 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->serial_number2");
18644 0 : return -1;
18645 : }
18646 : {
18647 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_number2));
18648 0 : if (PyLong_Check(value)) {
18649 : unsigned long long test_var;
18650 0 : test_var = PyLong_AsUnsignedLongLong(value);
18651 0 : if (PyErr_Occurred() != NULL) {
18652 0 : return -1;
18653 : }
18654 0 : if (test_var > uint_max) {
18655 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18656 : PyLong_Type.tp_name, uint_max, test_var);
18657 0 : return -1;
18658 : }
18659 0 : object->serial_number2 = test_var;
18660 : } else {
18661 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18662 : PyLong_Type.tp_name);
18663 0 : return -1;
18664 : }
18665 : }
18666 0 : return 0;
18667 : }
18668 :
18669 0 : static PyObject *py_netr_ChangeLogEntry_get_object_rid(PyObject *obj, void *closure)
18670 : {
18671 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj);
18672 : PyObject *py_object_rid;
18673 0 : py_object_rid = PyLong_FromUnsignedLongLong((uint32_t)object->object_rid);
18674 0 : return py_object_rid;
18675 : }
18676 :
18677 0 : static int py_netr_ChangeLogEntry_set_object_rid(PyObject *py_obj, PyObject *value, void *closure)
18678 : {
18679 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18680 0 : if (value == NULL) {
18681 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object_rid");
18682 0 : return -1;
18683 : }
18684 : {
18685 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->object_rid));
18686 0 : if (PyLong_Check(value)) {
18687 : unsigned long long test_var;
18688 0 : test_var = PyLong_AsUnsignedLongLong(value);
18689 0 : if (PyErr_Occurred() != NULL) {
18690 0 : return -1;
18691 : }
18692 0 : if (test_var > uint_max) {
18693 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18694 : PyLong_Type.tp_name, uint_max, test_var);
18695 0 : return -1;
18696 : }
18697 0 : object->object_rid = test_var;
18698 : } else {
18699 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18700 : PyLong_Type.tp_name);
18701 0 : return -1;
18702 : }
18703 : }
18704 0 : return 0;
18705 : }
18706 :
18707 0 : static PyObject *py_netr_ChangeLogEntry_get_flags(PyObject *obj, void *closure)
18708 : {
18709 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj);
18710 : PyObject *py_flags;
18711 0 : py_flags = PyLong_FromLong((uint16_t)object->flags);
18712 0 : return py_flags;
18713 : }
18714 :
18715 0 : static int py_netr_ChangeLogEntry_set_flags(PyObject *py_obj, PyObject *value, void *closure)
18716 : {
18717 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18718 0 : if (value == NULL) {
18719 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
18720 0 : return -1;
18721 : }
18722 : {
18723 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
18724 0 : if (PyLong_Check(value)) {
18725 : unsigned long long test_var;
18726 0 : test_var = PyLong_AsUnsignedLongLong(value);
18727 0 : if (PyErr_Occurred() != NULL) {
18728 0 : return -1;
18729 : }
18730 0 : if (test_var > uint_max) {
18731 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18732 : PyLong_Type.tp_name, uint_max, test_var);
18733 0 : return -1;
18734 : }
18735 0 : object->flags = test_var;
18736 : } else {
18737 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18738 : PyLong_Type.tp_name);
18739 0 : return -1;
18740 : }
18741 : }
18742 0 : return 0;
18743 : }
18744 :
18745 0 : static PyObject *py_netr_ChangeLogEntry_get_db_index(PyObject *obj, void *closure)
18746 : {
18747 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj);
18748 : PyObject *py_db_index;
18749 0 : py_db_index = PyLong_FromLong((uint16_t)object->db_index);
18750 0 : return py_db_index;
18751 : }
18752 :
18753 0 : static int py_netr_ChangeLogEntry_set_db_index(PyObject *py_obj, PyObject *value, void *closure)
18754 : {
18755 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18756 0 : if (value == NULL) {
18757 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_index");
18758 0 : return -1;
18759 : }
18760 : {
18761 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_index));
18762 0 : if (PyLong_Check(value)) {
18763 : unsigned long long test_var;
18764 0 : test_var = PyLong_AsUnsignedLongLong(value);
18765 0 : if (PyErr_Occurred() != NULL) {
18766 0 : return -1;
18767 : }
18768 0 : if (test_var > uint_max) {
18769 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18770 : PyLong_Type.tp_name, uint_max, test_var);
18771 0 : return -1;
18772 : }
18773 0 : object->db_index = test_var;
18774 : } else {
18775 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18776 : PyLong_Type.tp_name);
18777 0 : return -1;
18778 : }
18779 : }
18780 0 : return 0;
18781 : }
18782 :
18783 0 : static PyObject *py_netr_ChangeLogEntry_get_delta_type(PyObject *obj, void *closure)
18784 : {
18785 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj);
18786 : PyObject *py_delta_type;
18787 0 : py_delta_type = PyLong_FromLong((uint16_t)object->delta_type);
18788 0 : return py_delta_type;
18789 : }
18790 :
18791 0 : static int py_netr_ChangeLogEntry_set_delta_type(PyObject *py_obj, PyObject *value, void *closure)
18792 : {
18793 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18794 0 : if (value == NULL) {
18795 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->delta_type");
18796 0 : return -1;
18797 : }
18798 : {
18799 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->delta_type));
18800 0 : if (PyLong_Check(value)) {
18801 : unsigned long long test_var;
18802 0 : test_var = PyLong_AsUnsignedLongLong(value);
18803 0 : if (PyErr_Occurred() != NULL) {
18804 0 : return -1;
18805 : }
18806 0 : if (test_var > uint_max) {
18807 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18808 : PyLong_Type.tp_name, uint_max, test_var);
18809 0 : return -1;
18810 : }
18811 0 : object->delta_type = test_var;
18812 : } else {
18813 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18814 : PyLong_Type.tp_name);
18815 0 : return -1;
18816 : }
18817 : }
18818 0 : return 0;
18819 : }
18820 :
18821 0 : static PyObject *py_netr_ChangeLogEntry_get_object(PyObject *obj, void *closure)
18822 : {
18823 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(obj);
18824 : PyObject *py_object;
18825 0 : py_object = pyrpc_import_union(&netr_ChangeLogObject_Type, pytalloc_get_mem_ctx(obj), object->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED), &object->object, "union netr_ChangeLogObject");
18826 0 : if (py_object == NULL) {
18827 0 : return NULL;
18828 : }
18829 0 : return py_object;
18830 : }
18831 :
18832 0 : static int py_netr_ChangeLogEntry_set_object(PyObject *py_obj, PyObject *value, void *closure)
18833 : {
18834 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18835 0 : if (value == NULL) {
18836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object");
18837 0 : return -1;
18838 : }
18839 : {
18840 : union netr_ChangeLogObject *object_switch_0;
18841 0 : object_switch_0 = (union netr_ChangeLogObject *)pyrpc_export_union(&netr_ChangeLogObject_Type, pytalloc_get_mem_ctx(py_obj), object->flags & (NETR_CHANGELOG_SID_INCLUDED | NETR_CHANGELOG_NAME_INCLUDED), value, "union netr_ChangeLogObject");
18842 0 : if (object_switch_0 == NULL) {
18843 0 : return -1;
18844 : }
18845 0 : object->object = *object_switch_0;
18846 : }
18847 0 : return 0;
18848 : }
18849 :
18850 : static PyGetSetDef py_netr_ChangeLogEntry_getsetters[] = {
18851 : {
18852 : .name = discard_const_p(char, "serial_number1"),
18853 : .get = py_netr_ChangeLogEntry_get_serial_number1,
18854 : .set = py_netr_ChangeLogEntry_set_serial_number1,
18855 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18856 : },
18857 : {
18858 : .name = discard_const_p(char, "serial_number2"),
18859 : .get = py_netr_ChangeLogEntry_get_serial_number2,
18860 : .set = py_netr_ChangeLogEntry_set_serial_number2,
18861 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18862 : },
18863 : {
18864 : .name = discard_const_p(char, "object_rid"),
18865 : .get = py_netr_ChangeLogEntry_get_object_rid,
18866 : .set = py_netr_ChangeLogEntry_set_object_rid,
18867 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18868 : },
18869 : {
18870 : .name = discard_const_p(char, "flags"),
18871 : .get = py_netr_ChangeLogEntry_get_flags,
18872 : .set = py_netr_ChangeLogEntry_set_flags,
18873 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChangeLogFlags")
18874 : },
18875 : {
18876 : .name = discard_const_p(char, "db_index"),
18877 : .get = py_netr_ChangeLogEntry_get_db_index,
18878 : .set = py_netr_ChangeLogEntry_set_db_index,
18879 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID8Bit")
18880 : },
18881 : {
18882 : .name = discard_const_p(char, "delta_type"),
18883 : .get = py_netr_ChangeLogEntry_get_delta_type,
18884 : .set = py_netr_ChangeLogEntry_set_delta_type,
18885 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DeltaEnum8Bit")
18886 : },
18887 : {
18888 : .name = discard_const_p(char, "object"),
18889 : .get = py_netr_ChangeLogEntry_get_object,
18890 : .set = py_netr_ChangeLogEntry_set_object,
18891 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChangeLogObject")
18892 : },
18893 : { .name = NULL }
18894 : };
18895 :
18896 0 : static PyObject *py_netr_ChangeLogEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18897 : {
18898 0 : return pytalloc_new(struct netr_ChangeLogEntry, type);
18899 : }
18900 :
18901 0 : static PyObject *py_netr_ChangeLogEntry_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18902 : {
18903 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18904 0 : PyObject *ret = NULL;
18905 : DATA_BLOB blob;
18906 : enum ndr_err_code err;
18907 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
18908 0 : if (tmp_ctx == NULL) {
18909 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18910 0 : return NULL;
18911 : }
18912 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_ChangeLogEntry);
18913 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18914 0 : TALLOC_FREE(tmp_ctx);
18915 0 : PyErr_SetNdrError(err);
18916 0 : return NULL;
18917 : }
18918 :
18919 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18920 0 : TALLOC_FREE(tmp_ctx);
18921 0 : return ret;
18922 : }
18923 :
18924 0 : static PyObject *py_netr_ChangeLogEntry_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18925 : {
18926 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18927 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
18928 0 : Py_ssize_t blob_length = 0;
18929 : enum ndr_err_code err;
18930 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
18931 0 : PyObject *allow_remaining_obj = NULL;
18932 0 : bool allow_remaining = false;
18933 :
18934 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
18935 : discard_const_p(char *, kwnames),
18936 : &blob.data, &blob_length,
18937 : &allow_remaining_obj)) {
18938 0 : return NULL;
18939 : }
18940 0 : blob.length = blob_length;
18941 :
18942 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18943 0 : allow_remaining = true;
18944 : }
18945 :
18946 0 : if (allow_remaining) {
18947 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_ChangeLogEntry);
18948 : } else {
18949 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_ChangeLogEntry);
18950 : }
18951 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18952 0 : PyErr_SetNdrError(err);
18953 0 : return NULL;
18954 : }
18955 :
18956 0 : Py_RETURN_NONE;
18957 : }
18958 :
18959 0 : static PyObject *py_netr_ChangeLogEntry_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18960 : {
18961 0 : struct netr_ChangeLogEntry *object = (struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_obj);
18962 : PyObject *ret;
18963 : char *retstr;
18964 :
18965 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_ChangeLogEntry, "netr_ChangeLogEntry", object);
18966 0 : ret = PyUnicode_FromString(retstr);
18967 0 : talloc_free(retstr);
18968 :
18969 0 : return ret;
18970 : }
18971 :
18972 : static PyMethodDef py_netr_ChangeLogEntry_methods[] = {
18973 : { "__ndr_pack__", (PyCFunction)py_netr_ChangeLogEntry_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
18974 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ChangeLogEntry_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
18975 : { "__ndr_print__", (PyCFunction)py_netr_ChangeLogEntry_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
18976 : { NULL, NULL, 0, NULL }
18977 : };
18978 :
18979 :
18980 : static PyTypeObject netr_ChangeLogEntry_Type = {
18981 : PyVarObject_HEAD_INIT(NULL, 0)
18982 : .tp_name = "netlogon.netr_ChangeLogEntry",
18983 : .tp_getset = py_netr_ChangeLogEntry_getsetters,
18984 : .tp_methods = py_netr_ChangeLogEntry_methods,
18985 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18986 : .tp_new = py_netr_ChangeLogEntry_new,
18987 : };
18988 :
18989 :
18990 0 : static PyObject *py_netr_Blob_get_length(PyObject *obj, void *closure)
18991 : {
18992 0 : struct netr_Blob *object = (struct netr_Blob *)pytalloc_get_ptr(obj);
18993 : PyObject *py_length;
18994 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
18995 0 : return py_length;
18996 : }
18997 :
18998 0 : static int py_netr_Blob_set_length(PyObject *py_obj, PyObject *value, void *closure)
18999 : {
19000 0 : struct netr_Blob *object = (struct netr_Blob *)pytalloc_get_ptr(py_obj);
19001 0 : if (value == NULL) {
19002 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
19003 0 : return -1;
19004 : }
19005 : {
19006 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
19007 0 : if (PyLong_Check(value)) {
19008 : unsigned long long test_var;
19009 0 : test_var = PyLong_AsUnsignedLongLong(value);
19010 0 : if (PyErr_Occurred() != NULL) {
19011 0 : return -1;
19012 : }
19013 0 : if (test_var > uint_max) {
19014 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19015 : PyLong_Type.tp_name, uint_max, test_var);
19016 0 : return -1;
19017 : }
19018 0 : object->length = test_var;
19019 : } else {
19020 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19021 : PyLong_Type.tp_name);
19022 0 : return -1;
19023 : }
19024 : }
19025 0 : return 0;
19026 : }
19027 :
19028 0 : static PyObject *py_netr_Blob_get_data(PyObject *obj, void *closure)
19029 : {
19030 0 : struct netr_Blob *object = (struct netr_Blob *)pytalloc_get_ptr(obj);
19031 : PyObject *py_data;
19032 0 : if (object->data == NULL) {
19033 0 : Py_RETURN_NONE;
19034 : }
19035 0 : if (object->data == NULL) {
19036 0 : py_data = Py_None;
19037 0 : Py_INCREF(py_data);
19038 : } else {
19039 0 : py_data = PyList_New(object->length);
19040 0 : if (py_data == NULL) {
19041 0 : return NULL;
19042 : }
19043 : {
19044 : int data_cntr_1;
19045 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
19046 : PyObject *py_data_1;
19047 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
19048 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
19049 : }
19050 : }
19051 : }
19052 0 : return py_data;
19053 : }
19054 :
19055 0 : static int py_netr_Blob_set_data(PyObject *py_obj, PyObject *value, void *closure)
19056 : {
19057 0 : struct netr_Blob *object = (struct netr_Blob *)pytalloc_get_ptr(py_obj);
19058 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
19059 0 : if (value == NULL) {
19060 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
19061 0 : return -1;
19062 : }
19063 0 : if (value == Py_None) {
19064 0 : object->data = NULL;
19065 : } else {
19066 0 : object->data = NULL;
19067 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
19068 : {
19069 : int data_cntr_1;
19070 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
19071 0 : if (!object->data) { return -1;; }
19072 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
19073 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
19074 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
19075 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
19076 0 : return -1;
19077 : }
19078 : {
19079 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
19080 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
19081 : unsigned long long test_var;
19082 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
19083 0 : if (PyErr_Occurred() != NULL) {
19084 0 : return -1;
19085 : }
19086 0 : if (test_var > uint_max) {
19087 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19088 : PyLong_Type.tp_name, uint_max, test_var);
19089 0 : return -1;
19090 : }
19091 0 : object->data[data_cntr_1] = test_var;
19092 : } else {
19093 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19094 : PyLong_Type.tp_name);
19095 0 : return -1;
19096 : }
19097 : }
19098 : }
19099 : }
19100 : }
19101 0 : return 0;
19102 : }
19103 :
19104 : static PyGetSetDef py_netr_Blob_getsetters[] = {
19105 : {
19106 : .name = discard_const_p(char, "length"),
19107 : .get = py_netr_Blob_get_length,
19108 : .set = py_netr_Blob_set_length,
19109 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19110 : },
19111 : {
19112 : .name = discard_const_p(char, "data"),
19113 : .get = py_netr_Blob_get_data,
19114 : .set = py_netr_Blob_set_data,
19115 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
19116 : },
19117 : { .name = NULL }
19118 : };
19119 :
19120 0 : static PyObject *py_netr_Blob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19121 : {
19122 0 : return pytalloc_new(struct netr_Blob, type);
19123 : }
19124 :
19125 :
19126 : static PyTypeObject netr_Blob_Type = {
19127 : PyVarObject_HEAD_INIT(NULL, 0)
19128 : .tp_name = "netlogon.netr_Blob",
19129 : .tp_getset = py_netr_Blob_getsetters,
19130 : .tp_methods = NULL,
19131 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19132 : .tp_new = py_netr_Blob_new,
19133 : };
19134 :
19135 :
19136 200 : static PyObject *py_netr_DsRGetDCNameInfo_get_dc_unc(PyObject *obj, void *closure)
19137 : {
19138 200 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19139 : PyObject *py_dc_unc;
19140 200 : if (object->dc_unc == NULL) {
19141 0 : Py_RETURN_NONE;
19142 : }
19143 200 : if (object->dc_unc == NULL) {
19144 0 : py_dc_unc = Py_None;
19145 0 : Py_INCREF(py_dc_unc);
19146 : } else {
19147 200 : if (object->dc_unc == NULL) {
19148 0 : py_dc_unc = Py_None;
19149 0 : Py_INCREF(py_dc_unc);
19150 : } else {
19151 200 : py_dc_unc = PyUnicode_Decode(object->dc_unc, strlen(object->dc_unc), "utf-8", "ignore");
19152 : }
19153 : }
19154 200 : return py_dc_unc;
19155 : }
19156 :
19157 0 : static int py_netr_DsRGetDCNameInfo_set_dc_unc(PyObject *py_obj, PyObject *value, void *closure)
19158 : {
19159 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19160 0 : if (value == NULL) {
19161 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_unc");
19162 0 : return -1;
19163 : }
19164 0 : if (value == Py_None) {
19165 0 : object->dc_unc = NULL;
19166 : } else {
19167 0 : object->dc_unc = NULL;
19168 : {
19169 : const char *test_str;
19170 : const char *talloc_str;
19171 0 : PyObject *unicode = NULL;
19172 0 : if (PyUnicode_Check(value)) {
19173 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19174 0 : if (unicode == NULL) {
19175 0 : PyErr_NoMemory();
19176 0 : return -1;
19177 : }
19178 0 : test_str = PyBytes_AS_STRING(unicode);
19179 0 : } else if (PyBytes_Check(value)) {
19180 0 : test_str = PyBytes_AS_STRING(value);
19181 : } else {
19182 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19183 0 : return -1;
19184 : }
19185 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19186 0 : if (unicode != NULL) {
19187 0 : Py_DECREF(unicode);
19188 : }
19189 0 : if (talloc_str == NULL) {
19190 0 : PyErr_NoMemory();
19191 0 : return -1;
19192 : }
19193 0 : object->dc_unc = talloc_str;
19194 : }
19195 : }
19196 0 : return 0;
19197 : }
19198 :
19199 44 : static PyObject *py_netr_DsRGetDCNameInfo_get_dc_address(PyObject *obj, void *closure)
19200 : {
19201 44 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19202 : PyObject *py_dc_address;
19203 44 : if (object->dc_address == NULL) {
19204 0 : Py_RETURN_NONE;
19205 : }
19206 44 : if (object->dc_address == NULL) {
19207 0 : py_dc_address = Py_None;
19208 0 : Py_INCREF(py_dc_address);
19209 : } else {
19210 44 : if (object->dc_address == NULL) {
19211 0 : py_dc_address = Py_None;
19212 0 : Py_INCREF(py_dc_address);
19213 : } else {
19214 44 : py_dc_address = PyUnicode_Decode(object->dc_address, strlen(object->dc_address), "utf-8", "ignore");
19215 : }
19216 : }
19217 44 : return py_dc_address;
19218 : }
19219 :
19220 0 : static int py_netr_DsRGetDCNameInfo_set_dc_address(PyObject *py_obj, PyObject *value, void *closure)
19221 : {
19222 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19223 0 : if (value == NULL) {
19224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_address");
19225 0 : return -1;
19226 : }
19227 0 : if (value == Py_None) {
19228 0 : object->dc_address = NULL;
19229 : } else {
19230 0 : object->dc_address = NULL;
19231 : {
19232 : const char *test_str;
19233 : const char *talloc_str;
19234 0 : PyObject *unicode = NULL;
19235 0 : if (PyUnicode_Check(value)) {
19236 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19237 0 : if (unicode == NULL) {
19238 0 : PyErr_NoMemory();
19239 0 : return -1;
19240 : }
19241 0 : test_str = PyBytes_AS_STRING(unicode);
19242 0 : } else if (PyBytes_Check(value)) {
19243 0 : test_str = PyBytes_AS_STRING(value);
19244 : } else {
19245 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19246 0 : return -1;
19247 : }
19248 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19249 0 : if (unicode != NULL) {
19250 0 : Py_DECREF(unicode);
19251 : }
19252 0 : if (talloc_str == NULL) {
19253 0 : PyErr_NoMemory();
19254 0 : return -1;
19255 : }
19256 0 : object->dc_address = talloc_str;
19257 : }
19258 : }
19259 0 : return 0;
19260 : }
19261 :
19262 0 : static PyObject *py_netr_DsRGetDCNameInfo_get_dc_address_type(PyObject *obj, void *closure)
19263 : {
19264 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19265 : PyObject *py_dc_address_type;
19266 0 : py_dc_address_type = PyLong_FromUnsignedLongLong((uint32_t)object->dc_address_type);
19267 0 : return py_dc_address_type;
19268 : }
19269 :
19270 0 : static int py_netr_DsRGetDCNameInfo_set_dc_address_type(PyObject *py_obj, PyObject *value, void *closure)
19271 : {
19272 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19273 0 : if (value == NULL) {
19274 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_address_type");
19275 0 : return -1;
19276 : }
19277 : {
19278 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dc_address_type));
19279 0 : if (PyLong_Check(value)) {
19280 : unsigned long long test_var;
19281 0 : test_var = PyLong_AsUnsignedLongLong(value);
19282 0 : if (PyErr_Occurred() != NULL) {
19283 0 : return -1;
19284 : }
19285 0 : if (test_var > uint_max) {
19286 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19287 : PyLong_Type.tp_name, uint_max, test_var);
19288 0 : return -1;
19289 : }
19290 0 : object->dc_address_type = test_var;
19291 : } else {
19292 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19293 : PyLong_Type.tp_name);
19294 0 : return -1;
19295 : }
19296 : }
19297 0 : return 0;
19298 : }
19299 :
19300 0 : static PyObject *py_netr_DsRGetDCNameInfo_get_domain_guid(PyObject *obj, void *closure)
19301 : {
19302 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19303 : PyObject *py_domain_guid;
19304 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_guid);
19305 0 : return py_domain_guid;
19306 : }
19307 :
19308 0 : static int py_netr_DsRGetDCNameInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
19309 : {
19310 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19311 0 : if (value == NULL) {
19312 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_guid");
19313 0 : return -1;
19314 : }
19315 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
19316 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19317 0 : PyErr_NoMemory();
19318 0 : return -1;
19319 : }
19320 0 : object->domain_guid = *(struct GUID *)pytalloc_get_ptr(value);
19321 0 : return 0;
19322 : }
19323 :
19324 109 : static PyObject *py_netr_DsRGetDCNameInfo_get_domain_name(PyObject *obj, void *closure)
19325 : {
19326 109 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19327 : PyObject *py_domain_name;
19328 109 : if (object->domain_name == NULL) {
19329 0 : Py_RETURN_NONE;
19330 : }
19331 109 : if (object->domain_name == NULL) {
19332 0 : py_domain_name = Py_None;
19333 0 : Py_INCREF(py_domain_name);
19334 : } else {
19335 109 : if (object->domain_name == NULL) {
19336 0 : py_domain_name = Py_None;
19337 0 : Py_INCREF(py_domain_name);
19338 : } else {
19339 109 : py_domain_name = PyUnicode_Decode(object->domain_name, strlen(object->domain_name), "utf-8", "ignore");
19340 : }
19341 : }
19342 109 : return py_domain_name;
19343 : }
19344 :
19345 0 : static int py_netr_DsRGetDCNameInfo_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
19346 : {
19347 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19348 0 : if (value == NULL) {
19349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
19350 0 : return -1;
19351 : }
19352 0 : if (value == Py_None) {
19353 0 : object->domain_name = NULL;
19354 : } else {
19355 0 : object->domain_name = NULL;
19356 : {
19357 : const char *test_str;
19358 : const char *talloc_str;
19359 0 : PyObject *unicode = NULL;
19360 0 : if (PyUnicode_Check(value)) {
19361 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19362 0 : if (unicode == NULL) {
19363 0 : PyErr_NoMemory();
19364 0 : return -1;
19365 : }
19366 0 : test_str = PyBytes_AS_STRING(unicode);
19367 0 : } else if (PyBytes_Check(value)) {
19368 0 : test_str = PyBytes_AS_STRING(value);
19369 : } else {
19370 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19371 0 : return -1;
19372 : }
19373 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19374 0 : if (unicode != NULL) {
19375 0 : Py_DECREF(unicode);
19376 : }
19377 0 : if (talloc_str == NULL) {
19378 0 : PyErr_NoMemory();
19379 0 : return -1;
19380 : }
19381 0 : object->domain_name = talloc_str;
19382 : }
19383 : }
19384 0 : return 0;
19385 : }
19386 :
19387 71 : static PyObject *py_netr_DsRGetDCNameInfo_get_forest_name(PyObject *obj, void *closure)
19388 : {
19389 71 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19390 : PyObject *py_forest_name;
19391 71 : if (object->forest_name == NULL) {
19392 0 : Py_RETURN_NONE;
19393 : }
19394 71 : if (object->forest_name == NULL) {
19395 0 : py_forest_name = Py_None;
19396 0 : Py_INCREF(py_forest_name);
19397 : } else {
19398 71 : if (object->forest_name == NULL) {
19399 0 : py_forest_name = Py_None;
19400 0 : Py_INCREF(py_forest_name);
19401 : } else {
19402 71 : py_forest_name = PyUnicode_Decode(object->forest_name, strlen(object->forest_name), "utf-8", "ignore");
19403 : }
19404 : }
19405 71 : return py_forest_name;
19406 : }
19407 :
19408 0 : static int py_netr_DsRGetDCNameInfo_set_forest_name(PyObject *py_obj, PyObject *value, void *closure)
19409 : {
19410 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19411 0 : if (value == NULL) {
19412 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_name");
19413 0 : return -1;
19414 : }
19415 0 : if (value == Py_None) {
19416 0 : object->forest_name = NULL;
19417 : } else {
19418 0 : object->forest_name = NULL;
19419 : {
19420 : const char *test_str;
19421 : const char *talloc_str;
19422 0 : PyObject *unicode = NULL;
19423 0 : if (PyUnicode_Check(value)) {
19424 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19425 0 : if (unicode == NULL) {
19426 0 : PyErr_NoMemory();
19427 0 : return -1;
19428 : }
19429 0 : test_str = PyBytes_AS_STRING(unicode);
19430 0 : } else if (PyBytes_Check(value)) {
19431 0 : test_str = PyBytes_AS_STRING(value);
19432 : } else {
19433 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19434 0 : return -1;
19435 : }
19436 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19437 0 : if (unicode != NULL) {
19438 0 : Py_DECREF(unicode);
19439 : }
19440 0 : if (talloc_str == NULL) {
19441 0 : PyErr_NoMemory();
19442 0 : return -1;
19443 : }
19444 0 : object->forest_name = talloc_str;
19445 : }
19446 : }
19447 0 : return 0;
19448 : }
19449 :
19450 0 : static PyObject *py_netr_DsRGetDCNameInfo_get_dc_flags(PyObject *obj, void *closure)
19451 : {
19452 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19453 : PyObject *py_dc_flags;
19454 0 : py_dc_flags = PyLong_FromUnsignedLongLong((uint32_t)object->dc_flags);
19455 0 : return py_dc_flags;
19456 : }
19457 :
19458 0 : static int py_netr_DsRGetDCNameInfo_set_dc_flags(PyObject *py_obj, PyObject *value, void *closure)
19459 : {
19460 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19461 0 : if (value == NULL) {
19462 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_flags");
19463 0 : return -1;
19464 : }
19465 : {
19466 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dc_flags));
19467 0 : if (PyLong_Check(value)) {
19468 : unsigned long long test_var;
19469 0 : test_var = PyLong_AsUnsignedLongLong(value);
19470 0 : if (PyErr_Occurred() != NULL) {
19471 0 : return -1;
19472 : }
19473 0 : if (test_var > uint_max) {
19474 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19475 : PyLong_Type.tp_name, uint_max, test_var);
19476 0 : return -1;
19477 : }
19478 0 : object->dc_flags = test_var;
19479 : } else {
19480 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19481 : PyLong_Type.tp_name);
19482 0 : return -1;
19483 : }
19484 : }
19485 0 : return 0;
19486 : }
19487 :
19488 16 : static PyObject *py_netr_DsRGetDCNameInfo_get_dc_site_name(PyObject *obj, void *closure)
19489 : {
19490 16 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19491 : PyObject *py_dc_site_name;
19492 16 : if (object->dc_site_name == NULL) {
19493 0 : Py_RETURN_NONE;
19494 : }
19495 16 : if (object->dc_site_name == NULL) {
19496 0 : py_dc_site_name = Py_None;
19497 0 : Py_INCREF(py_dc_site_name);
19498 : } else {
19499 16 : if (object->dc_site_name == NULL) {
19500 0 : py_dc_site_name = Py_None;
19501 0 : Py_INCREF(py_dc_site_name);
19502 : } else {
19503 16 : py_dc_site_name = PyUnicode_Decode(object->dc_site_name, strlen(object->dc_site_name), "utf-8", "ignore");
19504 : }
19505 : }
19506 16 : return py_dc_site_name;
19507 : }
19508 :
19509 0 : static int py_netr_DsRGetDCNameInfo_set_dc_site_name(PyObject *py_obj, PyObject *value, void *closure)
19510 : {
19511 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19512 0 : if (value == NULL) {
19513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dc_site_name");
19514 0 : return -1;
19515 : }
19516 0 : if (value == Py_None) {
19517 0 : object->dc_site_name = NULL;
19518 : } else {
19519 0 : object->dc_site_name = NULL;
19520 : {
19521 : const char *test_str;
19522 : const char *talloc_str;
19523 0 : PyObject *unicode = NULL;
19524 0 : if (PyUnicode_Check(value)) {
19525 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19526 0 : if (unicode == NULL) {
19527 0 : PyErr_NoMemory();
19528 0 : return -1;
19529 : }
19530 0 : test_str = PyBytes_AS_STRING(unicode);
19531 0 : } else if (PyBytes_Check(value)) {
19532 0 : test_str = PyBytes_AS_STRING(value);
19533 : } else {
19534 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19535 0 : return -1;
19536 : }
19537 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19538 0 : if (unicode != NULL) {
19539 0 : Py_DECREF(unicode);
19540 : }
19541 0 : if (talloc_str == NULL) {
19542 0 : PyErr_NoMemory();
19543 0 : return -1;
19544 : }
19545 0 : object->dc_site_name = talloc_str;
19546 : }
19547 : }
19548 0 : return 0;
19549 : }
19550 :
19551 0 : static PyObject *py_netr_DsRGetDCNameInfo_get_client_site_name(PyObject *obj, void *closure)
19552 : {
19553 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(obj);
19554 : PyObject *py_client_site_name;
19555 0 : if (object->client_site_name == NULL) {
19556 0 : Py_RETURN_NONE;
19557 : }
19558 0 : if (object->client_site_name == NULL) {
19559 0 : py_client_site_name = Py_None;
19560 0 : Py_INCREF(py_client_site_name);
19561 : } else {
19562 0 : if (object->client_site_name == NULL) {
19563 0 : py_client_site_name = Py_None;
19564 0 : Py_INCREF(py_client_site_name);
19565 : } else {
19566 0 : py_client_site_name = PyUnicode_Decode(object->client_site_name, strlen(object->client_site_name), "utf-8", "ignore");
19567 : }
19568 : }
19569 0 : return py_client_site_name;
19570 : }
19571 :
19572 0 : static int py_netr_DsRGetDCNameInfo_set_client_site_name(PyObject *py_obj, PyObject *value, void *closure)
19573 : {
19574 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19575 0 : if (value == NULL) {
19576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_site_name");
19577 0 : return -1;
19578 : }
19579 0 : if (value == Py_None) {
19580 0 : object->client_site_name = NULL;
19581 : } else {
19582 0 : object->client_site_name = NULL;
19583 : {
19584 : const char *test_str;
19585 : const char *talloc_str;
19586 0 : PyObject *unicode = NULL;
19587 0 : if (PyUnicode_Check(value)) {
19588 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19589 0 : if (unicode == NULL) {
19590 0 : PyErr_NoMemory();
19591 0 : return -1;
19592 : }
19593 0 : test_str = PyBytes_AS_STRING(unicode);
19594 0 : } else if (PyBytes_Check(value)) {
19595 0 : test_str = PyBytes_AS_STRING(value);
19596 : } else {
19597 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19598 0 : return -1;
19599 : }
19600 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19601 0 : if (unicode != NULL) {
19602 0 : Py_DECREF(unicode);
19603 : }
19604 0 : if (talloc_str == NULL) {
19605 0 : PyErr_NoMemory();
19606 0 : return -1;
19607 : }
19608 0 : object->client_site_name = talloc_str;
19609 : }
19610 : }
19611 0 : return 0;
19612 : }
19613 :
19614 : static PyGetSetDef py_netr_DsRGetDCNameInfo_getsetters[] = {
19615 : {
19616 : .name = discard_const_p(char, "dc_unc"),
19617 : .get = py_netr_DsRGetDCNameInfo_get_dc_unc,
19618 : .set = py_netr_DsRGetDCNameInfo_set_dc_unc,
19619 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19620 : },
19621 : {
19622 : .name = discard_const_p(char, "dc_address"),
19623 : .get = py_netr_DsRGetDCNameInfo_get_dc_address,
19624 : .set = py_netr_DsRGetDCNameInfo_set_dc_address,
19625 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19626 : },
19627 : {
19628 : .name = discard_const_p(char, "dc_address_type"),
19629 : .get = py_netr_DsRGetDCNameInfo_get_dc_address_type,
19630 : .set = py_netr_DsRGetDCNameInfo_set_dc_address_type,
19631 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo_AddressType")
19632 : },
19633 : {
19634 : .name = discard_const_p(char, "domain_guid"),
19635 : .get = py_netr_DsRGetDCNameInfo_get_domain_guid,
19636 : .set = py_netr_DsRGetDCNameInfo_set_domain_guid,
19637 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
19638 : },
19639 : {
19640 : .name = discard_const_p(char, "domain_name"),
19641 : .get = py_netr_DsRGetDCNameInfo_get_domain_name,
19642 : .set = py_netr_DsRGetDCNameInfo_set_domain_name,
19643 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19644 : },
19645 : {
19646 : .name = discard_const_p(char, "forest_name"),
19647 : .get = py_netr_DsRGetDCNameInfo_get_forest_name,
19648 : .set = py_netr_DsRGetDCNameInfo_set_forest_name,
19649 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19650 : },
19651 : {
19652 : .name = discard_const_p(char, "dc_flags"),
19653 : .get = py_netr_DsRGetDCNameInfo_get_dc_flags,
19654 : .set = py_netr_DsRGetDCNameInfo_set_dc_flags,
19655 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsR_DcFlags")
19656 : },
19657 : {
19658 : .name = discard_const_p(char, "dc_site_name"),
19659 : .get = py_netr_DsRGetDCNameInfo_get_dc_site_name,
19660 : .set = py_netr_DsRGetDCNameInfo_set_dc_site_name,
19661 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19662 : },
19663 : {
19664 : .name = discard_const_p(char, "client_site_name"),
19665 : .get = py_netr_DsRGetDCNameInfo_get_client_site_name,
19666 : .set = py_netr_DsRGetDCNameInfo_set_client_site_name,
19667 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19668 : },
19669 : { .name = NULL }
19670 : };
19671 :
19672 0 : static PyObject *py_netr_DsRGetDCNameInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19673 : {
19674 0 : return pytalloc_new(struct netr_DsRGetDCNameInfo, type);
19675 : }
19676 :
19677 0 : static PyObject *py_netr_DsRGetDCNameInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19678 : {
19679 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19680 0 : PyObject *ret = NULL;
19681 : DATA_BLOB blob;
19682 : enum ndr_err_code err;
19683 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
19684 0 : if (tmp_ctx == NULL) {
19685 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19686 0 : return NULL;
19687 : }
19688 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_DsRGetDCNameInfo);
19689 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19690 0 : TALLOC_FREE(tmp_ctx);
19691 0 : PyErr_SetNdrError(err);
19692 0 : return NULL;
19693 : }
19694 :
19695 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19696 0 : TALLOC_FREE(tmp_ctx);
19697 0 : return ret;
19698 : }
19699 :
19700 0 : static PyObject *py_netr_DsRGetDCNameInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19701 : {
19702 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19703 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
19704 0 : Py_ssize_t blob_length = 0;
19705 : enum ndr_err_code err;
19706 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
19707 0 : PyObject *allow_remaining_obj = NULL;
19708 0 : bool allow_remaining = false;
19709 :
19710 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
19711 : discard_const_p(char *, kwnames),
19712 : &blob.data, &blob_length,
19713 : &allow_remaining_obj)) {
19714 0 : return NULL;
19715 : }
19716 0 : blob.length = blob_length;
19717 :
19718 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19719 0 : allow_remaining = true;
19720 : }
19721 :
19722 0 : if (allow_remaining) {
19723 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_DsRGetDCNameInfo);
19724 : } else {
19725 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_DsRGetDCNameInfo);
19726 : }
19727 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19728 0 : PyErr_SetNdrError(err);
19729 0 : return NULL;
19730 : }
19731 :
19732 0 : Py_RETURN_NONE;
19733 : }
19734 :
19735 0 : static PyObject *py_netr_DsRGetDCNameInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19736 : {
19737 0 : struct netr_DsRGetDCNameInfo *object = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(py_obj);
19738 : PyObject *ret;
19739 : char *retstr;
19740 :
19741 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_DsRGetDCNameInfo, "netr_DsRGetDCNameInfo", object);
19742 0 : ret = PyUnicode_FromString(retstr);
19743 0 : talloc_free(retstr);
19744 :
19745 0 : return ret;
19746 : }
19747 :
19748 : static PyMethodDef py_netr_DsRGetDCNameInfo_methods[] = {
19749 : { "__ndr_pack__", (PyCFunction)py_netr_DsRGetDCNameInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
19750 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
19751 : { "__ndr_print__", (PyCFunction)py_netr_DsRGetDCNameInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
19752 : { NULL, NULL, 0, NULL }
19753 : };
19754 :
19755 :
19756 : static PyTypeObject netr_DsRGetDCNameInfo_Type = {
19757 : PyVarObject_HEAD_INIT(NULL, 0)
19758 : .tp_name = "netlogon.netr_DsRGetDCNameInfo",
19759 : .tp_getset = py_netr_DsRGetDCNameInfo_getsetters,
19760 : .tp_methods = py_netr_DsRGetDCNameInfo_methods,
19761 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19762 : .tp_new = py_netr_DsRGetDCNameInfo_new,
19763 : };
19764 :
19765 0 : static PyObject *py_import_netr_Capabilities(TALLOC_CTX *mem_ctx, int level, union netr_Capabilities *in)
19766 : {
19767 : PyObject *ret;
19768 :
19769 0 : switch (level) {
19770 0 : case 1:
19771 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->server_capabilities);
19772 0 : return ret;
19773 :
19774 0 : case 2:
19775 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)in->server_capabilities);
19776 0 : return ret;
19777 :
19778 : }
19779 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
19780 0 : return NULL;
19781 : }
19782 :
19783 0 : static union netr_Capabilities *py_export_netr_Capabilities(TALLOC_CTX *mem_ctx, int level, PyObject *in)
19784 : {
19785 0 : union netr_Capabilities *ret = talloc_zero(mem_ctx, union netr_Capabilities);
19786 0 : switch (level) {
19787 0 : case 1:
19788 0 : if (in == NULL) {
19789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->server_capabilities");
19790 0 : talloc_free(ret); return NULL;
19791 : }
19792 : {
19793 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->server_capabilities));
19794 0 : if (PyLong_Check(in)) {
19795 : unsigned long long test_var;
19796 0 : test_var = PyLong_AsUnsignedLongLong(in);
19797 0 : if (PyErr_Occurred() != NULL) {
19798 0 : talloc_free(ret); return NULL;
19799 : }
19800 0 : if (test_var > uint_max) {
19801 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19802 : PyLong_Type.tp_name, uint_max, test_var);
19803 0 : talloc_free(ret); return NULL;
19804 : }
19805 0 : ret->server_capabilities = test_var;
19806 : } else {
19807 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19808 : PyLong_Type.tp_name);
19809 0 : talloc_free(ret); return NULL;
19810 : }
19811 : }
19812 0 : break;
19813 :
19814 0 : case 2:
19815 0 : if (in == NULL) {
19816 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->server_capabilities");
19817 0 : talloc_free(ret); return NULL;
19818 : }
19819 : {
19820 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->server_capabilities));
19821 0 : if (PyLong_Check(in)) {
19822 : unsigned long long test_var;
19823 0 : test_var = PyLong_AsUnsignedLongLong(in);
19824 0 : if (PyErr_Occurred() != NULL) {
19825 0 : talloc_free(ret); return NULL;
19826 : }
19827 0 : if (test_var > uint_max) {
19828 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19829 : PyLong_Type.tp_name, uint_max, test_var);
19830 0 : talloc_free(ret); return NULL;
19831 : }
19832 0 : ret->server_capabilities = test_var;
19833 : } else {
19834 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19835 : PyLong_Type.tp_name);
19836 0 : talloc_free(ret); return NULL;
19837 : }
19838 : }
19839 0 : break;
19840 :
19841 0 : default:
19842 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
19843 0 : talloc_free(ret);
19844 0 : ret = NULL;
19845 : }
19846 :
19847 0 : return ret;
19848 : }
19849 :
19850 0 : static PyObject *py_netr_Capabilities_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19851 : {
19852 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
19853 0 : PyObject *mem_ctx_obj = NULL;
19854 0 : TALLOC_CTX *mem_ctx = NULL;
19855 0 : int level = 0;
19856 0 : PyObject *in_obj = NULL;
19857 0 : union netr_Capabilities *in = NULL;
19858 :
19859 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
19860 : discard_const_p(char *, kwnames),
19861 : &mem_ctx_obj,
19862 : &level,
19863 : &in_obj)) {
19864 0 : return NULL;
19865 : }
19866 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
19867 0 : if (mem_ctx == NULL) {
19868 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
19869 0 : return NULL;
19870 : }
19871 0 : in = (union netr_Capabilities *)pytalloc_get_ptr(in_obj);
19872 0 : if (in == NULL) {
19873 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_Capabilities!");
19874 0 : return NULL;
19875 : }
19876 :
19877 0 : return py_import_netr_Capabilities(mem_ctx, level, in);
19878 : }
19879 :
19880 0 : static PyObject *py_netr_Capabilities_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19881 : {
19882 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
19883 0 : PyObject *mem_ctx_obj = NULL;
19884 0 : TALLOC_CTX *mem_ctx = NULL;
19885 0 : int level = 0;
19886 0 : PyObject *in = NULL;
19887 0 : union netr_Capabilities *out = NULL;
19888 :
19889 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
19890 : discard_const_p(char *, kwnames),
19891 : &mem_ctx_obj,
19892 : &level,
19893 : &in)) {
19894 0 : return NULL;
19895 : }
19896 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
19897 0 : if (mem_ctx == NULL) {
19898 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
19899 0 : return NULL;
19900 : }
19901 :
19902 0 : out = py_export_netr_Capabilities(mem_ctx, level, in);
19903 0 : if (out == NULL) {
19904 0 : return NULL;
19905 : }
19906 :
19907 0 : return pytalloc_GenericObject_reference(out);
19908 : }
19909 :
19910 : static PyMethodDef py_netr_Capabilities_methods[] = {
19911 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Capabilities_import),
19912 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
19913 : "T.__import__(mem_ctx, level, in) => ret." },
19914 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Capabilities_export),
19915 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
19916 : "T.__export__(mem_ctx, level, in) => ret." },
19917 : { NULL, NULL, 0, NULL }
19918 : };
19919 :
19920 0 : static PyObject *py_netr_Capabilities_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19921 : {
19922 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
19923 0 : return NULL;
19924 : }
19925 :
19926 :
19927 : static PyTypeObject netr_Capabilities_Type = {
19928 : PyVarObject_HEAD_INIT(NULL, 0)
19929 : .tp_name = "netlogon.netr_Capabilities",
19930 : .tp_getset = NULL,
19931 : .tp_methods = py_netr_Capabilities_methods,
19932 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19933 : .tp_new = py_netr_Capabilities_new,
19934 : };
19935 :
19936 :
19937 0 : static PyObject *py_netr_LsaPolicyInformation_get_policy_size(PyObject *obj, void *closure)
19938 : {
19939 0 : struct netr_LsaPolicyInformation *object = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(obj);
19940 : PyObject *py_policy_size;
19941 0 : py_policy_size = PyLong_FromUnsignedLongLong((uint32_t)object->policy_size);
19942 0 : return py_policy_size;
19943 : }
19944 :
19945 0 : static int py_netr_LsaPolicyInformation_set_policy_size(PyObject *py_obj, PyObject *value, void *closure)
19946 : {
19947 0 : struct netr_LsaPolicyInformation *object = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(py_obj);
19948 0 : if (value == NULL) {
19949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->policy_size");
19950 0 : return -1;
19951 : }
19952 : {
19953 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->policy_size));
19954 0 : if (PyLong_Check(value)) {
19955 : unsigned long long test_var;
19956 0 : test_var = PyLong_AsUnsignedLongLong(value);
19957 0 : if (PyErr_Occurred() != NULL) {
19958 0 : return -1;
19959 : }
19960 0 : if (test_var > uint_max) {
19961 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19962 : PyLong_Type.tp_name, uint_max, test_var);
19963 0 : return -1;
19964 : }
19965 0 : object->policy_size = test_var;
19966 : } else {
19967 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19968 : PyLong_Type.tp_name);
19969 0 : return -1;
19970 : }
19971 : }
19972 0 : return 0;
19973 : }
19974 :
19975 0 : static PyObject *py_netr_LsaPolicyInformation_get_policy(PyObject *obj, void *closure)
19976 : {
19977 0 : struct netr_LsaPolicyInformation *object = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(obj);
19978 : PyObject *py_policy;
19979 0 : if (object->policy == NULL) {
19980 0 : Py_RETURN_NONE;
19981 : }
19982 0 : if (object->policy == NULL) {
19983 0 : py_policy = Py_None;
19984 0 : Py_INCREF(py_policy);
19985 : } else {
19986 0 : py_policy = PyList_New(object->policy_size);
19987 0 : if (py_policy == NULL) {
19988 0 : return NULL;
19989 : }
19990 : {
19991 : int policy_cntr_1;
19992 0 : for (policy_cntr_1 = 0; policy_cntr_1 < (object->policy_size); policy_cntr_1++) {
19993 : PyObject *py_policy_1;
19994 0 : py_policy_1 = PyLong_FromLong((uint16_t)object->policy[policy_cntr_1]);
19995 0 : PyList_SetItem(py_policy, policy_cntr_1, py_policy_1);
19996 : }
19997 : }
19998 : }
19999 0 : return py_policy;
20000 : }
20001 :
20002 0 : static int py_netr_LsaPolicyInformation_set_policy(PyObject *py_obj, PyObject *value, void *closure)
20003 : {
20004 0 : struct netr_LsaPolicyInformation *object = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(py_obj);
20005 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->policy));
20006 0 : if (value == NULL) {
20007 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->policy");
20008 0 : return -1;
20009 : }
20010 0 : if (value == Py_None) {
20011 0 : object->policy = NULL;
20012 : } else {
20013 0 : object->policy = NULL;
20014 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
20015 : {
20016 : int policy_cntr_1;
20017 0 : object->policy = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->policy, PyList_GET_SIZE(value));
20018 0 : if (!object->policy) { return -1;; }
20019 0 : talloc_set_name_const(object->policy, "ARRAY: object->policy");
20020 0 : for (policy_cntr_1 = 0; policy_cntr_1 < PyList_GET_SIZE(value); policy_cntr_1++) {
20021 0 : if (PyList_GET_ITEM(value, policy_cntr_1) == NULL) {
20022 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->policy[policy_cntr_1]");
20023 0 : return -1;
20024 : }
20025 : {
20026 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->policy[policy_cntr_1]));
20027 0 : if (PyLong_Check(PyList_GET_ITEM(value, policy_cntr_1))) {
20028 : unsigned long long test_var;
20029 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, policy_cntr_1));
20030 0 : if (PyErr_Occurred() != NULL) {
20031 0 : return -1;
20032 : }
20033 0 : if (test_var > uint_max) {
20034 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20035 : PyLong_Type.tp_name, uint_max, test_var);
20036 0 : return -1;
20037 : }
20038 0 : object->policy[policy_cntr_1] = test_var;
20039 : } else {
20040 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20041 : PyLong_Type.tp_name);
20042 0 : return -1;
20043 : }
20044 : }
20045 : }
20046 : }
20047 : }
20048 0 : return 0;
20049 : }
20050 :
20051 : static PyGetSetDef py_netr_LsaPolicyInformation_getsetters[] = {
20052 : {
20053 : .name = discard_const_p(char, "policy_size"),
20054 : .get = py_netr_LsaPolicyInformation_get_policy_size,
20055 : .set = py_netr_LsaPolicyInformation_set_policy_size,
20056 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20057 : },
20058 : {
20059 : .name = discard_const_p(char, "policy"),
20060 : .get = py_netr_LsaPolicyInformation_get_policy,
20061 : .set = py_netr_LsaPolicyInformation_set_policy,
20062 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
20063 : },
20064 : { .name = NULL }
20065 : };
20066 :
20067 0 : static PyObject *py_netr_LsaPolicyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20068 : {
20069 0 : return pytalloc_new(struct netr_LsaPolicyInformation, type);
20070 : }
20071 :
20072 :
20073 : static PyTypeObject netr_LsaPolicyInformation_Type = {
20074 : PyVarObject_HEAD_INIT(NULL, 0)
20075 : .tp_name = "netlogon.netr_LsaPolicyInformation",
20076 : .tp_getset = py_netr_LsaPolicyInformation_getsetters,
20077 : .tp_methods = NULL,
20078 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20079 : .tp_new = py_netr_LsaPolicyInformation_new,
20080 : };
20081 :
20082 :
20083 0 : static PyObject *py_netr_OsVersionInfoEx_get_OSVersionInfoSize(PyObject *obj, void *closure)
20084 : {
20085 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20086 : PyObject *py_OSVersionInfoSize;
20087 0 : py_OSVersionInfoSize = PyLong_FromUnsignedLongLong((uint32_t)object->OSVersionInfoSize);
20088 0 : return py_OSVersionInfoSize;
20089 : }
20090 :
20091 0 : static int py_netr_OsVersionInfoEx_set_OSVersionInfoSize(PyObject *py_obj, PyObject *value, void *closure)
20092 : {
20093 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20094 0 : if (value == NULL) {
20095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->OSVersionInfoSize");
20096 0 : return -1;
20097 : }
20098 : {
20099 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->OSVersionInfoSize));
20100 0 : if (PyLong_Check(value)) {
20101 : unsigned long long test_var;
20102 0 : test_var = PyLong_AsUnsignedLongLong(value);
20103 0 : if (PyErr_Occurred() != NULL) {
20104 0 : return -1;
20105 : }
20106 0 : if (test_var > uint_max) {
20107 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20108 : PyLong_Type.tp_name, uint_max, test_var);
20109 0 : return -1;
20110 : }
20111 0 : object->OSVersionInfoSize = test_var;
20112 : } else {
20113 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20114 : PyLong_Type.tp_name);
20115 0 : return -1;
20116 : }
20117 : }
20118 0 : return 0;
20119 : }
20120 :
20121 0 : static PyObject *py_netr_OsVersionInfoEx_get_MajorVersion(PyObject *obj, void *closure)
20122 : {
20123 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20124 : PyObject *py_MajorVersion;
20125 0 : py_MajorVersion = PyLong_FromUnsignedLongLong((uint32_t)object->MajorVersion);
20126 0 : return py_MajorVersion;
20127 : }
20128 :
20129 0 : static int py_netr_OsVersionInfoEx_set_MajorVersion(PyObject *py_obj, PyObject *value, void *closure)
20130 : {
20131 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20132 0 : if (value == NULL) {
20133 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MajorVersion");
20134 0 : return -1;
20135 : }
20136 : {
20137 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MajorVersion));
20138 0 : if (PyLong_Check(value)) {
20139 : unsigned long long test_var;
20140 0 : test_var = PyLong_AsUnsignedLongLong(value);
20141 0 : if (PyErr_Occurred() != NULL) {
20142 0 : return -1;
20143 : }
20144 0 : if (test_var > uint_max) {
20145 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20146 : PyLong_Type.tp_name, uint_max, test_var);
20147 0 : return -1;
20148 : }
20149 0 : object->MajorVersion = test_var;
20150 : } else {
20151 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20152 : PyLong_Type.tp_name);
20153 0 : return -1;
20154 : }
20155 : }
20156 0 : return 0;
20157 : }
20158 :
20159 0 : static PyObject *py_netr_OsVersionInfoEx_get_MinorVersion(PyObject *obj, void *closure)
20160 : {
20161 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20162 : PyObject *py_MinorVersion;
20163 0 : py_MinorVersion = PyLong_FromUnsignedLongLong((uint32_t)object->MinorVersion);
20164 0 : return py_MinorVersion;
20165 : }
20166 :
20167 0 : static int py_netr_OsVersionInfoEx_set_MinorVersion(PyObject *py_obj, PyObject *value, void *closure)
20168 : {
20169 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20170 0 : if (value == NULL) {
20171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MinorVersion");
20172 0 : return -1;
20173 : }
20174 : {
20175 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MinorVersion));
20176 0 : if (PyLong_Check(value)) {
20177 : unsigned long long test_var;
20178 0 : test_var = PyLong_AsUnsignedLongLong(value);
20179 0 : if (PyErr_Occurred() != NULL) {
20180 0 : return -1;
20181 : }
20182 0 : if (test_var > uint_max) {
20183 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20184 : PyLong_Type.tp_name, uint_max, test_var);
20185 0 : return -1;
20186 : }
20187 0 : object->MinorVersion = test_var;
20188 : } else {
20189 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20190 : PyLong_Type.tp_name);
20191 0 : return -1;
20192 : }
20193 : }
20194 0 : return 0;
20195 : }
20196 :
20197 0 : static PyObject *py_netr_OsVersionInfoEx_get_BuildNumber(PyObject *obj, void *closure)
20198 : {
20199 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20200 : PyObject *py_BuildNumber;
20201 0 : py_BuildNumber = PyLong_FromUnsignedLongLong((uint32_t)object->BuildNumber);
20202 0 : return py_BuildNumber;
20203 : }
20204 :
20205 0 : static int py_netr_OsVersionInfoEx_set_BuildNumber(PyObject *py_obj, PyObject *value, void *closure)
20206 : {
20207 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20208 0 : if (value == NULL) {
20209 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->BuildNumber");
20210 0 : return -1;
20211 : }
20212 : {
20213 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BuildNumber));
20214 0 : if (PyLong_Check(value)) {
20215 : unsigned long long test_var;
20216 0 : test_var = PyLong_AsUnsignedLongLong(value);
20217 0 : if (PyErr_Occurred() != NULL) {
20218 0 : return -1;
20219 : }
20220 0 : if (test_var > uint_max) {
20221 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20222 : PyLong_Type.tp_name, uint_max, test_var);
20223 0 : return -1;
20224 : }
20225 0 : object->BuildNumber = test_var;
20226 : } else {
20227 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20228 : PyLong_Type.tp_name);
20229 0 : return -1;
20230 : }
20231 : }
20232 0 : return 0;
20233 : }
20234 :
20235 0 : static PyObject *py_netr_OsVersionInfoEx_get_PlatformId(PyObject *obj, void *closure)
20236 : {
20237 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20238 : PyObject *py_PlatformId;
20239 0 : py_PlatformId = PyLong_FromUnsignedLongLong((uint32_t)object->PlatformId);
20240 0 : return py_PlatformId;
20241 : }
20242 :
20243 0 : static int py_netr_OsVersionInfoEx_set_PlatformId(PyObject *py_obj, PyObject *value, void *closure)
20244 : {
20245 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20246 0 : if (value == NULL) {
20247 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->PlatformId");
20248 0 : return -1;
20249 : }
20250 : {
20251 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PlatformId));
20252 0 : if (PyLong_Check(value)) {
20253 : unsigned long long test_var;
20254 0 : test_var = PyLong_AsUnsignedLongLong(value);
20255 0 : if (PyErr_Occurred() != NULL) {
20256 0 : return -1;
20257 : }
20258 0 : if (test_var > uint_max) {
20259 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20260 : PyLong_Type.tp_name, uint_max, test_var);
20261 0 : return -1;
20262 : }
20263 0 : object->PlatformId = test_var;
20264 : } else {
20265 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20266 : PyLong_Type.tp_name);
20267 0 : return -1;
20268 : }
20269 : }
20270 0 : return 0;
20271 : }
20272 :
20273 0 : static PyObject *py_netr_OsVersionInfoEx_get_CSDVersion(PyObject *obj, void *closure)
20274 : {
20275 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20276 : PyObject *py_CSDVersion;
20277 0 : py_CSDVersion = PyString_FromStringOrNULL(object->CSDVersion);
20278 0 : return py_CSDVersion;
20279 : }
20280 :
20281 0 : static int py_netr_OsVersionInfoEx_set_CSDVersion(PyObject *py_obj, PyObject *value, void *closure)
20282 : {
20283 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20284 0 : if (value == NULL) {
20285 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->CSDVersion");
20286 0 : return -1;
20287 : }
20288 : {
20289 : const char *test_str;
20290 : const char *talloc_str;
20291 0 : PyObject *unicode = NULL;
20292 0 : if (PyUnicode_Check(value)) {
20293 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
20294 0 : if (unicode == NULL) {
20295 0 : PyErr_NoMemory();
20296 0 : return -1;
20297 : }
20298 0 : test_str = PyBytes_AS_STRING(unicode);
20299 0 : } else if (PyBytes_Check(value)) {
20300 0 : test_str = PyBytes_AS_STRING(value);
20301 : } else {
20302 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
20303 0 : return -1;
20304 : }
20305 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
20306 0 : if (unicode != NULL) {
20307 0 : Py_DECREF(unicode);
20308 : }
20309 0 : if (talloc_str == NULL) {
20310 0 : PyErr_NoMemory();
20311 0 : return -1;
20312 : }
20313 0 : object->CSDVersion = talloc_str;
20314 : }
20315 0 : return 0;
20316 : }
20317 :
20318 0 : static PyObject *py_netr_OsVersionInfoEx_get_ServicePackMajor(PyObject *obj, void *closure)
20319 : {
20320 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20321 : PyObject *py_ServicePackMajor;
20322 0 : py_ServicePackMajor = PyLong_FromLong((uint16_t)object->ServicePackMajor);
20323 0 : return py_ServicePackMajor;
20324 : }
20325 :
20326 0 : static int py_netr_OsVersionInfoEx_set_ServicePackMajor(PyObject *py_obj, PyObject *value, void *closure)
20327 : {
20328 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20329 0 : if (value == NULL) {
20330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServicePackMajor");
20331 0 : return -1;
20332 : }
20333 : {
20334 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServicePackMajor));
20335 0 : if (PyLong_Check(value)) {
20336 : unsigned long long test_var;
20337 0 : test_var = PyLong_AsUnsignedLongLong(value);
20338 0 : if (PyErr_Occurred() != NULL) {
20339 0 : return -1;
20340 : }
20341 0 : if (test_var > uint_max) {
20342 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20343 : PyLong_Type.tp_name, uint_max, test_var);
20344 0 : return -1;
20345 : }
20346 0 : object->ServicePackMajor = test_var;
20347 : } else {
20348 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20349 : PyLong_Type.tp_name);
20350 0 : return -1;
20351 : }
20352 : }
20353 0 : return 0;
20354 : }
20355 :
20356 0 : static PyObject *py_netr_OsVersionInfoEx_get_ServicePackMinor(PyObject *obj, void *closure)
20357 : {
20358 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20359 : PyObject *py_ServicePackMinor;
20360 0 : py_ServicePackMinor = PyLong_FromLong((uint16_t)object->ServicePackMinor);
20361 0 : return py_ServicePackMinor;
20362 : }
20363 :
20364 0 : static int py_netr_OsVersionInfoEx_set_ServicePackMinor(PyObject *py_obj, PyObject *value, void *closure)
20365 : {
20366 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20367 0 : if (value == NULL) {
20368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ServicePackMinor");
20369 0 : return -1;
20370 : }
20371 : {
20372 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ServicePackMinor));
20373 0 : if (PyLong_Check(value)) {
20374 : unsigned long long test_var;
20375 0 : test_var = PyLong_AsUnsignedLongLong(value);
20376 0 : if (PyErr_Occurred() != NULL) {
20377 0 : return -1;
20378 : }
20379 0 : if (test_var > uint_max) {
20380 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20381 : PyLong_Type.tp_name, uint_max, test_var);
20382 0 : return -1;
20383 : }
20384 0 : object->ServicePackMinor = test_var;
20385 : } else {
20386 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20387 : PyLong_Type.tp_name);
20388 0 : return -1;
20389 : }
20390 : }
20391 0 : return 0;
20392 : }
20393 :
20394 0 : static PyObject *py_netr_OsVersionInfoEx_get_SuiteMask(PyObject *obj, void *closure)
20395 : {
20396 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20397 : PyObject *py_SuiteMask;
20398 0 : py_SuiteMask = PyLong_FromLong((uint16_t)object->SuiteMask);
20399 0 : return py_SuiteMask;
20400 : }
20401 :
20402 0 : static int py_netr_OsVersionInfoEx_set_SuiteMask(PyObject *py_obj, PyObject *value, void *closure)
20403 : {
20404 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20405 0 : if (value == NULL) {
20406 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SuiteMask");
20407 0 : return -1;
20408 : }
20409 : {
20410 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SuiteMask));
20411 0 : if (PyLong_Check(value)) {
20412 : unsigned long long test_var;
20413 0 : test_var = PyLong_AsUnsignedLongLong(value);
20414 0 : if (PyErr_Occurred() != NULL) {
20415 0 : return -1;
20416 : }
20417 0 : if (test_var > uint_max) {
20418 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20419 : PyLong_Type.tp_name, uint_max, test_var);
20420 0 : return -1;
20421 : }
20422 0 : object->SuiteMask = test_var;
20423 : } else {
20424 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20425 : PyLong_Type.tp_name);
20426 0 : return -1;
20427 : }
20428 : }
20429 0 : return 0;
20430 : }
20431 :
20432 0 : static PyObject *py_netr_OsVersionInfoEx_get_ProductType(PyObject *obj, void *closure)
20433 : {
20434 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20435 : PyObject *py_ProductType;
20436 0 : py_ProductType = PyLong_FromLong((uint16_t)object->ProductType);
20437 0 : return py_ProductType;
20438 : }
20439 :
20440 0 : static int py_netr_OsVersionInfoEx_set_ProductType(PyObject *py_obj, PyObject *value, void *closure)
20441 : {
20442 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20443 0 : if (value == NULL) {
20444 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ProductType");
20445 0 : return -1;
20446 : }
20447 : {
20448 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ProductType));
20449 0 : if (PyLong_Check(value)) {
20450 : unsigned long long test_var;
20451 0 : test_var = PyLong_AsUnsignedLongLong(value);
20452 0 : if (PyErr_Occurred() != NULL) {
20453 0 : return -1;
20454 : }
20455 0 : if (test_var > uint_max) {
20456 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20457 : PyLong_Type.tp_name, uint_max, test_var);
20458 0 : return -1;
20459 : }
20460 0 : object->ProductType = test_var;
20461 : } else {
20462 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20463 : PyLong_Type.tp_name);
20464 0 : return -1;
20465 : }
20466 : }
20467 0 : return 0;
20468 : }
20469 :
20470 0 : static PyObject *py_netr_OsVersionInfoEx_get_Reserved(PyObject *obj, void *closure)
20471 : {
20472 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(obj);
20473 : PyObject *py_Reserved;
20474 0 : py_Reserved = PyLong_FromLong((uint16_t)object->Reserved);
20475 0 : return py_Reserved;
20476 : }
20477 :
20478 0 : static int py_netr_OsVersionInfoEx_set_Reserved(PyObject *py_obj, PyObject *value, void *closure)
20479 : {
20480 0 : struct netr_OsVersionInfoEx *object = (struct netr_OsVersionInfoEx *)pytalloc_get_ptr(py_obj);
20481 0 : if (value == NULL) {
20482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->Reserved");
20483 0 : return -1;
20484 : }
20485 : {
20486 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Reserved));
20487 0 : if (PyLong_Check(value)) {
20488 : unsigned long long test_var;
20489 0 : test_var = PyLong_AsUnsignedLongLong(value);
20490 0 : if (PyErr_Occurred() != NULL) {
20491 0 : return -1;
20492 : }
20493 0 : if (test_var > uint_max) {
20494 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20495 : PyLong_Type.tp_name, uint_max, test_var);
20496 0 : return -1;
20497 : }
20498 0 : object->Reserved = test_var;
20499 : } else {
20500 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20501 : PyLong_Type.tp_name);
20502 0 : return -1;
20503 : }
20504 : }
20505 0 : return 0;
20506 : }
20507 :
20508 : static PyGetSetDef py_netr_OsVersionInfoEx_getsetters[] = {
20509 : {
20510 : .name = discard_const_p(char, "OSVersionInfoSize"),
20511 : .get = py_netr_OsVersionInfoEx_get_OSVersionInfoSize,
20512 : .set = py_netr_OsVersionInfoEx_set_OSVersionInfoSize,
20513 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20514 : },
20515 : {
20516 : .name = discard_const_p(char, "MajorVersion"),
20517 : .get = py_netr_OsVersionInfoEx_get_MajorVersion,
20518 : .set = py_netr_OsVersionInfoEx_set_MajorVersion,
20519 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20520 : },
20521 : {
20522 : .name = discard_const_p(char, "MinorVersion"),
20523 : .get = py_netr_OsVersionInfoEx_get_MinorVersion,
20524 : .set = py_netr_OsVersionInfoEx_set_MinorVersion,
20525 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20526 : },
20527 : {
20528 : .name = discard_const_p(char, "BuildNumber"),
20529 : .get = py_netr_OsVersionInfoEx_get_BuildNumber,
20530 : .set = py_netr_OsVersionInfoEx_set_BuildNumber,
20531 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20532 : },
20533 : {
20534 : .name = discard_const_p(char, "PlatformId"),
20535 : .get = py_netr_OsVersionInfoEx_get_PlatformId,
20536 : .set = py_netr_OsVersionInfoEx_set_PlatformId,
20537 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20538 : },
20539 : {
20540 : .name = discard_const_p(char, "CSDVersion"),
20541 : .get = py_netr_OsVersionInfoEx_get_CSDVersion,
20542 : .set = py_netr_OsVersionInfoEx_set_CSDVersion,
20543 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
20544 : },
20545 : {
20546 : .name = discard_const_p(char, "ServicePackMajor"),
20547 : .get = py_netr_OsVersionInfoEx_get_ServicePackMajor,
20548 : .set = py_netr_OsVersionInfoEx_set_ServicePackMajor,
20549 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
20550 : },
20551 : {
20552 : .name = discard_const_p(char, "ServicePackMinor"),
20553 : .get = py_netr_OsVersionInfoEx_get_ServicePackMinor,
20554 : .set = py_netr_OsVersionInfoEx_set_ServicePackMinor,
20555 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
20556 : },
20557 : {
20558 : .name = discard_const_p(char, "SuiteMask"),
20559 : .get = py_netr_OsVersionInfoEx_get_SuiteMask,
20560 : .set = py_netr_OsVersionInfoEx_set_SuiteMask,
20561 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SuiteMask")
20562 : },
20563 : {
20564 : .name = discard_const_p(char, "ProductType"),
20565 : .get = py_netr_OsVersionInfoEx_get_ProductType,
20566 : .set = py_netr_OsVersionInfoEx_set_ProductType,
20567 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_ProductType")
20568 : },
20569 : {
20570 : .name = discard_const_p(char, "Reserved"),
20571 : .get = py_netr_OsVersionInfoEx_get_Reserved,
20572 : .set = py_netr_OsVersionInfoEx_set_Reserved,
20573 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
20574 : },
20575 : { .name = NULL }
20576 : };
20577 :
20578 0 : static PyObject *py_netr_OsVersionInfoEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20579 : {
20580 0 : return pytalloc_new(struct netr_OsVersionInfoEx, type);
20581 : }
20582 :
20583 :
20584 : static PyTypeObject netr_OsVersionInfoEx_Type = {
20585 : PyVarObject_HEAD_INIT(NULL, 0)
20586 : .tp_name = "netlogon.netr_OsVersionInfoEx",
20587 : .tp_getset = py_netr_OsVersionInfoEx_getsetters,
20588 : .tp_methods = NULL,
20589 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20590 : .tp_new = py_netr_OsVersionInfoEx_new,
20591 : };
20592 :
20593 :
20594 0 : static PyObject *py_netr_OsVersion_get_length(PyObject *obj, void *closure)
20595 : {
20596 0 : struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(obj);
20597 : PyObject *py_length;
20598 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
20599 0 : return py_length;
20600 : }
20601 :
20602 0 : static int py_netr_OsVersion_set_length(PyObject *py_obj, PyObject *value, void *closure)
20603 : {
20604 0 : struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(py_obj);
20605 0 : if (value == NULL) {
20606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
20607 0 : return -1;
20608 : }
20609 : {
20610 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
20611 0 : if (PyLong_Check(value)) {
20612 : unsigned long long test_var;
20613 0 : test_var = PyLong_AsUnsignedLongLong(value);
20614 0 : if (PyErr_Occurred() != NULL) {
20615 0 : return -1;
20616 : }
20617 0 : if (test_var > uint_max) {
20618 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20619 : PyLong_Type.tp_name, uint_max, test_var);
20620 0 : return -1;
20621 : }
20622 0 : object->length = test_var;
20623 : } else {
20624 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20625 : PyLong_Type.tp_name);
20626 0 : return -1;
20627 : }
20628 : }
20629 0 : return 0;
20630 : }
20631 :
20632 0 : static PyObject *py_netr_OsVersion_get_dummy(PyObject *obj, void *closure)
20633 : {
20634 0 : struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(obj);
20635 : PyObject *py_dummy;
20636 0 : py_dummy = PyLong_FromUnsignedLongLong((uint32_t)object->dummy);
20637 0 : return py_dummy;
20638 : }
20639 :
20640 0 : static int py_netr_OsVersion_set_dummy(PyObject *py_obj, PyObject *value, void *closure)
20641 : {
20642 0 : struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(py_obj);
20643 0 : if (value == NULL) {
20644 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy");
20645 0 : return -1;
20646 : }
20647 : {
20648 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy));
20649 0 : if (PyLong_Check(value)) {
20650 : unsigned long long test_var;
20651 0 : test_var = PyLong_AsUnsignedLongLong(value);
20652 0 : if (PyErr_Occurred() != NULL) {
20653 0 : return -1;
20654 : }
20655 0 : if (test_var > uint_max) {
20656 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20657 : PyLong_Type.tp_name, uint_max, test_var);
20658 0 : return -1;
20659 : }
20660 0 : object->dummy = test_var;
20661 : } else {
20662 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20663 : PyLong_Type.tp_name);
20664 0 : return -1;
20665 : }
20666 : }
20667 0 : return 0;
20668 : }
20669 :
20670 0 : static PyObject *py_netr_OsVersion_get_size(PyObject *obj, void *closure)
20671 : {
20672 0 : struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(obj);
20673 : PyObject *py_size;
20674 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
20675 0 : return py_size;
20676 : }
20677 :
20678 0 : static int py_netr_OsVersion_set_size(PyObject *py_obj, PyObject *value, void *closure)
20679 : {
20680 0 : struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(py_obj);
20681 0 : if (value == NULL) {
20682 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
20683 0 : return -1;
20684 : }
20685 : {
20686 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
20687 0 : if (PyLong_Check(value)) {
20688 : unsigned long long test_var;
20689 0 : test_var = PyLong_AsUnsignedLongLong(value);
20690 0 : if (PyErr_Occurred() != NULL) {
20691 0 : return -1;
20692 : }
20693 0 : if (test_var > uint_max) {
20694 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20695 : PyLong_Type.tp_name, uint_max, test_var);
20696 0 : return -1;
20697 : }
20698 0 : object->size = test_var;
20699 : } else {
20700 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20701 : PyLong_Type.tp_name);
20702 0 : return -1;
20703 : }
20704 : }
20705 0 : return 0;
20706 : }
20707 :
20708 0 : static PyObject *py_netr_OsVersion_get_os(PyObject *obj, void *closure)
20709 : {
20710 0 : struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(obj);
20711 : PyObject *py_os;
20712 0 : py_os = pytalloc_reference_ex(&netr_OsVersionInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->os);
20713 0 : return py_os;
20714 : }
20715 :
20716 0 : static int py_netr_OsVersion_set_os(PyObject *py_obj, PyObject *value, void *closure)
20717 : {
20718 0 : struct netr_OsVersion *object = (struct netr_OsVersion *)pytalloc_get_ptr(py_obj);
20719 0 : if (value == NULL) {
20720 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->os");
20721 0 : return -1;
20722 : }
20723 0 : PY_CHECK_TYPE(&netr_OsVersionInfoEx_Type, value, return -1;);
20724 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20725 0 : PyErr_NoMemory();
20726 0 : return -1;
20727 : }
20728 0 : object->os = *(struct netr_OsVersionInfoEx *)pytalloc_get_ptr(value);
20729 0 : return 0;
20730 : }
20731 :
20732 : static PyGetSetDef py_netr_OsVersion_getsetters[] = {
20733 : {
20734 : .name = discard_const_p(char, "length"),
20735 : .get = py_netr_OsVersion_get_length,
20736 : .set = py_netr_OsVersion_set_length,
20737 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
20738 : },
20739 : {
20740 : .name = discard_const_p(char, "dummy"),
20741 : .get = py_netr_OsVersion_get_dummy,
20742 : .set = py_netr_OsVersion_set_dummy,
20743 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
20744 : },
20745 : {
20746 : .name = discard_const_p(char, "size"),
20747 : .get = py_netr_OsVersion_get_size,
20748 : .set = py_netr_OsVersion_set_size,
20749 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
20750 : },
20751 : {
20752 : .name = discard_const_p(char, "os"),
20753 : .get = py_netr_OsVersion_get_os,
20754 : .set = py_netr_OsVersion_set_os,
20755 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_OsVersionInfoEx")
20756 : },
20757 : { .name = NULL }
20758 : };
20759 :
20760 0 : static PyObject *py_netr_OsVersion_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20761 : {
20762 0 : return pytalloc_new(struct netr_OsVersion, type);
20763 : }
20764 :
20765 :
20766 : static PyTypeObject netr_OsVersion_Type = {
20767 : PyVarObject_HEAD_INIT(NULL, 0)
20768 : .tp_name = "netlogon.netr_OsVersion",
20769 : .tp_getset = py_netr_OsVersion_getsetters,
20770 : .tp_methods = NULL,
20771 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20772 : .tp_new = py_netr_OsVersion_new,
20773 : };
20774 :
20775 :
20776 0 : static PyObject *py_netr_OsVersionContainer_get_length(PyObject *obj, void *closure)
20777 : {
20778 0 : struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(obj);
20779 : PyObject *py_length;
20780 0 : py_length = PyLong_FromLong((uint16_t)object->length);
20781 0 : return py_length;
20782 : }
20783 :
20784 0 : static int py_netr_OsVersionContainer_set_length(PyObject *py_obj, PyObject *value, void *closure)
20785 : {
20786 0 : struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(py_obj);
20787 0 : if (value == NULL) {
20788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
20789 0 : return -1;
20790 : }
20791 : {
20792 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
20793 0 : if (PyLong_Check(value)) {
20794 : unsigned long long test_var;
20795 0 : test_var = PyLong_AsUnsignedLongLong(value);
20796 0 : if (PyErr_Occurred() != NULL) {
20797 0 : return -1;
20798 : }
20799 0 : if (test_var > uint_max) {
20800 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20801 : PyLong_Type.tp_name, uint_max, test_var);
20802 0 : return -1;
20803 : }
20804 0 : object->length = test_var;
20805 : } else {
20806 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20807 : PyLong_Type.tp_name);
20808 0 : return -1;
20809 : }
20810 : }
20811 0 : return 0;
20812 : }
20813 :
20814 0 : static PyObject *py_netr_OsVersionContainer_get_size(PyObject *obj, void *closure)
20815 : {
20816 0 : struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(obj);
20817 : PyObject *py_size;
20818 0 : py_size = PyLong_FromLong((uint16_t)object->size);
20819 0 : return py_size;
20820 : }
20821 :
20822 0 : static int py_netr_OsVersionContainer_set_size(PyObject *py_obj, PyObject *value, void *closure)
20823 : {
20824 0 : struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(py_obj);
20825 0 : if (value == NULL) {
20826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
20827 0 : return -1;
20828 : }
20829 : {
20830 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
20831 0 : if (PyLong_Check(value)) {
20832 : unsigned long long test_var;
20833 0 : test_var = PyLong_AsUnsignedLongLong(value);
20834 0 : if (PyErr_Occurred() != NULL) {
20835 0 : return -1;
20836 : }
20837 0 : if (test_var > uint_max) {
20838 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20839 : PyLong_Type.tp_name, uint_max, test_var);
20840 0 : return -1;
20841 : }
20842 0 : object->size = test_var;
20843 : } else {
20844 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20845 : PyLong_Type.tp_name);
20846 0 : return -1;
20847 : }
20848 : }
20849 0 : return 0;
20850 : }
20851 :
20852 0 : static PyObject *py_netr_OsVersionContainer_get_os(PyObject *obj, void *closure)
20853 : {
20854 0 : struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(obj);
20855 : PyObject *py_os;
20856 0 : if (object->os == NULL) {
20857 0 : Py_RETURN_NONE;
20858 : }
20859 0 : if (object->os == NULL) {
20860 0 : py_os = Py_None;
20861 0 : Py_INCREF(py_os);
20862 : } else {
20863 0 : py_os = pytalloc_reference_ex(&netr_OsVersion_Type, object->os, object->os);
20864 : }
20865 0 : return py_os;
20866 : }
20867 :
20868 0 : static int py_netr_OsVersionContainer_set_os(PyObject *py_obj, PyObject *value, void *closure)
20869 : {
20870 0 : struct netr_OsVersionContainer *object = (struct netr_OsVersionContainer *)pytalloc_get_ptr(py_obj);
20871 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->os));
20872 0 : if (value == NULL) {
20873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->os");
20874 0 : return -1;
20875 : }
20876 0 : if (value == Py_None) {
20877 0 : object->os = NULL;
20878 : } else {
20879 0 : object->os = NULL;
20880 0 : PY_CHECK_TYPE(&netr_OsVersion_Type, value, return -1;);
20881 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20882 0 : PyErr_NoMemory();
20883 0 : return -1;
20884 : }
20885 0 : object->os = (struct netr_OsVersion *)pytalloc_get_ptr(value);
20886 : }
20887 0 : return 0;
20888 : }
20889 :
20890 : static PyGetSetDef py_netr_OsVersionContainer_getsetters[] = {
20891 : {
20892 : .name = discard_const_p(char, "length"),
20893 : .get = py_netr_OsVersionContainer_get_length,
20894 : .set = py_netr_OsVersionContainer_set_length,
20895 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
20896 : },
20897 : {
20898 : .name = discard_const_p(char, "size"),
20899 : .get = py_netr_OsVersionContainer_get_size,
20900 : .set = py_netr_OsVersionContainer_set_size,
20901 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
20902 : },
20903 : {
20904 : .name = discard_const_p(char, "os"),
20905 : .get = py_netr_OsVersionContainer_get_os,
20906 : .set = py_netr_OsVersionContainer_set_os,
20907 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_OsVersion")
20908 : },
20909 : { .name = NULL }
20910 : };
20911 :
20912 0 : static PyObject *py_netr_OsVersionContainer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20913 : {
20914 0 : return pytalloc_new(struct netr_OsVersionContainer, type);
20915 : }
20916 :
20917 :
20918 : static PyTypeObject netr_OsVersionContainer_Type = {
20919 : PyVarObject_HEAD_INIT(NULL, 0)
20920 : .tp_name = "netlogon.netr_OsVersionContainer",
20921 : .tp_getset = py_netr_OsVersionContainer_getsetters,
20922 : .tp_methods = NULL,
20923 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20924 : .tp_new = py_netr_OsVersionContainer_new,
20925 : };
20926 :
20927 :
20928 0 : static PyObject *py_netr_WorkstationInformation_get_lsa_policy(PyObject *obj, void *closure)
20929 : {
20930 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
20931 : PyObject *py_lsa_policy;
20932 0 : py_lsa_policy = pytalloc_reference_ex(&netr_LsaPolicyInformation_Type, pytalloc_get_mem_ctx(obj), &object->lsa_policy);
20933 0 : return py_lsa_policy;
20934 : }
20935 :
20936 0 : static int py_netr_WorkstationInformation_set_lsa_policy(PyObject *py_obj, PyObject *value, void *closure)
20937 : {
20938 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
20939 0 : if (value == NULL) {
20940 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lsa_policy");
20941 0 : return -1;
20942 : }
20943 0 : PY_CHECK_TYPE(&netr_LsaPolicyInformation_Type, value, return -1;);
20944 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20945 0 : PyErr_NoMemory();
20946 0 : return -1;
20947 : }
20948 0 : object->lsa_policy = *(struct netr_LsaPolicyInformation *)pytalloc_get_ptr(value);
20949 0 : return 0;
20950 : }
20951 :
20952 0 : static PyObject *py_netr_WorkstationInformation_get_dns_hostname(PyObject *obj, void *closure)
20953 : {
20954 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
20955 : PyObject *py_dns_hostname;
20956 0 : if (object->dns_hostname == NULL) {
20957 0 : Py_RETURN_NONE;
20958 : }
20959 0 : if (object->dns_hostname == NULL) {
20960 0 : py_dns_hostname = Py_None;
20961 0 : Py_INCREF(py_dns_hostname);
20962 : } else {
20963 0 : if (object->dns_hostname == NULL) {
20964 0 : py_dns_hostname = Py_None;
20965 0 : Py_INCREF(py_dns_hostname);
20966 : } else {
20967 0 : py_dns_hostname = PyUnicode_Decode(object->dns_hostname, strlen(object->dns_hostname), "utf-8", "ignore");
20968 : }
20969 : }
20970 0 : return py_dns_hostname;
20971 : }
20972 :
20973 21 : static int py_netr_WorkstationInformation_set_dns_hostname(PyObject *py_obj, PyObject *value, void *closure)
20974 : {
20975 21 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
20976 21 : if (value == NULL) {
20977 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_hostname");
20978 0 : return -1;
20979 : }
20980 21 : if (value == Py_None) {
20981 0 : object->dns_hostname = NULL;
20982 : } else {
20983 21 : object->dns_hostname = NULL;
20984 : {
20985 : const char *test_str;
20986 : const char *talloc_str;
20987 21 : PyObject *unicode = NULL;
20988 21 : if (PyUnicode_Check(value)) {
20989 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
20990 0 : if (unicode == NULL) {
20991 0 : PyErr_NoMemory();
20992 0 : return -1;
20993 : }
20994 0 : test_str = PyBytes_AS_STRING(unicode);
20995 21 : } else if (PyBytes_Check(value)) {
20996 21 : test_str = PyBytes_AS_STRING(value);
20997 : } else {
20998 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
20999 0 : return -1;
21000 : }
21001 21 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21002 21 : if (unicode != NULL) {
21003 0 : Py_DECREF(unicode);
21004 : }
21005 21 : if (talloc_str == NULL) {
21006 0 : PyErr_NoMemory();
21007 0 : return -1;
21008 : }
21009 21 : object->dns_hostname = talloc_str;
21010 : }
21011 : }
21012 21 : return 0;
21013 : }
21014 :
21015 0 : static PyObject *py_netr_WorkstationInformation_get_sitename(PyObject *obj, void *closure)
21016 : {
21017 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21018 : PyObject *py_sitename;
21019 0 : if (object->sitename == NULL) {
21020 0 : Py_RETURN_NONE;
21021 : }
21022 0 : if (object->sitename == NULL) {
21023 0 : py_sitename = Py_None;
21024 0 : Py_INCREF(py_sitename);
21025 : } else {
21026 0 : if (object->sitename == NULL) {
21027 0 : py_sitename = Py_None;
21028 0 : Py_INCREF(py_sitename);
21029 : } else {
21030 0 : py_sitename = PyUnicode_Decode(object->sitename, strlen(object->sitename), "utf-8", "ignore");
21031 : }
21032 : }
21033 0 : return py_sitename;
21034 : }
21035 :
21036 0 : static int py_netr_WorkstationInformation_set_sitename(PyObject *py_obj, PyObject *value, void *closure)
21037 : {
21038 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21039 0 : if (value == NULL) {
21040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename");
21041 0 : return -1;
21042 : }
21043 0 : if (value == Py_None) {
21044 0 : object->sitename = NULL;
21045 : } else {
21046 0 : object->sitename = NULL;
21047 : {
21048 : const char *test_str;
21049 : const char *talloc_str;
21050 0 : PyObject *unicode = NULL;
21051 0 : if (PyUnicode_Check(value)) {
21052 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21053 0 : if (unicode == NULL) {
21054 0 : PyErr_NoMemory();
21055 0 : return -1;
21056 : }
21057 0 : test_str = PyBytes_AS_STRING(unicode);
21058 0 : } else if (PyBytes_Check(value)) {
21059 0 : test_str = PyBytes_AS_STRING(value);
21060 : } else {
21061 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21062 0 : return -1;
21063 : }
21064 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21065 0 : if (unicode != NULL) {
21066 0 : Py_DECREF(unicode);
21067 : }
21068 0 : if (talloc_str == NULL) {
21069 0 : PyErr_NoMemory();
21070 0 : return -1;
21071 : }
21072 0 : object->sitename = talloc_str;
21073 : }
21074 : }
21075 0 : return 0;
21076 : }
21077 :
21078 0 : static PyObject *py_netr_WorkstationInformation_get_dummy1(PyObject *obj, void *closure)
21079 : {
21080 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21081 : PyObject *py_dummy1;
21082 0 : if (object->dummy1 == NULL) {
21083 0 : Py_RETURN_NONE;
21084 : }
21085 0 : if (object->dummy1 == NULL) {
21086 0 : py_dummy1 = Py_None;
21087 0 : Py_INCREF(py_dummy1);
21088 : } else {
21089 0 : if (object->dummy1 == NULL) {
21090 0 : py_dummy1 = Py_None;
21091 0 : Py_INCREF(py_dummy1);
21092 : } else {
21093 0 : py_dummy1 = PyUnicode_Decode(object->dummy1, strlen(object->dummy1), "utf-8", "ignore");
21094 : }
21095 : }
21096 0 : return py_dummy1;
21097 : }
21098 :
21099 0 : static int py_netr_WorkstationInformation_set_dummy1(PyObject *py_obj, PyObject *value, void *closure)
21100 : {
21101 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21102 0 : if (value == NULL) {
21103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy1");
21104 0 : return -1;
21105 : }
21106 0 : if (value == Py_None) {
21107 0 : object->dummy1 = NULL;
21108 : } else {
21109 0 : object->dummy1 = NULL;
21110 : {
21111 : const char *test_str;
21112 : const char *talloc_str;
21113 0 : PyObject *unicode = NULL;
21114 0 : if (PyUnicode_Check(value)) {
21115 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21116 0 : if (unicode == NULL) {
21117 0 : PyErr_NoMemory();
21118 0 : return -1;
21119 : }
21120 0 : test_str = PyBytes_AS_STRING(unicode);
21121 0 : } else if (PyBytes_Check(value)) {
21122 0 : test_str = PyBytes_AS_STRING(value);
21123 : } else {
21124 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21125 0 : return -1;
21126 : }
21127 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21128 0 : if (unicode != NULL) {
21129 0 : Py_DECREF(unicode);
21130 : }
21131 0 : if (talloc_str == NULL) {
21132 0 : PyErr_NoMemory();
21133 0 : return -1;
21134 : }
21135 0 : object->dummy1 = talloc_str;
21136 : }
21137 : }
21138 0 : return 0;
21139 : }
21140 :
21141 0 : static PyObject *py_netr_WorkstationInformation_get_dummy2(PyObject *obj, void *closure)
21142 : {
21143 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21144 : PyObject *py_dummy2;
21145 0 : if (object->dummy2 == NULL) {
21146 0 : Py_RETURN_NONE;
21147 : }
21148 0 : if (object->dummy2 == NULL) {
21149 0 : py_dummy2 = Py_None;
21150 0 : Py_INCREF(py_dummy2);
21151 : } else {
21152 0 : if (object->dummy2 == NULL) {
21153 0 : py_dummy2 = Py_None;
21154 0 : Py_INCREF(py_dummy2);
21155 : } else {
21156 0 : py_dummy2 = PyUnicode_Decode(object->dummy2, strlen(object->dummy2), "utf-8", "ignore");
21157 : }
21158 : }
21159 0 : return py_dummy2;
21160 : }
21161 :
21162 0 : static int py_netr_WorkstationInformation_set_dummy2(PyObject *py_obj, PyObject *value, void *closure)
21163 : {
21164 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21165 0 : if (value == NULL) {
21166 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy2");
21167 0 : return -1;
21168 : }
21169 0 : if (value == Py_None) {
21170 0 : object->dummy2 = NULL;
21171 : } else {
21172 0 : object->dummy2 = NULL;
21173 : {
21174 : const char *test_str;
21175 : const char *talloc_str;
21176 0 : PyObject *unicode = NULL;
21177 0 : if (PyUnicode_Check(value)) {
21178 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21179 0 : if (unicode == NULL) {
21180 0 : PyErr_NoMemory();
21181 0 : return -1;
21182 : }
21183 0 : test_str = PyBytes_AS_STRING(unicode);
21184 0 : } else if (PyBytes_Check(value)) {
21185 0 : test_str = PyBytes_AS_STRING(value);
21186 : } else {
21187 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21188 0 : return -1;
21189 : }
21190 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21191 0 : if (unicode != NULL) {
21192 0 : Py_DECREF(unicode);
21193 : }
21194 0 : if (talloc_str == NULL) {
21195 0 : PyErr_NoMemory();
21196 0 : return -1;
21197 : }
21198 0 : object->dummy2 = talloc_str;
21199 : }
21200 : }
21201 0 : return 0;
21202 : }
21203 :
21204 0 : static PyObject *py_netr_WorkstationInformation_get_dummy3(PyObject *obj, void *closure)
21205 : {
21206 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21207 : PyObject *py_dummy3;
21208 0 : if (object->dummy3 == NULL) {
21209 0 : Py_RETURN_NONE;
21210 : }
21211 0 : if (object->dummy3 == NULL) {
21212 0 : py_dummy3 = Py_None;
21213 0 : Py_INCREF(py_dummy3);
21214 : } else {
21215 0 : if (object->dummy3 == NULL) {
21216 0 : py_dummy3 = Py_None;
21217 0 : Py_INCREF(py_dummy3);
21218 : } else {
21219 0 : py_dummy3 = PyUnicode_Decode(object->dummy3, strlen(object->dummy3), "utf-8", "ignore");
21220 : }
21221 : }
21222 0 : return py_dummy3;
21223 : }
21224 :
21225 0 : static int py_netr_WorkstationInformation_set_dummy3(PyObject *py_obj, PyObject *value, void *closure)
21226 : {
21227 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21228 0 : if (value == NULL) {
21229 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy3");
21230 0 : return -1;
21231 : }
21232 0 : if (value == Py_None) {
21233 0 : object->dummy3 = NULL;
21234 : } else {
21235 0 : object->dummy3 = NULL;
21236 : {
21237 : const char *test_str;
21238 : const char *talloc_str;
21239 0 : PyObject *unicode = NULL;
21240 0 : if (PyUnicode_Check(value)) {
21241 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21242 0 : if (unicode == NULL) {
21243 0 : PyErr_NoMemory();
21244 0 : return -1;
21245 : }
21246 0 : test_str = PyBytes_AS_STRING(unicode);
21247 0 : } else if (PyBytes_Check(value)) {
21248 0 : test_str = PyBytes_AS_STRING(value);
21249 : } else {
21250 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21251 0 : return -1;
21252 : }
21253 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21254 0 : if (unicode != NULL) {
21255 0 : Py_DECREF(unicode);
21256 : }
21257 0 : if (talloc_str == NULL) {
21258 0 : PyErr_NoMemory();
21259 0 : return -1;
21260 : }
21261 0 : object->dummy3 = talloc_str;
21262 : }
21263 : }
21264 0 : return 0;
21265 : }
21266 :
21267 0 : static PyObject *py_netr_WorkstationInformation_get_dummy4(PyObject *obj, void *closure)
21268 : {
21269 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21270 : PyObject *py_dummy4;
21271 0 : if (object->dummy4 == NULL) {
21272 0 : Py_RETURN_NONE;
21273 : }
21274 0 : if (object->dummy4 == NULL) {
21275 0 : py_dummy4 = Py_None;
21276 0 : Py_INCREF(py_dummy4);
21277 : } else {
21278 0 : if (object->dummy4 == NULL) {
21279 0 : py_dummy4 = Py_None;
21280 0 : Py_INCREF(py_dummy4);
21281 : } else {
21282 0 : py_dummy4 = PyUnicode_Decode(object->dummy4, strlen(object->dummy4), "utf-8", "ignore");
21283 : }
21284 : }
21285 0 : return py_dummy4;
21286 : }
21287 :
21288 0 : static int py_netr_WorkstationInformation_set_dummy4(PyObject *py_obj, PyObject *value, void *closure)
21289 : {
21290 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21291 0 : if (value == NULL) {
21292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy4");
21293 0 : return -1;
21294 : }
21295 0 : if (value == Py_None) {
21296 0 : object->dummy4 = NULL;
21297 : } else {
21298 0 : object->dummy4 = NULL;
21299 : {
21300 : const char *test_str;
21301 : const char *talloc_str;
21302 0 : PyObject *unicode = NULL;
21303 0 : if (PyUnicode_Check(value)) {
21304 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
21305 0 : if (unicode == NULL) {
21306 0 : PyErr_NoMemory();
21307 0 : return -1;
21308 : }
21309 0 : test_str = PyBytes_AS_STRING(unicode);
21310 0 : } else if (PyBytes_Check(value)) {
21311 0 : test_str = PyBytes_AS_STRING(value);
21312 : } else {
21313 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
21314 0 : return -1;
21315 : }
21316 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
21317 0 : if (unicode != NULL) {
21318 0 : Py_DECREF(unicode);
21319 : }
21320 0 : if (talloc_str == NULL) {
21321 0 : PyErr_NoMemory();
21322 0 : return -1;
21323 : }
21324 0 : object->dummy4 = talloc_str;
21325 : }
21326 : }
21327 0 : return 0;
21328 : }
21329 :
21330 0 : static PyObject *py_netr_WorkstationInformation_get_os_version(PyObject *obj, void *closure)
21331 : {
21332 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21333 : PyObject *py_os_version;
21334 0 : py_os_version = pytalloc_reference_ex(&netr_OsVersionContainer_Type, pytalloc_get_mem_ctx(obj), &object->os_version);
21335 0 : return py_os_version;
21336 : }
21337 :
21338 0 : static int py_netr_WorkstationInformation_set_os_version(PyObject *py_obj, PyObject *value, void *closure)
21339 : {
21340 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21341 0 : if (value == NULL) {
21342 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->os_version");
21343 0 : return -1;
21344 : }
21345 0 : PY_CHECK_TYPE(&netr_OsVersionContainer_Type, value, return -1;);
21346 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21347 0 : PyErr_NoMemory();
21348 0 : return -1;
21349 : }
21350 0 : object->os_version = *(struct netr_OsVersionContainer *)pytalloc_get_ptr(value);
21351 0 : return 0;
21352 : }
21353 :
21354 0 : static PyObject *py_netr_WorkstationInformation_get_os_name(PyObject *obj, void *closure)
21355 : {
21356 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21357 : PyObject *py_os_name;
21358 0 : py_os_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->os_name);
21359 0 : return py_os_name;
21360 : }
21361 :
21362 21 : static int py_netr_WorkstationInformation_set_os_name(PyObject *py_obj, PyObject *value, void *closure)
21363 : {
21364 21 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21365 21 : if (value == NULL) {
21366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->os_name");
21367 0 : return -1;
21368 : }
21369 21 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
21370 21 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21371 0 : PyErr_NoMemory();
21372 0 : return -1;
21373 : }
21374 21 : object->os_name = *(struct lsa_String *)pytalloc_get_ptr(value);
21375 21 : return 0;
21376 : }
21377 :
21378 0 : static PyObject *py_netr_WorkstationInformation_get_dummy_string3(PyObject *obj, void *closure)
21379 : {
21380 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21381 : PyObject *py_dummy_string3;
21382 0 : py_dummy_string3 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string3);
21383 0 : return py_dummy_string3;
21384 : }
21385 :
21386 0 : static int py_netr_WorkstationInformation_set_dummy_string3(PyObject *py_obj, PyObject *value, void *closure)
21387 : {
21388 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21389 0 : if (value == NULL) {
21390 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string3");
21391 0 : return -1;
21392 : }
21393 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
21394 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21395 0 : PyErr_NoMemory();
21396 0 : return -1;
21397 : }
21398 0 : object->dummy_string3 = *(struct lsa_String *)pytalloc_get_ptr(value);
21399 0 : return 0;
21400 : }
21401 :
21402 0 : static PyObject *py_netr_WorkstationInformation_get_dummy_string4(PyObject *obj, void *closure)
21403 : {
21404 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21405 : PyObject *py_dummy_string4;
21406 0 : py_dummy_string4 = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string4);
21407 0 : return py_dummy_string4;
21408 : }
21409 :
21410 0 : static int py_netr_WorkstationInformation_set_dummy_string4(PyObject *py_obj, PyObject *value, void *closure)
21411 : {
21412 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21413 0 : if (value == NULL) {
21414 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string4");
21415 0 : return -1;
21416 : }
21417 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
21418 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21419 0 : PyErr_NoMemory();
21420 0 : return -1;
21421 : }
21422 0 : object->dummy_string4 = *(struct lsa_String *)pytalloc_get_ptr(value);
21423 0 : return 0;
21424 : }
21425 :
21426 0 : static PyObject *py_netr_WorkstationInformation_get_workstation_flags(PyObject *obj, void *closure)
21427 : {
21428 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21429 : PyObject *py_workstation_flags;
21430 0 : py_workstation_flags = PyLong_FromUnsignedLongLong((uint32_t)object->workstation_flags);
21431 0 : return py_workstation_flags;
21432 : }
21433 :
21434 3 : static int py_netr_WorkstationInformation_set_workstation_flags(PyObject *py_obj, PyObject *value, void *closure)
21435 : {
21436 3 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21437 3 : if (value == NULL) {
21438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstation_flags");
21439 0 : return -1;
21440 : }
21441 : {
21442 3 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->workstation_flags));
21443 3 : if (PyLong_Check(value)) {
21444 : unsigned long long test_var;
21445 3 : test_var = PyLong_AsUnsignedLongLong(value);
21446 3 : if (PyErr_Occurred() != NULL) {
21447 0 : return -1;
21448 : }
21449 3 : if (test_var > uint_max) {
21450 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21451 : PyLong_Type.tp_name, uint_max, test_var);
21452 0 : return -1;
21453 : }
21454 3 : object->workstation_flags = test_var;
21455 : } else {
21456 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21457 : PyLong_Type.tp_name);
21458 0 : return -1;
21459 : }
21460 : }
21461 3 : return 0;
21462 : }
21463 :
21464 0 : static PyObject *py_netr_WorkstationInformation_get_supported_enc_types(PyObject *obj, void *closure)
21465 : {
21466 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21467 : PyObject *py_supported_enc_types;
21468 0 : py_supported_enc_types = PyLong_FromUnsignedLongLong((uint32_t)object->supported_enc_types);
21469 0 : return py_supported_enc_types;
21470 : }
21471 :
21472 0 : static int py_netr_WorkstationInformation_set_supported_enc_types(PyObject *py_obj, PyObject *value, void *closure)
21473 : {
21474 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21475 0 : if (value == NULL) {
21476 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->supported_enc_types");
21477 0 : return -1;
21478 : }
21479 : {
21480 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->supported_enc_types));
21481 0 : if (PyLong_Check(value)) {
21482 : unsigned long long test_var;
21483 0 : test_var = PyLong_AsUnsignedLongLong(value);
21484 0 : if (PyErr_Occurred() != NULL) {
21485 0 : return -1;
21486 : }
21487 0 : if (test_var > uint_max) {
21488 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21489 : PyLong_Type.tp_name, uint_max, test_var);
21490 0 : return -1;
21491 : }
21492 0 : object->supported_enc_types = test_var;
21493 : } else {
21494 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21495 : PyLong_Type.tp_name);
21496 0 : return -1;
21497 : }
21498 : }
21499 0 : return 0;
21500 : }
21501 :
21502 0 : static PyObject *py_netr_WorkstationInformation_get_dummy_long3(PyObject *obj, void *closure)
21503 : {
21504 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21505 : PyObject *py_dummy_long3;
21506 0 : py_dummy_long3 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long3);
21507 0 : return py_dummy_long3;
21508 : }
21509 :
21510 0 : static int py_netr_WorkstationInformation_set_dummy_long3(PyObject *py_obj, PyObject *value, void *closure)
21511 : {
21512 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21513 0 : if (value == NULL) {
21514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long3");
21515 0 : return -1;
21516 : }
21517 : {
21518 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long3));
21519 0 : if (PyLong_Check(value)) {
21520 : unsigned long long test_var;
21521 0 : test_var = PyLong_AsUnsignedLongLong(value);
21522 0 : if (PyErr_Occurred() != NULL) {
21523 0 : return -1;
21524 : }
21525 0 : if (test_var > uint_max) {
21526 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21527 : PyLong_Type.tp_name, uint_max, test_var);
21528 0 : return -1;
21529 : }
21530 0 : object->dummy_long3 = test_var;
21531 : } else {
21532 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21533 : PyLong_Type.tp_name);
21534 0 : return -1;
21535 : }
21536 : }
21537 0 : return 0;
21538 : }
21539 :
21540 0 : static PyObject *py_netr_WorkstationInformation_get_dummy_long4(PyObject *obj, void *closure)
21541 : {
21542 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(obj);
21543 : PyObject *py_dummy_long4;
21544 0 : py_dummy_long4 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long4);
21545 0 : return py_dummy_long4;
21546 : }
21547 :
21548 0 : static int py_netr_WorkstationInformation_set_dummy_long4(PyObject *py_obj, PyObject *value, void *closure)
21549 : {
21550 0 : struct netr_WorkstationInformation *object = (struct netr_WorkstationInformation *)pytalloc_get_ptr(py_obj);
21551 0 : if (value == NULL) {
21552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long4");
21553 0 : return -1;
21554 : }
21555 : {
21556 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long4));
21557 0 : if (PyLong_Check(value)) {
21558 : unsigned long long test_var;
21559 0 : test_var = PyLong_AsUnsignedLongLong(value);
21560 0 : if (PyErr_Occurred() != NULL) {
21561 0 : return -1;
21562 : }
21563 0 : if (test_var > uint_max) {
21564 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21565 : PyLong_Type.tp_name, uint_max, test_var);
21566 0 : return -1;
21567 : }
21568 0 : object->dummy_long4 = test_var;
21569 : } else {
21570 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21571 : PyLong_Type.tp_name);
21572 0 : return -1;
21573 : }
21574 : }
21575 0 : return 0;
21576 : }
21577 :
21578 : static PyGetSetDef py_netr_WorkstationInformation_getsetters[] = {
21579 : {
21580 : .name = discard_const_p(char, "lsa_policy"),
21581 : .get = py_netr_WorkstationInformation_get_lsa_policy,
21582 : .set = py_netr_WorkstationInformation_set_lsa_policy,
21583 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LsaPolicyInformation")
21584 : },
21585 : {
21586 : .name = discard_const_p(char, "dns_hostname"),
21587 : .get = py_netr_WorkstationInformation_get_dns_hostname,
21588 : .set = py_netr_WorkstationInformation_set_dns_hostname,
21589 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21590 : },
21591 : {
21592 : .name = discard_const_p(char, "sitename"),
21593 : .get = py_netr_WorkstationInformation_get_sitename,
21594 : .set = py_netr_WorkstationInformation_set_sitename,
21595 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21596 : },
21597 : {
21598 : .name = discard_const_p(char, "dummy1"),
21599 : .get = py_netr_WorkstationInformation_get_dummy1,
21600 : .set = py_netr_WorkstationInformation_set_dummy1,
21601 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21602 : },
21603 : {
21604 : .name = discard_const_p(char, "dummy2"),
21605 : .get = py_netr_WorkstationInformation_get_dummy2,
21606 : .set = py_netr_WorkstationInformation_set_dummy2,
21607 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21608 : },
21609 : {
21610 : .name = discard_const_p(char, "dummy3"),
21611 : .get = py_netr_WorkstationInformation_get_dummy3,
21612 : .set = py_netr_WorkstationInformation_set_dummy3,
21613 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21614 : },
21615 : {
21616 : .name = discard_const_p(char, "dummy4"),
21617 : .get = py_netr_WorkstationInformation_get_dummy4,
21618 : .set = py_netr_WorkstationInformation_set_dummy4,
21619 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
21620 : },
21621 : {
21622 : .name = discard_const_p(char, "os_version"),
21623 : .get = py_netr_WorkstationInformation_get_os_version,
21624 : .set = py_netr_WorkstationInformation_set_os_version,
21625 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_OsVersionContainer")
21626 : },
21627 : {
21628 : .name = discard_const_p(char, "os_name"),
21629 : .get = py_netr_WorkstationInformation_get_os_name,
21630 : .set = py_netr_WorkstationInformation_set_os_name,
21631 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
21632 : },
21633 : {
21634 : .name = discard_const_p(char, "dummy_string3"),
21635 : .get = py_netr_WorkstationInformation_get_dummy_string3,
21636 : .set = py_netr_WorkstationInformation_set_dummy_string3,
21637 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
21638 : },
21639 : {
21640 : .name = discard_const_p(char, "dummy_string4"),
21641 : .get = py_netr_WorkstationInformation_get_dummy_string4,
21642 : .set = py_netr_WorkstationInformation_set_dummy_string4,
21643 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
21644 : },
21645 : {
21646 : .name = discard_const_p(char, "workstation_flags"),
21647 : .get = py_netr_WorkstationInformation_get_workstation_flags,
21648 : .set = py_netr_WorkstationInformation_set_workstation_flags,
21649 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_WorkstationFlags")
21650 : },
21651 : {
21652 : .name = discard_const_p(char, "supported_enc_types"),
21653 : .get = py_netr_WorkstationInformation_get_supported_enc_types,
21654 : .set = py_netr_WorkstationInformation_set_supported_enc_types,
21655 : .doc = discard_const_p(char, "PIDL-generated element of base type kerb_EncTypes")
21656 : },
21657 : {
21658 : .name = discard_const_p(char, "dummy_long3"),
21659 : .get = py_netr_WorkstationInformation_get_dummy_long3,
21660 : .set = py_netr_WorkstationInformation_set_dummy_long3,
21661 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
21662 : },
21663 : {
21664 : .name = discard_const_p(char, "dummy_long4"),
21665 : .get = py_netr_WorkstationInformation_get_dummy_long4,
21666 : .set = py_netr_WorkstationInformation_set_dummy_long4,
21667 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
21668 : },
21669 : { .name = NULL }
21670 : };
21671 :
21672 35 : static PyObject *py_netr_WorkstationInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21673 : {
21674 35 : return pytalloc_new(struct netr_WorkstationInformation, type);
21675 : }
21676 :
21677 :
21678 : static PyTypeObject netr_WorkstationInformation_Type = {
21679 : PyVarObject_HEAD_INIT(NULL, 0)
21680 : .tp_name = "netlogon.netr_WorkstationInformation",
21681 : .tp_getset = py_netr_WorkstationInformation_getsetters,
21682 : .tp_methods = NULL,
21683 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21684 : .tp_new = py_netr_WorkstationInformation_new,
21685 : };
21686 :
21687 0 : static PyObject *py_import_netr_WorkstationInfo(TALLOC_CTX *mem_ctx, int level, union netr_WorkstationInfo *in)
21688 : {
21689 : PyObject *ret;
21690 :
21691 0 : switch (level) {
21692 0 : case 1:
21693 0 : if (in->workstation_info == NULL) {
21694 0 : ret = Py_None;
21695 0 : Py_INCREF(ret);
21696 : } else {
21697 0 : ret = pytalloc_reference_ex(&netr_WorkstationInformation_Type, in->workstation_info, in->workstation_info);
21698 : }
21699 0 : return ret;
21700 :
21701 0 : case 2:
21702 0 : if (in->lsa_policy_info == NULL) {
21703 0 : ret = Py_None;
21704 0 : Py_INCREF(ret);
21705 : } else {
21706 0 : ret = pytalloc_reference_ex(&netr_WorkstationInformation_Type, in->lsa_policy_info, in->lsa_policy_info);
21707 : }
21708 0 : return ret;
21709 :
21710 : }
21711 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
21712 0 : return NULL;
21713 : }
21714 :
21715 35 : static union netr_WorkstationInfo *py_export_netr_WorkstationInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
21716 : {
21717 35 : union netr_WorkstationInfo *ret = talloc_zero(mem_ctx, union netr_WorkstationInfo);
21718 35 : switch (level) {
21719 21 : case 1:
21720 21 : if (in == NULL) {
21721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->workstation_info");
21722 0 : talloc_free(ret); return NULL;
21723 : }
21724 21 : if (in == Py_None) {
21725 0 : ret->workstation_info = NULL;
21726 : } else {
21727 21 : ret->workstation_info = NULL;
21728 21 : PY_CHECK_TYPE(&netr_WorkstationInformation_Type, in, talloc_free(ret); return NULL;);
21729 21 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
21730 0 : PyErr_NoMemory();
21731 0 : talloc_free(ret); return NULL;
21732 : }
21733 21 : ret->workstation_info = (struct netr_WorkstationInformation *)pytalloc_get_ptr(in);
21734 : }
21735 21 : break;
21736 :
21737 14 : case 2:
21738 14 : if (in == NULL) {
21739 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->lsa_policy_info");
21740 0 : talloc_free(ret); return NULL;
21741 : }
21742 14 : if (in == Py_None) {
21743 0 : ret->lsa_policy_info = NULL;
21744 : } else {
21745 14 : ret->lsa_policy_info = NULL;
21746 14 : PY_CHECK_TYPE(&netr_WorkstationInformation_Type, in, talloc_free(ret); return NULL;);
21747 14 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
21748 0 : PyErr_NoMemory();
21749 0 : talloc_free(ret); return NULL;
21750 : }
21751 14 : ret->lsa_policy_info = (struct netr_WorkstationInformation *)pytalloc_get_ptr(in);
21752 : }
21753 14 : break;
21754 :
21755 0 : default:
21756 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
21757 0 : talloc_free(ret);
21758 0 : ret = NULL;
21759 : }
21760 :
21761 35 : return ret;
21762 : }
21763 :
21764 0 : static PyObject *py_netr_WorkstationInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21765 : {
21766 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
21767 0 : PyObject *mem_ctx_obj = NULL;
21768 0 : TALLOC_CTX *mem_ctx = NULL;
21769 0 : int level = 0;
21770 0 : PyObject *in_obj = NULL;
21771 0 : union netr_WorkstationInfo *in = NULL;
21772 :
21773 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
21774 : discard_const_p(char *, kwnames),
21775 : &mem_ctx_obj,
21776 : &level,
21777 : &in_obj)) {
21778 0 : return NULL;
21779 : }
21780 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
21781 0 : if (mem_ctx == NULL) {
21782 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
21783 0 : return NULL;
21784 : }
21785 0 : in = (union netr_WorkstationInfo *)pytalloc_get_ptr(in_obj);
21786 0 : if (in == NULL) {
21787 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_WorkstationInfo!");
21788 0 : return NULL;
21789 : }
21790 :
21791 0 : return py_import_netr_WorkstationInfo(mem_ctx, level, in);
21792 : }
21793 :
21794 35 : static PyObject *py_netr_WorkstationInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21795 : {
21796 35 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
21797 35 : PyObject *mem_ctx_obj = NULL;
21798 35 : TALLOC_CTX *mem_ctx = NULL;
21799 35 : int level = 0;
21800 35 : PyObject *in = NULL;
21801 35 : union netr_WorkstationInfo *out = NULL;
21802 :
21803 35 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
21804 : discard_const_p(char *, kwnames),
21805 : &mem_ctx_obj,
21806 : &level,
21807 : &in)) {
21808 0 : return NULL;
21809 : }
21810 35 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
21811 35 : if (mem_ctx == NULL) {
21812 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
21813 0 : return NULL;
21814 : }
21815 :
21816 35 : out = py_export_netr_WorkstationInfo(mem_ctx, level, in);
21817 35 : if (out == NULL) {
21818 0 : return NULL;
21819 : }
21820 :
21821 35 : return pytalloc_GenericObject_reference(out);
21822 : }
21823 :
21824 : static PyMethodDef py_netr_WorkstationInfo_methods[] = {
21825 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_WorkstationInfo_import),
21826 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
21827 : "T.__import__(mem_ctx, level, in) => ret." },
21828 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_WorkstationInfo_export),
21829 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
21830 : "T.__export__(mem_ctx, level, in) => ret." },
21831 : { NULL, NULL, 0, NULL }
21832 : };
21833 :
21834 0 : static PyObject *py_netr_WorkstationInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21835 : {
21836 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
21837 0 : return NULL;
21838 : }
21839 :
21840 :
21841 : static PyTypeObject netr_WorkstationInfo_Type = {
21842 : PyVarObject_HEAD_INIT(NULL, 0)
21843 : .tp_name = "netlogon.netr_WorkstationInfo",
21844 : .tp_getset = NULL,
21845 : .tp_methods = py_netr_WorkstationInfo_methods,
21846 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21847 : .tp_new = py_netr_WorkstationInfo_new,
21848 : };
21849 :
21850 :
21851 0 : static PyObject *py_netr_trust_extension_info_get_flags(PyObject *obj, void *closure)
21852 : {
21853 0 : struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(obj);
21854 : PyObject *py_flags;
21855 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
21856 0 : return py_flags;
21857 : }
21858 :
21859 0 : static int py_netr_trust_extension_info_set_flags(PyObject *py_obj, PyObject *value, void *closure)
21860 : {
21861 0 : struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(py_obj);
21862 0 : if (value == NULL) {
21863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
21864 0 : return -1;
21865 : }
21866 : {
21867 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
21868 0 : if (PyLong_Check(value)) {
21869 : unsigned long long test_var;
21870 0 : test_var = PyLong_AsUnsignedLongLong(value);
21871 0 : if (PyErr_Occurred() != NULL) {
21872 0 : return -1;
21873 : }
21874 0 : if (test_var > uint_max) {
21875 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21876 : PyLong_Type.tp_name, uint_max, test_var);
21877 0 : return -1;
21878 : }
21879 0 : object->flags = test_var;
21880 : } else {
21881 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21882 : PyLong_Type.tp_name);
21883 0 : return -1;
21884 : }
21885 : }
21886 0 : return 0;
21887 : }
21888 :
21889 0 : static PyObject *py_netr_trust_extension_info_get_parent_index(PyObject *obj, void *closure)
21890 : {
21891 0 : struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(obj);
21892 : PyObject *py_parent_index;
21893 0 : py_parent_index = PyLong_FromUnsignedLongLong((uint32_t)object->parent_index);
21894 0 : return py_parent_index;
21895 : }
21896 :
21897 0 : static int py_netr_trust_extension_info_set_parent_index(PyObject *py_obj, PyObject *value, void *closure)
21898 : {
21899 0 : struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(py_obj);
21900 0 : if (value == NULL) {
21901 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parent_index");
21902 0 : return -1;
21903 : }
21904 : {
21905 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->parent_index));
21906 0 : if (PyLong_Check(value)) {
21907 : unsigned long long test_var;
21908 0 : test_var = PyLong_AsUnsignedLongLong(value);
21909 0 : if (PyErr_Occurred() != NULL) {
21910 0 : return -1;
21911 : }
21912 0 : if (test_var > uint_max) {
21913 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21914 : PyLong_Type.tp_name, uint_max, test_var);
21915 0 : return -1;
21916 : }
21917 0 : object->parent_index = test_var;
21918 : } else {
21919 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21920 : PyLong_Type.tp_name);
21921 0 : return -1;
21922 : }
21923 : }
21924 0 : return 0;
21925 : }
21926 :
21927 0 : static PyObject *py_netr_trust_extension_info_get_trust_type(PyObject *obj, void *closure)
21928 : {
21929 0 : struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(obj);
21930 : PyObject *py_trust_type;
21931 0 : py_trust_type = PyLong_FromUnsignedLongLong((uint32_t)object->trust_type);
21932 0 : return py_trust_type;
21933 : }
21934 :
21935 0 : static int py_netr_trust_extension_info_set_trust_type(PyObject *py_obj, PyObject *value, void *closure)
21936 : {
21937 0 : struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(py_obj);
21938 0 : if (value == NULL) {
21939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_type");
21940 0 : return -1;
21941 : }
21942 : {
21943 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_type));
21944 0 : if (PyLong_Check(value)) {
21945 : unsigned long long test_var;
21946 0 : test_var = PyLong_AsUnsignedLongLong(value);
21947 0 : if (PyErr_Occurred() != NULL) {
21948 0 : return -1;
21949 : }
21950 0 : if (test_var > uint_max) {
21951 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21952 : PyLong_Type.tp_name, uint_max, test_var);
21953 0 : return -1;
21954 : }
21955 0 : object->trust_type = test_var;
21956 : } else {
21957 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21958 : PyLong_Type.tp_name);
21959 0 : return -1;
21960 : }
21961 : }
21962 0 : return 0;
21963 : }
21964 :
21965 0 : static PyObject *py_netr_trust_extension_info_get_trust_attributes(PyObject *obj, void *closure)
21966 : {
21967 0 : struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(obj);
21968 : PyObject *py_trust_attributes;
21969 0 : py_trust_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->trust_attributes);
21970 0 : return py_trust_attributes;
21971 : }
21972 :
21973 0 : static int py_netr_trust_extension_info_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure)
21974 : {
21975 0 : struct netr_trust_extension_info *object = (struct netr_trust_extension_info *)pytalloc_get_ptr(py_obj);
21976 0 : if (value == NULL) {
21977 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_attributes");
21978 0 : return -1;
21979 : }
21980 : {
21981 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_attributes));
21982 0 : if (PyLong_Check(value)) {
21983 : unsigned long long test_var;
21984 0 : test_var = PyLong_AsUnsignedLongLong(value);
21985 0 : if (PyErr_Occurred() != NULL) {
21986 0 : return -1;
21987 : }
21988 0 : if (test_var > uint_max) {
21989 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21990 : PyLong_Type.tp_name, uint_max, test_var);
21991 0 : return -1;
21992 : }
21993 0 : object->trust_attributes = test_var;
21994 : } else {
21995 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21996 : PyLong_Type.tp_name);
21997 0 : return -1;
21998 : }
21999 : }
22000 0 : return 0;
22001 : }
22002 :
22003 : static PyGetSetDef py_netr_trust_extension_info_getsetters[] = {
22004 : {
22005 : .name = discard_const_p(char, "flags"),
22006 : .get = py_netr_trust_extension_info_get_flags,
22007 : .set = py_netr_trust_extension_info_set_flags,
22008 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_TrustFlags")
22009 : },
22010 : {
22011 : .name = discard_const_p(char, "parent_index"),
22012 : .get = py_netr_trust_extension_info_get_parent_index,
22013 : .set = py_netr_trust_extension_info_set_parent_index,
22014 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22015 : },
22016 : {
22017 : .name = discard_const_p(char, "trust_type"),
22018 : .get = py_netr_trust_extension_info_get_trust_type,
22019 : .set = py_netr_trust_extension_info_set_trust_type,
22020 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustType")
22021 : },
22022 : {
22023 : .name = discard_const_p(char, "trust_attributes"),
22024 : .get = py_netr_trust_extension_info_get_trust_attributes,
22025 : .set = py_netr_trust_extension_info_set_trust_attributes,
22026 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAttributes")
22027 : },
22028 : { .name = NULL }
22029 : };
22030 :
22031 0 : static PyObject *py_netr_trust_extension_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22032 : {
22033 0 : return pytalloc_new(struct netr_trust_extension_info, type);
22034 : }
22035 :
22036 :
22037 : static PyTypeObject netr_trust_extension_info_Type = {
22038 : PyVarObject_HEAD_INIT(NULL, 0)
22039 : .tp_name = "netlogon.netr_trust_extension_info",
22040 : .tp_getset = py_netr_trust_extension_info_getsetters,
22041 : .tp_methods = NULL,
22042 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22043 : .tp_new = py_netr_trust_extension_info_new,
22044 : };
22045 :
22046 :
22047 0 : static PyObject *py_netr_trust_extension_get_length(PyObject *obj, void *closure)
22048 : {
22049 0 : struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(obj);
22050 : PyObject *py_length;
22051 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
22052 0 : return py_length;
22053 : }
22054 :
22055 0 : static int py_netr_trust_extension_set_length(PyObject *py_obj, PyObject *value, void *closure)
22056 : {
22057 0 : struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(py_obj);
22058 0 : if (value == NULL) {
22059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
22060 0 : return -1;
22061 : }
22062 : {
22063 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
22064 0 : if (PyLong_Check(value)) {
22065 : unsigned long long test_var;
22066 0 : test_var = PyLong_AsUnsignedLongLong(value);
22067 0 : if (PyErr_Occurred() != NULL) {
22068 0 : return -1;
22069 : }
22070 0 : if (test_var > uint_max) {
22071 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22072 : PyLong_Type.tp_name, uint_max, test_var);
22073 0 : return -1;
22074 : }
22075 0 : object->length = test_var;
22076 : } else {
22077 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22078 : PyLong_Type.tp_name);
22079 0 : return -1;
22080 : }
22081 : }
22082 0 : return 0;
22083 : }
22084 :
22085 0 : static PyObject *py_netr_trust_extension_get_dummy(PyObject *obj, void *closure)
22086 : {
22087 0 : struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(obj);
22088 : PyObject *py_dummy;
22089 0 : py_dummy = PyLong_FromUnsignedLongLong((uint32_t)object->dummy);
22090 0 : return py_dummy;
22091 : }
22092 :
22093 0 : static int py_netr_trust_extension_set_dummy(PyObject *py_obj, PyObject *value, void *closure)
22094 : {
22095 0 : struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(py_obj);
22096 0 : if (value == NULL) {
22097 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy");
22098 0 : return -1;
22099 : }
22100 : {
22101 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy));
22102 0 : if (PyLong_Check(value)) {
22103 : unsigned long long test_var;
22104 0 : test_var = PyLong_AsUnsignedLongLong(value);
22105 0 : if (PyErr_Occurred() != NULL) {
22106 0 : return -1;
22107 : }
22108 0 : if (test_var > uint_max) {
22109 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22110 : PyLong_Type.tp_name, uint_max, test_var);
22111 0 : return -1;
22112 : }
22113 0 : object->dummy = test_var;
22114 : } else {
22115 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22116 : PyLong_Type.tp_name);
22117 0 : return -1;
22118 : }
22119 : }
22120 0 : return 0;
22121 : }
22122 :
22123 0 : static PyObject *py_netr_trust_extension_get_size(PyObject *obj, void *closure)
22124 : {
22125 0 : struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(obj);
22126 : PyObject *py_size;
22127 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
22128 0 : return py_size;
22129 : }
22130 :
22131 0 : static int py_netr_trust_extension_set_size(PyObject *py_obj, PyObject *value, void *closure)
22132 : {
22133 0 : struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(py_obj);
22134 0 : if (value == NULL) {
22135 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
22136 0 : return -1;
22137 : }
22138 : {
22139 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
22140 0 : if (PyLong_Check(value)) {
22141 : unsigned long long test_var;
22142 0 : test_var = PyLong_AsUnsignedLongLong(value);
22143 0 : if (PyErr_Occurred() != NULL) {
22144 0 : return -1;
22145 : }
22146 0 : if (test_var > uint_max) {
22147 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22148 : PyLong_Type.tp_name, uint_max, test_var);
22149 0 : return -1;
22150 : }
22151 0 : object->size = test_var;
22152 : } else {
22153 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22154 : PyLong_Type.tp_name);
22155 0 : return -1;
22156 : }
22157 : }
22158 0 : return 0;
22159 : }
22160 :
22161 0 : static PyObject *py_netr_trust_extension_get_info(PyObject *obj, void *closure)
22162 : {
22163 0 : struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(obj);
22164 : PyObject *py_info;
22165 0 : py_info = pytalloc_reference_ex(&netr_trust_extension_info_Type, pytalloc_get_mem_ctx(obj), &object->info);
22166 0 : return py_info;
22167 : }
22168 :
22169 0 : static int py_netr_trust_extension_set_info(PyObject *py_obj, PyObject *value, void *closure)
22170 : {
22171 0 : struct netr_trust_extension *object = (struct netr_trust_extension *)pytalloc_get_ptr(py_obj);
22172 0 : if (value == NULL) {
22173 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
22174 0 : return -1;
22175 : }
22176 0 : PY_CHECK_TYPE(&netr_trust_extension_info_Type, value, return -1;);
22177 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22178 0 : PyErr_NoMemory();
22179 0 : return -1;
22180 : }
22181 0 : object->info = *(struct netr_trust_extension_info *)pytalloc_get_ptr(value);
22182 0 : return 0;
22183 : }
22184 :
22185 : static PyGetSetDef py_netr_trust_extension_getsetters[] = {
22186 : {
22187 : .name = discard_const_p(char, "length"),
22188 : .get = py_netr_trust_extension_get_length,
22189 : .set = py_netr_trust_extension_set_length,
22190 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
22191 : },
22192 : {
22193 : .name = discard_const_p(char, "dummy"),
22194 : .get = py_netr_trust_extension_get_dummy,
22195 : .set = py_netr_trust_extension_set_dummy,
22196 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
22197 : },
22198 : {
22199 : .name = discard_const_p(char, "size"),
22200 : .get = py_netr_trust_extension_get_size,
22201 : .set = py_netr_trust_extension_set_size,
22202 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
22203 : },
22204 : {
22205 : .name = discard_const_p(char, "info"),
22206 : .get = py_netr_trust_extension_get_info,
22207 : .set = py_netr_trust_extension_set_info,
22208 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_trust_extension_info")
22209 : },
22210 : { .name = NULL }
22211 : };
22212 :
22213 0 : static PyObject *py_netr_trust_extension_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22214 : {
22215 0 : return pytalloc_new(struct netr_trust_extension, type);
22216 : }
22217 :
22218 :
22219 : static PyTypeObject netr_trust_extension_Type = {
22220 : PyVarObject_HEAD_INIT(NULL, 0)
22221 : .tp_name = "netlogon.netr_trust_extension",
22222 : .tp_getset = py_netr_trust_extension_getsetters,
22223 : .tp_methods = NULL,
22224 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22225 : .tp_new = py_netr_trust_extension_new,
22226 : };
22227 :
22228 :
22229 0 : static PyObject *py_netr_trust_extension_container_get_length(PyObject *obj, void *closure)
22230 : {
22231 0 : struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(obj);
22232 : PyObject *py_length;
22233 0 : py_length = PyLong_FromLong((uint16_t)object->length);
22234 0 : return py_length;
22235 : }
22236 :
22237 0 : static int py_netr_trust_extension_container_set_length(PyObject *py_obj, PyObject *value, void *closure)
22238 : {
22239 0 : struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(py_obj);
22240 0 : if (value == NULL) {
22241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
22242 0 : return -1;
22243 : }
22244 : {
22245 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
22246 0 : if (PyLong_Check(value)) {
22247 : unsigned long long test_var;
22248 0 : test_var = PyLong_AsUnsignedLongLong(value);
22249 0 : if (PyErr_Occurred() != NULL) {
22250 0 : return -1;
22251 : }
22252 0 : if (test_var > uint_max) {
22253 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22254 : PyLong_Type.tp_name, uint_max, test_var);
22255 0 : return -1;
22256 : }
22257 0 : object->length = test_var;
22258 : } else {
22259 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22260 : PyLong_Type.tp_name);
22261 0 : return -1;
22262 : }
22263 : }
22264 0 : return 0;
22265 : }
22266 :
22267 0 : static PyObject *py_netr_trust_extension_container_get_size(PyObject *obj, void *closure)
22268 : {
22269 0 : struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(obj);
22270 : PyObject *py_size;
22271 0 : py_size = PyLong_FromLong((uint16_t)object->size);
22272 0 : return py_size;
22273 : }
22274 :
22275 0 : static int py_netr_trust_extension_container_set_size(PyObject *py_obj, PyObject *value, void *closure)
22276 : {
22277 0 : struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(py_obj);
22278 0 : if (value == NULL) {
22279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
22280 0 : return -1;
22281 : }
22282 : {
22283 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
22284 0 : if (PyLong_Check(value)) {
22285 : unsigned long long test_var;
22286 0 : test_var = PyLong_AsUnsignedLongLong(value);
22287 0 : if (PyErr_Occurred() != NULL) {
22288 0 : return -1;
22289 : }
22290 0 : if (test_var > uint_max) {
22291 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22292 : PyLong_Type.tp_name, uint_max, test_var);
22293 0 : return -1;
22294 : }
22295 0 : object->size = test_var;
22296 : } else {
22297 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22298 : PyLong_Type.tp_name);
22299 0 : return -1;
22300 : }
22301 : }
22302 0 : return 0;
22303 : }
22304 :
22305 0 : static PyObject *py_netr_trust_extension_container_get_info(PyObject *obj, void *closure)
22306 : {
22307 0 : struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(obj);
22308 : PyObject *py_info;
22309 0 : if (object->info == NULL) {
22310 0 : Py_RETURN_NONE;
22311 : }
22312 0 : if (object->info == NULL) {
22313 0 : py_info = Py_None;
22314 0 : Py_INCREF(py_info);
22315 : } else {
22316 0 : py_info = pytalloc_reference_ex(&netr_trust_extension_Type, object->info, object->info);
22317 : }
22318 0 : return py_info;
22319 : }
22320 :
22321 0 : static int py_netr_trust_extension_container_set_info(PyObject *py_obj, PyObject *value, void *closure)
22322 : {
22323 0 : struct netr_trust_extension_container *object = (struct netr_trust_extension_container *)pytalloc_get_ptr(py_obj);
22324 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
22325 0 : if (value == NULL) {
22326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
22327 0 : return -1;
22328 : }
22329 0 : if (value == Py_None) {
22330 0 : object->info = NULL;
22331 : } else {
22332 0 : object->info = NULL;
22333 0 : PY_CHECK_TYPE(&netr_trust_extension_Type, value, return -1;);
22334 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22335 0 : PyErr_NoMemory();
22336 0 : return -1;
22337 : }
22338 0 : object->info = (struct netr_trust_extension *)pytalloc_get_ptr(value);
22339 : }
22340 0 : return 0;
22341 : }
22342 :
22343 : static PyGetSetDef py_netr_trust_extension_container_getsetters[] = {
22344 : {
22345 : .name = discard_const_p(char, "length"),
22346 : .get = py_netr_trust_extension_container_get_length,
22347 : .set = py_netr_trust_extension_container_set_length,
22348 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22349 : },
22350 : {
22351 : .name = discard_const_p(char, "size"),
22352 : .get = py_netr_trust_extension_container_get_size,
22353 : .set = py_netr_trust_extension_container_set_size,
22354 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
22355 : },
22356 : {
22357 : .name = discard_const_p(char, "info"),
22358 : .get = py_netr_trust_extension_container_get_info,
22359 : .set = py_netr_trust_extension_container_set_info,
22360 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_trust_extension")
22361 : },
22362 : { .name = NULL }
22363 : };
22364 :
22365 0 : static PyObject *py_netr_trust_extension_container_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22366 : {
22367 0 : return pytalloc_new(struct netr_trust_extension_container, type);
22368 : }
22369 :
22370 :
22371 : static PyTypeObject netr_trust_extension_container_Type = {
22372 : PyVarObject_HEAD_INIT(NULL, 0)
22373 : .tp_name = "netlogon.netr_trust_extension_container",
22374 : .tp_getset = py_netr_trust_extension_container_getsetters,
22375 : .tp_methods = NULL,
22376 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22377 : .tp_new = py_netr_trust_extension_container_new,
22378 : };
22379 :
22380 :
22381 0 : static PyObject *py_netr_OneDomainInfo_get_domainname(PyObject *obj, void *closure)
22382 : {
22383 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22384 : PyObject *py_domainname;
22385 0 : py_domainname = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->domainname);
22386 0 : return py_domainname;
22387 : }
22388 :
22389 0 : static int py_netr_OneDomainInfo_set_domainname(PyObject *py_obj, PyObject *value, void *closure)
22390 : {
22391 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22392 0 : if (value == NULL) {
22393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domainname");
22394 0 : return -1;
22395 : }
22396 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
22397 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22398 0 : PyErr_NoMemory();
22399 0 : return -1;
22400 : }
22401 0 : object->domainname = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
22402 0 : return 0;
22403 : }
22404 :
22405 0 : static PyObject *py_netr_OneDomainInfo_get_dns_domainname(PyObject *obj, void *closure)
22406 : {
22407 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22408 : PyObject *py_dns_domainname;
22409 0 : py_dns_domainname = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domainname);
22410 0 : return py_dns_domainname;
22411 : }
22412 :
22413 0 : static int py_netr_OneDomainInfo_set_dns_domainname(PyObject *py_obj, PyObject *value, void *closure)
22414 : {
22415 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22416 0 : if (value == NULL) {
22417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domainname");
22418 0 : return -1;
22419 : }
22420 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
22421 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22422 0 : PyErr_NoMemory();
22423 0 : return -1;
22424 : }
22425 0 : object->dns_domainname = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
22426 0 : return 0;
22427 : }
22428 :
22429 0 : static PyObject *py_netr_OneDomainInfo_get_dns_forestname(PyObject *obj, void *closure)
22430 : {
22431 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22432 : PyObject *py_dns_forestname;
22433 0 : py_dns_forestname = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_forestname);
22434 0 : return py_dns_forestname;
22435 : }
22436 :
22437 0 : static int py_netr_OneDomainInfo_set_dns_forestname(PyObject *py_obj, PyObject *value, void *closure)
22438 : {
22439 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22440 0 : if (value == NULL) {
22441 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_forestname");
22442 0 : return -1;
22443 : }
22444 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
22445 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22446 0 : PyErr_NoMemory();
22447 0 : return -1;
22448 : }
22449 0 : object->dns_forestname = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
22450 0 : return 0;
22451 : }
22452 :
22453 0 : static PyObject *py_netr_OneDomainInfo_get_domain_guid(PyObject *obj, void *closure)
22454 : {
22455 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22456 : PyObject *py_domain_guid;
22457 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_guid);
22458 0 : return py_domain_guid;
22459 : }
22460 :
22461 0 : static int py_netr_OneDomainInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
22462 : {
22463 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22464 0 : if (value == NULL) {
22465 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_guid");
22466 0 : return -1;
22467 : }
22468 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
22469 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22470 0 : PyErr_NoMemory();
22471 0 : return -1;
22472 : }
22473 0 : object->domain_guid = *(struct GUID *)pytalloc_get_ptr(value);
22474 0 : return 0;
22475 : }
22476 :
22477 0 : static PyObject *py_netr_OneDomainInfo_get_domain_sid(PyObject *obj, void *closure)
22478 : {
22479 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22480 : PyObject *py_domain_sid;
22481 0 : if (object->domain_sid == NULL) {
22482 0 : Py_RETURN_NONE;
22483 : }
22484 0 : if (object->domain_sid == NULL) {
22485 0 : py_domain_sid = Py_None;
22486 0 : Py_INCREF(py_domain_sid);
22487 : } else {
22488 0 : py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
22489 : }
22490 0 : return py_domain_sid;
22491 : }
22492 :
22493 0 : static int py_netr_OneDomainInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
22494 : {
22495 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22496 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
22497 0 : if (value == NULL) {
22498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid");
22499 0 : return -1;
22500 : }
22501 0 : if (value == Py_None) {
22502 0 : object->domain_sid = NULL;
22503 : } else {
22504 0 : object->domain_sid = NULL;
22505 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
22506 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22507 0 : PyErr_NoMemory();
22508 0 : return -1;
22509 : }
22510 0 : object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
22511 : }
22512 0 : return 0;
22513 : }
22514 :
22515 0 : static PyObject *py_netr_OneDomainInfo_get_trust_extension(PyObject *obj, void *closure)
22516 : {
22517 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22518 : PyObject *py_trust_extension;
22519 0 : py_trust_extension = pytalloc_reference_ex(&netr_trust_extension_container_Type, pytalloc_get_mem_ctx(obj), &object->trust_extension);
22520 0 : return py_trust_extension;
22521 : }
22522 :
22523 0 : static int py_netr_OneDomainInfo_set_trust_extension(PyObject *py_obj, PyObject *value, void *closure)
22524 : {
22525 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22526 0 : if (value == NULL) {
22527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_extension");
22528 0 : return -1;
22529 : }
22530 0 : PY_CHECK_TYPE(&netr_trust_extension_container_Type, value, return -1;);
22531 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22532 0 : PyErr_NoMemory();
22533 0 : return -1;
22534 : }
22535 0 : object->trust_extension = *(struct netr_trust_extension_container *)pytalloc_get_ptr(value);
22536 0 : return 0;
22537 : }
22538 :
22539 0 : static PyObject *py_netr_OneDomainInfo_get_dummy_string2(PyObject *obj, void *closure)
22540 : {
22541 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22542 : PyObject *py_dummy_string2;
22543 0 : py_dummy_string2 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string2);
22544 0 : return py_dummy_string2;
22545 : }
22546 :
22547 0 : static int py_netr_OneDomainInfo_set_dummy_string2(PyObject *py_obj, PyObject *value, void *closure)
22548 : {
22549 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22550 0 : if (value == NULL) {
22551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string2");
22552 0 : return -1;
22553 : }
22554 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
22555 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22556 0 : PyErr_NoMemory();
22557 0 : return -1;
22558 : }
22559 0 : object->dummy_string2 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
22560 0 : return 0;
22561 : }
22562 :
22563 0 : static PyObject *py_netr_OneDomainInfo_get_dummy_string3(PyObject *obj, void *closure)
22564 : {
22565 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22566 : PyObject *py_dummy_string3;
22567 0 : py_dummy_string3 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string3);
22568 0 : return py_dummy_string3;
22569 : }
22570 :
22571 0 : static int py_netr_OneDomainInfo_set_dummy_string3(PyObject *py_obj, PyObject *value, void *closure)
22572 : {
22573 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22574 0 : if (value == NULL) {
22575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string3");
22576 0 : return -1;
22577 : }
22578 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
22579 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22580 0 : PyErr_NoMemory();
22581 0 : return -1;
22582 : }
22583 0 : object->dummy_string3 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
22584 0 : return 0;
22585 : }
22586 :
22587 0 : static PyObject *py_netr_OneDomainInfo_get_dummy_string4(PyObject *obj, void *closure)
22588 : {
22589 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22590 : PyObject *py_dummy_string4;
22591 0 : py_dummy_string4 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string4);
22592 0 : return py_dummy_string4;
22593 : }
22594 :
22595 0 : static int py_netr_OneDomainInfo_set_dummy_string4(PyObject *py_obj, PyObject *value, void *closure)
22596 : {
22597 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22598 0 : if (value == NULL) {
22599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string4");
22600 0 : return -1;
22601 : }
22602 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
22603 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22604 0 : PyErr_NoMemory();
22605 0 : return -1;
22606 : }
22607 0 : object->dummy_string4 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
22608 0 : return 0;
22609 : }
22610 :
22611 0 : static PyObject *py_netr_OneDomainInfo_get_dummy_long1(PyObject *obj, void *closure)
22612 : {
22613 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22614 : PyObject *py_dummy_long1;
22615 0 : py_dummy_long1 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long1);
22616 0 : return py_dummy_long1;
22617 : }
22618 :
22619 0 : static int py_netr_OneDomainInfo_set_dummy_long1(PyObject *py_obj, PyObject *value, void *closure)
22620 : {
22621 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22622 0 : if (value == NULL) {
22623 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long1");
22624 0 : return -1;
22625 : }
22626 : {
22627 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long1));
22628 0 : if (PyLong_Check(value)) {
22629 : unsigned long long test_var;
22630 0 : test_var = PyLong_AsUnsignedLongLong(value);
22631 0 : if (PyErr_Occurred() != NULL) {
22632 0 : return -1;
22633 : }
22634 0 : if (test_var > uint_max) {
22635 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22636 : PyLong_Type.tp_name, uint_max, test_var);
22637 0 : return -1;
22638 : }
22639 0 : object->dummy_long1 = test_var;
22640 : } else {
22641 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22642 : PyLong_Type.tp_name);
22643 0 : return -1;
22644 : }
22645 : }
22646 0 : return 0;
22647 : }
22648 :
22649 0 : static PyObject *py_netr_OneDomainInfo_get_dummy_long2(PyObject *obj, void *closure)
22650 : {
22651 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22652 : PyObject *py_dummy_long2;
22653 0 : py_dummy_long2 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long2);
22654 0 : return py_dummy_long2;
22655 : }
22656 :
22657 0 : static int py_netr_OneDomainInfo_set_dummy_long2(PyObject *py_obj, PyObject *value, void *closure)
22658 : {
22659 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22660 0 : if (value == NULL) {
22661 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long2");
22662 0 : return -1;
22663 : }
22664 : {
22665 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long2));
22666 0 : if (PyLong_Check(value)) {
22667 : unsigned long long test_var;
22668 0 : test_var = PyLong_AsUnsignedLongLong(value);
22669 0 : if (PyErr_Occurred() != NULL) {
22670 0 : return -1;
22671 : }
22672 0 : if (test_var > uint_max) {
22673 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22674 : PyLong_Type.tp_name, uint_max, test_var);
22675 0 : return -1;
22676 : }
22677 0 : object->dummy_long2 = test_var;
22678 : } else {
22679 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22680 : PyLong_Type.tp_name);
22681 0 : return -1;
22682 : }
22683 : }
22684 0 : return 0;
22685 : }
22686 :
22687 0 : static PyObject *py_netr_OneDomainInfo_get_dummy_long3(PyObject *obj, void *closure)
22688 : {
22689 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22690 : PyObject *py_dummy_long3;
22691 0 : py_dummy_long3 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long3);
22692 0 : return py_dummy_long3;
22693 : }
22694 :
22695 0 : static int py_netr_OneDomainInfo_set_dummy_long3(PyObject *py_obj, PyObject *value, void *closure)
22696 : {
22697 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22698 0 : if (value == NULL) {
22699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long3");
22700 0 : return -1;
22701 : }
22702 : {
22703 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long3));
22704 0 : if (PyLong_Check(value)) {
22705 : unsigned long long test_var;
22706 0 : test_var = PyLong_AsUnsignedLongLong(value);
22707 0 : if (PyErr_Occurred() != NULL) {
22708 0 : return -1;
22709 : }
22710 0 : if (test_var > uint_max) {
22711 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22712 : PyLong_Type.tp_name, uint_max, test_var);
22713 0 : return -1;
22714 : }
22715 0 : object->dummy_long3 = test_var;
22716 : } else {
22717 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22718 : PyLong_Type.tp_name);
22719 0 : return -1;
22720 : }
22721 : }
22722 0 : return 0;
22723 : }
22724 :
22725 0 : static PyObject *py_netr_OneDomainInfo_get_dummy_long4(PyObject *obj, void *closure)
22726 : {
22727 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(obj);
22728 : PyObject *py_dummy_long4;
22729 0 : py_dummy_long4 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long4);
22730 0 : return py_dummy_long4;
22731 : }
22732 :
22733 0 : static int py_netr_OneDomainInfo_set_dummy_long4(PyObject *py_obj, PyObject *value, void *closure)
22734 : {
22735 0 : struct netr_OneDomainInfo *object = (struct netr_OneDomainInfo *)pytalloc_get_ptr(py_obj);
22736 0 : if (value == NULL) {
22737 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long4");
22738 0 : return -1;
22739 : }
22740 : {
22741 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long4));
22742 0 : if (PyLong_Check(value)) {
22743 : unsigned long long test_var;
22744 0 : test_var = PyLong_AsUnsignedLongLong(value);
22745 0 : if (PyErr_Occurred() != NULL) {
22746 0 : return -1;
22747 : }
22748 0 : if (test_var > uint_max) {
22749 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22750 : PyLong_Type.tp_name, uint_max, test_var);
22751 0 : return -1;
22752 : }
22753 0 : object->dummy_long4 = test_var;
22754 : } else {
22755 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22756 : PyLong_Type.tp_name);
22757 0 : return -1;
22758 : }
22759 : }
22760 0 : return 0;
22761 : }
22762 :
22763 : static PyGetSetDef py_netr_OneDomainInfo_getsetters[] = {
22764 : {
22765 : .name = discard_const_p(char, "domainname"),
22766 : .get = py_netr_OneDomainInfo_get_domainname,
22767 : .set = py_netr_OneDomainInfo_set_domainname,
22768 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
22769 : },
22770 : {
22771 : .name = discard_const_p(char, "dns_domainname"),
22772 : .get = py_netr_OneDomainInfo_get_dns_domainname,
22773 : .set = py_netr_OneDomainInfo_set_dns_domainname,
22774 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
22775 : },
22776 : {
22777 : .name = discard_const_p(char, "dns_forestname"),
22778 : .get = py_netr_OneDomainInfo_get_dns_forestname,
22779 : .set = py_netr_OneDomainInfo_set_dns_forestname,
22780 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
22781 : },
22782 : {
22783 : .name = discard_const_p(char, "domain_guid"),
22784 : .get = py_netr_OneDomainInfo_get_domain_guid,
22785 : .set = py_netr_OneDomainInfo_set_domain_guid,
22786 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
22787 : },
22788 : {
22789 : .name = discard_const_p(char, "domain_sid"),
22790 : .get = py_netr_OneDomainInfo_get_domain_sid,
22791 : .set = py_netr_OneDomainInfo_set_domain_sid,
22792 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
22793 : },
22794 : {
22795 : .name = discard_const_p(char, "trust_extension"),
22796 : .get = py_netr_OneDomainInfo_get_trust_extension,
22797 : .set = py_netr_OneDomainInfo_set_trust_extension,
22798 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_trust_extension_container")
22799 : },
22800 : {
22801 : .name = discard_const_p(char, "dummy_string2"),
22802 : .get = py_netr_OneDomainInfo_get_dummy_string2,
22803 : .set = py_netr_OneDomainInfo_set_dummy_string2,
22804 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
22805 : },
22806 : {
22807 : .name = discard_const_p(char, "dummy_string3"),
22808 : .get = py_netr_OneDomainInfo_get_dummy_string3,
22809 : .set = py_netr_OneDomainInfo_set_dummy_string3,
22810 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
22811 : },
22812 : {
22813 : .name = discard_const_p(char, "dummy_string4"),
22814 : .get = py_netr_OneDomainInfo_get_dummy_string4,
22815 : .set = py_netr_OneDomainInfo_set_dummy_string4,
22816 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
22817 : },
22818 : {
22819 : .name = discard_const_p(char, "dummy_long1"),
22820 : .get = py_netr_OneDomainInfo_get_dummy_long1,
22821 : .set = py_netr_OneDomainInfo_set_dummy_long1,
22822 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22823 : },
22824 : {
22825 : .name = discard_const_p(char, "dummy_long2"),
22826 : .get = py_netr_OneDomainInfo_get_dummy_long2,
22827 : .set = py_netr_OneDomainInfo_set_dummy_long2,
22828 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22829 : },
22830 : {
22831 : .name = discard_const_p(char, "dummy_long3"),
22832 : .get = py_netr_OneDomainInfo_get_dummy_long3,
22833 : .set = py_netr_OneDomainInfo_set_dummy_long3,
22834 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22835 : },
22836 : {
22837 : .name = discard_const_p(char, "dummy_long4"),
22838 : .get = py_netr_OneDomainInfo_get_dummy_long4,
22839 : .set = py_netr_OneDomainInfo_set_dummy_long4,
22840 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22841 : },
22842 : { .name = NULL }
22843 : };
22844 :
22845 0 : static PyObject *py_netr_OneDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22846 : {
22847 0 : return pytalloc_new(struct netr_OneDomainInfo, type);
22848 : }
22849 :
22850 :
22851 : static PyTypeObject netr_OneDomainInfo_Type = {
22852 : PyVarObject_HEAD_INIT(NULL, 0)
22853 : .tp_name = "netlogon.netr_OneDomainInfo",
22854 : .tp_getset = py_netr_OneDomainInfo_getsetters,
22855 : .tp_methods = NULL,
22856 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22857 : .tp_new = py_netr_OneDomainInfo_new,
22858 : };
22859 :
22860 :
22861 0 : static PyObject *py_netr_DomainInformation_get_primary_domain(PyObject *obj, void *closure)
22862 : {
22863 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
22864 : PyObject *py_primary_domain;
22865 0 : py_primary_domain = pytalloc_reference_ex(&netr_OneDomainInfo_Type, pytalloc_get_mem_ctx(obj), &object->primary_domain);
22866 0 : return py_primary_domain;
22867 : }
22868 :
22869 0 : static int py_netr_DomainInformation_set_primary_domain(PyObject *py_obj, PyObject *value, void *closure)
22870 : {
22871 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
22872 0 : if (value == NULL) {
22873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_domain");
22874 0 : return -1;
22875 : }
22876 0 : PY_CHECK_TYPE(&netr_OneDomainInfo_Type, value, return -1;);
22877 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22878 0 : PyErr_NoMemory();
22879 0 : return -1;
22880 : }
22881 0 : object->primary_domain = *(struct netr_OneDomainInfo *)pytalloc_get_ptr(value);
22882 0 : return 0;
22883 : }
22884 :
22885 0 : static PyObject *py_netr_DomainInformation_get_trusted_domain_count(PyObject *obj, void *closure)
22886 : {
22887 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
22888 : PyObject *py_trusted_domain_count;
22889 0 : py_trusted_domain_count = PyLong_FromUnsignedLongLong((uint32_t)object->trusted_domain_count);
22890 0 : return py_trusted_domain_count;
22891 : }
22892 :
22893 0 : static int py_netr_DomainInformation_set_trusted_domain_count(PyObject *py_obj, PyObject *value, void *closure)
22894 : {
22895 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
22896 0 : if (value == NULL) {
22897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_domain_count");
22898 0 : return -1;
22899 : }
22900 : {
22901 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trusted_domain_count));
22902 0 : if (PyLong_Check(value)) {
22903 : unsigned long long test_var;
22904 0 : test_var = PyLong_AsUnsignedLongLong(value);
22905 0 : if (PyErr_Occurred() != NULL) {
22906 0 : return -1;
22907 : }
22908 0 : if (test_var > uint_max) {
22909 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22910 : PyLong_Type.tp_name, uint_max, test_var);
22911 0 : return -1;
22912 : }
22913 0 : object->trusted_domain_count = test_var;
22914 : } else {
22915 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22916 : PyLong_Type.tp_name);
22917 0 : return -1;
22918 : }
22919 : }
22920 0 : return 0;
22921 : }
22922 :
22923 0 : static PyObject *py_netr_DomainInformation_get_trusted_domains(PyObject *obj, void *closure)
22924 : {
22925 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
22926 : PyObject *py_trusted_domains;
22927 0 : if (object->trusted_domains == NULL) {
22928 0 : Py_RETURN_NONE;
22929 : }
22930 0 : if (object->trusted_domains == NULL) {
22931 0 : py_trusted_domains = Py_None;
22932 0 : Py_INCREF(py_trusted_domains);
22933 : } else {
22934 0 : py_trusted_domains = PyList_New(object->trusted_domain_count);
22935 0 : if (py_trusted_domains == NULL) {
22936 0 : return NULL;
22937 : }
22938 : {
22939 : int trusted_domains_cntr_1;
22940 0 : for (trusted_domains_cntr_1 = 0; trusted_domains_cntr_1 < (object->trusted_domain_count); trusted_domains_cntr_1++) {
22941 : PyObject *py_trusted_domains_1;
22942 0 : py_trusted_domains_1 = pytalloc_reference_ex(&netr_OneDomainInfo_Type, object->trusted_domains, &object->trusted_domains[trusted_domains_cntr_1]);
22943 0 : PyList_SetItem(py_trusted_domains, trusted_domains_cntr_1, py_trusted_domains_1);
22944 : }
22945 : }
22946 : }
22947 0 : return py_trusted_domains;
22948 : }
22949 :
22950 0 : static int py_netr_DomainInformation_set_trusted_domains(PyObject *py_obj, PyObject *value, void *closure)
22951 : {
22952 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
22953 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->trusted_domains));
22954 0 : if (value == NULL) {
22955 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_domains");
22956 0 : return -1;
22957 : }
22958 0 : if (value == Py_None) {
22959 0 : object->trusted_domains = NULL;
22960 : } else {
22961 0 : object->trusted_domains = NULL;
22962 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
22963 : {
22964 : int trusted_domains_cntr_1;
22965 0 : object->trusted_domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->trusted_domains, PyList_GET_SIZE(value));
22966 0 : if (!object->trusted_domains) { return -1;; }
22967 0 : talloc_set_name_const(object->trusted_domains, "ARRAY: object->trusted_domains");
22968 0 : for (trusted_domains_cntr_1 = 0; trusted_domains_cntr_1 < PyList_GET_SIZE(value); trusted_domains_cntr_1++) {
22969 0 : if (PyList_GET_ITEM(value, trusted_domains_cntr_1) == NULL) {
22970 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trusted_domains[trusted_domains_cntr_1]");
22971 0 : return -1;
22972 : }
22973 0 : PY_CHECK_TYPE(&netr_OneDomainInfo_Type, PyList_GET_ITEM(value, trusted_domains_cntr_1), return -1;);
22974 0 : if (talloc_reference(object->trusted_domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, trusted_domains_cntr_1))) == NULL) {
22975 0 : PyErr_NoMemory();
22976 0 : return -1;
22977 : }
22978 0 : object->trusted_domains[trusted_domains_cntr_1] = *(struct netr_OneDomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, trusted_domains_cntr_1));
22979 : }
22980 : }
22981 : }
22982 0 : return 0;
22983 : }
22984 :
22985 0 : static PyObject *py_netr_DomainInformation_get_lsa_policy(PyObject *obj, void *closure)
22986 : {
22987 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
22988 : PyObject *py_lsa_policy;
22989 0 : py_lsa_policy = pytalloc_reference_ex(&netr_LsaPolicyInformation_Type, pytalloc_get_mem_ctx(obj), &object->lsa_policy);
22990 0 : return py_lsa_policy;
22991 : }
22992 :
22993 0 : static int py_netr_DomainInformation_set_lsa_policy(PyObject *py_obj, PyObject *value, void *closure)
22994 : {
22995 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
22996 0 : if (value == NULL) {
22997 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lsa_policy");
22998 0 : return -1;
22999 : }
23000 0 : PY_CHECK_TYPE(&netr_LsaPolicyInformation_Type, value, return -1;);
23001 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23002 0 : PyErr_NoMemory();
23003 0 : return -1;
23004 : }
23005 0 : object->lsa_policy = *(struct netr_LsaPolicyInformation *)pytalloc_get_ptr(value);
23006 0 : return 0;
23007 : }
23008 :
23009 0 : static PyObject *py_netr_DomainInformation_get_dns_hostname(PyObject *obj, void *closure)
23010 : {
23011 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
23012 : PyObject *py_dns_hostname;
23013 0 : py_dns_hostname = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_hostname);
23014 0 : return py_dns_hostname;
23015 : }
23016 :
23017 0 : static int py_netr_DomainInformation_set_dns_hostname(PyObject *py_obj, PyObject *value, void *closure)
23018 : {
23019 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
23020 0 : if (value == NULL) {
23021 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_hostname");
23022 0 : return -1;
23023 : }
23024 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
23025 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23026 0 : PyErr_NoMemory();
23027 0 : return -1;
23028 : }
23029 0 : object->dns_hostname = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
23030 0 : return 0;
23031 : }
23032 :
23033 0 : static PyObject *py_netr_DomainInformation_get_dummy_string2(PyObject *obj, void *closure)
23034 : {
23035 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
23036 : PyObject *py_dummy_string2;
23037 0 : py_dummy_string2 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string2);
23038 0 : return py_dummy_string2;
23039 : }
23040 :
23041 0 : static int py_netr_DomainInformation_set_dummy_string2(PyObject *py_obj, PyObject *value, void *closure)
23042 : {
23043 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
23044 0 : if (value == NULL) {
23045 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string2");
23046 0 : return -1;
23047 : }
23048 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
23049 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23050 0 : PyErr_NoMemory();
23051 0 : return -1;
23052 : }
23053 0 : object->dummy_string2 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
23054 0 : return 0;
23055 : }
23056 :
23057 0 : static PyObject *py_netr_DomainInformation_get_dummy_string3(PyObject *obj, void *closure)
23058 : {
23059 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
23060 : PyObject *py_dummy_string3;
23061 0 : py_dummy_string3 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string3);
23062 0 : return py_dummy_string3;
23063 : }
23064 :
23065 0 : static int py_netr_DomainInformation_set_dummy_string3(PyObject *py_obj, PyObject *value, void *closure)
23066 : {
23067 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
23068 0 : if (value == NULL) {
23069 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string3");
23070 0 : return -1;
23071 : }
23072 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
23073 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23074 0 : PyErr_NoMemory();
23075 0 : return -1;
23076 : }
23077 0 : object->dummy_string3 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
23078 0 : return 0;
23079 : }
23080 :
23081 0 : static PyObject *py_netr_DomainInformation_get_dummy_string4(PyObject *obj, void *closure)
23082 : {
23083 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
23084 : PyObject *py_dummy_string4;
23085 0 : py_dummy_string4 = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dummy_string4);
23086 0 : return py_dummy_string4;
23087 : }
23088 :
23089 0 : static int py_netr_DomainInformation_set_dummy_string4(PyObject *py_obj, PyObject *value, void *closure)
23090 : {
23091 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
23092 0 : if (value == NULL) {
23093 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_string4");
23094 0 : return -1;
23095 : }
23096 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
23097 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23098 0 : PyErr_NoMemory();
23099 0 : return -1;
23100 : }
23101 0 : object->dummy_string4 = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
23102 0 : return 0;
23103 : }
23104 :
23105 0 : static PyObject *py_netr_DomainInformation_get_workstation_flags(PyObject *obj, void *closure)
23106 : {
23107 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
23108 : PyObject *py_workstation_flags;
23109 0 : py_workstation_flags = PyLong_FromUnsignedLongLong((uint32_t)object->workstation_flags);
23110 0 : return py_workstation_flags;
23111 : }
23112 :
23113 0 : static int py_netr_DomainInformation_set_workstation_flags(PyObject *py_obj, PyObject *value, void *closure)
23114 : {
23115 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
23116 0 : if (value == NULL) {
23117 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstation_flags");
23118 0 : return -1;
23119 : }
23120 : {
23121 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->workstation_flags));
23122 0 : if (PyLong_Check(value)) {
23123 : unsigned long long test_var;
23124 0 : test_var = PyLong_AsUnsignedLongLong(value);
23125 0 : if (PyErr_Occurred() != NULL) {
23126 0 : return -1;
23127 : }
23128 0 : if (test_var > uint_max) {
23129 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23130 : PyLong_Type.tp_name, uint_max, test_var);
23131 0 : return -1;
23132 : }
23133 0 : object->workstation_flags = test_var;
23134 : } else {
23135 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23136 : PyLong_Type.tp_name);
23137 0 : return -1;
23138 : }
23139 : }
23140 0 : return 0;
23141 : }
23142 :
23143 0 : static PyObject *py_netr_DomainInformation_get_supported_enc_types(PyObject *obj, void *closure)
23144 : {
23145 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
23146 : PyObject *py_supported_enc_types;
23147 0 : py_supported_enc_types = PyLong_FromUnsignedLongLong((uint32_t)object->supported_enc_types);
23148 0 : return py_supported_enc_types;
23149 : }
23150 :
23151 0 : static int py_netr_DomainInformation_set_supported_enc_types(PyObject *py_obj, PyObject *value, void *closure)
23152 : {
23153 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
23154 0 : if (value == NULL) {
23155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->supported_enc_types");
23156 0 : return -1;
23157 : }
23158 : {
23159 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->supported_enc_types));
23160 0 : if (PyLong_Check(value)) {
23161 : unsigned long long test_var;
23162 0 : test_var = PyLong_AsUnsignedLongLong(value);
23163 0 : if (PyErr_Occurred() != NULL) {
23164 0 : return -1;
23165 : }
23166 0 : if (test_var > uint_max) {
23167 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23168 : PyLong_Type.tp_name, uint_max, test_var);
23169 0 : return -1;
23170 : }
23171 0 : object->supported_enc_types = test_var;
23172 : } else {
23173 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23174 : PyLong_Type.tp_name);
23175 0 : return -1;
23176 : }
23177 : }
23178 0 : return 0;
23179 : }
23180 :
23181 0 : static PyObject *py_netr_DomainInformation_get_dummy_long3(PyObject *obj, void *closure)
23182 : {
23183 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
23184 : PyObject *py_dummy_long3;
23185 0 : py_dummy_long3 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long3);
23186 0 : return py_dummy_long3;
23187 : }
23188 :
23189 0 : static int py_netr_DomainInformation_set_dummy_long3(PyObject *py_obj, PyObject *value, void *closure)
23190 : {
23191 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
23192 0 : if (value == NULL) {
23193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long3");
23194 0 : return -1;
23195 : }
23196 : {
23197 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long3));
23198 0 : if (PyLong_Check(value)) {
23199 : unsigned long long test_var;
23200 0 : test_var = PyLong_AsUnsignedLongLong(value);
23201 0 : if (PyErr_Occurred() != NULL) {
23202 0 : return -1;
23203 : }
23204 0 : if (test_var > uint_max) {
23205 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23206 : PyLong_Type.tp_name, uint_max, test_var);
23207 0 : return -1;
23208 : }
23209 0 : object->dummy_long3 = test_var;
23210 : } else {
23211 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23212 : PyLong_Type.tp_name);
23213 0 : return -1;
23214 : }
23215 : }
23216 0 : return 0;
23217 : }
23218 :
23219 0 : static PyObject *py_netr_DomainInformation_get_dummy_long4(PyObject *obj, void *closure)
23220 : {
23221 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(obj);
23222 : PyObject *py_dummy_long4;
23223 0 : py_dummy_long4 = PyLong_FromUnsignedLongLong((uint32_t)object->dummy_long4);
23224 0 : return py_dummy_long4;
23225 : }
23226 :
23227 0 : static int py_netr_DomainInformation_set_dummy_long4(PyObject *py_obj, PyObject *value, void *closure)
23228 : {
23229 0 : struct netr_DomainInformation *object = (struct netr_DomainInformation *)pytalloc_get_ptr(py_obj);
23230 0 : if (value == NULL) {
23231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dummy_long4");
23232 0 : return -1;
23233 : }
23234 : {
23235 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dummy_long4));
23236 0 : if (PyLong_Check(value)) {
23237 : unsigned long long test_var;
23238 0 : test_var = PyLong_AsUnsignedLongLong(value);
23239 0 : if (PyErr_Occurred() != NULL) {
23240 0 : return -1;
23241 : }
23242 0 : if (test_var > uint_max) {
23243 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23244 : PyLong_Type.tp_name, uint_max, test_var);
23245 0 : return -1;
23246 : }
23247 0 : object->dummy_long4 = test_var;
23248 : } else {
23249 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23250 : PyLong_Type.tp_name);
23251 0 : return -1;
23252 : }
23253 : }
23254 0 : return 0;
23255 : }
23256 :
23257 : static PyGetSetDef py_netr_DomainInformation_getsetters[] = {
23258 : {
23259 : .name = discard_const_p(char, "primary_domain"),
23260 : .get = py_netr_DomainInformation_get_primary_domain,
23261 : .set = py_netr_DomainInformation_set_primary_domain,
23262 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_OneDomainInfo")
23263 : },
23264 : {
23265 : .name = discard_const_p(char, "trusted_domain_count"),
23266 : .get = py_netr_DomainInformation_get_trusted_domain_count,
23267 : .set = py_netr_DomainInformation_set_trusted_domain_count,
23268 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23269 : },
23270 : {
23271 : .name = discard_const_p(char, "trusted_domains"),
23272 : .get = py_netr_DomainInformation_get_trusted_domains,
23273 : .set = py_netr_DomainInformation_set_trusted_domains,
23274 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_OneDomainInfo")
23275 : },
23276 : {
23277 : .name = discard_const_p(char, "lsa_policy"),
23278 : .get = py_netr_DomainInformation_get_lsa_policy,
23279 : .set = py_netr_DomainInformation_set_lsa_policy,
23280 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LsaPolicyInformation")
23281 : },
23282 : {
23283 : .name = discard_const_p(char, "dns_hostname"),
23284 : .get = py_netr_DomainInformation_get_dns_hostname,
23285 : .set = py_netr_DomainInformation_set_dns_hostname,
23286 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
23287 : },
23288 : {
23289 : .name = discard_const_p(char, "dummy_string2"),
23290 : .get = py_netr_DomainInformation_get_dummy_string2,
23291 : .set = py_netr_DomainInformation_set_dummy_string2,
23292 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
23293 : },
23294 : {
23295 : .name = discard_const_p(char, "dummy_string3"),
23296 : .get = py_netr_DomainInformation_get_dummy_string3,
23297 : .set = py_netr_DomainInformation_set_dummy_string3,
23298 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
23299 : },
23300 : {
23301 : .name = discard_const_p(char, "dummy_string4"),
23302 : .get = py_netr_DomainInformation_get_dummy_string4,
23303 : .set = py_netr_DomainInformation_set_dummy_string4,
23304 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
23305 : },
23306 : {
23307 : .name = discard_const_p(char, "workstation_flags"),
23308 : .get = py_netr_DomainInformation_get_workstation_flags,
23309 : .set = py_netr_DomainInformation_set_workstation_flags,
23310 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_WorkstationFlags")
23311 : },
23312 : {
23313 : .name = discard_const_p(char, "supported_enc_types"),
23314 : .get = py_netr_DomainInformation_get_supported_enc_types,
23315 : .set = py_netr_DomainInformation_set_supported_enc_types,
23316 : .doc = discard_const_p(char, "PIDL-generated element of base type kerb_EncTypes")
23317 : },
23318 : {
23319 : .name = discard_const_p(char, "dummy_long3"),
23320 : .get = py_netr_DomainInformation_get_dummy_long3,
23321 : .set = py_netr_DomainInformation_set_dummy_long3,
23322 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23323 : },
23324 : {
23325 : .name = discard_const_p(char, "dummy_long4"),
23326 : .get = py_netr_DomainInformation_get_dummy_long4,
23327 : .set = py_netr_DomainInformation_set_dummy_long4,
23328 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23329 : },
23330 : { .name = NULL }
23331 : };
23332 :
23333 0 : static PyObject *py_netr_DomainInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23334 : {
23335 0 : return pytalloc_new(struct netr_DomainInformation, type);
23336 : }
23337 :
23338 :
23339 : static PyTypeObject netr_DomainInformation_Type = {
23340 : PyVarObject_HEAD_INIT(NULL, 0)
23341 : .tp_name = "netlogon.netr_DomainInformation",
23342 : .tp_getset = py_netr_DomainInformation_getsetters,
23343 : .tp_methods = NULL,
23344 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23345 : .tp_new = py_netr_DomainInformation_new,
23346 : };
23347 :
23348 35 : static PyObject *py_import_netr_DomainInfo(TALLOC_CTX *mem_ctx, int level, union netr_DomainInfo *in)
23349 : {
23350 : PyObject *ret;
23351 :
23352 35 : switch (level) {
23353 21 : case 1:
23354 21 : if (in->domain_info == NULL) {
23355 0 : ret = Py_None;
23356 0 : Py_INCREF(ret);
23357 : } else {
23358 21 : ret = pytalloc_reference_ex(&netr_DomainInformation_Type, in->domain_info, in->domain_info);
23359 : }
23360 21 : return ret;
23361 :
23362 14 : case 2:
23363 14 : if (in->lsa_policy_info == NULL) {
23364 0 : ret = Py_None;
23365 0 : Py_INCREF(ret);
23366 : } else {
23367 14 : ret = pytalloc_reference_ex(&netr_LsaPolicyInformation_Type, in->lsa_policy_info, in->lsa_policy_info);
23368 : }
23369 14 : return ret;
23370 :
23371 : }
23372 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
23373 0 : return NULL;
23374 : }
23375 :
23376 0 : static union netr_DomainInfo *py_export_netr_DomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
23377 : {
23378 0 : union netr_DomainInfo *ret = talloc_zero(mem_ctx, union netr_DomainInfo);
23379 0 : switch (level) {
23380 0 : case 1:
23381 0 : if (in == NULL) {
23382 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain_info");
23383 0 : talloc_free(ret); return NULL;
23384 : }
23385 0 : if (in == Py_None) {
23386 0 : ret->domain_info = NULL;
23387 : } else {
23388 0 : ret->domain_info = NULL;
23389 0 : PY_CHECK_TYPE(&netr_DomainInformation_Type, in, talloc_free(ret); return NULL;);
23390 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
23391 0 : PyErr_NoMemory();
23392 0 : talloc_free(ret); return NULL;
23393 : }
23394 0 : ret->domain_info = (struct netr_DomainInformation *)pytalloc_get_ptr(in);
23395 : }
23396 0 : break;
23397 :
23398 0 : case 2:
23399 0 : if (in == NULL) {
23400 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->lsa_policy_info");
23401 0 : talloc_free(ret); return NULL;
23402 : }
23403 0 : if (in == Py_None) {
23404 0 : ret->lsa_policy_info = NULL;
23405 : } else {
23406 0 : ret->lsa_policy_info = NULL;
23407 0 : PY_CHECK_TYPE(&netr_LsaPolicyInformation_Type, in, talloc_free(ret); return NULL;);
23408 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
23409 0 : PyErr_NoMemory();
23410 0 : talloc_free(ret); return NULL;
23411 : }
23412 0 : ret->lsa_policy_info = (struct netr_LsaPolicyInformation *)pytalloc_get_ptr(in);
23413 : }
23414 0 : break;
23415 :
23416 0 : default:
23417 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
23418 0 : talloc_free(ret);
23419 0 : ret = NULL;
23420 : }
23421 :
23422 0 : return ret;
23423 : }
23424 :
23425 35 : static PyObject *py_netr_DomainInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23426 : {
23427 35 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
23428 35 : PyObject *mem_ctx_obj = NULL;
23429 35 : TALLOC_CTX *mem_ctx = NULL;
23430 35 : int level = 0;
23431 35 : PyObject *in_obj = NULL;
23432 35 : union netr_DomainInfo *in = NULL;
23433 :
23434 35 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
23435 : discard_const_p(char *, kwnames),
23436 : &mem_ctx_obj,
23437 : &level,
23438 : &in_obj)) {
23439 0 : return NULL;
23440 : }
23441 35 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
23442 35 : if (mem_ctx == NULL) {
23443 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
23444 0 : return NULL;
23445 : }
23446 35 : in = (union netr_DomainInfo *)pytalloc_get_ptr(in_obj);
23447 35 : if (in == NULL) {
23448 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_DomainInfo!");
23449 0 : return NULL;
23450 : }
23451 :
23452 35 : return py_import_netr_DomainInfo(mem_ctx, level, in);
23453 : }
23454 :
23455 0 : static PyObject *py_netr_DomainInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23456 : {
23457 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
23458 0 : PyObject *mem_ctx_obj = NULL;
23459 0 : TALLOC_CTX *mem_ctx = NULL;
23460 0 : int level = 0;
23461 0 : PyObject *in = NULL;
23462 0 : union netr_DomainInfo *out = NULL;
23463 :
23464 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
23465 : discard_const_p(char *, kwnames),
23466 : &mem_ctx_obj,
23467 : &level,
23468 : &in)) {
23469 0 : return NULL;
23470 : }
23471 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
23472 0 : if (mem_ctx == NULL) {
23473 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
23474 0 : return NULL;
23475 : }
23476 :
23477 0 : out = py_export_netr_DomainInfo(mem_ctx, level, in);
23478 0 : if (out == NULL) {
23479 0 : return NULL;
23480 : }
23481 :
23482 0 : return pytalloc_GenericObject_reference(out);
23483 : }
23484 :
23485 : static PyMethodDef py_netr_DomainInfo_methods[] = {
23486 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DomainInfo_import),
23487 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
23488 : "T.__import__(mem_ctx, level, in) => ret." },
23489 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DomainInfo_export),
23490 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
23491 : "T.__export__(mem_ctx, level, in) => ret." },
23492 : { NULL, NULL, 0, NULL }
23493 : };
23494 :
23495 0 : static PyObject *py_netr_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23496 : {
23497 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
23498 0 : return NULL;
23499 : }
23500 :
23501 :
23502 : static PyTypeObject netr_DomainInfo_Type = {
23503 : PyVarObject_HEAD_INIT(NULL, 0)
23504 : .tp_name = "netlogon.netr_DomainInfo",
23505 : .tp_getset = NULL,
23506 : .tp_methods = py_netr_DomainInfo_methods,
23507 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23508 : .tp_new = py_netr_DomainInfo_new,
23509 : };
23510 :
23511 :
23512 0 : static PyObject *py_NL_PASSWORD_VERSION_get_ReservedField(PyObject *obj, void *closure)
23513 : {
23514 0 : struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(obj);
23515 : PyObject *py_ReservedField;
23516 0 : py_ReservedField = PyLong_FromUnsignedLongLong((uint32_t)object->ReservedField);
23517 0 : return py_ReservedField;
23518 : }
23519 :
23520 0 : static int py_NL_PASSWORD_VERSION_set_ReservedField(PyObject *py_obj, PyObject *value, void *closure)
23521 : {
23522 0 : struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(py_obj);
23523 0 : if (value == NULL) {
23524 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ReservedField");
23525 0 : return -1;
23526 : }
23527 : {
23528 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ReservedField));
23529 0 : if (PyLong_Check(value)) {
23530 : unsigned long long test_var;
23531 0 : test_var = PyLong_AsUnsignedLongLong(value);
23532 0 : if (PyErr_Occurred() != NULL) {
23533 0 : return -1;
23534 : }
23535 0 : if (test_var > uint_max) {
23536 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23537 : PyLong_Type.tp_name, uint_max, test_var);
23538 0 : return -1;
23539 : }
23540 0 : object->ReservedField = test_var;
23541 : } else {
23542 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23543 : PyLong_Type.tp_name);
23544 0 : return -1;
23545 : }
23546 : }
23547 0 : return 0;
23548 : }
23549 :
23550 0 : static PyObject *py_NL_PASSWORD_VERSION_get_PasswordVersionNumber(PyObject *obj, void *closure)
23551 : {
23552 0 : struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(obj);
23553 : PyObject *py_PasswordVersionNumber;
23554 0 : py_PasswordVersionNumber = PyLong_FromUnsignedLongLong((uint32_t)object->PasswordVersionNumber);
23555 0 : return py_PasswordVersionNumber;
23556 : }
23557 :
23558 0 : static int py_NL_PASSWORD_VERSION_set_PasswordVersionNumber(PyObject *py_obj, PyObject *value, void *closure)
23559 : {
23560 0 : struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(py_obj);
23561 0 : if (value == NULL) {
23562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->PasswordVersionNumber");
23563 0 : return -1;
23564 : }
23565 : {
23566 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PasswordVersionNumber));
23567 0 : if (PyLong_Check(value)) {
23568 : unsigned long long test_var;
23569 0 : test_var = PyLong_AsUnsignedLongLong(value);
23570 0 : if (PyErr_Occurred() != NULL) {
23571 0 : return -1;
23572 : }
23573 0 : if (test_var > uint_max) {
23574 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23575 : PyLong_Type.tp_name, uint_max, test_var);
23576 0 : return -1;
23577 : }
23578 0 : object->PasswordVersionNumber = test_var;
23579 : } else {
23580 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23581 : PyLong_Type.tp_name);
23582 0 : return -1;
23583 : }
23584 : }
23585 0 : return 0;
23586 : }
23587 :
23588 0 : static PyObject *py_NL_PASSWORD_VERSION_get_PasswordVersionPresent(PyObject *obj, void *closure)
23589 : {
23590 0 : struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(obj);
23591 : PyObject *py_PasswordVersionPresent;
23592 0 : py_PasswordVersionPresent = PyLong_FromUnsignedLongLong((uint32_t)object->PasswordVersionPresent);
23593 0 : return py_PasswordVersionPresent;
23594 : }
23595 :
23596 0 : static int py_NL_PASSWORD_VERSION_set_PasswordVersionPresent(PyObject *py_obj, PyObject *value, void *closure)
23597 : {
23598 0 : struct NL_PASSWORD_VERSION *object = (struct NL_PASSWORD_VERSION *)pytalloc_get_ptr(py_obj);
23599 0 : if (value == NULL) {
23600 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->PasswordVersionPresent");
23601 0 : return -1;
23602 : }
23603 : {
23604 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PasswordVersionPresent));
23605 0 : if (PyLong_Check(value)) {
23606 : unsigned long long test_var;
23607 0 : test_var = PyLong_AsUnsignedLongLong(value);
23608 0 : if (PyErr_Occurred() != NULL) {
23609 0 : return -1;
23610 : }
23611 0 : if (test_var > uint_max) {
23612 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23613 : PyLong_Type.tp_name, uint_max, test_var);
23614 0 : return -1;
23615 : }
23616 0 : object->PasswordVersionPresent = test_var;
23617 : } else {
23618 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23619 : PyLong_Type.tp_name);
23620 0 : return -1;
23621 : }
23622 : }
23623 0 : return 0;
23624 : }
23625 :
23626 : static PyGetSetDef py_NL_PASSWORD_VERSION_getsetters[] = {
23627 : {
23628 : .name = discard_const_p(char, "ReservedField"),
23629 : .get = py_NL_PASSWORD_VERSION_get_ReservedField,
23630 : .set = py_NL_PASSWORD_VERSION_set_ReservedField,
23631 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23632 : },
23633 : {
23634 : .name = discard_const_p(char, "PasswordVersionNumber"),
23635 : .get = py_NL_PASSWORD_VERSION_get_PasswordVersionNumber,
23636 : .set = py_NL_PASSWORD_VERSION_set_PasswordVersionNumber,
23637 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23638 : },
23639 : {
23640 : .name = discard_const_p(char, "PasswordVersionPresent"),
23641 : .get = py_NL_PASSWORD_VERSION_get_PasswordVersionPresent,
23642 : .set = py_NL_PASSWORD_VERSION_set_PasswordVersionPresent,
23643 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23644 : },
23645 : { .name = NULL }
23646 : };
23647 :
23648 0 : static PyObject *py_NL_PASSWORD_VERSION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23649 : {
23650 0 : return pytalloc_new(struct NL_PASSWORD_VERSION, type);
23651 : }
23652 :
23653 :
23654 : static PyTypeObject NL_PASSWORD_VERSION_Type = {
23655 : PyVarObject_HEAD_INIT(NULL, 0)
23656 : .tp_name = "netlogon.NL_PASSWORD_VERSION",
23657 : .tp_getset = py_NL_PASSWORD_VERSION_getsetters,
23658 : .tp_methods = NULL,
23659 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23660 : .tp_new = py_NL_PASSWORD_VERSION_new,
23661 : };
23662 :
23663 :
23664 0 : static PyObject *py_netr_CryptPassword_get_data(PyObject *obj, void *closure)
23665 : {
23666 0 : struct netr_CryptPassword *object = (struct netr_CryptPassword *)pytalloc_get_ptr(obj);
23667 : PyObject *py_data;
23668 0 : py_data = PyList_New(512);
23669 0 : if (py_data == NULL) {
23670 0 : return NULL;
23671 : }
23672 : {
23673 : int data_cntr_0;
23674 0 : for (data_cntr_0 = 0; data_cntr_0 < (512); data_cntr_0++) {
23675 : PyObject *py_data_0;
23676 0 : py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]);
23677 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
23678 : }
23679 : }
23680 0 : return py_data;
23681 : }
23682 :
23683 4 : static int py_netr_CryptPassword_set_data(PyObject *py_obj, PyObject *value, void *closure)
23684 : {
23685 4 : struct netr_CryptPassword *object = (struct netr_CryptPassword *)pytalloc_get_ptr(py_obj);
23686 4 : if (value == NULL) {
23687 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
23688 0 : return -1;
23689 : }
23690 4 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
23691 : {
23692 : int data_cntr_0;
23693 4 : if (ARRAY_SIZE(object->data) != PyList_GET_SIZE(value)) {
23694 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->data), PyList_GET_SIZE(value));
23695 0 : return -1;
23696 : }
23697 2052 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
23698 2048 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
23699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
23700 0 : return -1;
23701 : }
23702 : {
23703 2048 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0]));
23704 2048 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
23705 : unsigned long long test_var;
23706 2048 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
23707 2048 : if (PyErr_Occurred() != NULL) {
23708 0 : return -1;
23709 : }
23710 2048 : if (test_var > uint_max) {
23711 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23712 : PyLong_Type.tp_name, uint_max, test_var);
23713 0 : return -1;
23714 : }
23715 2048 : object->data[data_cntr_0] = test_var;
23716 : } else {
23717 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23718 : PyLong_Type.tp_name);
23719 0 : return -1;
23720 : }
23721 : }
23722 : }
23723 : }
23724 4 : return 0;
23725 : }
23726 :
23727 0 : static PyObject *py_netr_CryptPassword_get_length(PyObject *obj, void *closure)
23728 : {
23729 0 : struct netr_CryptPassword *object = (struct netr_CryptPassword *)pytalloc_get_ptr(obj);
23730 : PyObject *py_length;
23731 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
23732 0 : return py_length;
23733 : }
23734 :
23735 4 : static int py_netr_CryptPassword_set_length(PyObject *py_obj, PyObject *value, void *closure)
23736 : {
23737 4 : struct netr_CryptPassword *object = (struct netr_CryptPassword *)pytalloc_get_ptr(py_obj);
23738 4 : if (value == NULL) {
23739 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
23740 0 : return -1;
23741 : }
23742 : {
23743 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
23744 4 : if (PyLong_Check(value)) {
23745 : unsigned long long test_var;
23746 4 : test_var = PyLong_AsUnsignedLongLong(value);
23747 4 : if (PyErr_Occurred() != NULL) {
23748 0 : return -1;
23749 : }
23750 4 : if (test_var > uint_max) {
23751 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23752 : PyLong_Type.tp_name, uint_max, test_var);
23753 0 : return -1;
23754 : }
23755 4 : object->length = test_var;
23756 : } else {
23757 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23758 : PyLong_Type.tp_name);
23759 0 : return -1;
23760 : }
23761 : }
23762 4 : return 0;
23763 : }
23764 :
23765 : static PyGetSetDef py_netr_CryptPassword_getsetters[] = {
23766 : {
23767 : .name = discard_const_p(char, "data"),
23768 : .get = py_netr_CryptPassword_get_data,
23769 : .set = py_netr_CryptPassword_set_data,
23770 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
23771 : },
23772 : {
23773 : .name = discard_const_p(char, "length"),
23774 : .get = py_netr_CryptPassword_get_length,
23775 : .set = py_netr_CryptPassword_set_length,
23776 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23777 : },
23778 : { .name = NULL }
23779 : };
23780 :
23781 4 : static PyObject *py_netr_CryptPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23782 : {
23783 4 : return pytalloc_new(struct netr_CryptPassword, type);
23784 : }
23785 :
23786 :
23787 : static PyTypeObject netr_CryptPassword_Type = {
23788 : PyVarObject_HEAD_INIT(NULL, 0)
23789 : .tp_name = "netlogon.netr_CryptPassword",
23790 : .tp_getset = py_netr_CryptPassword_getsetters,
23791 : .tp_methods = NULL,
23792 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23793 : .tp_new = py_netr_CryptPassword_new,
23794 : };
23795 :
23796 :
23797 0 : static PyObject *py_netr_SendToSamResetBadPasswordCount_get_guid(PyObject *obj, void *closure)
23798 : {
23799 0 : struct netr_SendToSamResetBadPasswordCount *object = (struct netr_SendToSamResetBadPasswordCount *)pytalloc_get_ptr(obj);
23800 : PyObject *py_guid;
23801 0 : py_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->guid);
23802 0 : return py_guid;
23803 : }
23804 :
23805 0 : static int py_netr_SendToSamResetBadPasswordCount_set_guid(PyObject *py_obj, PyObject *value, void *closure)
23806 : {
23807 0 : struct netr_SendToSamResetBadPasswordCount *object = (struct netr_SendToSamResetBadPasswordCount *)pytalloc_get_ptr(py_obj);
23808 0 : if (value == NULL) {
23809 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->guid");
23810 0 : return -1;
23811 : }
23812 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
23813 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23814 0 : PyErr_NoMemory();
23815 0 : return -1;
23816 : }
23817 0 : object->guid = *(struct GUID *)pytalloc_get_ptr(value);
23818 0 : return 0;
23819 : }
23820 :
23821 : static PyGetSetDef py_netr_SendToSamResetBadPasswordCount_getsetters[] = {
23822 : {
23823 : .name = discard_const_p(char, "guid"),
23824 : .get = py_netr_SendToSamResetBadPasswordCount_get_guid,
23825 : .set = py_netr_SendToSamResetBadPasswordCount_set_guid,
23826 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
23827 : },
23828 : { .name = NULL }
23829 : };
23830 :
23831 0 : static PyObject *py_netr_SendToSamResetBadPasswordCount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23832 : {
23833 0 : return pytalloc_new(struct netr_SendToSamResetBadPasswordCount, type);
23834 : }
23835 :
23836 :
23837 : static PyTypeObject netr_SendToSamResetBadPasswordCount_Type = {
23838 : PyVarObject_HEAD_INIT(NULL, 0)
23839 : .tp_name = "netlogon.netr_SendToSamResetBadPasswordCount",
23840 : .tp_getset = py_netr_SendToSamResetBadPasswordCount_getsetters,
23841 : .tp_methods = NULL,
23842 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23843 : .tp_new = py_netr_SendToSamResetBadPasswordCount_new,
23844 : };
23845 :
23846 0 : static PyObject *py_import_netr_SendToSamMessage(TALLOC_CTX *mem_ctx, int level, union netr_SendToSamMessage *in)
23847 : {
23848 : PyObject *ret;
23849 :
23850 0 : switch (level) {
23851 0 : case SendToSamResetBadPasswordCount:
23852 0 : ret = pytalloc_reference_ex(&netr_SendToSamResetBadPasswordCount_Type, mem_ctx, &in->reset_bad_password);
23853 0 : return ret;
23854 :
23855 0 : default:
23856 0 : ret = Py_None;
23857 0 : Py_INCREF(ret);
23858 0 : return ret;
23859 :
23860 : }
23861 : PyErr_SetString(PyExc_TypeError, "unknown union level");
23862 : return NULL;
23863 : }
23864 :
23865 0 : static union netr_SendToSamMessage *py_export_netr_SendToSamMessage(TALLOC_CTX *mem_ctx, int level, PyObject *in)
23866 : {
23867 0 : union netr_SendToSamMessage *ret = talloc_zero(mem_ctx, union netr_SendToSamMessage);
23868 0 : switch (level) {
23869 0 : case SendToSamResetBadPasswordCount:
23870 0 : if (in == NULL) {
23871 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->reset_bad_password");
23872 0 : talloc_free(ret); return NULL;
23873 : }
23874 0 : PY_CHECK_TYPE(&netr_SendToSamResetBadPasswordCount_Type, in, talloc_free(ret); return NULL;);
23875 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
23876 0 : PyErr_NoMemory();
23877 0 : talloc_free(ret); return NULL;
23878 : }
23879 0 : ret->reset_bad_password = *(struct netr_SendToSamResetBadPasswordCount *)pytalloc_get_ptr(in);
23880 0 : break;
23881 :
23882 0 : default:
23883 0 : break;
23884 :
23885 : }
23886 :
23887 0 : return ret;
23888 : }
23889 :
23890 0 : static PyObject *py_netr_SendToSamMessage_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23891 : {
23892 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
23893 0 : PyObject *mem_ctx_obj = NULL;
23894 0 : TALLOC_CTX *mem_ctx = NULL;
23895 0 : int level = 0;
23896 0 : PyObject *in_obj = NULL;
23897 0 : union netr_SendToSamMessage *in = NULL;
23898 :
23899 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
23900 : discard_const_p(char *, kwnames),
23901 : &mem_ctx_obj,
23902 : &level,
23903 : &in_obj)) {
23904 0 : return NULL;
23905 : }
23906 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
23907 0 : if (mem_ctx == NULL) {
23908 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
23909 0 : return NULL;
23910 : }
23911 0 : in = (union netr_SendToSamMessage *)pytalloc_get_ptr(in_obj);
23912 0 : if (in == NULL) {
23913 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union netr_SendToSamMessage!");
23914 0 : return NULL;
23915 : }
23916 :
23917 0 : return py_import_netr_SendToSamMessage(mem_ctx, level, in);
23918 : }
23919 :
23920 0 : static PyObject *py_netr_SendToSamMessage_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23921 : {
23922 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
23923 0 : PyObject *mem_ctx_obj = NULL;
23924 0 : TALLOC_CTX *mem_ctx = NULL;
23925 0 : int level = 0;
23926 0 : PyObject *in = NULL;
23927 0 : union netr_SendToSamMessage *out = NULL;
23928 :
23929 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
23930 : discard_const_p(char *, kwnames),
23931 : &mem_ctx_obj,
23932 : &level,
23933 : &in)) {
23934 0 : return NULL;
23935 : }
23936 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
23937 0 : if (mem_ctx == NULL) {
23938 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
23939 0 : return NULL;
23940 : }
23941 :
23942 0 : out = py_export_netr_SendToSamMessage(mem_ctx, level, in);
23943 0 : if (out == NULL) {
23944 0 : return NULL;
23945 : }
23946 :
23947 0 : return pytalloc_GenericObject_reference(out);
23948 : }
23949 :
23950 : static PyMethodDef py_netr_SendToSamMessage_methods[] = {
23951 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SendToSamMessage_import),
23952 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
23953 : "T.__import__(mem_ctx, level, in) => ret." },
23954 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SendToSamMessage_export),
23955 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
23956 : "T.__export__(mem_ctx, level, in) => ret." },
23957 : { NULL, NULL, 0, NULL }
23958 : };
23959 :
23960 0 : static PyObject *py_netr_SendToSamMessage_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23961 : {
23962 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
23963 0 : return NULL;
23964 : }
23965 :
23966 :
23967 : static PyTypeObject netr_SendToSamMessage_Type = {
23968 : PyVarObject_HEAD_INIT(NULL, 0)
23969 : .tp_name = "netlogon.netr_SendToSamMessage",
23970 : .tp_getset = NULL,
23971 : .tp_methods = py_netr_SendToSamMessage_methods,
23972 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23973 : .tp_new = py_netr_SendToSamMessage_new,
23974 : };
23975 :
23976 :
23977 0 : static PyObject *py_netr_SendToSamBase_get_message_type(PyObject *obj, void *closure)
23978 : {
23979 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(obj);
23980 : PyObject *py_message_type;
23981 0 : py_message_type = PyLong_FromLong((uint16_t)object->message_type);
23982 0 : return py_message_type;
23983 : }
23984 :
23985 0 : static int py_netr_SendToSamBase_set_message_type(PyObject *py_obj, PyObject *value, void *closure)
23986 : {
23987 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj);
23988 0 : if (value == NULL) {
23989 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message_type");
23990 0 : return -1;
23991 : }
23992 : {
23993 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_type));
23994 0 : if (PyLong_Check(value)) {
23995 : unsigned long long test_var;
23996 0 : test_var = PyLong_AsUnsignedLongLong(value);
23997 0 : if (PyErr_Occurred() != NULL) {
23998 0 : return -1;
23999 : }
24000 0 : if (test_var > uint_max) {
24001 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24002 : PyLong_Type.tp_name, uint_max, test_var);
24003 0 : return -1;
24004 : }
24005 0 : object->message_type = test_var;
24006 : } else {
24007 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24008 : PyLong_Type.tp_name);
24009 0 : return -1;
24010 : }
24011 : }
24012 0 : return 0;
24013 : }
24014 :
24015 0 : static PyObject *py_netr_SendToSamBase_get_message_size(PyObject *obj, void *closure)
24016 : {
24017 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(obj);
24018 : PyObject *py_message_size;
24019 0 : py_message_size = PyLong_FromUnsignedLongLong((uint32_t)object->message_size);
24020 0 : return py_message_size;
24021 : }
24022 :
24023 0 : static int py_netr_SendToSamBase_set_message_size(PyObject *py_obj, PyObject *value, void *closure)
24024 : {
24025 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj);
24026 0 : if (value == NULL) {
24027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message_size");
24028 0 : return -1;
24029 : }
24030 : {
24031 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->message_size));
24032 0 : if (PyLong_Check(value)) {
24033 : unsigned long long test_var;
24034 0 : test_var = PyLong_AsUnsignedLongLong(value);
24035 0 : if (PyErr_Occurred() != NULL) {
24036 0 : return -1;
24037 : }
24038 0 : if (test_var > uint_max) {
24039 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24040 : PyLong_Type.tp_name, uint_max, test_var);
24041 0 : return -1;
24042 : }
24043 0 : object->message_size = test_var;
24044 : } else {
24045 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24046 : PyLong_Type.tp_name);
24047 0 : return -1;
24048 : }
24049 : }
24050 0 : return 0;
24051 : }
24052 :
24053 0 : static PyObject *py_netr_SendToSamBase_get_message(PyObject *obj, void *closure)
24054 : {
24055 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(obj);
24056 : PyObject *py_message;
24057 0 : py_message = pyrpc_import_union(&netr_SendToSamMessage_Type, pytalloc_get_mem_ctx(obj), object->message_type, &object->message, "union netr_SendToSamMessage");
24058 0 : if (py_message == NULL) {
24059 0 : return NULL;
24060 : }
24061 0 : return py_message;
24062 : }
24063 :
24064 0 : static int py_netr_SendToSamBase_set_message(PyObject *py_obj, PyObject *value, void *closure)
24065 : {
24066 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj);
24067 0 : if (value == NULL) {
24068 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->message");
24069 0 : return -1;
24070 : }
24071 : {
24072 : union netr_SendToSamMessage *message_switch_1;
24073 0 : message_switch_1 = (union netr_SendToSamMessage *)pyrpc_export_union(&netr_SendToSamMessage_Type, pytalloc_get_mem_ctx(py_obj), object->message_type, value, "union netr_SendToSamMessage");
24074 0 : if (message_switch_1 == NULL) {
24075 0 : return -1;
24076 : }
24077 0 : object->message = *message_switch_1;
24078 : }
24079 0 : return 0;
24080 : }
24081 :
24082 : static PyGetSetDef py_netr_SendToSamBase_getsetters[] = {
24083 : {
24084 : .name = discard_const_p(char, "message_type"),
24085 : .get = py_netr_SendToSamBase_get_message_type,
24086 : .set = py_netr_SendToSamBase_set_message_type,
24087 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SendToSamType")
24088 : },
24089 : {
24090 : .name = discard_const_p(char, "message_size"),
24091 : .get = py_netr_SendToSamBase_get_message_size,
24092 : .set = py_netr_SendToSamBase_set_message_size,
24093 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24094 : },
24095 : {
24096 : .name = discard_const_p(char, "message"),
24097 : .get = py_netr_SendToSamBase_get_message,
24098 : .set = py_netr_SendToSamBase_set_message,
24099 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SendToSamMessage")
24100 : },
24101 : { .name = NULL }
24102 : };
24103 :
24104 0 : static PyObject *py_netr_SendToSamBase_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24105 : {
24106 0 : return pytalloc_new(struct netr_SendToSamBase, type);
24107 : }
24108 :
24109 0 : static PyObject *py_netr_SendToSamBase_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24110 : {
24111 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj);
24112 0 : PyObject *ret = NULL;
24113 : DATA_BLOB blob;
24114 : enum ndr_err_code err;
24115 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
24116 0 : if (tmp_ctx == NULL) {
24117 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24118 0 : return NULL;
24119 : }
24120 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_SendToSamBase);
24121 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24122 0 : TALLOC_FREE(tmp_ctx);
24123 0 : PyErr_SetNdrError(err);
24124 0 : return NULL;
24125 : }
24126 :
24127 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24128 0 : TALLOC_FREE(tmp_ctx);
24129 0 : return ret;
24130 : }
24131 :
24132 0 : static PyObject *py_netr_SendToSamBase_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24133 : {
24134 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj);
24135 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
24136 0 : Py_ssize_t blob_length = 0;
24137 : enum ndr_err_code err;
24138 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
24139 0 : PyObject *allow_remaining_obj = NULL;
24140 0 : bool allow_remaining = false;
24141 :
24142 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
24143 : discard_const_p(char *, kwnames),
24144 : &blob.data, &blob_length,
24145 : &allow_remaining_obj)) {
24146 0 : return NULL;
24147 : }
24148 0 : blob.length = blob_length;
24149 :
24150 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24151 0 : allow_remaining = true;
24152 : }
24153 :
24154 0 : if (allow_remaining) {
24155 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SendToSamBase);
24156 : } else {
24157 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_SendToSamBase);
24158 : }
24159 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24160 0 : PyErr_SetNdrError(err);
24161 0 : return NULL;
24162 : }
24163 :
24164 0 : Py_RETURN_NONE;
24165 : }
24166 :
24167 0 : static PyObject *py_netr_SendToSamBase_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24168 : {
24169 0 : struct netr_SendToSamBase *object = (struct netr_SendToSamBase *)pytalloc_get_ptr(py_obj);
24170 : PyObject *ret;
24171 : char *retstr;
24172 :
24173 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_SendToSamBase, "netr_SendToSamBase", object);
24174 0 : ret = PyUnicode_FromString(retstr);
24175 0 : talloc_free(retstr);
24176 :
24177 0 : return ret;
24178 : }
24179 :
24180 : static PyMethodDef py_netr_SendToSamBase_methods[] = {
24181 : { "__ndr_pack__", (PyCFunction)py_netr_SendToSamBase_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
24182 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_SendToSamBase_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
24183 : { "__ndr_print__", (PyCFunction)py_netr_SendToSamBase_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
24184 : { NULL, NULL, 0, NULL }
24185 : };
24186 :
24187 :
24188 : static PyTypeObject netr_SendToSamBase_Type = {
24189 : PyVarObject_HEAD_INIT(NULL, 0)
24190 : .tp_name = "netlogon.netr_SendToSamBase",
24191 : .tp_getset = py_netr_SendToSamBase_getsetters,
24192 : .tp_methods = py_netr_SendToSamBase_methods,
24193 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24194 : .tp_new = py_netr_SendToSamBase_new,
24195 : };
24196 :
24197 :
24198 0 : static PyObject *py_netr_DsRAddressToSitenamesWCtr_get_count(PyObject *obj, void *closure)
24199 : {
24200 0 : struct netr_DsRAddressToSitenamesWCtr *object = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(obj);
24201 : PyObject *py_count;
24202 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
24203 0 : return py_count;
24204 : }
24205 :
24206 0 : static int py_netr_DsRAddressToSitenamesWCtr_set_count(PyObject *py_obj, PyObject *value, void *closure)
24207 : {
24208 0 : struct netr_DsRAddressToSitenamesWCtr *object = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(py_obj);
24209 0 : if (value == NULL) {
24210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
24211 0 : return -1;
24212 : }
24213 : {
24214 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
24215 0 : if (PyLong_Check(value)) {
24216 : unsigned long long test_var;
24217 0 : test_var = PyLong_AsUnsignedLongLong(value);
24218 0 : if (PyErr_Occurred() != NULL) {
24219 0 : return -1;
24220 : }
24221 0 : if (test_var > uint_max) {
24222 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24223 : PyLong_Type.tp_name, uint_max, test_var);
24224 0 : return -1;
24225 : }
24226 0 : object->count = test_var;
24227 : } else {
24228 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24229 : PyLong_Type.tp_name);
24230 0 : return -1;
24231 : }
24232 : }
24233 0 : return 0;
24234 : }
24235 :
24236 0 : static PyObject *py_netr_DsRAddressToSitenamesWCtr_get_sitename(PyObject *obj, void *closure)
24237 : {
24238 0 : struct netr_DsRAddressToSitenamesWCtr *object = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(obj);
24239 : PyObject *py_sitename;
24240 0 : if (object->sitename == NULL) {
24241 0 : Py_RETURN_NONE;
24242 : }
24243 0 : if (object->sitename == NULL) {
24244 0 : py_sitename = Py_None;
24245 0 : Py_INCREF(py_sitename);
24246 : } else {
24247 0 : py_sitename = PyList_New(object->count);
24248 0 : if (py_sitename == NULL) {
24249 0 : return NULL;
24250 : }
24251 : {
24252 : int sitename_cntr_1;
24253 0 : for (sitename_cntr_1 = 0; sitename_cntr_1 < (object->count); sitename_cntr_1++) {
24254 : PyObject *py_sitename_1;
24255 0 : py_sitename_1 = pytalloc_reference_ex(lsa_String_Type, object->sitename, &object->sitename[sitename_cntr_1]);
24256 0 : PyList_SetItem(py_sitename, sitename_cntr_1, py_sitename_1);
24257 : }
24258 : }
24259 : }
24260 0 : return py_sitename;
24261 : }
24262 :
24263 0 : static int py_netr_DsRAddressToSitenamesWCtr_set_sitename(PyObject *py_obj, PyObject *value, void *closure)
24264 : {
24265 0 : struct netr_DsRAddressToSitenamesWCtr *object = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(py_obj);
24266 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sitename));
24267 0 : if (value == NULL) {
24268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename");
24269 0 : return -1;
24270 : }
24271 0 : if (value == Py_None) {
24272 0 : object->sitename = NULL;
24273 : } else {
24274 0 : object->sitename = NULL;
24275 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
24276 : {
24277 : int sitename_cntr_1;
24278 0 : object->sitename = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sitename, PyList_GET_SIZE(value));
24279 0 : if (!object->sitename) { return -1;; }
24280 0 : talloc_set_name_const(object->sitename, "ARRAY: object->sitename");
24281 0 : for (sitename_cntr_1 = 0; sitename_cntr_1 < PyList_GET_SIZE(value); sitename_cntr_1++) {
24282 0 : if (PyList_GET_ITEM(value, sitename_cntr_1) == NULL) {
24283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename[sitename_cntr_1]");
24284 0 : return -1;
24285 : }
24286 0 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, sitename_cntr_1), return -1;);
24287 0 : if (talloc_reference(object->sitename, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sitename_cntr_1))) == NULL) {
24288 0 : PyErr_NoMemory();
24289 0 : return -1;
24290 : }
24291 0 : object->sitename[sitename_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, sitename_cntr_1));
24292 : }
24293 : }
24294 : }
24295 0 : return 0;
24296 : }
24297 :
24298 : static PyGetSetDef py_netr_DsRAddressToSitenamesWCtr_getsetters[] = {
24299 : {
24300 : .name = discard_const_p(char, "count"),
24301 : .get = py_netr_DsRAddressToSitenamesWCtr_get_count,
24302 : .set = py_netr_DsRAddressToSitenamesWCtr_set_count,
24303 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24304 : },
24305 : {
24306 : .name = discard_const_p(char, "sitename"),
24307 : .get = py_netr_DsRAddressToSitenamesWCtr_get_sitename,
24308 : .set = py_netr_DsRAddressToSitenamesWCtr_set_sitename,
24309 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
24310 : },
24311 : { .name = NULL }
24312 : };
24313 :
24314 0 : static PyObject *py_netr_DsRAddressToSitenamesWCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24315 : {
24316 0 : return pytalloc_new(struct netr_DsRAddressToSitenamesWCtr, type);
24317 : }
24318 :
24319 :
24320 : static PyTypeObject netr_DsRAddressToSitenamesWCtr_Type = {
24321 : PyVarObject_HEAD_INIT(NULL, 0)
24322 : .tp_name = "netlogon.netr_DsRAddressToSitenamesWCtr",
24323 : .tp_getset = py_netr_DsRAddressToSitenamesWCtr_getsetters,
24324 : .tp_methods = NULL,
24325 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24326 : .tp_new = py_netr_DsRAddressToSitenamesWCtr_new,
24327 : };
24328 :
24329 :
24330 0 : static PyObject *py_netr_DsRAddress_get_buffer(PyObject *obj, void *closure)
24331 : {
24332 0 : struct netr_DsRAddress *object = (struct netr_DsRAddress *)pytalloc_get_ptr(obj);
24333 : PyObject *py_buffer;
24334 0 : if (object->buffer == NULL) {
24335 0 : Py_RETURN_NONE;
24336 : }
24337 0 : if (object->buffer == NULL) {
24338 0 : py_buffer = Py_None;
24339 0 : Py_INCREF(py_buffer);
24340 : } else {
24341 0 : py_buffer = PyList_New(object->size);
24342 0 : if (py_buffer == NULL) {
24343 0 : return NULL;
24344 : }
24345 : {
24346 : int buffer_cntr_1;
24347 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->size); buffer_cntr_1++) {
24348 : PyObject *py_buffer_1;
24349 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->buffer[buffer_cntr_1]);
24350 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
24351 : }
24352 : }
24353 : }
24354 0 : return py_buffer;
24355 : }
24356 :
24357 0 : static int py_netr_DsRAddress_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
24358 : {
24359 0 : struct netr_DsRAddress *object = (struct netr_DsRAddress *)pytalloc_get_ptr(py_obj);
24360 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->buffer));
24361 0 : if (value == NULL) {
24362 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffer");
24363 0 : return -1;
24364 : }
24365 0 : if (value == Py_None) {
24366 0 : object->buffer = NULL;
24367 : } else {
24368 0 : object->buffer = NULL;
24369 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
24370 : {
24371 : int buffer_cntr_1;
24372 0 : object->buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffer, PyList_GET_SIZE(value));
24373 0 : if (!object->buffer) { return -1;; }
24374 0 : talloc_set_name_const(object->buffer, "ARRAY: object->buffer");
24375 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
24376 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
24377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffer[buffer_cntr_1]");
24378 0 : return -1;
24379 : }
24380 : {
24381 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->buffer[buffer_cntr_1]));
24382 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
24383 : unsigned long long test_var;
24384 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
24385 0 : if (PyErr_Occurred() != NULL) {
24386 0 : return -1;
24387 : }
24388 0 : if (test_var > uint_max) {
24389 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24390 : PyLong_Type.tp_name, uint_max, test_var);
24391 0 : return -1;
24392 : }
24393 0 : object->buffer[buffer_cntr_1] = test_var;
24394 : } else {
24395 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24396 : PyLong_Type.tp_name);
24397 0 : return -1;
24398 : }
24399 : }
24400 : }
24401 : }
24402 : }
24403 0 : return 0;
24404 : }
24405 :
24406 0 : static PyObject *py_netr_DsRAddress_get_size(PyObject *obj, void *closure)
24407 : {
24408 0 : struct netr_DsRAddress *object = (struct netr_DsRAddress *)pytalloc_get_ptr(obj);
24409 : PyObject *py_size;
24410 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
24411 0 : return py_size;
24412 : }
24413 :
24414 0 : static int py_netr_DsRAddress_set_size(PyObject *py_obj, PyObject *value, void *closure)
24415 : {
24416 0 : struct netr_DsRAddress *object = (struct netr_DsRAddress *)pytalloc_get_ptr(py_obj);
24417 0 : if (value == NULL) {
24418 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
24419 0 : return -1;
24420 : }
24421 : {
24422 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
24423 0 : if (PyLong_Check(value)) {
24424 : unsigned long long test_var;
24425 0 : test_var = PyLong_AsUnsignedLongLong(value);
24426 0 : if (PyErr_Occurred() != NULL) {
24427 0 : return -1;
24428 : }
24429 0 : if (test_var > uint_max) {
24430 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24431 : PyLong_Type.tp_name, uint_max, test_var);
24432 0 : return -1;
24433 : }
24434 0 : object->size = test_var;
24435 : } else {
24436 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24437 : PyLong_Type.tp_name);
24438 0 : return -1;
24439 : }
24440 : }
24441 0 : return 0;
24442 : }
24443 :
24444 : static PyGetSetDef py_netr_DsRAddress_getsetters[] = {
24445 : {
24446 : .name = discard_const_p(char, "buffer"),
24447 : .get = py_netr_DsRAddress_get_buffer,
24448 : .set = py_netr_DsRAddress_set_buffer,
24449 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
24450 : },
24451 : {
24452 : .name = discard_const_p(char, "size"),
24453 : .get = py_netr_DsRAddress_get_size,
24454 : .set = py_netr_DsRAddress_set_size,
24455 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24456 : },
24457 : { .name = NULL }
24458 : };
24459 :
24460 0 : static PyObject *py_netr_DsRAddress_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24461 : {
24462 0 : return pytalloc_new(struct netr_DsRAddress, type);
24463 : }
24464 :
24465 :
24466 : static PyTypeObject netr_DsRAddress_Type = {
24467 : PyVarObject_HEAD_INIT(NULL, 0)
24468 : .tp_name = "netlogon.netr_DsRAddress",
24469 : .tp_getset = py_netr_DsRAddress_getsetters,
24470 : .tp_methods = NULL,
24471 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24472 : .tp_new = py_netr_DsRAddress_new,
24473 : };
24474 :
24475 :
24476 0 : static PyObject *py_netr_DomainTrust_get_netbios_name(PyObject *obj, void *closure)
24477 : {
24478 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj);
24479 : PyObject *py_netbios_name;
24480 0 : if (object->netbios_name == NULL) {
24481 0 : Py_RETURN_NONE;
24482 : }
24483 0 : if (object->netbios_name == NULL) {
24484 0 : py_netbios_name = Py_None;
24485 0 : Py_INCREF(py_netbios_name);
24486 : } else {
24487 0 : if (object->netbios_name == NULL) {
24488 0 : py_netbios_name = Py_None;
24489 0 : Py_INCREF(py_netbios_name);
24490 : } else {
24491 0 : py_netbios_name = PyUnicode_Decode(object->netbios_name, strlen(object->netbios_name), "utf-8", "ignore");
24492 : }
24493 : }
24494 0 : return py_netbios_name;
24495 : }
24496 :
24497 0 : static int py_netr_DomainTrust_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
24498 : {
24499 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24500 0 : if (value == NULL) {
24501 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name");
24502 0 : return -1;
24503 : }
24504 0 : if (value == Py_None) {
24505 0 : object->netbios_name = NULL;
24506 : } else {
24507 0 : object->netbios_name = NULL;
24508 : {
24509 : const char *test_str;
24510 : const char *talloc_str;
24511 0 : PyObject *unicode = NULL;
24512 0 : if (PyUnicode_Check(value)) {
24513 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
24514 0 : if (unicode == NULL) {
24515 0 : PyErr_NoMemory();
24516 0 : return -1;
24517 : }
24518 0 : test_str = PyBytes_AS_STRING(unicode);
24519 0 : } else if (PyBytes_Check(value)) {
24520 0 : test_str = PyBytes_AS_STRING(value);
24521 : } else {
24522 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
24523 0 : return -1;
24524 : }
24525 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
24526 0 : if (unicode != NULL) {
24527 0 : Py_DECREF(unicode);
24528 : }
24529 0 : if (talloc_str == NULL) {
24530 0 : PyErr_NoMemory();
24531 0 : return -1;
24532 : }
24533 0 : object->netbios_name = talloc_str;
24534 : }
24535 : }
24536 0 : return 0;
24537 : }
24538 :
24539 26 : static PyObject *py_netr_DomainTrust_get_dns_name(PyObject *obj, void *closure)
24540 : {
24541 26 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj);
24542 : PyObject *py_dns_name;
24543 26 : if (object->dns_name == NULL) {
24544 0 : Py_RETURN_NONE;
24545 : }
24546 26 : if (object->dns_name == NULL) {
24547 0 : py_dns_name = Py_None;
24548 0 : Py_INCREF(py_dns_name);
24549 : } else {
24550 26 : if (object->dns_name == NULL) {
24551 0 : py_dns_name = Py_None;
24552 0 : Py_INCREF(py_dns_name);
24553 : } else {
24554 26 : py_dns_name = PyUnicode_Decode(object->dns_name, strlen(object->dns_name), "utf-8", "ignore");
24555 : }
24556 : }
24557 26 : return py_dns_name;
24558 : }
24559 :
24560 0 : static int py_netr_DomainTrust_set_dns_name(PyObject *py_obj, PyObject *value, void *closure)
24561 : {
24562 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24563 0 : if (value == NULL) {
24564 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_name");
24565 0 : return -1;
24566 : }
24567 0 : if (value == Py_None) {
24568 0 : object->dns_name = NULL;
24569 : } else {
24570 0 : object->dns_name = NULL;
24571 : {
24572 : const char *test_str;
24573 : const char *talloc_str;
24574 0 : PyObject *unicode = NULL;
24575 0 : if (PyUnicode_Check(value)) {
24576 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
24577 0 : if (unicode == NULL) {
24578 0 : PyErr_NoMemory();
24579 0 : return -1;
24580 : }
24581 0 : test_str = PyBytes_AS_STRING(unicode);
24582 0 : } else if (PyBytes_Check(value)) {
24583 0 : test_str = PyBytes_AS_STRING(value);
24584 : } else {
24585 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
24586 0 : return -1;
24587 : }
24588 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
24589 0 : if (unicode != NULL) {
24590 0 : Py_DECREF(unicode);
24591 : }
24592 0 : if (talloc_str == NULL) {
24593 0 : PyErr_NoMemory();
24594 0 : return -1;
24595 : }
24596 0 : object->dns_name = talloc_str;
24597 : }
24598 : }
24599 0 : return 0;
24600 : }
24601 :
24602 252 : static PyObject *py_netr_DomainTrust_get_trust_flags(PyObject *obj, void *closure)
24603 : {
24604 252 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj);
24605 : PyObject *py_trust_flags;
24606 252 : py_trust_flags = PyLong_FromUnsignedLongLong((uint32_t)object->trust_flags);
24607 252 : return py_trust_flags;
24608 : }
24609 :
24610 0 : static int py_netr_DomainTrust_set_trust_flags(PyObject *py_obj, PyObject *value, void *closure)
24611 : {
24612 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24613 0 : if (value == NULL) {
24614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_flags");
24615 0 : return -1;
24616 : }
24617 : {
24618 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_flags));
24619 0 : if (PyLong_Check(value)) {
24620 : unsigned long long test_var;
24621 0 : test_var = PyLong_AsUnsignedLongLong(value);
24622 0 : if (PyErr_Occurred() != NULL) {
24623 0 : return -1;
24624 : }
24625 0 : if (test_var > uint_max) {
24626 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24627 : PyLong_Type.tp_name, uint_max, test_var);
24628 0 : return -1;
24629 : }
24630 0 : object->trust_flags = test_var;
24631 : } else {
24632 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24633 : PyLong_Type.tp_name);
24634 0 : return -1;
24635 : }
24636 : }
24637 0 : return 0;
24638 : }
24639 :
24640 0 : static PyObject *py_netr_DomainTrust_get_parent_index(PyObject *obj, void *closure)
24641 : {
24642 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj);
24643 : PyObject *py_parent_index;
24644 0 : py_parent_index = PyLong_FromUnsignedLongLong((uint32_t)object->parent_index);
24645 0 : return py_parent_index;
24646 : }
24647 :
24648 0 : static int py_netr_DomainTrust_set_parent_index(PyObject *py_obj, PyObject *value, void *closure)
24649 : {
24650 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24651 0 : if (value == NULL) {
24652 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parent_index");
24653 0 : return -1;
24654 : }
24655 : {
24656 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->parent_index));
24657 0 : if (PyLong_Check(value)) {
24658 : unsigned long long test_var;
24659 0 : test_var = PyLong_AsUnsignedLongLong(value);
24660 0 : if (PyErr_Occurred() != NULL) {
24661 0 : return -1;
24662 : }
24663 0 : if (test_var > uint_max) {
24664 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24665 : PyLong_Type.tp_name, uint_max, test_var);
24666 0 : return -1;
24667 : }
24668 0 : object->parent_index = test_var;
24669 : } else {
24670 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24671 : PyLong_Type.tp_name);
24672 0 : return -1;
24673 : }
24674 : }
24675 0 : return 0;
24676 : }
24677 :
24678 26 : static PyObject *py_netr_DomainTrust_get_trust_type(PyObject *obj, void *closure)
24679 : {
24680 26 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj);
24681 : PyObject *py_trust_type;
24682 26 : py_trust_type = PyLong_FromUnsignedLongLong((uint32_t)object->trust_type);
24683 26 : return py_trust_type;
24684 : }
24685 :
24686 0 : static int py_netr_DomainTrust_set_trust_type(PyObject *py_obj, PyObject *value, void *closure)
24687 : {
24688 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24689 0 : if (value == NULL) {
24690 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_type");
24691 0 : return -1;
24692 : }
24693 : {
24694 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_type));
24695 0 : if (PyLong_Check(value)) {
24696 : unsigned long long test_var;
24697 0 : test_var = PyLong_AsUnsignedLongLong(value);
24698 0 : if (PyErr_Occurred() != NULL) {
24699 0 : return -1;
24700 : }
24701 0 : if (test_var > uint_max) {
24702 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24703 : PyLong_Type.tp_name, uint_max, test_var);
24704 0 : return -1;
24705 : }
24706 0 : object->trust_type = test_var;
24707 : } else {
24708 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24709 : PyLong_Type.tp_name);
24710 0 : return -1;
24711 : }
24712 : }
24713 0 : return 0;
24714 : }
24715 :
24716 78 : static PyObject *py_netr_DomainTrust_get_trust_attributes(PyObject *obj, void *closure)
24717 : {
24718 78 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj);
24719 : PyObject *py_trust_attributes;
24720 78 : py_trust_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->trust_attributes);
24721 78 : return py_trust_attributes;
24722 : }
24723 :
24724 0 : static int py_netr_DomainTrust_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure)
24725 : {
24726 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24727 0 : if (value == NULL) {
24728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_attributes");
24729 0 : return -1;
24730 : }
24731 : {
24732 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_attributes));
24733 0 : if (PyLong_Check(value)) {
24734 : unsigned long long test_var;
24735 0 : test_var = PyLong_AsUnsignedLongLong(value);
24736 0 : if (PyErr_Occurred() != NULL) {
24737 0 : return -1;
24738 : }
24739 0 : if (test_var > uint_max) {
24740 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24741 : PyLong_Type.tp_name, uint_max, test_var);
24742 0 : return -1;
24743 : }
24744 0 : object->trust_attributes = test_var;
24745 : } else {
24746 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24747 : PyLong_Type.tp_name);
24748 0 : return -1;
24749 : }
24750 : }
24751 0 : return 0;
24752 : }
24753 :
24754 0 : static PyObject *py_netr_DomainTrust_get_sid(PyObject *obj, void *closure)
24755 : {
24756 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj);
24757 : PyObject *py_sid;
24758 0 : if (object->sid == NULL) {
24759 0 : Py_RETURN_NONE;
24760 : }
24761 0 : if (object->sid == NULL) {
24762 0 : py_sid = Py_None;
24763 0 : Py_INCREF(py_sid);
24764 : } else {
24765 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
24766 : }
24767 0 : return py_sid;
24768 : }
24769 :
24770 0 : static int py_netr_DomainTrust_set_sid(PyObject *py_obj, PyObject *value, void *closure)
24771 : {
24772 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24773 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
24774 0 : if (value == NULL) {
24775 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
24776 0 : return -1;
24777 : }
24778 0 : if (value == Py_None) {
24779 0 : object->sid = NULL;
24780 : } else {
24781 0 : object->sid = NULL;
24782 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
24783 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24784 0 : PyErr_NoMemory();
24785 0 : return -1;
24786 : }
24787 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
24788 : }
24789 0 : return 0;
24790 : }
24791 :
24792 0 : static PyObject *py_netr_DomainTrust_get_guid(PyObject *obj, void *closure)
24793 : {
24794 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(obj);
24795 : PyObject *py_guid;
24796 0 : py_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->guid);
24797 0 : return py_guid;
24798 : }
24799 :
24800 0 : static int py_netr_DomainTrust_set_guid(PyObject *py_obj, PyObject *value, void *closure)
24801 : {
24802 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24803 0 : if (value == NULL) {
24804 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->guid");
24805 0 : return -1;
24806 : }
24807 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
24808 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24809 0 : PyErr_NoMemory();
24810 0 : return -1;
24811 : }
24812 0 : object->guid = *(struct GUID *)pytalloc_get_ptr(value);
24813 0 : return 0;
24814 : }
24815 :
24816 : static PyGetSetDef py_netr_DomainTrust_getsetters[] = {
24817 : {
24818 : .name = discard_const_p(char, "netbios_name"),
24819 : .get = py_netr_DomainTrust_get_netbios_name,
24820 : .set = py_netr_DomainTrust_set_netbios_name,
24821 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
24822 : },
24823 : {
24824 : .name = discard_const_p(char, "dns_name"),
24825 : .get = py_netr_DomainTrust_get_dns_name,
24826 : .set = py_netr_DomainTrust_set_dns_name,
24827 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
24828 : },
24829 : {
24830 : .name = discard_const_p(char, "trust_flags"),
24831 : .get = py_netr_DomainTrust_get_trust_flags,
24832 : .set = py_netr_DomainTrust_set_trust_flags,
24833 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_TrustFlags")
24834 : },
24835 : {
24836 : .name = discard_const_p(char, "parent_index"),
24837 : .get = py_netr_DomainTrust_get_parent_index,
24838 : .set = py_netr_DomainTrust_set_parent_index,
24839 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24840 : },
24841 : {
24842 : .name = discard_const_p(char, "trust_type"),
24843 : .get = py_netr_DomainTrust_get_trust_type,
24844 : .set = py_netr_DomainTrust_set_trust_type,
24845 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustType")
24846 : },
24847 : {
24848 : .name = discard_const_p(char, "trust_attributes"),
24849 : .get = py_netr_DomainTrust_get_trust_attributes,
24850 : .set = py_netr_DomainTrust_set_trust_attributes,
24851 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAttributes")
24852 : },
24853 : {
24854 : .name = discard_const_p(char, "sid"),
24855 : .get = py_netr_DomainTrust_get_sid,
24856 : .set = py_netr_DomainTrust_set_sid,
24857 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
24858 : },
24859 : {
24860 : .name = discard_const_p(char, "guid"),
24861 : .get = py_netr_DomainTrust_get_guid,
24862 : .set = py_netr_DomainTrust_set_guid,
24863 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
24864 : },
24865 : { .name = NULL }
24866 : };
24867 :
24868 0 : static PyObject *py_netr_DomainTrust_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24869 : {
24870 0 : return pytalloc_new(struct netr_DomainTrust, type);
24871 : }
24872 :
24873 0 : static PyObject *py_netr_DomainTrust_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24874 : {
24875 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24876 0 : PyObject *ret = NULL;
24877 : DATA_BLOB blob;
24878 : enum ndr_err_code err;
24879 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
24880 0 : if (tmp_ctx == NULL) {
24881 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24882 0 : return NULL;
24883 : }
24884 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_DomainTrust);
24885 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24886 0 : TALLOC_FREE(tmp_ctx);
24887 0 : PyErr_SetNdrError(err);
24888 0 : return NULL;
24889 : }
24890 :
24891 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24892 0 : TALLOC_FREE(tmp_ctx);
24893 0 : return ret;
24894 : }
24895 :
24896 0 : static PyObject *py_netr_DomainTrust_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24897 : {
24898 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24899 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
24900 0 : Py_ssize_t blob_length = 0;
24901 : enum ndr_err_code err;
24902 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
24903 0 : PyObject *allow_remaining_obj = NULL;
24904 0 : bool allow_remaining = false;
24905 :
24906 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
24907 : discard_const_p(char *, kwnames),
24908 : &blob.data, &blob_length,
24909 : &allow_remaining_obj)) {
24910 0 : return NULL;
24911 : }
24912 0 : blob.length = blob_length;
24913 :
24914 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24915 0 : allow_remaining = true;
24916 : }
24917 :
24918 0 : if (allow_remaining) {
24919 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_DomainTrust);
24920 : } else {
24921 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_DomainTrust);
24922 : }
24923 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24924 0 : PyErr_SetNdrError(err);
24925 0 : return NULL;
24926 : }
24927 :
24928 0 : Py_RETURN_NONE;
24929 : }
24930 :
24931 0 : static PyObject *py_netr_DomainTrust_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24932 : {
24933 0 : struct netr_DomainTrust *object = (struct netr_DomainTrust *)pytalloc_get_ptr(py_obj);
24934 : PyObject *ret;
24935 : char *retstr;
24936 :
24937 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_DomainTrust, "netr_DomainTrust", object);
24938 0 : ret = PyUnicode_FromString(retstr);
24939 0 : talloc_free(retstr);
24940 :
24941 0 : return ret;
24942 : }
24943 :
24944 : static PyMethodDef py_netr_DomainTrust_methods[] = {
24945 : { "__ndr_pack__", (PyCFunction)py_netr_DomainTrust_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
24946 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DomainTrust_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
24947 : { "__ndr_print__", (PyCFunction)py_netr_DomainTrust_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
24948 : { NULL, NULL, 0, NULL }
24949 : };
24950 :
24951 :
24952 : static PyTypeObject netr_DomainTrust_Type = {
24953 : PyVarObject_HEAD_INIT(NULL, 0)
24954 : .tp_name = "netlogon.netr_DomainTrust",
24955 : .tp_getset = py_netr_DomainTrust_getsetters,
24956 : .tp_methods = py_netr_DomainTrust_methods,
24957 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24958 : .tp_new = py_netr_DomainTrust_new,
24959 : };
24960 :
24961 :
24962 0 : static PyObject *py_netr_DomainTrustList_get_count(PyObject *obj, void *closure)
24963 : {
24964 0 : struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(obj);
24965 : PyObject *py_count;
24966 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
24967 0 : return py_count;
24968 : }
24969 :
24970 0 : static int py_netr_DomainTrustList_set_count(PyObject *py_obj, PyObject *value, void *closure)
24971 : {
24972 0 : struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(py_obj);
24973 0 : if (value == NULL) {
24974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
24975 0 : return -1;
24976 : }
24977 : {
24978 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
24979 0 : if (PyLong_Check(value)) {
24980 : unsigned long long test_var;
24981 0 : test_var = PyLong_AsUnsignedLongLong(value);
24982 0 : if (PyErr_Occurred() != NULL) {
24983 0 : return -1;
24984 : }
24985 0 : if (test_var > uint_max) {
24986 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24987 : PyLong_Type.tp_name, uint_max, test_var);
24988 0 : return -1;
24989 : }
24990 0 : object->count = test_var;
24991 : } else {
24992 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24993 : PyLong_Type.tp_name);
24994 0 : return -1;
24995 : }
24996 : }
24997 0 : return 0;
24998 : }
24999 :
25000 18 : static PyObject *py_netr_DomainTrustList_get_array(PyObject *obj, void *closure)
25001 : {
25002 18 : struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(obj);
25003 : PyObject *py_array;
25004 18 : if (object->array == NULL) {
25005 0 : Py_RETURN_NONE;
25006 : }
25007 18 : if (object->array == NULL) {
25008 0 : py_array = Py_None;
25009 0 : Py_INCREF(py_array);
25010 : } else {
25011 18 : py_array = PyList_New(object->count);
25012 18 : if (py_array == NULL) {
25013 0 : return NULL;
25014 : }
25015 : {
25016 : int array_cntr_1;
25017 62 : for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
25018 : PyObject *py_array_1;
25019 44 : py_array_1 = pytalloc_reference_ex(&netr_DomainTrust_Type, object->array, &object->array[array_cntr_1]);
25020 44 : PyList_SetItem(py_array, array_cntr_1, py_array_1);
25021 : }
25022 : }
25023 : }
25024 18 : return py_array;
25025 : }
25026 :
25027 0 : static int py_netr_DomainTrustList_set_array(PyObject *py_obj, PyObject *value, void *closure)
25028 : {
25029 0 : struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(py_obj);
25030 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
25031 0 : if (value == NULL) {
25032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
25033 0 : return -1;
25034 : }
25035 0 : if (value == Py_None) {
25036 0 : object->array = NULL;
25037 : } else {
25038 0 : object->array = NULL;
25039 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
25040 : {
25041 : int array_cntr_1;
25042 0 : object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
25043 0 : if (!object->array) { return -1;; }
25044 0 : talloc_set_name_const(object->array, "ARRAY: object->array");
25045 0 : for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
25046 0 : if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
25047 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
25048 0 : return -1;
25049 : }
25050 0 : PY_CHECK_TYPE(&netr_DomainTrust_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
25051 0 : if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
25052 0 : PyErr_NoMemory();
25053 0 : return -1;
25054 : }
25055 0 : object->array[array_cntr_1] = *(struct netr_DomainTrust *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
25056 : }
25057 : }
25058 : }
25059 0 : return 0;
25060 : }
25061 :
25062 : static PyGetSetDef py_netr_DomainTrustList_getsetters[] = {
25063 : {
25064 : .name = discard_const_p(char, "count"),
25065 : .get = py_netr_DomainTrustList_get_count,
25066 : .set = py_netr_DomainTrustList_set_count,
25067 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25068 : },
25069 : {
25070 : .name = discard_const_p(char, "array"),
25071 : .get = py_netr_DomainTrustList_get_array,
25072 : .set = py_netr_DomainTrustList_set_array,
25073 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainTrust")
25074 : },
25075 : { .name = NULL }
25076 : };
25077 :
25078 0 : static PyObject *py_netr_DomainTrustList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25079 : {
25080 0 : return pytalloc_new(struct netr_DomainTrustList, type);
25081 : }
25082 :
25083 0 : static PyObject *py_netr_DomainTrustList_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25084 : {
25085 0 : struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(py_obj);
25086 0 : PyObject *ret = NULL;
25087 : DATA_BLOB blob;
25088 : enum ndr_err_code err;
25089 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
25090 0 : if (tmp_ctx == NULL) {
25091 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25092 0 : return NULL;
25093 : }
25094 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netr_DomainTrustList);
25095 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25096 0 : TALLOC_FREE(tmp_ctx);
25097 0 : PyErr_SetNdrError(err);
25098 0 : return NULL;
25099 : }
25100 :
25101 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25102 0 : TALLOC_FREE(tmp_ctx);
25103 0 : return ret;
25104 : }
25105 :
25106 0 : static PyObject *py_netr_DomainTrustList_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25107 : {
25108 0 : struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(py_obj);
25109 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
25110 0 : Py_ssize_t blob_length = 0;
25111 : enum ndr_err_code err;
25112 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
25113 0 : PyObject *allow_remaining_obj = NULL;
25114 0 : bool allow_remaining = false;
25115 :
25116 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
25117 : discard_const_p(char *, kwnames),
25118 : &blob.data, &blob_length,
25119 : &allow_remaining_obj)) {
25120 0 : return NULL;
25121 : }
25122 0 : blob.length = blob_length;
25123 :
25124 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25125 0 : allow_remaining = true;
25126 : }
25127 :
25128 0 : if (allow_remaining) {
25129 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_DomainTrustList);
25130 : } else {
25131 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netr_DomainTrustList);
25132 : }
25133 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25134 0 : PyErr_SetNdrError(err);
25135 0 : return NULL;
25136 : }
25137 :
25138 0 : Py_RETURN_NONE;
25139 : }
25140 :
25141 0 : static PyObject *py_netr_DomainTrustList_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25142 : {
25143 0 : struct netr_DomainTrustList *object = (struct netr_DomainTrustList *)pytalloc_get_ptr(py_obj);
25144 : PyObject *ret;
25145 : char *retstr;
25146 :
25147 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netr_DomainTrustList, "netr_DomainTrustList", object);
25148 0 : ret = PyUnicode_FromString(retstr);
25149 0 : talloc_free(retstr);
25150 :
25151 0 : return ret;
25152 : }
25153 :
25154 : static PyMethodDef py_netr_DomainTrustList_methods[] = {
25155 : { "__ndr_pack__", (PyCFunction)py_netr_DomainTrustList_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
25156 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DomainTrustList_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
25157 : { "__ndr_print__", (PyCFunction)py_netr_DomainTrustList_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
25158 : { NULL, NULL, 0, NULL }
25159 : };
25160 :
25161 :
25162 : static PyTypeObject netr_DomainTrustList_Type = {
25163 : PyVarObject_HEAD_INIT(NULL, 0)
25164 : .tp_name = "netlogon.netr_DomainTrustList",
25165 : .tp_getset = py_netr_DomainTrustList_getsetters,
25166 : .tp_methods = py_netr_DomainTrustList_methods,
25167 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25168 : .tp_new = py_netr_DomainTrustList_new,
25169 : };
25170 :
25171 :
25172 0 : static PyObject *py_netr_DsRAddressToSitenamesExWCtr_get_count(PyObject *obj, void *closure)
25173 : {
25174 0 : struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(obj);
25175 : PyObject *py_count;
25176 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
25177 0 : return py_count;
25178 : }
25179 :
25180 0 : static int py_netr_DsRAddressToSitenamesExWCtr_set_count(PyObject *py_obj, PyObject *value, void *closure)
25181 : {
25182 0 : struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(py_obj);
25183 0 : if (value == NULL) {
25184 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
25185 0 : return -1;
25186 : }
25187 : {
25188 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
25189 0 : if (PyLong_Check(value)) {
25190 : unsigned long long test_var;
25191 0 : test_var = PyLong_AsUnsignedLongLong(value);
25192 0 : if (PyErr_Occurred() != NULL) {
25193 0 : return -1;
25194 : }
25195 0 : if (test_var > uint_max) {
25196 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25197 : PyLong_Type.tp_name, uint_max, test_var);
25198 0 : return -1;
25199 : }
25200 0 : object->count = test_var;
25201 : } else {
25202 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25203 : PyLong_Type.tp_name);
25204 0 : return -1;
25205 : }
25206 : }
25207 0 : return 0;
25208 : }
25209 :
25210 0 : static PyObject *py_netr_DsRAddressToSitenamesExWCtr_get_sitename(PyObject *obj, void *closure)
25211 : {
25212 0 : struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(obj);
25213 : PyObject *py_sitename;
25214 0 : if (object->sitename == NULL) {
25215 0 : Py_RETURN_NONE;
25216 : }
25217 0 : if (object->sitename == NULL) {
25218 0 : py_sitename = Py_None;
25219 0 : Py_INCREF(py_sitename);
25220 : } else {
25221 0 : py_sitename = PyList_New(object->count);
25222 0 : if (py_sitename == NULL) {
25223 0 : return NULL;
25224 : }
25225 : {
25226 : int sitename_cntr_1;
25227 0 : for (sitename_cntr_1 = 0; sitename_cntr_1 < (object->count); sitename_cntr_1++) {
25228 : PyObject *py_sitename_1;
25229 0 : py_sitename_1 = pytalloc_reference_ex(lsa_String_Type, object->sitename, &object->sitename[sitename_cntr_1]);
25230 0 : PyList_SetItem(py_sitename, sitename_cntr_1, py_sitename_1);
25231 : }
25232 : }
25233 : }
25234 0 : return py_sitename;
25235 : }
25236 :
25237 0 : static int py_netr_DsRAddressToSitenamesExWCtr_set_sitename(PyObject *py_obj, PyObject *value, void *closure)
25238 : {
25239 0 : struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(py_obj);
25240 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sitename));
25241 0 : if (value == NULL) {
25242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename");
25243 0 : return -1;
25244 : }
25245 0 : if (value == Py_None) {
25246 0 : object->sitename = NULL;
25247 : } else {
25248 0 : object->sitename = NULL;
25249 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
25250 : {
25251 : int sitename_cntr_1;
25252 0 : object->sitename = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sitename, PyList_GET_SIZE(value));
25253 0 : if (!object->sitename) { return -1;; }
25254 0 : talloc_set_name_const(object->sitename, "ARRAY: object->sitename");
25255 0 : for (sitename_cntr_1 = 0; sitename_cntr_1 < PyList_GET_SIZE(value); sitename_cntr_1++) {
25256 0 : if (PyList_GET_ITEM(value, sitename_cntr_1) == NULL) {
25257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sitename[sitename_cntr_1]");
25258 0 : return -1;
25259 : }
25260 0 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, sitename_cntr_1), return -1;);
25261 0 : if (talloc_reference(object->sitename, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sitename_cntr_1))) == NULL) {
25262 0 : PyErr_NoMemory();
25263 0 : return -1;
25264 : }
25265 0 : object->sitename[sitename_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, sitename_cntr_1));
25266 : }
25267 : }
25268 : }
25269 0 : return 0;
25270 : }
25271 :
25272 0 : static PyObject *py_netr_DsRAddressToSitenamesExWCtr_get_subnetname(PyObject *obj, void *closure)
25273 : {
25274 0 : struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(obj);
25275 : PyObject *py_subnetname;
25276 0 : if (object->subnetname == NULL) {
25277 0 : Py_RETURN_NONE;
25278 : }
25279 0 : if (object->subnetname == NULL) {
25280 0 : py_subnetname = Py_None;
25281 0 : Py_INCREF(py_subnetname);
25282 : } else {
25283 0 : py_subnetname = PyList_New(object->count);
25284 0 : if (py_subnetname == NULL) {
25285 0 : return NULL;
25286 : }
25287 : {
25288 : int subnetname_cntr_1;
25289 0 : for (subnetname_cntr_1 = 0; subnetname_cntr_1 < (object->count); subnetname_cntr_1++) {
25290 : PyObject *py_subnetname_1;
25291 0 : py_subnetname_1 = pytalloc_reference_ex(lsa_String_Type, object->subnetname, &object->subnetname[subnetname_cntr_1]);
25292 0 : PyList_SetItem(py_subnetname, subnetname_cntr_1, py_subnetname_1);
25293 : }
25294 : }
25295 : }
25296 0 : return py_subnetname;
25297 : }
25298 :
25299 0 : static int py_netr_DsRAddressToSitenamesExWCtr_set_subnetname(PyObject *py_obj, PyObject *value, void *closure)
25300 : {
25301 0 : struct netr_DsRAddressToSitenamesExWCtr *object = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(py_obj);
25302 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->subnetname));
25303 0 : if (value == NULL) {
25304 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->subnetname");
25305 0 : return -1;
25306 : }
25307 0 : if (value == Py_None) {
25308 0 : object->subnetname = NULL;
25309 : } else {
25310 0 : object->subnetname = NULL;
25311 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
25312 : {
25313 : int subnetname_cntr_1;
25314 0 : object->subnetname = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->subnetname, PyList_GET_SIZE(value));
25315 0 : if (!object->subnetname) { return -1;; }
25316 0 : talloc_set_name_const(object->subnetname, "ARRAY: object->subnetname");
25317 0 : for (subnetname_cntr_1 = 0; subnetname_cntr_1 < PyList_GET_SIZE(value); subnetname_cntr_1++) {
25318 0 : if (PyList_GET_ITEM(value, subnetname_cntr_1) == NULL) {
25319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->subnetname[subnetname_cntr_1]");
25320 0 : return -1;
25321 : }
25322 0 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, subnetname_cntr_1), return -1;);
25323 0 : if (talloc_reference(object->subnetname, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, subnetname_cntr_1))) == NULL) {
25324 0 : PyErr_NoMemory();
25325 0 : return -1;
25326 : }
25327 0 : object->subnetname[subnetname_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, subnetname_cntr_1));
25328 : }
25329 : }
25330 : }
25331 0 : return 0;
25332 : }
25333 :
25334 : static PyGetSetDef py_netr_DsRAddressToSitenamesExWCtr_getsetters[] = {
25335 : {
25336 : .name = discard_const_p(char, "count"),
25337 : .get = py_netr_DsRAddressToSitenamesExWCtr_get_count,
25338 : .set = py_netr_DsRAddressToSitenamesExWCtr_set_count,
25339 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25340 : },
25341 : {
25342 : .name = discard_const_p(char, "sitename"),
25343 : .get = py_netr_DsRAddressToSitenamesExWCtr_get_sitename,
25344 : .set = py_netr_DsRAddressToSitenamesExWCtr_set_sitename,
25345 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
25346 : },
25347 : {
25348 : .name = discard_const_p(char, "subnetname"),
25349 : .get = py_netr_DsRAddressToSitenamesExWCtr_get_subnetname,
25350 : .set = py_netr_DsRAddressToSitenamesExWCtr_set_subnetname,
25351 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
25352 : },
25353 : { .name = NULL }
25354 : };
25355 :
25356 0 : static PyObject *py_netr_DsRAddressToSitenamesExWCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25357 : {
25358 0 : return pytalloc_new(struct netr_DsRAddressToSitenamesExWCtr, type);
25359 : }
25360 :
25361 :
25362 : static PyTypeObject netr_DsRAddressToSitenamesExWCtr_Type = {
25363 : PyVarObject_HEAD_INIT(NULL, 0)
25364 : .tp_name = "netlogon.netr_DsRAddressToSitenamesExWCtr",
25365 : .tp_getset = py_netr_DsRAddressToSitenamesExWCtr_getsetters,
25366 : .tp_methods = NULL,
25367 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25368 : .tp_new = py_netr_DsRAddressToSitenamesExWCtr_new,
25369 : };
25370 :
25371 :
25372 0 : static PyObject *py_DcSitesCtr_get_num_sites(PyObject *obj, void *closure)
25373 : {
25374 0 : struct DcSitesCtr *object = (struct DcSitesCtr *)pytalloc_get_ptr(obj);
25375 : PyObject *py_num_sites;
25376 0 : py_num_sites = PyLong_FromUnsignedLongLong((uint32_t)object->num_sites);
25377 0 : return py_num_sites;
25378 : }
25379 :
25380 0 : static int py_DcSitesCtr_set_num_sites(PyObject *py_obj, PyObject *value, void *closure)
25381 : {
25382 0 : struct DcSitesCtr *object = (struct DcSitesCtr *)pytalloc_get_ptr(py_obj);
25383 0 : if (value == NULL) {
25384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sites");
25385 0 : return -1;
25386 : }
25387 : {
25388 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sites));
25389 0 : if (PyLong_Check(value)) {
25390 : unsigned long long test_var;
25391 0 : test_var = PyLong_AsUnsignedLongLong(value);
25392 0 : if (PyErr_Occurred() != NULL) {
25393 0 : return -1;
25394 : }
25395 0 : if (test_var > uint_max) {
25396 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25397 : PyLong_Type.tp_name, uint_max, test_var);
25398 0 : return -1;
25399 : }
25400 0 : object->num_sites = test_var;
25401 : } else {
25402 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25403 : PyLong_Type.tp_name);
25404 0 : return -1;
25405 : }
25406 : }
25407 0 : return 0;
25408 : }
25409 :
25410 0 : static PyObject *py_DcSitesCtr_get_sites(PyObject *obj, void *closure)
25411 : {
25412 0 : struct DcSitesCtr *object = (struct DcSitesCtr *)pytalloc_get_ptr(obj);
25413 : PyObject *py_sites;
25414 0 : if (object->sites == NULL) {
25415 0 : Py_RETURN_NONE;
25416 : }
25417 0 : if (object->sites == NULL) {
25418 0 : py_sites = Py_None;
25419 0 : Py_INCREF(py_sites);
25420 : } else {
25421 0 : py_sites = PyList_New(object->num_sites);
25422 0 : if (py_sites == NULL) {
25423 0 : return NULL;
25424 : }
25425 : {
25426 : int sites_cntr_1;
25427 0 : for (sites_cntr_1 = 0; sites_cntr_1 < (object->num_sites); sites_cntr_1++) {
25428 : PyObject *py_sites_1;
25429 0 : py_sites_1 = pytalloc_reference_ex(lsa_String_Type, object->sites, &object->sites[sites_cntr_1]);
25430 0 : PyList_SetItem(py_sites, sites_cntr_1, py_sites_1);
25431 : }
25432 : }
25433 : }
25434 0 : return py_sites;
25435 : }
25436 :
25437 0 : static int py_DcSitesCtr_set_sites(PyObject *py_obj, PyObject *value, void *closure)
25438 : {
25439 0 : struct DcSitesCtr *object = (struct DcSitesCtr *)pytalloc_get_ptr(py_obj);
25440 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sites));
25441 0 : if (value == NULL) {
25442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sites");
25443 0 : return -1;
25444 : }
25445 0 : if (value == Py_None) {
25446 0 : object->sites = NULL;
25447 : } else {
25448 0 : object->sites = NULL;
25449 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
25450 : {
25451 : int sites_cntr_1;
25452 0 : object->sites = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sites, PyList_GET_SIZE(value));
25453 0 : if (!object->sites) { return -1;; }
25454 0 : talloc_set_name_const(object->sites, "ARRAY: object->sites");
25455 0 : for (sites_cntr_1 = 0; sites_cntr_1 < PyList_GET_SIZE(value); sites_cntr_1++) {
25456 0 : if (PyList_GET_ITEM(value, sites_cntr_1) == NULL) {
25457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sites[sites_cntr_1]");
25458 0 : return -1;
25459 : }
25460 0 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, sites_cntr_1), return -1;);
25461 0 : if (talloc_reference(object->sites, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sites_cntr_1))) == NULL) {
25462 0 : PyErr_NoMemory();
25463 0 : return -1;
25464 : }
25465 0 : object->sites[sites_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, sites_cntr_1));
25466 : }
25467 : }
25468 : }
25469 0 : return 0;
25470 : }
25471 :
25472 : static PyGetSetDef py_DcSitesCtr_getsetters[] = {
25473 : {
25474 : .name = discard_const_p(char, "num_sites"),
25475 : .get = py_DcSitesCtr_get_num_sites,
25476 : .set = py_DcSitesCtr_set_num_sites,
25477 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25478 : },
25479 : {
25480 : .name = discard_const_p(char, "sites"),
25481 : .get = py_DcSitesCtr_get_sites,
25482 : .set = py_DcSitesCtr_set_sites,
25483 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
25484 : },
25485 : { .name = NULL }
25486 : };
25487 :
25488 0 : static PyObject *py_DcSitesCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25489 : {
25490 0 : return pytalloc_new(struct DcSitesCtr, type);
25491 : }
25492 :
25493 :
25494 : static PyTypeObject DcSitesCtr_Type = {
25495 : PyVarObject_HEAD_INIT(NULL, 0)
25496 : .tp_name = "netlogon.DcSitesCtr",
25497 : .tp_getset = py_DcSitesCtr_getsetters,
25498 : .tp_methods = NULL,
25499 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25500 : .tp_new = py_DcSitesCtr_new,
25501 : };
25502 :
25503 :
25504 0 : static PyObject *py_netr_TrustInfo_get_count(PyObject *obj, void *closure)
25505 : {
25506 0 : struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(obj);
25507 : PyObject *py_count;
25508 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
25509 0 : return py_count;
25510 : }
25511 :
25512 0 : static int py_netr_TrustInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
25513 : {
25514 0 : struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(py_obj);
25515 0 : if (value == NULL) {
25516 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
25517 0 : return -1;
25518 : }
25519 : {
25520 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
25521 0 : if (PyLong_Check(value)) {
25522 : unsigned long long test_var;
25523 0 : test_var = PyLong_AsUnsignedLongLong(value);
25524 0 : if (PyErr_Occurred() != NULL) {
25525 0 : return -1;
25526 : }
25527 0 : if (test_var > uint_max) {
25528 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25529 : PyLong_Type.tp_name, uint_max, test_var);
25530 0 : return -1;
25531 : }
25532 0 : object->count = test_var;
25533 : } else {
25534 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25535 : PyLong_Type.tp_name);
25536 0 : return -1;
25537 : }
25538 : }
25539 0 : return 0;
25540 : }
25541 :
25542 0 : static PyObject *py_netr_TrustInfo_get_data(PyObject *obj, void *closure)
25543 : {
25544 0 : struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(obj);
25545 : PyObject *py_data;
25546 0 : if (object->data == NULL) {
25547 0 : Py_RETURN_NONE;
25548 : }
25549 0 : if (object->data == NULL) {
25550 0 : py_data = Py_None;
25551 0 : Py_INCREF(py_data);
25552 : } else {
25553 0 : py_data = PyList_New(object->count);
25554 0 : if (py_data == NULL) {
25555 0 : return NULL;
25556 : }
25557 : {
25558 : int data_cntr_1;
25559 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->count); data_cntr_1++) {
25560 : PyObject *py_data_1;
25561 0 : py_data_1 = PyLong_FromUnsignedLongLong((uint32_t)object->data[data_cntr_1]);
25562 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
25563 : }
25564 : }
25565 : }
25566 0 : return py_data;
25567 : }
25568 :
25569 0 : static int py_netr_TrustInfo_set_data(PyObject *py_obj, PyObject *value, void *closure)
25570 : {
25571 0 : struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(py_obj);
25572 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
25573 0 : if (value == NULL) {
25574 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
25575 0 : return -1;
25576 : }
25577 0 : if (value == Py_None) {
25578 0 : object->data = NULL;
25579 : } else {
25580 0 : object->data = NULL;
25581 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
25582 : {
25583 : int data_cntr_1;
25584 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
25585 0 : if (!object->data) { return -1;; }
25586 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
25587 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
25588 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
25589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
25590 0 : return -1;
25591 : }
25592 : {
25593 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
25594 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
25595 : unsigned long long test_var;
25596 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
25597 0 : if (PyErr_Occurred() != NULL) {
25598 0 : return -1;
25599 : }
25600 0 : if (test_var > uint_max) {
25601 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25602 : PyLong_Type.tp_name, uint_max, test_var);
25603 0 : return -1;
25604 : }
25605 0 : object->data[data_cntr_1] = test_var;
25606 : } else {
25607 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25608 : PyLong_Type.tp_name);
25609 0 : return -1;
25610 : }
25611 : }
25612 : }
25613 : }
25614 : }
25615 0 : return 0;
25616 : }
25617 :
25618 0 : static PyObject *py_netr_TrustInfo_get_entry_count(PyObject *obj, void *closure)
25619 : {
25620 0 : struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(obj);
25621 : PyObject *py_entry_count;
25622 0 : py_entry_count = PyLong_FromUnsignedLongLong((uint32_t)object->entry_count);
25623 0 : return py_entry_count;
25624 : }
25625 :
25626 0 : static int py_netr_TrustInfo_set_entry_count(PyObject *py_obj, PyObject *value, void *closure)
25627 : {
25628 0 : struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(py_obj);
25629 0 : if (value == NULL) {
25630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entry_count");
25631 0 : return -1;
25632 : }
25633 : {
25634 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->entry_count));
25635 0 : if (PyLong_Check(value)) {
25636 : unsigned long long test_var;
25637 0 : test_var = PyLong_AsUnsignedLongLong(value);
25638 0 : if (PyErr_Occurred() != NULL) {
25639 0 : return -1;
25640 : }
25641 0 : if (test_var > uint_max) {
25642 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25643 : PyLong_Type.tp_name, uint_max, test_var);
25644 0 : return -1;
25645 : }
25646 0 : object->entry_count = test_var;
25647 : } else {
25648 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25649 : PyLong_Type.tp_name);
25650 0 : return -1;
25651 : }
25652 : }
25653 0 : return 0;
25654 : }
25655 :
25656 0 : static PyObject *py_netr_TrustInfo_get_entries(PyObject *obj, void *closure)
25657 : {
25658 0 : struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(obj);
25659 : PyObject *py_entries;
25660 0 : if (object->entries == NULL) {
25661 0 : Py_RETURN_NONE;
25662 : }
25663 0 : if (object->entries == NULL) {
25664 0 : py_entries = Py_None;
25665 0 : Py_INCREF(py_entries);
25666 : } else {
25667 0 : py_entries = PyList_New(object->count);
25668 0 : if (py_entries == NULL) {
25669 0 : return NULL;
25670 : }
25671 : {
25672 : int entries_cntr_1;
25673 0 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
25674 : PyObject *py_entries_1;
25675 0 : py_entries_1 = pytalloc_reference_ex(lsa_String_Type, object->entries, &object->entries[entries_cntr_1]);
25676 0 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
25677 : }
25678 : }
25679 : }
25680 0 : return py_entries;
25681 : }
25682 :
25683 0 : static int py_netr_TrustInfo_set_entries(PyObject *py_obj, PyObject *value, void *closure)
25684 : {
25685 0 : struct netr_TrustInfo *object = (struct netr_TrustInfo *)pytalloc_get_ptr(py_obj);
25686 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
25687 0 : if (value == NULL) {
25688 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
25689 0 : return -1;
25690 : }
25691 0 : if (value == Py_None) {
25692 0 : object->entries = NULL;
25693 : } else {
25694 0 : object->entries = NULL;
25695 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
25696 : {
25697 : int entries_cntr_1;
25698 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
25699 0 : if (!object->entries) { return -1;; }
25700 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
25701 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
25702 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
25703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
25704 0 : return -1;
25705 : }
25706 0 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
25707 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
25708 0 : PyErr_NoMemory();
25709 0 : return -1;
25710 : }
25711 0 : object->entries[entries_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
25712 : }
25713 : }
25714 : }
25715 0 : return 0;
25716 : }
25717 :
25718 : static PyGetSetDef py_netr_TrustInfo_getsetters[] = {
25719 : {
25720 : .name = discard_const_p(char, "count"),
25721 : .get = py_netr_TrustInfo_get_count,
25722 : .set = py_netr_TrustInfo_set_count,
25723 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25724 : },
25725 : {
25726 : .name = discard_const_p(char, "data"),
25727 : .get = py_netr_TrustInfo_get_data,
25728 : .set = py_netr_TrustInfo_set_data,
25729 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25730 : },
25731 : {
25732 : .name = discard_const_p(char, "entry_count"),
25733 : .get = py_netr_TrustInfo_get_entry_count,
25734 : .set = py_netr_TrustInfo_set_entry_count,
25735 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
25736 : },
25737 : {
25738 : .name = discard_const_p(char, "entries"),
25739 : .get = py_netr_TrustInfo_get_entries,
25740 : .set = py_netr_TrustInfo_set_entries,
25741 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
25742 : },
25743 : { .name = NULL }
25744 : };
25745 :
25746 0 : static PyObject *py_netr_TrustInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25747 : {
25748 0 : return pytalloc_new(struct netr_TrustInfo, type);
25749 : }
25750 :
25751 :
25752 : static PyTypeObject netr_TrustInfo_Type = {
25753 : PyVarObject_HEAD_INIT(NULL, 0)
25754 : .tp_name = "netlogon.netr_TrustInfo",
25755 : .tp_getset = py_netr_TrustInfo_getsetters,
25756 : .tp_methods = NULL,
25757 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25758 : .tp_new = py_netr_TrustInfo_new,
25759 : };
25760 :
25761 :
25762 0 : static PyObject *py_NL_DNS_NAME_INFO_get_type(PyObject *obj, void *closure)
25763 : {
25764 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj);
25765 : PyObject *py_type;
25766 0 : py_type = PyLong_FromLong((uint16_t)object->type);
25767 0 : return py_type;
25768 : }
25769 :
25770 4 : static int py_NL_DNS_NAME_INFO_set_type(PyObject *py_obj, PyObject *value, void *closure)
25771 : {
25772 4 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj);
25773 4 : if (value == NULL) {
25774 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
25775 0 : return -1;
25776 : }
25777 : {
25778 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
25779 4 : if (PyLong_Check(value)) {
25780 : unsigned long long test_var;
25781 4 : test_var = PyLong_AsUnsignedLongLong(value);
25782 4 : if (PyErr_Occurred() != NULL) {
25783 0 : return -1;
25784 : }
25785 4 : if (test_var > uint_max) {
25786 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25787 : PyLong_Type.tp_name, uint_max, test_var);
25788 0 : return -1;
25789 : }
25790 4 : object->type = test_var;
25791 : } else {
25792 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25793 : PyLong_Type.tp_name);
25794 0 : return -1;
25795 : }
25796 : }
25797 4 : return 0;
25798 : }
25799 :
25800 0 : static PyObject *py_NL_DNS_NAME_INFO_get_dns_domain_info(PyObject *obj, void *closure)
25801 : {
25802 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj);
25803 : PyObject *py_dns_domain_info;
25804 0 : if (object->dns_domain_info == NULL) {
25805 0 : Py_RETURN_NONE;
25806 : }
25807 0 : if (object->dns_domain_info == NULL) {
25808 0 : py_dns_domain_info = Py_None;
25809 0 : Py_INCREF(py_dns_domain_info);
25810 : } else {
25811 0 : if (object->dns_domain_info == NULL) {
25812 0 : py_dns_domain_info = Py_None;
25813 0 : Py_INCREF(py_dns_domain_info);
25814 : } else {
25815 0 : py_dns_domain_info = PyUnicode_Decode(object->dns_domain_info, strlen(object->dns_domain_info), "utf-8", "ignore");
25816 : }
25817 : }
25818 0 : return py_dns_domain_info;
25819 : }
25820 :
25821 0 : static int py_NL_DNS_NAME_INFO_set_dns_domain_info(PyObject *py_obj, PyObject *value, void *closure)
25822 : {
25823 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj);
25824 0 : if (value == NULL) {
25825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_info");
25826 0 : return -1;
25827 : }
25828 0 : if (value == Py_None) {
25829 0 : object->dns_domain_info = NULL;
25830 : } else {
25831 0 : object->dns_domain_info = NULL;
25832 : {
25833 : const char *test_str;
25834 : const char *talloc_str;
25835 0 : PyObject *unicode = NULL;
25836 0 : if (PyUnicode_Check(value)) {
25837 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
25838 0 : if (unicode == NULL) {
25839 0 : PyErr_NoMemory();
25840 0 : return -1;
25841 : }
25842 0 : test_str = PyBytes_AS_STRING(unicode);
25843 0 : } else if (PyBytes_Check(value)) {
25844 0 : test_str = PyBytes_AS_STRING(value);
25845 : } else {
25846 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
25847 0 : return -1;
25848 : }
25849 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
25850 0 : if (unicode != NULL) {
25851 0 : Py_DECREF(unicode);
25852 : }
25853 0 : if (talloc_str == NULL) {
25854 0 : PyErr_NoMemory();
25855 0 : return -1;
25856 : }
25857 0 : object->dns_domain_info = talloc_str;
25858 : }
25859 : }
25860 0 : return 0;
25861 : }
25862 :
25863 0 : static PyObject *py_NL_DNS_NAME_INFO_get_dns_domain_info_type(PyObject *obj, void *closure)
25864 : {
25865 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj);
25866 : PyObject *py_dns_domain_info_type;
25867 0 : py_dns_domain_info_type = PyLong_FromLong((uint16_t)object->dns_domain_info_type);
25868 0 : return py_dns_domain_info_type;
25869 : }
25870 :
25871 4 : static int py_NL_DNS_NAME_INFO_set_dns_domain_info_type(PyObject *py_obj, PyObject *value, void *closure)
25872 : {
25873 4 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj);
25874 4 : if (value == NULL) {
25875 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_info_type");
25876 0 : return -1;
25877 : }
25878 : {
25879 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dns_domain_info_type));
25880 4 : if (PyLong_Check(value)) {
25881 : unsigned long long test_var;
25882 4 : test_var = PyLong_AsUnsignedLongLong(value);
25883 4 : if (PyErr_Occurred() != NULL) {
25884 0 : return -1;
25885 : }
25886 4 : if (test_var > uint_max) {
25887 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25888 : PyLong_Type.tp_name, uint_max, test_var);
25889 0 : return -1;
25890 : }
25891 4 : object->dns_domain_info_type = test_var;
25892 : } else {
25893 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25894 : PyLong_Type.tp_name);
25895 0 : return -1;
25896 : }
25897 : }
25898 4 : return 0;
25899 : }
25900 :
25901 0 : static PyObject *py_NL_DNS_NAME_INFO_get_priority(PyObject *obj, void *closure)
25902 : {
25903 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj);
25904 : PyObject *py_priority;
25905 0 : py_priority = PyLong_FromUnsignedLongLong((uint32_t)object->priority);
25906 0 : return py_priority;
25907 : }
25908 :
25909 4 : static int py_NL_DNS_NAME_INFO_set_priority(PyObject *py_obj, PyObject *value, void *closure)
25910 : {
25911 4 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj);
25912 4 : if (value == NULL) {
25913 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->priority");
25914 0 : return -1;
25915 : }
25916 : {
25917 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
25918 4 : if (PyLong_Check(value)) {
25919 : unsigned long long test_var;
25920 4 : test_var = PyLong_AsUnsignedLongLong(value);
25921 4 : if (PyErr_Occurred() != NULL) {
25922 0 : return -1;
25923 : }
25924 4 : if (test_var > uint_max) {
25925 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25926 : PyLong_Type.tp_name, uint_max, test_var);
25927 0 : return -1;
25928 : }
25929 4 : object->priority = test_var;
25930 : } else {
25931 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25932 : PyLong_Type.tp_name);
25933 0 : return -1;
25934 : }
25935 : }
25936 4 : return 0;
25937 : }
25938 :
25939 0 : static PyObject *py_NL_DNS_NAME_INFO_get_weight(PyObject *obj, void *closure)
25940 : {
25941 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj);
25942 : PyObject *py_weight;
25943 0 : py_weight = PyLong_FromUnsignedLongLong((uint32_t)object->weight);
25944 0 : return py_weight;
25945 : }
25946 :
25947 4 : static int py_NL_DNS_NAME_INFO_set_weight(PyObject *py_obj, PyObject *value, void *closure)
25948 : {
25949 4 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj);
25950 4 : if (value == NULL) {
25951 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->weight");
25952 0 : return -1;
25953 : }
25954 : {
25955 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->weight));
25956 4 : if (PyLong_Check(value)) {
25957 : unsigned long long test_var;
25958 4 : test_var = PyLong_AsUnsignedLongLong(value);
25959 4 : if (PyErr_Occurred() != NULL) {
25960 0 : return -1;
25961 : }
25962 4 : if (test_var > uint_max) {
25963 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25964 : PyLong_Type.tp_name, uint_max, test_var);
25965 0 : return -1;
25966 : }
25967 4 : object->weight = test_var;
25968 : } else {
25969 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25970 : PyLong_Type.tp_name);
25971 0 : return -1;
25972 : }
25973 : }
25974 4 : return 0;
25975 : }
25976 :
25977 0 : static PyObject *py_NL_DNS_NAME_INFO_get_port(PyObject *obj, void *closure)
25978 : {
25979 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj);
25980 : PyObject *py_port;
25981 0 : py_port = PyLong_FromUnsignedLongLong((uint32_t)object->port);
25982 0 : return py_port;
25983 : }
25984 :
25985 4 : static int py_NL_DNS_NAME_INFO_set_port(PyObject *py_obj, PyObject *value, void *closure)
25986 : {
25987 4 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj);
25988 4 : if (value == NULL) {
25989 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->port");
25990 0 : return -1;
25991 : }
25992 : {
25993 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
25994 4 : if (PyLong_Check(value)) {
25995 : unsigned long long test_var;
25996 4 : test_var = PyLong_AsUnsignedLongLong(value);
25997 4 : if (PyErr_Occurred() != NULL) {
25998 0 : return -1;
25999 : }
26000 4 : if (test_var > uint_max) {
26001 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26002 : PyLong_Type.tp_name, uint_max, test_var);
26003 0 : return -1;
26004 : }
26005 4 : object->port = test_var;
26006 : } else {
26007 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26008 : PyLong_Type.tp_name);
26009 0 : return -1;
26010 : }
26011 : }
26012 4 : return 0;
26013 : }
26014 :
26015 0 : static PyObject *py_NL_DNS_NAME_INFO_get_dns_register(PyObject *obj, void *closure)
26016 : {
26017 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj);
26018 : PyObject *py_dns_register;
26019 0 : py_dns_register = PyLong_FromUnsignedLongLong((uint32_t)object->dns_register);
26020 0 : return py_dns_register;
26021 : }
26022 :
26023 4 : static int py_NL_DNS_NAME_INFO_set_dns_register(PyObject *py_obj, PyObject *value, void *closure)
26024 : {
26025 4 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj);
26026 4 : if (value == NULL) {
26027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_register");
26028 0 : return -1;
26029 : }
26030 : {
26031 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dns_register));
26032 4 : if (PyLong_Check(value)) {
26033 : unsigned long long test_var;
26034 4 : test_var = PyLong_AsUnsignedLongLong(value);
26035 4 : if (PyErr_Occurred() != NULL) {
26036 0 : return -1;
26037 : }
26038 4 : if (test_var > uint_max) {
26039 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26040 : PyLong_Type.tp_name, uint_max, test_var);
26041 0 : return -1;
26042 : }
26043 4 : object->dns_register = test_var;
26044 : } else {
26045 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26046 : PyLong_Type.tp_name);
26047 0 : return -1;
26048 : }
26049 : }
26050 4 : return 0;
26051 : }
26052 :
26053 8 : static PyObject *py_NL_DNS_NAME_INFO_get_status(PyObject *obj, void *closure)
26054 : {
26055 8 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(obj);
26056 : PyObject *py_status;
26057 8 : py_status = PyLong_FromUnsignedLongLong((uint32_t)object->status);
26058 8 : return py_status;
26059 : }
26060 :
26061 0 : static int py_NL_DNS_NAME_INFO_set_status(PyObject *py_obj, PyObject *value, void *closure)
26062 : {
26063 0 : struct NL_DNS_NAME_INFO *object = (struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(py_obj);
26064 0 : if (value == NULL) {
26065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
26066 0 : return -1;
26067 : }
26068 : {
26069 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
26070 0 : if (PyLong_Check(value)) {
26071 : unsigned long long test_var;
26072 0 : test_var = PyLong_AsUnsignedLongLong(value);
26073 0 : if (PyErr_Occurred() != NULL) {
26074 0 : return -1;
26075 : }
26076 0 : if (test_var > uint_max) {
26077 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26078 : PyLong_Type.tp_name, uint_max, test_var);
26079 0 : return -1;
26080 : }
26081 0 : object->status = test_var;
26082 : } else {
26083 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26084 : PyLong_Type.tp_name);
26085 0 : return -1;
26086 : }
26087 : }
26088 0 : return 0;
26089 : }
26090 :
26091 : static PyGetSetDef py_NL_DNS_NAME_INFO_getsetters[] = {
26092 : {
26093 : .name = discard_const_p(char, "type"),
26094 : .get = py_NL_DNS_NAME_INFO_get_type,
26095 : .set = py_NL_DNS_NAME_INFO_set_type,
26096 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DnsType")
26097 : },
26098 : {
26099 : .name = discard_const_p(char, "dns_domain_info"),
26100 : .get = py_NL_DNS_NAME_INFO_get_dns_domain_info,
26101 : .set = py_NL_DNS_NAME_INFO_set_dns_domain_info,
26102 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
26103 : },
26104 : {
26105 : .name = discard_const_p(char, "dns_domain_info_type"),
26106 : .get = py_NL_DNS_NAME_INFO_get_dns_domain_info_type,
26107 : .set = py_NL_DNS_NAME_INFO_set_dns_domain_info_type,
26108 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DnsDomainInfoType")
26109 : },
26110 : {
26111 : .name = discard_const_p(char, "priority"),
26112 : .get = py_NL_DNS_NAME_INFO_get_priority,
26113 : .set = py_NL_DNS_NAME_INFO_set_priority,
26114 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26115 : },
26116 : {
26117 : .name = discard_const_p(char, "weight"),
26118 : .get = py_NL_DNS_NAME_INFO_get_weight,
26119 : .set = py_NL_DNS_NAME_INFO_set_weight,
26120 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26121 : },
26122 : {
26123 : .name = discard_const_p(char, "port"),
26124 : .get = py_NL_DNS_NAME_INFO_get_port,
26125 : .set = py_NL_DNS_NAME_INFO_set_port,
26126 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26127 : },
26128 : {
26129 : .name = discard_const_p(char, "dns_register"),
26130 : .get = py_NL_DNS_NAME_INFO_get_dns_register,
26131 : .set = py_NL_DNS_NAME_INFO_set_dns_register,
26132 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26133 : },
26134 : {
26135 : .name = discard_const_p(char, "status"),
26136 : .get = py_NL_DNS_NAME_INFO_get_status,
26137 : .set = py_NL_DNS_NAME_INFO_set_status,
26138 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26139 : },
26140 : { .name = NULL }
26141 : };
26142 :
26143 4 : static PyObject *py_NL_DNS_NAME_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26144 : {
26145 4 : return pytalloc_new(struct NL_DNS_NAME_INFO, type);
26146 : }
26147 :
26148 :
26149 : static PyTypeObject NL_DNS_NAME_INFO_Type = {
26150 : PyVarObject_HEAD_INIT(NULL, 0)
26151 : .tp_name = "netlogon.NL_DNS_NAME_INFO",
26152 : .tp_getset = py_NL_DNS_NAME_INFO_getsetters,
26153 : .tp_methods = NULL,
26154 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26155 : .tp_new = py_NL_DNS_NAME_INFO_new,
26156 : };
26157 :
26158 :
26159 0 : static PyObject *py_NL_DNS_NAME_INFO_ARRAY_get_count(PyObject *obj, void *closure)
26160 : {
26161 0 : struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(obj);
26162 : PyObject *py_count;
26163 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
26164 0 : return py_count;
26165 : }
26166 :
26167 4 : static int py_NL_DNS_NAME_INFO_ARRAY_set_count(PyObject *py_obj, PyObject *value, void *closure)
26168 : {
26169 4 : struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_obj);
26170 4 : if (value == NULL) {
26171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
26172 0 : return -1;
26173 : }
26174 : {
26175 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
26176 4 : if (PyLong_Check(value)) {
26177 : unsigned long long test_var;
26178 4 : test_var = PyLong_AsUnsignedLongLong(value);
26179 4 : if (PyErr_Occurred() != NULL) {
26180 0 : return -1;
26181 : }
26182 4 : if (test_var > uint_max) {
26183 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26184 : PyLong_Type.tp_name, uint_max, test_var);
26185 0 : return -1;
26186 : }
26187 4 : object->count = test_var;
26188 : } else {
26189 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26190 : PyLong_Type.tp_name);
26191 0 : return -1;
26192 : }
26193 : }
26194 4 : return 0;
26195 : }
26196 :
26197 8 : static PyObject *py_NL_DNS_NAME_INFO_ARRAY_get_names(PyObject *obj, void *closure)
26198 : {
26199 8 : struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(obj);
26200 : PyObject *py_names;
26201 8 : if (object->names == NULL) {
26202 0 : Py_RETURN_NONE;
26203 : }
26204 8 : if (object->names == NULL) {
26205 0 : py_names = Py_None;
26206 0 : Py_INCREF(py_names);
26207 : } else {
26208 8 : py_names = PyList_New(object->count);
26209 8 : if (py_names == NULL) {
26210 0 : return NULL;
26211 : }
26212 : {
26213 : int names_cntr_1;
26214 16 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
26215 : PyObject *py_names_1;
26216 8 : py_names_1 = pytalloc_reference_ex(&NL_DNS_NAME_INFO_Type, object->names, &object->names[names_cntr_1]);
26217 8 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
26218 : }
26219 : }
26220 : }
26221 8 : return py_names;
26222 : }
26223 :
26224 4 : static int py_NL_DNS_NAME_INFO_ARRAY_set_names(PyObject *py_obj, PyObject *value, void *closure)
26225 : {
26226 4 : struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_obj);
26227 4 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
26228 4 : if (value == NULL) {
26229 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
26230 0 : return -1;
26231 : }
26232 4 : if (value == Py_None) {
26233 0 : object->names = NULL;
26234 : } else {
26235 4 : object->names = NULL;
26236 4 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
26237 : {
26238 : int names_cntr_1;
26239 4 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
26240 4 : if (!object->names) { return -1;; }
26241 4 : talloc_set_name_const(object->names, "ARRAY: object->names");
26242 8 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
26243 4 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
26244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
26245 0 : return -1;
26246 : }
26247 4 : PY_CHECK_TYPE(&NL_DNS_NAME_INFO_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
26248 4 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
26249 0 : PyErr_NoMemory();
26250 0 : return -1;
26251 : }
26252 4 : object->names[names_cntr_1] = *(struct NL_DNS_NAME_INFO *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
26253 : }
26254 : }
26255 : }
26256 4 : return 0;
26257 : }
26258 :
26259 : static PyGetSetDef py_NL_DNS_NAME_INFO_ARRAY_getsetters[] = {
26260 : {
26261 : .name = discard_const_p(char, "count"),
26262 : .get = py_NL_DNS_NAME_INFO_ARRAY_get_count,
26263 : .set = py_NL_DNS_NAME_INFO_ARRAY_set_count,
26264 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26265 : },
26266 : {
26267 : .name = discard_const_p(char, "names"),
26268 : .get = py_NL_DNS_NAME_INFO_ARRAY_get_names,
26269 : .set = py_NL_DNS_NAME_INFO_ARRAY_set_names,
26270 : .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO")
26271 : },
26272 : { .name = NULL }
26273 : };
26274 :
26275 4 : static PyObject *py_NL_DNS_NAME_INFO_ARRAY_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26276 : {
26277 4 : return pytalloc_new(struct NL_DNS_NAME_INFO_ARRAY, type);
26278 : }
26279 :
26280 0 : static PyObject *py_NL_DNS_NAME_INFO_ARRAY_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26281 : {
26282 0 : struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_obj);
26283 0 : PyObject *ret = NULL;
26284 : DATA_BLOB blob;
26285 : enum ndr_err_code err;
26286 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
26287 0 : if (tmp_ctx == NULL) {
26288 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26289 0 : return NULL;
26290 : }
26291 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_NL_DNS_NAME_INFO_ARRAY);
26292 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26293 0 : TALLOC_FREE(tmp_ctx);
26294 0 : PyErr_SetNdrError(err);
26295 0 : return NULL;
26296 : }
26297 :
26298 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26299 0 : TALLOC_FREE(tmp_ctx);
26300 0 : return ret;
26301 : }
26302 :
26303 0 : static PyObject *py_NL_DNS_NAME_INFO_ARRAY_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26304 : {
26305 0 : struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_obj);
26306 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
26307 0 : Py_ssize_t blob_length = 0;
26308 : enum ndr_err_code err;
26309 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
26310 0 : PyObject *allow_remaining_obj = NULL;
26311 0 : bool allow_remaining = false;
26312 :
26313 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
26314 : discard_const_p(char *, kwnames),
26315 : &blob.data, &blob_length,
26316 : &allow_remaining_obj)) {
26317 0 : return NULL;
26318 : }
26319 0 : blob.length = blob_length;
26320 :
26321 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26322 0 : allow_remaining = true;
26323 : }
26324 :
26325 0 : if (allow_remaining) {
26326 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NL_DNS_NAME_INFO_ARRAY);
26327 : } else {
26328 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_NL_DNS_NAME_INFO_ARRAY);
26329 : }
26330 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26331 0 : PyErr_SetNdrError(err);
26332 0 : return NULL;
26333 : }
26334 :
26335 0 : Py_RETURN_NONE;
26336 : }
26337 :
26338 0 : static PyObject *py_NL_DNS_NAME_INFO_ARRAY_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26339 : {
26340 0 : struct NL_DNS_NAME_INFO_ARRAY *object = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_obj);
26341 : PyObject *ret;
26342 : char *retstr;
26343 :
26344 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_NL_DNS_NAME_INFO_ARRAY, "NL_DNS_NAME_INFO_ARRAY", object);
26345 0 : ret = PyUnicode_FromString(retstr);
26346 0 : talloc_free(retstr);
26347 :
26348 0 : return ret;
26349 : }
26350 :
26351 : static PyMethodDef py_NL_DNS_NAME_INFO_ARRAY_methods[] = {
26352 : { "__ndr_pack__", (PyCFunction)py_NL_DNS_NAME_INFO_ARRAY_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
26353 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_NL_DNS_NAME_INFO_ARRAY_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
26354 : { "__ndr_print__", (PyCFunction)py_NL_DNS_NAME_INFO_ARRAY_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
26355 : { NULL, NULL, 0, NULL }
26356 : };
26357 :
26358 :
26359 : static PyTypeObject NL_DNS_NAME_INFO_ARRAY_Type = {
26360 : PyVarObject_HEAD_INIT(NULL, 0)
26361 : .tp_name = "netlogon.NL_DNS_NAME_INFO_ARRAY",
26362 : .tp_getset = py_NL_DNS_NAME_INFO_ARRAY_getsetters,
26363 : .tp_methods = py_NL_DNS_NAME_INFO_ARRAY_methods,
26364 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26365 : .tp_new = py_NL_DNS_NAME_INFO_ARRAY_new,
26366 : };
26367 :
26368 :
26369 :
26370 0 : static PyObject *py_netr_LogonUasLogon_in_get_server_name(PyObject *obj, void *closure)
26371 : {
26372 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj);
26373 : PyObject *py_server_name;
26374 0 : if (object->in.server_name == NULL) {
26375 0 : Py_RETURN_NONE;
26376 : }
26377 0 : if (object->in.server_name == NULL) {
26378 0 : py_server_name = Py_None;
26379 0 : Py_INCREF(py_server_name);
26380 : } else {
26381 0 : if (object->in.server_name == NULL) {
26382 0 : py_server_name = Py_None;
26383 0 : Py_INCREF(py_server_name);
26384 : } else {
26385 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
26386 : }
26387 : }
26388 0 : return py_server_name;
26389 : }
26390 :
26391 0 : static int py_netr_LogonUasLogon_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
26392 : {
26393 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj);
26394 0 : if (value == NULL) {
26395 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
26396 0 : return -1;
26397 : }
26398 0 : if (value == Py_None) {
26399 0 : object->in.server_name = NULL;
26400 : } else {
26401 0 : object->in.server_name = NULL;
26402 : {
26403 : const char *test_str;
26404 : const char *talloc_str;
26405 0 : PyObject *unicode = NULL;
26406 0 : if (PyUnicode_Check(value)) {
26407 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
26408 0 : if (unicode == NULL) {
26409 0 : PyErr_NoMemory();
26410 0 : return -1;
26411 : }
26412 0 : test_str = PyBytes_AS_STRING(unicode);
26413 0 : } else if (PyBytes_Check(value)) {
26414 0 : test_str = PyBytes_AS_STRING(value);
26415 : } else {
26416 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
26417 0 : return -1;
26418 : }
26419 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
26420 0 : if (unicode != NULL) {
26421 0 : Py_DECREF(unicode);
26422 : }
26423 0 : if (talloc_str == NULL) {
26424 0 : PyErr_NoMemory();
26425 0 : return -1;
26426 : }
26427 0 : object->in.server_name = talloc_str;
26428 : }
26429 : }
26430 0 : return 0;
26431 : }
26432 :
26433 0 : static PyObject *py_netr_LogonUasLogon_in_get_account_name(PyObject *obj, void *closure)
26434 : {
26435 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj);
26436 : PyObject *py_account_name;
26437 0 : if (object->in.account_name == NULL) {
26438 0 : Py_RETURN_NONE;
26439 : }
26440 0 : if (object->in.account_name == NULL) {
26441 0 : py_account_name = Py_None;
26442 0 : Py_INCREF(py_account_name);
26443 : } else {
26444 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
26445 : }
26446 0 : return py_account_name;
26447 : }
26448 :
26449 0 : static int py_netr_LogonUasLogon_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
26450 : {
26451 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj);
26452 0 : if (value == NULL) {
26453 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
26454 0 : return -1;
26455 : }
26456 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
26457 0 : if (object->in.account_name == NULL) {
26458 0 : PyErr_NoMemory();
26459 0 : return -1;
26460 : }
26461 : {
26462 : const char *test_str;
26463 : const char *talloc_str;
26464 0 : PyObject *unicode = NULL;
26465 0 : if (PyUnicode_Check(value)) {
26466 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
26467 0 : if (unicode == NULL) {
26468 0 : PyErr_NoMemory();
26469 0 : return -1;
26470 : }
26471 0 : test_str = PyBytes_AS_STRING(unicode);
26472 0 : } else if (PyBytes_Check(value)) {
26473 0 : test_str = PyBytes_AS_STRING(value);
26474 : } else {
26475 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
26476 0 : return -1;
26477 : }
26478 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
26479 0 : if (unicode != NULL) {
26480 0 : Py_DECREF(unicode);
26481 : }
26482 0 : if (talloc_str == NULL) {
26483 0 : PyErr_NoMemory();
26484 0 : return -1;
26485 : }
26486 0 : object->in.account_name = talloc_str;
26487 : }
26488 0 : return 0;
26489 : }
26490 :
26491 0 : static PyObject *py_netr_LogonUasLogon_in_get_workstation(PyObject *obj, void *closure)
26492 : {
26493 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj);
26494 : PyObject *py_workstation;
26495 0 : if (object->in.workstation == NULL) {
26496 0 : Py_RETURN_NONE;
26497 : }
26498 0 : if (object->in.workstation == NULL) {
26499 0 : py_workstation = Py_None;
26500 0 : Py_INCREF(py_workstation);
26501 : } else {
26502 0 : py_workstation = PyUnicode_Decode(object->in.workstation, strlen(object->in.workstation), "utf-8", "ignore");
26503 : }
26504 0 : return py_workstation;
26505 : }
26506 :
26507 0 : static int py_netr_LogonUasLogon_in_set_workstation(PyObject *py_obj, PyObject *value, void *closure)
26508 : {
26509 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj);
26510 0 : if (value == NULL) {
26511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.workstation");
26512 0 : return -1;
26513 : }
26514 0 : object->in.workstation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.workstation);
26515 0 : if (object->in.workstation == NULL) {
26516 0 : PyErr_NoMemory();
26517 0 : return -1;
26518 : }
26519 : {
26520 : const char *test_str;
26521 : const char *talloc_str;
26522 0 : PyObject *unicode = NULL;
26523 0 : if (PyUnicode_Check(value)) {
26524 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
26525 0 : if (unicode == NULL) {
26526 0 : PyErr_NoMemory();
26527 0 : return -1;
26528 : }
26529 0 : test_str = PyBytes_AS_STRING(unicode);
26530 0 : } else if (PyBytes_Check(value)) {
26531 0 : test_str = PyBytes_AS_STRING(value);
26532 : } else {
26533 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
26534 0 : return -1;
26535 : }
26536 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
26537 0 : if (unicode != NULL) {
26538 0 : Py_DECREF(unicode);
26539 : }
26540 0 : if (talloc_str == NULL) {
26541 0 : PyErr_NoMemory();
26542 0 : return -1;
26543 : }
26544 0 : object->in.workstation = talloc_str;
26545 : }
26546 0 : return 0;
26547 : }
26548 :
26549 0 : static PyObject *py_netr_LogonUasLogon_out_get_info(PyObject *obj, void *closure)
26550 : {
26551 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj);
26552 : PyObject *py_info;
26553 0 : if (object->out.info == NULL) {
26554 0 : Py_RETURN_NONE;
26555 : }
26556 0 : if (*object->out.info == NULL) {
26557 0 : py_info = Py_None;
26558 0 : Py_INCREF(py_info);
26559 : } else {
26560 0 : py_info = pytalloc_reference_ex(&netr_UasInfo_Type, *object->out.info, *object->out.info);
26561 : }
26562 0 : return py_info;
26563 : }
26564 :
26565 0 : static int py_netr_LogonUasLogon_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
26566 : {
26567 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj);
26568 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
26569 0 : if (value == NULL) {
26570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
26571 0 : return -1;
26572 : }
26573 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
26574 0 : if (object->out.info == NULL) {
26575 0 : PyErr_NoMemory();
26576 0 : return -1;
26577 : }
26578 0 : if (value == Py_None) {
26579 0 : *object->out.info = NULL;
26580 : } else {
26581 0 : *object->out.info = NULL;
26582 0 : PY_CHECK_TYPE(&netr_UasInfo_Type, value, return -1;);
26583 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26584 0 : PyErr_NoMemory();
26585 0 : return -1;
26586 : }
26587 0 : *object->out.info = (struct netr_UasInfo *)pytalloc_get_ptr(value);
26588 : }
26589 0 : return 0;
26590 : }
26591 :
26592 0 : static PyObject *py_netr_LogonUasLogon_get_result(PyObject *obj, void *closure)
26593 : {
26594 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(obj);
26595 : PyObject *py_result;
26596 0 : py_result = PyErr_FromWERROR(object->out.result);
26597 0 : return py_result;
26598 : }
26599 :
26600 0 : static int py_netr_LogonUasLogon_set_result(PyObject *py_obj, PyObject *value, void *closure)
26601 : {
26602 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj);
26603 0 : if (value == NULL) {
26604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
26605 0 : return -1;
26606 : }
26607 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
26608 0 : return 0;
26609 : }
26610 :
26611 : static PyGetSetDef py_netr_LogonUasLogon_getsetters[] = {
26612 : {
26613 : .name = discard_const_p(char, "in_server_name"),
26614 : .get = py_netr_LogonUasLogon_in_get_server_name,
26615 : .set = py_netr_LogonUasLogon_in_set_server_name,
26616 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
26617 : },
26618 : {
26619 : .name = discard_const_p(char, "in_account_name"),
26620 : .get = py_netr_LogonUasLogon_in_get_account_name,
26621 : .set = py_netr_LogonUasLogon_in_set_account_name,
26622 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
26623 : },
26624 : {
26625 : .name = discard_const_p(char, "in_workstation"),
26626 : .get = py_netr_LogonUasLogon_in_get_workstation,
26627 : .set = py_netr_LogonUasLogon_in_set_workstation,
26628 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
26629 : },
26630 : {
26631 : .name = discard_const_p(char, "out_info"),
26632 : .get = py_netr_LogonUasLogon_out_get_info,
26633 : .set = py_netr_LogonUasLogon_out_set_info,
26634 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UasInfo")
26635 : },
26636 : {
26637 : .name = discard_const_p(char, "result"),
26638 : .get = py_netr_LogonUasLogon_get_result,
26639 : .set = py_netr_LogonUasLogon_set_result,
26640 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
26641 : },
26642 : { .name = NULL }
26643 : };
26644 :
26645 0 : static PyObject *py_netr_LogonUasLogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26646 : {
26647 0 : PyObject *self = pytalloc_new(struct netr_LogonUasLogon, type);
26648 0 : struct netr_LogonUasLogon *_self = (struct netr_LogonUasLogon *)pytalloc_get_ptr(self);
26649 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26650 : /* a pointer to a NULL pointer */
26651 0 : _self->out.info = talloc_zero(mem_ctx, struct netr_UasInfo *);
26652 0 : return self;
26653 : }
26654 :
26655 0 : static PyObject *py_netr_LogonUasLogon_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26656 : {
26657 :
26658 :
26659 0 : return PyLong_FromLong(0);
26660 : }
26661 :
26662 0 : static PyObject *py_netr_LogonUasLogon_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
26663 : {
26664 0 : const struct ndr_interface_call *call = NULL;
26665 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj);
26666 0 : PyObject *ret = NULL;
26667 0 : struct ndr_push *push = NULL;
26668 : DATA_BLOB blob;
26669 : enum ndr_err_code err;
26670 :
26671 0 : if (ndr_table_netlogon.num_calls < 1) {
26672 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogon_ndr_pack");
26673 0 : return NULL;
26674 : }
26675 0 : call = &ndr_table_netlogon.calls[0];
26676 :
26677 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26678 0 : if (push == NULL) {
26679 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26680 0 : return NULL;
26681 : }
26682 :
26683 0 : push->flags |= ndr_push_flags;
26684 :
26685 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26686 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26687 0 : TALLOC_FREE(push);
26688 0 : PyErr_SetNdrError(err);
26689 0 : return NULL;
26690 : }
26691 0 : blob = ndr_push_blob(push);
26692 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26693 0 : TALLOC_FREE(push);
26694 0 : return ret;
26695 : }
26696 :
26697 0 : static PyObject *py_netr_LogonUasLogon_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26698 : {
26699 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26700 0 : PyObject *bigendian_obj = NULL;
26701 0 : PyObject *ndr64_obj = NULL;
26702 0 : uint32_t ndr_push_flags = 0;
26703 :
26704 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26705 : discard_const_p(char *, kwnames),
26706 : &bigendian_obj,
26707 : &ndr64_obj)) {
26708 0 : return NULL;
26709 : }
26710 :
26711 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26712 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26713 : }
26714 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26715 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26716 : }
26717 :
26718 0 : return py_netr_LogonUasLogon_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26719 : }
26720 :
26721 0 : static PyObject *py_netr_LogonUasLogon_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26722 : {
26723 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26724 0 : PyObject *bigendian_obj = NULL;
26725 0 : PyObject *ndr64_obj = NULL;
26726 0 : uint32_t ndr_push_flags = 0;
26727 :
26728 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26729 : discard_const_p(char *, kwnames),
26730 : &bigendian_obj,
26731 : &ndr64_obj)) {
26732 0 : return NULL;
26733 : }
26734 :
26735 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26736 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26737 : }
26738 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26739 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26740 : }
26741 :
26742 0 : return py_netr_LogonUasLogon_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26743 : }
26744 :
26745 0 : static PyObject *py_netr_LogonUasLogon_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
26746 : {
26747 0 : const struct ndr_interface_call *call = NULL;
26748 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj);
26749 0 : struct ndr_pull *pull = NULL;
26750 : enum ndr_err_code err;
26751 :
26752 0 : if (ndr_table_netlogon.num_calls < 1) {
26753 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogon_ndr_unpack");
26754 0 : return NULL;
26755 : }
26756 0 : call = &ndr_table_netlogon.calls[0];
26757 :
26758 0 : pull = ndr_pull_init_blob(blob, object);
26759 0 : if (pull == NULL) {
26760 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26761 0 : return NULL;
26762 : }
26763 :
26764 0 : pull->flags |= ndr_pull_flags;
26765 :
26766 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26767 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26768 0 : TALLOC_FREE(pull);
26769 0 : PyErr_SetNdrError(err);
26770 0 : return NULL;
26771 : }
26772 0 : if (!allow_remaining) {
26773 : uint32_t highest_ofs;
26774 :
26775 0 : if (pull->offset > pull->relative_highest_offset) {
26776 0 : highest_ofs = pull->offset;
26777 : } else {
26778 0 : highest_ofs = pull->relative_highest_offset;
26779 : }
26780 0 : if (highest_ofs < pull->data_size) {
26781 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26782 : "not all bytes consumed ofs[%u] size[%u]",
26783 : highest_ofs, pull->data_size);
26784 0 : TALLOC_FREE(pull);
26785 0 : PyErr_SetNdrError(err);
26786 0 : return NULL;
26787 : }
26788 : }
26789 :
26790 0 : TALLOC_FREE(pull);
26791 0 : Py_RETURN_NONE;
26792 : }
26793 :
26794 0 : static PyObject *py_netr_LogonUasLogon_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26795 : {
26796 : DATA_BLOB blob;
26797 0 : Py_ssize_t blob_length = 0;
26798 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26799 0 : PyObject *bigendian_obj = NULL;
26800 0 : PyObject *ndr64_obj = NULL;
26801 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26802 0 : PyObject *allow_remaining_obj = NULL;
26803 0 : bool allow_remaining = false;
26804 :
26805 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26806 : discard_const_p(char *, kwnames),
26807 : &blob.data, &blob_length,
26808 : &bigendian_obj,
26809 : &ndr64_obj,
26810 : &allow_remaining_obj)) {
26811 0 : return NULL;
26812 : }
26813 0 : blob.length = blob_length;
26814 :
26815 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26816 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26817 : }
26818 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26819 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26820 : }
26821 :
26822 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26823 0 : allow_remaining = true;
26824 : }
26825 :
26826 0 : return py_netr_LogonUasLogon_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26827 : }
26828 :
26829 0 : static PyObject *py_netr_LogonUasLogon_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26830 : {
26831 : DATA_BLOB blob;
26832 0 : Py_ssize_t blob_length = 0;
26833 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26834 0 : PyObject *bigendian_obj = NULL;
26835 0 : PyObject *ndr64_obj = NULL;
26836 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26837 0 : PyObject *allow_remaining_obj = NULL;
26838 0 : bool allow_remaining = false;
26839 :
26840 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26841 : discard_const_p(char *, kwnames),
26842 : &blob.data, &blob_length,
26843 : &bigendian_obj,
26844 : &ndr64_obj,
26845 : &allow_remaining_obj)) {
26846 0 : return NULL;
26847 : }
26848 0 : blob.length = blob_length;
26849 :
26850 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26851 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26852 : }
26853 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26854 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26855 : }
26856 :
26857 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26858 0 : allow_remaining = true;
26859 : }
26860 :
26861 0 : return py_netr_LogonUasLogon_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26862 : }
26863 :
26864 0 : static PyObject *py_netr_LogonUasLogon_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
26865 : {
26866 0 : const struct ndr_interface_call *call = NULL;
26867 0 : struct netr_LogonUasLogon *object = (struct netr_LogonUasLogon *)pytalloc_get_ptr(py_obj);
26868 : PyObject *ret;
26869 : char *retstr;
26870 :
26871 0 : if (ndr_table_netlogon.num_calls < 1) {
26872 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogon_ndr_print");
26873 0 : return NULL;
26874 : }
26875 0 : call = &ndr_table_netlogon.calls[0];
26876 :
26877 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26878 0 : ret = PyUnicode_FromString(retstr);
26879 0 : TALLOC_FREE(retstr);
26880 :
26881 0 : return ret;
26882 : }
26883 :
26884 0 : static PyObject *py_netr_LogonUasLogon_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26885 : {
26886 0 : return py_netr_LogonUasLogon_ndr_print(py_obj, "netr_LogonUasLogon_in", NDR_IN);
26887 : }
26888 :
26889 0 : static PyObject *py_netr_LogonUasLogon_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26890 : {
26891 0 : return py_netr_LogonUasLogon_ndr_print(py_obj, "netr_LogonUasLogon_out", NDR_OUT);
26892 : }
26893 :
26894 : static PyMethodDef py_netr_LogonUasLogon_methods[] = {
26895 : { "opnum", (PyCFunction)py_netr_LogonUasLogon_ndr_opnum, METH_NOARGS|METH_CLASS,
26896 : "netlogon.netr_LogonUasLogon.opnum() -> 0 (0x00) " },
26897 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogon_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26898 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26899 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogon_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26900 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26901 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogon_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26902 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26903 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogon_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26904 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26905 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonUasLogon_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26906 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonUasLogon_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26907 : { NULL, NULL, 0, NULL }
26908 : };
26909 :
26910 :
26911 : static PyTypeObject netr_LogonUasLogon_Type = {
26912 : PyVarObject_HEAD_INIT(NULL, 0)
26913 : .tp_name = "netlogon.netr_LogonUasLogon",
26914 : .tp_getset = py_netr_LogonUasLogon_getsetters,
26915 : .tp_methods = py_netr_LogonUasLogon_methods,
26916 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26917 : .tp_new = py_netr_LogonUasLogon_new,
26918 : };
26919 :
26920 0 : static bool pack_py_netr_LogonUasLogon_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonUasLogon *r)
26921 : {
26922 : PyObject *py_server_name;
26923 : PyObject *py_account_name;
26924 : PyObject *py_workstation;
26925 0 : const char *kwnames[] = {
26926 : "server_name", "account_name", "workstation", NULL
26927 : };
26928 :
26929 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_LogonUasLogon", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_workstation)) {
26930 0 : return false;
26931 : }
26932 :
26933 0 : if (py_server_name == NULL) {
26934 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
26935 0 : return false;
26936 : }
26937 0 : if (py_server_name == Py_None) {
26938 0 : r->in.server_name = NULL;
26939 : } else {
26940 0 : r->in.server_name = NULL;
26941 : {
26942 : const char *test_str;
26943 : const char *talloc_str;
26944 0 : PyObject *unicode = NULL;
26945 0 : if (PyUnicode_Check(py_server_name)) {
26946 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
26947 0 : if (unicode == NULL) {
26948 0 : PyErr_NoMemory();
26949 0 : return false;
26950 : }
26951 0 : test_str = PyBytes_AS_STRING(unicode);
26952 0 : } else if (PyBytes_Check(py_server_name)) {
26953 0 : test_str = PyBytes_AS_STRING(py_server_name);
26954 : } else {
26955 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
26956 0 : return false;
26957 : }
26958 0 : talloc_str = talloc_strdup(r, test_str);
26959 0 : if (unicode != NULL) {
26960 0 : Py_DECREF(unicode);
26961 : }
26962 0 : if (talloc_str == NULL) {
26963 0 : PyErr_NoMemory();
26964 0 : return false;
26965 : }
26966 0 : r->in.server_name = talloc_str;
26967 : }
26968 : }
26969 0 : if (py_account_name == NULL) {
26970 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
26971 0 : return false;
26972 : }
26973 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
26974 0 : if (r->in.account_name == NULL) {
26975 0 : PyErr_NoMemory();
26976 0 : return false;
26977 : }
26978 : {
26979 : const char *test_str;
26980 : const char *talloc_str;
26981 0 : PyObject *unicode = NULL;
26982 0 : if (PyUnicode_Check(py_account_name)) {
26983 0 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
26984 0 : if (unicode == NULL) {
26985 0 : PyErr_NoMemory();
26986 0 : return false;
26987 : }
26988 0 : test_str = PyBytes_AS_STRING(unicode);
26989 0 : } else if (PyBytes_Check(py_account_name)) {
26990 0 : test_str = PyBytes_AS_STRING(py_account_name);
26991 : } else {
26992 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
26993 0 : return false;
26994 : }
26995 0 : talloc_str = talloc_strdup(r, test_str);
26996 0 : if (unicode != NULL) {
26997 0 : Py_DECREF(unicode);
26998 : }
26999 0 : if (talloc_str == NULL) {
27000 0 : PyErr_NoMemory();
27001 0 : return false;
27002 : }
27003 0 : r->in.account_name = talloc_str;
27004 : }
27005 0 : if (py_workstation == NULL) {
27006 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.workstation");
27007 0 : return false;
27008 : }
27009 0 : r->in.workstation = talloc_ptrtype(r, r->in.workstation);
27010 0 : if (r->in.workstation == NULL) {
27011 0 : PyErr_NoMemory();
27012 0 : return false;
27013 : }
27014 : {
27015 : const char *test_str;
27016 : const char *talloc_str;
27017 0 : PyObject *unicode = NULL;
27018 0 : if (PyUnicode_Check(py_workstation)) {
27019 0 : unicode = PyUnicode_AsEncodedString(py_workstation, "utf-8", "ignore");
27020 0 : if (unicode == NULL) {
27021 0 : PyErr_NoMemory();
27022 0 : return false;
27023 : }
27024 0 : test_str = PyBytes_AS_STRING(unicode);
27025 0 : } else if (PyBytes_Check(py_workstation)) {
27026 0 : test_str = PyBytes_AS_STRING(py_workstation);
27027 : } else {
27028 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_workstation)->tp_name);
27029 0 : return false;
27030 : }
27031 0 : talloc_str = talloc_strdup(r, test_str);
27032 0 : if (unicode != NULL) {
27033 0 : Py_DECREF(unicode);
27034 : }
27035 0 : if (talloc_str == NULL) {
27036 0 : PyErr_NoMemory();
27037 0 : return false;
27038 : }
27039 0 : r->in.workstation = talloc_str;
27040 : }
27041 0 : return true;
27042 : }
27043 :
27044 0 : static PyObject *unpack_py_netr_LogonUasLogon_args_out(struct netr_LogonUasLogon *r)
27045 : {
27046 : PyObject *result;
27047 : PyObject *py_info;
27048 0 : if (*r->out.info == NULL) {
27049 0 : py_info = Py_None;
27050 0 : Py_INCREF(py_info);
27051 : } else {
27052 0 : py_info = pytalloc_reference_ex(&netr_UasInfo_Type, *r->out.info, *r->out.info);
27053 : }
27054 0 : result = py_info;
27055 0 : if (!W_ERROR_IS_OK(r->out.result)) {
27056 0 : PyErr_SetWERROR(r->out.result);
27057 0 : return NULL;
27058 : }
27059 :
27060 0 : return result;
27061 : }
27062 :
27063 :
27064 0 : static PyObject *py_netr_LogonUasLogoff_in_get_server_name(PyObject *obj, void *closure)
27065 : {
27066 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj);
27067 : PyObject *py_server_name;
27068 0 : if (object->in.server_name == NULL) {
27069 0 : Py_RETURN_NONE;
27070 : }
27071 0 : if (object->in.server_name == NULL) {
27072 0 : py_server_name = Py_None;
27073 0 : Py_INCREF(py_server_name);
27074 : } else {
27075 0 : if (object->in.server_name == NULL) {
27076 0 : py_server_name = Py_None;
27077 0 : Py_INCREF(py_server_name);
27078 : } else {
27079 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
27080 : }
27081 : }
27082 0 : return py_server_name;
27083 : }
27084 :
27085 0 : static int py_netr_LogonUasLogoff_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
27086 : {
27087 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj);
27088 0 : if (value == NULL) {
27089 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
27090 0 : return -1;
27091 : }
27092 0 : if (value == Py_None) {
27093 0 : object->in.server_name = NULL;
27094 : } else {
27095 0 : object->in.server_name = NULL;
27096 : {
27097 : const char *test_str;
27098 : const char *talloc_str;
27099 0 : PyObject *unicode = NULL;
27100 0 : if (PyUnicode_Check(value)) {
27101 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
27102 0 : if (unicode == NULL) {
27103 0 : PyErr_NoMemory();
27104 0 : return -1;
27105 : }
27106 0 : test_str = PyBytes_AS_STRING(unicode);
27107 0 : } else if (PyBytes_Check(value)) {
27108 0 : test_str = PyBytes_AS_STRING(value);
27109 : } else {
27110 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
27111 0 : return -1;
27112 : }
27113 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
27114 0 : if (unicode != NULL) {
27115 0 : Py_DECREF(unicode);
27116 : }
27117 0 : if (talloc_str == NULL) {
27118 0 : PyErr_NoMemory();
27119 0 : return -1;
27120 : }
27121 0 : object->in.server_name = talloc_str;
27122 : }
27123 : }
27124 0 : return 0;
27125 : }
27126 :
27127 0 : static PyObject *py_netr_LogonUasLogoff_in_get_account_name(PyObject *obj, void *closure)
27128 : {
27129 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj);
27130 : PyObject *py_account_name;
27131 0 : if (object->in.account_name == NULL) {
27132 0 : Py_RETURN_NONE;
27133 : }
27134 0 : if (object->in.account_name == NULL) {
27135 0 : py_account_name = Py_None;
27136 0 : Py_INCREF(py_account_name);
27137 : } else {
27138 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
27139 : }
27140 0 : return py_account_name;
27141 : }
27142 :
27143 0 : static int py_netr_LogonUasLogoff_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
27144 : {
27145 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj);
27146 0 : if (value == NULL) {
27147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
27148 0 : return -1;
27149 : }
27150 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
27151 0 : if (object->in.account_name == NULL) {
27152 0 : PyErr_NoMemory();
27153 0 : return -1;
27154 : }
27155 : {
27156 : const char *test_str;
27157 : const char *talloc_str;
27158 0 : PyObject *unicode = NULL;
27159 0 : if (PyUnicode_Check(value)) {
27160 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
27161 0 : if (unicode == NULL) {
27162 0 : PyErr_NoMemory();
27163 0 : return -1;
27164 : }
27165 0 : test_str = PyBytes_AS_STRING(unicode);
27166 0 : } else if (PyBytes_Check(value)) {
27167 0 : test_str = PyBytes_AS_STRING(value);
27168 : } else {
27169 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
27170 0 : return -1;
27171 : }
27172 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
27173 0 : if (unicode != NULL) {
27174 0 : Py_DECREF(unicode);
27175 : }
27176 0 : if (talloc_str == NULL) {
27177 0 : PyErr_NoMemory();
27178 0 : return -1;
27179 : }
27180 0 : object->in.account_name = talloc_str;
27181 : }
27182 0 : return 0;
27183 : }
27184 :
27185 0 : static PyObject *py_netr_LogonUasLogoff_in_get_workstation(PyObject *obj, void *closure)
27186 : {
27187 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj);
27188 : PyObject *py_workstation;
27189 0 : if (object->in.workstation == NULL) {
27190 0 : Py_RETURN_NONE;
27191 : }
27192 0 : if (object->in.workstation == NULL) {
27193 0 : py_workstation = Py_None;
27194 0 : Py_INCREF(py_workstation);
27195 : } else {
27196 0 : py_workstation = PyUnicode_Decode(object->in.workstation, strlen(object->in.workstation), "utf-8", "ignore");
27197 : }
27198 0 : return py_workstation;
27199 : }
27200 :
27201 0 : static int py_netr_LogonUasLogoff_in_set_workstation(PyObject *py_obj, PyObject *value, void *closure)
27202 : {
27203 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj);
27204 0 : if (value == NULL) {
27205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.workstation");
27206 0 : return -1;
27207 : }
27208 0 : object->in.workstation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.workstation);
27209 0 : if (object->in.workstation == NULL) {
27210 0 : PyErr_NoMemory();
27211 0 : return -1;
27212 : }
27213 : {
27214 : const char *test_str;
27215 : const char *talloc_str;
27216 0 : PyObject *unicode = NULL;
27217 0 : if (PyUnicode_Check(value)) {
27218 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
27219 0 : if (unicode == NULL) {
27220 0 : PyErr_NoMemory();
27221 0 : return -1;
27222 : }
27223 0 : test_str = PyBytes_AS_STRING(unicode);
27224 0 : } else if (PyBytes_Check(value)) {
27225 0 : test_str = PyBytes_AS_STRING(value);
27226 : } else {
27227 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
27228 0 : return -1;
27229 : }
27230 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
27231 0 : if (unicode != NULL) {
27232 0 : Py_DECREF(unicode);
27233 : }
27234 0 : if (talloc_str == NULL) {
27235 0 : PyErr_NoMemory();
27236 0 : return -1;
27237 : }
27238 0 : object->in.workstation = talloc_str;
27239 : }
27240 0 : return 0;
27241 : }
27242 :
27243 0 : static PyObject *py_netr_LogonUasLogoff_out_get_info(PyObject *obj, void *closure)
27244 : {
27245 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj);
27246 : PyObject *py_info;
27247 0 : if (object->out.info == NULL) {
27248 0 : Py_RETURN_NONE;
27249 : }
27250 0 : py_info = pytalloc_reference_ex(&netr_UasLogoffInfo_Type, object->out.info, object->out.info);
27251 0 : return py_info;
27252 : }
27253 :
27254 0 : static int py_netr_LogonUasLogoff_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
27255 : {
27256 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj);
27257 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
27258 0 : if (value == NULL) {
27259 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
27260 0 : return -1;
27261 : }
27262 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
27263 0 : if (object->out.info == NULL) {
27264 0 : PyErr_NoMemory();
27265 0 : return -1;
27266 : }
27267 0 : PY_CHECK_TYPE(&netr_UasLogoffInfo_Type, value, return -1;);
27268 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27269 0 : PyErr_NoMemory();
27270 0 : return -1;
27271 : }
27272 0 : object->out.info = (struct netr_UasLogoffInfo *)pytalloc_get_ptr(value);
27273 0 : return 0;
27274 : }
27275 :
27276 0 : static PyObject *py_netr_LogonUasLogoff_get_result(PyObject *obj, void *closure)
27277 : {
27278 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(obj);
27279 : PyObject *py_result;
27280 0 : py_result = PyErr_FromWERROR(object->out.result);
27281 0 : return py_result;
27282 : }
27283 :
27284 0 : static int py_netr_LogonUasLogoff_set_result(PyObject *py_obj, PyObject *value, void *closure)
27285 : {
27286 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj);
27287 0 : if (value == NULL) {
27288 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27289 0 : return -1;
27290 : }
27291 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
27292 0 : return 0;
27293 : }
27294 :
27295 : static PyGetSetDef py_netr_LogonUasLogoff_getsetters[] = {
27296 : {
27297 : .name = discard_const_p(char, "in_server_name"),
27298 : .get = py_netr_LogonUasLogoff_in_get_server_name,
27299 : .set = py_netr_LogonUasLogoff_in_set_server_name,
27300 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
27301 : },
27302 : {
27303 : .name = discard_const_p(char, "in_account_name"),
27304 : .get = py_netr_LogonUasLogoff_in_get_account_name,
27305 : .set = py_netr_LogonUasLogoff_in_set_account_name,
27306 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
27307 : },
27308 : {
27309 : .name = discard_const_p(char, "in_workstation"),
27310 : .get = py_netr_LogonUasLogoff_in_get_workstation,
27311 : .set = py_netr_LogonUasLogoff_in_set_workstation,
27312 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
27313 : },
27314 : {
27315 : .name = discard_const_p(char, "out_info"),
27316 : .get = py_netr_LogonUasLogoff_out_get_info,
27317 : .set = py_netr_LogonUasLogoff_out_set_info,
27318 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UasLogoffInfo")
27319 : },
27320 : {
27321 : .name = discard_const_p(char, "result"),
27322 : .get = py_netr_LogonUasLogoff_get_result,
27323 : .set = py_netr_LogonUasLogoff_set_result,
27324 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
27325 : },
27326 : { .name = NULL }
27327 : };
27328 :
27329 0 : static PyObject *py_netr_LogonUasLogoff_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27330 : {
27331 0 : PyObject *self = pytalloc_new(struct netr_LogonUasLogoff, type);
27332 0 : struct netr_LogonUasLogoff *_self = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(self);
27333 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27334 0 : _self->out.info = talloc_zero(mem_ctx, struct netr_UasLogoffInfo);
27335 0 : return self;
27336 : }
27337 :
27338 0 : static PyObject *py_netr_LogonUasLogoff_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27339 : {
27340 :
27341 :
27342 0 : return PyLong_FromLong(1);
27343 : }
27344 :
27345 0 : static PyObject *py_netr_LogonUasLogoff_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
27346 : {
27347 0 : const struct ndr_interface_call *call = NULL;
27348 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj);
27349 0 : PyObject *ret = NULL;
27350 0 : struct ndr_push *push = NULL;
27351 : DATA_BLOB blob;
27352 : enum ndr_err_code err;
27353 :
27354 0 : if (ndr_table_netlogon.num_calls < 2) {
27355 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogoff_ndr_pack");
27356 0 : return NULL;
27357 : }
27358 0 : call = &ndr_table_netlogon.calls[1];
27359 :
27360 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27361 0 : if (push == NULL) {
27362 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27363 0 : return NULL;
27364 : }
27365 :
27366 0 : push->flags |= ndr_push_flags;
27367 :
27368 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27369 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27370 0 : TALLOC_FREE(push);
27371 0 : PyErr_SetNdrError(err);
27372 0 : return NULL;
27373 : }
27374 0 : blob = ndr_push_blob(push);
27375 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27376 0 : TALLOC_FREE(push);
27377 0 : return ret;
27378 : }
27379 :
27380 0 : static PyObject *py_netr_LogonUasLogoff_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27381 : {
27382 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27383 0 : PyObject *bigendian_obj = NULL;
27384 0 : PyObject *ndr64_obj = NULL;
27385 0 : uint32_t ndr_push_flags = 0;
27386 :
27387 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27388 : discard_const_p(char *, kwnames),
27389 : &bigendian_obj,
27390 : &ndr64_obj)) {
27391 0 : return NULL;
27392 : }
27393 :
27394 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27395 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27396 : }
27397 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27398 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27399 : }
27400 :
27401 0 : return py_netr_LogonUasLogoff_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27402 : }
27403 :
27404 0 : static PyObject *py_netr_LogonUasLogoff_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27405 : {
27406 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27407 0 : PyObject *bigendian_obj = NULL;
27408 0 : PyObject *ndr64_obj = NULL;
27409 0 : uint32_t ndr_push_flags = 0;
27410 :
27411 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27412 : discard_const_p(char *, kwnames),
27413 : &bigendian_obj,
27414 : &ndr64_obj)) {
27415 0 : return NULL;
27416 : }
27417 :
27418 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27419 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27420 : }
27421 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27422 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27423 : }
27424 :
27425 0 : return py_netr_LogonUasLogoff_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27426 : }
27427 :
27428 0 : static PyObject *py_netr_LogonUasLogoff_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
27429 : {
27430 0 : const struct ndr_interface_call *call = NULL;
27431 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj);
27432 0 : struct ndr_pull *pull = NULL;
27433 : enum ndr_err_code err;
27434 :
27435 0 : if (ndr_table_netlogon.num_calls < 2) {
27436 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogoff_ndr_unpack");
27437 0 : return NULL;
27438 : }
27439 0 : call = &ndr_table_netlogon.calls[1];
27440 :
27441 0 : pull = ndr_pull_init_blob(blob, object);
27442 0 : if (pull == NULL) {
27443 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27444 0 : return NULL;
27445 : }
27446 :
27447 0 : pull->flags |= ndr_pull_flags;
27448 :
27449 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27450 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27451 0 : TALLOC_FREE(pull);
27452 0 : PyErr_SetNdrError(err);
27453 0 : return NULL;
27454 : }
27455 0 : if (!allow_remaining) {
27456 : uint32_t highest_ofs;
27457 :
27458 0 : if (pull->offset > pull->relative_highest_offset) {
27459 0 : highest_ofs = pull->offset;
27460 : } else {
27461 0 : highest_ofs = pull->relative_highest_offset;
27462 : }
27463 0 : if (highest_ofs < pull->data_size) {
27464 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27465 : "not all bytes consumed ofs[%u] size[%u]",
27466 : highest_ofs, pull->data_size);
27467 0 : TALLOC_FREE(pull);
27468 0 : PyErr_SetNdrError(err);
27469 0 : return NULL;
27470 : }
27471 : }
27472 :
27473 0 : TALLOC_FREE(pull);
27474 0 : Py_RETURN_NONE;
27475 : }
27476 :
27477 0 : static PyObject *py_netr_LogonUasLogoff_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27478 : {
27479 : DATA_BLOB blob;
27480 0 : Py_ssize_t blob_length = 0;
27481 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27482 0 : PyObject *bigendian_obj = NULL;
27483 0 : PyObject *ndr64_obj = NULL;
27484 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27485 0 : PyObject *allow_remaining_obj = NULL;
27486 0 : bool allow_remaining = false;
27487 :
27488 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27489 : discard_const_p(char *, kwnames),
27490 : &blob.data, &blob_length,
27491 : &bigendian_obj,
27492 : &ndr64_obj,
27493 : &allow_remaining_obj)) {
27494 0 : return NULL;
27495 : }
27496 0 : blob.length = blob_length;
27497 :
27498 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27499 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27500 : }
27501 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27502 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27503 : }
27504 :
27505 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27506 0 : allow_remaining = true;
27507 : }
27508 :
27509 0 : return py_netr_LogonUasLogoff_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27510 : }
27511 :
27512 0 : static PyObject *py_netr_LogonUasLogoff_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27513 : {
27514 : DATA_BLOB blob;
27515 0 : Py_ssize_t blob_length = 0;
27516 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27517 0 : PyObject *bigendian_obj = NULL;
27518 0 : PyObject *ndr64_obj = NULL;
27519 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27520 0 : PyObject *allow_remaining_obj = NULL;
27521 0 : bool allow_remaining = false;
27522 :
27523 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27524 : discard_const_p(char *, kwnames),
27525 : &blob.data, &blob_length,
27526 : &bigendian_obj,
27527 : &ndr64_obj,
27528 : &allow_remaining_obj)) {
27529 0 : return NULL;
27530 : }
27531 0 : blob.length = blob_length;
27532 :
27533 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27534 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27535 : }
27536 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27537 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27538 : }
27539 :
27540 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27541 0 : allow_remaining = true;
27542 : }
27543 :
27544 0 : return py_netr_LogonUasLogoff_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27545 : }
27546 :
27547 0 : static PyObject *py_netr_LogonUasLogoff_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
27548 : {
27549 0 : const struct ndr_interface_call *call = NULL;
27550 0 : struct netr_LogonUasLogoff *object = (struct netr_LogonUasLogoff *)pytalloc_get_ptr(py_obj);
27551 : PyObject *ret;
27552 : char *retstr;
27553 :
27554 0 : if (ndr_table_netlogon.num_calls < 2) {
27555 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonUasLogoff_ndr_print");
27556 0 : return NULL;
27557 : }
27558 0 : call = &ndr_table_netlogon.calls[1];
27559 :
27560 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27561 0 : ret = PyUnicode_FromString(retstr);
27562 0 : TALLOC_FREE(retstr);
27563 :
27564 0 : return ret;
27565 : }
27566 :
27567 0 : static PyObject *py_netr_LogonUasLogoff_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27568 : {
27569 0 : return py_netr_LogonUasLogoff_ndr_print(py_obj, "netr_LogonUasLogoff_in", NDR_IN);
27570 : }
27571 :
27572 0 : static PyObject *py_netr_LogonUasLogoff_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27573 : {
27574 0 : return py_netr_LogonUasLogoff_ndr_print(py_obj, "netr_LogonUasLogoff_out", NDR_OUT);
27575 : }
27576 :
27577 : static PyMethodDef py_netr_LogonUasLogoff_methods[] = {
27578 : { "opnum", (PyCFunction)py_netr_LogonUasLogoff_ndr_opnum, METH_NOARGS|METH_CLASS,
27579 : "netlogon.netr_LogonUasLogoff.opnum() -> 1 (0x01) " },
27580 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogoff_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27581 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27582 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogoff_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27583 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27584 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogoff_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27585 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27586 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonUasLogoff_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27587 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27588 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonUasLogoff_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27589 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonUasLogoff_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27590 : { NULL, NULL, 0, NULL }
27591 : };
27592 :
27593 :
27594 : static PyTypeObject netr_LogonUasLogoff_Type = {
27595 : PyVarObject_HEAD_INIT(NULL, 0)
27596 : .tp_name = "netlogon.netr_LogonUasLogoff",
27597 : .tp_getset = py_netr_LogonUasLogoff_getsetters,
27598 : .tp_methods = py_netr_LogonUasLogoff_methods,
27599 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27600 : .tp_new = py_netr_LogonUasLogoff_new,
27601 : };
27602 :
27603 0 : static bool pack_py_netr_LogonUasLogoff_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonUasLogoff *r)
27604 : {
27605 : PyObject *py_server_name;
27606 : PyObject *py_account_name;
27607 : PyObject *py_workstation;
27608 0 : const char *kwnames[] = {
27609 : "server_name", "account_name", "workstation", NULL
27610 : };
27611 :
27612 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_LogonUasLogoff", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_workstation)) {
27613 0 : return false;
27614 : }
27615 :
27616 0 : if (py_server_name == NULL) {
27617 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
27618 0 : return false;
27619 : }
27620 0 : if (py_server_name == Py_None) {
27621 0 : r->in.server_name = NULL;
27622 : } else {
27623 0 : r->in.server_name = NULL;
27624 : {
27625 : const char *test_str;
27626 : const char *talloc_str;
27627 0 : PyObject *unicode = NULL;
27628 0 : if (PyUnicode_Check(py_server_name)) {
27629 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
27630 0 : if (unicode == NULL) {
27631 0 : PyErr_NoMemory();
27632 0 : return false;
27633 : }
27634 0 : test_str = PyBytes_AS_STRING(unicode);
27635 0 : } else if (PyBytes_Check(py_server_name)) {
27636 0 : test_str = PyBytes_AS_STRING(py_server_name);
27637 : } else {
27638 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
27639 0 : return false;
27640 : }
27641 0 : talloc_str = talloc_strdup(r, test_str);
27642 0 : if (unicode != NULL) {
27643 0 : Py_DECREF(unicode);
27644 : }
27645 0 : if (talloc_str == NULL) {
27646 0 : PyErr_NoMemory();
27647 0 : return false;
27648 : }
27649 0 : r->in.server_name = talloc_str;
27650 : }
27651 : }
27652 0 : if (py_account_name == NULL) {
27653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
27654 0 : return false;
27655 : }
27656 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
27657 0 : if (r->in.account_name == NULL) {
27658 0 : PyErr_NoMemory();
27659 0 : return false;
27660 : }
27661 : {
27662 : const char *test_str;
27663 : const char *talloc_str;
27664 0 : PyObject *unicode = NULL;
27665 0 : if (PyUnicode_Check(py_account_name)) {
27666 0 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
27667 0 : if (unicode == NULL) {
27668 0 : PyErr_NoMemory();
27669 0 : return false;
27670 : }
27671 0 : test_str = PyBytes_AS_STRING(unicode);
27672 0 : } else if (PyBytes_Check(py_account_name)) {
27673 0 : test_str = PyBytes_AS_STRING(py_account_name);
27674 : } else {
27675 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
27676 0 : return false;
27677 : }
27678 0 : talloc_str = talloc_strdup(r, test_str);
27679 0 : if (unicode != NULL) {
27680 0 : Py_DECREF(unicode);
27681 : }
27682 0 : if (talloc_str == NULL) {
27683 0 : PyErr_NoMemory();
27684 0 : return false;
27685 : }
27686 0 : r->in.account_name = talloc_str;
27687 : }
27688 0 : if (py_workstation == NULL) {
27689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.workstation");
27690 0 : return false;
27691 : }
27692 0 : r->in.workstation = talloc_ptrtype(r, r->in.workstation);
27693 0 : if (r->in.workstation == NULL) {
27694 0 : PyErr_NoMemory();
27695 0 : return false;
27696 : }
27697 : {
27698 : const char *test_str;
27699 : const char *talloc_str;
27700 0 : PyObject *unicode = NULL;
27701 0 : if (PyUnicode_Check(py_workstation)) {
27702 0 : unicode = PyUnicode_AsEncodedString(py_workstation, "utf-8", "ignore");
27703 0 : if (unicode == NULL) {
27704 0 : PyErr_NoMemory();
27705 0 : return false;
27706 : }
27707 0 : test_str = PyBytes_AS_STRING(unicode);
27708 0 : } else if (PyBytes_Check(py_workstation)) {
27709 0 : test_str = PyBytes_AS_STRING(py_workstation);
27710 : } else {
27711 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_workstation)->tp_name);
27712 0 : return false;
27713 : }
27714 0 : talloc_str = talloc_strdup(r, test_str);
27715 0 : if (unicode != NULL) {
27716 0 : Py_DECREF(unicode);
27717 : }
27718 0 : if (talloc_str == NULL) {
27719 0 : PyErr_NoMemory();
27720 0 : return false;
27721 : }
27722 0 : r->in.workstation = talloc_str;
27723 : }
27724 0 : return true;
27725 : }
27726 :
27727 0 : static PyObject *unpack_py_netr_LogonUasLogoff_args_out(struct netr_LogonUasLogoff *r)
27728 : {
27729 : PyObject *result;
27730 : PyObject *py_info;
27731 0 : py_info = pytalloc_reference_ex(&netr_UasLogoffInfo_Type, r->out.info, r->out.info);
27732 0 : result = py_info;
27733 0 : if (!W_ERROR_IS_OK(r->out.result)) {
27734 0 : PyErr_SetWERROR(r->out.result);
27735 0 : return NULL;
27736 : }
27737 :
27738 0 : return result;
27739 : }
27740 :
27741 :
27742 0 : static PyObject *py_netr_LogonSamLogon_in_get_server_name(PyObject *obj, void *closure)
27743 : {
27744 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
27745 : PyObject *py_server_name;
27746 0 : if (object->in.server_name == NULL) {
27747 0 : Py_RETURN_NONE;
27748 : }
27749 0 : if (object->in.server_name == NULL) {
27750 0 : py_server_name = Py_None;
27751 0 : Py_INCREF(py_server_name);
27752 : } else {
27753 0 : if (object->in.server_name == NULL) {
27754 0 : py_server_name = Py_None;
27755 0 : Py_INCREF(py_server_name);
27756 : } else {
27757 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
27758 : }
27759 : }
27760 0 : return py_server_name;
27761 : }
27762 :
27763 0 : static int py_netr_LogonSamLogon_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
27764 : {
27765 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
27766 0 : if (value == NULL) {
27767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
27768 0 : return -1;
27769 : }
27770 0 : if (value == Py_None) {
27771 0 : object->in.server_name = NULL;
27772 : } else {
27773 0 : object->in.server_name = NULL;
27774 : {
27775 : const char *test_str;
27776 : const char *talloc_str;
27777 0 : PyObject *unicode = NULL;
27778 0 : if (PyUnicode_Check(value)) {
27779 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
27780 0 : if (unicode == NULL) {
27781 0 : PyErr_NoMemory();
27782 0 : return -1;
27783 : }
27784 0 : test_str = PyBytes_AS_STRING(unicode);
27785 0 : } else if (PyBytes_Check(value)) {
27786 0 : test_str = PyBytes_AS_STRING(value);
27787 : } else {
27788 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
27789 0 : return -1;
27790 : }
27791 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
27792 0 : if (unicode != NULL) {
27793 0 : Py_DECREF(unicode);
27794 : }
27795 0 : if (talloc_str == NULL) {
27796 0 : PyErr_NoMemory();
27797 0 : return -1;
27798 : }
27799 0 : object->in.server_name = talloc_str;
27800 : }
27801 : }
27802 0 : return 0;
27803 : }
27804 :
27805 0 : static PyObject *py_netr_LogonSamLogon_in_get_computer_name(PyObject *obj, void *closure)
27806 : {
27807 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
27808 : PyObject *py_computer_name;
27809 0 : if (object->in.computer_name == NULL) {
27810 0 : Py_RETURN_NONE;
27811 : }
27812 0 : if (object->in.computer_name == NULL) {
27813 0 : py_computer_name = Py_None;
27814 0 : Py_INCREF(py_computer_name);
27815 : } else {
27816 0 : if (object->in.computer_name == NULL) {
27817 0 : py_computer_name = Py_None;
27818 0 : Py_INCREF(py_computer_name);
27819 : } else {
27820 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
27821 : }
27822 : }
27823 0 : return py_computer_name;
27824 : }
27825 :
27826 0 : static int py_netr_LogonSamLogon_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
27827 : {
27828 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
27829 0 : if (value == NULL) {
27830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
27831 0 : return -1;
27832 : }
27833 0 : if (value == Py_None) {
27834 0 : object->in.computer_name = NULL;
27835 : } else {
27836 0 : object->in.computer_name = NULL;
27837 : {
27838 : const char *test_str;
27839 : const char *talloc_str;
27840 0 : PyObject *unicode = NULL;
27841 0 : if (PyUnicode_Check(value)) {
27842 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
27843 0 : if (unicode == NULL) {
27844 0 : PyErr_NoMemory();
27845 0 : return -1;
27846 : }
27847 0 : test_str = PyBytes_AS_STRING(unicode);
27848 0 : } else if (PyBytes_Check(value)) {
27849 0 : test_str = PyBytes_AS_STRING(value);
27850 : } else {
27851 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
27852 0 : return -1;
27853 : }
27854 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
27855 0 : if (unicode != NULL) {
27856 0 : Py_DECREF(unicode);
27857 : }
27858 0 : if (talloc_str == NULL) {
27859 0 : PyErr_NoMemory();
27860 0 : return -1;
27861 : }
27862 0 : object->in.computer_name = talloc_str;
27863 : }
27864 : }
27865 0 : return 0;
27866 : }
27867 :
27868 0 : static PyObject *py_netr_LogonSamLogon_in_get_credential(PyObject *obj, void *closure)
27869 : {
27870 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
27871 : PyObject *py_credential;
27872 0 : if (object->in.credential == NULL) {
27873 0 : Py_RETURN_NONE;
27874 : }
27875 0 : if (object->in.credential == NULL) {
27876 0 : py_credential = Py_None;
27877 0 : Py_INCREF(py_credential);
27878 : } else {
27879 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
27880 : }
27881 0 : return py_credential;
27882 : }
27883 :
27884 0 : static int py_netr_LogonSamLogon_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
27885 : {
27886 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
27887 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
27888 0 : if (value == NULL) {
27889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
27890 0 : return -1;
27891 : }
27892 0 : if (value == Py_None) {
27893 0 : object->in.credential = NULL;
27894 : } else {
27895 0 : object->in.credential = NULL;
27896 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
27897 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27898 0 : PyErr_NoMemory();
27899 0 : return -1;
27900 : }
27901 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
27902 : }
27903 0 : return 0;
27904 : }
27905 :
27906 0 : static PyObject *py_netr_LogonSamLogon_in_get_return_authenticator(PyObject *obj, void *closure)
27907 : {
27908 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
27909 : PyObject *py_return_authenticator;
27910 0 : if (object->in.return_authenticator == NULL) {
27911 0 : Py_RETURN_NONE;
27912 : }
27913 0 : if (object->in.return_authenticator == NULL) {
27914 0 : py_return_authenticator = Py_None;
27915 0 : Py_INCREF(py_return_authenticator);
27916 : } else {
27917 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
27918 : }
27919 0 : return py_return_authenticator;
27920 : }
27921 :
27922 0 : static int py_netr_LogonSamLogon_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
27923 : {
27924 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
27925 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
27926 0 : if (value == NULL) {
27927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
27928 0 : return -1;
27929 : }
27930 0 : if (value == Py_None) {
27931 0 : object->in.return_authenticator = NULL;
27932 : } else {
27933 0 : object->in.return_authenticator = NULL;
27934 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
27935 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27936 0 : PyErr_NoMemory();
27937 0 : return -1;
27938 : }
27939 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
27940 : }
27941 0 : return 0;
27942 : }
27943 :
27944 0 : static PyObject *py_netr_LogonSamLogon_out_get_return_authenticator(PyObject *obj, void *closure)
27945 : {
27946 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
27947 : PyObject *py_return_authenticator;
27948 0 : if (object->out.return_authenticator == NULL) {
27949 0 : Py_RETURN_NONE;
27950 : }
27951 0 : if (object->out.return_authenticator == NULL) {
27952 0 : py_return_authenticator = Py_None;
27953 0 : Py_INCREF(py_return_authenticator);
27954 : } else {
27955 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
27956 : }
27957 0 : return py_return_authenticator;
27958 : }
27959 :
27960 0 : static int py_netr_LogonSamLogon_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
27961 : {
27962 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
27963 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
27964 0 : if (value == NULL) {
27965 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
27966 0 : return -1;
27967 : }
27968 0 : if (value == Py_None) {
27969 0 : object->out.return_authenticator = NULL;
27970 : } else {
27971 0 : object->out.return_authenticator = NULL;
27972 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
27973 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27974 0 : PyErr_NoMemory();
27975 0 : return -1;
27976 : }
27977 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
27978 : }
27979 0 : return 0;
27980 : }
27981 :
27982 0 : static PyObject *py_netr_LogonSamLogon_in_get_logon_level(PyObject *obj, void *closure)
27983 : {
27984 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
27985 : PyObject *py_logon_level;
27986 0 : py_logon_level = PyLong_FromLong((uint16_t)object->in.logon_level);
27987 0 : return py_logon_level;
27988 : }
27989 :
27990 0 : static int py_netr_LogonSamLogon_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure)
27991 : {
27992 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
27993 0 : if (value == NULL) {
27994 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_level");
27995 0 : return -1;
27996 : }
27997 : {
27998 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_level));
27999 0 : if (PyLong_Check(value)) {
28000 : unsigned long long test_var;
28001 0 : test_var = PyLong_AsUnsignedLongLong(value);
28002 0 : if (PyErr_Occurred() != NULL) {
28003 0 : return -1;
28004 : }
28005 0 : if (test_var > uint_max) {
28006 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28007 : PyLong_Type.tp_name, uint_max, test_var);
28008 0 : return -1;
28009 : }
28010 0 : object->in.logon_level = test_var;
28011 : } else {
28012 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28013 : PyLong_Type.tp_name);
28014 0 : return -1;
28015 : }
28016 : }
28017 0 : return 0;
28018 : }
28019 :
28020 0 : static PyObject *py_netr_LogonSamLogon_in_get_logon(PyObject *obj, void *closure)
28021 : {
28022 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
28023 : PyObject *py_logon;
28024 0 : if (object->in.logon == NULL) {
28025 0 : Py_RETURN_NONE;
28026 : }
28027 0 : py_logon = pyrpc_import_union(&netr_LogonLevel_Type, object->in.logon, object->in.logon_level, object->in.logon, "union netr_LogonLevel");
28028 0 : if (py_logon == NULL) {
28029 0 : return NULL;
28030 : }
28031 0 : return py_logon;
28032 : }
28033 :
28034 0 : static int py_netr_LogonSamLogon_in_set_logon(PyObject *py_obj, PyObject *value, void *closure)
28035 : {
28036 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
28037 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.logon));
28038 0 : if (value == NULL) {
28039 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon");
28040 0 : return -1;
28041 : }
28042 0 : object->in.logon = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon);
28043 0 : if (object->in.logon == NULL) {
28044 0 : PyErr_NoMemory();
28045 0 : return -1;
28046 : }
28047 : {
28048 : union netr_LogonLevel *logon_switch_1;
28049 0 : logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, pytalloc_get_mem_ctx(py_obj), object->in.logon_level, value, "union netr_LogonLevel");
28050 0 : if (logon_switch_1 == NULL) {
28051 0 : return -1;
28052 : }
28053 0 : object->in.logon = logon_switch_1;
28054 : }
28055 0 : return 0;
28056 : }
28057 :
28058 0 : static PyObject *py_netr_LogonSamLogon_in_get_validation_level(PyObject *obj, void *closure)
28059 : {
28060 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
28061 : PyObject *py_validation_level;
28062 0 : py_validation_level = PyLong_FromLong((uint16_t)object->in.validation_level);
28063 0 : return py_validation_level;
28064 : }
28065 :
28066 0 : static int py_netr_LogonSamLogon_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure)
28067 : {
28068 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
28069 0 : if (value == NULL) {
28070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.validation_level");
28071 0 : return -1;
28072 : }
28073 : {
28074 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.validation_level));
28075 0 : if (PyLong_Check(value)) {
28076 : unsigned long long test_var;
28077 0 : test_var = PyLong_AsUnsignedLongLong(value);
28078 0 : if (PyErr_Occurred() != NULL) {
28079 0 : return -1;
28080 : }
28081 0 : if (test_var > uint_max) {
28082 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28083 : PyLong_Type.tp_name, uint_max, test_var);
28084 0 : return -1;
28085 : }
28086 0 : object->in.validation_level = test_var;
28087 : } else {
28088 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28089 : PyLong_Type.tp_name);
28090 0 : return -1;
28091 : }
28092 : }
28093 0 : return 0;
28094 : }
28095 :
28096 0 : static PyObject *py_netr_LogonSamLogon_out_get_validation(PyObject *obj, void *closure)
28097 : {
28098 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
28099 : PyObject *py_validation;
28100 0 : if (object->out.validation == NULL) {
28101 0 : Py_RETURN_NONE;
28102 : }
28103 0 : py_validation = pyrpc_import_union(&netr_Validation_Type, object->out.validation, object->in.validation_level, object->out.validation, "union netr_Validation");
28104 0 : if (py_validation == NULL) {
28105 0 : return NULL;
28106 : }
28107 0 : return py_validation;
28108 : }
28109 :
28110 0 : static int py_netr_LogonSamLogon_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
28111 : {
28112 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
28113 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation));
28114 0 : if (value == NULL) {
28115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation");
28116 0 : return -1;
28117 : }
28118 0 : object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation);
28119 0 : if (object->out.validation == NULL) {
28120 0 : PyErr_NoMemory();
28121 0 : return -1;
28122 : }
28123 : {
28124 : union netr_Validation *validation_switch_1;
28125 0 : validation_switch_1 = (union netr_Validation *)pyrpc_export_union(&netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->in.validation_level, value, "union netr_Validation");
28126 0 : if (validation_switch_1 == NULL) {
28127 0 : return -1;
28128 : }
28129 0 : object->out.validation = validation_switch_1;
28130 : }
28131 0 : return 0;
28132 : }
28133 :
28134 0 : static PyObject *py_netr_LogonSamLogon_out_get_authoritative(PyObject *obj, void *closure)
28135 : {
28136 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
28137 : PyObject *py_authoritative;
28138 0 : if (object->out.authoritative == NULL) {
28139 0 : Py_RETURN_NONE;
28140 : }
28141 0 : py_authoritative = PyLong_FromLong((uint16_t)*object->out.authoritative);
28142 0 : return py_authoritative;
28143 : }
28144 :
28145 0 : static int py_netr_LogonSamLogon_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure)
28146 : {
28147 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
28148 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authoritative));
28149 0 : if (value == NULL) {
28150 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative");
28151 0 : return -1;
28152 : }
28153 0 : object->out.authoritative = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authoritative);
28154 0 : if (object->out.authoritative == NULL) {
28155 0 : PyErr_NoMemory();
28156 0 : return -1;
28157 : }
28158 : {
28159 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.authoritative));
28160 0 : if (PyLong_Check(value)) {
28161 : unsigned long long test_var;
28162 0 : test_var = PyLong_AsUnsignedLongLong(value);
28163 0 : if (PyErr_Occurred() != NULL) {
28164 0 : return -1;
28165 : }
28166 0 : if (test_var > uint_max) {
28167 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28168 : PyLong_Type.tp_name, uint_max, test_var);
28169 0 : return -1;
28170 : }
28171 0 : *object->out.authoritative = test_var;
28172 : } else {
28173 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28174 : PyLong_Type.tp_name);
28175 0 : return -1;
28176 : }
28177 : }
28178 0 : return 0;
28179 : }
28180 :
28181 0 : static PyObject *py_netr_LogonSamLogon_get_result(PyObject *obj, void *closure)
28182 : {
28183 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(obj);
28184 : PyObject *py_result;
28185 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28186 0 : return py_result;
28187 : }
28188 :
28189 0 : static int py_netr_LogonSamLogon_set_result(PyObject *py_obj, PyObject *value, void *closure)
28190 : {
28191 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
28192 0 : if (value == NULL) {
28193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28194 0 : return -1;
28195 : }
28196 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28197 0 : return 0;
28198 : }
28199 :
28200 : static PyGetSetDef py_netr_LogonSamLogon_getsetters[] = {
28201 : {
28202 : .name = discard_const_p(char, "in_server_name"),
28203 : .get = py_netr_LogonSamLogon_in_get_server_name,
28204 : .set = py_netr_LogonSamLogon_in_set_server_name,
28205 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28206 : },
28207 : {
28208 : .name = discard_const_p(char, "in_computer_name"),
28209 : .get = py_netr_LogonSamLogon_in_get_computer_name,
28210 : .set = py_netr_LogonSamLogon_in_set_computer_name,
28211 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28212 : },
28213 : {
28214 : .name = discard_const_p(char, "in_credential"),
28215 : .get = py_netr_LogonSamLogon_in_get_credential,
28216 : .set = py_netr_LogonSamLogon_in_set_credential,
28217 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
28218 : },
28219 : {
28220 : .name = discard_const_p(char, "in_return_authenticator"),
28221 : .get = py_netr_LogonSamLogon_in_get_return_authenticator,
28222 : .set = py_netr_LogonSamLogon_in_set_return_authenticator,
28223 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
28224 : },
28225 : {
28226 : .name = discard_const_p(char, "out_return_authenticator"),
28227 : .get = py_netr_LogonSamLogon_out_get_return_authenticator,
28228 : .set = py_netr_LogonSamLogon_out_set_return_authenticator,
28229 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
28230 : },
28231 : {
28232 : .name = discard_const_p(char, "in_logon_level"),
28233 : .get = py_netr_LogonSamLogon_in_get_logon_level,
28234 : .set = py_netr_LogonSamLogon_in_set_logon_level,
28235 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonInfoClass")
28236 : },
28237 : {
28238 : .name = discard_const_p(char, "in_logon"),
28239 : .get = py_netr_LogonSamLogon_in_get_logon,
28240 : .set = py_netr_LogonSamLogon_in_set_logon,
28241 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonLevel")
28242 : },
28243 : {
28244 : .name = discard_const_p(char, "in_validation_level"),
28245 : .get = py_netr_LogonSamLogon_in_get_validation_level,
28246 : .set = py_netr_LogonSamLogon_in_set_validation_level,
28247 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28248 : },
28249 : {
28250 : .name = discard_const_p(char, "out_validation"),
28251 : .get = py_netr_LogonSamLogon_out_get_validation,
28252 : .set = py_netr_LogonSamLogon_out_set_validation,
28253 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
28254 : },
28255 : {
28256 : .name = discard_const_p(char, "out_authoritative"),
28257 : .get = py_netr_LogonSamLogon_out_get_authoritative,
28258 : .set = py_netr_LogonSamLogon_out_set_authoritative,
28259 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
28260 : },
28261 : {
28262 : .name = discard_const_p(char, "result"),
28263 : .get = py_netr_LogonSamLogon_get_result,
28264 : .set = py_netr_LogonSamLogon_set_result,
28265 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
28266 : },
28267 : { .name = NULL }
28268 : };
28269 :
28270 0 : static PyObject *py_netr_LogonSamLogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28271 : {
28272 0 : PyObject *self = pytalloc_new(struct netr_LogonSamLogon, type);
28273 0 : struct netr_LogonSamLogon *_self = (struct netr_LogonSamLogon *)pytalloc_get_ptr(self);
28274 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28275 0 : _self->in.logon = talloc_zero(mem_ctx, union netr_LogonLevel);
28276 0 : _self->out.validation = talloc_zero(mem_ctx, union netr_Validation);
28277 0 : _self->out.authoritative = talloc_zero(mem_ctx, uint8_t);
28278 0 : return self;
28279 : }
28280 :
28281 0 : static PyObject *py_netr_LogonSamLogon_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28282 : {
28283 :
28284 :
28285 0 : return PyLong_FromLong(2);
28286 : }
28287 :
28288 0 : static PyObject *py_netr_LogonSamLogon_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
28289 : {
28290 0 : const struct ndr_interface_call *call = NULL;
28291 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
28292 0 : PyObject *ret = NULL;
28293 0 : struct ndr_push *push = NULL;
28294 : DATA_BLOB blob;
28295 : enum ndr_err_code err;
28296 :
28297 0 : if (ndr_table_netlogon.num_calls < 3) {
28298 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogon_ndr_pack");
28299 0 : return NULL;
28300 : }
28301 0 : call = &ndr_table_netlogon.calls[2];
28302 :
28303 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28304 0 : if (push == NULL) {
28305 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28306 0 : return NULL;
28307 : }
28308 :
28309 0 : push->flags |= ndr_push_flags;
28310 :
28311 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28312 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28313 0 : TALLOC_FREE(push);
28314 0 : PyErr_SetNdrError(err);
28315 0 : return NULL;
28316 : }
28317 0 : blob = ndr_push_blob(push);
28318 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28319 0 : TALLOC_FREE(push);
28320 0 : return ret;
28321 : }
28322 :
28323 0 : static PyObject *py_netr_LogonSamLogon_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28324 : {
28325 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28326 0 : PyObject *bigendian_obj = NULL;
28327 0 : PyObject *ndr64_obj = NULL;
28328 0 : uint32_t ndr_push_flags = 0;
28329 :
28330 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28331 : discard_const_p(char *, kwnames),
28332 : &bigendian_obj,
28333 : &ndr64_obj)) {
28334 0 : return NULL;
28335 : }
28336 :
28337 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28338 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28339 : }
28340 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28341 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28342 : }
28343 :
28344 0 : return py_netr_LogonSamLogon_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28345 : }
28346 :
28347 0 : static PyObject *py_netr_LogonSamLogon_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28348 : {
28349 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28350 0 : PyObject *bigendian_obj = NULL;
28351 0 : PyObject *ndr64_obj = NULL;
28352 0 : uint32_t ndr_push_flags = 0;
28353 :
28354 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28355 : discard_const_p(char *, kwnames),
28356 : &bigendian_obj,
28357 : &ndr64_obj)) {
28358 0 : return NULL;
28359 : }
28360 :
28361 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28362 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28363 : }
28364 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28365 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28366 : }
28367 :
28368 0 : return py_netr_LogonSamLogon_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28369 : }
28370 :
28371 0 : static PyObject *py_netr_LogonSamLogon_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
28372 : {
28373 0 : const struct ndr_interface_call *call = NULL;
28374 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
28375 0 : struct ndr_pull *pull = NULL;
28376 : enum ndr_err_code err;
28377 :
28378 0 : if (ndr_table_netlogon.num_calls < 3) {
28379 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogon_ndr_unpack");
28380 0 : return NULL;
28381 : }
28382 0 : call = &ndr_table_netlogon.calls[2];
28383 :
28384 0 : pull = ndr_pull_init_blob(blob, object);
28385 0 : if (pull == NULL) {
28386 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28387 0 : return NULL;
28388 : }
28389 :
28390 0 : pull->flags |= ndr_pull_flags;
28391 :
28392 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28393 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28394 0 : TALLOC_FREE(pull);
28395 0 : PyErr_SetNdrError(err);
28396 0 : return NULL;
28397 : }
28398 0 : if (!allow_remaining) {
28399 : uint32_t highest_ofs;
28400 :
28401 0 : if (pull->offset > pull->relative_highest_offset) {
28402 0 : highest_ofs = pull->offset;
28403 : } else {
28404 0 : highest_ofs = pull->relative_highest_offset;
28405 : }
28406 0 : if (highest_ofs < pull->data_size) {
28407 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28408 : "not all bytes consumed ofs[%u] size[%u]",
28409 : highest_ofs, pull->data_size);
28410 0 : TALLOC_FREE(pull);
28411 0 : PyErr_SetNdrError(err);
28412 0 : return NULL;
28413 : }
28414 : }
28415 :
28416 0 : TALLOC_FREE(pull);
28417 0 : Py_RETURN_NONE;
28418 : }
28419 :
28420 0 : static PyObject *py_netr_LogonSamLogon_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28421 : {
28422 : DATA_BLOB blob;
28423 0 : Py_ssize_t blob_length = 0;
28424 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28425 0 : PyObject *bigendian_obj = NULL;
28426 0 : PyObject *ndr64_obj = NULL;
28427 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28428 0 : PyObject *allow_remaining_obj = NULL;
28429 0 : bool allow_remaining = false;
28430 :
28431 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28432 : discard_const_p(char *, kwnames),
28433 : &blob.data, &blob_length,
28434 : &bigendian_obj,
28435 : &ndr64_obj,
28436 : &allow_remaining_obj)) {
28437 0 : return NULL;
28438 : }
28439 0 : blob.length = blob_length;
28440 :
28441 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28442 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28443 : }
28444 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28445 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28446 : }
28447 :
28448 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28449 0 : allow_remaining = true;
28450 : }
28451 :
28452 0 : return py_netr_LogonSamLogon_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28453 : }
28454 :
28455 0 : static PyObject *py_netr_LogonSamLogon_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28456 : {
28457 : DATA_BLOB blob;
28458 0 : Py_ssize_t blob_length = 0;
28459 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28460 0 : PyObject *bigendian_obj = NULL;
28461 0 : PyObject *ndr64_obj = NULL;
28462 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28463 0 : PyObject *allow_remaining_obj = NULL;
28464 0 : bool allow_remaining = false;
28465 :
28466 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28467 : discard_const_p(char *, kwnames),
28468 : &blob.data, &blob_length,
28469 : &bigendian_obj,
28470 : &ndr64_obj,
28471 : &allow_remaining_obj)) {
28472 0 : return NULL;
28473 : }
28474 0 : blob.length = blob_length;
28475 :
28476 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28477 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28478 : }
28479 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28480 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28481 : }
28482 :
28483 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28484 0 : allow_remaining = true;
28485 : }
28486 :
28487 0 : return py_netr_LogonSamLogon_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28488 : }
28489 :
28490 0 : static PyObject *py_netr_LogonSamLogon_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
28491 : {
28492 0 : const struct ndr_interface_call *call = NULL;
28493 0 : struct netr_LogonSamLogon *object = (struct netr_LogonSamLogon *)pytalloc_get_ptr(py_obj);
28494 : PyObject *ret;
28495 : char *retstr;
28496 :
28497 0 : if (ndr_table_netlogon.num_calls < 3) {
28498 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogon_ndr_print");
28499 0 : return NULL;
28500 : }
28501 0 : call = &ndr_table_netlogon.calls[2];
28502 :
28503 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28504 0 : ret = PyUnicode_FromString(retstr);
28505 0 : TALLOC_FREE(retstr);
28506 :
28507 0 : return ret;
28508 : }
28509 :
28510 0 : static PyObject *py_netr_LogonSamLogon_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28511 : {
28512 0 : return py_netr_LogonSamLogon_ndr_print(py_obj, "netr_LogonSamLogon_in", NDR_IN);
28513 : }
28514 :
28515 0 : static PyObject *py_netr_LogonSamLogon_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28516 : {
28517 0 : return py_netr_LogonSamLogon_ndr_print(py_obj, "netr_LogonSamLogon_out", NDR_OUT);
28518 : }
28519 :
28520 : static PyMethodDef py_netr_LogonSamLogon_methods[] = {
28521 : { "opnum", (PyCFunction)py_netr_LogonSamLogon_ndr_opnum, METH_NOARGS|METH_CLASS,
28522 : "netlogon.netr_LogonSamLogon.opnum() -> 2 (0x02) " },
28523 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogon_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28524 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28525 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogon_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28526 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28527 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogon_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28528 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28529 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogon_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28530 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28531 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonSamLogon_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28532 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonSamLogon_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28533 : { NULL, NULL, 0, NULL }
28534 : };
28535 :
28536 :
28537 : static PyTypeObject netr_LogonSamLogon_Type = {
28538 : PyVarObject_HEAD_INIT(NULL, 0)
28539 : .tp_name = "netlogon.netr_LogonSamLogon",
28540 : .tp_getset = py_netr_LogonSamLogon_getsetters,
28541 : .tp_methods = py_netr_LogonSamLogon_methods,
28542 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28543 : .tp_new = py_netr_LogonSamLogon_new,
28544 : };
28545 :
28546 0 : static bool pack_py_netr_LogonSamLogon_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonSamLogon *r)
28547 : {
28548 : PyObject *py_server_name;
28549 : PyObject *py_computer_name;
28550 : PyObject *py_credential;
28551 : PyObject *py_return_authenticator;
28552 : PyObject *py_logon_level;
28553 : PyObject *py_logon;
28554 : PyObject *py_validation_level;
28555 0 : const char *kwnames[] = {
28556 : "server_name", "computer_name", "credential", "return_authenticator", "logon_level", "logon", "validation_level", NULL
28557 : };
28558 :
28559 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:netr_LogonSamLogon", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_logon_level, &py_logon, &py_validation_level)) {
28560 0 : return false;
28561 : }
28562 :
28563 0 : if (py_server_name == NULL) {
28564 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
28565 0 : return false;
28566 : }
28567 0 : if (py_server_name == Py_None) {
28568 0 : r->in.server_name = NULL;
28569 : } else {
28570 0 : r->in.server_name = NULL;
28571 : {
28572 : const char *test_str;
28573 : const char *talloc_str;
28574 0 : PyObject *unicode = NULL;
28575 0 : if (PyUnicode_Check(py_server_name)) {
28576 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
28577 0 : if (unicode == NULL) {
28578 0 : PyErr_NoMemory();
28579 0 : return false;
28580 : }
28581 0 : test_str = PyBytes_AS_STRING(unicode);
28582 0 : } else if (PyBytes_Check(py_server_name)) {
28583 0 : test_str = PyBytes_AS_STRING(py_server_name);
28584 : } else {
28585 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
28586 0 : return false;
28587 : }
28588 0 : talloc_str = talloc_strdup(r, test_str);
28589 0 : if (unicode != NULL) {
28590 0 : Py_DECREF(unicode);
28591 : }
28592 0 : if (talloc_str == NULL) {
28593 0 : PyErr_NoMemory();
28594 0 : return false;
28595 : }
28596 0 : r->in.server_name = talloc_str;
28597 : }
28598 : }
28599 0 : if (py_computer_name == NULL) {
28600 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
28601 0 : return false;
28602 : }
28603 0 : if (py_computer_name == Py_None) {
28604 0 : r->in.computer_name = NULL;
28605 : } else {
28606 0 : r->in.computer_name = NULL;
28607 : {
28608 : const char *test_str;
28609 : const char *talloc_str;
28610 0 : PyObject *unicode = NULL;
28611 0 : if (PyUnicode_Check(py_computer_name)) {
28612 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
28613 0 : if (unicode == NULL) {
28614 0 : PyErr_NoMemory();
28615 0 : return false;
28616 : }
28617 0 : test_str = PyBytes_AS_STRING(unicode);
28618 0 : } else if (PyBytes_Check(py_computer_name)) {
28619 0 : test_str = PyBytes_AS_STRING(py_computer_name);
28620 : } else {
28621 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
28622 0 : return false;
28623 : }
28624 0 : talloc_str = talloc_strdup(r, test_str);
28625 0 : if (unicode != NULL) {
28626 0 : Py_DECREF(unicode);
28627 : }
28628 0 : if (talloc_str == NULL) {
28629 0 : PyErr_NoMemory();
28630 0 : return false;
28631 : }
28632 0 : r->in.computer_name = talloc_str;
28633 : }
28634 : }
28635 0 : if (py_credential == NULL) {
28636 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
28637 0 : return false;
28638 : }
28639 0 : if (py_credential == Py_None) {
28640 0 : r->in.credential = NULL;
28641 : } else {
28642 0 : r->in.credential = NULL;
28643 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
28644 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
28645 0 : PyErr_NoMemory();
28646 0 : return false;
28647 : }
28648 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
28649 : }
28650 0 : if (py_return_authenticator == NULL) {
28651 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
28652 0 : return false;
28653 : }
28654 0 : if (py_return_authenticator == Py_None) {
28655 0 : r->in.return_authenticator = NULL;
28656 : } else {
28657 0 : r->in.return_authenticator = NULL;
28658 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
28659 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
28660 0 : PyErr_NoMemory();
28661 0 : return false;
28662 : }
28663 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
28664 : }
28665 0 : if (py_logon_level == NULL) {
28666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_level");
28667 0 : return false;
28668 : }
28669 : {
28670 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_level));
28671 0 : if (PyLong_Check(py_logon_level)) {
28672 : unsigned long long test_var;
28673 0 : test_var = PyLong_AsUnsignedLongLong(py_logon_level);
28674 0 : if (PyErr_Occurred() != NULL) {
28675 0 : return false;
28676 : }
28677 0 : if (test_var > uint_max) {
28678 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28679 : PyLong_Type.tp_name, uint_max, test_var);
28680 0 : return false;
28681 : }
28682 0 : r->in.logon_level = test_var;
28683 : } else {
28684 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28685 : PyLong_Type.tp_name);
28686 0 : return false;
28687 : }
28688 : }
28689 0 : if (py_logon == NULL) {
28690 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon");
28691 0 : return false;
28692 : }
28693 0 : r->in.logon = talloc_ptrtype(r, r->in.logon);
28694 0 : if (r->in.logon == NULL) {
28695 0 : PyErr_NoMemory();
28696 0 : return false;
28697 : }
28698 : {
28699 : union netr_LogonLevel *logon_switch_1;
28700 0 : logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel");
28701 0 : if (logon_switch_1 == NULL) {
28702 0 : return false;
28703 : }
28704 0 : r->in.logon = logon_switch_1;
28705 : }
28706 0 : if (py_validation_level == NULL) {
28707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.validation_level");
28708 0 : return false;
28709 : }
28710 : {
28711 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.validation_level));
28712 0 : if (PyLong_Check(py_validation_level)) {
28713 : unsigned long long test_var;
28714 0 : test_var = PyLong_AsUnsignedLongLong(py_validation_level);
28715 0 : if (PyErr_Occurred() != NULL) {
28716 0 : return false;
28717 : }
28718 0 : if (test_var > uint_max) {
28719 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28720 : PyLong_Type.tp_name, uint_max, test_var);
28721 0 : return false;
28722 : }
28723 0 : r->in.validation_level = test_var;
28724 : } else {
28725 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28726 : PyLong_Type.tp_name);
28727 0 : return false;
28728 : }
28729 : }
28730 0 : return true;
28731 : }
28732 :
28733 0 : static PyObject *unpack_py_netr_LogonSamLogon_args_out(struct netr_LogonSamLogon *r)
28734 : {
28735 : PyObject *result;
28736 : PyObject *py_return_authenticator;
28737 : PyObject *py_validation;
28738 : PyObject *py_authoritative;
28739 0 : result = PyTuple_New(3);
28740 0 : if (r->out.return_authenticator == NULL) {
28741 0 : py_return_authenticator = Py_None;
28742 0 : Py_INCREF(py_return_authenticator);
28743 : } else {
28744 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
28745 : }
28746 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
28747 0 : py_validation = pyrpc_import_union(&netr_Validation_Type, r->out.validation, r->in.validation_level, r->out.validation, "union netr_Validation");
28748 0 : if (py_validation == NULL) {
28749 0 : return NULL;
28750 : }
28751 0 : PyTuple_SetItem(result, 1, py_validation);
28752 0 : py_authoritative = PyLong_FromLong((uint16_t)*r->out.authoritative);
28753 0 : PyTuple_SetItem(result, 2, py_authoritative);
28754 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
28755 0 : PyErr_SetNTSTATUS(r->out.result);
28756 0 : return NULL;
28757 : }
28758 :
28759 0 : return result;
28760 : }
28761 :
28762 :
28763 0 : static PyObject *py_netr_LogonSamLogoff_in_get_server_name(PyObject *obj, void *closure)
28764 : {
28765 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj);
28766 : PyObject *py_server_name;
28767 0 : if (object->in.server_name == NULL) {
28768 0 : Py_RETURN_NONE;
28769 : }
28770 0 : if (object->in.server_name == NULL) {
28771 0 : py_server_name = Py_None;
28772 0 : Py_INCREF(py_server_name);
28773 : } else {
28774 0 : if (object->in.server_name == NULL) {
28775 0 : py_server_name = Py_None;
28776 0 : Py_INCREF(py_server_name);
28777 : } else {
28778 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
28779 : }
28780 : }
28781 0 : return py_server_name;
28782 : }
28783 :
28784 0 : static int py_netr_LogonSamLogoff_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
28785 : {
28786 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
28787 0 : if (value == NULL) {
28788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
28789 0 : return -1;
28790 : }
28791 0 : if (value == Py_None) {
28792 0 : object->in.server_name = NULL;
28793 : } else {
28794 0 : object->in.server_name = NULL;
28795 : {
28796 : const char *test_str;
28797 : const char *talloc_str;
28798 0 : PyObject *unicode = NULL;
28799 0 : if (PyUnicode_Check(value)) {
28800 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
28801 0 : if (unicode == NULL) {
28802 0 : PyErr_NoMemory();
28803 0 : return -1;
28804 : }
28805 0 : test_str = PyBytes_AS_STRING(unicode);
28806 0 : } else if (PyBytes_Check(value)) {
28807 0 : test_str = PyBytes_AS_STRING(value);
28808 : } else {
28809 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
28810 0 : return -1;
28811 : }
28812 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
28813 0 : if (unicode != NULL) {
28814 0 : Py_DECREF(unicode);
28815 : }
28816 0 : if (talloc_str == NULL) {
28817 0 : PyErr_NoMemory();
28818 0 : return -1;
28819 : }
28820 0 : object->in.server_name = talloc_str;
28821 : }
28822 : }
28823 0 : return 0;
28824 : }
28825 :
28826 0 : static PyObject *py_netr_LogonSamLogoff_in_get_computer_name(PyObject *obj, void *closure)
28827 : {
28828 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj);
28829 : PyObject *py_computer_name;
28830 0 : if (object->in.computer_name == NULL) {
28831 0 : Py_RETURN_NONE;
28832 : }
28833 0 : if (object->in.computer_name == NULL) {
28834 0 : py_computer_name = Py_None;
28835 0 : Py_INCREF(py_computer_name);
28836 : } else {
28837 0 : if (object->in.computer_name == NULL) {
28838 0 : py_computer_name = Py_None;
28839 0 : Py_INCREF(py_computer_name);
28840 : } else {
28841 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
28842 : }
28843 : }
28844 0 : return py_computer_name;
28845 : }
28846 :
28847 0 : static int py_netr_LogonSamLogoff_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
28848 : {
28849 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
28850 0 : if (value == NULL) {
28851 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
28852 0 : return -1;
28853 : }
28854 0 : if (value == Py_None) {
28855 0 : object->in.computer_name = NULL;
28856 : } else {
28857 0 : object->in.computer_name = NULL;
28858 : {
28859 : const char *test_str;
28860 : const char *talloc_str;
28861 0 : PyObject *unicode = NULL;
28862 0 : if (PyUnicode_Check(value)) {
28863 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
28864 0 : if (unicode == NULL) {
28865 0 : PyErr_NoMemory();
28866 0 : return -1;
28867 : }
28868 0 : test_str = PyBytes_AS_STRING(unicode);
28869 0 : } else if (PyBytes_Check(value)) {
28870 0 : test_str = PyBytes_AS_STRING(value);
28871 : } else {
28872 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
28873 0 : return -1;
28874 : }
28875 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
28876 0 : if (unicode != NULL) {
28877 0 : Py_DECREF(unicode);
28878 : }
28879 0 : if (talloc_str == NULL) {
28880 0 : PyErr_NoMemory();
28881 0 : return -1;
28882 : }
28883 0 : object->in.computer_name = talloc_str;
28884 : }
28885 : }
28886 0 : return 0;
28887 : }
28888 :
28889 0 : static PyObject *py_netr_LogonSamLogoff_in_get_credential(PyObject *obj, void *closure)
28890 : {
28891 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj);
28892 : PyObject *py_credential;
28893 0 : if (object->in.credential == NULL) {
28894 0 : Py_RETURN_NONE;
28895 : }
28896 0 : if (object->in.credential == NULL) {
28897 0 : py_credential = Py_None;
28898 0 : Py_INCREF(py_credential);
28899 : } else {
28900 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
28901 : }
28902 0 : return py_credential;
28903 : }
28904 :
28905 0 : static int py_netr_LogonSamLogoff_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
28906 : {
28907 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
28908 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
28909 0 : if (value == NULL) {
28910 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
28911 0 : return -1;
28912 : }
28913 0 : if (value == Py_None) {
28914 0 : object->in.credential = NULL;
28915 : } else {
28916 0 : object->in.credential = NULL;
28917 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
28918 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28919 0 : PyErr_NoMemory();
28920 0 : return -1;
28921 : }
28922 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
28923 : }
28924 0 : return 0;
28925 : }
28926 :
28927 0 : static PyObject *py_netr_LogonSamLogoff_in_get_return_authenticator(PyObject *obj, void *closure)
28928 : {
28929 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj);
28930 : PyObject *py_return_authenticator;
28931 0 : if (object->in.return_authenticator == NULL) {
28932 0 : Py_RETURN_NONE;
28933 : }
28934 0 : if (object->in.return_authenticator == NULL) {
28935 0 : py_return_authenticator = Py_None;
28936 0 : Py_INCREF(py_return_authenticator);
28937 : } else {
28938 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
28939 : }
28940 0 : return py_return_authenticator;
28941 : }
28942 :
28943 0 : static int py_netr_LogonSamLogoff_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
28944 : {
28945 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
28946 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
28947 0 : if (value == NULL) {
28948 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
28949 0 : return -1;
28950 : }
28951 0 : if (value == Py_None) {
28952 0 : object->in.return_authenticator = NULL;
28953 : } else {
28954 0 : object->in.return_authenticator = NULL;
28955 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
28956 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28957 0 : PyErr_NoMemory();
28958 0 : return -1;
28959 : }
28960 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
28961 : }
28962 0 : return 0;
28963 : }
28964 :
28965 0 : static PyObject *py_netr_LogonSamLogoff_out_get_return_authenticator(PyObject *obj, void *closure)
28966 : {
28967 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj);
28968 : PyObject *py_return_authenticator;
28969 0 : if (object->out.return_authenticator == NULL) {
28970 0 : Py_RETURN_NONE;
28971 : }
28972 0 : if (object->out.return_authenticator == NULL) {
28973 0 : py_return_authenticator = Py_None;
28974 0 : Py_INCREF(py_return_authenticator);
28975 : } else {
28976 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
28977 : }
28978 0 : return py_return_authenticator;
28979 : }
28980 :
28981 0 : static int py_netr_LogonSamLogoff_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
28982 : {
28983 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
28984 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
28985 0 : if (value == NULL) {
28986 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
28987 0 : return -1;
28988 : }
28989 0 : if (value == Py_None) {
28990 0 : object->out.return_authenticator = NULL;
28991 : } else {
28992 0 : object->out.return_authenticator = NULL;
28993 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
28994 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28995 0 : PyErr_NoMemory();
28996 0 : return -1;
28997 : }
28998 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
28999 : }
29000 0 : return 0;
29001 : }
29002 :
29003 0 : static PyObject *py_netr_LogonSamLogoff_in_get_logon_level(PyObject *obj, void *closure)
29004 : {
29005 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj);
29006 : PyObject *py_logon_level;
29007 0 : py_logon_level = PyLong_FromLong((uint16_t)object->in.logon_level);
29008 0 : return py_logon_level;
29009 : }
29010 :
29011 0 : static int py_netr_LogonSamLogoff_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure)
29012 : {
29013 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
29014 0 : if (value == NULL) {
29015 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_level");
29016 0 : return -1;
29017 : }
29018 : {
29019 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_level));
29020 0 : if (PyLong_Check(value)) {
29021 : unsigned long long test_var;
29022 0 : test_var = PyLong_AsUnsignedLongLong(value);
29023 0 : if (PyErr_Occurred() != NULL) {
29024 0 : return -1;
29025 : }
29026 0 : if (test_var > uint_max) {
29027 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29028 : PyLong_Type.tp_name, uint_max, test_var);
29029 0 : return -1;
29030 : }
29031 0 : object->in.logon_level = test_var;
29032 : } else {
29033 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29034 : PyLong_Type.tp_name);
29035 0 : return -1;
29036 : }
29037 : }
29038 0 : return 0;
29039 : }
29040 :
29041 0 : static PyObject *py_netr_LogonSamLogoff_in_get_logon(PyObject *obj, void *closure)
29042 : {
29043 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj);
29044 : PyObject *py_logon;
29045 0 : py_logon = pyrpc_import_union(&netr_LogonLevel_Type, pytalloc_get_mem_ctx(obj), object->in.logon_level, &object->in.logon, "union netr_LogonLevel");
29046 0 : if (py_logon == NULL) {
29047 0 : return NULL;
29048 : }
29049 0 : return py_logon;
29050 : }
29051 :
29052 0 : static int py_netr_LogonSamLogoff_in_set_logon(PyObject *py_obj, PyObject *value, void *closure)
29053 : {
29054 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
29055 0 : if (value == NULL) {
29056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon");
29057 0 : return -1;
29058 : }
29059 : {
29060 : union netr_LogonLevel *logon_switch_0;
29061 0 : logon_switch_0 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, pytalloc_get_mem_ctx(py_obj), object->in.logon_level, value, "union netr_LogonLevel");
29062 0 : if (logon_switch_0 == NULL) {
29063 0 : return -1;
29064 : }
29065 0 : object->in.logon = *logon_switch_0;
29066 : }
29067 0 : return 0;
29068 : }
29069 :
29070 0 : static PyObject *py_netr_LogonSamLogoff_get_result(PyObject *obj, void *closure)
29071 : {
29072 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(obj);
29073 : PyObject *py_result;
29074 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29075 0 : return py_result;
29076 : }
29077 :
29078 0 : static int py_netr_LogonSamLogoff_set_result(PyObject *py_obj, PyObject *value, void *closure)
29079 : {
29080 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
29081 0 : if (value == NULL) {
29082 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29083 0 : return -1;
29084 : }
29085 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29086 0 : return 0;
29087 : }
29088 :
29089 : static PyGetSetDef py_netr_LogonSamLogoff_getsetters[] = {
29090 : {
29091 : .name = discard_const_p(char, "in_server_name"),
29092 : .get = py_netr_LogonSamLogoff_in_get_server_name,
29093 : .set = py_netr_LogonSamLogoff_in_set_server_name,
29094 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29095 : },
29096 : {
29097 : .name = discard_const_p(char, "in_computer_name"),
29098 : .get = py_netr_LogonSamLogoff_in_get_computer_name,
29099 : .set = py_netr_LogonSamLogoff_in_set_computer_name,
29100 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29101 : },
29102 : {
29103 : .name = discard_const_p(char, "in_credential"),
29104 : .get = py_netr_LogonSamLogoff_in_get_credential,
29105 : .set = py_netr_LogonSamLogoff_in_set_credential,
29106 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
29107 : },
29108 : {
29109 : .name = discard_const_p(char, "in_return_authenticator"),
29110 : .get = py_netr_LogonSamLogoff_in_get_return_authenticator,
29111 : .set = py_netr_LogonSamLogoff_in_set_return_authenticator,
29112 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
29113 : },
29114 : {
29115 : .name = discard_const_p(char, "out_return_authenticator"),
29116 : .get = py_netr_LogonSamLogoff_out_get_return_authenticator,
29117 : .set = py_netr_LogonSamLogoff_out_set_return_authenticator,
29118 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
29119 : },
29120 : {
29121 : .name = discard_const_p(char, "in_logon_level"),
29122 : .get = py_netr_LogonSamLogoff_in_get_logon_level,
29123 : .set = py_netr_LogonSamLogoff_in_set_logon_level,
29124 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonInfoClass")
29125 : },
29126 : {
29127 : .name = discard_const_p(char, "in_logon"),
29128 : .get = py_netr_LogonSamLogoff_in_get_logon,
29129 : .set = py_netr_LogonSamLogoff_in_set_logon,
29130 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonLevel")
29131 : },
29132 : {
29133 : .name = discard_const_p(char, "result"),
29134 : .get = py_netr_LogonSamLogoff_get_result,
29135 : .set = py_netr_LogonSamLogoff_set_result,
29136 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29137 : },
29138 : { .name = NULL }
29139 : };
29140 :
29141 0 : static PyObject *py_netr_LogonSamLogoff_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29142 : {
29143 0 : PyObject *self = pytalloc_new(struct netr_LogonSamLogoff, type);
29144 0 : return self;
29145 : }
29146 :
29147 0 : static PyObject *py_netr_LogonSamLogoff_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29148 : {
29149 :
29150 :
29151 0 : return PyLong_FromLong(3);
29152 : }
29153 :
29154 0 : static PyObject *py_netr_LogonSamLogoff_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
29155 : {
29156 0 : const struct ndr_interface_call *call = NULL;
29157 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
29158 0 : PyObject *ret = NULL;
29159 0 : struct ndr_push *push = NULL;
29160 : DATA_BLOB blob;
29161 : enum ndr_err_code err;
29162 :
29163 0 : if (ndr_table_netlogon.num_calls < 4) {
29164 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogoff_ndr_pack");
29165 0 : return NULL;
29166 : }
29167 0 : call = &ndr_table_netlogon.calls[3];
29168 :
29169 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29170 0 : if (push == NULL) {
29171 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29172 0 : return NULL;
29173 : }
29174 :
29175 0 : push->flags |= ndr_push_flags;
29176 :
29177 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29178 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29179 0 : TALLOC_FREE(push);
29180 0 : PyErr_SetNdrError(err);
29181 0 : return NULL;
29182 : }
29183 0 : blob = ndr_push_blob(push);
29184 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29185 0 : TALLOC_FREE(push);
29186 0 : return ret;
29187 : }
29188 :
29189 0 : static PyObject *py_netr_LogonSamLogoff_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29190 : {
29191 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29192 0 : PyObject *bigendian_obj = NULL;
29193 0 : PyObject *ndr64_obj = NULL;
29194 0 : uint32_t ndr_push_flags = 0;
29195 :
29196 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29197 : discard_const_p(char *, kwnames),
29198 : &bigendian_obj,
29199 : &ndr64_obj)) {
29200 0 : return NULL;
29201 : }
29202 :
29203 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29204 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29205 : }
29206 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29207 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29208 : }
29209 :
29210 0 : return py_netr_LogonSamLogoff_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29211 : }
29212 :
29213 0 : static PyObject *py_netr_LogonSamLogoff_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29214 : {
29215 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29216 0 : PyObject *bigendian_obj = NULL;
29217 0 : PyObject *ndr64_obj = NULL;
29218 0 : uint32_t ndr_push_flags = 0;
29219 :
29220 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29221 : discard_const_p(char *, kwnames),
29222 : &bigendian_obj,
29223 : &ndr64_obj)) {
29224 0 : return NULL;
29225 : }
29226 :
29227 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29228 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29229 : }
29230 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29231 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29232 : }
29233 :
29234 0 : return py_netr_LogonSamLogoff_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29235 : }
29236 :
29237 0 : static PyObject *py_netr_LogonSamLogoff_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
29238 : {
29239 0 : const struct ndr_interface_call *call = NULL;
29240 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
29241 0 : struct ndr_pull *pull = NULL;
29242 : enum ndr_err_code err;
29243 :
29244 0 : if (ndr_table_netlogon.num_calls < 4) {
29245 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogoff_ndr_unpack");
29246 0 : return NULL;
29247 : }
29248 0 : call = &ndr_table_netlogon.calls[3];
29249 :
29250 0 : pull = ndr_pull_init_blob(blob, object);
29251 0 : if (pull == NULL) {
29252 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29253 0 : return NULL;
29254 : }
29255 :
29256 0 : pull->flags |= ndr_pull_flags;
29257 :
29258 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29259 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29260 0 : TALLOC_FREE(pull);
29261 0 : PyErr_SetNdrError(err);
29262 0 : return NULL;
29263 : }
29264 0 : if (!allow_remaining) {
29265 : uint32_t highest_ofs;
29266 :
29267 0 : if (pull->offset > pull->relative_highest_offset) {
29268 0 : highest_ofs = pull->offset;
29269 : } else {
29270 0 : highest_ofs = pull->relative_highest_offset;
29271 : }
29272 0 : if (highest_ofs < pull->data_size) {
29273 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29274 : "not all bytes consumed ofs[%u] size[%u]",
29275 : highest_ofs, pull->data_size);
29276 0 : TALLOC_FREE(pull);
29277 0 : PyErr_SetNdrError(err);
29278 0 : return NULL;
29279 : }
29280 : }
29281 :
29282 0 : TALLOC_FREE(pull);
29283 0 : Py_RETURN_NONE;
29284 : }
29285 :
29286 0 : static PyObject *py_netr_LogonSamLogoff_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29287 : {
29288 : DATA_BLOB blob;
29289 0 : Py_ssize_t blob_length = 0;
29290 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29291 0 : PyObject *bigendian_obj = NULL;
29292 0 : PyObject *ndr64_obj = NULL;
29293 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29294 0 : PyObject *allow_remaining_obj = NULL;
29295 0 : bool allow_remaining = false;
29296 :
29297 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29298 : discard_const_p(char *, kwnames),
29299 : &blob.data, &blob_length,
29300 : &bigendian_obj,
29301 : &ndr64_obj,
29302 : &allow_remaining_obj)) {
29303 0 : return NULL;
29304 : }
29305 0 : blob.length = blob_length;
29306 :
29307 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29308 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29309 : }
29310 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29311 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29312 : }
29313 :
29314 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29315 0 : allow_remaining = true;
29316 : }
29317 :
29318 0 : return py_netr_LogonSamLogoff_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29319 : }
29320 :
29321 0 : static PyObject *py_netr_LogonSamLogoff_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29322 : {
29323 : DATA_BLOB blob;
29324 0 : Py_ssize_t blob_length = 0;
29325 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29326 0 : PyObject *bigendian_obj = NULL;
29327 0 : PyObject *ndr64_obj = NULL;
29328 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29329 0 : PyObject *allow_remaining_obj = NULL;
29330 0 : bool allow_remaining = false;
29331 :
29332 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29333 : discard_const_p(char *, kwnames),
29334 : &blob.data, &blob_length,
29335 : &bigendian_obj,
29336 : &ndr64_obj,
29337 : &allow_remaining_obj)) {
29338 0 : return NULL;
29339 : }
29340 0 : blob.length = blob_length;
29341 :
29342 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29343 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29344 : }
29345 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29346 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29347 : }
29348 :
29349 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29350 0 : allow_remaining = true;
29351 : }
29352 :
29353 0 : return py_netr_LogonSamLogoff_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29354 : }
29355 :
29356 0 : static PyObject *py_netr_LogonSamLogoff_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
29357 : {
29358 0 : const struct ndr_interface_call *call = NULL;
29359 0 : struct netr_LogonSamLogoff *object = (struct netr_LogonSamLogoff *)pytalloc_get_ptr(py_obj);
29360 : PyObject *ret;
29361 : char *retstr;
29362 :
29363 0 : if (ndr_table_netlogon.num_calls < 4) {
29364 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogoff_ndr_print");
29365 0 : return NULL;
29366 : }
29367 0 : call = &ndr_table_netlogon.calls[3];
29368 :
29369 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29370 0 : ret = PyUnicode_FromString(retstr);
29371 0 : TALLOC_FREE(retstr);
29372 :
29373 0 : return ret;
29374 : }
29375 :
29376 0 : static PyObject *py_netr_LogonSamLogoff_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29377 : {
29378 0 : return py_netr_LogonSamLogoff_ndr_print(py_obj, "netr_LogonSamLogoff_in", NDR_IN);
29379 : }
29380 :
29381 0 : static PyObject *py_netr_LogonSamLogoff_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29382 : {
29383 0 : return py_netr_LogonSamLogoff_ndr_print(py_obj, "netr_LogonSamLogoff_out", NDR_OUT);
29384 : }
29385 :
29386 : static PyMethodDef py_netr_LogonSamLogoff_methods[] = {
29387 : { "opnum", (PyCFunction)py_netr_LogonSamLogoff_ndr_opnum, METH_NOARGS|METH_CLASS,
29388 : "netlogon.netr_LogonSamLogoff.opnum() -> 3 (0x03) " },
29389 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogoff_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29390 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29391 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogoff_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29392 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29393 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogoff_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29394 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29395 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogoff_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29396 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29397 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonSamLogoff_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29398 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonSamLogoff_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29399 : { NULL, NULL, 0, NULL }
29400 : };
29401 :
29402 :
29403 : static PyTypeObject netr_LogonSamLogoff_Type = {
29404 : PyVarObject_HEAD_INIT(NULL, 0)
29405 : .tp_name = "netlogon.netr_LogonSamLogoff",
29406 : .tp_getset = py_netr_LogonSamLogoff_getsetters,
29407 : .tp_methods = py_netr_LogonSamLogoff_methods,
29408 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29409 : .tp_new = py_netr_LogonSamLogoff_new,
29410 : };
29411 :
29412 0 : static bool pack_py_netr_LogonSamLogoff_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonSamLogoff *r)
29413 : {
29414 : PyObject *py_server_name;
29415 : PyObject *py_computer_name;
29416 : PyObject *py_credential;
29417 : PyObject *py_return_authenticator;
29418 : PyObject *py_logon_level;
29419 : PyObject *py_logon;
29420 0 : const char *kwnames[] = {
29421 : "server_name", "computer_name", "credential", "return_authenticator", "logon_level", "logon", NULL
29422 : };
29423 :
29424 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_LogonSamLogoff", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_logon_level, &py_logon)) {
29425 0 : return false;
29426 : }
29427 :
29428 0 : if (py_server_name == NULL) {
29429 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
29430 0 : return false;
29431 : }
29432 0 : if (py_server_name == Py_None) {
29433 0 : r->in.server_name = NULL;
29434 : } else {
29435 0 : r->in.server_name = NULL;
29436 : {
29437 : const char *test_str;
29438 : const char *talloc_str;
29439 0 : PyObject *unicode = NULL;
29440 0 : if (PyUnicode_Check(py_server_name)) {
29441 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
29442 0 : if (unicode == NULL) {
29443 0 : PyErr_NoMemory();
29444 0 : return false;
29445 : }
29446 0 : test_str = PyBytes_AS_STRING(unicode);
29447 0 : } else if (PyBytes_Check(py_server_name)) {
29448 0 : test_str = PyBytes_AS_STRING(py_server_name);
29449 : } else {
29450 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
29451 0 : return false;
29452 : }
29453 0 : talloc_str = talloc_strdup(r, test_str);
29454 0 : if (unicode != NULL) {
29455 0 : Py_DECREF(unicode);
29456 : }
29457 0 : if (talloc_str == NULL) {
29458 0 : PyErr_NoMemory();
29459 0 : return false;
29460 : }
29461 0 : r->in.server_name = talloc_str;
29462 : }
29463 : }
29464 0 : if (py_computer_name == NULL) {
29465 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
29466 0 : return false;
29467 : }
29468 0 : if (py_computer_name == Py_None) {
29469 0 : r->in.computer_name = NULL;
29470 : } else {
29471 0 : r->in.computer_name = NULL;
29472 : {
29473 : const char *test_str;
29474 : const char *talloc_str;
29475 0 : PyObject *unicode = NULL;
29476 0 : if (PyUnicode_Check(py_computer_name)) {
29477 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
29478 0 : if (unicode == NULL) {
29479 0 : PyErr_NoMemory();
29480 0 : return false;
29481 : }
29482 0 : test_str = PyBytes_AS_STRING(unicode);
29483 0 : } else if (PyBytes_Check(py_computer_name)) {
29484 0 : test_str = PyBytes_AS_STRING(py_computer_name);
29485 : } else {
29486 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
29487 0 : return false;
29488 : }
29489 0 : talloc_str = talloc_strdup(r, test_str);
29490 0 : if (unicode != NULL) {
29491 0 : Py_DECREF(unicode);
29492 : }
29493 0 : if (talloc_str == NULL) {
29494 0 : PyErr_NoMemory();
29495 0 : return false;
29496 : }
29497 0 : r->in.computer_name = talloc_str;
29498 : }
29499 : }
29500 0 : if (py_credential == NULL) {
29501 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
29502 0 : return false;
29503 : }
29504 0 : if (py_credential == Py_None) {
29505 0 : r->in.credential = NULL;
29506 : } else {
29507 0 : r->in.credential = NULL;
29508 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
29509 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
29510 0 : PyErr_NoMemory();
29511 0 : return false;
29512 : }
29513 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
29514 : }
29515 0 : if (py_return_authenticator == NULL) {
29516 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
29517 0 : return false;
29518 : }
29519 0 : if (py_return_authenticator == Py_None) {
29520 0 : r->in.return_authenticator = NULL;
29521 : } else {
29522 0 : r->in.return_authenticator = NULL;
29523 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
29524 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
29525 0 : PyErr_NoMemory();
29526 0 : return false;
29527 : }
29528 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
29529 : }
29530 0 : if (py_logon_level == NULL) {
29531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_level");
29532 0 : return false;
29533 : }
29534 : {
29535 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_level));
29536 0 : if (PyLong_Check(py_logon_level)) {
29537 : unsigned long long test_var;
29538 0 : test_var = PyLong_AsUnsignedLongLong(py_logon_level);
29539 0 : if (PyErr_Occurred() != NULL) {
29540 0 : return false;
29541 : }
29542 0 : if (test_var > uint_max) {
29543 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29544 : PyLong_Type.tp_name, uint_max, test_var);
29545 0 : return false;
29546 : }
29547 0 : r->in.logon_level = test_var;
29548 : } else {
29549 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29550 : PyLong_Type.tp_name);
29551 0 : return false;
29552 : }
29553 : }
29554 0 : if (py_logon == NULL) {
29555 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon");
29556 0 : return false;
29557 : }
29558 : {
29559 : union netr_LogonLevel *logon_switch_0;
29560 0 : logon_switch_0 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel");
29561 0 : if (logon_switch_0 == NULL) {
29562 0 : return false;
29563 : }
29564 0 : r->in.logon = *logon_switch_0;
29565 : }
29566 0 : return true;
29567 : }
29568 :
29569 0 : static PyObject *unpack_py_netr_LogonSamLogoff_args_out(struct netr_LogonSamLogoff *r)
29570 : {
29571 : PyObject *result;
29572 : PyObject *py_return_authenticator;
29573 0 : if (r->out.return_authenticator == NULL) {
29574 0 : py_return_authenticator = Py_None;
29575 0 : Py_INCREF(py_return_authenticator);
29576 : } else {
29577 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
29578 : }
29579 0 : result = py_return_authenticator;
29580 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
29581 0 : PyErr_SetNTSTATUS(r->out.result);
29582 0 : return NULL;
29583 : }
29584 :
29585 0 : return result;
29586 : }
29587 :
29588 :
29589 0 : static PyObject *py_netr_ServerReqChallenge_in_get_server_name(PyObject *obj, void *closure)
29590 : {
29591 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj);
29592 : PyObject *py_server_name;
29593 0 : if (object->in.server_name == NULL) {
29594 0 : Py_RETURN_NONE;
29595 : }
29596 0 : if (object->in.server_name == NULL) {
29597 0 : py_server_name = Py_None;
29598 0 : Py_INCREF(py_server_name);
29599 : } else {
29600 0 : if (object->in.server_name == NULL) {
29601 0 : py_server_name = Py_None;
29602 0 : Py_INCREF(py_server_name);
29603 : } else {
29604 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
29605 : }
29606 : }
29607 0 : return py_server_name;
29608 : }
29609 :
29610 0 : static int py_netr_ServerReqChallenge_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
29611 : {
29612 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj);
29613 0 : if (value == NULL) {
29614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
29615 0 : return -1;
29616 : }
29617 0 : if (value == Py_None) {
29618 0 : object->in.server_name = NULL;
29619 : } else {
29620 0 : object->in.server_name = NULL;
29621 : {
29622 : const char *test_str;
29623 : const char *talloc_str;
29624 0 : PyObject *unicode = NULL;
29625 0 : if (PyUnicode_Check(value)) {
29626 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
29627 0 : if (unicode == NULL) {
29628 0 : PyErr_NoMemory();
29629 0 : return -1;
29630 : }
29631 0 : test_str = PyBytes_AS_STRING(unicode);
29632 0 : } else if (PyBytes_Check(value)) {
29633 0 : test_str = PyBytes_AS_STRING(value);
29634 : } else {
29635 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
29636 0 : return -1;
29637 : }
29638 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
29639 0 : if (unicode != NULL) {
29640 0 : Py_DECREF(unicode);
29641 : }
29642 0 : if (talloc_str == NULL) {
29643 0 : PyErr_NoMemory();
29644 0 : return -1;
29645 : }
29646 0 : object->in.server_name = talloc_str;
29647 : }
29648 : }
29649 0 : return 0;
29650 : }
29651 :
29652 0 : static PyObject *py_netr_ServerReqChallenge_in_get_computer_name(PyObject *obj, void *closure)
29653 : {
29654 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj);
29655 : PyObject *py_computer_name;
29656 0 : if (object->in.computer_name == NULL) {
29657 0 : Py_RETURN_NONE;
29658 : }
29659 0 : if (object->in.computer_name == NULL) {
29660 0 : py_computer_name = Py_None;
29661 0 : Py_INCREF(py_computer_name);
29662 : } else {
29663 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
29664 : }
29665 0 : return py_computer_name;
29666 : }
29667 :
29668 0 : static int py_netr_ServerReqChallenge_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
29669 : {
29670 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj);
29671 0 : if (value == NULL) {
29672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
29673 0 : return -1;
29674 : }
29675 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
29676 0 : if (object->in.computer_name == NULL) {
29677 0 : PyErr_NoMemory();
29678 0 : return -1;
29679 : }
29680 : {
29681 : const char *test_str;
29682 : const char *talloc_str;
29683 0 : PyObject *unicode = NULL;
29684 0 : if (PyUnicode_Check(value)) {
29685 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
29686 0 : if (unicode == NULL) {
29687 0 : PyErr_NoMemory();
29688 0 : return -1;
29689 : }
29690 0 : test_str = PyBytes_AS_STRING(unicode);
29691 0 : } else if (PyBytes_Check(value)) {
29692 0 : test_str = PyBytes_AS_STRING(value);
29693 : } else {
29694 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
29695 0 : return -1;
29696 : }
29697 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
29698 0 : if (unicode != NULL) {
29699 0 : Py_DECREF(unicode);
29700 : }
29701 0 : if (talloc_str == NULL) {
29702 0 : PyErr_NoMemory();
29703 0 : return -1;
29704 : }
29705 0 : object->in.computer_name = talloc_str;
29706 : }
29707 0 : return 0;
29708 : }
29709 :
29710 0 : static PyObject *py_netr_ServerReqChallenge_in_get_credentials(PyObject *obj, void *closure)
29711 : {
29712 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj);
29713 : PyObject *py_credentials;
29714 0 : if (object->in.credentials == NULL) {
29715 0 : Py_RETURN_NONE;
29716 : }
29717 0 : py_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->in.credentials, object->in.credentials);
29718 0 : return py_credentials;
29719 : }
29720 :
29721 0 : static int py_netr_ServerReqChallenge_in_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
29722 : {
29723 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj);
29724 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credentials));
29725 0 : if (value == NULL) {
29726 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credentials");
29727 0 : return -1;
29728 : }
29729 0 : object->in.credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credentials);
29730 0 : if (object->in.credentials == NULL) {
29731 0 : PyErr_NoMemory();
29732 0 : return -1;
29733 : }
29734 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
29735 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29736 0 : PyErr_NoMemory();
29737 0 : return -1;
29738 : }
29739 0 : object->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(value);
29740 0 : return 0;
29741 : }
29742 :
29743 0 : static PyObject *py_netr_ServerReqChallenge_out_get_return_credentials(PyObject *obj, void *closure)
29744 : {
29745 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj);
29746 : PyObject *py_return_credentials;
29747 0 : if (object->out.return_credentials == NULL) {
29748 0 : Py_RETURN_NONE;
29749 : }
29750 0 : py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->out.return_credentials, object->out.return_credentials);
29751 0 : return py_return_credentials;
29752 : }
29753 :
29754 0 : static int py_netr_ServerReqChallenge_out_set_return_credentials(PyObject *py_obj, PyObject *value, void *closure)
29755 : {
29756 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj);
29757 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_credentials));
29758 0 : if (value == NULL) {
29759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_credentials");
29760 0 : return -1;
29761 : }
29762 0 : object->out.return_credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_credentials);
29763 0 : if (object->out.return_credentials == NULL) {
29764 0 : PyErr_NoMemory();
29765 0 : return -1;
29766 : }
29767 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
29768 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29769 0 : PyErr_NoMemory();
29770 0 : return -1;
29771 : }
29772 0 : object->out.return_credentials = (struct netr_Credential *)pytalloc_get_ptr(value);
29773 0 : return 0;
29774 : }
29775 :
29776 0 : static PyObject *py_netr_ServerReqChallenge_get_result(PyObject *obj, void *closure)
29777 : {
29778 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(obj);
29779 : PyObject *py_result;
29780 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29781 0 : return py_result;
29782 : }
29783 :
29784 0 : static int py_netr_ServerReqChallenge_set_result(PyObject *py_obj, PyObject *value, void *closure)
29785 : {
29786 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj);
29787 0 : if (value == NULL) {
29788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29789 0 : return -1;
29790 : }
29791 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29792 0 : return 0;
29793 : }
29794 :
29795 : static PyGetSetDef py_netr_ServerReqChallenge_getsetters[] = {
29796 : {
29797 : .name = discard_const_p(char, "in_server_name"),
29798 : .get = py_netr_ServerReqChallenge_in_get_server_name,
29799 : .set = py_netr_ServerReqChallenge_in_set_server_name,
29800 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29801 : },
29802 : {
29803 : .name = discard_const_p(char, "in_computer_name"),
29804 : .get = py_netr_ServerReqChallenge_in_get_computer_name,
29805 : .set = py_netr_ServerReqChallenge_in_set_computer_name,
29806 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29807 : },
29808 : {
29809 : .name = discard_const_p(char, "in_credentials"),
29810 : .get = py_netr_ServerReqChallenge_in_get_credentials,
29811 : .set = py_netr_ServerReqChallenge_in_set_credentials,
29812 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
29813 : },
29814 : {
29815 : .name = discard_const_p(char, "out_return_credentials"),
29816 : .get = py_netr_ServerReqChallenge_out_get_return_credentials,
29817 : .set = py_netr_ServerReqChallenge_out_set_return_credentials,
29818 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
29819 : },
29820 : {
29821 : .name = discard_const_p(char, "result"),
29822 : .get = py_netr_ServerReqChallenge_get_result,
29823 : .set = py_netr_ServerReqChallenge_set_result,
29824 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29825 : },
29826 : { .name = NULL }
29827 : };
29828 :
29829 0 : static PyObject *py_netr_ServerReqChallenge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29830 : {
29831 0 : PyObject *self = pytalloc_new(struct netr_ServerReqChallenge, type);
29832 0 : struct netr_ServerReqChallenge *_self = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(self);
29833 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29834 0 : _self->in.credentials = talloc_zero(mem_ctx, struct netr_Credential);
29835 0 : _self->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
29836 0 : return self;
29837 : }
29838 :
29839 0 : static PyObject *py_netr_ServerReqChallenge_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29840 : {
29841 :
29842 :
29843 0 : return PyLong_FromLong(4);
29844 : }
29845 :
29846 0 : static PyObject *py_netr_ServerReqChallenge_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
29847 : {
29848 0 : const struct ndr_interface_call *call = NULL;
29849 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj);
29850 0 : PyObject *ret = NULL;
29851 0 : struct ndr_push *push = NULL;
29852 : DATA_BLOB blob;
29853 : enum ndr_err_code err;
29854 :
29855 0 : if (ndr_table_netlogon.num_calls < 5) {
29856 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerReqChallenge_ndr_pack");
29857 0 : return NULL;
29858 : }
29859 0 : call = &ndr_table_netlogon.calls[4];
29860 :
29861 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29862 0 : if (push == NULL) {
29863 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29864 0 : return NULL;
29865 : }
29866 :
29867 0 : push->flags |= ndr_push_flags;
29868 :
29869 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29870 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29871 0 : TALLOC_FREE(push);
29872 0 : PyErr_SetNdrError(err);
29873 0 : return NULL;
29874 : }
29875 0 : blob = ndr_push_blob(push);
29876 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29877 0 : TALLOC_FREE(push);
29878 0 : return ret;
29879 : }
29880 :
29881 0 : static PyObject *py_netr_ServerReqChallenge_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29882 : {
29883 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29884 0 : PyObject *bigendian_obj = NULL;
29885 0 : PyObject *ndr64_obj = NULL;
29886 0 : uint32_t ndr_push_flags = 0;
29887 :
29888 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29889 : discard_const_p(char *, kwnames),
29890 : &bigendian_obj,
29891 : &ndr64_obj)) {
29892 0 : return NULL;
29893 : }
29894 :
29895 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29896 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29897 : }
29898 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29899 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29900 : }
29901 :
29902 0 : return py_netr_ServerReqChallenge_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29903 : }
29904 :
29905 0 : static PyObject *py_netr_ServerReqChallenge_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29906 : {
29907 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29908 0 : PyObject *bigendian_obj = NULL;
29909 0 : PyObject *ndr64_obj = NULL;
29910 0 : uint32_t ndr_push_flags = 0;
29911 :
29912 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29913 : discard_const_p(char *, kwnames),
29914 : &bigendian_obj,
29915 : &ndr64_obj)) {
29916 0 : return NULL;
29917 : }
29918 :
29919 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29920 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29921 : }
29922 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29923 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29924 : }
29925 :
29926 0 : return py_netr_ServerReqChallenge_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29927 : }
29928 :
29929 0 : static PyObject *py_netr_ServerReqChallenge_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
29930 : {
29931 0 : const struct ndr_interface_call *call = NULL;
29932 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj);
29933 0 : struct ndr_pull *pull = NULL;
29934 : enum ndr_err_code err;
29935 :
29936 0 : if (ndr_table_netlogon.num_calls < 5) {
29937 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerReqChallenge_ndr_unpack");
29938 0 : return NULL;
29939 : }
29940 0 : call = &ndr_table_netlogon.calls[4];
29941 :
29942 0 : pull = ndr_pull_init_blob(blob, object);
29943 0 : if (pull == NULL) {
29944 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29945 0 : return NULL;
29946 : }
29947 :
29948 0 : pull->flags |= ndr_pull_flags;
29949 :
29950 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29951 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29952 0 : TALLOC_FREE(pull);
29953 0 : PyErr_SetNdrError(err);
29954 0 : return NULL;
29955 : }
29956 0 : if (!allow_remaining) {
29957 : uint32_t highest_ofs;
29958 :
29959 0 : if (pull->offset > pull->relative_highest_offset) {
29960 0 : highest_ofs = pull->offset;
29961 : } else {
29962 0 : highest_ofs = pull->relative_highest_offset;
29963 : }
29964 0 : if (highest_ofs < pull->data_size) {
29965 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29966 : "not all bytes consumed ofs[%u] size[%u]",
29967 : highest_ofs, pull->data_size);
29968 0 : TALLOC_FREE(pull);
29969 0 : PyErr_SetNdrError(err);
29970 0 : return NULL;
29971 : }
29972 : }
29973 :
29974 0 : TALLOC_FREE(pull);
29975 0 : Py_RETURN_NONE;
29976 : }
29977 :
29978 0 : static PyObject *py_netr_ServerReqChallenge_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29979 : {
29980 : DATA_BLOB blob;
29981 0 : Py_ssize_t blob_length = 0;
29982 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29983 0 : PyObject *bigendian_obj = NULL;
29984 0 : PyObject *ndr64_obj = NULL;
29985 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29986 0 : PyObject *allow_remaining_obj = NULL;
29987 0 : bool allow_remaining = false;
29988 :
29989 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29990 : discard_const_p(char *, kwnames),
29991 : &blob.data, &blob_length,
29992 : &bigendian_obj,
29993 : &ndr64_obj,
29994 : &allow_remaining_obj)) {
29995 0 : return NULL;
29996 : }
29997 0 : blob.length = blob_length;
29998 :
29999 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30000 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30001 : }
30002 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30003 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30004 : }
30005 :
30006 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30007 0 : allow_remaining = true;
30008 : }
30009 :
30010 0 : return py_netr_ServerReqChallenge_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30011 : }
30012 :
30013 0 : static PyObject *py_netr_ServerReqChallenge_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30014 : {
30015 : DATA_BLOB blob;
30016 0 : Py_ssize_t blob_length = 0;
30017 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30018 0 : PyObject *bigendian_obj = NULL;
30019 0 : PyObject *ndr64_obj = NULL;
30020 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30021 0 : PyObject *allow_remaining_obj = NULL;
30022 0 : bool allow_remaining = false;
30023 :
30024 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30025 : discard_const_p(char *, kwnames),
30026 : &blob.data, &blob_length,
30027 : &bigendian_obj,
30028 : &ndr64_obj,
30029 : &allow_remaining_obj)) {
30030 0 : return NULL;
30031 : }
30032 0 : blob.length = blob_length;
30033 :
30034 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30035 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30036 : }
30037 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30038 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30039 : }
30040 :
30041 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30042 0 : allow_remaining = true;
30043 : }
30044 :
30045 0 : return py_netr_ServerReqChallenge_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30046 : }
30047 :
30048 0 : static PyObject *py_netr_ServerReqChallenge_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
30049 : {
30050 0 : const struct ndr_interface_call *call = NULL;
30051 0 : struct netr_ServerReqChallenge *object = (struct netr_ServerReqChallenge *)pytalloc_get_ptr(py_obj);
30052 : PyObject *ret;
30053 : char *retstr;
30054 :
30055 0 : if (ndr_table_netlogon.num_calls < 5) {
30056 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerReqChallenge_ndr_print");
30057 0 : return NULL;
30058 : }
30059 0 : call = &ndr_table_netlogon.calls[4];
30060 :
30061 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30062 0 : ret = PyUnicode_FromString(retstr);
30063 0 : TALLOC_FREE(retstr);
30064 :
30065 0 : return ret;
30066 : }
30067 :
30068 0 : static PyObject *py_netr_ServerReqChallenge_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30069 : {
30070 0 : return py_netr_ServerReqChallenge_ndr_print(py_obj, "netr_ServerReqChallenge_in", NDR_IN);
30071 : }
30072 :
30073 0 : static PyObject *py_netr_ServerReqChallenge_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30074 : {
30075 0 : return py_netr_ServerReqChallenge_ndr_print(py_obj, "netr_ServerReqChallenge_out", NDR_OUT);
30076 : }
30077 :
30078 : static PyMethodDef py_netr_ServerReqChallenge_methods[] = {
30079 : { "opnum", (PyCFunction)py_netr_ServerReqChallenge_ndr_opnum, METH_NOARGS|METH_CLASS,
30080 : "netlogon.netr_ServerReqChallenge.opnum() -> 4 (0x04) " },
30081 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerReqChallenge_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30082 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30083 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerReqChallenge_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30084 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30085 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerReqChallenge_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30086 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30087 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerReqChallenge_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30088 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30089 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerReqChallenge_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30090 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerReqChallenge_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30091 : { NULL, NULL, 0, NULL }
30092 : };
30093 :
30094 :
30095 : static PyTypeObject netr_ServerReqChallenge_Type = {
30096 : PyVarObject_HEAD_INIT(NULL, 0)
30097 : .tp_name = "netlogon.netr_ServerReqChallenge",
30098 : .tp_getset = py_netr_ServerReqChallenge_getsetters,
30099 : .tp_methods = py_netr_ServerReqChallenge_methods,
30100 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30101 : .tp_new = py_netr_ServerReqChallenge_new,
30102 : };
30103 :
30104 2 : static bool pack_py_netr_ServerReqChallenge_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerReqChallenge *r)
30105 : {
30106 : PyObject *py_server_name;
30107 : PyObject *py_computer_name;
30108 : PyObject *py_credentials;
30109 2 : const char *kwnames[] = {
30110 : "server_name", "computer_name", "credentials", NULL
30111 : };
30112 :
30113 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_ServerReqChallenge", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credentials)) {
30114 0 : return false;
30115 : }
30116 :
30117 2 : if (py_server_name == NULL) {
30118 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
30119 0 : return false;
30120 : }
30121 2 : if (py_server_name == Py_None) {
30122 0 : r->in.server_name = NULL;
30123 : } else {
30124 2 : r->in.server_name = NULL;
30125 : {
30126 : const char *test_str;
30127 : const char *talloc_str;
30128 2 : PyObject *unicode = NULL;
30129 2 : if (PyUnicode_Check(py_server_name)) {
30130 2 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
30131 2 : if (unicode == NULL) {
30132 0 : PyErr_NoMemory();
30133 0 : return false;
30134 : }
30135 2 : test_str = PyBytes_AS_STRING(unicode);
30136 0 : } else if (PyBytes_Check(py_server_name)) {
30137 0 : test_str = PyBytes_AS_STRING(py_server_name);
30138 : } else {
30139 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
30140 0 : return false;
30141 : }
30142 2 : talloc_str = talloc_strdup(r, test_str);
30143 2 : if (unicode != NULL) {
30144 2 : Py_DECREF(unicode);
30145 : }
30146 2 : if (talloc_str == NULL) {
30147 0 : PyErr_NoMemory();
30148 0 : return false;
30149 : }
30150 2 : r->in.server_name = talloc_str;
30151 : }
30152 : }
30153 2 : if (py_computer_name == NULL) {
30154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
30155 0 : return false;
30156 : }
30157 2 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
30158 2 : if (r->in.computer_name == NULL) {
30159 0 : PyErr_NoMemory();
30160 0 : return false;
30161 : }
30162 : {
30163 : const char *test_str;
30164 : const char *talloc_str;
30165 2 : PyObject *unicode = NULL;
30166 2 : if (PyUnicode_Check(py_computer_name)) {
30167 2 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
30168 2 : if (unicode == NULL) {
30169 0 : PyErr_NoMemory();
30170 0 : return false;
30171 : }
30172 2 : test_str = PyBytes_AS_STRING(unicode);
30173 0 : } else if (PyBytes_Check(py_computer_name)) {
30174 0 : test_str = PyBytes_AS_STRING(py_computer_name);
30175 : } else {
30176 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
30177 0 : return false;
30178 : }
30179 2 : talloc_str = talloc_strdup(r, test_str);
30180 2 : if (unicode != NULL) {
30181 2 : Py_DECREF(unicode);
30182 : }
30183 2 : if (talloc_str == NULL) {
30184 0 : PyErr_NoMemory();
30185 0 : return false;
30186 : }
30187 2 : r->in.computer_name = talloc_str;
30188 : }
30189 2 : if (py_credentials == NULL) {
30190 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credentials");
30191 0 : return false;
30192 : }
30193 2 : r->in.credentials = talloc_ptrtype(r, r->in.credentials);
30194 2 : if (r->in.credentials == NULL) {
30195 0 : PyErr_NoMemory();
30196 0 : return false;
30197 : }
30198 2 : PY_CHECK_TYPE(&netr_Credential_Type, py_credentials, return false;);
30199 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credentials)) == NULL) {
30200 0 : PyErr_NoMemory();
30201 0 : return false;
30202 : }
30203 2 : r->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(py_credentials);
30204 2 : return true;
30205 : }
30206 :
30207 2 : static PyObject *unpack_py_netr_ServerReqChallenge_args_out(struct netr_ServerReqChallenge *r)
30208 : {
30209 : PyObject *result;
30210 : PyObject *py_return_credentials;
30211 2 : py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, r->out.return_credentials, r->out.return_credentials);
30212 2 : result = py_return_credentials;
30213 2 : if (NT_STATUS_IS_ERR(r->out.result)) {
30214 0 : PyErr_SetNTSTATUS(r->out.result);
30215 0 : return NULL;
30216 : }
30217 :
30218 2 : return result;
30219 : }
30220 :
30221 :
30222 0 : static PyObject *py_netr_ServerAuthenticate_in_get_server_name(PyObject *obj, void *closure)
30223 : {
30224 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj);
30225 : PyObject *py_server_name;
30226 0 : if (object->in.server_name == NULL) {
30227 0 : Py_RETURN_NONE;
30228 : }
30229 0 : if (object->in.server_name == NULL) {
30230 0 : py_server_name = Py_None;
30231 0 : Py_INCREF(py_server_name);
30232 : } else {
30233 0 : if (object->in.server_name == NULL) {
30234 0 : py_server_name = Py_None;
30235 0 : Py_INCREF(py_server_name);
30236 : } else {
30237 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
30238 : }
30239 : }
30240 0 : return py_server_name;
30241 : }
30242 :
30243 0 : static int py_netr_ServerAuthenticate_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
30244 : {
30245 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30246 0 : if (value == NULL) {
30247 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
30248 0 : return -1;
30249 : }
30250 0 : if (value == Py_None) {
30251 0 : object->in.server_name = NULL;
30252 : } else {
30253 0 : object->in.server_name = NULL;
30254 : {
30255 : const char *test_str;
30256 : const char *talloc_str;
30257 0 : PyObject *unicode = NULL;
30258 0 : if (PyUnicode_Check(value)) {
30259 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
30260 0 : if (unicode == NULL) {
30261 0 : PyErr_NoMemory();
30262 0 : return -1;
30263 : }
30264 0 : test_str = PyBytes_AS_STRING(unicode);
30265 0 : } else if (PyBytes_Check(value)) {
30266 0 : test_str = PyBytes_AS_STRING(value);
30267 : } else {
30268 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
30269 0 : return -1;
30270 : }
30271 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
30272 0 : if (unicode != NULL) {
30273 0 : Py_DECREF(unicode);
30274 : }
30275 0 : if (talloc_str == NULL) {
30276 0 : PyErr_NoMemory();
30277 0 : return -1;
30278 : }
30279 0 : object->in.server_name = talloc_str;
30280 : }
30281 : }
30282 0 : return 0;
30283 : }
30284 :
30285 0 : static PyObject *py_netr_ServerAuthenticate_in_get_account_name(PyObject *obj, void *closure)
30286 : {
30287 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj);
30288 : PyObject *py_account_name;
30289 0 : if (object->in.account_name == NULL) {
30290 0 : Py_RETURN_NONE;
30291 : }
30292 0 : if (object->in.account_name == NULL) {
30293 0 : py_account_name = Py_None;
30294 0 : Py_INCREF(py_account_name);
30295 : } else {
30296 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
30297 : }
30298 0 : return py_account_name;
30299 : }
30300 :
30301 0 : static int py_netr_ServerAuthenticate_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
30302 : {
30303 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30304 0 : if (value == NULL) {
30305 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
30306 0 : return -1;
30307 : }
30308 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
30309 0 : if (object->in.account_name == NULL) {
30310 0 : PyErr_NoMemory();
30311 0 : return -1;
30312 : }
30313 : {
30314 : const char *test_str;
30315 : const char *talloc_str;
30316 0 : PyObject *unicode = NULL;
30317 0 : if (PyUnicode_Check(value)) {
30318 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
30319 0 : if (unicode == NULL) {
30320 0 : PyErr_NoMemory();
30321 0 : return -1;
30322 : }
30323 0 : test_str = PyBytes_AS_STRING(unicode);
30324 0 : } else if (PyBytes_Check(value)) {
30325 0 : test_str = PyBytes_AS_STRING(value);
30326 : } else {
30327 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
30328 0 : return -1;
30329 : }
30330 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
30331 0 : if (unicode != NULL) {
30332 0 : Py_DECREF(unicode);
30333 : }
30334 0 : if (talloc_str == NULL) {
30335 0 : PyErr_NoMemory();
30336 0 : return -1;
30337 : }
30338 0 : object->in.account_name = talloc_str;
30339 : }
30340 0 : return 0;
30341 : }
30342 :
30343 0 : static PyObject *py_netr_ServerAuthenticate_in_get_secure_channel_type(PyObject *obj, void *closure)
30344 : {
30345 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj);
30346 : PyObject *py_secure_channel_type;
30347 0 : py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type);
30348 0 : return py_secure_channel_type;
30349 : }
30350 :
30351 0 : static int py_netr_ServerAuthenticate_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure)
30352 : {
30353 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30354 0 : if (value == NULL) {
30355 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type");
30356 0 : return -1;
30357 : }
30358 : {
30359 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_type));
30360 0 : if (PyLong_Check(value)) {
30361 : unsigned long long test_var;
30362 0 : test_var = PyLong_AsUnsignedLongLong(value);
30363 0 : if (PyErr_Occurred() != NULL) {
30364 0 : return -1;
30365 : }
30366 0 : if (test_var > uint_max) {
30367 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30368 : PyLong_Type.tp_name, uint_max, test_var);
30369 0 : return -1;
30370 : }
30371 0 : object->in.secure_channel_type = test_var;
30372 : } else {
30373 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30374 : PyLong_Type.tp_name);
30375 0 : return -1;
30376 : }
30377 : }
30378 0 : return 0;
30379 : }
30380 :
30381 0 : static PyObject *py_netr_ServerAuthenticate_in_get_computer_name(PyObject *obj, void *closure)
30382 : {
30383 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj);
30384 : PyObject *py_computer_name;
30385 0 : if (object->in.computer_name == NULL) {
30386 0 : Py_RETURN_NONE;
30387 : }
30388 0 : if (object->in.computer_name == NULL) {
30389 0 : py_computer_name = Py_None;
30390 0 : Py_INCREF(py_computer_name);
30391 : } else {
30392 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
30393 : }
30394 0 : return py_computer_name;
30395 : }
30396 :
30397 0 : static int py_netr_ServerAuthenticate_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
30398 : {
30399 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30400 0 : if (value == NULL) {
30401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
30402 0 : return -1;
30403 : }
30404 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
30405 0 : if (object->in.computer_name == NULL) {
30406 0 : PyErr_NoMemory();
30407 0 : return -1;
30408 : }
30409 : {
30410 : const char *test_str;
30411 : const char *talloc_str;
30412 0 : PyObject *unicode = NULL;
30413 0 : if (PyUnicode_Check(value)) {
30414 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
30415 0 : if (unicode == NULL) {
30416 0 : PyErr_NoMemory();
30417 0 : return -1;
30418 : }
30419 0 : test_str = PyBytes_AS_STRING(unicode);
30420 0 : } else if (PyBytes_Check(value)) {
30421 0 : test_str = PyBytes_AS_STRING(value);
30422 : } else {
30423 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
30424 0 : return -1;
30425 : }
30426 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
30427 0 : if (unicode != NULL) {
30428 0 : Py_DECREF(unicode);
30429 : }
30430 0 : if (talloc_str == NULL) {
30431 0 : PyErr_NoMemory();
30432 0 : return -1;
30433 : }
30434 0 : object->in.computer_name = talloc_str;
30435 : }
30436 0 : return 0;
30437 : }
30438 :
30439 0 : static PyObject *py_netr_ServerAuthenticate_in_get_credentials(PyObject *obj, void *closure)
30440 : {
30441 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj);
30442 : PyObject *py_credentials;
30443 0 : if (object->in.credentials == NULL) {
30444 0 : Py_RETURN_NONE;
30445 : }
30446 0 : py_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->in.credentials, object->in.credentials);
30447 0 : return py_credentials;
30448 : }
30449 :
30450 0 : static int py_netr_ServerAuthenticate_in_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
30451 : {
30452 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30453 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credentials));
30454 0 : if (value == NULL) {
30455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credentials");
30456 0 : return -1;
30457 : }
30458 0 : object->in.credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credentials);
30459 0 : if (object->in.credentials == NULL) {
30460 0 : PyErr_NoMemory();
30461 0 : return -1;
30462 : }
30463 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
30464 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30465 0 : PyErr_NoMemory();
30466 0 : return -1;
30467 : }
30468 0 : object->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(value);
30469 0 : return 0;
30470 : }
30471 :
30472 0 : static PyObject *py_netr_ServerAuthenticate_out_get_return_credentials(PyObject *obj, void *closure)
30473 : {
30474 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj);
30475 : PyObject *py_return_credentials;
30476 0 : if (object->out.return_credentials == NULL) {
30477 0 : Py_RETURN_NONE;
30478 : }
30479 0 : py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->out.return_credentials, object->out.return_credentials);
30480 0 : return py_return_credentials;
30481 : }
30482 :
30483 0 : static int py_netr_ServerAuthenticate_out_set_return_credentials(PyObject *py_obj, PyObject *value, void *closure)
30484 : {
30485 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30486 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_credentials));
30487 0 : if (value == NULL) {
30488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_credentials");
30489 0 : return -1;
30490 : }
30491 0 : object->out.return_credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_credentials);
30492 0 : if (object->out.return_credentials == NULL) {
30493 0 : PyErr_NoMemory();
30494 0 : return -1;
30495 : }
30496 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
30497 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30498 0 : PyErr_NoMemory();
30499 0 : return -1;
30500 : }
30501 0 : object->out.return_credentials = (struct netr_Credential *)pytalloc_get_ptr(value);
30502 0 : return 0;
30503 : }
30504 :
30505 0 : static PyObject *py_netr_ServerAuthenticate_get_result(PyObject *obj, void *closure)
30506 : {
30507 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(obj);
30508 : PyObject *py_result;
30509 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30510 0 : return py_result;
30511 : }
30512 :
30513 0 : static int py_netr_ServerAuthenticate_set_result(PyObject *py_obj, PyObject *value, void *closure)
30514 : {
30515 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30516 0 : if (value == NULL) {
30517 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30518 0 : return -1;
30519 : }
30520 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30521 0 : return 0;
30522 : }
30523 :
30524 : static PyGetSetDef py_netr_ServerAuthenticate_getsetters[] = {
30525 : {
30526 : .name = discard_const_p(char, "in_server_name"),
30527 : .get = py_netr_ServerAuthenticate_in_get_server_name,
30528 : .set = py_netr_ServerAuthenticate_in_set_server_name,
30529 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
30530 : },
30531 : {
30532 : .name = discard_const_p(char, "in_account_name"),
30533 : .get = py_netr_ServerAuthenticate_in_get_account_name,
30534 : .set = py_netr_ServerAuthenticate_in_set_account_name,
30535 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
30536 : },
30537 : {
30538 : .name = discard_const_p(char, "in_secure_channel_type"),
30539 : .get = py_netr_ServerAuthenticate_in_get_secure_channel_type,
30540 : .set = py_netr_ServerAuthenticate_in_set_secure_channel_type,
30541 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType")
30542 : },
30543 : {
30544 : .name = discard_const_p(char, "in_computer_name"),
30545 : .get = py_netr_ServerAuthenticate_in_get_computer_name,
30546 : .set = py_netr_ServerAuthenticate_in_set_computer_name,
30547 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
30548 : },
30549 : {
30550 : .name = discard_const_p(char, "in_credentials"),
30551 : .get = py_netr_ServerAuthenticate_in_get_credentials,
30552 : .set = py_netr_ServerAuthenticate_in_set_credentials,
30553 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
30554 : },
30555 : {
30556 : .name = discard_const_p(char, "out_return_credentials"),
30557 : .get = py_netr_ServerAuthenticate_out_get_return_credentials,
30558 : .set = py_netr_ServerAuthenticate_out_set_return_credentials,
30559 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
30560 : },
30561 : {
30562 : .name = discard_const_p(char, "result"),
30563 : .get = py_netr_ServerAuthenticate_get_result,
30564 : .set = py_netr_ServerAuthenticate_set_result,
30565 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30566 : },
30567 : { .name = NULL }
30568 : };
30569 :
30570 0 : static PyObject *py_netr_ServerAuthenticate_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30571 : {
30572 0 : PyObject *self = pytalloc_new(struct netr_ServerAuthenticate, type);
30573 0 : struct netr_ServerAuthenticate *_self = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(self);
30574 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30575 0 : _self->in.credentials = talloc_zero(mem_ctx, struct netr_Credential);
30576 0 : _self->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
30577 0 : return self;
30578 : }
30579 :
30580 0 : static PyObject *py_netr_ServerAuthenticate_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30581 : {
30582 :
30583 :
30584 0 : return PyLong_FromLong(5);
30585 : }
30586 :
30587 0 : static PyObject *py_netr_ServerAuthenticate_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
30588 : {
30589 0 : const struct ndr_interface_call *call = NULL;
30590 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30591 0 : PyObject *ret = NULL;
30592 0 : struct ndr_push *push = NULL;
30593 : DATA_BLOB blob;
30594 : enum ndr_err_code err;
30595 :
30596 0 : if (ndr_table_netlogon.num_calls < 6) {
30597 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate_ndr_pack");
30598 0 : return NULL;
30599 : }
30600 0 : call = &ndr_table_netlogon.calls[5];
30601 :
30602 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30603 0 : if (push == NULL) {
30604 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30605 0 : return NULL;
30606 : }
30607 :
30608 0 : push->flags |= ndr_push_flags;
30609 :
30610 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30611 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30612 0 : TALLOC_FREE(push);
30613 0 : PyErr_SetNdrError(err);
30614 0 : return NULL;
30615 : }
30616 0 : blob = ndr_push_blob(push);
30617 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30618 0 : TALLOC_FREE(push);
30619 0 : return ret;
30620 : }
30621 :
30622 0 : static PyObject *py_netr_ServerAuthenticate_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30623 : {
30624 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30625 0 : PyObject *bigendian_obj = NULL;
30626 0 : PyObject *ndr64_obj = NULL;
30627 0 : uint32_t ndr_push_flags = 0;
30628 :
30629 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30630 : discard_const_p(char *, kwnames),
30631 : &bigendian_obj,
30632 : &ndr64_obj)) {
30633 0 : return NULL;
30634 : }
30635 :
30636 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30637 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30638 : }
30639 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30640 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30641 : }
30642 :
30643 0 : return py_netr_ServerAuthenticate_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30644 : }
30645 :
30646 0 : static PyObject *py_netr_ServerAuthenticate_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30647 : {
30648 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30649 0 : PyObject *bigendian_obj = NULL;
30650 0 : PyObject *ndr64_obj = NULL;
30651 0 : uint32_t ndr_push_flags = 0;
30652 :
30653 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30654 : discard_const_p(char *, kwnames),
30655 : &bigendian_obj,
30656 : &ndr64_obj)) {
30657 0 : return NULL;
30658 : }
30659 :
30660 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30661 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30662 : }
30663 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30664 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30665 : }
30666 :
30667 0 : return py_netr_ServerAuthenticate_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30668 : }
30669 :
30670 0 : static PyObject *py_netr_ServerAuthenticate_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
30671 : {
30672 0 : const struct ndr_interface_call *call = NULL;
30673 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30674 0 : struct ndr_pull *pull = NULL;
30675 : enum ndr_err_code err;
30676 :
30677 0 : if (ndr_table_netlogon.num_calls < 6) {
30678 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate_ndr_unpack");
30679 0 : return NULL;
30680 : }
30681 0 : call = &ndr_table_netlogon.calls[5];
30682 :
30683 0 : pull = ndr_pull_init_blob(blob, object);
30684 0 : if (pull == NULL) {
30685 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30686 0 : return NULL;
30687 : }
30688 :
30689 0 : pull->flags |= ndr_pull_flags;
30690 :
30691 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30692 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30693 0 : TALLOC_FREE(pull);
30694 0 : PyErr_SetNdrError(err);
30695 0 : return NULL;
30696 : }
30697 0 : if (!allow_remaining) {
30698 : uint32_t highest_ofs;
30699 :
30700 0 : if (pull->offset > pull->relative_highest_offset) {
30701 0 : highest_ofs = pull->offset;
30702 : } else {
30703 0 : highest_ofs = pull->relative_highest_offset;
30704 : }
30705 0 : if (highest_ofs < pull->data_size) {
30706 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30707 : "not all bytes consumed ofs[%u] size[%u]",
30708 : highest_ofs, pull->data_size);
30709 0 : TALLOC_FREE(pull);
30710 0 : PyErr_SetNdrError(err);
30711 0 : return NULL;
30712 : }
30713 : }
30714 :
30715 0 : TALLOC_FREE(pull);
30716 0 : Py_RETURN_NONE;
30717 : }
30718 :
30719 0 : static PyObject *py_netr_ServerAuthenticate_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30720 : {
30721 : DATA_BLOB blob;
30722 0 : Py_ssize_t blob_length = 0;
30723 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30724 0 : PyObject *bigendian_obj = NULL;
30725 0 : PyObject *ndr64_obj = NULL;
30726 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30727 0 : PyObject *allow_remaining_obj = NULL;
30728 0 : bool allow_remaining = false;
30729 :
30730 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30731 : discard_const_p(char *, kwnames),
30732 : &blob.data, &blob_length,
30733 : &bigendian_obj,
30734 : &ndr64_obj,
30735 : &allow_remaining_obj)) {
30736 0 : return NULL;
30737 : }
30738 0 : blob.length = blob_length;
30739 :
30740 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30741 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30742 : }
30743 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30744 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30745 : }
30746 :
30747 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30748 0 : allow_remaining = true;
30749 : }
30750 :
30751 0 : return py_netr_ServerAuthenticate_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30752 : }
30753 :
30754 0 : static PyObject *py_netr_ServerAuthenticate_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30755 : {
30756 : DATA_BLOB blob;
30757 0 : Py_ssize_t blob_length = 0;
30758 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30759 0 : PyObject *bigendian_obj = NULL;
30760 0 : PyObject *ndr64_obj = NULL;
30761 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30762 0 : PyObject *allow_remaining_obj = NULL;
30763 0 : bool allow_remaining = false;
30764 :
30765 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30766 : discard_const_p(char *, kwnames),
30767 : &blob.data, &blob_length,
30768 : &bigendian_obj,
30769 : &ndr64_obj,
30770 : &allow_remaining_obj)) {
30771 0 : return NULL;
30772 : }
30773 0 : blob.length = blob_length;
30774 :
30775 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30776 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30777 : }
30778 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30779 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30780 : }
30781 :
30782 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30783 0 : allow_remaining = true;
30784 : }
30785 :
30786 0 : return py_netr_ServerAuthenticate_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30787 : }
30788 :
30789 0 : static PyObject *py_netr_ServerAuthenticate_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
30790 : {
30791 0 : const struct ndr_interface_call *call = NULL;
30792 0 : struct netr_ServerAuthenticate *object = (struct netr_ServerAuthenticate *)pytalloc_get_ptr(py_obj);
30793 : PyObject *ret;
30794 : char *retstr;
30795 :
30796 0 : if (ndr_table_netlogon.num_calls < 6) {
30797 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate_ndr_print");
30798 0 : return NULL;
30799 : }
30800 0 : call = &ndr_table_netlogon.calls[5];
30801 :
30802 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30803 0 : ret = PyUnicode_FromString(retstr);
30804 0 : TALLOC_FREE(retstr);
30805 :
30806 0 : return ret;
30807 : }
30808 :
30809 0 : static PyObject *py_netr_ServerAuthenticate_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30810 : {
30811 0 : return py_netr_ServerAuthenticate_ndr_print(py_obj, "netr_ServerAuthenticate_in", NDR_IN);
30812 : }
30813 :
30814 0 : static PyObject *py_netr_ServerAuthenticate_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30815 : {
30816 0 : return py_netr_ServerAuthenticate_ndr_print(py_obj, "netr_ServerAuthenticate_out", NDR_OUT);
30817 : }
30818 :
30819 : static PyMethodDef py_netr_ServerAuthenticate_methods[] = {
30820 : { "opnum", (PyCFunction)py_netr_ServerAuthenticate_ndr_opnum, METH_NOARGS|METH_CLASS,
30821 : "netlogon.netr_ServerAuthenticate.opnum() -> 5 (0x05) " },
30822 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30823 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30824 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30825 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30826 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30827 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30828 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30829 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30830 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerAuthenticate_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30831 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerAuthenticate_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30832 : { NULL, NULL, 0, NULL }
30833 : };
30834 :
30835 :
30836 : static PyTypeObject netr_ServerAuthenticate_Type = {
30837 : PyVarObject_HEAD_INIT(NULL, 0)
30838 : .tp_name = "netlogon.netr_ServerAuthenticate",
30839 : .tp_getset = py_netr_ServerAuthenticate_getsetters,
30840 : .tp_methods = py_netr_ServerAuthenticate_methods,
30841 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30842 : .tp_new = py_netr_ServerAuthenticate_new,
30843 : };
30844 :
30845 0 : static bool pack_py_netr_ServerAuthenticate_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerAuthenticate *r)
30846 : {
30847 : PyObject *py_server_name;
30848 : PyObject *py_account_name;
30849 : PyObject *py_secure_channel_type;
30850 : PyObject *py_computer_name;
30851 : PyObject *py_credentials;
30852 0 : const char *kwnames[] = {
30853 : "server_name", "account_name", "secure_channel_type", "computer_name", "credentials", NULL
30854 : };
30855 :
30856 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_ServerAuthenticate", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credentials)) {
30857 0 : return false;
30858 : }
30859 :
30860 0 : if (py_server_name == NULL) {
30861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
30862 0 : return false;
30863 : }
30864 0 : if (py_server_name == Py_None) {
30865 0 : r->in.server_name = NULL;
30866 : } else {
30867 0 : r->in.server_name = NULL;
30868 : {
30869 : const char *test_str;
30870 : const char *talloc_str;
30871 0 : PyObject *unicode = NULL;
30872 0 : if (PyUnicode_Check(py_server_name)) {
30873 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
30874 0 : if (unicode == NULL) {
30875 0 : PyErr_NoMemory();
30876 0 : return false;
30877 : }
30878 0 : test_str = PyBytes_AS_STRING(unicode);
30879 0 : } else if (PyBytes_Check(py_server_name)) {
30880 0 : test_str = PyBytes_AS_STRING(py_server_name);
30881 : } else {
30882 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
30883 0 : return false;
30884 : }
30885 0 : talloc_str = talloc_strdup(r, test_str);
30886 0 : if (unicode != NULL) {
30887 0 : Py_DECREF(unicode);
30888 : }
30889 0 : if (talloc_str == NULL) {
30890 0 : PyErr_NoMemory();
30891 0 : return false;
30892 : }
30893 0 : r->in.server_name = talloc_str;
30894 : }
30895 : }
30896 0 : if (py_account_name == NULL) {
30897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
30898 0 : return false;
30899 : }
30900 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
30901 0 : if (r->in.account_name == NULL) {
30902 0 : PyErr_NoMemory();
30903 0 : return false;
30904 : }
30905 : {
30906 : const char *test_str;
30907 : const char *talloc_str;
30908 0 : PyObject *unicode = NULL;
30909 0 : if (PyUnicode_Check(py_account_name)) {
30910 0 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
30911 0 : if (unicode == NULL) {
30912 0 : PyErr_NoMemory();
30913 0 : return false;
30914 : }
30915 0 : test_str = PyBytes_AS_STRING(unicode);
30916 0 : } else if (PyBytes_Check(py_account_name)) {
30917 0 : test_str = PyBytes_AS_STRING(py_account_name);
30918 : } else {
30919 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
30920 0 : return false;
30921 : }
30922 0 : talloc_str = talloc_strdup(r, test_str);
30923 0 : if (unicode != NULL) {
30924 0 : Py_DECREF(unicode);
30925 : }
30926 0 : if (talloc_str == NULL) {
30927 0 : PyErr_NoMemory();
30928 0 : return false;
30929 : }
30930 0 : r->in.account_name = talloc_str;
30931 : }
30932 0 : if (py_secure_channel_type == NULL) {
30933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type");
30934 0 : return false;
30935 : }
30936 : {
30937 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type));
30938 0 : if (PyLong_Check(py_secure_channel_type)) {
30939 : unsigned long long test_var;
30940 0 : test_var = PyLong_AsUnsignedLongLong(py_secure_channel_type);
30941 0 : if (PyErr_Occurred() != NULL) {
30942 0 : return false;
30943 : }
30944 0 : if (test_var > uint_max) {
30945 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30946 : PyLong_Type.tp_name, uint_max, test_var);
30947 0 : return false;
30948 : }
30949 0 : r->in.secure_channel_type = test_var;
30950 : } else {
30951 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30952 : PyLong_Type.tp_name);
30953 0 : return false;
30954 : }
30955 : }
30956 0 : if (py_computer_name == NULL) {
30957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
30958 0 : return false;
30959 : }
30960 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
30961 0 : if (r->in.computer_name == NULL) {
30962 0 : PyErr_NoMemory();
30963 0 : return false;
30964 : }
30965 : {
30966 : const char *test_str;
30967 : const char *talloc_str;
30968 0 : PyObject *unicode = NULL;
30969 0 : if (PyUnicode_Check(py_computer_name)) {
30970 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
30971 0 : if (unicode == NULL) {
30972 0 : PyErr_NoMemory();
30973 0 : return false;
30974 : }
30975 0 : test_str = PyBytes_AS_STRING(unicode);
30976 0 : } else if (PyBytes_Check(py_computer_name)) {
30977 0 : test_str = PyBytes_AS_STRING(py_computer_name);
30978 : } else {
30979 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
30980 0 : return false;
30981 : }
30982 0 : talloc_str = talloc_strdup(r, test_str);
30983 0 : if (unicode != NULL) {
30984 0 : Py_DECREF(unicode);
30985 : }
30986 0 : if (talloc_str == NULL) {
30987 0 : PyErr_NoMemory();
30988 0 : return false;
30989 : }
30990 0 : r->in.computer_name = talloc_str;
30991 : }
30992 0 : if (py_credentials == NULL) {
30993 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credentials");
30994 0 : return false;
30995 : }
30996 0 : r->in.credentials = talloc_ptrtype(r, r->in.credentials);
30997 0 : if (r->in.credentials == NULL) {
30998 0 : PyErr_NoMemory();
30999 0 : return false;
31000 : }
31001 0 : PY_CHECK_TYPE(&netr_Credential_Type, py_credentials, return false;);
31002 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credentials)) == NULL) {
31003 0 : PyErr_NoMemory();
31004 0 : return false;
31005 : }
31006 0 : r->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(py_credentials);
31007 0 : return true;
31008 : }
31009 :
31010 0 : static PyObject *unpack_py_netr_ServerAuthenticate_args_out(struct netr_ServerAuthenticate *r)
31011 : {
31012 : PyObject *result;
31013 : PyObject *py_return_credentials;
31014 0 : py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, r->out.return_credentials, r->out.return_credentials);
31015 0 : result = py_return_credentials;
31016 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
31017 0 : PyErr_SetNTSTATUS(r->out.result);
31018 0 : return NULL;
31019 : }
31020 :
31021 0 : return result;
31022 : }
31023 :
31024 :
31025 0 : static PyObject *py_netr_ServerPasswordSet_in_get_server_name(PyObject *obj, void *closure)
31026 : {
31027 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj);
31028 : PyObject *py_server_name;
31029 0 : if (object->in.server_name == NULL) {
31030 0 : Py_RETURN_NONE;
31031 : }
31032 0 : if (object->in.server_name == NULL) {
31033 0 : py_server_name = Py_None;
31034 0 : Py_INCREF(py_server_name);
31035 : } else {
31036 0 : if (object->in.server_name == NULL) {
31037 0 : py_server_name = Py_None;
31038 0 : Py_INCREF(py_server_name);
31039 : } else {
31040 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
31041 : }
31042 : }
31043 0 : return py_server_name;
31044 : }
31045 :
31046 0 : static int py_netr_ServerPasswordSet_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
31047 : {
31048 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31049 0 : if (value == NULL) {
31050 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
31051 0 : return -1;
31052 : }
31053 0 : if (value == Py_None) {
31054 0 : object->in.server_name = NULL;
31055 : } else {
31056 0 : object->in.server_name = NULL;
31057 : {
31058 : const char *test_str;
31059 : const char *talloc_str;
31060 0 : PyObject *unicode = NULL;
31061 0 : if (PyUnicode_Check(value)) {
31062 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
31063 0 : if (unicode == NULL) {
31064 0 : PyErr_NoMemory();
31065 0 : return -1;
31066 : }
31067 0 : test_str = PyBytes_AS_STRING(unicode);
31068 0 : } else if (PyBytes_Check(value)) {
31069 0 : test_str = PyBytes_AS_STRING(value);
31070 : } else {
31071 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
31072 0 : return -1;
31073 : }
31074 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
31075 0 : if (unicode != NULL) {
31076 0 : Py_DECREF(unicode);
31077 : }
31078 0 : if (talloc_str == NULL) {
31079 0 : PyErr_NoMemory();
31080 0 : return -1;
31081 : }
31082 0 : object->in.server_name = talloc_str;
31083 : }
31084 : }
31085 0 : return 0;
31086 : }
31087 :
31088 0 : static PyObject *py_netr_ServerPasswordSet_in_get_account_name(PyObject *obj, void *closure)
31089 : {
31090 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj);
31091 : PyObject *py_account_name;
31092 0 : if (object->in.account_name == NULL) {
31093 0 : Py_RETURN_NONE;
31094 : }
31095 0 : if (object->in.account_name == NULL) {
31096 0 : py_account_name = Py_None;
31097 0 : Py_INCREF(py_account_name);
31098 : } else {
31099 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
31100 : }
31101 0 : return py_account_name;
31102 : }
31103 :
31104 0 : static int py_netr_ServerPasswordSet_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
31105 : {
31106 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31107 0 : if (value == NULL) {
31108 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
31109 0 : return -1;
31110 : }
31111 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
31112 0 : if (object->in.account_name == NULL) {
31113 0 : PyErr_NoMemory();
31114 0 : return -1;
31115 : }
31116 : {
31117 : const char *test_str;
31118 : const char *talloc_str;
31119 0 : PyObject *unicode = NULL;
31120 0 : if (PyUnicode_Check(value)) {
31121 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
31122 0 : if (unicode == NULL) {
31123 0 : PyErr_NoMemory();
31124 0 : return -1;
31125 : }
31126 0 : test_str = PyBytes_AS_STRING(unicode);
31127 0 : } else if (PyBytes_Check(value)) {
31128 0 : test_str = PyBytes_AS_STRING(value);
31129 : } else {
31130 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
31131 0 : return -1;
31132 : }
31133 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
31134 0 : if (unicode != NULL) {
31135 0 : Py_DECREF(unicode);
31136 : }
31137 0 : if (talloc_str == NULL) {
31138 0 : PyErr_NoMemory();
31139 0 : return -1;
31140 : }
31141 0 : object->in.account_name = talloc_str;
31142 : }
31143 0 : return 0;
31144 : }
31145 :
31146 0 : static PyObject *py_netr_ServerPasswordSet_in_get_secure_channel_type(PyObject *obj, void *closure)
31147 : {
31148 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj);
31149 : PyObject *py_secure_channel_type;
31150 0 : py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type);
31151 0 : return py_secure_channel_type;
31152 : }
31153 :
31154 0 : static int py_netr_ServerPasswordSet_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure)
31155 : {
31156 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31157 0 : if (value == NULL) {
31158 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type");
31159 0 : return -1;
31160 : }
31161 : {
31162 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_type));
31163 0 : if (PyLong_Check(value)) {
31164 : unsigned long long test_var;
31165 0 : test_var = PyLong_AsUnsignedLongLong(value);
31166 0 : if (PyErr_Occurred() != NULL) {
31167 0 : return -1;
31168 : }
31169 0 : if (test_var > uint_max) {
31170 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31171 : PyLong_Type.tp_name, uint_max, test_var);
31172 0 : return -1;
31173 : }
31174 0 : object->in.secure_channel_type = test_var;
31175 : } else {
31176 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31177 : PyLong_Type.tp_name);
31178 0 : return -1;
31179 : }
31180 : }
31181 0 : return 0;
31182 : }
31183 :
31184 0 : static PyObject *py_netr_ServerPasswordSet_in_get_computer_name(PyObject *obj, void *closure)
31185 : {
31186 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj);
31187 : PyObject *py_computer_name;
31188 0 : if (object->in.computer_name == NULL) {
31189 0 : Py_RETURN_NONE;
31190 : }
31191 0 : if (object->in.computer_name == NULL) {
31192 0 : py_computer_name = Py_None;
31193 0 : Py_INCREF(py_computer_name);
31194 : } else {
31195 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
31196 : }
31197 0 : return py_computer_name;
31198 : }
31199 :
31200 0 : static int py_netr_ServerPasswordSet_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
31201 : {
31202 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31203 0 : if (value == NULL) {
31204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
31205 0 : return -1;
31206 : }
31207 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
31208 0 : if (object->in.computer_name == NULL) {
31209 0 : PyErr_NoMemory();
31210 0 : return -1;
31211 : }
31212 : {
31213 : const char *test_str;
31214 : const char *talloc_str;
31215 0 : PyObject *unicode = NULL;
31216 0 : if (PyUnicode_Check(value)) {
31217 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
31218 0 : if (unicode == NULL) {
31219 0 : PyErr_NoMemory();
31220 0 : return -1;
31221 : }
31222 0 : test_str = PyBytes_AS_STRING(unicode);
31223 0 : } else if (PyBytes_Check(value)) {
31224 0 : test_str = PyBytes_AS_STRING(value);
31225 : } else {
31226 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
31227 0 : return -1;
31228 : }
31229 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
31230 0 : if (unicode != NULL) {
31231 0 : Py_DECREF(unicode);
31232 : }
31233 0 : if (talloc_str == NULL) {
31234 0 : PyErr_NoMemory();
31235 0 : return -1;
31236 : }
31237 0 : object->in.computer_name = talloc_str;
31238 : }
31239 0 : return 0;
31240 : }
31241 :
31242 0 : static PyObject *py_netr_ServerPasswordSet_in_get_credential(PyObject *obj, void *closure)
31243 : {
31244 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj);
31245 : PyObject *py_credential;
31246 0 : if (object->in.credential == NULL) {
31247 0 : Py_RETURN_NONE;
31248 : }
31249 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
31250 0 : return py_credential;
31251 : }
31252 :
31253 0 : static int py_netr_ServerPasswordSet_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
31254 : {
31255 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31256 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
31257 0 : if (value == NULL) {
31258 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
31259 0 : return -1;
31260 : }
31261 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
31262 0 : if (object->in.credential == NULL) {
31263 0 : PyErr_NoMemory();
31264 0 : return -1;
31265 : }
31266 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
31267 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31268 0 : PyErr_NoMemory();
31269 0 : return -1;
31270 : }
31271 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
31272 0 : return 0;
31273 : }
31274 :
31275 0 : static PyObject *py_netr_ServerPasswordSet_out_get_return_authenticator(PyObject *obj, void *closure)
31276 : {
31277 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj);
31278 : PyObject *py_return_authenticator;
31279 0 : if (object->out.return_authenticator == NULL) {
31280 0 : Py_RETURN_NONE;
31281 : }
31282 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
31283 0 : return py_return_authenticator;
31284 : }
31285 :
31286 0 : static int py_netr_ServerPasswordSet_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
31287 : {
31288 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31289 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
31290 0 : if (value == NULL) {
31291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
31292 0 : return -1;
31293 : }
31294 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
31295 0 : if (object->out.return_authenticator == NULL) {
31296 0 : PyErr_NoMemory();
31297 0 : return -1;
31298 : }
31299 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
31300 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31301 0 : PyErr_NoMemory();
31302 0 : return -1;
31303 : }
31304 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
31305 0 : return 0;
31306 : }
31307 :
31308 0 : static PyObject *py_netr_ServerPasswordSet_in_get_new_password(PyObject *obj, void *closure)
31309 : {
31310 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj);
31311 : PyObject *py_new_password;
31312 0 : if (object->in.new_password == NULL) {
31313 0 : Py_RETURN_NONE;
31314 : }
31315 0 : py_new_password = pytalloc_reference_ex(samr_Password_Type, object->in.new_password, object->in.new_password);
31316 0 : return py_new_password;
31317 : }
31318 :
31319 0 : static int py_netr_ServerPasswordSet_in_set_new_password(PyObject *py_obj, PyObject *value, void *closure)
31320 : {
31321 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31322 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_password));
31323 0 : if (value == NULL) {
31324 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_password");
31325 0 : return -1;
31326 : }
31327 0 : object->in.new_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_password);
31328 0 : if (object->in.new_password == NULL) {
31329 0 : PyErr_NoMemory();
31330 0 : return -1;
31331 : }
31332 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
31333 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31334 0 : PyErr_NoMemory();
31335 0 : return -1;
31336 : }
31337 0 : object->in.new_password = (struct samr_Password *)pytalloc_get_ptr(value);
31338 0 : return 0;
31339 : }
31340 :
31341 0 : static PyObject *py_netr_ServerPasswordSet_get_result(PyObject *obj, void *closure)
31342 : {
31343 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(obj);
31344 : PyObject *py_result;
31345 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31346 0 : return py_result;
31347 : }
31348 :
31349 0 : static int py_netr_ServerPasswordSet_set_result(PyObject *py_obj, PyObject *value, void *closure)
31350 : {
31351 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31352 0 : if (value == NULL) {
31353 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
31354 0 : return -1;
31355 : }
31356 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31357 0 : return 0;
31358 : }
31359 :
31360 : static PyGetSetDef py_netr_ServerPasswordSet_getsetters[] = {
31361 : {
31362 : .name = discard_const_p(char, "in_server_name"),
31363 : .get = py_netr_ServerPasswordSet_in_get_server_name,
31364 : .set = py_netr_ServerPasswordSet_in_set_server_name,
31365 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
31366 : },
31367 : {
31368 : .name = discard_const_p(char, "in_account_name"),
31369 : .get = py_netr_ServerPasswordSet_in_get_account_name,
31370 : .set = py_netr_ServerPasswordSet_in_set_account_name,
31371 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
31372 : },
31373 : {
31374 : .name = discard_const_p(char, "in_secure_channel_type"),
31375 : .get = py_netr_ServerPasswordSet_in_get_secure_channel_type,
31376 : .set = py_netr_ServerPasswordSet_in_set_secure_channel_type,
31377 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType")
31378 : },
31379 : {
31380 : .name = discard_const_p(char, "in_computer_name"),
31381 : .get = py_netr_ServerPasswordSet_in_get_computer_name,
31382 : .set = py_netr_ServerPasswordSet_in_set_computer_name,
31383 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
31384 : },
31385 : {
31386 : .name = discard_const_p(char, "in_credential"),
31387 : .get = py_netr_ServerPasswordSet_in_get_credential,
31388 : .set = py_netr_ServerPasswordSet_in_set_credential,
31389 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
31390 : },
31391 : {
31392 : .name = discard_const_p(char, "out_return_authenticator"),
31393 : .get = py_netr_ServerPasswordSet_out_get_return_authenticator,
31394 : .set = py_netr_ServerPasswordSet_out_set_return_authenticator,
31395 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
31396 : },
31397 : {
31398 : .name = discard_const_p(char, "in_new_password"),
31399 : .get = py_netr_ServerPasswordSet_in_get_new_password,
31400 : .set = py_netr_ServerPasswordSet_in_set_new_password,
31401 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
31402 : },
31403 : {
31404 : .name = discard_const_p(char, "result"),
31405 : .get = py_netr_ServerPasswordSet_get_result,
31406 : .set = py_netr_ServerPasswordSet_set_result,
31407 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
31408 : },
31409 : { .name = NULL }
31410 : };
31411 :
31412 0 : static PyObject *py_netr_ServerPasswordSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31413 : {
31414 0 : PyObject *self = pytalloc_new(struct netr_ServerPasswordSet, type);
31415 0 : struct netr_ServerPasswordSet *_self = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(self);
31416 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31417 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
31418 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
31419 0 : _self->in.new_password = talloc_zero(mem_ctx, struct samr_Password);
31420 0 : return self;
31421 : }
31422 :
31423 0 : static PyObject *py_netr_ServerPasswordSet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31424 : {
31425 :
31426 :
31427 0 : return PyLong_FromLong(6);
31428 : }
31429 :
31430 0 : static PyObject *py_netr_ServerPasswordSet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
31431 : {
31432 0 : const struct ndr_interface_call *call = NULL;
31433 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31434 0 : PyObject *ret = NULL;
31435 0 : struct ndr_push *push = NULL;
31436 : DATA_BLOB blob;
31437 : enum ndr_err_code err;
31438 :
31439 0 : if (ndr_table_netlogon.num_calls < 7) {
31440 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet_ndr_pack");
31441 0 : return NULL;
31442 : }
31443 0 : call = &ndr_table_netlogon.calls[6];
31444 :
31445 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31446 0 : if (push == NULL) {
31447 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31448 0 : return NULL;
31449 : }
31450 :
31451 0 : push->flags |= ndr_push_flags;
31452 :
31453 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31454 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31455 0 : TALLOC_FREE(push);
31456 0 : PyErr_SetNdrError(err);
31457 0 : return NULL;
31458 : }
31459 0 : blob = ndr_push_blob(push);
31460 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31461 0 : TALLOC_FREE(push);
31462 0 : return ret;
31463 : }
31464 :
31465 0 : static PyObject *py_netr_ServerPasswordSet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31466 : {
31467 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31468 0 : PyObject *bigendian_obj = NULL;
31469 0 : PyObject *ndr64_obj = NULL;
31470 0 : uint32_t ndr_push_flags = 0;
31471 :
31472 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31473 : discard_const_p(char *, kwnames),
31474 : &bigendian_obj,
31475 : &ndr64_obj)) {
31476 0 : return NULL;
31477 : }
31478 :
31479 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31480 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31481 : }
31482 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31483 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31484 : }
31485 :
31486 0 : return py_netr_ServerPasswordSet_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31487 : }
31488 :
31489 0 : static PyObject *py_netr_ServerPasswordSet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31490 : {
31491 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31492 0 : PyObject *bigendian_obj = NULL;
31493 0 : PyObject *ndr64_obj = NULL;
31494 0 : uint32_t ndr_push_flags = 0;
31495 :
31496 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31497 : discard_const_p(char *, kwnames),
31498 : &bigendian_obj,
31499 : &ndr64_obj)) {
31500 0 : return NULL;
31501 : }
31502 :
31503 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31504 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31505 : }
31506 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31507 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31508 : }
31509 :
31510 0 : return py_netr_ServerPasswordSet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31511 : }
31512 :
31513 0 : static PyObject *py_netr_ServerPasswordSet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
31514 : {
31515 0 : const struct ndr_interface_call *call = NULL;
31516 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31517 0 : struct ndr_pull *pull = NULL;
31518 : enum ndr_err_code err;
31519 :
31520 0 : if (ndr_table_netlogon.num_calls < 7) {
31521 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet_ndr_unpack");
31522 0 : return NULL;
31523 : }
31524 0 : call = &ndr_table_netlogon.calls[6];
31525 :
31526 0 : pull = ndr_pull_init_blob(blob, object);
31527 0 : if (pull == NULL) {
31528 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31529 0 : return NULL;
31530 : }
31531 :
31532 0 : pull->flags |= ndr_pull_flags;
31533 :
31534 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31535 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31536 0 : TALLOC_FREE(pull);
31537 0 : PyErr_SetNdrError(err);
31538 0 : return NULL;
31539 : }
31540 0 : if (!allow_remaining) {
31541 : uint32_t highest_ofs;
31542 :
31543 0 : if (pull->offset > pull->relative_highest_offset) {
31544 0 : highest_ofs = pull->offset;
31545 : } else {
31546 0 : highest_ofs = pull->relative_highest_offset;
31547 : }
31548 0 : if (highest_ofs < pull->data_size) {
31549 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31550 : "not all bytes consumed ofs[%u] size[%u]",
31551 : highest_ofs, pull->data_size);
31552 0 : TALLOC_FREE(pull);
31553 0 : PyErr_SetNdrError(err);
31554 0 : return NULL;
31555 : }
31556 : }
31557 :
31558 0 : TALLOC_FREE(pull);
31559 0 : Py_RETURN_NONE;
31560 : }
31561 :
31562 0 : static PyObject *py_netr_ServerPasswordSet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31563 : {
31564 : DATA_BLOB blob;
31565 0 : Py_ssize_t blob_length = 0;
31566 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31567 0 : PyObject *bigendian_obj = NULL;
31568 0 : PyObject *ndr64_obj = NULL;
31569 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31570 0 : PyObject *allow_remaining_obj = NULL;
31571 0 : bool allow_remaining = false;
31572 :
31573 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31574 : discard_const_p(char *, kwnames),
31575 : &blob.data, &blob_length,
31576 : &bigendian_obj,
31577 : &ndr64_obj,
31578 : &allow_remaining_obj)) {
31579 0 : return NULL;
31580 : }
31581 0 : blob.length = blob_length;
31582 :
31583 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31584 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31585 : }
31586 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31587 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31588 : }
31589 :
31590 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31591 0 : allow_remaining = true;
31592 : }
31593 :
31594 0 : return py_netr_ServerPasswordSet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31595 : }
31596 :
31597 0 : static PyObject *py_netr_ServerPasswordSet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31598 : {
31599 : DATA_BLOB blob;
31600 0 : Py_ssize_t blob_length = 0;
31601 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31602 0 : PyObject *bigendian_obj = NULL;
31603 0 : PyObject *ndr64_obj = NULL;
31604 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31605 0 : PyObject *allow_remaining_obj = NULL;
31606 0 : bool allow_remaining = false;
31607 :
31608 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31609 : discard_const_p(char *, kwnames),
31610 : &blob.data, &blob_length,
31611 : &bigendian_obj,
31612 : &ndr64_obj,
31613 : &allow_remaining_obj)) {
31614 0 : return NULL;
31615 : }
31616 0 : blob.length = blob_length;
31617 :
31618 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31619 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31620 : }
31621 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31622 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31623 : }
31624 :
31625 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31626 0 : allow_remaining = true;
31627 : }
31628 :
31629 0 : return py_netr_ServerPasswordSet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31630 : }
31631 :
31632 0 : static PyObject *py_netr_ServerPasswordSet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
31633 : {
31634 0 : const struct ndr_interface_call *call = NULL;
31635 0 : struct netr_ServerPasswordSet *object = (struct netr_ServerPasswordSet *)pytalloc_get_ptr(py_obj);
31636 : PyObject *ret;
31637 : char *retstr;
31638 :
31639 0 : if (ndr_table_netlogon.num_calls < 7) {
31640 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet_ndr_print");
31641 0 : return NULL;
31642 : }
31643 0 : call = &ndr_table_netlogon.calls[6];
31644 :
31645 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31646 0 : ret = PyUnicode_FromString(retstr);
31647 0 : TALLOC_FREE(retstr);
31648 :
31649 0 : return ret;
31650 : }
31651 :
31652 0 : static PyObject *py_netr_ServerPasswordSet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31653 : {
31654 0 : return py_netr_ServerPasswordSet_ndr_print(py_obj, "netr_ServerPasswordSet_in", NDR_IN);
31655 : }
31656 :
31657 0 : static PyObject *py_netr_ServerPasswordSet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31658 : {
31659 0 : return py_netr_ServerPasswordSet_ndr_print(py_obj, "netr_ServerPasswordSet_out", NDR_OUT);
31660 : }
31661 :
31662 : static PyMethodDef py_netr_ServerPasswordSet_methods[] = {
31663 : { "opnum", (PyCFunction)py_netr_ServerPasswordSet_ndr_opnum, METH_NOARGS|METH_CLASS,
31664 : "netlogon.netr_ServerPasswordSet.opnum() -> 6 (0x06) " },
31665 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31666 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31667 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31668 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31669 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31670 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31671 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31672 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31673 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerPasswordSet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31674 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerPasswordSet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31675 : { NULL, NULL, 0, NULL }
31676 : };
31677 :
31678 :
31679 : static PyTypeObject netr_ServerPasswordSet_Type = {
31680 : PyVarObject_HEAD_INIT(NULL, 0)
31681 : .tp_name = "netlogon.netr_ServerPasswordSet",
31682 : .tp_getset = py_netr_ServerPasswordSet_getsetters,
31683 : .tp_methods = py_netr_ServerPasswordSet_methods,
31684 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31685 : .tp_new = py_netr_ServerPasswordSet_new,
31686 : };
31687 :
31688 0 : static bool pack_py_netr_ServerPasswordSet_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerPasswordSet *r)
31689 : {
31690 : PyObject *py_server_name;
31691 : PyObject *py_account_name;
31692 : PyObject *py_secure_channel_type;
31693 : PyObject *py_computer_name;
31694 : PyObject *py_credential;
31695 : PyObject *py_new_password;
31696 0 : const char *kwnames[] = {
31697 : "server_name", "account_name", "secure_channel_type", "computer_name", "credential", "new_password", NULL
31698 : };
31699 :
31700 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_ServerPasswordSet", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential, &py_new_password)) {
31701 0 : return false;
31702 : }
31703 :
31704 0 : if (py_server_name == NULL) {
31705 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
31706 0 : return false;
31707 : }
31708 0 : if (py_server_name == Py_None) {
31709 0 : r->in.server_name = NULL;
31710 : } else {
31711 0 : r->in.server_name = NULL;
31712 : {
31713 : const char *test_str;
31714 : const char *talloc_str;
31715 0 : PyObject *unicode = NULL;
31716 0 : if (PyUnicode_Check(py_server_name)) {
31717 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
31718 0 : if (unicode == NULL) {
31719 0 : PyErr_NoMemory();
31720 0 : return false;
31721 : }
31722 0 : test_str = PyBytes_AS_STRING(unicode);
31723 0 : } else if (PyBytes_Check(py_server_name)) {
31724 0 : test_str = PyBytes_AS_STRING(py_server_name);
31725 : } else {
31726 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
31727 0 : return false;
31728 : }
31729 0 : talloc_str = talloc_strdup(r, test_str);
31730 0 : if (unicode != NULL) {
31731 0 : Py_DECREF(unicode);
31732 : }
31733 0 : if (talloc_str == NULL) {
31734 0 : PyErr_NoMemory();
31735 0 : return false;
31736 : }
31737 0 : r->in.server_name = talloc_str;
31738 : }
31739 : }
31740 0 : if (py_account_name == NULL) {
31741 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
31742 0 : return false;
31743 : }
31744 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
31745 0 : if (r->in.account_name == NULL) {
31746 0 : PyErr_NoMemory();
31747 0 : return false;
31748 : }
31749 : {
31750 : const char *test_str;
31751 : const char *talloc_str;
31752 0 : PyObject *unicode = NULL;
31753 0 : if (PyUnicode_Check(py_account_name)) {
31754 0 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
31755 0 : if (unicode == NULL) {
31756 0 : PyErr_NoMemory();
31757 0 : return false;
31758 : }
31759 0 : test_str = PyBytes_AS_STRING(unicode);
31760 0 : } else if (PyBytes_Check(py_account_name)) {
31761 0 : test_str = PyBytes_AS_STRING(py_account_name);
31762 : } else {
31763 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
31764 0 : return false;
31765 : }
31766 0 : talloc_str = talloc_strdup(r, test_str);
31767 0 : if (unicode != NULL) {
31768 0 : Py_DECREF(unicode);
31769 : }
31770 0 : if (talloc_str == NULL) {
31771 0 : PyErr_NoMemory();
31772 0 : return false;
31773 : }
31774 0 : r->in.account_name = talloc_str;
31775 : }
31776 0 : if (py_secure_channel_type == NULL) {
31777 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type");
31778 0 : return false;
31779 : }
31780 : {
31781 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type));
31782 0 : if (PyLong_Check(py_secure_channel_type)) {
31783 : unsigned long long test_var;
31784 0 : test_var = PyLong_AsUnsignedLongLong(py_secure_channel_type);
31785 0 : if (PyErr_Occurred() != NULL) {
31786 0 : return false;
31787 : }
31788 0 : if (test_var > uint_max) {
31789 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31790 : PyLong_Type.tp_name, uint_max, test_var);
31791 0 : return false;
31792 : }
31793 0 : r->in.secure_channel_type = test_var;
31794 : } else {
31795 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31796 : PyLong_Type.tp_name);
31797 0 : return false;
31798 : }
31799 : }
31800 0 : if (py_computer_name == NULL) {
31801 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
31802 0 : return false;
31803 : }
31804 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
31805 0 : if (r->in.computer_name == NULL) {
31806 0 : PyErr_NoMemory();
31807 0 : return false;
31808 : }
31809 : {
31810 : const char *test_str;
31811 : const char *talloc_str;
31812 0 : PyObject *unicode = NULL;
31813 0 : if (PyUnicode_Check(py_computer_name)) {
31814 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
31815 0 : if (unicode == NULL) {
31816 0 : PyErr_NoMemory();
31817 0 : return false;
31818 : }
31819 0 : test_str = PyBytes_AS_STRING(unicode);
31820 0 : } else if (PyBytes_Check(py_computer_name)) {
31821 0 : test_str = PyBytes_AS_STRING(py_computer_name);
31822 : } else {
31823 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
31824 0 : return false;
31825 : }
31826 0 : talloc_str = talloc_strdup(r, test_str);
31827 0 : if (unicode != NULL) {
31828 0 : Py_DECREF(unicode);
31829 : }
31830 0 : if (talloc_str == NULL) {
31831 0 : PyErr_NoMemory();
31832 0 : return false;
31833 : }
31834 0 : r->in.computer_name = talloc_str;
31835 : }
31836 0 : if (py_credential == NULL) {
31837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
31838 0 : return false;
31839 : }
31840 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
31841 0 : if (r->in.credential == NULL) {
31842 0 : PyErr_NoMemory();
31843 0 : return false;
31844 : }
31845 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
31846 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
31847 0 : PyErr_NoMemory();
31848 0 : return false;
31849 : }
31850 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
31851 0 : if (py_new_password == NULL) {
31852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_password");
31853 0 : return false;
31854 : }
31855 0 : r->in.new_password = talloc_ptrtype(r, r->in.new_password);
31856 0 : if (r->in.new_password == NULL) {
31857 0 : PyErr_NoMemory();
31858 0 : return false;
31859 : }
31860 0 : PY_CHECK_TYPE(samr_Password_Type, py_new_password, return false;);
31861 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_password)) == NULL) {
31862 0 : PyErr_NoMemory();
31863 0 : return false;
31864 : }
31865 0 : r->in.new_password = (struct samr_Password *)pytalloc_get_ptr(py_new_password);
31866 0 : return true;
31867 : }
31868 :
31869 0 : static PyObject *unpack_py_netr_ServerPasswordSet_args_out(struct netr_ServerPasswordSet *r)
31870 : {
31871 : PyObject *result;
31872 : PyObject *py_return_authenticator;
31873 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
31874 0 : result = py_return_authenticator;
31875 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
31876 0 : PyErr_SetNTSTATUS(r->out.result);
31877 0 : return NULL;
31878 : }
31879 :
31880 0 : return result;
31881 : }
31882 :
31883 :
31884 0 : static PyObject *py_netr_DatabaseDeltas_in_get_logon_server(PyObject *obj, void *closure)
31885 : {
31886 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
31887 : PyObject *py_logon_server;
31888 0 : if (object->in.logon_server == NULL) {
31889 0 : Py_RETURN_NONE;
31890 : }
31891 0 : if (object->in.logon_server == NULL) {
31892 0 : py_logon_server = Py_None;
31893 0 : Py_INCREF(py_logon_server);
31894 : } else {
31895 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
31896 : }
31897 0 : return py_logon_server;
31898 : }
31899 :
31900 0 : static int py_netr_DatabaseDeltas_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
31901 : {
31902 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
31903 0 : if (value == NULL) {
31904 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
31905 0 : return -1;
31906 : }
31907 0 : object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server);
31908 0 : if (object->in.logon_server == NULL) {
31909 0 : PyErr_NoMemory();
31910 0 : return -1;
31911 : }
31912 : {
31913 : const char *test_str;
31914 : const char *talloc_str;
31915 0 : PyObject *unicode = NULL;
31916 0 : if (PyUnicode_Check(value)) {
31917 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
31918 0 : if (unicode == NULL) {
31919 0 : PyErr_NoMemory();
31920 0 : return -1;
31921 : }
31922 0 : test_str = PyBytes_AS_STRING(unicode);
31923 0 : } else if (PyBytes_Check(value)) {
31924 0 : test_str = PyBytes_AS_STRING(value);
31925 : } else {
31926 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
31927 0 : return -1;
31928 : }
31929 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
31930 0 : if (unicode != NULL) {
31931 0 : Py_DECREF(unicode);
31932 : }
31933 0 : if (talloc_str == NULL) {
31934 0 : PyErr_NoMemory();
31935 0 : return -1;
31936 : }
31937 0 : object->in.logon_server = talloc_str;
31938 : }
31939 0 : return 0;
31940 : }
31941 :
31942 0 : static PyObject *py_netr_DatabaseDeltas_in_get_computername(PyObject *obj, void *closure)
31943 : {
31944 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
31945 : PyObject *py_computername;
31946 0 : if (object->in.computername == NULL) {
31947 0 : Py_RETURN_NONE;
31948 : }
31949 0 : if (object->in.computername == NULL) {
31950 0 : py_computername = Py_None;
31951 0 : Py_INCREF(py_computername);
31952 : } else {
31953 0 : py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore");
31954 : }
31955 0 : return py_computername;
31956 : }
31957 :
31958 0 : static int py_netr_DatabaseDeltas_in_set_computername(PyObject *py_obj, PyObject *value, void *closure)
31959 : {
31960 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
31961 0 : if (value == NULL) {
31962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername");
31963 0 : return -1;
31964 : }
31965 0 : object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername);
31966 0 : if (object->in.computername == NULL) {
31967 0 : PyErr_NoMemory();
31968 0 : return -1;
31969 : }
31970 : {
31971 : const char *test_str;
31972 : const char *talloc_str;
31973 0 : PyObject *unicode = NULL;
31974 0 : if (PyUnicode_Check(value)) {
31975 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
31976 0 : if (unicode == NULL) {
31977 0 : PyErr_NoMemory();
31978 0 : return -1;
31979 : }
31980 0 : test_str = PyBytes_AS_STRING(unicode);
31981 0 : } else if (PyBytes_Check(value)) {
31982 0 : test_str = PyBytes_AS_STRING(value);
31983 : } else {
31984 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
31985 0 : return -1;
31986 : }
31987 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
31988 0 : if (unicode != NULL) {
31989 0 : Py_DECREF(unicode);
31990 : }
31991 0 : if (talloc_str == NULL) {
31992 0 : PyErr_NoMemory();
31993 0 : return -1;
31994 : }
31995 0 : object->in.computername = talloc_str;
31996 : }
31997 0 : return 0;
31998 : }
31999 :
32000 0 : static PyObject *py_netr_DatabaseDeltas_in_get_credential(PyObject *obj, void *closure)
32001 : {
32002 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32003 : PyObject *py_credential;
32004 0 : if (object->in.credential == NULL) {
32005 0 : Py_RETURN_NONE;
32006 : }
32007 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
32008 0 : return py_credential;
32009 : }
32010 :
32011 0 : static int py_netr_DatabaseDeltas_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
32012 : {
32013 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32014 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
32015 0 : if (value == NULL) {
32016 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
32017 0 : return -1;
32018 : }
32019 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
32020 0 : if (object->in.credential == NULL) {
32021 0 : PyErr_NoMemory();
32022 0 : return -1;
32023 : }
32024 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
32025 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32026 0 : PyErr_NoMemory();
32027 0 : return -1;
32028 : }
32029 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
32030 0 : return 0;
32031 : }
32032 :
32033 0 : static PyObject *py_netr_DatabaseDeltas_in_get_return_authenticator(PyObject *obj, void *closure)
32034 : {
32035 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32036 : PyObject *py_return_authenticator;
32037 0 : if (object->in.return_authenticator == NULL) {
32038 0 : Py_RETURN_NONE;
32039 : }
32040 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
32041 0 : return py_return_authenticator;
32042 : }
32043 :
32044 0 : static int py_netr_DatabaseDeltas_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
32045 : {
32046 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32047 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
32048 0 : if (value == NULL) {
32049 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
32050 0 : return -1;
32051 : }
32052 0 : object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator);
32053 0 : if (object->in.return_authenticator == NULL) {
32054 0 : PyErr_NoMemory();
32055 0 : return -1;
32056 : }
32057 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
32058 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32059 0 : PyErr_NoMemory();
32060 0 : return -1;
32061 : }
32062 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
32063 0 : return 0;
32064 : }
32065 :
32066 0 : static PyObject *py_netr_DatabaseDeltas_out_get_return_authenticator(PyObject *obj, void *closure)
32067 : {
32068 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32069 : PyObject *py_return_authenticator;
32070 0 : if (object->out.return_authenticator == NULL) {
32071 0 : Py_RETURN_NONE;
32072 : }
32073 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
32074 0 : return py_return_authenticator;
32075 : }
32076 :
32077 0 : static int py_netr_DatabaseDeltas_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
32078 : {
32079 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32080 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
32081 0 : if (value == NULL) {
32082 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
32083 0 : return -1;
32084 : }
32085 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
32086 0 : if (object->out.return_authenticator == NULL) {
32087 0 : PyErr_NoMemory();
32088 0 : return -1;
32089 : }
32090 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
32091 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32092 0 : PyErr_NoMemory();
32093 0 : return -1;
32094 : }
32095 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
32096 0 : return 0;
32097 : }
32098 :
32099 0 : static PyObject *py_netr_DatabaseDeltas_in_get_database_id(PyObject *obj, void *closure)
32100 : {
32101 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32102 : PyObject *py_database_id;
32103 0 : py_database_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.database_id);
32104 0 : return py_database_id;
32105 : }
32106 :
32107 0 : static int py_netr_DatabaseDeltas_in_set_database_id(PyObject *py_obj, PyObject *value, void *closure)
32108 : {
32109 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32110 0 : if (value == NULL) {
32111 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.database_id");
32112 0 : return -1;
32113 : }
32114 : {
32115 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.database_id));
32116 0 : if (PyLong_Check(value)) {
32117 : unsigned long long test_var;
32118 0 : test_var = PyLong_AsUnsignedLongLong(value);
32119 0 : if (PyErr_Occurred() != NULL) {
32120 0 : return -1;
32121 : }
32122 0 : if (test_var > uint_max) {
32123 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32124 : PyLong_Type.tp_name, uint_max, test_var);
32125 0 : return -1;
32126 : }
32127 0 : object->in.database_id = test_var;
32128 : } else {
32129 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32130 : PyLong_Type.tp_name);
32131 0 : return -1;
32132 : }
32133 : }
32134 0 : return 0;
32135 : }
32136 :
32137 0 : static PyObject *py_netr_DatabaseDeltas_in_get_sequence_num(PyObject *obj, void *closure)
32138 : {
32139 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32140 : PyObject *py_sequence_num;
32141 0 : if (object->in.sequence_num == NULL) {
32142 0 : Py_RETURN_NONE;
32143 : }
32144 0 : py_sequence_num = PyLong_FromUnsignedLongLong(*object->in.sequence_num);
32145 0 : return py_sequence_num;
32146 : }
32147 :
32148 0 : static int py_netr_DatabaseDeltas_in_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
32149 : {
32150 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32151 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sequence_num));
32152 0 : if (value == NULL) {
32153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sequence_num");
32154 0 : return -1;
32155 : }
32156 0 : object->in.sequence_num = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sequence_num);
32157 0 : if (object->in.sequence_num == NULL) {
32158 0 : PyErr_NoMemory();
32159 0 : return -1;
32160 : }
32161 : {
32162 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.sequence_num));
32163 0 : if (PyLong_Check(value)) {
32164 : unsigned long long test_var;
32165 0 : test_var = PyLong_AsUnsignedLongLong(value);
32166 0 : if (PyErr_Occurred() != NULL) {
32167 0 : return -1;
32168 : }
32169 0 : if (test_var > uint_max) {
32170 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32171 : PyLong_Type.tp_name, uint_max, test_var);
32172 0 : return -1;
32173 : }
32174 0 : *object->in.sequence_num = test_var;
32175 : } else {
32176 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32177 : PyLong_Type.tp_name);
32178 0 : return -1;
32179 : }
32180 : }
32181 0 : return 0;
32182 : }
32183 :
32184 0 : static PyObject *py_netr_DatabaseDeltas_out_get_sequence_num(PyObject *obj, void *closure)
32185 : {
32186 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32187 : PyObject *py_sequence_num;
32188 0 : if (object->out.sequence_num == NULL) {
32189 0 : Py_RETURN_NONE;
32190 : }
32191 0 : py_sequence_num = PyLong_FromUnsignedLongLong(*object->out.sequence_num);
32192 0 : return py_sequence_num;
32193 : }
32194 :
32195 0 : static int py_netr_DatabaseDeltas_out_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
32196 : {
32197 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32198 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sequence_num));
32199 0 : if (value == NULL) {
32200 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sequence_num");
32201 0 : return -1;
32202 : }
32203 0 : object->out.sequence_num = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sequence_num);
32204 0 : if (object->out.sequence_num == NULL) {
32205 0 : PyErr_NoMemory();
32206 0 : return -1;
32207 : }
32208 : {
32209 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sequence_num));
32210 0 : if (PyLong_Check(value)) {
32211 : unsigned long long test_var;
32212 0 : test_var = PyLong_AsUnsignedLongLong(value);
32213 0 : if (PyErr_Occurred() != NULL) {
32214 0 : return -1;
32215 : }
32216 0 : if (test_var > uint_max) {
32217 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32218 : PyLong_Type.tp_name, uint_max, test_var);
32219 0 : return -1;
32220 : }
32221 0 : *object->out.sequence_num = test_var;
32222 : } else {
32223 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32224 : PyLong_Type.tp_name);
32225 0 : return -1;
32226 : }
32227 : }
32228 0 : return 0;
32229 : }
32230 :
32231 0 : static PyObject *py_netr_DatabaseDeltas_out_get_delta_enum_array(PyObject *obj, void *closure)
32232 : {
32233 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32234 : PyObject *py_delta_enum_array;
32235 0 : if (object->out.delta_enum_array == NULL) {
32236 0 : Py_RETURN_NONE;
32237 : }
32238 0 : if (*object->out.delta_enum_array == NULL) {
32239 0 : py_delta_enum_array = Py_None;
32240 0 : Py_INCREF(py_delta_enum_array);
32241 : } else {
32242 0 : py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *object->out.delta_enum_array, *object->out.delta_enum_array);
32243 : }
32244 0 : return py_delta_enum_array;
32245 : }
32246 :
32247 0 : static int py_netr_DatabaseDeltas_out_set_delta_enum_array(PyObject *py_obj, PyObject *value, void *closure)
32248 : {
32249 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32250 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.delta_enum_array));
32251 0 : if (value == NULL) {
32252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.delta_enum_array");
32253 0 : return -1;
32254 : }
32255 0 : object->out.delta_enum_array = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.delta_enum_array);
32256 0 : if (object->out.delta_enum_array == NULL) {
32257 0 : PyErr_NoMemory();
32258 0 : return -1;
32259 : }
32260 0 : if (value == Py_None) {
32261 0 : *object->out.delta_enum_array = NULL;
32262 : } else {
32263 0 : *object->out.delta_enum_array = NULL;
32264 0 : PY_CHECK_TYPE(&netr_DELTA_ENUM_ARRAY_Type, value, return -1;);
32265 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32266 0 : PyErr_NoMemory();
32267 0 : return -1;
32268 : }
32269 0 : *object->out.delta_enum_array = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(value);
32270 : }
32271 0 : return 0;
32272 : }
32273 :
32274 0 : static PyObject *py_netr_DatabaseDeltas_in_get_preferredmaximumlength(PyObject *obj, void *closure)
32275 : {
32276 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32277 : PyObject *py_preferredmaximumlength;
32278 0 : py_preferredmaximumlength = PyLong_FromUnsignedLongLong((uint32_t)object->in.preferredmaximumlength);
32279 0 : return py_preferredmaximumlength;
32280 : }
32281 :
32282 0 : static int py_netr_DatabaseDeltas_in_set_preferredmaximumlength(PyObject *py_obj, PyObject *value, void *closure)
32283 : {
32284 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32285 0 : if (value == NULL) {
32286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.preferredmaximumlength");
32287 0 : return -1;
32288 : }
32289 : {
32290 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.preferredmaximumlength));
32291 0 : if (PyLong_Check(value)) {
32292 : unsigned long long test_var;
32293 0 : test_var = PyLong_AsUnsignedLongLong(value);
32294 0 : if (PyErr_Occurred() != NULL) {
32295 0 : return -1;
32296 : }
32297 0 : if (test_var > uint_max) {
32298 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32299 : PyLong_Type.tp_name, uint_max, test_var);
32300 0 : return -1;
32301 : }
32302 0 : object->in.preferredmaximumlength = test_var;
32303 : } else {
32304 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32305 : PyLong_Type.tp_name);
32306 0 : return -1;
32307 : }
32308 : }
32309 0 : return 0;
32310 : }
32311 :
32312 0 : static PyObject *py_netr_DatabaseDeltas_get_result(PyObject *obj, void *closure)
32313 : {
32314 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(obj);
32315 : PyObject *py_result;
32316 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
32317 0 : return py_result;
32318 : }
32319 :
32320 0 : static int py_netr_DatabaseDeltas_set_result(PyObject *py_obj, PyObject *value, void *closure)
32321 : {
32322 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32323 0 : if (value == NULL) {
32324 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
32325 0 : return -1;
32326 : }
32327 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
32328 0 : return 0;
32329 : }
32330 :
32331 : static PyGetSetDef py_netr_DatabaseDeltas_getsetters[] = {
32332 : {
32333 : .name = discard_const_p(char, "in_logon_server"),
32334 : .get = py_netr_DatabaseDeltas_in_get_logon_server,
32335 : .set = py_netr_DatabaseDeltas_in_set_logon_server,
32336 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
32337 : },
32338 : {
32339 : .name = discard_const_p(char, "in_computername"),
32340 : .get = py_netr_DatabaseDeltas_in_get_computername,
32341 : .set = py_netr_DatabaseDeltas_in_set_computername,
32342 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
32343 : },
32344 : {
32345 : .name = discard_const_p(char, "in_credential"),
32346 : .get = py_netr_DatabaseDeltas_in_get_credential,
32347 : .set = py_netr_DatabaseDeltas_in_set_credential,
32348 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
32349 : },
32350 : {
32351 : .name = discard_const_p(char, "in_return_authenticator"),
32352 : .get = py_netr_DatabaseDeltas_in_get_return_authenticator,
32353 : .set = py_netr_DatabaseDeltas_in_set_return_authenticator,
32354 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
32355 : },
32356 : {
32357 : .name = discard_const_p(char, "out_return_authenticator"),
32358 : .get = py_netr_DatabaseDeltas_out_get_return_authenticator,
32359 : .set = py_netr_DatabaseDeltas_out_set_return_authenticator,
32360 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
32361 : },
32362 : {
32363 : .name = discard_const_p(char, "in_database_id"),
32364 : .get = py_netr_DatabaseDeltas_in_get_database_id,
32365 : .set = py_netr_DatabaseDeltas_in_set_database_id,
32366 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID")
32367 : },
32368 : {
32369 : .name = discard_const_p(char, "in_sequence_num"),
32370 : .get = py_netr_DatabaseDeltas_in_get_sequence_num,
32371 : .set = py_netr_DatabaseDeltas_in_set_sequence_num,
32372 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
32373 : },
32374 : {
32375 : .name = discard_const_p(char, "out_sequence_num"),
32376 : .get = py_netr_DatabaseDeltas_out_get_sequence_num,
32377 : .set = py_netr_DatabaseDeltas_out_set_sequence_num,
32378 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
32379 : },
32380 : {
32381 : .name = discard_const_p(char, "out_delta_enum_array"),
32382 : .get = py_netr_DatabaseDeltas_out_get_delta_enum_array,
32383 : .set = py_netr_DatabaseDeltas_out_set_delta_enum_array,
32384 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM_ARRAY")
32385 : },
32386 : {
32387 : .name = discard_const_p(char, "in_preferredmaximumlength"),
32388 : .get = py_netr_DatabaseDeltas_in_get_preferredmaximumlength,
32389 : .set = py_netr_DatabaseDeltas_in_set_preferredmaximumlength,
32390 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
32391 : },
32392 : {
32393 : .name = discard_const_p(char, "result"),
32394 : .get = py_netr_DatabaseDeltas_get_result,
32395 : .set = py_netr_DatabaseDeltas_set_result,
32396 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32397 : },
32398 : { .name = NULL }
32399 : };
32400 :
32401 0 : static PyObject *py_netr_DatabaseDeltas_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32402 : {
32403 0 : PyObject *self = pytalloc_new(struct netr_DatabaseDeltas, type);
32404 0 : struct netr_DatabaseDeltas *_self = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(self);
32405 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32406 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
32407 0 : _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
32408 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
32409 0 : _self->in.sequence_num = talloc_zero(mem_ctx, uint64_t);
32410 0 : _self->out.sequence_num = talloc_zero(mem_ctx, uint64_t);
32411 : /* a pointer to a NULL pointer */
32412 0 : _self->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
32413 0 : return self;
32414 : }
32415 :
32416 0 : static PyObject *py_netr_DatabaseDeltas_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32417 : {
32418 :
32419 :
32420 0 : return PyLong_FromLong(7);
32421 : }
32422 :
32423 0 : static PyObject *py_netr_DatabaseDeltas_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
32424 : {
32425 0 : const struct ndr_interface_call *call = NULL;
32426 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32427 0 : PyObject *ret = NULL;
32428 0 : struct ndr_push *push = NULL;
32429 : DATA_BLOB blob;
32430 : enum ndr_err_code err;
32431 :
32432 0 : if (ndr_table_netlogon.num_calls < 8) {
32433 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseDeltas_ndr_pack");
32434 0 : return NULL;
32435 : }
32436 0 : call = &ndr_table_netlogon.calls[7];
32437 :
32438 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32439 0 : if (push == NULL) {
32440 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32441 0 : return NULL;
32442 : }
32443 :
32444 0 : push->flags |= ndr_push_flags;
32445 :
32446 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32447 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32448 0 : TALLOC_FREE(push);
32449 0 : PyErr_SetNdrError(err);
32450 0 : return NULL;
32451 : }
32452 0 : blob = ndr_push_blob(push);
32453 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32454 0 : TALLOC_FREE(push);
32455 0 : return ret;
32456 : }
32457 :
32458 0 : static PyObject *py_netr_DatabaseDeltas_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32459 : {
32460 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32461 0 : PyObject *bigendian_obj = NULL;
32462 0 : PyObject *ndr64_obj = NULL;
32463 0 : uint32_t ndr_push_flags = 0;
32464 :
32465 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32466 : discard_const_p(char *, kwnames),
32467 : &bigendian_obj,
32468 : &ndr64_obj)) {
32469 0 : return NULL;
32470 : }
32471 :
32472 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32473 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32474 : }
32475 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32476 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32477 : }
32478 :
32479 0 : return py_netr_DatabaseDeltas_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32480 : }
32481 :
32482 0 : static PyObject *py_netr_DatabaseDeltas_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32483 : {
32484 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32485 0 : PyObject *bigendian_obj = NULL;
32486 0 : PyObject *ndr64_obj = NULL;
32487 0 : uint32_t ndr_push_flags = 0;
32488 :
32489 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32490 : discard_const_p(char *, kwnames),
32491 : &bigendian_obj,
32492 : &ndr64_obj)) {
32493 0 : return NULL;
32494 : }
32495 :
32496 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32497 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32498 : }
32499 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32500 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32501 : }
32502 :
32503 0 : return py_netr_DatabaseDeltas_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32504 : }
32505 :
32506 0 : static PyObject *py_netr_DatabaseDeltas_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
32507 : {
32508 0 : const struct ndr_interface_call *call = NULL;
32509 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32510 0 : struct ndr_pull *pull = NULL;
32511 : enum ndr_err_code err;
32512 :
32513 0 : if (ndr_table_netlogon.num_calls < 8) {
32514 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseDeltas_ndr_unpack");
32515 0 : return NULL;
32516 : }
32517 0 : call = &ndr_table_netlogon.calls[7];
32518 :
32519 0 : pull = ndr_pull_init_blob(blob, object);
32520 0 : if (pull == NULL) {
32521 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32522 0 : return NULL;
32523 : }
32524 :
32525 0 : pull->flags |= ndr_pull_flags;
32526 :
32527 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32528 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32529 0 : TALLOC_FREE(pull);
32530 0 : PyErr_SetNdrError(err);
32531 0 : return NULL;
32532 : }
32533 0 : if (!allow_remaining) {
32534 : uint32_t highest_ofs;
32535 :
32536 0 : if (pull->offset > pull->relative_highest_offset) {
32537 0 : highest_ofs = pull->offset;
32538 : } else {
32539 0 : highest_ofs = pull->relative_highest_offset;
32540 : }
32541 0 : if (highest_ofs < pull->data_size) {
32542 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32543 : "not all bytes consumed ofs[%u] size[%u]",
32544 : highest_ofs, pull->data_size);
32545 0 : TALLOC_FREE(pull);
32546 0 : PyErr_SetNdrError(err);
32547 0 : return NULL;
32548 : }
32549 : }
32550 :
32551 0 : TALLOC_FREE(pull);
32552 0 : Py_RETURN_NONE;
32553 : }
32554 :
32555 0 : static PyObject *py_netr_DatabaseDeltas_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32556 : {
32557 : DATA_BLOB blob;
32558 0 : Py_ssize_t blob_length = 0;
32559 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32560 0 : PyObject *bigendian_obj = NULL;
32561 0 : PyObject *ndr64_obj = NULL;
32562 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32563 0 : PyObject *allow_remaining_obj = NULL;
32564 0 : bool allow_remaining = false;
32565 :
32566 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32567 : discard_const_p(char *, kwnames),
32568 : &blob.data, &blob_length,
32569 : &bigendian_obj,
32570 : &ndr64_obj,
32571 : &allow_remaining_obj)) {
32572 0 : return NULL;
32573 : }
32574 0 : blob.length = blob_length;
32575 :
32576 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32577 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32578 : }
32579 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32580 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32581 : }
32582 :
32583 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32584 0 : allow_remaining = true;
32585 : }
32586 :
32587 0 : return py_netr_DatabaseDeltas_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32588 : }
32589 :
32590 0 : static PyObject *py_netr_DatabaseDeltas_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32591 : {
32592 : DATA_BLOB blob;
32593 0 : Py_ssize_t blob_length = 0;
32594 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32595 0 : PyObject *bigendian_obj = NULL;
32596 0 : PyObject *ndr64_obj = NULL;
32597 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32598 0 : PyObject *allow_remaining_obj = NULL;
32599 0 : bool allow_remaining = false;
32600 :
32601 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32602 : discard_const_p(char *, kwnames),
32603 : &blob.data, &blob_length,
32604 : &bigendian_obj,
32605 : &ndr64_obj,
32606 : &allow_remaining_obj)) {
32607 0 : return NULL;
32608 : }
32609 0 : blob.length = blob_length;
32610 :
32611 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32612 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32613 : }
32614 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32615 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32616 : }
32617 :
32618 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32619 0 : allow_remaining = true;
32620 : }
32621 :
32622 0 : return py_netr_DatabaseDeltas_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32623 : }
32624 :
32625 0 : static PyObject *py_netr_DatabaseDeltas_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
32626 : {
32627 0 : const struct ndr_interface_call *call = NULL;
32628 0 : struct netr_DatabaseDeltas *object = (struct netr_DatabaseDeltas *)pytalloc_get_ptr(py_obj);
32629 : PyObject *ret;
32630 : char *retstr;
32631 :
32632 0 : if (ndr_table_netlogon.num_calls < 8) {
32633 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseDeltas_ndr_print");
32634 0 : return NULL;
32635 : }
32636 0 : call = &ndr_table_netlogon.calls[7];
32637 :
32638 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32639 0 : ret = PyUnicode_FromString(retstr);
32640 0 : TALLOC_FREE(retstr);
32641 :
32642 0 : return ret;
32643 : }
32644 :
32645 0 : static PyObject *py_netr_DatabaseDeltas_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32646 : {
32647 0 : return py_netr_DatabaseDeltas_ndr_print(py_obj, "netr_DatabaseDeltas_in", NDR_IN);
32648 : }
32649 :
32650 0 : static PyObject *py_netr_DatabaseDeltas_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32651 : {
32652 0 : return py_netr_DatabaseDeltas_ndr_print(py_obj, "netr_DatabaseDeltas_out", NDR_OUT);
32653 : }
32654 :
32655 : static PyMethodDef py_netr_DatabaseDeltas_methods[] = {
32656 : { "opnum", (PyCFunction)py_netr_DatabaseDeltas_ndr_opnum, METH_NOARGS|METH_CLASS,
32657 : "netlogon.netr_DatabaseDeltas.opnum() -> 7 (0x07) " },
32658 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseDeltas_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32659 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32660 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseDeltas_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32661 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32662 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseDeltas_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32663 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32664 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseDeltas_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32665 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32666 : { "__ndr_print_in__", (PyCFunction)py_netr_DatabaseDeltas_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32667 : { "__ndr_print_out__", (PyCFunction)py_netr_DatabaseDeltas_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32668 : { NULL, NULL, 0, NULL }
32669 : };
32670 :
32671 :
32672 : static PyTypeObject netr_DatabaseDeltas_Type = {
32673 : PyVarObject_HEAD_INIT(NULL, 0)
32674 : .tp_name = "netlogon.netr_DatabaseDeltas",
32675 : .tp_getset = py_netr_DatabaseDeltas_getsetters,
32676 : .tp_methods = py_netr_DatabaseDeltas_methods,
32677 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32678 : .tp_new = py_netr_DatabaseDeltas_new,
32679 : };
32680 :
32681 0 : static bool pack_py_netr_DatabaseDeltas_args_in(PyObject *args, PyObject *kwargs, struct netr_DatabaseDeltas *r)
32682 : {
32683 : PyObject *py_logon_server;
32684 : PyObject *py_computername;
32685 : PyObject *py_credential;
32686 : PyObject *py_return_authenticator;
32687 : PyObject *py_database_id;
32688 : PyObject *py_sequence_num;
32689 : PyObject *py_preferredmaximumlength;
32690 0 : const char *kwnames[] = {
32691 : "logon_server", "computername", "credential", "return_authenticator", "database_id", "sequence_num", "preferredmaximumlength", NULL
32692 : };
32693 :
32694 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:netr_DatabaseDeltas", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_database_id, &py_sequence_num, &py_preferredmaximumlength)) {
32695 0 : return false;
32696 : }
32697 :
32698 0 : if (py_logon_server == NULL) {
32699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
32700 0 : return false;
32701 : }
32702 0 : r->in.logon_server = talloc_ptrtype(r, r->in.logon_server);
32703 0 : if (r->in.logon_server == NULL) {
32704 0 : PyErr_NoMemory();
32705 0 : return false;
32706 : }
32707 : {
32708 : const char *test_str;
32709 : const char *talloc_str;
32710 0 : PyObject *unicode = NULL;
32711 0 : if (PyUnicode_Check(py_logon_server)) {
32712 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
32713 0 : if (unicode == NULL) {
32714 0 : PyErr_NoMemory();
32715 0 : return false;
32716 : }
32717 0 : test_str = PyBytes_AS_STRING(unicode);
32718 0 : } else if (PyBytes_Check(py_logon_server)) {
32719 0 : test_str = PyBytes_AS_STRING(py_logon_server);
32720 : } else {
32721 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
32722 0 : return false;
32723 : }
32724 0 : talloc_str = talloc_strdup(r, test_str);
32725 0 : if (unicode != NULL) {
32726 0 : Py_DECREF(unicode);
32727 : }
32728 0 : if (talloc_str == NULL) {
32729 0 : PyErr_NoMemory();
32730 0 : return false;
32731 : }
32732 0 : r->in.logon_server = talloc_str;
32733 : }
32734 0 : if (py_computername == NULL) {
32735 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername");
32736 0 : return false;
32737 : }
32738 0 : r->in.computername = talloc_ptrtype(r, r->in.computername);
32739 0 : if (r->in.computername == NULL) {
32740 0 : PyErr_NoMemory();
32741 0 : return false;
32742 : }
32743 : {
32744 : const char *test_str;
32745 : const char *talloc_str;
32746 0 : PyObject *unicode = NULL;
32747 0 : if (PyUnicode_Check(py_computername)) {
32748 0 : unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore");
32749 0 : if (unicode == NULL) {
32750 0 : PyErr_NoMemory();
32751 0 : return false;
32752 : }
32753 0 : test_str = PyBytes_AS_STRING(unicode);
32754 0 : } else if (PyBytes_Check(py_computername)) {
32755 0 : test_str = PyBytes_AS_STRING(py_computername);
32756 : } else {
32757 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->tp_name);
32758 0 : return false;
32759 : }
32760 0 : talloc_str = talloc_strdup(r, test_str);
32761 0 : if (unicode != NULL) {
32762 0 : Py_DECREF(unicode);
32763 : }
32764 0 : if (talloc_str == NULL) {
32765 0 : PyErr_NoMemory();
32766 0 : return false;
32767 : }
32768 0 : r->in.computername = talloc_str;
32769 : }
32770 0 : if (py_credential == NULL) {
32771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
32772 0 : return false;
32773 : }
32774 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
32775 0 : if (r->in.credential == NULL) {
32776 0 : PyErr_NoMemory();
32777 0 : return false;
32778 : }
32779 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
32780 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
32781 0 : PyErr_NoMemory();
32782 0 : return false;
32783 : }
32784 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
32785 0 : if (py_return_authenticator == NULL) {
32786 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
32787 0 : return false;
32788 : }
32789 0 : r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator);
32790 0 : if (r->in.return_authenticator == NULL) {
32791 0 : PyErr_NoMemory();
32792 0 : return false;
32793 : }
32794 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
32795 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
32796 0 : PyErr_NoMemory();
32797 0 : return false;
32798 : }
32799 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
32800 0 : if (py_database_id == NULL) {
32801 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.database_id");
32802 0 : return false;
32803 : }
32804 : {
32805 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.database_id));
32806 0 : if (PyLong_Check(py_database_id)) {
32807 : unsigned long long test_var;
32808 0 : test_var = PyLong_AsUnsignedLongLong(py_database_id);
32809 0 : if (PyErr_Occurred() != NULL) {
32810 0 : return false;
32811 : }
32812 0 : if (test_var > uint_max) {
32813 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32814 : PyLong_Type.tp_name, uint_max, test_var);
32815 0 : return false;
32816 : }
32817 0 : r->in.database_id = test_var;
32818 : } else {
32819 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32820 : PyLong_Type.tp_name);
32821 0 : return false;
32822 : }
32823 : }
32824 0 : if (py_sequence_num == NULL) {
32825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sequence_num");
32826 0 : return false;
32827 : }
32828 0 : r->in.sequence_num = talloc_ptrtype(r, r->in.sequence_num);
32829 0 : if (r->in.sequence_num == NULL) {
32830 0 : PyErr_NoMemory();
32831 0 : return false;
32832 : }
32833 : {
32834 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.sequence_num));
32835 0 : if (PyLong_Check(py_sequence_num)) {
32836 : unsigned long long test_var;
32837 0 : test_var = PyLong_AsUnsignedLongLong(py_sequence_num);
32838 0 : if (PyErr_Occurred() != NULL) {
32839 0 : return false;
32840 : }
32841 0 : if (test_var > uint_max) {
32842 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32843 : PyLong_Type.tp_name, uint_max, test_var);
32844 0 : return false;
32845 : }
32846 0 : *r->in.sequence_num = test_var;
32847 : } else {
32848 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32849 : PyLong_Type.tp_name);
32850 0 : return false;
32851 : }
32852 : }
32853 0 : if (py_preferredmaximumlength == NULL) {
32854 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.preferredmaximumlength");
32855 0 : return false;
32856 : }
32857 : {
32858 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.preferredmaximumlength));
32859 0 : if (PyLong_Check(py_preferredmaximumlength)) {
32860 : unsigned long long test_var;
32861 0 : test_var = PyLong_AsUnsignedLongLong(py_preferredmaximumlength);
32862 0 : if (PyErr_Occurred() != NULL) {
32863 0 : return false;
32864 : }
32865 0 : if (test_var > uint_max) {
32866 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32867 : PyLong_Type.tp_name, uint_max, test_var);
32868 0 : return false;
32869 : }
32870 0 : r->in.preferredmaximumlength = test_var;
32871 : } else {
32872 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32873 : PyLong_Type.tp_name);
32874 0 : return false;
32875 : }
32876 : }
32877 0 : return true;
32878 : }
32879 :
32880 0 : static PyObject *unpack_py_netr_DatabaseDeltas_args_out(struct netr_DatabaseDeltas *r)
32881 : {
32882 : PyObject *result;
32883 : PyObject *py_return_authenticator;
32884 : PyObject *py_sequence_num;
32885 : PyObject *py_delta_enum_array;
32886 0 : result = PyTuple_New(3);
32887 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
32888 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
32889 0 : py_sequence_num = PyLong_FromUnsignedLongLong(*r->out.sequence_num);
32890 0 : PyTuple_SetItem(result, 1, py_sequence_num);
32891 0 : if (*r->out.delta_enum_array == NULL) {
32892 0 : py_delta_enum_array = Py_None;
32893 0 : Py_INCREF(py_delta_enum_array);
32894 : } else {
32895 0 : py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *r->out.delta_enum_array, *r->out.delta_enum_array);
32896 : }
32897 0 : PyTuple_SetItem(result, 2, py_delta_enum_array);
32898 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
32899 0 : PyErr_SetNTSTATUS(r->out.result);
32900 0 : return NULL;
32901 : }
32902 :
32903 0 : return result;
32904 : }
32905 :
32906 :
32907 0 : static PyObject *py_netr_DatabaseSync_in_get_logon_server(PyObject *obj, void *closure)
32908 : {
32909 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
32910 : PyObject *py_logon_server;
32911 0 : if (object->in.logon_server == NULL) {
32912 0 : Py_RETURN_NONE;
32913 : }
32914 0 : if (object->in.logon_server == NULL) {
32915 0 : py_logon_server = Py_None;
32916 0 : Py_INCREF(py_logon_server);
32917 : } else {
32918 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
32919 : }
32920 0 : return py_logon_server;
32921 : }
32922 :
32923 0 : static int py_netr_DatabaseSync_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
32924 : {
32925 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
32926 0 : if (value == NULL) {
32927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
32928 0 : return -1;
32929 : }
32930 0 : object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server);
32931 0 : if (object->in.logon_server == NULL) {
32932 0 : PyErr_NoMemory();
32933 0 : return -1;
32934 : }
32935 : {
32936 : const char *test_str;
32937 : const char *talloc_str;
32938 0 : PyObject *unicode = NULL;
32939 0 : if (PyUnicode_Check(value)) {
32940 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
32941 0 : if (unicode == NULL) {
32942 0 : PyErr_NoMemory();
32943 0 : return -1;
32944 : }
32945 0 : test_str = PyBytes_AS_STRING(unicode);
32946 0 : } else if (PyBytes_Check(value)) {
32947 0 : test_str = PyBytes_AS_STRING(value);
32948 : } else {
32949 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
32950 0 : return -1;
32951 : }
32952 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
32953 0 : if (unicode != NULL) {
32954 0 : Py_DECREF(unicode);
32955 : }
32956 0 : if (talloc_str == NULL) {
32957 0 : PyErr_NoMemory();
32958 0 : return -1;
32959 : }
32960 0 : object->in.logon_server = talloc_str;
32961 : }
32962 0 : return 0;
32963 : }
32964 :
32965 0 : static PyObject *py_netr_DatabaseSync_in_get_computername(PyObject *obj, void *closure)
32966 : {
32967 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
32968 : PyObject *py_computername;
32969 0 : if (object->in.computername == NULL) {
32970 0 : Py_RETURN_NONE;
32971 : }
32972 0 : if (object->in.computername == NULL) {
32973 0 : py_computername = Py_None;
32974 0 : Py_INCREF(py_computername);
32975 : } else {
32976 0 : py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore");
32977 : }
32978 0 : return py_computername;
32979 : }
32980 :
32981 0 : static int py_netr_DatabaseSync_in_set_computername(PyObject *py_obj, PyObject *value, void *closure)
32982 : {
32983 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
32984 0 : if (value == NULL) {
32985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername");
32986 0 : return -1;
32987 : }
32988 0 : object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername);
32989 0 : if (object->in.computername == NULL) {
32990 0 : PyErr_NoMemory();
32991 0 : return -1;
32992 : }
32993 : {
32994 : const char *test_str;
32995 : const char *talloc_str;
32996 0 : PyObject *unicode = NULL;
32997 0 : if (PyUnicode_Check(value)) {
32998 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
32999 0 : if (unicode == NULL) {
33000 0 : PyErr_NoMemory();
33001 0 : return -1;
33002 : }
33003 0 : test_str = PyBytes_AS_STRING(unicode);
33004 0 : } else if (PyBytes_Check(value)) {
33005 0 : test_str = PyBytes_AS_STRING(value);
33006 : } else {
33007 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
33008 0 : return -1;
33009 : }
33010 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
33011 0 : if (unicode != NULL) {
33012 0 : Py_DECREF(unicode);
33013 : }
33014 0 : if (talloc_str == NULL) {
33015 0 : PyErr_NoMemory();
33016 0 : return -1;
33017 : }
33018 0 : object->in.computername = talloc_str;
33019 : }
33020 0 : return 0;
33021 : }
33022 :
33023 0 : static PyObject *py_netr_DatabaseSync_in_get_credential(PyObject *obj, void *closure)
33024 : {
33025 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33026 : PyObject *py_credential;
33027 0 : if (object->in.credential == NULL) {
33028 0 : Py_RETURN_NONE;
33029 : }
33030 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
33031 0 : return py_credential;
33032 : }
33033 :
33034 0 : static int py_netr_DatabaseSync_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
33035 : {
33036 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33037 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
33038 0 : if (value == NULL) {
33039 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
33040 0 : return -1;
33041 : }
33042 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
33043 0 : if (object->in.credential == NULL) {
33044 0 : PyErr_NoMemory();
33045 0 : return -1;
33046 : }
33047 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
33048 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33049 0 : PyErr_NoMemory();
33050 0 : return -1;
33051 : }
33052 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
33053 0 : return 0;
33054 : }
33055 :
33056 0 : static PyObject *py_netr_DatabaseSync_in_get_return_authenticator(PyObject *obj, void *closure)
33057 : {
33058 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33059 : PyObject *py_return_authenticator;
33060 0 : if (object->in.return_authenticator == NULL) {
33061 0 : Py_RETURN_NONE;
33062 : }
33063 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
33064 0 : return py_return_authenticator;
33065 : }
33066 :
33067 0 : static int py_netr_DatabaseSync_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
33068 : {
33069 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33070 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
33071 0 : if (value == NULL) {
33072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
33073 0 : return -1;
33074 : }
33075 0 : object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator);
33076 0 : if (object->in.return_authenticator == NULL) {
33077 0 : PyErr_NoMemory();
33078 0 : return -1;
33079 : }
33080 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
33081 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33082 0 : PyErr_NoMemory();
33083 0 : return -1;
33084 : }
33085 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
33086 0 : return 0;
33087 : }
33088 :
33089 0 : static PyObject *py_netr_DatabaseSync_out_get_return_authenticator(PyObject *obj, void *closure)
33090 : {
33091 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33092 : PyObject *py_return_authenticator;
33093 0 : if (object->out.return_authenticator == NULL) {
33094 0 : Py_RETURN_NONE;
33095 : }
33096 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
33097 0 : return py_return_authenticator;
33098 : }
33099 :
33100 0 : static int py_netr_DatabaseSync_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
33101 : {
33102 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33103 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
33104 0 : if (value == NULL) {
33105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
33106 0 : return -1;
33107 : }
33108 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
33109 0 : if (object->out.return_authenticator == NULL) {
33110 0 : PyErr_NoMemory();
33111 0 : return -1;
33112 : }
33113 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
33114 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33115 0 : PyErr_NoMemory();
33116 0 : return -1;
33117 : }
33118 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
33119 0 : return 0;
33120 : }
33121 :
33122 0 : static PyObject *py_netr_DatabaseSync_in_get_database_id(PyObject *obj, void *closure)
33123 : {
33124 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33125 : PyObject *py_database_id;
33126 0 : py_database_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.database_id);
33127 0 : return py_database_id;
33128 : }
33129 :
33130 0 : static int py_netr_DatabaseSync_in_set_database_id(PyObject *py_obj, PyObject *value, void *closure)
33131 : {
33132 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33133 0 : if (value == NULL) {
33134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.database_id");
33135 0 : return -1;
33136 : }
33137 : {
33138 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.database_id));
33139 0 : if (PyLong_Check(value)) {
33140 : unsigned long long test_var;
33141 0 : test_var = PyLong_AsUnsignedLongLong(value);
33142 0 : if (PyErr_Occurred() != NULL) {
33143 0 : return -1;
33144 : }
33145 0 : if (test_var > uint_max) {
33146 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33147 : PyLong_Type.tp_name, uint_max, test_var);
33148 0 : return -1;
33149 : }
33150 0 : object->in.database_id = test_var;
33151 : } else {
33152 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33153 : PyLong_Type.tp_name);
33154 0 : return -1;
33155 : }
33156 : }
33157 0 : return 0;
33158 : }
33159 :
33160 0 : static PyObject *py_netr_DatabaseSync_in_get_sync_context(PyObject *obj, void *closure)
33161 : {
33162 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33163 : PyObject *py_sync_context;
33164 0 : if (object->in.sync_context == NULL) {
33165 0 : Py_RETURN_NONE;
33166 : }
33167 0 : py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*object->in.sync_context);
33168 0 : return py_sync_context;
33169 : }
33170 :
33171 0 : static int py_netr_DatabaseSync_in_set_sync_context(PyObject *py_obj, PyObject *value, void *closure)
33172 : {
33173 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33174 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sync_context));
33175 0 : if (value == NULL) {
33176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sync_context");
33177 0 : return -1;
33178 : }
33179 0 : object->in.sync_context = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sync_context);
33180 0 : if (object->in.sync_context == NULL) {
33181 0 : PyErr_NoMemory();
33182 0 : return -1;
33183 : }
33184 : {
33185 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.sync_context));
33186 0 : if (PyLong_Check(value)) {
33187 : unsigned long long test_var;
33188 0 : test_var = PyLong_AsUnsignedLongLong(value);
33189 0 : if (PyErr_Occurred() != NULL) {
33190 0 : return -1;
33191 : }
33192 0 : if (test_var > uint_max) {
33193 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33194 : PyLong_Type.tp_name, uint_max, test_var);
33195 0 : return -1;
33196 : }
33197 0 : *object->in.sync_context = test_var;
33198 : } else {
33199 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33200 : PyLong_Type.tp_name);
33201 0 : return -1;
33202 : }
33203 : }
33204 0 : return 0;
33205 : }
33206 :
33207 0 : static PyObject *py_netr_DatabaseSync_out_get_sync_context(PyObject *obj, void *closure)
33208 : {
33209 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33210 : PyObject *py_sync_context;
33211 0 : if (object->out.sync_context == NULL) {
33212 0 : Py_RETURN_NONE;
33213 : }
33214 0 : py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*object->out.sync_context);
33215 0 : return py_sync_context;
33216 : }
33217 :
33218 0 : static int py_netr_DatabaseSync_out_set_sync_context(PyObject *py_obj, PyObject *value, void *closure)
33219 : {
33220 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33221 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sync_context));
33222 0 : if (value == NULL) {
33223 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sync_context");
33224 0 : return -1;
33225 : }
33226 0 : object->out.sync_context = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sync_context);
33227 0 : if (object->out.sync_context == NULL) {
33228 0 : PyErr_NoMemory();
33229 0 : return -1;
33230 : }
33231 : {
33232 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sync_context));
33233 0 : if (PyLong_Check(value)) {
33234 : unsigned long long test_var;
33235 0 : test_var = PyLong_AsUnsignedLongLong(value);
33236 0 : if (PyErr_Occurred() != NULL) {
33237 0 : return -1;
33238 : }
33239 0 : if (test_var > uint_max) {
33240 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33241 : PyLong_Type.tp_name, uint_max, test_var);
33242 0 : return -1;
33243 : }
33244 0 : *object->out.sync_context = test_var;
33245 : } else {
33246 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33247 : PyLong_Type.tp_name);
33248 0 : return -1;
33249 : }
33250 : }
33251 0 : return 0;
33252 : }
33253 :
33254 0 : static PyObject *py_netr_DatabaseSync_out_get_delta_enum_array(PyObject *obj, void *closure)
33255 : {
33256 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33257 : PyObject *py_delta_enum_array;
33258 0 : if (object->out.delta_enum_array == NULL) {
33259 0 : Py_RETURN_NONE;
33260 : }
33261 0 : if (*object->out.delta_enum_array == NULL) {
33262 0 : py_delta_enum_array = Py_None;
33263 0 : Py_INCREF(py_delta_enum_array);
33264 : } else {
33265 0 : py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *object->out.delta_enum_array, *object->out.delta_enum_array);
33266 : }
33267 0 : return py_delta_enum_array;
33268 : }
33269 :
33270 0 : static int py_netr_DatabaseSync_out_set_delta_enum_array(PyObject *py_obj, PyObject *value, void *closure)
33271 : {
33272 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33273 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.delta_enum_array));
33274 0 : if (value == NULL) {
33275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.delta_enum_array");
33276 0 : return -1;
33277 : }
33278 0 : object->out.delta_enum_array = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.delta_enum_array);
33279 0 : if (object->out.delta_enum_array == NULL) {
33280 0 : PyErr_NoMemory();
33281 0 : return -1;
33282 : }
33283 0 : if (value == Py_None) {
33284 0 : *object->out.delta_enum_array = NULL;
33285 : } else {
33286 0 : *object->out.delta_enum_array = NULL;
33287 0 : PY_CHECK_TYPE(&netr_DELTA_ENUM_ARRAY_Type, value, return -1;);
33288 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33289 0 : PyErr_NoMemory();
33290 0 : return -1;
33291 : }
33292 0 : *object->out.delta_enum_array = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(value);
33293 : }
33294 0 : return 0;
33295 : }
33296 :
33297 0 : static PyObject *py_netr_DatabaseSync_in_get_preferredmaximumlength(PyObject *obj, void *closure)
33298 : {
33299 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33300 : PyObject *py_preferredmaximumlength;
33301 0 : py_preferredmaximumlength = PyLong_FromUnsignedLongLong((uint32_t)object->in.preferredmaximumlength);
33302 0 : return py_preferredmaximumlength;
33303 : }
33304 :
33305 0 : static int py_netr_DatabaseSync_in_set_preferredmaximumlength(PyObject *py_obj, PyObject *value, void *closure)
33306 : {
33307 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33308 0 : if (value == NULL) {
33309 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.preferredmaximumlength");
33310 0 : return -1;
33311 : }
33312 : {
33313 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.preferredmaximumlength));
33314 0 : if (PyLong_Check(value)) {
33315 : unsigned long long test_var;
33316 0 : test_var = PyLong_AsUnsignedLongLong(value);
33317 0 : if (PyErr_Occurred() != NULL) {
33318 0 : return -1;
33319 : }
33320 0 : if (test_var > uint_max) {
33321 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33322 : PyLong_Type.tp_name, uint_max, test_var);
33323 0 : return -1;
33324 : }
33325 0 : object->in.preferredmaximumlength = test_var;
33326 : } else {
33327 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33328 : PyLong_Type.tp_name);
33329 0 : return -1;
33330 : }
33331 : }
33332 0 : return 0;
33333 : }
33334 :
33335 0 : static PyObject *py_netr_DatabaseSync_get_result(PyObject *obj, void *closure)
33336 : {
33337 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(obj);
33338 : PyObject *py_result;
33339 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
33340 0 : return py_result;
33341 : }
33342 :
33343 0 : static int py_netr_DatabaseSync_set_result(PyObject *py_obj, PyObject *value, void *closure)
33344 : {
33345 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33346 0 : if (value == NULL) {
33347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
33348 0 : return -1;
33349 : }
33350 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
33351 0 : return 0;
33352 : }
33353 :
33354 : static PyGetSetDef py_netr_DatabaseSync_getsetters[] = {
33355 : {
33356 : .name = discard_const_p(char, "in_logon_server"),
33357 : .get = py_netr_DatabaseSync_in_get_logon_server,
33358 : .set = py_netr_DatabaseSync_in_set_logon_server,
33359 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
33360 : },
33361 : {
33362 : .name = discard_const_p(char, "in_computername"),
33363 : .get = py_netr_DatabaseSync_in_get_computername,
33364 : .set = py_netr_DatabaseSync_in_set_computername,
33365 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
33366 : },
33367 : {
33368 : .name = discard_const_p(char, "in_credential"),
33369 : .get = py_netr_DatabaseSync_in_get_credential,
33370 : .set = py_netr_DatabaseSync_in_set_credential,
33371 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
33372 : },
33373 : {
33374 : .name = discard_const_p(char, "in_return_authenticator"),
33375 : .get = py_netr_DatabaseSync_in_get_return_authenticator,
33376 : .set = py_netr_DatabaseSync_in_set_return_authenticator,
33377 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
33378 : },
33379 : {
33380 : .name = discard_const_p(char, "out_return_authenticator"),
33381 : .get = py_netr_DatabaseSync_out_get_return_authenticator,
33382 : .set = py_netr_DatabaseSync_out_set_return_authenticator,
33383 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
33384 : },
33385 : {
33386 : .name = discard_const_p(char, "in_database_id"),
33387 : .get = py_netr_DatabaseSync_in_get_database_id,
33388 : .set = py_netr_DatabaseSync_in_set_database_id,
33389 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID")
33390 : },
33391 : {
33392 : .name = discard_const_p(char, "in_sync_context"),
33393 : .get = py_netr_DatabaseSync_in_get_sync_context,
33394 : .set = py_netr_DatabaseSync_in_set_sync_context,
33395 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33396 : },
33397 : {
33398 : .name = discard_const_p(char, "out_sync_context"),
33399 : .get = py_netr_DatabaseSync_out_get_sync_context,
33400 : .set = py_netr_DatabaseSync_out_set_sync_context,
33401 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33402 : },
33403 : {
33404 : .name = discard_const_p(char, "out_delta_enum_array"),
33405 : .get = py_netr_DatabaseSync_out_get_delta_enum_array,
33406 : .set = py_netr_DatabaseSync_out_set_delta_enum_array,
33407 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM_ARRAY")
33408 : },
33409 : {
33410 : .name = discard_const_p(char, "in_preferredmaximumlength"),
33411 : .get = py_netr_DatabaseSync_in_get_preferredmaximumlength,
33412 : .set = py_netr_DatabaseSync_in_set_preferredmaximumlength,
33413 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
33414 : },
33415 : {
33416 : .name = discard_const_p(char, "result"),
33417 : .get = py_netr_DatabaseSync_get_result,
33418 : .set = py_netr_DatabaseSync_set_result,
33419 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
33420 : },
33421 : { .name = NULL }
33422 : };
33423 :
33424 0 : static PyObject *py_netr_DatabaseSync_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
33425 : {
33426 0 : PyObject *self = pytalloc_new(struct netr_DatabaseSync, type);
33427 0 : struct netr_DatabaseSync *_self = (struct netr_DatabaseSync *)pytalloc_get_ptr(self);
33428 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
33429 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
33430 0 : _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
33431 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
33432 0 : _self->in.sync_context = talloc_zero(mem_ctx, uint32_t);
33433 0 : _self->out.sync_context = talloc_zero(mem_ctx, uint32_t);
33434 : /* a pointer to a NULL pointer */
33435 0 : _self->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
33436 0 : return self;
33437 : }
33438 :
33439 0 : static PyObject *py_netr_DatabaseSync_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
33440 : {
33441 :
33442 :
33443 0 : return PyLong_FromLong(8);
33444 : }
33445 :
33446 0 : static PyObject *py_netr_DatabaseSync_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
33447 : {
33448 0 : const struct ndr_interface_call *call = NULL;
33449 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33450 0 : PyObject *ret = NULL;
33451 0 : struct ndr_push *push = NULL;
33452 : DATA_BLOB blob;
33453 : enum ndr_err_code err;
33454 :
33455 0 : if (ndr_table_netlogon.num_calls < 9) {
33456 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync_ndr_pack");
33457 0 : return NULL;
33458 : }
33459 0 : call = &ndr_table_netlogon.calls[8];
33460 :
33461 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
33462 0 : if (push == NULL) {
33463 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33464 0 : return NULL;
33465 : }
33466 :
33467 0 : push->flags |= ndr_push_flags;
33468 :
33469 0 : err = call->ndr_push(push, ndr_inout_flags, object);
33470 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33471 0 : TALLOC_FREE(push);
33472 0 : PyErr_SetNdrError(err);
33473 0 : return NULL;
33474 : }
33475 0 : blob = ndr_push_blob(push);
33476 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
33477 0 : TALLOC_FREE(push);
33478 0 : return ret;
33479 : }
33480 :
33481 0 : static PyObject *py_netr_DatabaseSync_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33482 : {
33483 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33484 0 : PyObject *bigendian_obj = NULL;
33485 0 : PyObject *ndr64_obj = NULL;
33486 0 : uint32_t ndr_push_flags = 0;
33487 :
33488 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
33489 : discard_const_p(char *, kwnames),
33490 : &bigendian_obj,
33491 : &ndr64_obj)) {
33492 0 : return NULL;
33493 : }
33494 :
33495 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33496 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33497 : }
33498 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33499 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33500 : }
33501 :
33502 0 : return py_netr_DatabaseSync_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
33503 : }
33504 :
33505 0 : static PyObject *py_netr_DatabaseSync_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33506 : {
33507 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33508 0 : PyObject *bigendian_obj = NULL;
33509 0 : PyObject *ndr64_obj = NULL;
33510 0 : uint32_t ndr_push_flags = 0;
33511 :
33512 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
33513 : discard_const_p(char *, kwnames),
33514 : &bigendian_obj,
33515 : &ndr64_obj)) {
33516 0 : return NULL;
33517 : }
33518 :
33519 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33520 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33521 : }
33522 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33523 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33524 : }
33525 :
33526 0 : return py_netr_DatabaseSync_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
33527 : }
33528 :
33529 0 : static PyObject *py_netr_DatabaseSync_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
33530 : {
33531 0 : const struct ndr_interface_call *call = NULL;
33532 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33533 0 : struct ndr_pull *pull = NULL;
33534 : enum ndr_err_code err;
33535 :
33536 0 : if (ndr_table_netlogon.num_calls < 9) {
33537 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync_ndr_unpack");
33538 0 : return NULL;
33539 : }
33540 0 : call = &ndr_table_netlogon.calls[8];
33541 :
33542 0 : pull = ndr_pull_init_blob(blob, object);
33543 0 : if (pull == NULL) {
33544 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33545 0 : return NULL;
33546 : }
33547 :
33548 0 : pull->flags |= ndr_pull_flags;
33549 :
33550 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
33551 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33552 0 : TALLOC_FREE(pull);
33553 0 : PyErr_SetNdrError(err);
33554 0 : return NULL;
33555 : }
33556 0 : if (!allow_remaining) {
33557 : uint32_t highest_ofs;
33558 :
33559 0 : if (pull->offset > pull->relative_highest_offset) {
33560 0 : highest_ofs = pull->offset;
33561 : } else {
33562 0 : highest_ofs = pull->relative_highest_offset;
33563 : }
33564 0 : if (highest_ofs < pull->data_size) {
33565 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
33566 : "not all bytes consumed ofs[%u] size[%u]",
33567 : highest_ofs, pull->data_size);
33568 0 : TALLOC_FREE(pull);
33569 0 : PyErr_SetNdrError(err);
33570 0 : return NULL;
33571 : }
33572 : }
33573 :
33574 0 : TALLOC_FREE(pull);
33575 0 : Py_RETURN_NONE;
33576 : }
33577 :
33578 0 : static PyObject *py_netr_DatabaseSync_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33579 : {
33580 : DATA_BLOB blob;
33581 0 : Py_ssize_t blob_length = 0;
33582 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33583 0 : PyObject *bigendian_obj = NULL;
33584 0 : PyObject *ndr64_obj = NULL;
33585 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33586 0 : PyObject *allow_remaining_obj = NULL;
33587 0 : bool allow_remaining = false;
33588 :
33589 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33590 : discard_const_p(char *, kwnames),
33591 : &blob.data, &blob_length,
33592 : &bigendian_obj,
33593 : &ndr64_obj,
33594 : &allow_remaining_obj)) {
33595 0 : return NULL;
33596 : }
33597 0 : blob.length = blob_length;
33598 :
33599 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33600 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33601 : }
33602 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33603 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33604 : }
33605 :
33606 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33607 0 : allow_remaining = true;
33608 : }
33609 :
33610 0 : return py_netr_DatabaseSync_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33611 : }
33612 :
33613 0 : static PyObject *py_netr_DatabaseSync_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33614 : {
33615 : DATA_BLOB blob;
33616 0 : Py_ssize_t blob_length = 0;
33617 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33618 0 : PyObject *bigendian_obj = NULL;
33619 0 : PyObject *ndr64_obj = NULL;
33620 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33621 0 : PyObject *allow_remaining_obj = NULL;
33622 0 : bool allow_remaining = false;
33623 :
33624 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33625 : discard_const_p(char *, kwnames),
33626 : &blob.data, &blob_length,
33627 : &bigendian_obj,
33628 : &ndr64_obj,
33629 : &allow_remaining_obj)) {
33630 0 : return NULL;
33631 : }
33632 0 : blob.length = blob_length;
33633 :
33634 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33635 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33636 : }
33637 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33638 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33639 : }
33640 :
33641 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33642 0 : allow_remaining = true;
33643 : }
33644 :
33645 0 : return py_netr_DatabaseSync_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33646 : }
33647 :
33648 0 : static PyObject *py_netr_DatabaseSync_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
33649 : {
33650 0 : const struct ndr_interface_call *call = NULL;
33651 0 : struct netr_DatabaseSync *object = (struct netr_DatabaseSync *)pytalloc_get_ptr(py_obj);
33652 : PyObject *ret;
33653 : char *retstr;
33654 :
33655 0 : if (ndr_table_netlogon.num_calls < 9) {
33656 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync_ndr_print");
33657 0 : return NULL;
33658 : }
33659 0 : call = &ndr_table_netlogon.calls[8];
33660 :
33661 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33662 0 : ret = PyUnicode_FromString(retstr);
33663 0 : TALLOC_FREE(retstr);
33664 :
33665 0 : return ret;
33666 : }
33667 :
33668 0 : static PyObject *py_netr_DatabaseSync_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33669 : {
33670 0 : return py_netr_DatabaseSync_ndr_print(py_obj, "netr_DatabaseSync_in", NDR_IN);
33671 : }
33672 :
33673 0 : static PyObject *py_netr_DatabaseSync_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33674 : {
33675 0 : return py_netr_DatabaseSync_ndr_print(py_obj, "netr_DatabaseSync_out", NDR_OUT);
33676 : }
33677 :
33678 : static PyMethodDef py_netr_DatabaseSync_methods[] = {
33679 : { "opnum", (PyCFunction)py_netr_DatabaseSync_ndr_opnum, METH_NOARGS|METH_CLASS,
33680 : "netlogon.netr_DatabaseSync.opnum() -> 8 (0x08) " },
33681 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33682 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33683 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33684 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33685 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33686 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33687 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33688 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33689 : { "__ndr_print_in__", (PyCFunction)py_netr_DatabaseSync_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33690 : { "__ndr_print_out__", (PyCFunction)py_netr_DatabaseSync_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33691 : { NULL, NULL, 0, NULL }
33692 : };
33693 :
33694 :
33695 : static PyTypeObject netr_DatabaseSync_Type = {
33696 : PyVarObject_HEAD_INIT(NULL, 0)
33697 : .tp_name = "netlogon.netr_DatabaseSync",
33698 : .tp_getset = py_netr_DatabaseSync_getsetters,
33699 : .tp_methods = py_netr_DatabaseSync_methods,
33700 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33701 : .tp_new = py_netr_DatabaseSync_new,
33702 : };
33703 :
33704 0 : static bool pack_py_netr_DatabaseSync_args_in(PyObject *args, PyObject *kwargs, struct netr_DatabaseSync *r)
33705 : {
33706 : PyObject *py_logon_server;
33707 : PyObject *py_computername;
33708 : PyObject *py_credential;
33709 : PyObject *py_return_authenticator;
33710 : PyObject *py_database_id;
33711 : PyObject *py_sync_context;
33712 : PyObject *py_preferredmaximumlength;
33713 0 : const char *kwnames[] = {
33714 : "logon_server", "computername", "credential", "return_authenticator", "database_id", "sync_context", "preferredmaximumlength", NULL
33715 : };
33716 :
33717 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:netr_DatabaseSync", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_database_id, &py_sync_context, &py_preferredmaximumlength)) {
33718 0 : return false;
33719 : }
33720 :
33721 0 : if (py_logon_server == NULL) {
33722 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
33723 0 : return false;
33724 : }
33725 0 : r->in.logon_server = talloc_ptrtype(r, r->in.logon_server);
33726 0 : if (r->in.logon_server == NULL) {
33727 0 : PyErr_NoMemory();
33728 0 : return false;
33729 : }
33730 : {
33731 : const char *test_str;
33732 : const char *talloc_str;
33733 0 : PyObject *unicode = NULL;
33734 0 : if (PyUnicode_Check(py_logon_server)) {
33735 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
33736 0 : if (unicode == NULL) {
33737 0 : PyErr_NoMemory();
33738 0 : return false;
33739 : }
33740 0 : test_str = PyBytes_AS_STRING(unicode);
33741 0 : } else if (PyBytes_Check(py_logon_server)) {
33742 0 : test_str = PyBytes_AS_STRING(py_logon_server);
33743 : } else {
33744 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
33745 0 : return false;
33746 : }
33747 0 : talloc_str = talloc_strdup(r, test_str);
33748 0 : if (unicode != NULL) {
33749 0 : Py_DECREF(unicode);
33750 : }
33751 0 : if (talloc_str == NULL) {
33752 0 : PyErr_NoMemory();
33753 0 : return false;
33754 : }
33755 0 : r->in.logon_server = talloc_str;
33756 : }
33757 0 : if (py_computername == NULL) {
33758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername");
33759 0 : return false;
33760 : }
33761 0 : r->in.computername = talloc_ptrtype(r, r->in.computername);
33762 0 : if (r->in.computername == NULL) {
33763 0 : PyErr_NoMemory();
33764 0 : return false;
33765 : }
33766 : {
33767 : const char *test_str;
33768 : const char *talloc_str;
33769 0 : PyObject *unicode = NULL;
33770 0 : if (PyUnicode_Check(py_computername)) {
33771 0 : unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore");
33772 0 : if (unicode == NULL) {
33773 0 : PyErr_NoMemory();
33774 0 : return false;
33775 : }
33776 0 : test_str = PyBytes_AS_STRING(unicode);
33777 0 : } else if (PyBytes_Check(py_computername)) {
33778 0 : test_str = PyBytes_AS_STRING(py_computername);
33779 : } else {
33780 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->tp_name);
33781 0 : return false;
33782 : }
33783 0 : talloc_str = talloc_strdup(r, test_str);
33784 0 : if (unicode != NULL) {
33785 0 : Py_DECREF(unicode);
33786 : }
33787 0 : if (talloc_str == NULL) {
33788 0 : PyErr_NoMemory();
33789 0 : return false;
33790 : }
33791 0 : r->in.computername = talloc_str;
33792 : }
33793 0 : if (py_credential == NULL) {
33794 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
33795 0 : return false;
33796 : }
33797 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
33798 0 : if (r->in.credential == NULL) {
33799 0 : PyErr_NoMemory();
33800 0 : return false;
33801 : }
33802 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
33803 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
33804 0 : PyErr_NoMemory();
33805 0 : return false;
33806 : }
33807 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
33808 0 : if (py_return_authenticator == NULL) {
33809 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
33810 0 : return false;
33811 : }
33812 0 : r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator);
33813 0 : if (r->in.return_authenticator == NULL) {
33814 0 : PyErr_NoMemory();
33815 0 : return false;
33816 : }
33817 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
33818 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
33819 0 : PyErr_NoMemory();
33820 0 : return false;
33821 : }
33822 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
33823 0 : if (py_database_id == NULL) {
33824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.database_id");
33825 0 : return false;
33826 : }
33827 : {
33828 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.database_id));
33829 0 : if (PyLong_Check(py_database_id)) {
33830 : unsigned long long test_var;
33831 0 : test_var = PyLong_AsUnsignedLongLong(py_database_id);
33832 0 : if (PyErr_Occurred() != NULL) {
33833 0 : return false;
33834 : }
33835 0 : if (test_var > uint_max) {
33836 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33837 : PyLong_Type.tp_name, uint_max, test_var);
33838 0 : return false;
33839 : }
33840 0 : r->in.database_id = test_var;
33841 : } else {
33842 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33843 : PyLong_Type.tp_name);
33844 0 : return false;
33845 : }
33846 : }
33847 0 : if (py_sync_context == NULL) {
33848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sync_context");
33849 0 : return false;
33850 : }
33851 0 : r->in.sync_context = talloc_ptrtype(r, r->in.sync_context);
33852 0 : if (r->in.sync_context == NULL) {
33853 0 : PyErr_NoMemory();
33854 0 : return false;
33855 : }
33856 : {
33857 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.sync_context));
33858 0 : if (PyLong_Check(py_sync_context)) {
33859 : unsigned long long test_var;
33860 0 : test_var = PyLong_AsUnsignedLongLong(py_sync_context);
33861 0 : if (PyErr_Occurred() != NULL) {
33862 0 : return false;
33863 : }
33864 0 : if (test_var > uint_max) {
33865 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33866 : PyLong_Type.tp_name, uint_max, test_var);
33867 0 : return false;
33868 : }
33869 0 : *r->in.sync_context = test_var;
33870 : } else {
33871 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33872 : PyLong_Type.tp_name);
33873 0 : return false;
33874 : }
33875 : }
33876 0 : if (py_preferredmaximumlength == NULL) {
33877 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.preferredmaximumlength");
33878 0 : return false;
33879 : }
33880 : {
33881 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.preferredmaximumlength));
33882 0 : if (PyLong_Check(py_preferredmaximumlength)) {
33883 : unsigned long long test_var;
33884 0 : test_var = PyLong_AsUnsignedLongLong(py_preferredmaximumlength);
33885 0 : if (PyErr_Occurred() != NULL) {
33886 0 : return false;
33887 : }
33888 0 : if (test_var > uint_max) {
33889 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33890 : PyLong_Type.tp_name, uint_max, test_var);
33891 0 : return false;
33892 : }
33893 0 : r->in.preferredmaximumlength = test_var;
33894 : } else {
33895 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33896 : PyLong_Type.tp_name);
33897 0 : return false;
33898 : }
33899 : }
33900 0 : return true;
33901 : }
33902 :
33903 0 : static PyObject *unpack_py_netr_DatabaseSync_args_out(struct netr_DatabaseSync *r)
33904 : {
33905 : PyObject *result;
33906 : PyObject *py_return_authenticator;
33907 : PyObject *py_sync_context;
33908 : PyObject *py_delta_enum_array;
33909 0 : result = PyTuple_New(3);
33910 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
33911 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
33912 0 : py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*r->out.sync_context);
33913 0 : PyTuple_SetItem(result, 1, py_sync_context);
33914 0 : if (*r->out.delta_enum_array == NULL) {
33915 0 : py_delta_enum_array = Py_None;
33916 0 : Py_INCREF(py_delta_enum_array);
33917 : } else {
33918 0 : py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *r->out.delta_enum_array, *r->out.delta_enum_array);
33919 : }
33920 0 : PyTuple_SetItem(result, 2, py_delta_enum_array);
33921 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
33922 0 : PyErr_SetNTSTATUS(r->out.result);
33923 0 : return NULL;
33924 : }
33925 :
33926 0 : return result;
33927 : }
33928 :
33929 :
33930 0 : static PyObject *py_netr_AccountDeltas_in_get_logon_server(PyObject *obj, void *closure)
33931 : {
33932 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
33933 : PyObject *py_logon_server;
33934 0 : if (object->in.logon_server == NULL) {
33935 0 : Py_RETURN_NONE;
33936 : }
33937 0 : if (object->in.logon_server == NULL) {
33938 0 : py_logon_server = Py_None;
33939 0 : Py_INCREF(py_logon_server);
33940 : } else {
33941 0 : if (object->in.logon_server == NULL) {
33942 0 : py_logon_server = Py_None;
33943 0 : Py_INCREF(py_logon_server);
33944 : } else {
33945 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
33946 : }
33947 : }
33948 0 : return py_logon_server;
33949 : }
33950 :
33951 0 : static int py_netr_AccountDeltas_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
33952 : {
33953 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
33954 0 : if (value == NULL) {
33955 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
33956 0 : return -1;
33957 : }
33958 0 : if (value == Py_None) {
33959 0 : object->in.logon_server = NULL;
33960 : } else {
33961 0 : object->in.logon_server = NULL;
33962 : {
33963 : const char *test_str;
33964 : const char *talloc_str;
33965 0 : PyObject *unicode = NULL;
33966 0 : if (PyUnicode_Check(value)) {
33967 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
33968 0 : if (unicode == NULL) {
33969 0 : PyErr_NoMemory();
33970 0 : return -1;
33971 : }
33972 0 : test_str = PyBytes_AS_STRING(unicode);
33973 0 : } else if (PyBytes_Check(value)) {
33974 0 : test_str = PyBytes_AS_STRING(value);
33975 : } else {
33976 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
33977 0 : return -1;
33978 : }
33979 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
33980 0 : if (unicode != NULL) {
33981 0 : Py_DECREF(unicode);
33982 : }
33983 0 : if (talloc_str == NULL) {
33984 0 : PyErr_NoMemory();
33985 0 : return -1;
33986 : }
33987 0 : object->in.logon_server = talloc_str;
33988 : }
33989 : }
33990 0 : return 0;
33991 : }
33992 :
33993 0 : static PyObject *py_netr_AccountDeltas_in_get_computername(PyObject *obj, void *closure)
33994 : {
33995 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
33996 : PyObject *py_computername;
33997 0 : if (object->in.computername == NULL) {
33998 0 : Py_RETURN_NONE;
33999 : }
34000 0 : if (object->in.computername == NULL) {
34001 0 : py_computername = Py_None;
34002 0 : Py_INCREF(py_computername);
34003 : } else {
34004 0 : py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore");
34005 : }
34006 0 : return py_computername;
34007 : }
34008 :
34009 0 : static int py_netr_AccountDeltas_in_set_computername(PyObject *py_obj, PyObject *value, void *closure)
34010 : {
34011 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34012 0 : if (value == NULL) {
34013 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername");
34014 0 : return -1;
34015 : }
34016 0 : object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername);
34017 0 : if (object->in.computername == NULL) {
34018 0 : PyErr_NoMemory();
34019 0 : return -1;
34020 : }
34021 : {
34022 : const char *test_str;
34023 : const char *talloc_str;
34024 0 : PyObject *unicode = NULL;
34025 0 : if (PyUnicode_Check(value)) {
34026 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
34027 0 : if (unicode == NULL) {
34028 0 : PyErr_NoMemory();
34029 0 : return -1;
34030 : }
34031 0 : test_str = PyBytes_AS_STRING(unicode);
34032 0 : } else if (PyBytes_Check(value)) {
34033 0 : test_str = PyBytes_AS_STRING(value);
34034 : } else {
34035 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
34036 0 : return -1;
34037 : }
34038 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
34039 0 : if (unicode != NULL) {
34040 0 : Py_DECREF(unicode);
34041 : }
34042 0 : if (talloc_str == NULL) {
34043 0 : PyErr_NoMemory();
34044 0 : return -1;
34045 : }
34046 0 : object->in.computername = talloc_str;
34047 : }
34048 0 : return 0;
34049 : }
34050 :
34051 0 : static PyObject *py_netr_AccountDeltas_in_get_credential(PyObject *obj, void *closure)
34052 : {
34053 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34054 : PyObject *py_credential;
34055 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, pytalloc_get_mem_ctx(obj), &object->in.credential);
34056 0 : return py_credential;
34057 : }
34058 :
34059 0 : static int py_netr_AccountDeltas_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
34060 : {
34061 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34062 0 : if (value == NULL) {
34063 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
34064 0 : return -1;
34065 : }
34066 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
34067 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34068 0 : PyErr_NoMemory();
34069 0 : return -1;
34070 : }
34071 0 : object->in.credential = *(struct netr_Authenticator *)pytalloc_get_ptr(value);
34072 0 : return 0;
34073 : }
34074 :
34075 0 : static PyObject *py_netr_AccountDeltas_in_get_return_authenticator(PyObject *obj, void *closure)
34076 : {
34077 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34078 : PyObject *py_return_authenticator;
34079 0 : if (object->in.return_authenticator == NULL) {
34080 0 : Py_RETURN_NONE;
34081 : }
34082 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
34083 0 : return py_return_authenticator;
34084 : }
34085 :
34086 0 : static int py_netr_AccountDeltas_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
34087 : {
34088 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34089 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
34090 0 : if (value == NULL) {
34091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
34092 0 : return -1;
34093 : }
34094 0 : object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator);
34095 0 : if (object->in.return_authenticator == NULL) {
34096 0 : PyErr_NoMemory();
34097 0 : return -1;
34098 : }
34099 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
34100 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34101 0 : PyErr_NoMemory();
34102 0 : return -1;
34103 : }
34104 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
34105 0 : return 0;
34106 : }
34107 :
34108 0 : static PyObject *py_netr_AccountDeltas_out_get_return_authenticator(PyObject *obj, void *closure)
34109 : {
34110 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34111 : PyObject *py_return_authenticator;
34112 0 : if (object->out.return_authenticator == NULL) {
34113 0 : Py_RETURN_NONE;
34114 : }
34115 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
34116 0 : return py_return_authenticator;
34117 : }
34118 :
34119 0 : static int py_netr_AccountDeltas_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
34120 : {
34121 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34122 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
34123 0 : if (value == NULL) {
34124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
34125 0 : return -1;
34126 : }
34127 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
34128 0 : if (object->out.return_authenticator == NULL) {
34129 0 : PyErr_NoMemory();
34130 0 : return -1;
34131 : }
34132 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
34133 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34134 0 : PyErr_NoMemory();
34135 0 : return -1;
34136 : }
34137 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
34138 0 : return 0;
34139 : }
34140 :
34141 0 : static PyObject *py_netr_AccountDeltas_in_get_uas(PyObject *obj, void *closure)
34142 : {
34143 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34144 : PyObject *py_uas;
34145 0 : py_uas = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, pytalloc_get_mem_ctx(obj), &object->in.uas);
34146 0 : return py_uas;
34147 : }
34148 :
34149 0 : static int py_netr_AccountDeltas_in_set_uas(PyObject *py_obj, PyObject *value, void *closure)
34150 : {
34151 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34152 0 : if (value == NULL) {
34153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.uas");
34154 0 : return -1;
34155 : }
34156 0 : PY_CHECK_TYPE(&netr_UAS_INFO_0_Type, value, return -1;);
34157 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34158 0 : PyErr_NoMemory();
34159 0 : return -1;
34160 : }
34161 0 : object->in.uas = *(struct netr_UAS_INFO_0 *)pytalloc_get_ptr(value);
34162 0 : return 0;
34163 : }
34164 :
34165 0 : static PyObject *py_netr_AccountDeltas_in_get_count(PyObject *obj, void *closure)
34166 : {
34167 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34168 : PyObject *py_count;
34169 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->in.count);
34170 0 : return py_count;
34171 : }
34172 :
34173 0 : static int py_netr_AccountDeltas_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
34174 : {
34175 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34176 0 : if (value == NULL) {
34177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
34178 0 : return -1;
34179 : }
34180 : {
34181 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.count));
34182 0 : if (PyLong_Check(value)) {
34183 : unsigned long long test_var;
34184 0 : test_var = PyLong_AsUnsignedLongLong(value);
34185 0 : if (PyErr_Occurred() != NULL) {
34186 0 : return -1;
34187 : }
34188 0 : if (test_var > uint_max) {
34189 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34190 : PyLong_Type.tp_name, uint_max, test_var);
34191 0 : return -1;
34192 : }
34193 0 : object->in.count = test_var;
34194 : } else {
34195 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34196 : PyLong_Type.tp_name);
34197 0 : return -1;
34198 : }
34199 : }
34200 0 : return 0;
34201 : }
34202 :
34203 0 : static PyObject *py_netr_AccountDeltas_in_get_level(PyObject *obj, void *closure)
34204 : {
34205 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34206 : PyObject *py_level;
34207 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level);
34208 0 : return py_level;
34209 : }
34210 :
34211 0 : static int py_netr_AccountDeltas_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
34212 : {
34213 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34214 0 : if (value == NULL) {
34215 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
34216 0 : return -1;
34217 : }
34218 : {
34219 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
34220 0 : if (PyLong_Check(value)) {
34221 : unsigned long long test_var;
34222 0 : test_var = PyLong_AsUnsignedLongLong(value);
34223 0 : if (PyErr_Occurred() != NULL) {
34224 0 : return -1;
34225 : }
34226 0 : if (test_var > uint_max) {
34227 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34228 : PyLong_Type.tp_name, uint_max, test_var);
34229 0 : return -1;
34230 : }
34231 0 : object->in.level = test_var;
34232 : } else {
34233 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34234 : PyLong_Type.tp_name);
34235 0 : return -1;
34236 : }
34237 : }
34238 0 : return 0;
34239 : }
34240 :
34241 0 : static PyObject *py_netr_AccountDeltas_in_get_buffersize(PyObject *obj, void *closure)
34242 : {
34243 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34244 : PyObject *py_buffersize;
34245 0 : py_buffersize = PyLong_FromUnsignedLongLong((uint32_t)object->in.buffersize);
34246 0 : return py_buffersize;
34247 : }
34248 :
34249 0 : static int py_netr_AccountDeltas_in_set_buffersize(PyObject *py_obj, PyObject *value, void *closure)
34250 : {
34251 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34252 0 : if (value == NULL) {
34253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffersize");
34254 0 : return -1;
34255 : }
34256 : {
34257 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffersize));
34258 0 : if (PyLong_Check(value)) {
34259 : unsigned long long test_var;
34260 0 : test_var = PyLong_AsUnsignedLongLong(value);
34261 0 : if (PyErr_Occurred() != NULL) {
34262 0 : return -1;
34263 : }
34264 0 : if (test_var > uint_max) {
34265 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34266 : PyLong_Type.tp_name, uint_max, test_var);
34267 0 : return -1;
34268 : }
34269 0 : object->in.buffersize = test_var;
34270 : } else {
34271 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34272 : PyLong_Type.tp_name);
34273 0 : return -1;
34274 : }
34275 : }
34276 0 : return 0;
34277 : }
34278 :
34279 0 : static PyObject *py_netr_AccountDeltas_out_get_buffer(PyObject *obj, void *closure)
34280 : {
34281 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34282 : PyObject *py_buffer;
34283 0 : if (object->out.buffer == NULL) {
34284 0 : Py_RETURN_NONE;
34285 : }
34286 0 : py_buffer = pytalloc_reference_ex(&netr_AccountBuffer_Type, object->out.buffer, object->out.buffer);
34287 0 : return py_buffer;
34288 : }
34289 :
34290 0 : static int py_netr_AccountDeltas_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
34291 : {
34292 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34293 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
34294 0 : if (value == NULL) {
34295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
34296 0 : return -1;
34297 : }
34298 0 : object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
34299 0 : if (object->out.buffer == NULL) {
34300 0 : PyErr_NoMemory();
34301 0 : return -1;
34302 : }
34303 0 : PY_CHECK_TYPE(&netr_AccountBuffer_Type, value, return -1;);
34304 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34305 0 : PyErr_NoMemory();
34306 0 : return -1;
34307 : }
34308 0 : object->out.buffer = (struct netr_AccountBuffer *)pytalloc_get_ptr(value);
34309 0 : return 0;
34310 : }
34311 :
34312 0 : static PyObject *py_netr_AccountDeltas_out_get_count_returned(PyObject *obj, void *closure)
34313 : {
34314 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34315 : PyObject *py_count_returned;
34316 0 : if (object->out.count_returned == NULL) {
34317 0 : Py_RETURN_NONE;
34318 : }
34319 0 : py_count_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count_returned);
34320 0 : return py_count_returned;
34321 : }
34322 :
34323 0 : static int py_netr_AccountDeltas_out_set_count_returned(PyObject *py_obj, PyObject *value, void *closure)
34324 : {
34325 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34326 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count_returned));
34327 0 : if (value == NULL) {
34328 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count_returned");
34329 0 : return -1;
34330 : }
34331 0 : object->out.count_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count_returned);
34332 0 : if (object->out.count_returned == NULL) {
34333 0 : PyErr_NoMemory();
34334 0 : return -1;
34335 : }
34336 : {
34337 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count_returned));
34338 0 : if (PyLong_Check(value)) {
34339 : unsigned long long test_var;
34340 0 : test_var = PyLong_AsUnsignedLongLong(value);
34341 0 : if (PyErr_Occurred() != NULL) {
34342 0 : return -1;
34343 : }
34344 0 : if (test_var > uint_max) {
34345 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34346 : PyLong_Type.tp_name, uint_max, test_var);
34347 0 : return -1;
34348 : }
34349 0 : *object->out.count_returned = test_var;
34350 : } else {
34351 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34352 : PyLong_Type.tp_name);
34353 0 : return -1;
34354 : }
34355 : }
34356 0 : return 0;
34357 : }
34358 :
34359 0 : static PyObject *py_netr_AccountDeltas_out_get_total_entries(PyObject *obj, void *closure)
34360 : {
34361 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34362 : PyObject *py_total_entries;
34363 0 : if (object->out.total_entries == NULL) {
34364 0 : Py_RETURN_NONE;
34365 : }
34366 0 : py_total_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_entries);
34367 0 : return py_total_entries;
34368 : }
34369 :
34370 0 : static int py_netr_AccountDeltas_out_set_total_entries(PyObject *py_obj, PyObject *value, void *closure)
34371 : {
34372 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34373 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_entries));
34374 0 : if (value == NULL) {
34375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_entries");
34376 0 : return -1;
34377 : }
34378 0 : object->out.total_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_entries);
34379 0 : if (object->out.total_entries == NULL) {
34380 0 : PyErr_NoMemory();
34381 0 : return -1;
34382 : }
34383 : {
34384 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_entries));
34385 0 : if (PyLong_Check(value)) {
34386 : unsigned long long test_var;
34387 0 : test_var = PyLong_AsUnsignedLongLong(value);
34388 0 : if (PyErr_Occurred() != NULL) {
34389 0 : return -1;
34390 : }
34391 0 : if (test_var > uint_max) {
34392 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34393 : PyLong_Type.tp_name, uint_max, test_var);
34394 0 : return -1;
34395 : }
34396 0 : *object->out.total_entries = test_var;
34397 : } else {
34398 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34399 : PyLong_Type.tp_name);
34400 0 : return -1;
34401 : }
34402 : }
34403 0 : return 0;
34404 : }
34405 :
34406 0 : static PyObject *py_netr_AccountDeltas_out_get_recordid(PyObject *obj, void *closure)
34407 : {
34408 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34409 : PyObject *py_recordid;
34410 0 : if (object->out.recordid == NULL) {
34411 0 : Py_RETURN_NONE;
34412 : }
34413 0 : py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, object->out.recordid, object->out.recordid);
34414 0 : return py_recordid;
34415 : }
34416 :
34417 0 : static int py_netr_AccountDeltas_out_set_recordid(PyObject *py_obj, PyObject *value, void *closure)
34418 : {
34419 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34420 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.recordid));
34421 0 : if (value == NULL) {
34422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.recordid");
34423 0 : return -1;
34424 : }
34425 0 : object->out.recordid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.recordid);
34426 0 : if (object->out.recordid == NULL) {
34427 0 : PyErr_NoMemory();
34428 0 : return -1;
34429 : }
34430 0 : PY_CHECK_TYPE(&netr_UAS_INFO_0_Type, value, return -1;);
34431 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34432 0 : PyErr_NoMemory();
34433 0 : return -1;
34434 : }
34435 0 : object->out.recordid = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(value);
34436 0 : return 0;
34437 : }
34438 :
34439 0 : static PyObject *py_netr_AccountDeltas_get_result(PyObject *obj, void *closure)
34440 : {
34441 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(obj);
34442 : PyObject *py_result;
34443 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
34444 0 : return py_result;
34445 : }
34446 :
34447 0 : static int py_netr_AccountDeltas_set_result(PyObject *py_obj, PyObject *value, void *closure)
34448 : {
34449 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34450 0 : if (value == NULL) {
34451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
34452 0 : return -1;
34453 : }
34454 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
34455 0 : return 0;
34456 : }
34457 :
34458 : static PyGetSetDef py_netr_AccountDeltas_getsetters[] = {
34459 : {
34460 : .name = discard_const_p(char, "in_logon_server"),
34461 : .get = py_netr_AccountDeltas_in_get_logon_server,
34462 : .set = py_netr_AccountDeltas_in_set_logon_server,
34463 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
34464 : },
34465 : {
34466 : .name = discard_const_p(char, "in_computername"),
34467 : .get = py_netr_AccountDeltas_in_get_computername,
34468 : .set = py_netr_AccountDeltas_in_set_computername,
34469 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
34470 : },
34471 : {
34472 : .name = discard_const_p(char, "in_credential"),
34473 : .get = py_netr_AccountDeltas_in_get_credential,
34474 : .set = py_netr_AccountDeltas_in_set_credential,
34475 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
34476 : },
34477 : {
34478 : .name = discard_const_p(char, "in_return_authenticator"),
34479 : .get = py_netr_AccountDeltas_in_get_return_authenticator,
34480 : .set = py_netr_AccountDeltas_in_set_return_authenticator,
34481 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
34482 : },
34483 : {
34484 : .name = discard_const_p(char, "out_return_authenticator"),
34485 : .get = py_netr_AccountDeltas_out_get_return_authenticator,
34486 : .set = py_netr_AccountDeltas_out_set_return_authenticator,
34487 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
34488 : },
34489 : {
34490 : .name = discard_const_p(char, "in_uas"),
34491 : .get = py_netr_AccountDeltas_in_get_uas,
34492 : .set = py_netr_AccountDeltas_in_set_uas,
34493 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UAS_INFO_0")
34494 : },
34495 : {
34496 : .name = discard_const_p(char, "in_count"),
34497 : .get = py_netr_AccountDeltas_in_get_count,
34498 : .set = py_netr_AccountDeltas_in_set_count,
34499 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34500 : },
34501 : {
34502 : .name = discard_const_p(char, "in_level"),
34503 : .get = py_netr_AccountDeltas_in_get_level,
34504 : .set = py_netr_AccountDeltas_in_set_level,
34505 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34506 : },
34507 : {
34508 : .name = discard_const_p(char, "in_buffersize"),
34509 : .get = py_netr_AccountDeltas_in_get_buffersize,
34510 : .set = py_netr_AccountDeltas_in_set_buffersize,
34511 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34512 : },
34513 : {
34514 : .name = discard_const_p(char, "out_buffer"),
34515 : .get = py_netr_AccountDeltas_out_get_buffer,
34516 : .set = py_netr_AccountDeltas_out_set_buffer,
34517 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_AccountBuffer")
34518 : },
34519 : {
34520 : .name = discard_const_p(char, "out_count_returned"),
34521 : .get = py_netr_AccountDeltas_out_get_count_returned,
34522 : .set = py_netr_AccountDeltas_out_set_count_returned,
34523 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34524 : },
34525 : {
34526 : .name = discard_const_p(char, "out_total_entries"),
34527 : .get = py_netr_AccountDeltas_out_get_total_entries,
34528 : .set = py_netr_AccountDeltas_out_set_total_entries,
34529 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
34530 : },
34531 : {
34532 : .name = discard_const_p(char, "out_recordid"),
34533 : .get = py_netr_AccountDeltas_out_get_recordid,
34534 : .set = py_netr_AccountDeltas_out_set_recordid,
34535 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UAS_INFO_0")
34536 : },
34537 : {
34538 : .name = discard_const_p(char, "result"),
34539 : .get = py_netr_AccountDeltas_get_result,
34540 : .set = py_netr_AccountDeltas_set_result,
34541 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
34542 : },
34543 : { .name = NULL }
34544 : };
34545 :
34546 0 : static PyObject *py_netr_AccountDeltas_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34547 : {
34548 0 : PyObject *self = pytalloc_new(struct netr_AccountDeltas, type);
34549 0 : struct netr_AccountDeltas *_self = (struct netr_AccountDeltas *)pytalloc_get_ptr(self);
34550 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34551 0 : _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
34552 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
34553 0 : _self->out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer);
34554 0 : _self->out.count_returned = talloc_zero(mem_ctx, uint32_t);
34555 0 : _self->out.total_entries = talloc_zero(mem_ctx, uint32_t);
34556 0 : _self->out.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0);
34557 0 : return self;
34558 : }
34559 :
34560 0 : static PyObject *py_netr_AccountDeltas_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34561 : {
34562 :
34563 :
34564 0 : return PyLong_FromLong(9);
34565 : }
34566 :
34567 0 : static PyObject *py_netr_AccountDeltas_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
34568 : {
34569 0 : const struct ndr_interface_call *call = NULL;
34570 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34571 0 : PyObject *ret = NULL;
34572 0 : struct ndr_push *push = NULL;
34573 : DATA_BLOB blob;
34574 : enum ndr_err_code err;
34575 :
34576 0 : if (ndr_table_netlogon.num_calls < 10) {
34577 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountDeltas_ndr_pack");
34578 0 : return NULL;
34579 : }
34580 0 : call = &ndr_table_netlogon.calls[9];
34581 :
34582 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34583 0 : if (push == NULL) {
34584 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34585 0 : return NULL;
34586 : }
34587 :
34588 0 : push->flags |= ndr_push_flags;
34589 :
34590 0 : err = call->ndr_push(push, ndr_inout_flags, object);
34591 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34592 0 : TALLOC_FREE(push);
34593 0 : PyErr_SetNdrError(err);
34594 0 : return NULL;
34595 : }
34596 0 : blob = ndr_push_blob(push);
34597 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34598 0 : TALLOC_FREE(push);
34599 0 : return ret;
34600 : }
34601 :
34602 0 : static PyObject *py_netr_AccountDeltas_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34603 : {
34604 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34605 0 : PyObject *bigendian_obj = NULL;
34606 0 : PyObject *ndr64_obj = NULL;
34607 0 : uint32_t ndr_push_flags = 0;
34608 :
34609 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34610 : discard_const_p(char *, kwnames),
34611 : &bigendian_obj,
34612 : &ndr64_obj)) {
34613 0 : return NULL;
34614 : }
34615 :
34616 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34617 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34618 : }
34619 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34620 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34621 : }
34622 :
34623 0 : return py_netr_AccountDeltas_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34624 : }
34625 :
34626 0 : static PyObject *py_netr_AccountDeltas_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34627 : {
34628 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34629 0 : PyObject *bigendian_obj = NULL;
34630 0 : PyObject *ndr64_obj = NULL;
34631 0 : uint32_t ndr_push_flags = 0;
34632 :
34633 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34634 : discard_const_p(char *, kwnames),
34635 : &bigendian_obj,
34636 : &ndr64_obj)) {
34637 0 : return NULL;
34638 : }
34639 :
34640 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34641 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34642 : }
34643 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34644 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34645 : }
34646 :
34647 0 : return py_netr_AccountDeltas_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34648 : }
34649 :
34650 0 : static PyObject *py_netr_AccountDeltas_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
34651 : {
34652 0 : const struct ndr_interface_call *call = NULL;
34653 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34654 0 : struct ndr_pull *pull = NULL;
34655 : enum ndr_err_code err;
34656 :
34657 0 : if (ndr_table_netlogon.num_calls < 10) {
34658 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountDeltas_ndr_unpack");
34659 0 : return NULL;
34660 : }
34661 0 : call = &ndr_table_netlogon.calls[9];
34662 :
34663 0 : pull = ndr_pull_init_blob(blob, object);
34664 0 : if (pull == NULL) {
34665 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34666 0 : return NULL;
34667 : }
34668 :
34669 0 : pull->flags |= ndr_pull_flags;
34670 :
34671 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34672 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34673 0 : TALLOC_FREE(pull);
34674 0 : PyErr_SetNdrError(err);
34675 0 : return NULL;
34676 : }
34677 0 : if (!allow_remaining) {
34678 : uint32_t highest_ofs;
34679 :
34680 0 : if (pull->offset > pull->relative_highest_offset) {
34681 0 : highest_ofs = pull->offset;
34682 : } else {
34683 0 : highest_ofs = pull->relative_highest_offset;
34684 : }
34685 0 : if (highest_ofs < pull->data_size) {
34686 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34687 : "not all bytes consumed ofs[%u] size[%u]",
34688 : highest_ofs, pull->data_size);
34689 0 : TALLOC_FREE(pull);
34690 0 : PyErr_SetNdrError(err);
34691 0 : return NULL;
34692 : }
34693 : }
34694 :
34695 0 : TALLOC_FREE(pull);
34696 0 : Py_RETURN_NONE;
34697 : }
34698 :
34699 0 : static PyObject *py_netr_AccountDeltas_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34700 : {
34701 : DATA_BLOB blob;
34702 0 : Py_ssize_t blob_length = 0;
34703 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34704 0 : PyObject *bigendian_obj = NULL;
34705 0 : PyObject *ndr64_obj = NULL;
34706 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34707 0 : PyObject *allow_remaining_obj = NULL;
34708 0 : bool allow_remaining = false;
34709 :
34710 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34711 : discard_const_p(char *, kwnames),
34712 : &blob.data, &blob_length,
34713 : &bigendian_obj,
34714 : &ndr64_obj,
34715 : &allow_remaining_obj)) {
34716 0 : return NULL;
34717 : }
34718 0 : blob.length = blob_length;
34719 :
34720 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34721 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34722 : }
34723 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34724 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34725 : }
34726 :
34727 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34728 0 : allow_remaining = true;
34729 : }
34730 :
34731 0 : return py_netr_AccountDeltas_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34732 : }
34733 :
34734 0 : static PyObject *py_netr_AccountDeltas_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34735 : {
34736 : DATA_BLOB blob;
34737 0 : Py_ssize_t blob_length = 0;
34738 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34739 0 : PyObject *bigendian_obj = NULL;
34740 0 : PyObject *ndr64_obj = NULL;
34741 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34742 0 : PyObject *allow_remaining_obj = NULL;
34743 0 : bool allow_remaining = false;
34744 :
34745 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34746 : discard_const_p(char *, kwnames),
34747 : &blob.data, &blob_length,
34748 : &bigendian_obj,
34749 : &ndr64_obj,
34750 : &allow_remaining_obj)) {
34751 0 : return NULL;
34752 : }
34753 0 : blob.length = blob_length;
34754 :
34755 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34756 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34757 : }
34758 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34759 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34760 : }
34761 :
34762 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34763 0 : allow_remaining = true;
34764 : }
34765 :
34766 0 : return py_netr_AccountDeltas_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34767 : }
34768 :
34769 0 : static PyObject *py_netr_AccountDeltas_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
34770 : {
34771 0 : const struct ndr_interface_call *call = NULL;
34772 0 : struct netr_AccountDeltas *object = (struct netr_AccountDeltas *)pytalloc_get_ptr(py_obj);
34773 : PyObject *ret;
34774 : char *retstr;
34775 :
34776 0 : if (ndr_table_netlogon.num_calls < 10) {
34777 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountDeltas_ndr_print");
34778 0 : return NULL;
34779 : }
34780 0 : call = &ndr_table_netlogon.calls[9];
34781 :
34782 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34783 0 : ret = PyUnicode_FromString(retstr);
34784 0 : TALLOC_FREE(retstr);
34785 :
34786 0 : return ret;
34787 : }
34788 :
34789 0 : static PyObject *py_netr_AccountDeltas_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34790 : {
34791 0 : return py_netr_AccountDeltas_ndr_print(py_obj, "netr_AccountDeltas_in", NDR_IN);
34792 : }
34793 :
34794 0 : static PyObject *py_netr_AccountDeltas_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34795 : {
34796 0 : return py_netr_AccountDeltas_ndr_print(py_obj, "netr_AccountDeltas_out", NDR_OUT);
34797 : }
34798 :
34799 : static PyMethodDef py_netr_AccountDeltas_methods[] = {
34800 : { "opnum", (PyCFunction)py_netr_AccountDeltas_ndr_opnum, METH_NOARGS|METH_CLASS,
34801 : "netlogon.netr_AccountDeltas.opnum() -> 9 (0x09) " },
34802 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountDeltas_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34803 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34804 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountDeltas_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34805 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34806 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountDeltas_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34807 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34808 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountDeltas_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34809 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34810 : { "__ndr_print_in__", (PyCFunction)py_netr_AccountDeltas_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34811 : { "__ndr_print_out__", (PyCFunction)py_netr_AccountDeltas_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34812 : { NULL, NULL, 0, NULL }
34813 : };
34814 :
34815 :
34816 : static PyTypeObject netr_AccountDeltas_Type = {
34817 : PyVarObject_HEAD_INIT(NULL, 0)
34818 : .tp_name = "netlogon.netr_AccountDeltas",
34819 : .tp_getset = py_netr_AccountDeltas_getsetters,
34820 : .tp_methods = py_netr_AccountDeltas_methods,
34821 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34822 : .tp_new = py_netr_AccountDeltas_new,
34823 : };
34824 :
34825 0 : static bool pack_py_netr_AccountDeltas_args_in(PyObject *args, PyObject *kwargs, struct netr_AccountDeltas *r)
34826 : {
34827 : PyObject *py_logon_server;
34828 : PyObject *py_computername;
34829 : PyObject *py_credential;
34830 : PyObject *py_return_authenticator;
34831 : PyObject *py_uas;
34832 : PyObject *py_count;
34833 : PyObject *py_level;
34834 : PyObject *py_buffersize;
34835 0 : const char *kwnames[] = {
34836 : "logon_server", "computername", "credential", "return_authenticator", "uas", "count", "level", "buffersize", NULL
34837 : };
34838 :
34839 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:netr_AccountDeltas", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_uas, &py_count, &py_level, &py_buffersize)) {
34840 0 : return false;
34841 : }
34842 :
34843 0 : if (py_logon_server == NULL) {
34844 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
34845 0 : return false;
34846 : }
34847 0 : if (py_logon_server == Py_None) {
34848 0 : r->in.logon_server = NULL;
34849 : } else {
34850 0 : r->in.logon_server = NULL;
34851 : {
34852 : const char *test_str;
34853 : const char *talloc_str;
34854 0 : PyObject *unicode = NULL;
34855 0 : if (PyUnicode_Check(py_logon_server)) {
34856 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
34857 0 : if (unicode == NULL) {
34858 0 : PyErr_NoMemory();
34859 0 : return false;
34860 : }
34861 0 : test_str = PyBytes_AS_STRING(unicode);
34862 0 : } else if (PyBytes_Check(py_logon_server)) {
34863 0 : test_str = PyBytes_AS_STRING(py_logon_server);
34864 : } else {
34865 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
34866 0 : return false;
34867 : }
34868 0 : talloc_str = talloc_strdup(r, test_str);
34869 0 : if (unicode != NULL) {
34870 0 : Py_DECREF(unicode);
34871 : }
34872 0 : if (talloc_str == NULL) {
34873 0 : PyErr_NoMemory();
34874 0 : return false;
34875 : }
34876 0 : r->in.logon_server = talloc_str;
34877 : }
34878 : }
34879 0 : if (py_computername == NULL) {
34880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername");
34881 0 : return false;
34882 : }
34883 0 : r->in.computername = talloc_ptrtype(r, r->in.computername);
34884 0 : if (r->in.computername == NULL) {
34885 0 : PyErr_NoMemory();
34886 0 : return false;
34887 : }
34888 : {
34889 : const char *test_str;
34890 : const char *talloc_str;
34891 0 : PyObject *unicode = NULL;
34892 0 : if (PyUnicode_Check(py_computername)) {
34893 0 : unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore");
34894 0 : if (unicode == NULL) {
34895 0 : PyErr_NoMemory();
34896 0 : return false;
34897 : }
34898 0 : test_str = PyBytes_AS_STRING(unicode);
34899 0 : } else if (PyBytes_Check(py_computername)) {
34900 0 : test_str = PyBytes_AS_STRING(py_computername);
34901 : } else {
34902 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->tp_name);
34903 0 : return false;
34904 : }
34905 0 : talloc_str = talloc_strdup(r, test_str);
34906 0 : if (unicode != NULL) {
34907 0 : Py_DECREF(unicode);
34908 : }
34909 0 : if (talloc_str == NULL) {
34910 0 : PyErr_NoMemory();
34911 0 : return false;
34912 : }
34913 0 : r->in.computername = talloc_str;
34914 : }
34915 0 : if (py_credential == NULL) {
34916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
34917 0 : return false;
34918 : }
34919 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
34920 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
34921 0 : PyErr_NoMemory();
34922 0 : return false;
34923 : }
34924 0 : r->in.credential = *(struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
34925 0 : if (py_return_authenticator == NULL) {
34926 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
34927 0 : return false;
34928 : }
34929 0 : r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator);
34930 0 : if (r->in.return_authenticator == NULL) {
34931 0 : PyErr_NoMemory();
34932 0 : return false;
34933 : }
34934 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
34935 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
34936 0 : PyErr_NoMemory();
34937 0 : return false;
34938 : }
34939 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
34940 0 : if (py_uas == NULL) {
34941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.uas");
34942 0 : return false;
34943 : }
34944 0 : PY_CHECK_TYPE(&netr_UAS_INFO_0_Type, py_uas, return false;);
34945 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_uas)) == NULL) {
34946 0 : PyErr_NoMemory();
34947 0 : return false;
34948 : }
34949 0 : r->in.uas = *(struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_uas);
34950 0 : if (py_count == NULL) {
34951 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
34952 0 : return false;
34953 : }
34954 : {
34955 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.count));
34956 0 : if (PyLong_Check(py_count)) {
34957 : unsigned long long test_var;
34958 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
34959 0 : if (PyErr_Occurred() != NULL) {
34960 0 : return false;
34961 : }
34962 0 : if (test_var > uint_max) {
34963 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34964 : PyLong_Type.tp_name, uint_max, test_var);
34965 0 : return false;
34966 : }
34967 0 : r->in.count = test_var;
34968 : } else {
34969 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34970 : PyLong_Type.tp_name);
34971 0 : return false;
34972 : }
34973 : }
34974 0 : if (py_level == NULL) {
34975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
34976 0 : return false;
34977 : }
34978 : {
34979 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
34980 0 : if (PyLong_Check(py_level)) {
34981 : unsigned long long test_var;
34982 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
34983 0 : if (PyErr_Occurred() != NULL) {
34984 0 : return false;
34985 : }
34986 0 : if (test_var > uint_max) {
34987 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34988 : PyLong_Type.tp_name, uint_max, test_var);
34989 0 : return false;
34990 : }
34991 0 : r->in.level = test_var;
34992 : } else {
34993 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34994 : PyLong_Type.tp_name);
34995 0 : return false;
34996 : }
34997 : }
34998 0 : if (py_buffersize == NULL) {
34999 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffersize");
35000 0 : return false;
35001 : }
35002 : {
35003 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buffersize));
35004 0 : if (PyLong_Check(py_buffersize)) {
35005 : unsigned long long test_var;
35006 0 : test_var = PyLong_AsUnsignedLongLong(py_buffersize);
35007 0 : if (PyErr_Occurred() != NULL) {
35008 0 : return false;
35009 : }
35010 0 : if (test_var > uint_max) {
35011 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35012 : PyLong_Type.tp_name, uint_max, test_var);
35013 0 : return false;
35014 : }
35015 0 : r->in.buffersize = test_var;
35016 : } else {
35017 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35018 : PyLong_Type.tp_name);
35019 0 : return false;
35020 : }
35021 : }
35022 0 : return true;
35023 : }
35024 :
35025 0 : static PyObject *unpack_py_netr_AccountDeltas_args_out(struct netr_AccountDeltas *r)
35026 : {
35027 : PyObject *result;
35028 : PyObject *py_return_authenticator;
35029 : PyObject *py_buffer;
35030 : PyObject *py_count_returned;
35031 : PyObject *py_total_entries;
35032 : PyObject *py_recordid;
35033 0 : result = PyTuple_New(5);
35034 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
35035 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
35036 0 : py_buffer = pytalloc_reference_ex(&netr_AccountBuffer_Type, r->out.buffer, r->out.buffer);
35037 0 : PyTuple_SetItem(result, 1, py_buffer);
35038 0 : py_count_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count_returned);
35039 0 : PyTuple_SetItem(result, 2, py_count_returned);
35040 0 : py_total_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_entries);
35041 0 : PyTuple_SetItem(result, 3, py_total_entries);
35042 0 : py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, r->out.recordid, r->out.recordid);
35043 0 : PyTuple_SetItem(result, 4, py_recordid);
35044 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
35045 0 : PyErr_SetNTSTATUS(r->out.result);
35046 0 : return NULL;
35047 : }
35048 :
35049 0 : return result;
35050 : }
35051 :
35052 :
35053 0 : static PyObject *py_netr_AccountSync_in_get_logon_server(PyObject *obj, void *closure)
35054 : {
35055 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35056 : PyObject *py_logon_server;
35057 0 : if (object->in.logon_server == NULL) {
35058 0 : Py_RETURN_NONE;
35059 : }
35060 0 : if (object->in.logon_server == NULL) {
35061 0 : py_logon_server = Py_None;
35062 0 : Py_INCREF(py_logon_server);
35063 : } else {
35064 0 : if (object->in.logon_server == NULL) {
35065 0 : py_logon_server = Py_None;
35066 0 : Py_INCREF(py_logon_server);
35067 : } else {
35068 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
35069 : }
35070 : }
35071 0 : return py_logon_server;
35072 : }
35073 :
35074 0 : static int py_netr_AccountSync_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
35075 : {
35076 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35077 0 : if (value == NULL) {
35078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
35079 0 : return -1;
35080 : }
35081 0 : if (value == Py_None) {
35082 0 : object->in.logon_server = NULL;
35083 : } else {
35084 0 : object->in.logon_server = NULL;
35085 : {
35086 : const char *test_str;
35087 : const char *talloc_str;
35088 0 : PyObject *unicode = NULL;
35089 0 : if (PyUnicode_Check(value)) {
35090 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
35091 0 : if (unicode == NULL) {
35092 0 : PyErr_NoMemory();
35093 0 : return -1;
35094 : }
35095 0 : test_str = PyBytes_AS_STRING(unicode);
35096 0 : } else if (PyBytes_Check(value)) {
35097 0 : test_str = PyBytes_AS_STRING(value);
35098 : } else {
35099 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
35100 0 : return -1;
35101 : }
35102 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
35103 0 : if (unicode != NULL) {
35104 0 : Py_DECREF(unicode);
35105 : }
35106 0 : if (talloc_str == NULL) {
35107 0 : PyErr_NoMemory();
35108 0 : return -1;
35109 : }
35110 0 : object->in.logon_server = talloc_str;
35111 : }
35112 : }
35113 0 : return 0;
35114 : }
35115 :
35116 0 : static PyObject *py_netr_AccountSync_in_get_computername(PyObject *obj, void *closure)
35117 : {
35118 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35119 : PyObject *py_computername;
35120 0 : if (object->in.computername == NULL) {
35121 0 : Py_RETURN_NONE;
35122 : }
35123 0 : if (object->in.computername == NULL) {
35124 0 : py_computername = Py_None;
35125 0 : Py_INCREF(py_computername);
35126 : } else {
35127 0 : py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore");
35128 : }
35129 0 : return py_computername;
35130 : }
35131 :
35132 0 : static int py_netr_AccountSync_in_set_computername(PyObject *py_obj, PyObject *value, void *closure)
35133 : {
35134 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35135 0 : if (value == NULL) {
35136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername");
35137 0 : return -1;
35138 : }
35139 0 : object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername);
35140 0 : if (object->in.computername == NULL) {
35141 0 : PyErr_NoMemory();
35142 0 : return -1;
35143 : }
35144 : {
35145 : const char *test_str;
35146 : const char *talloc_str;
35147 0 : PyObject *unicode = NULL;
35148 0 : if (PyUnicode_Check(value)) {
35149 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
35150 0 : if (unicode == NULL) {
35151 0 : PyErr_NoMemory();
35152 0 : return -1;
35153 : }
35154 0 : test_str = PyBytes_AS_STRING(unicode);
35155 0 : } else if (PyBytes_Check(value)) {
35156 0 : test_str = PyBytes_AS_STRING(value);
35157 : } else {
35158 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
35159 0 : return -1;
35160 : }
35161 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
35162 0 : if (unicode != NULL) {
35163 0 : Py_DECREF(unicode);
35164 : }
35165 0 : if (talloc_str == NULL) {
35166 0 : PyErr_NoMemory();
35167 0 : return -1;
35168 : }
35169 0 : object->in.computername = talloc_str;
35170 : }
35171 0 : return 0;
35172 : }
35173 :
35174 0 : static PyObject *py_netr_AccountSync_in_get_credential(PyObject *obj, void *closure)
35175 : {
35176 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35177 : PyObject *py_credential;
35178 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, pytalloc_get_mem_ctx(obj), &object->in.credential);
35179 0 : return py_credential;
35180 : }
35181 :
35182 0 : static int py_netr_AccountSync_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
35183 : {
35184 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35185 0 : if (value == NULL) {
35186 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
35187 0 : return -1;
35188 : }
35189 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
35190 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35191 0 : PyErr_NoMemory();
35192 0 : return -1;
35193 : }
35194 0 : object->in.credential = *(struct netr_Authenticator *)pytalloc_get_ptr(value);
35195 0 : return 0;
35196 : }
35197 :
35198 0 : static PyObject *py_netr_AccountSync_in_get_return_authenticator(PyObject *obj, void *closure)
35199 : {
35200 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35201 : PyObject *py_return_authenticator;
35202 0 : if (object->in.return_authenticator == NULL) {
35203 0 : Py_RETURN_NONE;
35204 : }
35205 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
35206 0 : return py_return_authenticator;
35207 : }
35208 :
35209 0 : static int py_netr_AccountSync_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
35210 : {
35211 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35212 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
35213 0 : if (value == NULL) {
35214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
35215 0 : return -1;
35216 : }
35217 0 : object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator);
35218 0 : if (object->in.return_authenticator == NULL) {
35219 0 : PyErr_NoMemory();
35220 0 : return -1;
35221 : }
35222 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
35223 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35224 0 : PyErr_NoMemory();
35225 0 : return -1;
35226 : }
35227 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
35228 0 : return 0;
35229 : }
35230 :
35231 0 : static PyObject *py_netr_AccountSync_out_get_return_authenticator(PyObject *obj, void *closure)
35232 : {
35233 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35234 : PyObject *py_return_authenticator;
35235 0 : if (object->out.return_authenticator == NULL) {
35236 0 : Py_RETURN_NONE;
35237 : }
35238 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
35239 0 : return py_return_authenticator;
35240 : }
35241 :
35242 0 : static int py_netr_AccountSync_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
35243 : {
35244 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35245 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
35246 0 : if (value == NULL) {
35247 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
35248 0 : return -1;
35249 : }
35250 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
35251 0 : if (object->out.return_authenticator == NULL) {
35252 0 : PyErr_NoMemory();
35253 0 : return -1;
35254 : }
35255 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
35256 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35257 0 : PyErr_NoMemory();
35258 0 : return -1;
35259 : }
35260 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
35261 0 : return 0;
35262 : }
35263 :
35264 0 : static PyObject *py_netr_AccountSync_in_get_reference(PyObject *obj, void *closure)
35265 : {
35266 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35267 : PyObject *py_reference;
35268 0 : py_reference = PyLong_FromUnsignedLongLong((uint32_t)object->in.reference);
35269 0 : return py_reference;
35270 : }
35271 :
35272 0 : static int py_netr_AccountSync_in_set_reference(PyObject *py_obj, PyObject *value, void *closure)
35273 : {
35274 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35275 0 : if (value == NULL) {
35276 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.reference");
35277 0 : return -1;
35278 : }
35279 : {
35280 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.reference));
35281 0 : if (PyLong_Check(value)) {
35282 : unsigned long long test_var;
35283 0 : test_var = PyLong_AsUnsignedLongLong(value);
35284 0 : if (PyErr_Occurred() != NULL) {
35285 0 : return -1;
35286 : }
35287 0 : if (test_var > uint_max) {
35288 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35289 : PyLong_Type.tp_name, uint_max, test_var);
35290 0 : return -1;
35291 : }
35292 0 : object->in.reference = test_var;
35293 : } else {
35294 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35295 : PyLong_Type.tp_name);
35296 0 : return -1;
35297 : }
35298 : }
35299 0 : return 0;
35300 : }
35301 :
35302 0 : static PyObject *py_netr_AccountSync_in_get_level(PyObject *obj, void *closure)
35303 : {
35304 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35305 : PyObject *py_level;
35306 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level);
35307 0 : return py_level;
35308 : }
35309 :
35310 0 : static int py_netr_AccountSync_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
35311 : {
35312 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35313 0 : if (value == NULL) {
35314 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
35315 0 : return -1;
35316 : }
35317 : {
35318 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
35319 0 : if (PyLong_Check(value)) {
35320 : unsigned long long test_var;
35321 0 : test_var = PyLong_AsUnsignedLongLong(value);
35322 0 : if (PyErr_Occurred() != NULL) {
35323 0 : return -1;
35324 : }
35325 0 : if (test_var > uint_max) {
35326 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35327 : PyLong_Type.tp_name, uint_max, test_var);
35328 0 : return -1;
35329 : }
35330 0 : object->in.level = test_var;
35331 : } else {
35332 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35333 : PyLong_Type.tp_name);
35334 0 : return -1;
35335 : }
35336 : }
35337 0 : return 0;
35338 : }
35339 :
35340 0 : static PyObject *py_netr_AccountSync_in_get_buffersize(PyObject *obj, void *closure)
35341 : {
35342 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35343 : PyObject *py_buffersize;
35344 0 : py_buffersize = PyLong_FromUnsignedLongLong((uint32_t)object->in.buffersize);
35345 0 : return py_buffersize;
35346 : }
35347 :
35348 0 : static int py_netr_AccountSync_in_set_buffersize(PyObject *py_obj, PyObject *value, void *closure)
35349 : {
35350 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35351 0 : if (value == NULL) {
35352 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffersize");
35353 0 : return -1;
35354 : }
35355 : {
35356 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffersize));
35357 0 : if (PyLong_Check(value)) {
35358 : unsigned long long test_var;
35359 0 : test_var = PyLong_AsUnsignedLongLong(value);
35360 0 : if (PyErr_Occurred() != NULL) {
35361 0 : return -1;
35362 : }
35363 0 : if (test_var > uint_max) {
35364 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35365 : PyLong_Type.tp_name, uint_max, test_var);
35366 0 : return -1;
35367 : }
35368 0 : object->in.buffersize = test_var;
35369 : } else {
35370 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35371 : PyLong_Type.tp_name);
35372 0 : return -1;
35373 : }
35374 : }
35375 0 : return 0;
35376 : }
35377 :
35378 0 : static PyObject *py_netr_AccountSync_out_get_buffer(PyObject *obj, void *closure)
35379 : {
35380 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35381 : PyObject *py_buffer;
35382 0 : if (object->out.buffer == NULL) {
35383 0 : Py_RETURN_NONE;
35384 : }
35385 0 : py_buffer = pytalloc_reference_ex(&netr_AccountBuffer_Type, object->out.buffer, object->out.buffer);
35386 0 : return py_buffer;
35387 : }
35388 :
35389 0 : static int py_netr_AccountSync_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
35390 : {
35391 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35392 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
35393 0 : if (value == NULL) {
35394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.buffer");
35395 0 : return -1;
35396 : }
35397 0 : object->out.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer);
35398 0 : if (object->out.buffer == NULL) {
35399 0 : PyErr_NoMemory();
35400 0 : return -1;
35401 : }
35402 0 : PY_CHECK_TYPE(&netr_AccountBuffer_Type, value, return -1;);
35403 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35404 0 : PyErr_NoMemory();
35405 0 : return -1;
35406 : }
35407 0 : object->out.buffer = (struct netr_AccountBuffer *)pytalloc_get_ptr(value);
35408 0 : return 0;
35409 : }
35410 :
35411 0 : static PyObject *py_netr_AccountSync_out_get_count_returned(PyObject *obj, void *closure)
35412 : {
35413 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35414 : PyObject *py_count_returned;
35415 0 : if (object->out.count_returned == NULL) {
35416 0 : Py_RETURN_NONE;
35417 : }
35418 0 : py_count_returned = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count_returned);
35419 0 : return py_count_returned;
35420 : }
35421 :
35422 0 : static int py_netr_AccountSync_out_set_count_returned(PyObject *py_obj, PyObject *value, void *closure)
35423 : {
35424 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35425 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count_returned));
35426 0 : if (value == NULL) {
35427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count_returned");
35428 0 : return -1;
35429 : }
35430 0 : object->out.count_returned = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count_returned);
35431 0 : if (object->out.count_returned == NULL) {
35432 0 : PyErr_NoMemory();
35433 0 : return -1;
35434 : }
35435 : {
35436 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count_returned));
35437 0 : if (PyLong_Check(value)) {
35438 : unsigned long long test_var;
35439 0 : test_var = PyLong_AsUnsignedLongLong(value);
35440 0 : if (PyErr_Occurred() != NULL) {
35441 0 : return -1;
35442 : }
35443 0 : if (test_var > uint_max) {
35444 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35445 : PyLong_Type.tp_name, uint_max, test_var);
35446 0 : return -1;
35447 : }
35448 0 : *object->out.count_returned = test_var;
35449 : } else {
35450 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35451 : PyLong_Type.tp_name);
35452 0 : return -1;
35453 : }
35454 : }
35455 0 : return 0;
35456 : }
35457 :
35458 0 : static PyObject *py_netr_AccountSync_out_get_total_entries(PyObject *obj, void *closure)
35459 : {
35460 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35461 : PyObject *py_total_entries;
35462 0 : if (object->out.total_entries == NULL) {
35463 0 : Py_RETURN_NONE;
35464 : }
35465 0 : py_total_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_entries);
35466 0 : return py_total_entries;
35467 : }
35468 :
35469 0 : static int py_netr_AccountSync_out_set_total_entries(PyObject *py_obj, PyObject *value, void *closure)
35470 : {
35471 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35472 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_entries));
35473 0 : if (value == NULL) {
35474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_entries");
35475 0 : return -1;
35476 : }
35477 0 : object->out.total_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_entries);
35478 0 : if (object->out.total_entries == NULL) {
35479 0 : PyErr_NoMemory();
35480 0 : return -1;
35481 : }
35482 : {
35483 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_entries));
35484 0 : if (PyLong_Check(value)) {
35485 : unsigned long long test_var;
35486 0 : test_var = PyLong_AsUnsignedLongLong(value);
35487 0 : if (PyErr_Occurred() != NULL) {
35488 0 : return -1;
35489 : }
35490 0 : if (test_var > uint_max) {
35491 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35492 : PyLong_Type.tp_name, uint_max, test_var);
35493 0 : return -1;
35494 : }
35495 0 : *object->out.total_entries = test_var;
35496 : } else {
35497 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35498 : PyLong_Type.tp_name);
35499 0 : return -1;
35500 : }
35501 : }
35502 0 : return 0;
35503 : }
35504 :
35505 0 : static PyObject *py_netr_AccountSync_out_get_next_reference(PyObject *obj, void *closure)
35506 : {
35507 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35508 : PyObject *py_next_reference;
35509 0 : if (object->out.next_reference == NULL) {
35510 0 : Py_RETURN_NONE;
35511 : }
35512 0 : py_next_reference = PyLong_FromUnsignedLongLong((uint32_t)*object->out.next_reference);
35513 0 : return py_next_reference;
35514 : }
35515 :
35516 0 : static int py_netr_AccountSync_out_set_next_reference(PyObject *py_obj, PyObject *value, void *closure)
35517 : {
35518 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35519 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.next_reference));
35520 0 : if (value == NULL) {
35521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.next_reference");
35522 0 : return -1;
35523 : }
35524 0 : object->out.next_reference = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.next_reference);
35525 0 : if (object->out.next_reference == NULL) {
35526 0 : PyErr_NoMemory();
35527 0 : return -1;
35528 : }
35529 : {
35530 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.next_reference));
35531 0 : if (PyLong_Check(value)) {
35532 : unsigned long long test_var;
35533 0 : test_var = PyLong_AsUnsignedLongLong(value);
35534 0 : if (PyErr_Occurred() != NULL) {
35535 0 : return -1;
35536 : }
35537 0 : if (test_var > uint_max) {
35538 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35539 : PyLong_Type.tp_name, uint_max, test_var);
35540 0 : return -1;
35541 : }
35542 0 : *object->out.next_reference = test_var;
35543 : } else {
35544 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35545 : PyLong_Type.tp_name);
35546 0 : return -1;
35547 : }
35548 : }
35549 0 : return 0;
35550 : }
35551 :
35552 0 : static PyObject *py_netr_AccountSync_in_get_recordid(PyObject *obj, void *closure)
35553 : {
35554 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35555 : PyObject *py_recordid;
35556 0 : if (object->in.recordid == NULL) {
35557 0 : Py_RETURN_NONE;
35558 : }
35559 0 : py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, object->in.recordid, object->in.recordid);
35560 0 : return py_recordid;
35561 : }
35562 :
35563 0 : static int py_netr_AccountSync_in_set_recordid(PyObject *py_obj, PyObject *value, void *closure)
35564 : {
35565 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35566 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.recordid));
35567 0 : if (value == NULL) {
35568 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.recordid");
35569 0 : return -1;
35570 : }
35571 0 : object->in.recordid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.recordid);
35572 0 : if (object->in.recordid == NULL) {
35573 0 : PyErr_NoMemory();
35574 0 : return -1;
35575 : }
35576 0 : PY_CHECK_TYPE(&netr_UAS_INFO_0_Type, value, return -1;);
35577 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35578 0 : PyErr_NoMemory();
35579 0 : return -1;
35580 : }
35581 0 : object->in.recordid = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(value);
35582 0 : return 0;
35583 : }
35584 :
35585 0 : static PyObject *py_netr_AccountSync_out_get_recordid(PyObject *obj, void *closure)
35586 : {
35587 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35588 : PyObject *py_recordid;
35589 0 : if (object->out.recordid == NULL) {
35590 0 : Py_RETURN_NONE;
35591 : }
35592 0 : py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, object->out.recordid, object->out.recordid);
35593 0 : return py_recordid;
35594 : }
35595 :
35596 0 : static int py_netr_AccountSync_out_set_recordid(PyObject *py_obj, PyObject *value, void *closure)
35597 : {
35598 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35599 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.recordid));
35600 0 : if (value == NULL) {
35601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.recordid");
35602 0 : return -1;
35603 : }
35604 0 : object->out.recordid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.recordid);
35605 0 : if (object->out.recordid == NULL) {
35606 0 : PyErr_NoMemory();
35607 0 : return -1;
35608 : }
35609 0 : PY_CHECK_TYPE(&netr_UAS_INFO_0_Type, value, return -1;);
35610 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35611 0 : PyErr_NoMemory();
35612 0 : return -1;
35613 : }
35614 0 : object->out.recordid = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(value);
35615 0 : return 0;
35616 : }
35617 :
35618 0 : static PyObject *py_netr_AccountSync_get_result(PyObject *obj, void *closure)
35619 : {
35620 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(obj);
35621 : PyObject *py_result;
35622 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
35623 0 : return py_result;
35624 : }
35625 :
35626 0 : static int py_netr_AccountSync_set_result(PyObject *py_obj, PyObject *value, void *closure)
35627 : {
35628 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35629 0 : if (value == NULL) {
35630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
35631 0 : return -1;
35632 : }
35633 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
35634 0 : return 0;
35635 : }
35636 :
35637 : static PyGetSetDef py_netr_AccountSync_getsetters[] = {
35638 : {
35639 : .name = discard_const_p(char, "in_logon_server"),
35640 : .get = py_netr_AccountSync_in_get_logon_server,
35641 : .set = py_netr_AccountSync_in_set_logon_server,
35642 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
35643 : },
35644 : {
35645 : .name = discard_const_p(char, "in_computername"),
35646 : .get = py_netr_AccountSync_in_get_computername,
35647 : .set = py_netr_AccountSync_in_set_computername,
35648 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
35649 : },
35650 : {
35651 : .name = discard_const_p(char, "in_credential"),
35652 : .get = py_netr_AccountSync_in_get_credential,
35653 : .set = py_netr_AccountSync_in_set_credential,
35654 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
35655 : },
35656 : {
35657 : .name = discard_const_p(char, "in_return_authenticator"),
35658 : .get = py_netr_AccountSync_in_get_return_authenticator,
35659 : .set = py_netr_AccountSync_in_set_return_authenticator,
35660 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
35661 : },
35662 : {
35663 : .name = discard_const_p(char, "out_return_authenticator"),
35664 : .get = py_netr_AccountSync_out_get_return_authenticator,
35665 : .set = py_netr_AccountSync_out_set_return_authenticator,
35666 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
35667 : },
35668 : {
35669 : .name = discard_const_p(char, "in_reference"),
35670 : .get = py_netr_AccountSync_in_get_reference,
35671 : .set = py_netr_AccountSync_in_set_reference,
35672 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35673 : },
35674 : {
35675 : .name = discard_const_p(char, "in_level"),
35676 : .get = py_netr_AccountSync_in_get_level,
35677 : .set = py_netr_AccountSync_in_set_level,
35678 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35679 : },
35680 : {
35681 : .name = discard_const_p(char, "in_buffersize"),
35682 : .get = py_netr_AccountSync_in_get_buffersize,
35683 : .set = py_netr_AccountSync_in_set_buffersize,
35684 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35685 : },
35686 : {
35687 : .name = discard_const_p(char, "out_buffer"),
35688 : .get = py_netr_AccountSync_out_get_buffer,
35689 : .set = py_netr_AccountSync_out_set_buffer,
35690 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_AccountBuffer")
35691 : },
35692 : {
35693 : .name = discard_const_p(char, "out_count_returned"),
35694 : .get = py_netr_AccountSync_out_get_count_returned,
35695 : .set = py_netr_AccountSync_out_set_count_returned,
35696 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35697 : },
35698 : {
35699 : .name = discard_const_p(char, "out_total_entries"),
35700 : .get = py_netr_AccountSync_out_get_total_entries,
35701 : .set = py_netr_AccountSync_out_set_total_entries,
35702 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35703 : },
35704 : {
35705 : .name = discard_const_p(char, "out_next_reference"),
35706 : .get = py_netr_AccountSync_out_get_next_reference,
35707 : .set = py_netr_AccountSync_out_set_next_reference,
35708 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35709 : },
35710 : {
35711 : .name = discard_const_p(char, "in_recordid"),
35712 : .get = py_netr_AccountSync_in_get_recordid,
35713 : .set = py_netr_AccountSync_in_set_recordid,
35714 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UAS_INFO_0")
35715 : },
35716 : {
35717 : .name = discard_const_p(char, "out_recordid"),
35718 : .get = py_netr_AccountSync_out_get_recordid,
35719 : .set = py_netr_AccountSync_out_set_recordid,
35720 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_UAS_INFO_0")
35721 : },
35722 : {
35723 : .name = discard_const_p(char, "result"),
35724 : .get = py_netr_AccountSync_get_result,
35725 : .set = py_netr_AccountSync_set_result,
35726 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
35727 : },
35728 : { .name = NULL }
35729 : };
35730 :
35731 0 : static PyObject *py_netr_AccountSync_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35732 : {
35733 0 : PyObject *self = pytalloc_new(struct netr_AccountSync, type);
35734 0 : struct netr_AccountSync *_self = (struct netr_AccountSync *)pytalloc_get_ptr(self);
35735 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35736 0 : _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
35737 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
35738 0 : _self->out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer);
35739 0 : _self->out.count_returned = talloc_zero(mem_ctx, uint32_t);
35740 0 : _self->out.total_entries = talloc_zero(mem_ctx, uint32_t);
35741 0 : _self->out.next_reference = talloc_zero(mem_ctx, uint32_t);
35742 0 : _self->in.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0);
35743 0 : _self->out.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0);
35744 0 : return self;
35745 : }
35746 :
35747 0 : static PyObject *py_netr_AccountSync_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35748 : {
35749 :
35750 :
35751 0 : return PyLong_FromLong(10);
35752 : }
35753 :
35754 0 : static PyObject *py_netr_AccountSync_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
35755 : {
35756 0 : const struct ndr_interface_call *call = NULL;
35757 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35758 0 : PyObject *ret = NULL;
35759 0 : struct ndr_push *push = NULL;
35760 : DATA_BLOB blob;
35761 : enum ndr_err_code err;
35762 :
35763 0 : if (ndr_table_netlogon.num_calls < 11) {
35764 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountSync_ndr_pack");
35765 0 : return NULL;
35766 : }
35767 0 : call = &ndr_table_netlogon.calls[10];
35768 :
35769 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
35770 0 : if (push == NULL) {
35771 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35772 0 : return NULL;
35773 : }
35774 :
35775 0 : push->flags |= ndr_push_flags;
35776 :
35777 0 : err = call->ndr_push(push, ndr_inout_flags, object);
35778 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35779 0 : TALLOC_FREE(push);
35780 0 : PyErr_SetNdrError(err);
35781 0 : return NULL;
35782 : }
35783 0 : blob = ndr_push_blob(push);
35784 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
35785 0 : TALLOC_FREE(push);
35786 0 : return ret;
35787 : }
35788 :
35789 0 : static PyObject *py_netr_AccountSync_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35790 : {
35791 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35792 0 : PyObject *bigendian_obj = NULL;
35793 0 : PyObject *ndr64_obj = NULL;
35794 0 : uint32_t ndr_push_flags = 0;
35795 :
35796 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
35797 : discard_const_p(char *, kwnames),
35798 : &bigendian_obj,
35799 : &ndr64_obj)) {
35800 0 : return NULL;
35801 : }
35802 :
35803 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35804 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35805 : }
35806 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35807 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35808 : }
35809 :
35810 0 : return py_netr_AccountSync_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
35811 : }
35812 :
35813 0 : static PyObject *py_netr_AccountSync_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35814 : {
35815 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35816 0 : PyObject *bigendian_obj = NULL;
35817 0 : PyObject *ndr64_obj = NULL;
35818 0 : uint32_t ndr_push_flags = 0;
35819 :
35820 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
35821 : discard_const_p(char *, kwnames),
35822 : &bigendian_obj,
35823 : &ndr64_obj)) {
35824 0 : return NULL;
35825 : }
35826 :
35827 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35828 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35829 : }
35830 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35831 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35832 : }
35833 :
35834 0 : return py_netr_AccountSync_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
35835 : }
35836 :
35837 0 : static PyObject *py_netr_AccountSync_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
35838 : {
35839 0 : const struct ndr_interface_call *call = NULL;
35840 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35841 0 : struct ndr_pull *pull = NULL;
35842 : enum ndr_err_code err;
35843 :
35844 0 : if (ndr_table_netlogon.num_calls < 11) {
35845 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountSync_ndr_unpack");
35846 0 : return NULL;
35847 : }
35848 0 : call = &ndr_table_netlogon.calls[10];
35849 :
35850 0 : pull = ndr_pull_init_blob(blob, object);
35851 0 : if (pull == NULL) {
35852 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35853 0 : return NULL;
35854 : }
35855 :
35856 0 : pull->flags |= ndr_pull_flags;
35857 :
35858 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
35859 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35860 0 : TALLOC_FREE(pull);
35861 0 : PyErr_SetNdrError(err);
35862 0 : return NULL;
35863 : }
35864 0 : if (!allow_remaining) {
35865 : uint32_t highest_ofs;
35866 :
35867 0 : if (pull->offset > pull->relative_highest_offset) {
35868 0 : highest_ofs = pull->offset;
35869 : } else {
35870 0 : highest_ofs = pull->relative_highest_offset;
35871 : }
35872 0 : if (highest_ofs < pull->data_size) {
35873 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
35874 : "not all bytes consumed ofs[%u] size[%u]",
35875 : highest_ofs, pull->data_size);
35876 0 : TALLOC_FREE(pull);
35877 0 : PyErr_SetNdrError(err);
35878 0 : return NULL;
35879 : }
35880 : }
35881 :
35882 0 : TALLOC_FREE(pull);
35883 0 : Py_RETURN_NONE;
35884 : }
35885 :
35886 0 : static PyObject *py_netr_AccountSync_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35887 : {
35888 : DATA_BLOB blob;
35889 0 : Py_ssize_t blob_length = 0;
35890 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35891 0 : PyObject *bigendian_obj = NULL;
35892 0 : PyObject *ndr64_obj = NULL;
35893 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35894 0 : PyObject *allow_remaining_obj = NULL;
35895 0 : bool allow_remaining = false;
35896 :
35897 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
35898 : discard_const_p(char *, kwnames),
35899 : &blob.data, &blob_length,
35900 : &bigendian_obj,
35901 : &ndr64_obj,
35902 : &allow_remaining_obj)) {
35903 0 : return NULL;
35904 : }
35905 0 : blob.length = blob_length;
35906 :
35907 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35908 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35909 : }
35910 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35911 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35912 : }
35913 :
35914 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35915 0 : allow_remaining = true;
35916 : }
35917 :
35918 0 : return py_netr_AccountSync_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
35919 : }
35920 :
35921 0 : static PyObject *py_netr_AccountSync_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35922 : {
35923 : DATA_BLOB blob;
35924 0 : Py_ssize_t blob_length = 0;
35925 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35926 0 : PyObject *bigendian_obj = NULL;
35927 0 : PyObject *ndr64_obj = NULL;
35928 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35929 0 : PyObject *allow_remaining_obj = NULL;
35930 0 : bool allow_remaining = false;
35931 :
35932 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
35933 : discard_const_p(char *, kwnames),
35934 : &blob.data, &blob_length,
35935 : &bigendian_obj,
35936 : &ndr64_obj,
35937 : &allow_remaining_obj)) {
35938 0 : return NULL;
35939 : }
35940 0 : blob.length = blob_length;
35941 :
35942 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35943 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35944 : }
35945 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35946 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35947 : }
35948 :
35949 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35950 0 : allow_remaining = true;
35951 : }
35952 :
35953 0 : return py_netr_AccountSync_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
35954 : }
35955 :
35956 0 : static PyObject *py_netr_AccountSync_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
35957 : {
35958 0 : const struct ndr_interface_call *call = NULL;
35959 0 : struct netr_AccountSync *object = (struct netr_AccountSync *)pytalloc_get_ptr(py_obj);
35960 : PyObject *ret;
35961 : char *retstr;
35962 :
35963 0 : if (ndr_table_netlogon.num_calls < 11) {
35964 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_AccountSync_ndr_print");
35965 0 : return NULL;
35966 : }
35967 0 : call = &ndr_table_netlogon.calls[10];
35968 :
35969 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
35970 0 : ret = PyUnicode_FromString(retstr);
35971 0 : TALLOC_FREE(retstr);
35972 :
35973 0 : return ret;
35974 : }
35975 :
35976 0 : static PyObject *py_netr_AccountSync_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35977 : {
35978 0 : return py_netr_AccountSync_ndr_print(py_obj, "netr_AccountSync_in", NDR_IN);
35979 : }
35980 :
35981 0 : static PyObject *py_netr_AccountSync_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35982 : {
35983 0 : return py_netr_AccountSync_ndr_print(py_obj, "netr_AccountSync_out", NDR_OUT);
35984 : }
35985 :
35986 : static PyMethodDef py_netr_AccountSync_methods[] = {
35987 : { "opnum", (PyCFunction)py_netr_AccountSync_ndr_opnum, METH_NOARGS|METH_CLASS,
35988 : "netlogon.netr_AccountSync.opnum() -> 10 (0x0a) " },
35989 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountSync_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
35990 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
35991 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountSync_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
35992 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
35993 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountSync_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
35994 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
35995 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_AccountSync_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
35996 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
35997 : { "__ndr_print_in__", (PyCFunction)py_netr_AccountSync_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
35998 : { "__ndr_print_out__", (PyCFunction)py_netr_AccountSync_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
35999 : { NULL, NULL, 0, NULL }
36000 : };
36001 :
36002 :
36003 : static PyTypeObject netr_AccountSync_Type = {
36004 : PyVarObject_HEAD_INIT(NULL, 0)
36005 : .tp_name = "netlogon.netr_AccountSync",
36006 : .tp_getset = py_netr_AccountSync_getsetters,
36007 : .tp_methods = py_netr_AccountSync_methods,
36008 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36009 : .tp_new = py_netr_AccountSync_new,
36010 : };
36011 :
36012 0 : static bool pack_py_netr_AccountSync_args_in(PyObject *args, PyObject *kwargs, struct netr_AccountSync *r)
36013 : {
36014 : PyObject *py_logon_server;
36015 : PyObject *py_computername;
36016 : PyObject *py_credential;
36017 : PyObject *py_return_authenticator;
36018 : PyObject *py_reference;
36019 : PyObject *py_level;
36020 : PyObject *py_buffersize;
36021 : PyObject *py_recordid;
36022 0 : const char *kwnames[] = {
36023 : "logon_server", "computername", "credential", "return_authenticator", "reference", "level", "buffersize", "recordid", NULL
36024 : };
36025 :
36026 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:netr_AccountSync", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_reference, &py_level, &py_buffersize, &py_recordid)) {
36027 0 : return false;
36028 : }
36029 :
36030 0 : if (py_logon_server == NULL) {
36031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
36032 0 : return false;
36033 : }
36034 0 : if (py_logon_server == Py_None) {
36035 0 : r->in.logon_server = NULL;
36036 : } else {
36037 0 : r->in.logon_server = NULL;
36038 : {
36039 : const char *test_str;
36040 : const char *talloc_str;
36041 0 : PyObject *unicode = NULL;
36042 0 : if (PyUnicode_Check(py_logon_server)) {
36043 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
36044 0 : if (unicode == NULL) {
36045 0 : PyErr_NoMemory();
36046 0 : return false;
36047 : }
36048 0 : test_str = PyBytes_AS_STRING(unicode);
36049 0 : } else if (PyBytes_Check(py_logon_server)) {
36050 0 : test_str = PyBytes_AS_STRING(py_logon_server);
36051 : } else {
36052 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
36053 0 : return false;
36054 : }
36055 0 : talloc_str = talloc_strdup(r, test_str);
36056 0 : if (unicode != NULL) {
36057 0 : Py_DECREF(unicode);
36058 : }
36059 0 : if (talloc_str == NULL) {
36060 0 : PyErr_NoMemory();
36061 0 : return false;
36062 : }
36063 0 : r->in.logon_server = talloc_str;
36064 : }
36065 : }
36066 0 : if (py_computername == NULL) {
36067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername");
36068 0 : return false;
36069 : }
36070 0 : r->in.computername = talloc_ptrtype(r, r->in.computername);
36071 0 : if (r->in.computername == NULL) {
36072 0 : PyErr_NoMemory();
36073 0 : return false;
36074 : }
36075 : {
36076 : const char *test_str;
36077 : const char *talloc_str;
36078 0 : PyObject *unicode = NULL;
36079 0 : if (PyUnicode_Check(py_computername)) {
36080 0 : unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore");
36081 0 : if (unicode == NULL) {
36082 0 : PyErr_NoMemory();
36083 0 : return false;
36084 : }
36085 0 : test_str = PyBytes_AS_STRING(unicode);
36086 0 : } else if (PyBytes_Check(py_computername)) {
36087 0 : test_str = PyBytes_AS_STRING(py_computername);
36088 : } else {
36089 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->tp_name);
36090 0 : return false;
36091 : }
36092 0 : talloc_str = talloc_strdup(r, test_str);
36093 0 : if (unicode != NULL) {
36094 0 : Py_DECREF(unicode);
36095 : }
36096 0 : if (talloc_str == NULL) {
36097 0 : PyErr_NoMemory();
36098 0 : return false;
36099 : }
36100 0 : r->in.computername = talloc_str;
36101 : }
36102 0 : if (py_credential == NULL) {
36103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
36104 0 : return false;
36105 : }
36106 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
36107 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
36108 0 : PyErr_NoMemory();
36109 0 : return false;
36110 : }
36111 0 : r->in.credential = *(struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
36112 0 : if (py_return_authenticator == NULL) {
36113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
36114 0 : return false;
36115 : }
36116 0 : r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator);
36117 0 : if (r->in.return_authenticator == NULL) {
36118 0 : PyErr_NoMemory();
36119 0 : return false;
36120 : }
36121 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
36122 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
36123 0 : PyErr_NoMemory();
36124 0 : return false;
36125 : }
36126 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
36127 0 : if (py_reference == NULL) {
36128 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.reference");
36129 0 : return false;
36130 : }
36131 : {
36132 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.reference));
36133 0 : if (PyLong_Check(py_reference)) {
36134 : unsigned long long test_var;
36135 0 : test_var = PyLong_AsUnsignedLongLong(py_reference);
36136 0 : if (PyErr_Occurred() != NULL) {
36137 0 : return false;
36138 : }
36139 0 : if (test_var > uint_max) {
36140 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36141 : PyLong_Type.tp_name, uint_max, test_var);
36142 0 : return false;
36143 : }
36144 0 : r->in.reference = test_var;
36145 : } else {
36146 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36147 : PyLong_Type.tp_name);
36148 0 : return false;
36149 : }
36150 : }
36151 0 : if (py_level == NULL) {
36152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
36153 0 : return false;
36154 : }
36155 : {
36156 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
36157 0 : if (PyLong_Check(py_level)) {
36158 : unsigned long long test_var;
36159 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
36160 0 : if (PyErr_Occurred() != NULL) {
36161 0 : return false;
36162 : }
36163 0 : if (test_var > uint_max) {
36164 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36165 : PyLong_Type.tp_name, uint_max, test_var);
36166 0 : return false;
36167 : }
36168 0 : r->in.level = test_var;
36169 : } else {
36170 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36171 : PyLong_Type.tp_name);
36172 0 : return false;
36173 : }
36174 : }
36175 0 : if (py_buffersize == NULL) {
36176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buffersize");
36177 0 : return false;
36178 : }
36179 : {
36180 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buffersize));
36181 0 : if (PyLong_Check(py_buffersize)) {
36182 : unsigned long long test_var;
36183 0 : test_var = PyLong_AsUnsignedLongLong(py_buffersize);
36184 0 : if (PyErr_Occurred() != NULL) {
36185 0 : return false;
36186 : }
36187 0 : if (test_var > uint_max) {
36188 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36189 : PyLong_Type.tp_name, uint_max, test_var);
36190 0 : return false;
36191 : }
36192 0 : r->in.buffersize = test_var;
36193 : } else {
36194 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36195 : PyLong_Type.tp_name);
36196 0 : return false;
36197 : }
36198 : }
36199 0 : if (py_recordid == NULL) {
36200 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.recordid");
36201 0 : return false;
36202 : }
36203 0 : r->in.recordid = talloc_ptrtype(r, r->in.recordid);
36204 0 : if (r->in.recordid == NULL) {
36205 0 : PyErr_NoMemory();
36206 0 : return false;
36207 : }
36208 0 : PY_CHECK_TYPE(&netr_UAS_INFO_0_Type, py_recordid, return false;);
36209 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_recordid)) == NULL) {
36210 0 : PyErr_NoMemory();
36211 0 : return false;
36212 : }
36213 0 : r->in.recordid = (struct netr_UAS_INFO_0 *)pytalloc_get_ptr(py_recordid);
36214 0 : return true;
36215 : }
36216 :
36217 0 : static PyObject *unpack_py_netr_AccountSync_args_out(struct netr_AccountSync *r)
36218 : {
36219 : PyObject *result;
36220 : PyObject *py_return_authenticator;
36221 : PyObject *py_buffer;
36222 : PyObject *py_count_returned;
36223 : PyObject *py_total_entries;
36224 : PyObject *py_next_reference;
36225 : PyObject *py_recordid;
36226 0 : result = PyTuple_New(6);
36227 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
36228 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
36229 0 : py_buffer = pytalloc_reference_ex(&netr_AccountBuffer_Type, r->out.buffer, r->out.buffer);
36230 0 : PyTuple_SetItem(result, 1, py_buffer);
36231 0 : py_count_returned = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count_returned);
36232 0 : PyTuple_SetItem(result, 2, py_count_returned);
36233 0 : py_total_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_entries);
36234 0 : PyTuple_SetItem(result, 3, py_total_entries);
36235 0 : py_next_reference = PyLong_FromUnsignedLongLong((uint32_t)*r->out.next_reference);
36236 0 : PyTuple_SetItem(result, 4, py_next_reference);
36237 0 : py_recordid = pytalloc_reference_ex(&netr_UAS_INFO_0_Type, r->out.recordid, r->out.recordid);
36238 0 : PyTuple_SetItem(result, 5, py_recordid);
36239 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
36240 0 : PyErr_SetNTSTATUS(r->out.result);
36241 0 : return NULL;
36242 : }
36243 :
36244 0 : return result;
36245 : }
36246 :
36247 :
36248 0 : static PyObject *py_netr_GetDcName_in_get_logon_server(PyObject *obj, void *closure)
36249 : {
36250 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(obj);
36251 : PyObject *py_logon_server;
36252 0 : if (object->in.logon_server == NULL) {
36253 0 : Py_RETURN_NONE;
36254 : }
36255 0 : if (object->in.logon_server == NULL) {
36256 0 : py_logon_server = Py_None;
36257 0 : Py_INCREF(py_logon_server);
36258 : } else {
36259 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
36260 : }
36261 0 : return py_logon_server;
36262 : }
36263 :
36264 0 : static int py_netr_GetDcName_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
36265 : {
36266 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj);
36267 0 : if (value == NULL) {
36268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
36269 0 : return -1;
36270 : }
36271 0 : object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server);
36272 0 : if (object->in.logon_server == NULL) {
36273 0 : PyErr_NoMemory();
36274 0 : return -1;
36275 : }
36276 : {
36277 : const char *test_str;
36278 : const char *talloc_str;
36279 0 : PyObject *unicode = NULL;
36280 0 : if (PyUnicode_Check(value)) {
36281 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
36282 0 : if (unicode == NULL) {
36283 0 : PyErr_NoMemory();
36284 0 : return -1;
36285 : }
36286 0 : test_str = PyBytes_AS_STRING(unicode);
36287 0 : } else if (PyBytes_Check(value)) {
36288 0 : test_str = PyBytes_AS_STRING(value);
36289 : } else {
36290 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
36291 0 : return -1;
36292 : }
36293 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
36294 0 : if (unicode != NULL) {
36295 0 : Py_DECREF(unicode);
36296 : }
36297 0 : if (talloc_str == NULL) {
36298 0 : PyErr_NoMemory();
36299 0 : return -1;
36300 : }
36301 0 : object->in.logon_server = talloc_str;
36302 : }
36303 0 : return 0;
36304 : }
36305 :
36306 0 : static PyObject *py_netr_GetDcName_in_get_domainname(PyObject *obj, void *closure)
36307 : {
36308 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(obj);
36309 : PyObject *py_domainname;
36310 0 : if (object->in.domainname == NULL) {
36311 0 : Py_RETURN_NONE;
36312 : }
36313 0 : if (object->in.domainname == NULL) {
36314 0 : py_domainname = Py_None;
36315 0 : Py_INCREF(py_domainname);
36316 : } else {
36317 0 : if (object->in.domainname == NULL) {
36318 0 : py_domainname = Py_None;
36319 0 : Py_INCREF(py_domainname);
36320 : } else {
36321 0 : py_domainname = PyUnicode_Decode(object->in.domainname, strlen(object->in.domainname), "utf-8", "ignore");
36322 : }
36323 : }
36324 0 : return py_domainname;
36325 : }
36326 :
36327 0 : static int py_netr_GetDcName_in_set_domainname(PyObject *py_obj, PyObject *value, void *closure)
36328 : {
36329 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj);
36330 0 : if (value == NULL) {
36331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domainname");
36332 0 : return -1;
36333 : }
36334 0 : if (value == Py_None) {
36335 0 : object->in.domainname = NULL;
36336 : } else {
36337 0 : object->in.domainname = NULL;
36338 : {
36339 : const char *test_str;
36340 : const char *talloc_str;
36341 0 : PyObject *unicode = NULL;
36342 0 : if (PyUnicode_Check(value)) {
36343 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
36344 0 : if (unicode == NULL) {
36345 0 : PyErr_NoMemory();
36346 0 : return -1;
36347 : }
36348 0 : test_str = PyBytes_AS_STRING(unicode);
36349 0 : } else if (PyBytes_Check(value)) {
36350 0 : test_str = PyBytes_AS_STRING(value);
36351 : } else {
36352 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
36353 0 : return -1;
36354 : }
36355 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
36356 0 : if (unicode != NULL) {
36357 0 : Py_DECREF(unicode);
36358 : }
36359 0 : if (talloc_str == NULL) {
36360 0 : PyErr_NoMemory();
36361 0 : return -1;
36362 : }
36363 0 : object->in.domainname = talloc_str;
36364 : }
36365 : }
36366 0 : return 0;
36367 : }
36368 :
36369 0 : static PyObject *py_netr_GetDcName_out_get_dcname(PyObject *obj, void *closure)
36370 : {
36371 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(obj);
36372 : PyObject *py_dcname;
36373 0 : if (object->out.dcname == NULL) {
36374 0 : Py_RETURN_NONE;
36375 : }
36376 0 : if (*object->out.dcname == NULL) {
36377 0 : py_dcname = Py_None;
36378 0 : Py_INCREF(py_dcname);
36379 : } else {
36380 0 : if (*object->out.dcname == NULL) {
36381 0 : py_dcname = Py_None;
36382 0 : Py_INCREF(py_dcname);
36383 : } else {
36384 0 : py_dcname = PyUnicode_Decode(*object->out.dcname, strlen(*object->out.dcname), "utf-8", "ignore");
36385 : }
36386 : }
36387 0 : return py_dcname;
36388 : }
36389 :
36390 0 : static int py_netr_GetDcName_out_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
36391 : {
36392 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj);
36393 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dcname));
36394 0 : if (value == NULL) {
36395 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dcname");
36396 0 : return -1;
36397 : }
36398 0 : object->out.dcname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dcname);
36399 0 : if (object->out.dcname == NULL) {
36400 0 : PyErr_NoMemory();
36401 0 : return -1;
36402 : }
36403 0 : if (value == Py_None) {
36404 0 : *object->out.dcname = NULL;
36405 : } else {
36406 0 : *object->out.dcname = NULL;
36407 : {
36408 : const char *test_str;
36409 : const char *talloc_str;
36410 0 : PyObject *unicode = NULL;
36411 0 : if (PyUnicode_Check(value)) {
36412 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
36413 0 : if (unicode == NULL) {
36414 0 : PyErr_NoMemory();
36415 0 : return -1;
36416 : }
36417 0 : test_str = PyBytes_AS_STRING(unicode);
36418 0 : } else if (PyBytes_Check(value)) {
36419 0 : test_str = PyBytes_AS_STRING(value);
36420 : } else {
36421 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
36422 0 : return -1;
36423 : }
36424 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
36425 0 : if (unicode != NULL) {
36426 0 : Py_DECREF(unicode);
36427 : }
36428 0 : if (talloc_str == NULL) {
36429 0 : PyErr_NoMemory();
36430 0 : return -1;
36431 : }
36432 0 : *object->out.dcname = talloc_str;
36433 : }
36434 : }
36435 0 : return 0;
36436 : }
36437 :
36438 0 : static PyObject *py_netr_GetDcName_get_result(PyObject *obj, void *closure)
36439 : {
36440 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(obj);
36441 : PyObject *py_result;
36442 0 : py_result = PyErr_FromWERROR(object->out.result);
36443 0 : return py_result;
36444 : }
36445 :
36446 0 : static int py_netr_GetDcName_set_result(PyObject *py_obj, PyObject *value, void *closure)
36447 : {
36448 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj);
36449 0 : if (value == NULL) {
36450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
36451 0 : return -1;
36452 : }
36453 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
36454 0 : return 0;
36455 : }
36456 :
36457 : static PyGetSetDef py_netr_GetDcName_getsetters[] = {
36458 : {
36459 : .name = discard_const_p(char, "in_logon_server"),
36460 : .get = py_netr_GetDcName_in_get_logon_server,
36461 : .set = py_netr_GetDcName_in_set_logon_server,
36462 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
36463 : },
36464 : {
36465 : .name = discard_const_p(char, "in_domainname"),
36466 : .get = py_netr_GetDcName_in_get_domainname,
36467 : .set = py_netr_GetDcName_in_set_domainname,
36468 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
36469 : },
36470 : {
36471 : .name = discard_const_p(char, "out_dcname"),
36472 : .get = py_netr_GetDcName_out_get_dcname,
36473 : .set = py_netr_GetDcName_out_set_dcname,
36474 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
36475 : },
36476 : {
36477 : .name = discard_const_p(char, "result"),
36478 : .get = py_netr_GetDcName_get_result,
36479 : .set = py_netr_GetDcName_set_result,
36480 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
36481 : },
36482 : { .name = NULL }
36483 : };
36484 :
36485 0 : static PyObject *py_netr_GetDcName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36486 : {
36487 0 : PyObject *self = pytalloc_new(struct netr_GetDcName, type);
36488 0 : return self;
36489 : }
36490 :
36491 0 : static PyObject *py_netr_GetDcName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36492 : {
36493 :
36494 :
36495 0 : return PyLong_FromLong(11);
36496 : }
36497 :
36498 0 : static PyObject *py_netr_GetDcName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
36499 : {
36500 0 : const struct ndr_interface_call *call = NULL;
36501 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj);
36502 0 : PyObject *ret = NULL;
36503 0 : struct ndr_push *push = NULL;
36504 : DATA_BLOB blob;
36505 : enum ndr_err_code err;
36506 :
36507 0 : if (ndr_table_netlogon.num_calls < 12) {
36508 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetDcName_ndr_pack");
36509 0 : return NULL;
36510 : }
36511 0 : call = &ndr_table_netlogon.calls[11];
36512 :
36513 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36514 0 : if (push == NULL) {
36515 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36516 0 : return NULL;
36517 : }
36518 :
36519 0 : push->flags |= ndr_push_flags;
36520 :
36521 0 : err = call->ndr_push(push, ndr_inout_flags, object);
36522 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36523 0 : TALLOC_FREE(push);
36524 0 : PyErr_SetNdrError(err);
36525 0 : return NULL;
36526 : }
36527 0 : blob = ndr_push_blob(push);
36528 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36529 0 : TALLOC_FREE(push);
36530 0 : return ret;
36531 : }
36532 :
36533 0 : static PyObject *py_netr_GetDcName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36534 : {
36535 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36536 0 : PyObject *bigendian_obj = NULL;
36537 0 : PyObject *ndr64_obj = NULL;
36538 0 : uint32_t ndr_push_flags = 0;
36539 :
36540 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36541 : discard_const_p(char *, kwnames),
36542 : &bigendian_obj,
36543 : &ndr64_obj)) {
36544 0 : return NULL;
36545 : }
36546 :
36547 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36548 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36549 : }
36550 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36551 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36552 : }
36553 :
36554 0 : return py_netr_GetDcName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
36555 : }
36556 :
36557 0 : static PyObject *py_netr_GetDcName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36558 : {
36559 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36560 0 : PyObject *bigendian_obj = NULL;
36561 0 : PyObject *ndr64_obj = NULL;
36562 0 : uint32_t ndr_push_flags = 0;
36563 :
36564 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
36565 : discard_const_p(char *, kwnames),
36566 : &bigendian_obj,
36567 : &ndr64_obj)) {
36568 0 : return NULL;
36569 : }
36570 :
36571 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36572 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36573 : }
36574 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36575 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36576 : }
36577 :
36578 0 : return py_netr_GetDcName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
36579 : }
36580 :
36581 0 : static PyObject *py_netr_GetDcName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
36582 : {
36583 0 : const struct ndr_interface_call *call = NULL;
36584 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj);
36585 0 : struct ndr_pull *pull = NULL;
36586 : enum ndr_err_code err;
36587 :
36588 0 : if (ndr_table_netlogon.num_calls < 12) {
36589 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetDcName_ndr_unpack");
36590 0 : return NULL;
36591 : }
36592 0 : call = &ndr_table_netlogon.calls[11];
36593 :
36594 0 : pull = ndr_pull_init_blob(blob, object);
36595 0 : if (pull == NULL) {
36596 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36597 0 : return NULL;
36598 : }
36599 :
36600 0 : pull->flags |= ndr_pull_flags;
36601 :
36602 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
36603 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36604 0 : TALLOC_FREE(pull);
36605 0 : PyErr_SetNdrError(err);
36606 0 : return NULL;
36607 : }
36608 0 : if (!allow_remaining) {
36609 : uint32_t highest_ofs;
36610 :
36611 0 : if (pull->offset > pull->relative_highest_offset) {
36612 0 : highest_ofs = pull->offset;
36613 : } else {
36614 0 : highest_ofs = pull->relative_highest_offset;
36615 : }
36616 0 : if (highest_ofs < pull->data_size) {
36617 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
36618 : "not all bytes consumed ofs[%u] size[%u]",
36619 : highest_ofs, pull->data_size);
36620 0 : TALLOC_FREE(pull);
36621 0 : PyErr_SetNdrError(err);
36622 0 : return NULL;
36623 : }
36624 : }
36625 :
36626 0 : TALLOC_FREE(pull);
36627 0 : Py_RETURN_NONE;
36628 : }
36629 :
36630 0 : static PyObject *py_netr_GetDcName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36631 : {
36632 : DATA_BLOB blob;
36633 0 : Py_ssize_t blob_length = 0;
36634 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36635 0 : PyObject *bigendian_obj = NULL;
36636 0 : PyObject *ndr64_obj = NULL;
36637 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36638 0 : PyObject *allow_remaining_obj = NULL;
36639 0 : bool allow_remaining = false;
36640 :
36641 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
36642 : discard_const_p(char *, kwnames),
36643 : &blob.data, &blob_length,
36644 : &bigendian_obj,
36645 : &ndr64_obj,
36646 : &allow_remaining_obj)) {
36647 0 : return NULL;
36648 : }
36649 0 : blob.length = blob_length;
36650 :
36651 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36652 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36653 : }
36654 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36655 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36656 : }
36657 :
36658 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36659 0 : allow_remaining = true;
36660 : }
36661 :
36662 0 : return py_netr_GetDcName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
36663 : }
36664 :
36665 0 : static PyObject *py_netr_GetDcName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36666 : {
36667 : DATA_BLOB blob;
36668 0 : Py_ssize_t blob_length = 0;
36669 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36670 0 : PyObject *bigendian_obj = NULL;
36671 0 : PyObject *ndr64_obj = NULL;
36672 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36673 0 : PyObject *allow_remaining_obj = NULL;
36674 0 : bool allow_remaining = false;
36675 :
36676 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36677 : discard_const_p(char *, kwnames),
36678 : &blob.data, &blob_length,
36679 : &bigendian_obj,
36680 : &ndr64_obj,
36681 : &allow_remaining_obj)) {
36682 0 : return NULL;
36683 : }
36684 0 : blob.length = blob_length;
36685 :
36686 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36687 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36688 : }
36689 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36690 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36691 : }
36692 :
36693 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36694 0 : allow_remaining = true;
36695 : }
36696 :
36697 0 : return py_netr_GetDcName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36698 : }
36699 :
36700 0 : static PyObject *py_netr_GetDcName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
36701 : {
36702 0 : const struct ndr_interface_call *call = NULL;
36703 0 : struct netr_GetDcName *object = (struct netr_GetDcName *)pytalloc_get_ptr(py_obj);
36704 : PyObject *ret;
36705 : char *retstr;
36706 :
36707 0 : if (ndr_table_netlogon.num_calls < 12) {
36708 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetDcName_ndr_print");
36709 0 : return NULL;
36710 : }
36711 0 : call = &ndr_table_netlogon.calls[11];
36712 :
36713 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36714 0 : ret = PyUnicode_FromString(retstr);
36715 0 : TALLOC_FREE(retstr);
36716 :
36717 0 : return ret;
36718 : }
36719 :
36720 0 : static PyObject *py_netr_GetDcName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36721 : {
36722 0 : return py_netr_GetDcName_ndr_print(py_obj, "netr_GetDcName_in", NDR_IN);
36723 : }
36724 :
36725 0 : static PyObject *py_netr_GetDcName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36726 : {
36727 0 : return py_netr_GetDcName_ndr_print(py_obj, "netr_GetDcName_out", NDR_OUT);
36728 : }
36729 :
36730 : static PyMethodDef py_netr_GetDcName_methods[] = {
36731 : { "opnum", (PyCFunction)py_netr_GetDcName_ndr_opnum, METH_NOARGS|METH_CLASS,
36732 : "netlogon.netr_GetDcName.opnum() -> 11 (0x0b) " },
36733 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetDcName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36734 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36735 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetDcName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36736 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36737 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetDcName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36738 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36739 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetDcName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36740 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36741 : { "__ndr_print_in__", (PyCFunction)py_netr_GetDcName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36742 : { "__ndr_print_out__", (PyCFunction)py_netr_GetDcName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36743 : { NULL, NULL, 0, NULL }
36744 : };
36745 :
36746 :
36747 : static PyTypeObject netr_GetDcName_Type = {
36748 : PyVarObject_HEAD_INIT(NULL, 0)
36749 : .tp_name = "netlogon.netr_GetDcName",
36750 : .tp_getset = py_netr_GetDcName_getsetters,
36751 : .tp_methods = py_netr_GetDcName_methods,
36752 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36753 : .tp_new = py_netr_GetDcName_new,
36754 : };
36755 :
36756 0 : static bool pack_py_netr_GetDcName_args_in(PyObject *args, PyObject *kwargs, struct netr_GetDcName *r)
36757 : {
36758 : PyObject *py_logon_server;
36759 : PyObject *py_domainname;
36760 0 : const char *kwnames[] = {
36761 : "logon_server", "domainname", NULL
36762 : };
36763 :
36764 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_GetDcName", discard_const_p(char *, kwnames), &py_logon_server, &py_domainname)) {
36765 0 : return false;
36766 : }
36767 :
36768 0 : if (py_logon_server == NULL) {
36769 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
36770 0 : return false;
36771 : }
36772 0 : r->in.logon_server = talloc_ptrtype(r, r->in.logon_server);
36773 0 : if (r->in.logon_server == NULL) {
36774 0 : PyErr_NoMemory();
36775 0 : return false;
36776 : }
36777 : {
36778 : const char *test_str;
36779 : const char *talloc_str;
36780 0 : PyObject *unicode = NULL;
36781 0 : if (PyUnicode_Check(py_logon_server)) {
36782 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
36783 0 : if (unicode == NULL) {
36784 0 : PyErr_NoMemory();
36785 0 : return false;
36786 : }
36787 0 : test_str = PyBytes_AS_STRING(unicode);
36788 0 : } else if (PyBytes_Check(py_logon_server)) {
36789 0 : test_str = PyBytes_AS_STRING(py_logon_server);
36790 : } else {
36791 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
36792 0 : return false;
36793 : }
36794 0 : talloc_str = talloc_strdup(r, test_str);
36795 0 : if (unicode != NULL) {
36796 0 : Py_DECREF(unicode);
36797 : }
36798 0 : if (talloc_str == NULL) {
36799 0 : PyErr_NoMemory();
36800 0 : return false;
36801 : }
36802 0 : r->in.logon_server = talloc_str;
36803 : }
36804 0 : if (py_domainname == NULL) {
36805 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domainname");
36806 0 : return false;
36807 : }
36808 0 : if (py_domainname == Py_None) {
36809 0 : r->in.domainname = NULL;
36810 : } else {
36811 0 : r->in.domainname = NULL;
36812 : {
36813 : const char *test_str;
36814 : const char *talloc_str;
36815 0 : PyObject *unicode = NULL;
36816 0 : if (PyUnicode_Check(py_domainname)) {
36817 0 : unicode = PyUnicode_AsEncodedString(py_domainname, "utf-8", "ignore");
36818 0 : if (unicode == NULL) {
36819 0 : PyErr_NoMemory();
36820 0 : return false;
36821 : }
36822 0 : test_str = PyBytes_AS_STRING(unicode);
36823 0 : } else if (PyBytes_Check(py_domainname)) {
36824 0 : test_str = PyBytes_AS_STRING(py_domainname);
36825 : } else {
36826 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domainname)->tp_name);
36827 0 : return false;
36828 : }
36829 0 : talloc_str = talloc_strdup(r, test_str);
36830 0 : if (unicode != NULL) {
36831 0 : Py_DECREF(unicode);
36832 : }
36833 0 : if (talloc_str == NULL) {
36834 0 : PyErr_NoMemory();
36835 0 : return false;
36836 : }
36837 0 : r->in.domainname = talloc_str;
36838 : }
36839 : }
36840 0 : return true;
36841 : }
36842 :
36843 0 : static PyObject *unpack_py_netr_GetDcName_args_out(struct netr_GetDcName *r)
36844 : {
36845 : PyObject *result;
36846 : PyObject *py_dcname;
36847 0 : if (*r->out.dcname == NULL) {
36848 0 : py_dcname = Py_None;
36849 0 : Py_INCREF(py_dcname);
36850 : } else {
36851 0 : if (*r->out.dcname == NULL) {
36852 0 : py_dcname = Py_None;
36853 0 : Py_INCREF(py_dcname);
36854 : } else {
36855 0 : py_dcname = PyUnicode_Decode(*r->out.dcname, strlen(*r->out.dcname), "utf-8", "ignore");
36856 : }
36857 : }
36858 0 : result = py_dcname;
36859 0 : if (!W_ERROR_IS_OK(r->out.result)) {
36860 0 : PyErr_SetWERROR(r->out.result);
36861 0 : return NULL;
36862 : }
36863 :
36864 0 : return result;
36865 : }
36866 :
36867 :
36868 0 : static PyObject *py_netr_LogonControl_in_get_logon_server(PyObject *obj, void *closure)
36869 : {
36870 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(obj);
36871 : PyObject *py_logon_server;
36872 0 : if (object->in.logon_server == NULL) {
36873 0 : Py_RETURN_NONE;
36874 : }
36875 0 : if (object->in.logon_server == NULL) {
36876 0 : py_logon_server = Py_None;
36877 0 : Py_INCREF(py_logon_server);
36878 : } else {
36879 0 : if (object->in.logon_server == NULL) {
36880 0 : py_logon_server = Py_None;
36881 0 : Py_INCREF(py_logon_server);
36882 : } else {
36883 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
36884 : }
36885 : }
36886 0 : return py_logon_server;
36887 : }
36888 :
36889 0 : static int py_netr_LogonControl_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
36890 : {
36891 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj);
36892 0 : if (value == NULL) {
36893 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
36894 0 : return -1;
36895 : }
36896 0 : if (value == Py_None) {
36897 0 : object->in.logon_server = NULL;
36898 : } else {
36899 0 : object->in.logon_server = NULL;
36900 : {
36901 : const char *test_str;
36902 : const char *talloc_str;
36903 0 : PyObject *unicode = NULL;
36904 0 : if (PyUnicode_Check(value)) {
36905 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
36906 0 : if (unicode == NULL) {
36907 0 : PyErr_NoMemory();
36908 0 : return -1;
36909 : }
36910 0 : test_str = PyBytes_AS_STRING(unicode);
36911 0 : } else if (PyBytes_Check(value)) {
36912 0 : test_str = PyBytes_AS_STRING(value);
36913 : } else {
36914 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
36915 0 : return -1;
36916 : }
36917 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
36918 0 : if (unicode != NULL) {
36919 0 : Py_DECREF(unicode);
36920 : }
36921 0 : if (talloc_str == NULL) {
36922 0 : PyErr_NoMemory();
36923 0 : return -1;
36924 : }
36925 0 : object->in.logon_server = talloc_str;
36926 : }
36927 : }
36928 0 : return 0;
36929 : }
36930 :
36931 0 : static PyObject *py_netr_LogonControl_in_get_function_code(PyObject *obj, void *closure)
36932 : {
36933 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(obj);
36934 : PyObject *py_function_code;
36935 0 : py_function_code = PyLong_FromUnsignedLongLong((uint32_t)object->in.function_code);
36936 0 : return py_function_code;
36937 : }
36938 :
36939 0 : static int py_netr_LogonControl_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure)
36940 : {
36941 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj);
36942 0 : if (value == NULL) {
36943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.function_code");
36944 0 : return -1;
36945 : }
36946 : {
36947 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.function_code));
36948 0 : if (PyLong_Check(value)) {
36949 : unsigned long long test_var;
36950 0 : test_var = PyLong_AsUnsignedLongLong(value);
36951 0 : if (PyErr_Occurred() != NULL) {
36952 0 : return -1;
36953 : }
36954 0 : if (test_var > uint_max) {
36955 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36956 : PyLong_Type.tp_name, uint_max, test_var);
36957 0 : return -1;
36958 : }
36959 0 : object->in.function_code = test_var;
36960 : } else {
36961 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36962 : PyLong_Type.tp_name);
36963 0 : return -1;
36964 : }
36965 : }
36966 0 : return 0;
36967 : }
36968 :
36969 0 : static PyObject *py_netr_LogonControl_in_get_level(PyObject *obj, void *closure)
36970 : {
36971 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(obj);
36972 : PyObject *py_level;
36973 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level);
36974 0 : return py_level;
36975 : }
36976 :
36977 0 : static int py_netr_LogonControl_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
36978 : {
36979 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj);
36980 0 : if (value == NULL) {
36981 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
36982 0 : return -1;
36983 : }
36984 : {
36985 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
36986 0 : if (PyLong_Check(value)) {
36987 : unsigned long long test_var;
36988 0 : test_var = PyLong_AsUnsignedLongLong(value);
36989 0 : if (PyErr_Occurred() != NULL) {
36990 0 : return -1;
36991 : }
36992 0 : if (test_var > uint_max) {
36993 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36994 : PyLong_Type.tp_name, uint_max, test_var);
36995 0 : return -1;
36996 : }
36997 0 : object->in.level = test_var;
36998 : } else {
36999 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37000 : PyLong_Type.tp_name);
37001 0 : return -1;
37002 : }
37003 : }
37004 0 : return 0;
37005 : }
37006 :
37007 0 : static PyObject *py_netr_LogonControl_out_get_query(PyObject *obj, void *closure)
37008 : {
37009 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(obj);
37010 : PyObject *py_query;
37011 0 : if (object->out.query == NULL) {
37012 0 : Py_RETURN_NONE;
37013 : }
37014 0 : py_query = pyrpc_import_union(&netr_CONTROL_QUERY_INFORMATION_Type, object->out.query, object->in.level, object->out.query, "union netr_CONTROL_QUERY_INFORMATION");
37015 0 : if (py_query == NULL) {
37016 0 : return NULL;
37017 : }
37018 0 : return py_query;
37019 : }
37020 :
37021 0 : static int py_netr_LogonControl_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
37022 : {
37023 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj);
37024 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.query));
37025 0 : if (value == NULL) {
37026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query");
37027 0 : return -1;
37028 : }
37029 0 : object->out.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query);
37030 0 : if (object->out.query == NULL) {
37031 0 : PyErr_NoMemory();
37032 0 : return -1;
37033 : }
37034 : {
37035 : union netr_CONTROL_QUERY_INFORMATION *query_switch_1;
37036 0 : query_switch_1 = (union netr_CONTROL_QUERY_INFORMATION *)pyrpc_export_union(&netr_CONTROL_QUERY_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_CONTROL_QUERY_INFORMATION");
37037 0 : if (query_switch_1 == NULL) {
37038 0 : return -1;
37039 : }
37040 0 : object->out.query = query_switch_1;
37041 : }
37042 0 : return 0;
37043 : }
37044 :
37045 0 : static PyObject *py_netr_LogonControl_get_result(PyObject *obj, void *closure)
37046 : {
37047 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(obj);
37048 : PyObject *py_result;
37049 0 : py_result = PyErr_FromWERROR(object->out.result);
37050 0 : return py_result;
37051 : }
37052 :
37053 0 : static int py_netr_LogonControl_set_result(PyObject *py_obj, PyObject *value, void *closure)
37054 : {
37055 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj);
37056 0 : if (value == NULL) {
37057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
37058 0 : return -1;
37059 : }
37060 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
37061 0 : return 0;
37062 : }
37063 :
37064 : static PyGetSetDef py_netr_LogonControl_getsetters[] = {
37065 : {
37066 : .name = discard_const_p(char, "in_logon_server"),
37067 : .get = py_netr_LogonControl_in_get_logon_server,
37068 : .set = py_netr_LogonControl_in_set_logon_server,
37069 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37070 : },
37071 : {
37072 : .name = discard_const_p(char, "in_function_code"),
37073 : .get = py_netr_LogonControl_in_get_function_code,
37074 : .set = py_netr_LogonControl_in_set_function_code,
37075 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonControlCode")
37076 : },
37077 : {
37078 : .name = discard_const_p(char, "in_level"),
37079 : .get = py_netr_LogonControl_in_get_level,
37080 : .set = py_netr_LogonControl_in_set_level,
37081 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37082 : },
37083 : {
37084 : .name = discard_const_p(char, "out_query"),
37085 : .get = py_netr_LogonControl_out_get_query,
37086 : .set = py_netr_LogonControl_out_set_query,
37087 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_QUERY_INFORMATION")
37088 : },
37089 : {
37090 : .name = discard_const_p(char, "result"),
37091 : .get = py_netr_LogonControl_get_result,
37092 : .set = py_netr_LogonControl_set_result,
37093 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
37094 : },
37095 : { .name = NULL }
37096 : };
37097 :
37098 0 : static PyObject *py_netr_LogonControl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37099 : {
37100 0 : PyObject *self = pytalloc_new(struct netr_LogonControl, type);
37101 0 : struct netr_LogonControl *_self = (struct netr_LogonControl *)pytalloc_get_ptr(self);
37102 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
37103 0 : _self->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
37104 0 : return self;
37105 : }
37106 :
37107 0 : static PyObject *py_netr_LogonControl_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37108 : {
37109 :
37110 :
37111 0 : return PyLong_FromLong(12);
37112 : }
37113 :
37114 0 : static PyObject *py_netr_LogonControl_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
37115 : {
37116 0 : const struct ndr_interface_call *call = NULL;
37117 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj);
37118 0 : PyObject *ret = NULL;
37119 0 : struct ndr_push *push = NULL;
37120 : DATA_BLOB blob;
37121 : enum ndr_err_code err;
37122 :
37123 0 : if (ndr_table_netlogon.num_calls < 13) {
37124 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl_ndr_pack");
37125 0 : return NULL;
37126 : }
37127 0 : call = &ndr_table_netlogon.calls[12];
37128 :
37129 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37130 0 : if (push == NULL) {
37131 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37132 0 : return NULL;
37133 : }
37134 :
37135 0 : push->flags |= ndr_push_flags;
37136 :
37137 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37138 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37139 0 : TALLOC_FREE(push);
37140 0 : PyErr_SetNdrError(err);
37141 0 : return NULL;
37142 : }
37143 0 : blob = ndr_push_blob(push);
37144 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37145 0 : TALLOC_FREE(push);
37146 0 : return ret;
37147 : }
37148 :
37149 0 : static PyObject *py_netr_LogonControl_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37150 : {
37151 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37152 0 : PyObject *bigendian_obj = NULL;
37153 0 : PyObject *ndr64_obj = NULL;
37154 0 : uint32_t ndr_push_flags = 0;
37155 :
37156 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37157 : discard_const_p(char *, kwnames),
37158 : &bigendian_obj,
37159 : &ndr64_obj)) {
37160 0 : return NULL;
37161 : }
37162 :
37163 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37164 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37165 : }
37166 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37167 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37168 : }
37169 :
37170 0 : return py_netr_LogonControl_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37171 : }
37172 :
37173 0 : static PyObject *py_netr_LogonControl_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37174 : {
37175 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37176 0 : PyObject *bigendian_obj = NULL;
37177 0 : PyObject *ndr64_obj = NULL;
37178 0 : uint32_t ndr_push_flags = 0;
37179 :
37180 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37181 : discard_const_p(char *, kwnames),
37182 : &bigendian_obj,
37183 : &ndr64_obj)) {
37184 0 : return NULL;
37185 : }
37186 :
37187 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37188 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37189 : }
37190 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37191 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37192 : }
37193 :
37194 0 : return py_netr_LogonControl_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37195 : }
37196 :
37197 0 : static PyObject *py_netr_LogonControl_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
37198 : {
37199 0 : const struct ndr_interface_call *call = NULL;
37200 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj);
37201 0 : struct ndr_pull *pull = NULL;
37202 : enum ndr_err_code err;
37203 :
37204 0 : if (ndr_table_netlogon.num_calls < 13) {
37205 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl_ndr_unpack");
37206 0 : return NULL;
37207 : }
37208 0 : call = &ndr_table_netlogon.calls[12];
37209 :
37210 0 : pull = ndr_pull_init_blob(blob, object);
37211 0 : if (pull == NULL) {
37212 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37213 0 : return NULL;
37214 : }
37215 :
37216 0 : pull->flags |= ndr_pull_flags;
37217 :
37218 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37219 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37220 0 : TALLOC_FREE(pull);
37221 0 : PyErr_SetNdrError(err);
37222 0 : return NULL;
37223 : }
37224 0 : if (!allow_remaining) {
37225 : uint32_t highest_ofs;
37226 :
37227 0 : if (pull->offset > pull->relative_highest_offset) {
37228 0 : highest_ofs = pull->offset;
37229 : } else {
37230 0 : highest_ofs = pull->relative_highest_offset;
37231 : }
37232 0 : if (highest_ofs < pull->data_size) {
37233 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37234 : "not all bytes consumed ofs[%u] size[%u]",
37235 : highest_ofs, pull->data_size);
37236 0 : TALLOC_FREE(pull);
37237 0 : PyErr_SetNdrError(err);
37238 0 : return NULL;
37239 : }
37240 : }
37241 :
37242 0 : TALLOC_FREE(pull);
37243 0 : Py_RETURN_NONE;
37244 : }
37245 :
37246 0 : static PyObject *py_netr_LogonControl_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37247 : {
37248 : DATA_BLOB blob;
37249 0 : Py_ssize_t blob_length = 0;
37250 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37251 0 : PyObject *bigendian_obj = NULL;
37252 0 : PyObject *ndr64_obj = NULL;
37253 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37254 0 : PyObject *allow_remaining_obj = NULL;
37255 0 : bool allow_remaining = false;
37256 :
37257 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37258 : discard_const_p(char *, kwnames),
37259 : &blob.data, &blob_length,
37260 : &bigendian_obj,
37261 : &ndr64_obj,
37262 : &allow_remaining_obj)) {
37263 0 : return NULL;
37264 : }
37265 0 : blob.length = blob_length;
37266 :
37267 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37268 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37269 : }
37270 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37271 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37272 : }
37273 :
37274 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37275 0 : allow_remaining = true;
37276 : }
37277 :
37278 0 : return py_netr_LogonControl_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37279 : }
37280 :
37281 0 : static PyObject *py_netr_LogonControl_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37282 : {
37283 : DATA_BLOB blob;
37284 0 : Py_ssize_t blob_length = 0;
37285 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37286 0 : PyObject *bigendian_obj = NULL;
37287 0 : PyObject *ndr64_obj = NULL;
37288 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37289 0 : PyObject *allow_remaining_obj = NULL;
37290 0 : bool allow_remaining = false;
37291 :
37292 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37293 : discard_const_p(char *, kwnames),
37294 : &blob.data, &blob_length,
37295 : &bigendian_obj,
37296 : &ndr64_obj,
37297 : &allow_remaining_obj)) {
37298 0 : return NULL;
37299 : }
37300 0 : blob.length = blob_length;
37301 :
37302 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37303 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37304 : }
37305 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37306 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37307 : }
37308 :
37309 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37310 0 : allow_remaining = true;
37311 : }
37312 :
37313 0 : return py_netr_LogonControl_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37314 : }
37315 :
37316 0 : static PyObject *py_netr_LogonControl_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
37317 : {
37318 0 : const struct ndr_interface_call *call = NULL;
37319 0 : struct netr_LogonControl *object = (struct netr_LogonControl *)pytalloc_get_ptr(py_obj);
37320 : PyObject *ret;
37321 : char *retstr;
37322 :
37323 0 : if (ndr_table_netlogon.num_calls < 13) {
37324 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl_ndr_print");
37325 0 : return NULL;
37326 : }
37327 0 : call = &ndr_table_netlogon.calls[12];
37328 :
37329 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37330 0 : ret = PyUnicode_FromString(retstr);
37331 0 : TALLOC_FREE(retstr);
37332 :
37333 0 : return ret;
37334 : }
37335 :
37336 0 : static PyObject *py_netr_LogonControl_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37337 : {
37338 0 : return py_netr_LogonControl_ndr_print(py_obj, "netr_LogonControl_in", NDR_IN);
37339 : }
37340 :
37341 0 : static PyObject *py_netr_LogonControl_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37342 : {
37343 0 : return py_netr_LogonControl_ndr_print(py_obj, "netr_LogonControl_out", NDR_OUT);
37344 : }
37345 :
37346 : static PyMethodDef py_netr_LogonControl_methods[] = {
37347 : { "opnum", (PyCFunction)py_netr_LogonControl_ndr_opnum, METH_NOARGS|METH_CLASS,
37348 : "netlogon.netr_LogonControl.opnum() -> 12 (0x0c) " },
37349 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37350 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37351 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37352 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37353 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37354 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37355 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37356 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37357 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonControl_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37358 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonControl_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37359 : { NULL, NULL, 0, NULL }
37360 : };
37361 :
37362 :
37363 : static PyTypeObject netr_LogonControl_Type = {
37364 : PyVarObject_HEAD_INIT(NULL, 0)
37365 : .tp_name = "netlogon.netr_LogonControl",
37366 : .tp_getset = py_netr_LogonControl_getsetters,
37367 : .tp_methods = py_netr_LogonControl_methods,
37368 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37369 : .tp_new = py_netr_LogonControl_new,
37370 : };
37371 :
37372 0 : static bool pack_py_netr_LogonControl_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonControl *r)
37373 : {
37374 : PyObject *py_logon_server;
37375 : PyObject *py_function_code;
37376 : PyObject *py_level;
37377 0 : const char *kwnames[] = {
37378 : "logon_server", "function_code", "level", NULL
37379 : };
37380 :
37381 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_LogonControl", discard_const_p(char *, kwnames), &py_logon_server, &py_function_code, &py_level)) {
37382 0 : return false;
37383 : }
37384 :
37385 0 : if (py_logon_server == NULL) {
37386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
37387 0 : return false;
37388 : }
37389 0 : if (py_logon_server == Py_None) {
37390 0 : r->in.logon_server = NULL;
37391 : } else {
37392 0 : r->in.logon_server = NULL;
37393 : {
37394 : const char *test_str;
37395 : const char *talloc_str;
37396 0 : PyObject *unicode = NULL;
37397 0 : if (PyUnicode_Check(py_logon_server)) {
37398 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
37399 0 : if (unicode == NULL) {
37400 0 : PyErr_NoMemory();
37401 0 : return false;
37402 : }
37403 0 : test_str = PyBytes_AS_STRING(unicode);
37404 0 : } else if (PyBytes_Check(py_logon_server)) {
37405 0 : test_str = PyBytes_AS_STRING(py_logon_server);
37406 : } else {
37407 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
37408 0 : return false;
37409 : }
37410 0 : talloc_str = talloc_strdup(r, test_str);
37411 0 : if (unicode != NULL) {
37412 0 : Py_DECREF(unicode);
37413 : }
37414 0 : if (talloc_str == NULL) {
37415 0 : PyErr_NoMemory();
37416 0 : return false;
37417 : }
37418 0 : r->in.logon_server = talloc_str;
37419 : }
37420 : }
37421 0 : if (py_function_code == NULL) {
37422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.function_code");
37423 0 : return false;
37424 : }
37425 : {
37426 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.function_code));
37427 0 : if (PyLong_Check(py_function_code)) {
37428 : unsigned long long test_var;
37429 0 : test_var = PyLong_AsUnsignedLongLong(py_function_code);
37430 0 : if (PyErr_Occurred() != NULL) {
37431 0 : return false;
37432 : }
37433 0 : if (test_var > uint_max) {
37434 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37435 : PyLong_Type.tp_name, uint_max, test_var);
37436 0 : return false;
37437 : }
37438 0 : r->in.function_code = test_var;
37439 : } else {
37440 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37441 : PyLong_Type.tp_name);
37442 0 : return false;
37443 : }
37444 : }
37445 0 : if (py_level == NULL) {
37446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
37447 0 : return false;
37448 : }
37449 : {
37450 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
37451 0 : if (PyLong_Check(py_level)) {
37452 : unsigned long long test_var;
37453 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
37454 0 : if (PyErr_Occurred() != NULL) {
37455 0 : return false;
37456 : }
37457 0 : if (test_var > uint_max) {
37458 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37459 : PyLong_Type.tp_name, uint_max, test_var);
37460 0 : return false;
37461 : }
37462 0 : r->in.level = test_var;
37463 : } else {
37464 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37465 : PyLong_Type.tp_name);
37466 0 : return false;
37467 : }
37468 : }
37469 0 : return true;
37470 : }
37471 :
37472 0 : static PyObject *unpack_py_netr_LogonControl_args_out(struct netr_LogonControl *r)
37473 : {
37474 : PyObject *result;
37475 : PyObject *py_query;
37476 0 : py_query = pyrpc_import_union(&netr_CONTROL_QUERY_INFORMATION_Type, r->out.query, r->in.level, r->out.query, "union netr_CONTROL_QUERY_INFORMATION");
37477 0 : if (py_query == NULL) {
37478 0 : return NULL;
37479 : }
37480 0 : result = py_query;
37481 0 : if (!W_ERROR_IS_OK(r->out.result)) {
37482 0 : PyErr_SetWERROR(r->out.result);
37483 0 : return NULL;
37484 : }
37485 :
37486 0 : return result;
37487 : }
37488 :
37489 :
37490 0 : static PyObject *py_netr_GetAnyDCName_in_get_logon_server(PyObject *obj, void *closure)
37491 : {
37492 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(obj);
37493 : PyObject *py_logon_server;
37494 0 : if (object->in.logon_server == NULL) {
37495 0 : Py_RETURN_NONE;
37496 : }
37497 0 : if (object->in.logon_server == NULL) {
37498 0 : py_logon_server = Py_None;
37499 0 : Py_INCREF(py_logon_server);
37500 : } else {
37501 0 : if (object->in.logon_server == NULL) {
37502 0 : py_logon_server = Py_None;
37503 0 : Py_INCREF(py_logon_server);
37504 : } else {
37505 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
37506 : }
37507 : }
37508 0 : return py_logon_server;
37509 : }
37510 :
37511 0 : static int py_netr_GetAnyDCName_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
37512 : {
37513 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj);
37514 0 : if (value == NULL) {
37515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
37516 0 : return -1;
37517 : }
37518 0 : if (value == Py_None) {
37519 0 : object->in.logon_server = NULL;
37520 : } else {
37521 0 : object->in.logon_server = NULL;
37522 : {
37523 : const char *test_str;
37524 : const char *talloc_str;
37525 0 : PyObject *unicode = NULL;
37526 0 : if (PyUnicode_Check(value)) {
37527 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
37528 0 : if (unicode == NULL) {
37529 0 : PyErr_NoMemory();
37530 0 : return -1;
37531 : }
37532 0 : test_str = PyBytes_AS_STRING(unicode);
37533 0 : } else if (PyBytes_Check(value)) {
37534 0 : test_str = PyBytes_AS_STRING(value);
37535 : } else {
37536 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
37537 0 : return -1;
37538 : }
37539 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
37540 0 : if (unicode != NULL) {
37541 0 : Py_DECREF(unicode);
37542 : }
37543 0 : if (talloc_str == NULL) {
37544 0 : PyErr_NoMemory();
37545 0 : return -1;
37546 : }
37547 0 : object->in.logon_server = talloc_str;
37548 : }
37549 : }
37550 0 : return 0;
37551 : }
37552 :
37553 0 : static PyObject *py_netr_GetAnyDCName_in_get_domainname(PyObject *obj, void *closure)
37554 : {
37555 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(obj);
37556 : PyObject *py_domainname;
37557 0 : if (object->in.domainname == NULL) {
37558 0 : Py_RETURN_NONE;
37559 : }
37560 0 : if (object->in.domainname == NULL) {
37561 0 : py_domainname = Py_None;
37562 0 : Py_INCREF(py_domainname);
37563 : } else {
37564 0 : if (object->in.domainname == NULL) {
37565 0 : py_domainname = Py_None;
37566 0 : Py_INCREF(py_domainname);
37567 : } else {
37568 0 : py_domainname = PyUnicode_Decode(object->in.domainname, strlen(object->in.domainname), "utf-8", "ignore");
37569 : }
37570 : }
37571 0 : return py_domainname;
37572 : }
37573 :
37574 0 : static int py_netr_GetAnyDCName_in_set_domainname(PyObject *py_obj, PyObject *value, void *closure)
37575 : {
37576 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj);
37577 0 : if (value == NULL) {
37578 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domainname");
37579 0 : return -1;
37580 : }
37581 0 : if (value == Py_None) {
37582 0 : object->in.domainname = NULL;
37583 : } else {
37584 0 : object->in.domainname = NULL;
37585 : {
37586 : const char *test_str;
37587 : const char *talloc_str;
37588 0 : PyObject *unicode = NULL;
37589 0 : if (PyUnicode_Check(value)) {
37590 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
37591 0 : if (unicode == NULL) {
37592 0 : PyErr_NoMemory();
37593 0 : return -1;
37594 : }
37595 0 : test_str = PyBytes_AS_STRING(unicode);
37596 0 : } else if (PyBytes_Check(value)) {
37597 0 : test_str = PyBytes_AS_STRING(value);
37598 : } else {
37599 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
37600 0 : return -1;
37601 : }
37602 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
37603 0 : if (unicode != NULL) {
37604 0 : Py_DECREF(unicode);
37605 : }
37606 0 : if (talloc_str == NULL) {
37607 0 : PyErr_NoMemory();
37608 0 : return -1;
37609 : }
37610 0 : object->in.domainname = talloc_str;
37611 : }
37612 : }
37613 0 : return 0;
37614 : }
37615 :
37616 0 : static PyObject *py_netr_GetAnyDCName_out_get_dcname(PyObject *obj, void *closure)
37617 : {
37618 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(obj);
37619 : PyObject *py_dcname;
37620 0 : if (object->out.dcname == NULL) {
37621 0 : Py_RETURN_NONE;
37622 : }
37623 0 : if (*object->out.dcname == NULL) {
37624 0 : py_dcname = Py_None;
37625 0 : Py_INCREF(py_dcname);
37626 : } else {
37627 0 : if (*object->out.dcname == NULL) {
37628 0 : py_dcname = Py_None;
37629 0 : Py_INCREF(py_dcname);
37630 : } else {
37631 0 : py_dcname = PyUnicode_Decode(*object->out.dcname, strlen(*object->out.dcname), "utf-8", "ignore");
37632 : }
37633 : }
37634 0 : return py_dcname;
37635 : }
37636 :
37637 0 : static int py_netr_GetAnyDCName_out_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
37638 : {
37639 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj);
37640 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dcname));
37641 0 : if (value == NULL) {
37642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dcname");
37643 0 : return -1;
37644 : }
37645 0 : object->out.dcname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dcname);
37646 0 : if (object->out.dcname == NULL) {
37647 0 : PyErr_NoMemory();
37648 0 : return -1;
37649 : }
37650 0 : if (value == Py_None) {
37651 0 : *object->out.dcname = NULL;
37652 : } else {
37653 0 : *object->out.dcname = NULL;
37654 : {
37655 : const char *test_str;
37656 : const char *talloc_str;
37657 0 : PyObject *unicode = NULL;
37658 0 : if (PyUnicode_Check(value)) {
37659 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
37660 0 : if (unicode == NULL) {
37661 0 : PyErr_NoMemory();
37662 0 : return -1;
37663 : }
37664 0 : test_str = PyBytes_AS_STRING(unicode);
37665 0 : } else if (PyBytes_Check(value)) {
37666 0 : test_str = PyBytes_AS_STRING(value);
37667 : } else {
37668 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
37669 0 : return -1;
37670 : }
37671 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
37672 0 : if (unicode != NULL) {
37673 0 : Py_DECREF(unicode);
37674 : }
37675 0 : if (talloc_str == NULL) {
37676 0 : PyErr_NoMemory();
37677 0 : return -1;
37678 : }
37679 0 : *object->out.dcname = talloc_str;
37680 : }
37681 : }
37682 0 : return 0;
37683 : }
37684 :
37685 0 : static PyObject *py_netr_GetAnyDCName_get_result(PyObject *obj, void *closure)
37686 : {
37687 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(obj);
37688 : PyObject *py_result;
37689 0 : py_result = PyErr_FromWERROR(object->out.result);
37690 0 : return py_result;
37691 : }
37692 :
37693 0 : static int py_netr_GetAnyDCName_set_result(PyObject *py_obj, PyObject *value, void *closure)
37694 : {
37695 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj);
37696 0 : if (value == NULL) {
37697 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
37698 0 : return -1;
37699 : }
37700 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
37701 0 : return 0;
37702 : }
37703 :
37704 : static PyGetSetDef py_netr_GetAnyDCName_getsetters[] = {
37705 : {
37706 : .name = discard_const_p(char, "in_logon_server"),
37707 : .get = py_netr_GetAnyDCName_in_get_logon_server,
37708 : .set = py_netr_GetAnyDCName_in_set_logon_server,
37709 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37710 : },
37711 : {
37712 : .name = discard_const_p(char, "in_domainname"),
37713 : .get = py_netr_GetAnyDCName_in_get_domainname,
37714 : .set = py_netr_GetAnyDCName_in_set_domainname,
37715 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37716 : },
37717 : {
37718 : .name = discard_const_p(char, "out_dcname"),
37719 : .get = py_netr_GetAnyDCName_out_get_dcname,
37720 : .set = py_netr_GetAnyDCName_out_set_dcname,
37721 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
37722 : },
37723 : {
37724 : .name = discard_const_p(char, "result"),
37725 : .get = py_netr_GetAnyDCName_get_result,
37726 : .set = py_netr_GetAnyDCName_set_result,
37727 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
37728 : },
37729 : { .name = NULL }
37730 : };
37731 :
37732 0 : static PyObject *py_netr_GetAnyDCName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37733 : {
37734 0 : PyObject *self = pytalloc_new(struct netr_GetAnyDCName, type);
37735 0 : return self;
37736 : }
37737 :
37738 0 : static PyObject *py_netr_GetAnyDCName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37739 : {
37740 :
37741 :
37742 0 : return PyLong_FromLong(13);
37743 : }
37744 :
37745 0 : static PyObject *py_netr_GetAnyDCName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
37746 : {
37747 0 : const struct ndr_interface_call *call = NULL;
37748 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj);
37749 0 : PyObject *ret = NULL;
37750 0 : struct ndr_push *push = NULL;
37751 : DATA_BLOB blob;
37752 : enum ndr_err_code err;
37753 :
37754 0 : if (ndr_table_netlogon.num_calls < 14) {
37755 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetAnyDCName_ndr_pack");
37756 0 : return NULL;
37757 : }
37758 0 : call = &ndr_table_netlogon.calls[13];
37759 :
37760 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37761 0 : if (push == NULL) {
37762 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37763 0 : return NULL;
37764 : }
37765 :
37766 0 : push->flags |= ndr_push_flags;
37767 :
37768 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37769 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37770 0 : TALLOC_FREE(push);
37771 0 : PyErr_SetNdrError(err);
37772 0 : return NULL;
37773 : }
37774 0 : blob = ndr_push_blob(push);
37775 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37776 0 : TALLOC_FREE(push);
37777 0 : return ret;
37778 : }
37779 :
37780 0 : static PyObject *py_netr_GetAnyDCName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37781 : {
37782 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37783 0 : PyObject *bigendian_obj = NULL;
37784 0 : PyObject *ndr64_obj = NULL;
37785 0 : uint32_t ndr_push_flags = 0;
37786 :
37787 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37788 : discard_const_p(char *, kwnames),
37789 : &bigendian_obj,
37790 : &ndr64_obj)) {
37791 0 : return NULL;
37792 : }
37793 :
37794 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37795 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37796 : }
37797 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37798 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37799 : }
37800 :
37801 0 : return py_netr_GetAnyDCName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37802 : }
37803 :
37804 0 : static PyObject *py_netr_GetAnyDCName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37805 : {
37806 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37807 0 : PyObject *bigendian_obj = NULL;
37808 0 : PyObject *ndr64_obj = NULL;
37809 0 : uint32_t ndr_push_flags = 0;
37810 :
37811 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37812 : discard_const_p(char *, kwnames),
37813 : &bigendian_obj,
37814 : &ndr64_obj)) {
37815 0 : return NULL;
37816 : }
37817 :
37818 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37819 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37820 : }
37821 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37822 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37823 : }
37824 :
37825 0 : return py_netr_GetAnyDCName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37826 : }
37827 :
37828 0 : static PyObject *py_netr_GetAnyDCName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
37829 : {
37830 0 : const struct ndr_interface_call *call = NULL;
37831 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj);
37832 0 : struct ndr_pull *pull = NULL;
37833 : enum ndr_err_code err;
37834 :
37835 0 : if (ndr_table_netlogon.num_calls < 14) {
37836 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetAnyDCName_ndr_unpack");
37837 0 : return NULL;
37838 : }
37839 0 : call = &ndr_table_netlogon.calls[13];
37840 :
37841 0 : pull = ndr_pull_init_blob(blob, object);
37842 0 : if (pull == NULL) {
37843 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37844 0 : return NULL;
37845 : }
37846 :
37847 0 : pull->flags |= ndr_pull_flags;
37848 :
37849 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37850 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37851 0 : TALLOC_FREE(pull);
37852 0 : PyErr_SetNdrError(err);
37853 0 : return NULL;
37854 : }
37855 0 : if (!allow_remaining) {
37856 : uint32_t highest_ofs;
37857 :
37858 0 : if (pull->offset > pull->relative_highest_offset) {
37859 0 : highest_ofs = pull->offset;
37860 : } else {
37861 0 : highest_ofs = pull->relative_highest_offset;
37862 : }
37863 0 : if (highest_ofs < pull->data_size) {
37864 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37865 : "not all bytes consumed ofs[%u] size[%u]",
37866 : highest_ofs, pull->data_size);
37867 0 : TALLOC_FREE(pull);
37868 0 : PyErr_SetNdrError(err);
37869 0 : return NULL;
37870 : }
37871 : }
37872 :
37873 0 : TALLOC_FREE(pull);
37874 0 : Py_RETURN_NONE;
37875 : }
37876 :
37877 0 : static PyObject *py_netr_GetAnyDCName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37878 : {
37879 : DATA_BLOB blob;
37880 0 : Py_ssize_t blob_length = 0;
37881 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37882 0 : PyObject *bigendian_obj = NULL;
37883 0 : PyObject *ndr64_obj = NULL;
37884 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37885 0 : PyObject *allow_remaining_obj = NULL;
37886 0 : bool allow_remaining = false;
37887 :
37888 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37889 : discard_const_p(char *, kwnames),
37890 : &blob.data, &blob_length,
37891 : &bigendian_obj,
37892 : &ndr64_obj,
37893 : &allow_remaining_obj)) {
37894 0 : return NULL;
37895 : }
37896 0 : blob.length = blob_length;
37897 :
37898 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37899 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37900 : }
37901 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37902 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37903 : }
37904 :
37905 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37906 0 : allow_remaining = true;
37907 : }
37908 :
37909 0 : return py_netr_GetAnyDCName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37910 : }
37911 :
37912 0 : static PyObject *py_netr_GetAnyDCName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37913 : {
37914 : DATA_BLOB blob;
37915 0 : Py_ssize_t blob_length = 0;
37916 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37917 0 : PyObject *bigendian_obj = NULL;
37918 0 : PyObject *ndr64_obj = NULL;
37919 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37920 0 : PyObject *allow_remaining_obj = NULL;
37921 0 : bool allow_remaining = false;
37922 :
37923 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37924 : discard_const_p(char *, kwnames),
37925 : &blob.data, &blob_length,
37926 : &bigendian_obj,
37927 : &ndr64_obj,
37928 : &allow_remaining_obj)) {
37929 0 : return NULL;
37930 : }
37931 0 : blob.length = blob_length;
37932 :
37933 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37934 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37935 : }
37936 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37937 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37938 : }
37939 :
37940 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37941 0 : allow_remaining = true;
37942 : }
37943 :
37944 0 : return py_netr_GetAnyDCName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37945 : }
37946 :
37947 0 : static PyObject *py_netr_GetAnyDCName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
37948 : {
37949 0 : const struct ndr_interface_call *call = NULL;
37950 0 : struct netr_GetAnyDCName *object = (struct netr_GetAnyDCName *)pytalloc_get_ptr(py_obj);
37951 : PyObject *ret;
37952 : char *retstr;
37953 :
37954 0 : if (ndr_table_netlogon.num_calls < 14) {
37955 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetAnyDCName_ndr_print");
37956 0 : return NULL;
37957 : }
37958 0 : call = &ndr_table_netlogon.calls[13];
37959 :
37960 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37961 0 : ret = PyUnicode_FromString(retstr);
37962 0 : TALLOC_FREE(retstr);
37963 :
37964 0 : return ret;
37965 : }
37966 :
37967 0 : static PyObject *py_netr_GetAnyDCName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37968 : {
37969 0 : return py_netr_GetAnyDCName_ndr_print(py_obj, "netr_GetAnyDCName_in", NDR_IN);
37970 : }
37971 :
37972 0 : static PyObject *py_netr_GetAnyDCName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37973 : {
37974 0 : return py_netr_GetAnyDCName_ndr_print(py_obj, "netr_GetAnyDCName_out", NDR_OUT);
37975 : }
37976 :
37977 : static PyMethodDef py_netr_GetAnyDCName_methods[] = {
37978 : { "opnum", (PyCFunction)py_netr_GetAnyDCName_ndr_opnum, METH_NOARGS|METH_CLASS,
37979 : "netlogon.netr_GetAnyDCName.opnum() -> 13 (0x0d) " },
37980 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetAnyDCName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37981 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37982 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetAnyDCName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37983 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37984 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetAnyDCName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37985 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37986 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetAnyDCName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37987 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37988 : { "__ndr_print_in__", (PyCFunction)py_netr_GetAnyDCName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37989 : { "__ndr_print_out__", (PyCFunction)py_netr_GetAnyDCName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37990 : { NULL, NULL, 0, NULL }
37991 : };
37992 :
37993 :
37994 : static PyTypeObject netr_GetAnyDCName_Type = {
37995 : PyVarObject_HEAD_INIT(NULL, 0)
37996 : .tp_name = "netlogon.netr_GetAnyDCName",
37997 : .tp_getset = py_netr_GetAnyDCName_getsetters,
37998 : .tp_methods = py_netr_GetAnyDCName_methods,
37999 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38000 : .tp_new = py_netr_GetAnyDCName_new,
38001 : };
38002 :
38003 0 : static bool pack_py_netr_GetAnyDCName_args_in(PyObject *args, PyObject *kwargs, struct netr_GetAnyDCName *r)
38004 : {
38005 : PyObject *py_logon_server;
38006 : PyObject *py_domainname;
38007 0 : const char *kwnames[] = {
38008 : "logon_server", "domainname", NULL
38009 : };
38010 :
38011 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_GetAnyDCName", discard_const_p(char *, kwnames), &py_logon_server, &py_domainname)) {
38012 0 : return false;
38013 : }
38014 :
38015 0 : if (py_logon_server == NULL) {
38016 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
38017 0 : return false;
38018 : }
38019 0 : if (py_logon_server == Py_None) {
38020 0 : r->in.logon_server = NULL;
38021 : } else {
38022 0 : r->in.logon_server = NULL;
38023 : {
38024 : const char *test_str;
38025 : const char *talloc_str;
38026 0 : PyObject *unicode = NULL;
38027 0 : if (PyUnicode_Check(py_logon_server)) {
38028 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
38029 0 : if (unicode == NULL) {
38030 0 : PyErr_NoMemory();
38031 0 : return false;
38032 : }
38033 0 : test_str = PyBytes_AS_STRING(unicode);
38034 0 : } else if (PyBytes_Check(py_logon_server)) {
38035 0 : test_str = PyBytes_AS_STRING(py_logon_server);
38036 : } else {
38037 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
38038 0 : return false;
38039 : }
38040 0 : talloc_str = talloc_strdup(r, test_str);
38041 0 : if (unicode != NULL) {
38042 0 : Py_DECREF(unicode);
38043 : }
38044 0 : if (talloc_str == NULL) {
38045 0 : PyErr_NoMemory();
38046 0 : return false;
38047 : }
38048 0 : r->in.logon_server = talloc_str;
38049 : }
38050 : }
38051 0 : if (py_domainname == NULL) {
38052 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domainname");
38053 0 : return false;
38054 : }
38055 0 : if (py_domainname == Py_None) {
38056 0 : r->in.domainname = NULL;
38057 : } else {
38058 0 : r->in.domainname = NULL;
38059 : {
38060 : const char *test_str;
38061 : const char *talloc_str;
38062 0 : PyObject *unicode = NULL;
38063 0 : if (PyUnicode_Check(py_domainname)) {
38064 0 : unicode = PyUnicode_AsEncodedString(py_domainname, "utf-8", "ignore");
38065 0 : if (unicode == NULL) {
38066 0 : PyErr_NoMemory();
38067 0 : return false;
38068 : }
38069 0 : test_str = PyBytes_AS_STRING(unicode);
38070 0 : } else if (PyBytes_Check(py_domainname)) {
38071 0 : test_str = PyBytes_AS_STRING(py_domainname);
38072 : } else {
38073 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domainname)->tp_name);
38074 0 : return false;
38075 : }
38076 0 : talloc_str = talloc_strdup(r, test_str);
38077 0 : if (unicode != NULL) {
38078 0 : Py_DECREF(unicode);
38079 : }
38080 0 : if (talloc_str == NULL) {
38081 0 : PyErr_NoMemory();
38082 0 : return false;
38083 : }
38084 0 : r->in.domainname = talloc_str;
38085 : }
38086 : }
38087 0 : return true;
38088 : }
38089 :
38090 0 : static PyObject *unpack_py_netr_GetAnyDCName_args_out(struct netr_GetAnyDCName *r)
38091 : {
38092 : PyObject *result;
38093 : PyObject *py_dcname;
38094 0 : if (*r->out.dcname == NULL) {
38095 0 : py_dcname = Py_None;
38096 0 : Py_INCREF(py_dcname);
38097 : } else {
38098 0 : if (*r->out.dcname == NULL) {
38099 0 : py_dcname = Py_None;
38100 0 : Py_INCREF(py_dcname);
38101 : } else {
38102 0 : py_dcname = PyUnicode_Decode(*r->out.dcname, strlen(*r->out.dcname), "utf-8", "ignore");
38103 : }
38104 : }
38105 0 : result = py_dcname;
38106 0 : if (!W_ERROR_IS_OK(r->out.result)) {
38107 0 : PyErr_SetWERROR(r->out.result);
38108 0 : return NULL;
38109 : }
38110 :
38111 0 : return result;
38112 : }
38113 :
38114 :
38115 0 : static PyObject *py_netr_LogonControl2_in_get_logon_server(PyObject *obj, void *closure)
38116 : {
38117 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj);
38118 : PyObject *py_logon_server;
38119 0 : if (object->in.logon_server == NULL) {
38120 0 : Py_RETURN_NONE;
38121 : }
38122 0 : if (object->in.logon_server == NULL) {
38123 0 : py_logon_server = Py_None;
38124 0 : Py_INCREF(py_logon_server);
38125 : } else {
38126 0 : if (object->in.logon_server == NULL) {
38127 0 : py_logon_server = Py_None;
38128 0 : Py_INCREF(py_logon_server);
38129 : } else {
38130 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
38131 : }
38132 : }
38133 0 : return py_logon_server;
38134 : }
38135 :
38136 0 : static int py_netr_LogonControl2_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
38137 : {
38138 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38139 0 : if (value == NULL) {
38140 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
38141 0 : return -1;
38142 : }
38143 0 : if (value == Py_None) {
38144 0 : object->in.logon_server = NULL;
38145 : } else {
38146 0 : object->in.logon_server = NULL;
38147 : {
38148 : const char *test_str;
38149 : const char *talloc_str;
38150 0 : PyObject *unicode = NULL;
38151 0 : if (PyUnicode_Check(value)) {
38152 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
38153 0 : if (unicode == NULL) {
38154 0 : PyErr_NoMemory();
38155 0 : return -1;
38156 : }
38157 0 : test_str = PyBytes_AS_STRING(unicode);
38158 0 : } else if (PyBytes_Check(value)) {
38159 0 : test_str = PyBytes_AS_STRING(value);
38160 : } else {
38161 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
38162 0 : return -1;
38163 : }
38164 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
38165 0 : if (unicode != NULL) {
38166 0 : Py_DECREF(unicode);
38167 : }
38168 0 : if (talloc_str == NULL) {
38169 0 : PyErr_NoMemory();
38170 0 : return -1;
38171 : }
38172 0 : object->in.logon_server = talloc_str;
38173 : }
38174 : }
38175 0 : return 0;
38176 : }
38177 :
38178 0 : static PyObject *py_netr_LogonControl2_in_get_function_code(PyObject *obj, void *closure)
38179 : {
38180 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj);
38181 : PyObject *py_function_code;
38182 0 : py_function_code = PyLong_FromUnsignedLongLong((uint32_t)object->in.function_code);
38183 0 : return py_function_code;
38184 : }
38185 :
38186 0 : static int py_netr_LogonControl2_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure)
38187 : {
38188 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38189 0 : if (value == NULL) {
38190 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.function_code");
38191 0 : return -1;
38192 : }
38193 : {
38194 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.function_code));
38195 0 : if (PyLong_Check(value)) {
38196 : unsigned long long test_var;
38197 0 : test_var = PyLong_AsUnsignedLongLong(value);
38198 0 : if (PyErr_Occurred() != NULL) {
38199 0 : return -1;
38200 : }
38201 0 : if (test_var > uint_max) {
38202 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38203 : PyLong_Type.tp_name, uint_max, test_var);
38204 0 : return -1;
38205 : }
38206 0 : object->in.function_code = test_var;
38207 : } else {
38208 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38209 : PyLong_Type.tp_name);
38210 0 : return -1;
38211 : }
38212 : }
38213 0 : return 0;
38214 : }
38215 :
38216 0 : static PyObject *py_netr_LogonControl2_in_get_level(PyObject *obj, void *closure)
38217 : {
38218 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj);
38219 : PyObject *py_level;
38220 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level);
38221 0 : return py_level;
38222 : }
38223 :
38224 0 : static int py_netr_LogonControl2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
38225 : {
38226 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38227 0 : if (value == NULL) {
38228 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
38229 0 : return -1;
38230 : }
38231 : {
38232 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
38233 0 : if (PyLong_Check(value)) {
38234 : unsigned long long test_var;
38235 0 : test_var = PyLong_AsUnsignedLongLong(value);
38236 0 : if (PyErr_Occurred() != NULL) {
38237 0 : return -1;
38238 : }
38239 0 : if (test_var > uint_max) {
38240 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38241 : PyLong_Type.tp_name, uint_max, test_var);
38242 0 : return -1;
38243 : }
38244 0 : object->in.level = test_var;
38245 : } else {
38246 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38247 : PyLong_Type.tp_name);
38248 0 : return -1;
38249 : }
38250 : }
38251 0 : return 0;
38252 : }
38253 :
38254 0 : static PyObject *py_netr_LogonControl2_in_get_data(PyObject *obj, void *closure)
38255 : {
38256 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj);
38257 : PyObject *py_data;
38258 0 : if (object->in.data == NULL) {
38259 0 : Py_RETURN_NONE;
38260 : }
38261 0 : py_data = pyrpc_import_union(&netr_CONTROL_DATA_INFORMATION_Type, object->in.data, object->in.function_code, object->in.data, "union netr_CONTROL_DATA_INFORMATION");
38262 0 : if (py_data == NULL) {
38263 0 : return NULL;
38264 : }
38265 0 : return py_data;
38266 : }
38267 :
38268 0 : static int py_netr_LogonControl2_in_set_data(PyObject *py_obj, PyObject *value, void *closure)
38269 : {
38270 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38271 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.data));
38272 0 : if (value == NULL) {
38273 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.data");
38274 0 : return -1;
38275 : }
38276 0 : object->in.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data);
38277 0 : if (object->in.data == NULL) {
38278 0 : PyErr_NoMemory();
38279 0 : return -1;
38280 : }
38281 : {
38282 : union netr_CONTROL_DATA_INFORMATION *data_switch_1;
38283 0 : data_switch_1 = (union netr_CONTROL_DATA_INFORMATION *)pyrpc_export_union(&netr_CONTROL_DATA_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.function_code, value, "union netr_CONTROL_DATA_INFORMATION");
38284 0 : if (data_switch_1 == NULL) {
38285 0 : return -1;
38286 : }
38287 0 : object->in.data = data_switch_1;
38288 : }
38289 0 : return 0;
38290 : }
38291 :
38292 0 : static PyObject *py_netr_LogonControl2_out_get_query(PyObject *obj, void *closure)
38293 : {
38294 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj);
38295 : PyObject *py_query;
38296 0 : if (object->out.query == NULL) {
38297 0 : Py_RETURN_NONE;
38298 : }
38299 0 : py_query = pyrpc_import_union(&netr_CONTROL_QUERY_INFORMATION_Type, object->out.query, object->in.level, object->out.query, "union netr_CONTROL_QUERY_INFORMATION");
38300 0 : if (py_query == NULL) {
38301 0 : return NULL;
38302 : }
38303 0 : return py_query;
38304 : }
38305 :
38306 0 : static int py_netr_LogonControl2_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
38307 : {
38308 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38309 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.query));
38310 0 : if (value == NULL) {
38311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query");
38312 0 : return -1;
38313 : }
38314 0 : object->out.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query);
38315 0 : if (object->out.query == NULL) {
38316 0 : PyErr_NoMemory();
38317 0 : return -1;
38318 : }
38319 : {
38320 : union netr_CONTROL_QUERY_INFORMATION *query_switch_1;
38321 0 : query_switch_1 = (union netr_CONTROL_QUERY_INFORMATION *)pyrpc_export_union(&netr_CONTROL_QUERY_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_CONTROL_QUERY_INFORMATION");
38322 0 : if (query_switch_1 == NULL) {
38323 0 : return -1;
38324 : }
38325 0 : object->out.query = query_switch_1;
38326 : }
38327 0 : return 0;
38328 : }
38329 :
38330 0 : static PyObject *py_netr_LogonControl2_get_result(PyObject *obj, void *closure)
38331 : {
38332 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(obj);
38333 : PyObject *py_result;
38334 0 : py_result = PyErr_FromWERROR(object->out.result);
38335 0 : return py_result;
38336 : }
38337 :
38338 0 : static int py_netr_LogonControl2_set_result(PyObject *py_obj, PyObject *value, void *closure)
38339 : {
38340 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38341 0 : if (value == NULL) {
38342 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
38343 0 : return -1;
38344 : }
38345 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
38346 0 : return 0;
38347 : }
38348 :
38349 : static PyGetSetDef py_netr_LogonControl2_getsetters[] = {
38350 : {
38351 : .name = discard_const_p(char, "in_logon_server"),
38352 : .get = py_netr_LogonControl2_in_get_logon_server,
38353 : .set = py_netr_LogonControl2_in_set_logon_server,
38354 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
38355 : },
38356 : {
38357 : .name = discard_const_p(char, "in_function_code"),
38358 : .get = py_netr_LogonControl2_in_get_function_code,
38359 : .set = py_netr_LogonControl2_in_set_function_code,
38360 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonControlCode")
38361 : },
38362 : {
38363 : .name = discard_const_p(char, "in_level"),
38364 : .get = py_netr_LogonControl2_in_get_level,
38365 : .set = py_netr_LogonControl2_in_set_level,
38366 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
38367 : },
38368 : {
38369 : .name = discard_const_p(char, "in_data"),
38370 : .get = py_netr_LogonControl2_in_get_data,
38371 : .set = py_netr_LogonControl2_in_set_data,
38372 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_DATA_INFORMATION")
38373 : },
38374 : {
38375 : .name = discard_const_p(char, "out_query"),
38376 : .get = py_netr_LogonControl2_out_get_query,
38377 : .set = py_netr_LogonControl2_out_set_query,
38378 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_QUERY_INFORMATION")
38379 : },
38380 : {
38381 : .name = discard_const_p(char, "result"),
38382 : .get = py_netr_LogonControl2_get_result,
38383 : .set = py_netr_LogonControl2_set_result,
38384 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
38385 : },
38386 : { .name = NULL }
38387 : };
38388 :
38389 0 : static PyObject *py_netr_LogonControl2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38390 : {
38391 0 : PyObject *self = pytalloc_new(struct netr_LogonControl2, type);
38392 0 : struct netr_LogonControl2 *_self = (struct netr_LogonControl2 *)pytalloc_get_ptr(self);
38393 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38394 0 : _self->in.data = talloc_zero(mem_ctx, union netr_CONTROL_DATA_INFORMATION);
38395 0 : _self->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
38396 0 : return self;
38397 : }
38398 :
38399 0 : static PyObject *py_netr_LogonControl2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38400 : {
38401 :
38402 :
38403 0 : return PyLong_FromLong(14);
38404 : }
38405 :
38406 0 : static PyObject *py_netr_LogonControl2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
38407 : {
38408 0 : const struct ndr_interface_call *call = NULL;
38409 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38410 0 : PyObject *ret = NULL;
38411 0 : struct ndr_push *push = NULL;
38412 : DATA_BLOB blob;
38413 : enum ndr_err_code err;
38414 :
38415 0 : if (ndr_table_netlogon.num_calls < 15) {
38416 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2_ndr_pack");
38417 0 : return NULL;
38418 : }
38419 0 : call = &ndr_table_netlogon.calls[14];
38420 :
38421 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38422 0 : if (push == NULL) {
38423 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38424 0 : return NULL;
38425 : }
38426 :
38427 0 : push->flags |= ndr_push_flags;
38428 :
38429 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38430 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38431 0 : TALLOC_FREE(push);
38432 0 : PyErr_SetNdrError(err);
38433 0 : return NULL;
38434 : }
38435 0 : blob = ndr_push_blob(push);
38436 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38437 0 : TALLOC_FREE(push);
38438 0 : return ret;
38439 : }
38440 :
38441 0 : static PyObject *py_netr_LogonControl2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38442 : {
38443 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38444 0 : PyObject *bigendian_obj = NULL;
38445 0 : PyObject *ndr64_obj = NULL;
38446 0 : uint32_t ndr_push_flags = 0;
38447 :
38448 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38449 : discard_const_p(char *, kwnames),
38450 : &bigendian_obj,
38451 : &ndr64_obj)) {
38452 0 : return NULL;
38453 : }
38454 :
38455 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38456 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38457 : }
38458 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38459 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38460 : }
38461 :
38462 0 : return py_netr_LogonControl2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38463 : }
38464 :
38465 0 : static PyObject *py_netr_LogonControl2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38466 : {
38467 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38468 0 : PyObject *bigendian_obj = NULL;
38469 0 : PyObject *ndr64_obj = NULL;
38470 0 : uint32_t ndr_push_flags = 0;
38471 :
38472 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38473 : discard_const_p(char *, kwnames),
38474 : &bigendian_obj,
38475 : &ndr64_obj)) {
38476 0 : return NULL;
38477 : }
38478 :
38479 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38480 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38481 : }
38482 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38483 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38484 : }
38485 :
38486 0 : return py_netr_LogonControl2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38487 : }
38488 :
38489 0 : static PyObject *py_netr_LogonControl2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
38490 : {
38491 0 : const struct ndr_interface_call *call = NULL;
38492 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38493 0 : struct ndr_pull *pull = NULL;
38494 : enum ndr_err_code err;
38495 :
38496 0 : if (ndr_table_netlogon.num_calls < 15) {
38497 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2_ndr_unpack");
38498 0 : return NULL;
38499 : }
38500 0 : call = &ndr_table_netlogon.calls[14];
38501 :
38502 0 : pull = ndr_pull_init_blob(blob, object);
38503 0 : if (pull == NULL) {
38504 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38505 0 : return NULL;
38506 : }
38507 :
38508 0 : pull->flags |= ndr_pull_flags;
38509 :
38510 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38511 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38512 0 : TALLOC_FREE(pull);
38513 0 : PyErr_SetNdrError(err);
38514 0 : return NULL;
38515 : }
38516 0 : if (!allow_remaining) {
38517 : uint32_t highest_ofs;
38518 :
38519 0 : if (pull->offset > pull->relative_highest_offset) {
38520 0 : highest_ofs = pull->offset;
38521 : } else {
38522 0 : highest_ofs = pull->relative_highest_offset;
38523 : }
38524 0 : if (highest_ofs < pull->data_size) {
38525 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38526 : "not all bytes consumed ofs[%u] size[%u]",
38527 : highest_ofs, pull->data_size);
38528 0 : TALLOC_FREE(pull);
38529 0 : PyErr_SetNdrError(err);
38530 0 : return NULL;
38531 : }
38532 : }
38533 :
38534 0 : TALLOC_FREE(pull);
38535 0 : Py_RETURN_NONE;
38536 : }
38537 :
38538 0 : static PyObject *py_netr_LogonControl2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38539 : {
38540 : DATA_BLOB blob;
38541 0 : Py_ssize_t blob_length = 0;
38542 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38543 0 : PyObject *bigendian_obj = NULL;
38544 0 : PyObject *ndr64_obj = NULL;
38545 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38546 0 : PyObject *allow_remaining_obj = NULL;
38547 0 : bool allow_remaining = false;
38548 :
38549 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38550 : discard_const_p(char *, kwnames),
38551 : &blob.data, &blob_length,
38552 : &bigendian_obj,
38553 : &ndr64_obj,
38554 : &allow_remaining_obj)) {
38555 0 : return NULL;
38556 : }
38557 0 : blob.length = blob_length;
38558 :
38559 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38560 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38561 : }
38562 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38563 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38564 : }
38565 :
38566 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38567 0 : allow_remaining = true;
38568 : }
38569 :
38570 0 : return py_netr_LogonControl2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
38571 : }
38572 :
38573 0 : static PyObject *py_netr_LogonControl2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38574 : {
38575 : DATA_BLOB blob;
38576 0 : Py_ssize_t blob_length = 0;
38577 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38578 0 : PyObject *bigendian_obj = NULL;
38579 0 : PyObject *ndr64_obj = NULL;
38580 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38581 0 : PyObject *allow_remaining_obj = NULL;
38582 0 : bool allow_remaining = false;
38583 :
38584 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38585 : discard_const_p(char *, kwnames),
38586 : &blob.data, &blob_length,
38587 : &bigendian_obj,
38588 : &ndr64_obj,
38589 : &allow_remaining_obj)) {
38590 0 : return NULL;
38591 : }
38592 0 : blob.length = blob_length;
38593 :
38594 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38595 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38596 : }
38597 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38598 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38599 : }
38600 :
38601 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38602 0 : allow_remaining = true;
38603 : }
38604 :
38605 0 : return py_netr_LogonControl2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38606 : }
38607 :
38608 0 : static PyObject *py_netr_LogonControl2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
38609 : {
38610 0 : const struct ndr_interface_call *call = NULL;
38611 0 : struct netr_LogonControl2 *object = (struct netr_LogonControl2 *)pytalloc_get_ptr(py_obj);
38612 : PyObject *ret;
38613 : char *retstr;
38614 :
38615 0 : if (ndr_table_netlogon.num_calls < 15) {
38616 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2_ndr_print");
38617 0 : return NULL;
38618 : }
38619 0 : call = &ndr_table_netlogon.calls[14];
38620 :
38621 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38622 0 : ret = PyUnicode_FromString(retstr);
38623 0 : TALLOC_FREE(retstr);
38624 :
38625 0 : return ret;
38626 : }
38627 :
38628 0 : static PyObject *py_netr_LogonControl2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38629 : {
38630 0 : return py_netr_LogonControl2_ndr_print(py_obj, "netr_LogonControl2_in", NDR_IN);
38631 : }
38632 :
38633 0 : static PyObject *py_netr_LogonControl2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38634 : {
38635 0 : return py_netr_LogonControl2_ndr_print(py_obj, "netr_LogonControl2_out", NDR_OUT);
38636 : }
38637 :
38638 : static PyMethodDef py_netr_LogonControl2_methods[] = {
38639 : { "opnum", (PyCFunction)py_netr_LogonControl2_ndr_opnum, METH_NOARGS|METH_CLASS,
38640 : "netlogon.netr_LogonControl2.opnum() -> 14 (0x0e) " },
38641 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38642 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38643 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38644 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38645 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38646 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38647 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38648 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38649 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonControl2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38650 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonControl2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38651 : { NULL, NULL, 0, NULL }
38652 : };
38653 :
38654 :
38655 : static PyTypeObject netr_LogonControl2_Type = {
38656 : PyVarObject_HEAD_INIT(NULL, 0)
38657 : .tp_name = "netlogon.netr_LogonControl2",
38658 : .tp_getset = py_netr_LogonControl2_getsetters,
38659 : .tp_methods = py_netr_LogonControl2_methods,
38660 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38661 : .tp_new = py_netr_LogonControl2_new,
38662 : };
38663 :
38664 0 : static bool pack_py_netr_LogonControl2_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonControl2 *r)
38665 : {
38666 : PyObject *py_logon_server;
38667 : PyObject *py_function_code;
38668 : PyObject *py_level;
38669 : PyObject *py_data;
38670 0 : const char *kwnames[] = {
38671 : "logon_server", "function_code", "level", "data", NULL
38672 : };
38673 :
38674 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:netr_LogonControl2", discard_const_p(char *, kwnames), &py_logon_server, &py_function_code, &py_level, &py_data)) {
38675 0 : return false;
38676 : }
38677 :
38678 0 : if (py_logon_server == NULL) {
38679 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
38680 0 : return false;
38681 : }
38682 0 : if (py_logon_server == Py_None) {
38683 0 : r->in.logon_server = NULL;
38684 : } else {
38685 0 : r->in.logon_server = NULL;
38686 : {
38687 : const char *test_str;
38688 : const char *talloc_str;
38689 0 : PyObject *unicode = NULL;
38690 0 : if (PyUnicode_Check(py_logon_server)) {
38691 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
38692 0 : if (unicode == NULL) {
38693 0 : PyErr_NoMemory();
38694 0 : return false;
38695 : }
38696 0 : test_str = PyBytes_AS_STRING(unicode);
38697 0 : } else if (PyBytes_Check(py_logon_server)) {
38698 0 : test_str = PyBytes_AS_STRING(py_logon_server);
38699 : } else {
38700 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
38701 0 : return false;
38702 : }
38703 0 : talloc_str = talloc_strdup(r, test_str);
38704 0 : if (unicode != NULL) {
38705 0 : Py_DECREF(unicode);
38706 : }
38707 0 : if (talloc_str == NULL) {
38708 0 : PyErr_NoMemory();
38709 0 : return false;
38710 : }
38711 0 : r->in.logon_server = talloc_str;
38712 : }
38713 : }
38714 0 : if (py_function_code == NULL) {
38715 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.function_code");
38716 0 : return false;
38717 : }
38718 : {
38719 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.function_code));
38720 0 : if (PyLong_Check(py_function_code)) {
38721 : unsigned long long test_var;
38722 0 : test_var = PyLong_AsUnsignedLongLong(py_function_code);
38723 0 : if (PyErr_Occurred() != NULL) {
38724 0 : return false;
38725 : }
38726 0 : if (test_var > uint_max) {
38727 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38728 : PyLong_Type.tp_name, uint_max, test_var);
38729 0 : return false;
38730 : }
38731 0 : r->in.function_code = test_var;
38732 : } else {
38733 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38734 : PyLong_Type.tp_name);
38735 0 : return false;
38736 : }
38737 : }
38738 0 : if (py_level == NULL) {
38739 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
38740 0 : return false;
38741 : }
38742 : {
38743 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
38744 0 : if (PyLong_Check(py_level)) {
38745 : unsigned long long test_var;
38746 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
38747 0 : if (PyErr_Occurred() != NULL) {
38748 0 : return false;
38749 : }
38750 0 : if (test_var > uint_max) {
38751 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38752 : PyLong_Type.tp_name, uint_max, test_var);
38753 0 : return false;
38754 : }
38755 0 : r->in.level = test_var;
38756 : } else {
38757 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38758 : PyLong_Type.tp_name);
38759 0 : return false;
38760 : }
38761 : }
38762 0 : if (py_data == NULL) {
38763 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.data");
38764 0 : return false;
38765 : }
38766 0 : r->in.data = talloc_ptrtype(r, r->in.data);
38767 0 : if (r->in.data == NULL) {
38768 0 : PyErr_NoMemory();
38769 0 : return false;
38770 : }
38771 : {
38772 : union netr_CONTROL_DATA_INFORMATION *data_switch_1;
38773 0 : data_switch_1 = (union netr_CONTROL_DATA_INFORMATION *)pyrpc_export_union(&netr_CONTROL_DATA_INFORMATION_Type, r, r->in.function_code, py_data, "union netr_CONTROL_DATA_INFORMATION");
38774 0 : if (data_switch_1 == NULL) {
38775 0 : return false;
38776 : }
38777 0 : r->in.data = data_switch_1;
38778 : }
38779 0 : return true;
38780 : }
38781 :
38782 0 : static PyObject *unpack_py_netr_LogonControl2_args_out(struct netr_LogonControl2 *r)
38783 : {
38784 : PyObject *result;
38785 : PyObject *py_query;
38786 0 : py_query = pyrpc_import_union(&netr_CONTROL_QUERY_INFORMATION_Type, r->out.query, r->in.level, r->out.query, "union netr_CONTROL_QUERY_INFORMATION");
38787 0 : if (py_query == NULL) {
38788 0 : return NULL;
38789 : }
38790 0 : result = py_query;
38791 0 : if (!W_ERROR_IS_OK(r->out.result)) {
38792 0 : PyErr_SetWERROR(r->out.result);
38793 0 : return NULL;
38794 : }
38795 :
38796 0 : return result;
38797 : }
38798 :
38799 :
38800 0 : static PyObject *py_netr_ServerAuthenticate2_in_get_server_name(PyObject *obj, void *closure)
38801 : {
38802 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
38803 : PyObject *py_server_name;
38804 0 : if (object->in.server_name == NULL) {
38805 0 : Py_RETURN_NONE;
38806 : }
38807 0 : if (object->in.server_name == NULL) {
38808 0 : py_server_name = Py_None;
38809 0 : Py_INCREF(py_server_name);
38810 : } else {
38811 0 : if (object->in.server_name == NULL) {
38812 0 : py_server_name = Py_None;
38813 0 : Py_INCREF(py_server_name);
38814 : } else {
38815 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
38816 : }
38817 : }
38818 0 : return py_server_name;
38819 : }
38820 :
38821 0 : static int py_netr_ServerAuthenticate2_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
38822 : {
38823 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
38824 0 : if (value == NULL) {
38825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
38826 0 : return -1;
38827 : }
38828 0 : if (value == Py_None) {
38829 0 : object->in.server_name = NULL;
38830 : } else {
38831 0 : object->in.server_name = NULL;
38832 : {
38833 : const char *test_str;
38834 : const char *talloc_str;
38835 0 : PyObject *unicode = NULL;
38836 0 : if (PyUnicode_Check(value)) {
38837 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
38838 0 : if (unicode == NULL) {
38839 0 : PyErr_NoMemory();
38840 0 : return -1;
38841 : }
38842 0 : test_str = PyBytes_AS_STRING(unicode);
38843 0 : } else if (PyBytes_Check(value)) {
38844 0 : test_str = PyBytes_AS_STRING(value);
38845 : } else {
38846 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
38847 0 : return -1;
38848 : }
38849 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
38850 0 : if (unicode != NULL) {
38851 0 : Py_DECREF(unicode);
38852 : }
38853 0 : if (talloc_str == NULL) {
38854 0 : PyErr_NoMemory();
38855 0 : return -1;
38856 : }
38857 0 : object->in.server_name = talloc_str;
38858 : }
38859 : }
38860 0 : return 0;
38861 : }
38862 :
38863 0 : static PyObject *py_netr_ServerAuthenticate2_in_get_account_name(PyObject *obj, void *closure)
38864 : {
38865 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
38866 : PyObject *py_account_name;
38867 0 : if (object->in.account_name == NULL) {
38868 0 : Py_RETURN_NONE;
38869 : }
38870 0 : if (object->in.account_name == NULL) {
38871 0 : py_account_name = Py_None;
38872 0 : Py_INCREF(py_account_name);
38873 : } else {
38874 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
38875 : }
38876 0 : return py_account_name;
38877 : }
38878 :
38879 0 : static int py_netr_ServerAuthenticate2_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
38880 : {
38881 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
38882 0 : if (value == NULL) {
38883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
38884 0 : return -1;
38885 : }
38886 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
38887 0 : if (object->in.account_name == NULL) {
38888 0 : PyErr_NoMemory();
38889 0 : return -1;
38890 : }
38891 : {
38892 : const char *test_str;
38893 : const char *talloc_str;
38894 0 : PyObject *unicode = NULL;
38895 0 : if (PyUnicode_Check(value)) {
38896 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
38897 0 : if (unicode == NULL) {
38898 0 : PyErr_NoMemory();
38899 0 : return -1;
38900 : }
38901 0 : test_str = PyBytes_AS_STRING(unicode);
38902 0 : } else if (PyBytes_Check(value)) {
38903 0 : test_str = PyBytes_AS_STRING(value);
38904 : } else {
38905 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
38906 0 : return -1;
38907 : }
38908 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
38909 0 : if (unicode != NULL) {
38910 0 : Py_DECREF(unicode);
38911 : }
38912 0 : if (talloc_str == NULL) {
38913 0 : PyErr_NoMemory();
38914 0 : return -1;
38915 : }
38916 0 : object->in.account_name = talloc_str;
38917 : }
38918 0 : return 0;
38919 : }
38920 :
38921 0 : static PyObject *py_netr_ServerAuthenticate2_in_get_secure_channel_type(PyObject *obj, void *closure)
38922 : {
38923 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
38924 : PyObject *py_secure_channel_type;
38925 0 : py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type);
38926 0 : return py_secure_channel_type;
38927 : }
38928 :
38929 0 : static int py_netr_ServerAuthenticate2_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure)
38930 : {
38931 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
38932 0 : if (value == NULL) {
38933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type");
38934 0 : return -1;
38935 : }
38936 : {
38937 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_type));
38938 0 : if (PyLong_Check(value)) {
38939 : unsigned long long test_var;
38940 0 : test_var = PyLong_AsUnsignedLongLong(value);
38941 0 : if (PyErr_Occurred() != NULL) {
38942 0 : return -1;
38943 : }
38944 0 : if (test_var > uint_max) {
38945 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38946 : PyLong_Type.tp_name, uint_max, test_var);
38947 0 : return -1;
38948 : }
38949 0 : object->in.secure_channel_type = test_var;
38950 : } else {
38951 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38952 : PyLong_Type.tp_name);
38953 0 : return -1;
38954 : }
38955 : }
38956 0 : return 0;
38957 : }
38958 :
38959 0 : static PyObject *py_netr_ServerAuthenticate2_in_get_computer_name(PyObject *obj, void *closure)
38960 : {
38961 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
38962 : PyObject *py_computer_name;
38963 0 : if (object->in.computer_name == NULL) {
38964 0 : Py_RETURN_NONE;
38965 : }
38966 0 : if (object->in.computer_name == NULL) {
38967 0 : py_computer_name = Py_None;
38968 0 : Py_INCREF(py_computer_name);
38969 : } else {
38970 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
38971 : }
38972 0 : return py_computer_name;
38973 : }
38974 :
38975 0 : static int py_netr_ServerAuthenticate2_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
38976 : {
38977 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
38978 0 : if (value == NULL) {
38979 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
38980 0 : return -1;
38981 : }
38982 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
38983 0 : if (object->in.computer_name == NULL) {
38984 0 : PyErr_NoMemory();
38985 0 : return -1;
38986 : }
38987 : {
38988 : const char *test_str;
38989 : const char *talloc_str;
38990 0 : PyObject *unicode = NULL;
38991 0 : if (PyUnicode_Check(value)) {
38992 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
38993 0 : if (unicode == NULL) {
38994 0 : PyErr_NoMemory();
38995 0 : return -1;
38996 : }
38997 0 : test_str = PyBytes_AS_STRING(unicode);
38998 0 : } else if (PyBytes_Check(value)) {
38999 0 : test_str = PyBytes_AS_STRING(value);
39000 : } else {
39001 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
39002 0 : return -1;
39003 : }
39004 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
39005 0 : if (unicode != NULL) {
39006 0 : Py_DECREF(unicode);
39007 : }
39008 0 : if (talloc_str == NULL) {
39009 0 : PyErr_NoMemory();
39010 0 : return -1;
39011 : }
39012 0 : object->in.computer_name = talloc_str;
39013 : }
39014 0 : return 0;
39015 : }
39016 :
39017 0 : static PyObject *py_netr_ServerAuthenticate2_in_get_credentials(PyObject *obj, void *closure)
39018 : {
39019 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
39020 : PyObject *py_credentials;
39021 0 : if (object->in.credentials == NULL) {
39022 0 : Py_RETURN_NONE;
39023 : }
39024 0 : py_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->in.credentials, object->in.credentials);
39025 0 : return py_credentials;
39026 : }
39027 :
39028 0 : static int py_netr_ServerAuthenticate2_in_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
39029 : {
39030 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
39031 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credentials));
39032 0 : if (value == NULL) {
39033 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credentials");
39034 0 : return -1;
39035 : }
39036 0 : object->in.credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credentials);
39037 0 : if (object->in.credentials == NULL) {
39038 0 : PyErr_NoMemory();
39039 0 : return -1;
39040 : }
39041 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
39042 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39043 0 : PyErr_NoMemory();
39044 0 : return -1;
39045 : }
39046 0 : object->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(value);
39047 0 : return 0;
39048 : }
39049 :
39050 0 : static PyObject *py_netr_ServerAuthenticate2_out_get_return_credentials(PyObject *obj, void *closure)
39051 : {
39052 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
39053 : PyObject *py_return_credentials;
39054 0 : if (object->out.return_credentials == NULL) {
39055 0 : Py_RETURN_NONE;
39056 : }
39057 0 : py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->out.return_credentials, object->out.return_credentials);
39058 0 : return py_return_credentials;
39059 : }
39060 :
39061 0 : static int py_netr_ServerAuthenticate2_out_set_return_credentials(PyObject *py_obj, PyObject *value, void *closure)
39062 : {
39063 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
39064 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_credentials));
39065 0 : if (value == NULL) {
39066 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_credentials");
39067 0 : return -1;
39068 : }
39069 0 : object->out.return_credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_credentials);
39070 0 : if (object->out.return_credentials == NULL) {
39071 0 : PyErr_NoMemory();
39072 0 : return -1;
39073 : }
39074 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
39075 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39076 0 : PyErr_NoMemory();
39077 0 : return -1;
39078 : }
39079 0 : object->out.return_credentials = (struct netr_Credential *)pytalloc_get_ptr(value);
39080 0 : return 0;
39081 : }
39082 :
39083 0 : static PyObject *py_netr_ServerAuthenticate2_in_get_negotiate_flags(PyObject *obj, void *closure)
39084 : {
39085 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
39086 : PyObject *py_negotiate_flags;
39087 0 : if (object->in.negotiate_flags == NULL) {
39088 0 : Py_RETURN_NONE;
39089 : }
39090 0 : py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->in.negotiate_flags);
39091 0 : return py_negotiate_flags;
39092 : }
39093 :
39094 0 : static int py_netr_ServerAuthenticate2_in_set_negotiate_flags(PyObject *py_obj, PyObject *value, void *closure)
39095 : {
39096 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
39097 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.negotiate_flags));
39098 0 : if (value == NULL) {
39099 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.negotiate_flags");
39100 0 : return -1;
39101 : }
39102 0 : object->in.negotiate_flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.negotiate_flags);
39103 0 : if (object->in.negotiate_flags == NULL) {
39104 0 : PyErr_NoMemory();
39105 0 : return -1;
39106 : }
39107 : {
39108 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.negotiate_flags));
39109 0 : if (PyLong_Check(value)) {
39110 : unsigned long long test_var;
39111 0 : test_var = PyLong_AsUnsignedLongLong(value);
39112 0 : if (PyErr_Occurred() != NULL) {
39113 0 : return -1;
39114 : }
39115 0 : if (test_var > uint_max) {
39116 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39117 : PyLong_Type.tp_name, uint_max, test_var);
39118 0 : return -1;
39119 : }
39120 0 : *object->in.negotiate_flags = test_var;
39121 : } else {
39122 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39123 : PyLong_Type.tp_name);
39124 0 : return -1;
39125 : }
39126 : }
39127 0 : return 0;
39128 : }
39129 :
39130 0 : static PyObject *py_netr_ServerAuthenticate2_out_get_negotiate_flags(PyObject *obj, void *closure)
39131 : {
39132 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
39133 : PyObject *py_negotiate_flags;
39134 0 : if (object->out.negotiate_flags == NULL) {
39135 0 : Py_RETURN_NONE;
39136 : }
39137 0 : py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.negotiate_flags);
39138 0 : return py_negotiate_flags;
39139 : }
39140 :
39141 0 : static int py_netr_ServerAuthenticate2_out_set_negotiate_flags(PyObject *py_obj, PyObject *value, void *closure)
39142 : {
39143 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
39144 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.negotiate_flags));
39145 0 : if (value == NULL) {
39146 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.negotiate_flags");
39147 0 : return -1;
39148 : }
39149 0 : object->out.negotiate_flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.negotiate_flags);
39150 0 : if (object->out.negotiate_flags == NULL) {
39151 0 : PyErr_NoMemory();
39152 0 : return -1;
39153 : }
39154 : {
39155 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.negotiate_flags));
39156 0 : if (PyLong_Check(value)) {
39157 : unsigned long long test_var;
39158 0 : test_var = PyLong_AsUnsignedLongLong(value);
39159 0 : if (PyErr_Occurred() != NULL) {
39160 0 : return -1;
39161 : }
39162 0 : if (test_var > uint_max) {
39163 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39164 : PyLong_Type.tp_name, uint_max, test_var);
39165 0 : return -1;
39166 : }
39167 0 : *object->out.negotiate_flags = test_var;
39168 : } else {
39169 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39170 : PyLong_Type.tp_name);
39171 0 : return -1;
39172 : }
39173 : }
39174 0 : return 0;
39175 : }
39176 :
39177 0 : static PyObject *py_netr_ServerAuthenticate2_get_result(PyObject *obj, void *closure)
39178 : {
39179 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(obj);
39180 : PyObject *py_result;
39181 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
39182 0 : return py_result;
39183 : }
39184 :
39185 0 : static int py_netr_ServerAuthenticate2_set_result(PyObject *py_obj, PyObject *value, void *closure)
39186 : {
39187 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
39188 0 : if (value == NULL) {
39189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
39190 0 : return -1;
39191 : }
39192 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
39193 0 : return 0;
39194 : }
39195 :
39196 : static PyGetSetDef py_netr_ServerAuthenticate2_getsetters[] = {
39197 : {
39198 : .name = discard_const_p(char, "in_server_name"),
39199 : .get = py_netr_ServerAuthenticate2_in_get_server_name,
39200 : .set = py_netr_ServerAuthenticate2_in_set_server_name,
39201 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
39202 : },
39203 : {
39204 : .name = discard_const_p(char, "in_account_name"),
39205 : .get = py_netr_ServerAuthenticate2_in_get_account_name,
39206 : .set = py_netr_ServerAuthenticate2_in_set_account_name,
39207 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
39208 : },
39209 : {
39210 : .name = discard_const_p(char, "in_secure_channel_type"),
39211 : .get = py_netr_ServerAuthenticate2_in_get_secure_channel_type,
39212 : .set = py_netr_ServerAuthenticate2_in_set_secure_channel_type,
39213 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType")
39214 : },
39215 : {
39216 : .name = discard_const_p(char, "in_computer_name"),
39217 : .get = py_netr_ServerAuthenticate2_in_get_computer_name,
39218 : .set = py_netr_ServerAuthenticate2_in_set_computer_name,
39219 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
39220 : },
39221 : {
39222 : .name = discard_const_p(char, "in_credentials"),
39223 : .get = py_netr_ServerAuthenticate2_in_get_credentials,
39224 : .set = py_netr_ServerAuthenticate2_in_set_credentials,
39225 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
39226 : },
39227 : {
39228 : .name = discard_const_p(char, "out_return_credentials"),
39229 : .get = py_netr_ServerAuthenticate2_out_get_return_credentials,
39230 : .set = py_netr_ServerAuthenticate2_out_set_return_credentials,
39231 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
39232 : },
39233 : {
39234 : .name = discard_const_p(char, "in_negotiate_flags"),
39235 : .get = py_netr_ServerAuthenticate2_in_get_negotiate_flags,
39236 : .set = py_netr_ServerAuthenticate2_in_set_negotiate_flags,
39237 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_NegotiateFlags")
39238 : },
39239 : {
39240 : .name = discard_const_p(char, "out_negotiate_flags"),
39241 : .get = py_netr_ServerAuthenticate2_out_get_negotiate_flags,
39242 : .set = py_netr_ServerAuthenticate2_out_set_negotiate_flags,
39243 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_NegotiateFlags")
39244 : },
39245 : {
39246 : .name = discard_const_p(char, "result"),
39247 : .get = py_netr_ServerAuthenticate2_get_result,
39248 : .set = py_netr_ServerAuthenticate2_set_result,
39249 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
39250 : },
39251 : { .name = NULL }
39252 : };
39253 :
39254 0 : static PyObject *py_netr_ServerAuthenticate2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39255 : {
39256 0 : PyObject *self = pytalloc_new(struct netr_ServerAuthenticate2, type);
39257 0 : struct netr_ServerAuthenticate2 *_self = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(self);
39258 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39259 0 : _self->in.credentials = talloc_zero(mem_ctx, struct netr_Credential);
39260 0 : _self->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
39261 0 : _self->in.negotiate_flags = talloc_zero(mem_ctx, uint32_t);
39262 0 : _self->out.negotiate_flags = talloc_zero(mem_ctx, uint32_t);
39263 0 : return self;
39264 : }
39265 :
39266 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39267 : {
39268 :
39269 :
39270 0 : return PyLong_FromLong(15);
39271 : }
39272 :
39273 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
39274 : {
39275 0 : const struct ndr_interface_call *call = NULL;
39276 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
39277 0 : PyObject *ret = NULL;
39278 0 : struct ndr_push *push = NULL;
39279 : DATA_BLOB blob;
39280 : enum ndr_err_code err;
39281 :
39282 0 : if (ndr_table_netlogon.num_calls < 16) {
39283 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate2_ndr_pack");
39284 0 : return NULL;
39285 : }
39286 0 : call = &ndr_table_netlogon.calls[15];
39287 :
39288 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39289 0 : if (push == NULL) {
39290 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39291 0 : return NULL;
39292 : }
39293 :
39294 0 : push->flags |= ndr_push_flags;
39295 :
39296 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39297 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39298 0 : TALLOC_FREE(push);
39299 0 : PyErr_SetNdrError(err);
39300 0 : return NULL;
39301 : }
39302 0 : blob = ndr_push_blob(push);
39303 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39304 0 : TALLOC_FREE(push);
39305 0 : return ret;
39306 : }
39307 :
39308 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39309 : {
39310 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39311 0 : PyObject *bigendian_obj = NULL;
39312 0 : PyObject *ndr64_obj = NULL;
39313 0 : uint32_t ndr_push_flags = 0;
39314 :
39315 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39316 : discard_const_p(char *, kwnames),
39317 : &bigendian_obj,
39318 : &ndr64_obj)) {
39319 0 : return NULL;
39320 : }
39321 :
39322 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39323 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39324 : }
39325 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39326 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39327 : }
39328 :
39329 0 : return py_netr_ServerAuthenticate2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39330 : }
39331 :
39332 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39333 : {
39334 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39335 0 : PyObject *bigendian_obj = NULL;
39336 0 : PyObject *ndr64_obj = NULL;
39337 0 : uint32_t ndr_push_flags = 0;
39338 :
39339 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39340 : discard_const_p(char *, kwnames),
39341 : &bigendian_obj,
39342 : &ndr64_obj)) {
39343 0 : return NULL;
39344 : }
39345 :
39346 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39347 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39348 : }
39349 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39350 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39351 : }
39352 :
39353 0 : return py_netr_ServerAuthenticate2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39354 : }
39355 :
39356 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
39357 : {
39358 0 : const struct ndr_interface_call *call = NULL;
39359 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
39360 0 : struct ndr_pull *pull = NULL;
39361 : enum ndr_err_code err;
39362 :
39363 0 : if (ndr_table_netlogon.num_calls < 16) {
39364 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate2_ndr_unpack");
39365 0 : return NULL;
39366 : }
39367 0 : call = &ndr_table_netlogon.calls[15];
39368 :
39369 0 : pull = ndr_pull_init_blob(blob, object);
39370 0 : if (pull == NULL) {
39371 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39372 0 : return NULL;
39373 : }
39374 :
39375 0 : pull->flags |= ndr_pull_flags;
39376 :
39377 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39378 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39379 0 : TALLOC_FREE(pull);
39380 0 : PyErr_SetNdrError(err);
39381 0 : return NULL;
39382 : }
39383 0 : if (!allow_remaining) {
39384 : uint32_t highest_ofs;
39385 :
39386 0 : if (pull->offset > pull->relative_highest_offset) {
39387 0 : highest_ofs = pull->offset;
39388 : } else {
39389 0 : highest_ofs = pull->relative_highest_offset;
39390 : }
39391 0 : if (highest_ofs < pull->data_size) {
39392 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39393 : "not all bytes consumed ofs[%u] size[%u]",
39394 : highest_ofs, pull->data_size);
39395 0 : TALLOC_FREE(pull);
39396 0 : PyErr_SetNdrError(err);
39397 0 : return NULL;
39398 : }
39399 : }
39400 :
39401 0 : TALLOC_FREE(pull);
39402 0 : Py_RETURN_NONE;
39403 : }
39404 :
39405 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39406 : {
39407 : DATA_BLOB blob;
39408 0 : Py_ssize_t blob_length = 0;
39409 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39410 0 : PyObject *bigendian_obj = NULL;
39411 0 : PyObject *ndr64_obj = NULL;
39412 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39413 0 : PyObject *allow_remaining_obj = NULL;
39414 0 : bool allow_remaining = false;
39415 :
39416 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39417 : discard_const_p(char *, kwnames),
39418 : &blob.data, &blob_length,
39419 : &bigendian_obj,
39420 : &ndr64_obj,
39421 : &allow_remaining_obj)) {
39422 0 : return NULL;
39423 : }
39424 0 : blob.length = blob_length;
39425 :
39426 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39427 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39428 : }
39429 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39430 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39431 : }
39432 :
39433 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39434 0 : allow_remaining = true;
39435 : }
39436 :
39437 0 : return py_netr_ServerAuthenticate2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39438 : }
39439 :
39440 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39441 : {
39442 : DATA_BLOB blob;
39443 0 : Py_ssize_t blob_length = 0;
39444 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39445 0 : PyObject *bigendian_obj = NULL;
39446 0 : PyObject *ndr64_obj = NULL;
39447 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39448 0 : PyObject *allow_remaining_obj = NULL;
39449 0 : bool allow_remaining = false;
39450 :
39451 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39452 : discard_const_p(char *, kwnames),
39453 : &blob.data, &blob_length,
39454 : &bigendian_obj,
39455 : &ndr64_obj,
39456 : &allow_remaining_obj)) {
39457 0 : return NULL;
39458 : }
39459 0 : blob.length = blob_length;
39460 :
39461 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39462 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39463 : }
39464 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39465 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39466 : }
39467 :
39468 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39469 0 : allow_remaining = true;
39470 : }
39471 :
39472 0 : return py_netr_ServerAuthenticate2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39473 : }
39474 :
39475 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
39476 : {
39477 0 : const struct ndr_interface_call *call = NULL;
39478 0 : struct netr_ServerAuthenticate2 *object = (struct netr_ServerAuthenticate2 *)pytalloc_get_ptr(py_obj);
39479 : PyObject *ret;
39480 : char *retstr;
39481 :
39482 0 : if (ndr_table_netlogon.num_calls < 16) {
39483 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate2_ndr_print");
39484 0 : return NULL;
39485 : }
39486 0 : call = &ndr_table_netlogon.calls[15];
39487 :
39488 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39489 0 : ret = PyUnicode_FromString(retstr);
39490 0 : TALLOC_FREE(retstr);
39491 :
39492 0 : return ret;
39493 : }
39494 :
39495 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39496 : {
39497 0 : return py_netr_ServerAuthenticate2_ndr_print(py_obj, "netr_ServerAuthenticate2_in", NDR_IN);
39498 : }
39499 :
39500 0 : static PyObject *py_netr_ServerAuthenticate2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39501 : {
39502 0 : return py_netr_ServerAuthenticate2_ndr_print(py_obj, "netr_ServerAuthenticate2_out", NDR_OUT);
39503 : }
39504 :
39505 : static PyMethodDef py_netr_ServerAuthenticate2_methods[] = {
39506 : { "opnum", (PyCFunction)py_netr_ServerAuthenticate2_ndr_opnum, METH_NOARGS|METH_CLASS,
39507 : "netlogon.netr_ServerAuthenticate2.opnum() -> 15 (0x0f) " },
39508 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39509 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39510 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39511 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39512 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39513 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39514 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39515 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39516 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerAuthenticate2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39517 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerAuthenticate2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39518 : { NULL, NULL, 0, NULL }
39519 : };
39520 :
39521 :
39522 : static PyTypeObject netr_ServerAuthenticate2_Type = {
39523 : PyVarObject_HEAD_INIT(NULL, 0)
39524 : .tp_name = "netlogon.netr_ServerAuthenticate2",
39525 : .tp_getset = py_netr_ServerAuthenticate2_getsetters,
39526 : .tp_methods = py_netr_ServerAuthenticate2_methods,
39527 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39528 : .tp_new = py_netr_ServerAuthenticate2_new,
39529 : };
39530 :
39531 0 : static bool pack_py_netr_ServerAuthenticate2_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerAuthenticate2 *r)
39532 : {
39533 : PyObject *py_server_name;
39534 : PyObject *py_account_name;
39535 : PyObject *py_secure_channel_type;
39536 : PyObject *py_computer_name;
39537 : PyObject *py_credentials;
39538 : PyObject *py_negotiate_flags;
39539 0 : const char *kwnames[] = {
39540 : "server_name", "account_name", "secure_channel_type", "computer_name", "credentials", "negotiate_flags", NULL
39541 : };
39542 :
39543 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_ServerAuthenticate2", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credentials, &py_negotiate_flags)) {
39544 0 : return false;
39545 : }
39546 :
39547 0 : if (py_server_name == NULL) {
39548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
39549 0 : return false;
39550 : }
39551 0 : if (py_server_name == Py_None) {
39552 0 : r->in.server_name = NULL;
39553 : } else {
39554 0 : r->in.server_name = NULL;
39555 : {
39556 : const char *test_str;
39557 : const char *talloc_str;
39558 0 : PyObject *unicode = NULL;
39559 0 : if (PyUnicode_Check(py_server_name)) {
39560 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
39561 0 : if (unicode == NULL) {
39562 0 : PyErr_NoMemory();
39563 0 : return false;
39564 : }
39565 0 : test_str = PyBytes_AS_STRING(unicode);
39566 0 : } else if (PyBytes_Check(py_server_name)) {
39567 0 : test_str = PyBytes_AS_STRING(py_server_name);
39568 : } else {
39569 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
39570 0 : return false;
39571 : }
39572 0 : talloc_str = talloc_strdup(r, test_str);
39573 0 : if (unicode != NULL) {
39574 0 : Py_DECREF(unicode);
39575 : }
39576 0 : if (talloc_str == NULL) {
39577 0 : PyErr_NoMemory();
39578 0 : return false;
39579 : }
39580 0 : r->in.server_name = talloc_str;
39581 : }
39582 : }
39583 0 : if (py_account_name == NULL) {
39584 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
39585 0 : return false;
39586 : }
39587 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
39588 0 : if (r->in.account_name == NULL) {
39589 0 : PyErr_NoMemory();
39590 0 : return false;
39591 : }
39592 : {
39593 : const char *test_str;
39594 : const char *talloc_str;
39595 0 : PyObject *unicode = NULL;
39596 0 : if (PyUnicode_Check(py_account_name)) {
39597 0 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
39598 0 : if (unicode == NULL) {
39599 0 : PyErr_NoMemory();
39600 0 : return false;
39601 : }
39602 0 : test_str = PyBytes_AS_STRING(unicode);
39603 0 : } else if (PyBytes_Check(py_account_name)) {
39604 0 : test_str = PyBytes_AS_STRING(py_account_name);
39605 : } else {
39606 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
39607 0 : return false;
39608 : }
39609 0 : talloc_str = talloc_strdup(r, test_str);
39610 0 : if (unicode != NULL) {
39611 0 : Py_DECREF(unicode);
39612 : }
39613 0 : if (talloc_str == NULL) {
39614 0 : PyErr_NoMemory();
39615 0 : return false;
39616 : }
39617 0 : r->in.account_name = talloc_str;
39618 : }
39619 0 : if (py_secure_channel_type == NULL) {
39620 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type");
39621 0 : return false;
39622 : }
39623 : {
39624 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type));
39625 0 : if (PyLong_Check(py_secure_channel_type)) {
39626 : unsigned long long test_var;
39627 0 : test_var = PyLong_AsUnsignedLongLong(py_secure_channel_type);
39628 0 : if (PyErr_Occurred() != NULL) {
39629 0 : return false;
39630 : }
39631 0 : if (test_var > uint_max) {
39632 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39633 : PyLong_Type.tp_name, uint_max, test_var);
39634 0 : return false;
39635 : }
39636 0 : r->in.secure_channel_type = test_var;
39637 : } else {
39638 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39639 : PyLong_Type.tp_name);
39640 0 : return false;
39641 : }
39642 : }
39643 0 : if (py_computer_name == NULL) {
39644 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
39645 0 : return false;
39646 : }
39647 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
39648 0 : if (r->in.computer_name == NULL) {
39649 0 : PyErr_NoMemory();
39650 0 : return false;
39651 : }
39652 : {
39653 : const char *test_str;
39654 : const char *talloc_str;
39655 0 : PyObject *unicode = NULL;
39656 0 : if (PyUnicode_Check(py_computer_name)) {
39657 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
39658 0 : if (unicode == NULL) {
39659 0 : PyErr_NoMemory();
39660 0 : return false;
39661 : }
39662 0 : test_str = PyBytes_AS_STRING(unicode);
39663 0 : } else if (PyBytes_Check(py_computer_name)) {
39664 0 : test_str = PyBytes_AS_STRING(py_computer_name);
39665 : } else {
39666 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
39667 0 : return false;
39668 : }
39669 0 : talloc_str = talloc_strdup(r, test_str);
39670 0 : if (unicode != NULL) {
39671 0 : Py_DECREF(unicode);
39672 : }
39673 0 : if (talloc_str == NULL) {
39674 0 : PyErr_NoMemory();
39675 0 : return false;
39676 : }
39677 0 : r->in.computer_name = talloc_str;
39678 : }
39679 0 : if (py_credentials == NULL) {
39680 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credentials");
39681 0 : return false;
39682 : }
39683 0 : r->in.credentials = talloc_ptrtype(r, r->in.credentials);
39684 0 : if (r->in.credentials == NULL) {
39685 0 : PyErr_NoMemory();
39686 0 : return false;
39687 : }
39688 0 : PY_CHECK_TYPE(&netr_Credential_Type, py_credentials, return false;);
39689 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credentials)) == NULL) {
39690 0 : PyErr_NoMemory();
39691 0 : return false;
39692 : }
39693 0 : r->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(py_credentials);
39694 0 : if (py_negotiate_flags == NULL) {
39695 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.negotiate_flags");
39696 0 : return false;
39697 : }
39698 0 : r->in.negotiate_flags = talloc_ptrtype(r, r->in.negotiate_flags);
39699 0 : if (r->in.negotiate_flags == NULL) {
39700 0 : PyErr_NoMemory();
39701 0 : return false;
39702 : }
39703 : {
39704 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.negotiate_flags));
39705 0 : if (PyLong_Check(py_negotiate_flags)) {
39706 : unsigned long long test_var;
39707 0 : test_var = PyLong_AsUnsignedLongLong(py_negotiate_flags);
39708 0 : if (PyErr_Occurred() != NULL) {
39709 0 : return false;
39710 : }
39711 0 : if (test_var > uint_max) {
39712 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39713 : PyLong_Type.tp_name, uint_max, test_var);
39714 0 : return false;
39715 : }
39716 0 : *r->in.negotiate_flags = test_var;
39717 : } else {
39718 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39719 : PyLong_Type.tp_name);
39720 0 : return false;
39721 : }
39722 : }
39723 0 : return true;
39724 : }
39725 :
39726 0 : static PyObject *unpack_py_netr_ServerAuthenticate2_args_out(struct netr_ServerAuthenticate2 *r)
39727 : {
39728 : PyObject *result;
39729 : PyObject *py_return_credentials;
39730 : PyObject *py_negotiate_flags;
39731 0 : result = PyTuple_New(2);
39732 0 : py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, r->out.return_credentials, r->out.return_credentials);
39733 0 : PyTuple_SetItem(result, 0, py_return_credentials);
39734 0 : py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.negotiate_flags);
39735 0 : PyTuple_SetItem(result, 1, py_negotiate_flags);
39736 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
39737 0 : PyErr_SetNTSTATUS(r->out.result);
39738 0 : return NULL;
39739 : }
39740 :
39741 0 : return result;
39742 : }
39743 :
39744 :
39745 0 : static PyObject *py_netr_DatabaseSync2_in_get_logon_server(PyObject *obj, void *closure)
39746 : {
39747 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
39748 : PyObject *py_logon_server;
39749 0 : if (object->in.logon_server == NULL) {
39750 0 : Py_RETURN_NONE;
39751 : }
39752 0 : if (object->in.logon_server == NULL) {
39753 0 : py_logon_server = Py_None;
39754 0 : Py_INCREF(py_logon_server);
39755 : } else {
39756 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
39757 : }
39758 0 : return py_logon_server;
39759 : }
39760 :
39761 0 : static int py_netr_DatabaseSync2_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
39762 : {
39763 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
39764 0 : if (value == NULL) {
39765 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
39766 0 : return -1;
39767 : }
39768 0 : object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server);
39769 0 : if (object->in.logon_server == NULL) {
39770 0 : PyErr_NoMemory();
39771 0 : return -1;
39772 : }
39773 : {
39774 : const char *test_str;
39775 : const char *talloc_str;
39776 0 : PyObject *unicode = NULL;
39777 0 : if (PyUnicode_Check(value)) {
39778 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
39779 0 : if (unicode == NULL) {
39780 0 : PyErr_NoMemory();
39781 0 : return -1;
39782 : }
39783 0 : test_str = PyBytes_AS_STRING(unicode);
39784 0 : } else if (PyBytes_Check(value)) {
39785 0 : test_str = PyBytes_AS_STRING(value);
39786 : } else {
39787 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
39788 0 : return -1;
39789 : }
39790 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
39791 0 : if (unicode != NULL) {
39792 0 : Py_DECREF(unicode);
39793 : }
39794 0 : if (talloc_str == NULL) {
39795 0 : PyErr_NoMemory();
39796 0 : return -1;
39797 : }
39798 0 : object->in.logon_server = talloc_str;
39799 : }
39800 0 : return 0;
39801 : }
39802 :
39803 0 : static PyObject *py_netr_DatabaseSync2_in_get_computername(PyObject *obj, void *closure)
39804 : {
39805 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
39806 : PyObject *py_computername;
39807 0 : if (object->in.computername == NULL) {
39808 0 : Py_RETURN_NONE;
39809 : }
39810 0 : if (object->in.computername == NULL) {
39811 0 : py_computername = Py_None;
39812 0 : Py_INCREF(py_computername);
39813 : } else {
39814 0 : py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore");
39815 : }
39816 0 : return py_computername;
39817 : }
39818 :
39819 0 : static int py_netr_DatabaseSync2_in_set_computername(PyObject *py_obj, PyObject *value, void *closure)
39820 : {
39821 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
39822 0 : if (value == NULL) {
39823 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername");
39824 0 : return -1;
39825 : }
39826 0 : object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername);
39827 0 : if (object->in.computername == NULL) {
39828 0 : PyErr_NoMemory();
39829 0 : return -1;
39830 : }
39831 : {
39832 : const char *test_str;
39833 : const char *talloc_str;
39834 0 : PyObject *unicode = NULL;
39835 0 : if (PyUnicode_Check(value)) {
39836 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
39837 0 : if (unicode == NULL) {
39838 0 : PyErr_NoMemory();
39839 0 : return -1;
39840 : }
39841 0 : test_str = PyBytes_AS_STRING(unicode);
39842 0 : } else if (PyBytes_Check(value)) {
39843 0 : test_str = PyBytes_AS_STRING(value);
39844 : } else {
39845 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
39846 0 : return -1;
39847 : }
39848 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
39849 0 : if (unicode != NULL) {
39850 0 : Py_DECREF(unicode);
39851 : }
39852 0 : if (talloc_str == NULL) {
39853 0 : PyErr_NoMemory();
39854 0 : return -1;
39855 : }
39856 0 : object->in.computername = talloc_str;
39857 : }
39858 0 : return 0;
39859 : }
39860 :
39861 0 : static PyObject *py_netr_DatabaseSync2_in_get_credential(PyObject *obj, void *closure)
39862 : {
39863 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
39864 : PyObject *py_credential;
39865 0 : if (object->in.credential == NULL) {
39866 0 : Py_RETURN_NONE;
39867 : }
39868 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
39869 0 : return py_credential;
39870 : }
39871 :
39872 0 : static int py_netr_DatabaseSync2_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
39873 : {
39874 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
39875 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
39876 0 : if (value == NULL) {
39877 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
39878 0 : return -1;
39879 : }
39880 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
39881 0 : if (object->in.credential == NULL) {
39882 0 : PyErr_NoMemory();
39883 0 : return -1;
39884 : }
39885 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
39886 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39887 0 : PyErr_NoMemory();
39888 0 : return -1;
39889 : }
39890 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
39891 0 : return 0;
39892 : }
39893 :
39894 0 : static PyObject *py_netr_DatabaseSync2_in_get_return_authenticator(PyObject *obj, void *closure)
39895 : {
39896 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
39897 : PyObject *py_return_authenticator;
39898 0 : if (object->in.return_authenticator == NULL) {
39899 0 : Py_RETURN_NONE;
39900 : }
39901 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
39902 0 : return py_return_authenticator;
39903 : }
39904 :
39905 0 : static int py_netr_DatabaseSync2_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
39906 : {
39907 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
39908 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
39909 0 : if (value == NULL) {
39910 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
39911 0 : return -1;
39912 : }
39913 0 : object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator);
39914 0 : if (object->in.return_authenticator == NULL) {
39915 0 : PyErr_NoMemory();
39916 0 : return -1;
39917 : }
39918 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
39919 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39920 0 : PyErr_NoMemory();
39921 0 : return -1;
39922 : }
39923 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
39924 0 : return 0;
39925 : }
39926 :
39927 0 : static PyObject *py_netr_DatabaseSync2_out_get_return_authenticator(PyObject *obj, void *closure)
39928 : {
39929 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
39930 : PyObject *py_return_authenticator;
39931 0 : if (object->out.return_authenticator == NULL) {
39932 0 : Py_RETURN_NONE;
39933 : }
39934 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
39935 0 : return py_return_authenticator;
39936 : }
39937 :
39938 0 : static int py_netr_DatabaseSync2_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
39939 : {
39940 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
39941 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
39942 0 : if (value == NULL) {
39943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
39944 0 : return -1;
39945 : }
39946 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
39947 0 : if (object->out.return_authenticator == NULL) {
39948 0 : PyErr_NoMemory();
39949 0 : return -1;
39950 : }
39951 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
39952 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39953 0 : PyErr_NoMemory();
39954 0 : return -1;
39955 : }
39956 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
39957 0 : return 0;
39958 : }
39959 :
39960 0 : static PyObject *py_netr_DatabaseSync2_in_get_database_id(PyObject *obj, void *closure)
39961 : {
39962 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
39963 : PyObject *py_database_id;
39964 0 : py_database_id = PyLong_FromUnsignedLongLong((uint32_t)object->in.database_id);
39965 0 : return py_database_id;
39966 : }
39967 :
39968 0 : static int py_netr_DatabaseSync2_in_set_database_id(PyObject *py_obj, PyObject *value, void *closure)
39969 : {
39970 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
39971 0 : if (value == NULL) {
39972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.database_id");
39973 0 : return -1;
39974 : }
39975 : {
39976 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.database_id));
39977 0 : if (PyLong_Check(value)) {
39978 : unsigned long long test_var;
39979 0 : test_var = PyLong_AsUnsignedLongLong(value);
39980 0 : if (PyErr_Occurred() != NULL) {
39981 0 : return -1;
39982 : }
39983 0 : if (test_var > uint_max) {
39984 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39985 : PyLong_Type.tp_name, uint_max, test_var);
39986 0 : return -1;
39987 : }
39988 0 : object->in.database_id = test_var;
39989 : } else {
39990 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39991 : PyLong_Type.tp_name);
39992 0 : return -1;
39993 : }
39994 : }
39995 0 : return 0;
39996 : }
39997 :
39998 0 : static PyObject *py_netr_DatabaseSync2_in_get_restart_state(PyObject *obj, void *closure)
39999 : {
40000 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
40001 : PyObject *py_restart_state;
40002 0 : py_restart_state = PyLong_FromLong((uint16_t)object->in.restart_state);
40003 0 : return py_restart_state;
40004 : }
40005 :
40006 0 : static int py_netr_DatabaseSync2_in_set_restart_state(PyObject *py_obj, PyObject *value, void *closure)
40007 : {
40008 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40009 0 : if (value == NULL) {
40010 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.restart_state");
40011 0 : return -1;
40012 : }
40013 : {
40014 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.restart_state));
40015 0 : if (PyLong_Check(value)) {
40016 : unsigned long long test_var;
40017 0 : test_var = PyLong_AsUnsignedLongLong(value);
40018 0 : if (PyErr_Occurred() != NULL) {
40019 0 : return -1;
40020 : }
40021 0 : if (test_var > uint_max) {
40022 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40023 : PyLong_Type.tp_name, uint_max, test_var);
40024 0 : return -1;
40025 : }
40026 0 : object->in.restart_state = test_var;
40027 : } else {
40028 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40029 : PyLong_Type.tp_name);
40030 0 : return -1;
40031 : }
40032 : }
40033 0 : return 0;
40034 : }
40035 :
40036 0 : static PyObject *py_netr_DatabaseSync2_in_get_sync_context(PyObject *obj, void *closure)
40037 : {
40038 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
40039 : PyObject *py_sync_context;
40040 0 : if (object->in.sync_context == NULL) {
40041 0 : Py_RETURN_NONE;
40042 : }
40043 0 : py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*object->in.sync_context);
40044 0 : return py_sync_context;
40045 : }
40046 :
40047 0 : static int py_netr_DatabaseSync2_in_set_sync_context(PyObject *py_obj, PyObject *value, void *closure)
40048 : {
40049 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40050 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sync_context));
40051 0 : if (value == NULL) {
40052 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sync_context");
40053 0 : return -1;
40054 : }
40055 0 : object->in.sync_context = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sync_context);
40056 0 : if (object->in.sync_context == NULL) {
40057 0 : PyErr_NoMemory();
40058 0 : return -1;
40059 : }
40060 : {
40061 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.sync_context));
40062 0 : if (PyLong_Check(value)) {
40063 : unsigned long long test_var;
40064 0 : test_var = PyLong_AsUnsignedLongLong(value);
40065 0 : if (PyErr_Occurred() != NULL) {
40066 0 : return -1;
40067 : }
40068 0 : if (test_var > uint_max) {
40069 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40070 : PyLong_Type.tp_name, uint_max, test_var);
40071 0 : return -1;
40072 : }
40073 0 : *object->in.sync_context = test_var;
40074 : } else {
40075 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40076 : PyLong_Type.tp_name);
40077 0 : return -1;
40078 : }
40079 : }
40080 0 : return 0;
40081 : }
40082 :
40083 0 : static PyObject *py_netr_DatabaseSync2_out_get_sync_context(PyObject *obj, void *closure)
40084 : {
40085 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
40086 : PyObject *py_sync_context;
40087 0 : if (object->out.sync_context == NULL) {
40088 0 : Py_RETURN_NONE;
40089 : }
40090 0 : py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*object->out.sync_context);
40091 0 : return py_sync_context;
40092 : }
40093 :
40094 0 : static int py_netr_DatabaseSync2_out_set_sync_context(PyObject *py_obj, PyObject *value, void *closure)
40095 : {
40096 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40097 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sync_context));
40098 0 : if (value == NULL) {
40099 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sync_context");
40100 0 : return -1;
40101 : }
40102 0 : object->out.sync_context = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sync_context);
40103 0 : if (object->out.sync_context == NULL) {
40104 0 : PyErr_NoMemory();
40105 0 : return -1;
40106 : }
40107 : {
40108 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sync_context));
40109 0 : if (PyLong_Check(value)) {
40110 : unsigned long long test_var;
40111 0 : test_var = PyLong_AsUnsignedLongLong(value);
40112 0 : if (PyErr_Occurred() != NULL) {
40113 0 : return -1;
40114 : }
40115 0 : if (test_var > uint_max) {
40116 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40117 : PyLong_Type.tp_name, uint_max, test_var);
40118 0 : return -1;
40119 : }
40120 0 : *object->out.sync_context = test_var;
40121 : } else {
40122 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40123 : PyLong_Type.tp_name);
40124 0 : return -1;
40125 : }
40126 : }
40127 0 : return 0;
40128 : }
40129 :
40130 0 : static PyObject *py_netr_DatabaseSync2_out_get_delta_enum_array(PyObject *obj, void *closure)
40131 : {
40132 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
40133 : PyObject *py_delta_enum_array;
40134 0 : if (object->out.delta_enum_array == NULL) {
40135 0 : Py_RETURN_NONE;
40136 : }
40137 0 : if (*object->out.delta_enum_array == NULL) {
40138 0 : py_delta_enum_array = Py_None;
40139 0 : Py_INCREF(py_delta_enum_array);
40140 : } else {
40141 0 : py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *object->out.delta_enum_array, *object->out.delta_enum_array);
40142 : }
40143 0 : return py_delta_enum_array;
40144 : }
40145 :
40146 0 : static int py_netr_DatabaseSync2_out_set_delta_enum_array(PyObject *py_obj, PyObject *value, void *closure)
40147 : {
40148 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40149 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.delta_enum_array));
40150 0 : if (value == NULL) {
40151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.delta_enum_array");
40152 0 : return -1;
40153 : }
40154 0 : object->out.delta_enum_array = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.delta_enum_array);
40155 0 : if (object->out.delta_enum_array == NULL) {
40156 0 : PyErr_NoMemory();
40157 0 : return -1;
40158 : }
40159 0 : if (value == Py_None) {
40160 0 : *object->out.delta_enum_array = NULL;
40161 : } else {
40162 0 : *object->out.delta_enum_array = NULL;
40163 0 : PY_CHECK_TYPE(&netr_DELTA_ENUM_ARRAY_Type, value, return -1;);
40164 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40165 0 : PyErr_NoMemory();
40166 0 : return -1;
40167 : }
40168 0 : *object->out.delta_enum_array = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(value);
40169 : }
40170 0 : return 0;
40171 : }
40172 :
40173 0 : static PyObject *py_netr_DatabaseSync2_in_get_preferredmaximumlength(PyObject *obj, void *closure)
40174 : {
40175 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
40176 : PyObject *py_preferredmaximumlength;
40177 0 : py_preferredmaximumlength = PyLong_FromUnsignedLongLong((uint32_t)object->in.preferredmaximumlength);
40178 0 : return py_preferredmaximumlength;
40179 : }
40180 :
40181 0 : static int py_netr_DatabaseSync2_in_set_preferredmaximumlength(PyObject *py_obj, PyObject *value, void *closure)
40182 : {
40183 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40184 0 : if (value == NULL) {
40185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.preferredmaximumlength");
40186 0 : return -1;
40187 : }
40188 : {
40189 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.preferredmaximumlength));
40190 0 : if (PyLong_Check(value)) {
40191 : unsigned long long test_var;
40192 0 : test_var = PyLong_AsUnsignedLongLong(value);
40193 0 : if (PyErr_Occurred() != NULL) {
40194 0 : return -1;
40195 : }
40196 0 : if (test_var > uint_max) {
40197 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40198 : PyLong_Type.tp_name, uint_max, test_var);
40199 0 : return -1;
40200 : }
40201 0 : object->in.preferredmaximumlength = test_var;
40202 : } else {
40203 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40204 : PyLong_Type.tp_name);
40205 0 : return -1;
40206 : }
40207 : }
40208 0 : return 0;
40209 : }
40210 :
40211 0 : static PyObject *py_netr_DatabaseSync2_get_result(PyObject *obj, void *closure)
40212 : {
40213 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(obj);
40214 : PyObject *py_result;
40215 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40216 0 : return py_result;
40217 : }
40218 :
40219 0 : static int py_netr_DatabaseSync2_set_result(PyObject *py_obj, PyObject *value, void *closure)
40220 : {
40221 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40222 0 : if (value == NULL) {
40223 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40224 0 : return -1;
40225 : }
40226 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40227 0 : return 0;
40228 : }
40229 :
40230 : static PyGetSetDef py_netr_DatabaseSync2_getsetters[] = {
40231 : {
40232 : .name = discard_const_p(char, "in_logon_server"),
40233 : .get = py_netr_DatabaseSync2_in_get_logon_server,
40234 : .set = py_netr_DatabaseSync2_in_set_logon_server,
40235 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
40236 : },
40237 : {
40238 : .name = discard_const_p(char, "in_computername"),
40239 : .get = py_netr_DatabaseSync2_in_get_computername,
40240 : .set = py_netr_DatabaseSync2_in_set_computername,
40241 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
40242 : },
40243 : {
40244 : .name = discard_const_p(char, "in_credential"),
40245 : .get = py_netr_DatabaseSync2_in_get_credential,
40246 : .set = py_netr_DatabaseSync2_in_set_credential,
40247 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
40248 : },
40249 : {
40250 : .name = discard_const_p(char, "in_return_authenticator"),
40251 : .get = py_netr_DatabaseSync2_in_get_return_authenticator,
40252 : .set = py_netr_DatabaseSync2_in_set_return_authenticator,
40253 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
40254 : },
40255 : {
40256 : .name = discard_const_p(char, "out_return_authenticator"),
40257 : .get = py_netr_DatabaseSync2_out_get_return_authenticator,
40258 : .set = py_netr_DatabaseSync2_out_set_return_authenticator,
40259 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
40260 : },
40261 : {
40262 : .name = discard_const_p(char, "in_database_id"),
40263 : .get = py_netr_DatabaseSync2_in_get_database_id,
40264 : .set = py_netr_DatabaseSync2_in_set_database_id,
40265 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamDatabaseID")
40266 : },
40267 : {
40268 : .name = discard_const_p(char, "in_restart_state"),
40269 : .get = py_netr_DatabaseSync2_in_get_restart_state,
40270 : .set = py_netr_DatabaseSync2_in_set_restart_state,
40271 : .doc = discard_const_p(char, "PIDL-generated element of base type SyncStateEnum")
40272 : },
40273 : {
40274 : .name = discard_const_p(char, "in_sync_context"),
40275 : .get = py_netr_DatabaseSync2_in_get_sync_context,
40276 : .set = py_netr_DatabaseSync2_in_set_sync_context,
40277 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40278 : },
40279 : {
40280 : .name = discard_const_p(char, "out_sync_context"),
40281 : .get = py_netr_DatabaseSync2_out_get_sync_context,
40282 : .set = py_netr_DatabaseSync2_out_set_sync_context,
40283 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40284 : },
40285 : {
40286 : .name = discard_const_p(char, "out_delta_enum_array"),
40287 : .get = py_netr_DatabaseSync2_out_get_delta_enum_array,
40288 : .set = py_netr_DatabaseSync2_out_set_delta_enum_array,
40289 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM_ARRAY")
40290 : },
40291 : {
40292 : .name = discard_const_p(char, "in_preferredmaximumlength"),
40293 : .get = py_netr_DatabaseSync2_in_get_preferredmaximumlength,
40294 : .set = py_netr_DatabaseSync2_in_set_preferredmaximumlength,
40295 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40296 : },
40297 : {
40298 : .name = discard_const_p(char, "result"),
40299 : .get = py_netr_DatabaseSync2_get_result,
40300 : .set = py_netr_DatabaseSync2_set_result,
40301 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
40302 : },
40303 : { .name = NULL }
40304 : };
40305 :
40306 0 : static PyObject *py_netr_DatabaseSync2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40307 : {
40308 0 : PyObject *self = pytalloc_new(struct netr_DatabaseSync2, type);
40309 0 : struct netr_DatabaseSync2 *_self = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(self);
40310 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40311 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
40312 0 : _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
40313 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
40314 0 : _self->in.sync_context = talloc_zero(mem_ctx, uint32_t);
40315 0 : _self->out.sync_context = talloc_zero(mem_ctx, uint32_t);
40316 : /* a pointer to a NULL pointer */
40317 0 : _self->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
40318 0 : return self;
40319 : }
40320 :
40321 0 : static PyObject *py_netr_DatabaseSync2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40322 : {
40323 :
40324 :
40325 0 : return PyLong_FromLong(16);
40326 : }
40327 :
40328 0 : static PyObject *py_netr_DatabaseSync2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
40329 : {
40330 0 : const struct ndr_interface_call *call = NULL;
40331 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40332 0 : PyObject *ret = NULL;
40333 0 : struct ndr_push *push = NULL;
40334 : DATA_BLOB blob;
40335 : enum ndr_err_code err;
40336 :
40337 0 : if (ndr_table_netlogon.num_calls < 17) {
40338 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync2_ndr_pack");
40339 0 : return NULL;
40340 : }
40341 0 : call = &ndr_table_netlogon.calls[16];
40342 :
40343 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
40344 0 : if (push == NULL) {
40345 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40346 0 : return NULL;
40347 : }
40348 :
40349 0 : push->flags |= ndr_push_flags;
40350 :
40351 0 : err = call->ndr_push(push, ndr_inout_flags, object);
40352 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40353 0 : TALLOC_FREE(push);
40354 0 : PyErr_SetNdrError(err);
40355 0 : return NULL;
40356 : }
40357 0 : blob = ndr_push_blob(push);
40358 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
40359 0 : TALLOC_FREE(push);
40360 0 : return ret;
40361 : }
40362 :
40363 0 : static PyObject *py_netr_DatabaseSync2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40364 : {
40365 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40366 0 : PyObject *bigendian_obj = NULL;
40367 0 : PyObject *ndr64_obj = NULL;
40368 0 : uint32_t ndr_push_flags = 0;
40369 :
40370 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
40371 : discard_const_p(char *, kwnames),
40372 : &bigendian_obj,
40373 : &ndr64_obj)) {
40374 0 : return NULL;
40375 : }
40376 :
40377 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40378 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40379 : }
40380 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40381 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40382 : }
40383 :
40384 0 : return py_netr_DatabaseSync2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
40385 : }
40386 :
40387 0 : static PyObject *py_netr_DatabaseSync2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40388 : {
40389 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40390 0 : PyObject *bigendian_obj = NULL;
40391 0 : PyObject *ndr64_obj = NULL;
40392 0 : uint32_t ndr_push_flags = 0;
40393 :
40394 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
40395 : discard_const_p(char *, kwnames),
40396 : &bigendian_obj,
40397 : &ndr64_obj)) {
40398 0 : return NULL;
40399 : }
40400 :
40401 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40402 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40403 : }
40404 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40405 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40406 : }
40407 :
40408 0 : return py_netr_DatabaseSync2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
40409 : }
40410 :
40411 0 : static PyObject *py_netr_DatabaseSync2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
40412 : {
40413 0 : const struct ndr_interface_call *call = NULL;
40414 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40415 0 : struct ndr_pull *pull = NULL;
40416 : enum ndr_err_code err;
40417 :
40418 0 : if (ndr_table_netlogon.num_calls < 17) {
40419 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync2_ndr_unpack");
40420 0 : return NULL;
40421 : }
40422 0 : call = &ndr_table_netlogon.calls[16];
40423 :
40424 0 : pull = ndr_pull_init_blob(blob, object);
40425 0 : if (pull == NULL) {
40426 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40427 0 : return NULL;
40428 : }
40429 :
40430 0 : pull->flags |= ndr_pull_flags;
40431 :
40432 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
40433 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40434 0 : TALLOC_FREE(pull);
40435 0 : PyErr_SetNdrError(err);
40436 0 : return NULL;
40437 : }
40438 0 : if (!allow_remaining) {
40439 : uint32_t highest_ofs;
40440 :
40441 0 : if (pull->offset > pull->relative_highest_offset) {
40442 0 : highest_ofs = pull->offset;
40443 : } else {
40444 0 : highest_ofs = pull->relative_highest_offset;
40445 : }
40446 0 : if (highest_ofs < pull->data_size) {
40447 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
40448 : "not all bytes consumed ofs[%u] size[%u]",
40449 : highest_ofs, pull->data_size);
40450 0 : TALLOC_FREE(pull);
40451 0 : PyErr_SetNdrError(err);
40452 0 : return NULL;
40453 : }
40454 : }
40455 :
40456 0 : TALLOC_FREE(pull);
40457 0 : Py_RETURN_NONE;
40458 : }
40459 :
40460 0 : static PyObject *py_netr_DatabaseSync2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40461 : {
40462 : DATA_BLOB blob;
40463 0 : Py_ssize_t blob_length = 0;
40464 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40465 0 : PyObject *bigendian_obj = NULL;
40466 0 : PyObject *ndr64_obj = NULL;
40467 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40468 0 : PyObject *allow_remaining_obj = NULL;
40469 0 : bool allow_remaining = false;
40470 :
40471 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
40472 : discard_const_p(char *, kwnames),
40473 : &blob.data, &blob_length,
40474 : &bigendian_obj,
40475 : &ndr64_obj,
40476 : &allow_remaining_obj)) {
40477 0 : return NULL;
40478 : }
40479 0 : blob.length = blob_length;
40480 :
40481 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40482 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40483 : }
40484 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40485 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40486 : }
40487 :
40488 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40489 0 : allow_remaining = true;
40490 : }
40491 :
40492 0 : return py_netr_DatabaseSync2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
40493 : }
40494 :
40495 0 : static PyObject *py_netr_DatabaseSync2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40496 : {
40497 : DATA_BLOB blob;
40498 0 : Py_ssize_t blob_length = 0;
40499 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40500 0 : PyObject *bigendian_obj = NULL;
40501 0 : PyObject *ndr64_obj = NULL;
40502 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40503 0 : PyObject *allow_remaining_obj = NULL;
40504 0 : bool allow_remaining = false;
40505 :
40506 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
40507 : discard_const_p(char *, kwnames),
40508 : &blob.data, &blob_length,
40509 : &bigendian_obj,
40510 : &ndr64_obj,
40511 : &allow_remaining_obj)) {
40512 0 : return NULL;
40513 : }
40514 0 : blob.length = blob_length;
40515 :
40516 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40517 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40518 : }
40519 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40520 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40521 : }
40522 :
40523 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40524 0 : allow_remaining = true;
40525 : }
40526 :
40527 0 : return py_netr_DatabaseSync2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
40528 : }
40529 :
40530 0 : static PyObject *py_netr_DatabaseSync2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
40531 : {
40532 0 : const struct ndr_interface_call *call = NULL;
40533 0 : struct netr_DatabaseSync2 *object = (struct netr_DatabaseSync2 *)pytalloc_get_ptr(py_obj);
40534 : PyObject *ret;
40535 : char *retstr;
40536 :
40537 0 : if (ndr_table_netlogon.num_calls < 17) {
40538 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseSync2_ndr_print");
40539 0 : return NULL;
40540 : }
40541 0 : call = &ndr_table_netlogon.calls[16];
40542 :
40543 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
40544 0 : ret = PyUnicode_FromString(retstr);
40545 0 : TALLOC_FREE(retstr);
40546 :
40547 0 : return ret;
40548 : }
40549 :
40550 0 : static PyObject *py_netr_DatabaseSync2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40551 : {
40552 0 : return py_netr_DatabaseSync2_ndr_print(py_obj, "netr_DatabaseSync2_in", NDR_IN);
40553 : }
40554 :
40555 0 : static PyObject *py_netr_DatabaseSync2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40556 : {
40557 0 : return py_netr_DatabaseSync2_ndr_print(py_obj, "netr_DatabaseSync2_out", NDR_OUT);
40558 : }
40559 :
40560 : static PyMethodDef py_netr_DatabaseSync2_methods[] = {
40561 : { "opnum", (PyCFunction)py_netr_DatabaseSync2_ndr_opnum, METH_NOARGS|METH_CLASS,
40562 : "netlogon.netr_DatabaseSync2.opnum() -> 16 (0x10) " },
40563 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
40564 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
40565 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
40566 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
40567 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
40568 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
40569 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseSync2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
40570 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
40571 : { "__ndr_print_in__", (PyCFunction)py_netr_DatabaseSync2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
40572 : { "__ndr_print_out__", (PyCFunction)py_netr_DatabaseSync2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
40573 : { NULL, NULL, 0, NULL }
40574 : };
40575 :
40576 :
40577 : static PyTypeObject netr_DatabaseSync2_Type = {
40578 : PyVarObject_HEAD_INIT(NULL, 0)
40579 : .tp_name = "netlogon.netr_DatabaseSync2",
40580 : .tp_getset = py_netr_DatabaseSync2_getsetters,
40581 : .tp_methods = py_netr_DatabaseSync2_methods,
40582 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
40583 : .tp_new = py_netr_DatabaseSync2_new,
40584 : };
40585 :
40586 0 : static bool pack_py_netr_DatabaseSync2_args_in(PyObject *args, PyObject *kwargs, struct netr_DatabaseSync2 *r)
40587 : {
40588 : PyObject *py_logon_server;
40589 : PyObject *py_computername;
40590 : PyObject *py_credential;
40591 : PyObject *py_return_authenticator;
40592 : PyObject *py_database_id;
40593 : PyObject *py_restart_state;
40594 : PyObject *py_sync_context;
40595 : PyObject *py_preferredmaximumlength;
40596 0 : const char *kwnames[] = {
40597 : "logon_server", "computername", "credential", "return_authenticator", "database_id", "restart_state", "sync_context", "preferredmaximumlength", NULL
40598 : };
40599 :
40600 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:netr_DatabaseSync2", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_database_id, &py_restart_state, &py_sync_context, &py_preferredmaximumlength)) {
40601 0 : return false;
40602 : }
40603 :
40604 0 : if (py_logon_server == NULL) {
40605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
40606 0 : return false;
40607 : }
40608 0 : r->in.logon_server = talloc_ptrtype(r, r->in.logon_server);
40609 0 : if (r->in.logon_server == NULL) {
40610 0 : PyErr_NoMemory();
40611 0 : return false;
40612 : }
40613 : {
40614 : const char *test_str;
40615 : const char *talloc_str;
40616 0 : PyObject *unicode = NULL;
40617 0 : if (PyUnicode_Check(py_logon_server)) {
40618 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
40619 0 : if (unicode == NULL) {
40620 0 : PyErr_NoMemory();
40621 0 : return false;
40622 : }
40623 0 : test_str = PyBytes_AS_STRING(unicode);
40624 0 : } else if (PyBytes_Check(py_logon_server)) {
40625 0 : test_str = PyBytes_AS_STRING(py_logon_server);
40626 : } else {
40627 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
40628 0 : return false;
40629 : }
40630 0 : talloc_str = talloc_strdup(r, test_str);
40631 0 : if (unicode != NULL) {
40632 0 : Py_DECREF(unicode);
40633 : }
40634 0 : if (talloc_str == NULL) {
40635 0 : PyErr_NoMemory();
40636 0 : return false;
40637 : }
40638 0 : r->in.logon_server = talloc_str;
40639 : }
40640 0 : if (py_computername == NULL) {
40641 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername");
40642 0 : return false;
40643 : }
40644 0 : r->in.computername = talloc_ptrtype(r, r->in.computername);
40645 0 : if (r->in.computername == NULL) {
40646 0 : PyErr_NoMemory();
40647 0 : return false;
40648 : }
40649 : {
40650 : const char *test_str;
40651 : const char *talloc_str;
40652 0 : PyObject *unicode = NULL;
40653 0 : if (PyUnicode_Check(py_computername)) {
40654 0 : unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore");
40655 0 : if (unicode == NULL) {
40656 0 : PyErr_NoMemory();
40657 0 : return false;
40658 : }
40659 0 : test_str = PyBytes_AS_STRING(unicode);
40660 0 : } else if (PyBytes_Check(py_computername)) {
40661 0 : test_str = PyBytes_AS_STRING(py_computername);
40662 : } else {
40663 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->tp_name);
40664 0 : return false;
40665 : }
40666 0 : talloc_str = talloc_strdup(r, test_str);
40667 0 : if (unicode != NULL) {
40668 0 : Py_DECREF(unicode);
40669 : }
40670 0 : if (talloc_str == NULL) {
40671 0 : PyErr_NoMemory();
40672 0 : return false;
40673 : }
40674 0 : r->in.computername = talloc_str;
40675 : }
40676 0 : if (py_credential == NULL) {
40677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
40678 0 : return false;
40679 : }
40680 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
40681 0 : if (r->in.credential == NULL) {
40682 0 : PyErr_NoMemory();
40683 0 : return false;
40684 : }
40685 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
40686 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
40687 0 : PyErr_NoMemory();
40688 0 : return false;
40689 : }
40690 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
40691 0 : if (py_return_authenticator == NULL) {
40692 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
40693 0 : return false;
40694 : }
40695 0 : r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator);
40696 0 : if (r->in.return_authenticator == NULL) {
40697 0 : PyErr_NoMemory();
40698 0 : return false;
40699 : }
40700 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
40701 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
40702 0 : PyErr_NoMemory();
40703 0 : return false;
40704 : }
40705 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
40706 0 : if (py_database_id == NULL) {
40707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.database_id");
40708 0 : return false;
40709 : }
40710 : {
40711 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.database_id));
40712 0 : if (PyLong_Check(py_database_id)) {
40713 : unsigned long long test_var;
40714 0 : test_var = PyLong_AsUnsignedLongLong(py_database_id);
40715 0 : if (PyErr_Occurred() != NULL) {
40716 0 : return false;
40717 : }
40718 0 : if (test_var > uint_max) {
40719 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40720 : PyLong_Type.tp_name, uint_max, test_var);
40721 0 : return false;
40722 : }
40723 0 : r->in.database_id = test_var;
40724 : } else {
40725 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40726 : PyLong_Type.tp_name);
40727 0 : return false;
40728 : }
40729 : }
40730 0 : if (py_restart_state == NULL) {
40731 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.restart_state");
40732 0 : return false;
40733 : }
40734 : {
40735 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.restart_state));
40736 0 : if (PyLong_Check(py_restart_state)) {
40737 : unsigned long long test_var;
40738 0 : test_var = PyLong_AsUnsignedLongLong(py_restart_state);
40739 0 : if (PyErr_Occurred() != NULL) {
40740 0 : return false;
40741 : }
40742 0 : if (test_var > uint_max) {
40743 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40744 : PyLong_Type.tp_name, uint_max, test_var);
40745 0 : return false;
40746 : }
40747 0 : r->in.restart_state = test_var;
40748 : } else {
40749 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40750 : PyLong_Type.tp_name);
40751 0 : return false;
40752 : }
40753 : }
40754 0 : if (py_sync_context == NULL) {
40755 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sync_context");
40756 0 : return false;
40757 : }
40758 0 : r->in.sync_context = talloc_ptrtype(r, r->in.sync_context);
40759 0 : if (r->in.sync_context == NULL) {
40760 0 : PyErr_NoMemory();
40761 0 : return false;
40762 : }
40763 : {
40764 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.sync_context));
40765 0 : if (PyLong_Check(py_sync_context)) {
40766 : unsigned long long test_var;
40767 0 : test_var = PyLong_AsUnsignedLongLong(py_sync_context);
40768 0 : if (PyErr_Occurred() != NULL) {
40769 0 : return false;
40770 : }
40771 0 : if (test_var > uint_max) {
40772 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40773 : PyLong_Type.tp_name, uint_max, test_var);
40774 0 : return false;
40775 : }
40776 0 : *r->in.sync_context = test_var;
40777 : } else {
40778 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40779 : PyLong_Type.tp_name);
40780 0 : return false;
40781 : }
40782 : }
40783 0 : if (py_preferredmaximumlength == NULL) {
40784 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.preferredmaximumlength");
40785 0 : return false;
40786 : }
40787 : {
40788 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.preferredmaximumlength));
40789 0 : if (PyLong_Check(py_preferredmaximumlength)) {
40790 : unsigned long long test_var;
40791 0 : test_var = PyLong_AsUnsignedLongLong(py_preferredmaximumlength);
40792 0 : if (PyErr_Occurred() != NULL) {
40793 0 : return false;
40794 : }
40795 0 : if (test_var > uint_max) {
40796 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40797 : PyLong_Type.tp_name, uint_max, test_var);
40798 0 : return false;
40799 : }
40800 0 : r->in.preferredmaximumlength = test_var;
40801 : } else {
40802 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40803 : PyLong_Type.tp_name);
40804 0 : return false;
40805 : }
40806 : }
40807 0 : return true;
40808 : }
40809 :
40810 0 : static PyObject *unpack_py_netr_DatabaseSync2_args_out(struct netr_DatabaseSync2 *r)
40811 : {
40812 : PyObject *result;
40813 : PyObject *py_return_authenticator;
40814 : PyObject *py_sync_context;
40815 : PyObject *py_delta_enum_array;
40816 0 : result = PyTuple_New(3);
40817 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
40818 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
40819 0 : py_sync_context = PyLong_FromUnsignedLongLong((uint32_t)*r->out.sync_context);
40820 0 : PyTuple_SetItem(result, 1, py_sync_context);
40821 0 : if (*r->out.delta_enum_array == NULL) {
40822 0 : py_delta_enum_array = Py_None;
40823 0 : Py_INCREF(py_delta_enum_array);
40824 : } else {
40825 0 : py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *r->out.delta_enum_array, *r->out.delta_enum_array);
40826 : }
40827 0 : PyTuple_SetItem(result, 2, py_delta_enum_array);
40828 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40829 0 : PyErr_SetNTSTATUS(r->out.result);
40830 0 : return NULL;
40831 : }
40832 :
40833 0 : return result;
40834 : }
40835 :
40836 :
40837 0 : static PyObject *py_netr_DatabaseRedo_in_get_logon_server(PyObject *obj, void *closure)
40838 : {
40839 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
40840 : PyObject *py_logon_server;
40841 0 : if (object->in.logon_server == NULL) {
40842 0 : Py_RETURN_NONE;
40843 : }
40844 0 : if (object->in.logon_server == NULL) {
40845 0 : py_logon_server = Py_None;
40846 0 : Py_INCREF(py_logon_server);
40847 : } else {
40848 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
40849 : }
40850 0 : return py_logon_server;
40851 : }
40852 :
40853 0 : static int py_netr_DatabaseRedo_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
40854 : {
40855 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
40856 0 : if (value == NULL) {
40857 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
40858 0 : return -1;
40859 : }
40860 0 : object->in.logon_server = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon_server);
40861 0 : if (object->in.logon_server == NULL) {
40862 0 : PyErr_NoMemory();
40863 0 : return -1;
40864 : }
40865 : {
40866 : const char *test_str;
40867 : const char *talloc_str;
40868 0 : PyObject *unicode = NULL;
40869 0 : if (PyUnicode_Check(value)) {
40870 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
40871 0 : if (unicode == NULL) {
40872 0 : PyErr_NoMemory();
40873 0 : return -1;
40874 : }
40875 0 : test_str = PyBytes_AS_STRING(unicode);
40876 0 : } else if (PyBytes_Check(value)) {
40877 0 : test_str = PyBytes_AS_STRING(value);
40878 : } else {
40879 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
40880 0 : return -1;
40881 : }
40882 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
40883 0 : if (unicode != NULL) {
40884 0 : Py_DECREF(unicode);
40885 : }
40886 0 : if (talloc_str == NULL) {
40887 0 : PyErr_NoMemory();
40888 0 : return -1;
40889 : }
40890 0 : object->in.logon_server = talloc_str;
40891 : }
40892 0 : return 0;
40893 : }
40894 :
40895 0 : static PyObject *py_netr_DatabaseRedo_in_get_computername(PyObject *obj, void *closure)
40896 : {
40897 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
40898 : PyObject *py_computername;
40899 0 : if (object->in.computername == NULL) {
40900 0 : Py_RETURN_NONE;
40901 : }
40902 0 : if (object->in.computername == NULL) {
40903 0 : py_computername = Py_None;
40904 0 : Py_INCREF(py_computername);
40905 : } else {
40906 0 : py_computername = PyUnicode_Decode(object->in.computername, strlen(object->in.computername), "utf-8", "ignore");
40907 : }
40908 0 : return py_computername;
40909 : }
40910 :
40911 0 : static int py_netr_DatabaseRedo_in_set_computername(PyObject *py_obj, PyObject *value, void *closure)
40912 : {
40913 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
40914 0 : if (value == NULL) {
40915 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computername");
40916 0 : return -1;
40917 : }
40918 0 : object->in.computername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computername);
40919 0 : if (object->in.computername == NULL) {
40920 0 : PyErr_NoMemory();
40921 0 : return -1;
40922 : }
40923 : {
40924 : const char *test_str;
40925 : const char *talloc_str;
40926 0 : PyObject *unicode = NULL;
40927 0 : if (PyUnicode_Check(value)) {
40928 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
40929 0 : if (unicode == NULL) {
40930 0 : PyErr_NoMemory();
40931 0 : return -1;
40932 : }
40933 0 : test_str = PyBytes_AS_STRING(unicode);
40934 0 : } else if (PyBytes_Check(value)) {
40935 0 : test_str = PyBytes_AS_STRING(value);
40936 : } else {
40937 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
40938 0 : return -1;
40939 : }
40940 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
40941 0 : if (unicode != NULL) {
40942 0 : Py_DECREF(unicode);
40943 : }
40944 0 : if (talloc_str == NULL) {
40945 0 : PyErr_NoMemory();
40946 0 : return -1;
40947 : }
40948 0 : object->in.computername = talloc_str;
40949 : }
40950 0 : return 0;
40951 : }
40952 :
40953 0 : static PyObject *py_netr_DatabaseRedo_in_get_credential(PyObject *obj, void *closure)
40954 : {
40955 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
40956 : PyObject *py_credential;
40957 0 : if (object->in.credential == NULL) {
40958 0 : Py_RETURN_NONE;
40959 : }
40960 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
40961 0 : return py_credential;
40962 : }
40963 :
40964 0 : static int py_netr_DatabaseRedo_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
40965 : {
40966 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
40967 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
40968 0 : if (value == NULL) {
40969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
40970 0 : return -1;
40971 : }
40972 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
40973 0 : if (object->in.credential == NULL) {
40974 0 : PyErr_NoMemory();
40975 0 : return -1;
40976 : }
40977 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
40978 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40979 0 : PyErr_NoMemory();
40980 0 : return -1;
40981 : }
40982 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
40983 0 : return 0;
40984 : }
40985 :
40986 0 : static PyObject *py_netr_DatabaseRedo_in_get_return_authenticator(PyObject *obj, void *closure)
40987 : {
40988 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
40989 : PyObject *py_return_authenticator;
40990 0 : if (object->in.return_authenticator == NULL) {
40991 0 : Py_RETURN_NONE;
40992 : }
40993 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
40994 0 : return py_return_authenticator;
40995 : }
40996 :
40997 0 : static int py_netr_DatabaseRedo_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
40998 : {
40999 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41000 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
41001 0 : if (value == NULL) {
41002 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
41003 0 : return -1;
41004 : }
41005 0 : object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator);
41006 0 : if (object->in.return_authenticator == NULL) {
41007 0 : PyErr_NoMemory();
41008 0 : return -1;
41009 : }
41010 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
41011 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41012 0 : PyErr_NoMemory();
41013 0 : return -1;
41014 : }
41015 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
41016 0 : return 0;
41017 : }
41018 :
41019 0 : static PyObject *py_netr_DatabaseRedo_out_get_return_authenticator(PyObject *obj, void *closure)
41020 : {
41021 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
41022 : PyObject *py_return_authenticator;
41023 0 : if (object->out.return_authenticator == NULL) {
41024 0 : Py_RETURN_NONE;
41025 : }
41026 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
41027 0 : return py_return_authenticator;
41028 : }
41029 :
41030 0 : static int py_netr_DatabaseRedo_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
41031 : {
41032 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41033 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
41034 0 : if (value == NULL) {
41035 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
41036 0 : return -1;
41037 : }
41038 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
41039 0 : if (object->out.return_authenticator == NULL) {
41040 0 : PyErr_NoMemory();
41041 0 : return -1;
41042 : }
41043 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
41044 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41045 0 : PyErr_NoMemory();
41046 0 : return -1;
41047 : }
41048 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
41049 0 : return 0;
41050 : }
41051 :
41052 0 : static PyObject *py_netr_DatabaseRedo_in_get_change_log_entry(PyObject *obj, void *closure)
41053 : {
41054 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
41055 : PyObject *py_change_log_entry;
41056 0 : py_change_log_entry = pytalloc_reference_ex(&netr_ChangeLogEntry_Type, pytalloc_get_mem_ctx(obj), &object->in.change_log_entry);
41057 0 : return py_change_log_entry;
41058 : }
41059 :
41060 0 : static int py_netr_DatabaseRedo_in_set_change_log_entry(PyObject *py_obj, PyObject *value, void *closure)
41061 : {
41062 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41063 0 : if (value == NULL) {
41064 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.change_log_entry");
41065 0 : return -1;
41066 : }
41067 0 : PY_CHECK_TYPE(&netr_ChangeLogEntry_Type, value, return -1;);
41068 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41069 0 : PyErr_NoMemory();
41070 0 : return -1;
41071 : }
41072 0 : object->in.change_log_entry = *(struct netr_ChangeLogEntry *)pytalloc_get_ptr(value);
41073 0 : return 0;
41074 : }
41075 :
41076 0 : static PyObject *py_netr_DatabaseRedo_in_get_change_log_entry_size(PyObject *obj, void *closure)
41077 : {
41078 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
41079 : PyObject *py_change_log_entry_size;
41080 0 : py_change_log_entry_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.change_log_entry_size);
41081 0 : return py_change_log_entry_size;
41082 : }
41083 :
41084 0 : static int py_netr_DatabaseRedo_in_set_change_log_entry_size(PyObject *py_obj, PyObject *value, void *closure)
41085 : {
41086 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41087 0 : if (value == NULL) {
41088 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.change_log_entry_size");
41089 0 : return -1;
41090 : }
41091 : {
41092 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.change_log_entry_size));
41093 0 : if (PyLong_Check(value)) {
41094 : unsigned long long test_var;
41095 0 : test_var = PyLong_AsUnsignedLongLong(value);
41096 0 : if (PyErr_Occurred() != NULL) {
41097 0 : return -1;
41098 : }
41099 0 : if (test_var > uint_max) {
41100 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41101 : PyLong_Type.tp_name, uint_max, test_var);
41102 0 : return -1;
41103 : }
41104 0 : object->in.change_log_entry_size = test_var;
41105 : } else {
41106 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41107 : PyLong_Type.tp_name);
41108 0 : return -1;
41109 : }
41110 : }
41111 0 : return 0;
41112 : }
41113 :
41114 0 : static PyObject *py_netr_DatabaseRedo_out_get_delta_enum_array(PyObject *obj, void *closure)
41115 : {
41116 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
41117 : PyObject *py_delta_enum_array;
41118 0 : if (object->out.delta_enum_array == NULL) {
41119 0 : Py_RETURN_NONE;
41120 : }
41121 0 : if (*object->out.delta_enum_array == NULL) {
41122 0 : py_delta_enum_array = Py_None;
41123 0 : Py_INCREF(py_delta_enum_array);
41124 : } else {
41125 0 : py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *object->out.delta_enum_array, *object->out.delta_enum_array);
41126 : }
41127 0 : return py_delta_enum_array;
41128 : }
41129 :
41130 0 : static int py_netr_DatabaseRedo_out_set_delta_enum_array(PyObject *py_obj, PyObject *value, void *closure)
41131 : {
41132 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41133 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.delta_enum_array));
41134 0 : if (value == NULL) {
41135 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.delta_enum_array");
41136 0 : return -1;
41137 : }
41138 0 : object->out.delta_enum_array = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.delta_enum_array);
41139 0 : if (object->out.delta_enum_array == NULL) {
41140 0 : PyErr_NoMemory();
41141 0 : return -1;
41142 : }
41143 0 : if (value == Py_None) {
41144 0 : *object->out.delta_enum_array = NULL;
41145 : } else {
41146 0 : *object->out.delta_enum_array = NULL;
41147 0 : PY_CHECK_TYPE(&netr_DELTA_ENUM_ARRAY_Type, value, return -1;);
41148 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41149 0 : PyErr_NoMemory();
41150 0 : return -1;
41151 : }
41152 0 : *object->out.delta_enum_array = (struct netr_DELTA_ENUM_ARRAY *)pytalloc_get_ptr(value);
41153 : }
41154 0 : return 0;
41155 : }
41156 :
41157 0 : static PyObject *py_netr_DatabaseRedo_get_result(PyObject *obj, void *closure)
41158 : {
41159 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(obj);
41160 : PyObject *py_result;
41161 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
41162 0 : return py_result;
41163 : }
41164 :
41165 0 : static int py_netr_DatabaseRedo_set_result(PyObject *py_obj, PyObject *value, void *closure)
41166 : {
41167 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41168 0 : if (value == NULL) {
41169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
41170 0 : return -1;
41171 : }
41172 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
41173 0 : return 0;
41174 : }
41175 :
41176 : static PyGetSetDef py_netr_DatabaseRedo_getsetters[] = {
41177 : {
41178 : .name = discard_const_p(char, "in_logon_server"),
41179 : .get = py_netr_DatabaseRedo_in_get_logon_server,
41180 : .set = py_netr_DatabaseRedo_in_set_logon_server,
41181 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
41182 : },
41183 : {
41184 : .name = discard_const_p(char, "in_computername"),
41185 : .get = py_netr_DatabaseRedo_in_get_computername,
41186 : .set = py_netr_DatabaseRedo_in_set_computername,
41187 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
41188 : },
41189 : {
41190 : .name = discard_const_p(char, "in_credential"),
41191 : .get = py_netr_DatabaseRedo_in_get_credential,
41192 : .set = py_netr_DatabaseRedo_in_set_credential,
41193 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
41194 : },
41195 : {
41196 : .name = discard_const_p(char, "in_return_authenticator"),
41197 : .get = py_netr_DatabaseRedo_in_get_return_authenticator,
41198 : .set = py_netr_DatabaseRedo_in_set_return_authenticator,
41199 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
41200 : },
41201 : {
41202 : .name = discard_const_p(char, "out_return_authenticator"),
41203 : .get = py_netr_DatabaseRedo_out_get_return_authenticator,
41204 : .set = py_netr_DatabaseRedo_out_set_return_authenticator,
41205 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
41206 : },
41207 : {
41208 : .name = discard_const_p(char, "in_change_log_entry"),
41209 : .get = py_netr_DatabaseRedo_in_get_change_log_entry,
41210 : .set = py_netr_DatabaseRedo_in_set_change_log_entry,
41211 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_ChangeLogEntry")
41212 : },
41213 : {
41214 : .name = discard_const_p(char, "in_change_log_entry_size"),
41215 : .get = py_netr_DatabaseRedo_in_get_change_log_entry_size,
41216 : .set = py_netr_DatabaseRedo_in_set_change_log_entry_size,
41217 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41218 : },
41219 : {
41220 : .name = discard_const_p(char, "out_delta_enum_array"),
41221 : .get = py_netr_DatabaseRedo_out_get_delta_enum_array,
41222 : .set = py_netr_DatabaseRedo_out_set_delta_enum_array,
41223 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DELTA_ENUM_ARRAY")
41224 : },
41225 : {
41226 : .name = discard_const_p(char, "result"),
41227 : .get = py_netr_DatabaseRedo_get_result,
41228 : .set = py_netr_DatabaseRedo_set_result,
41229 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
41230 : },
41231 : { .name = NULL }
41232 : };
41233 :
41234 0 : static PyObject *py_netr_DatabaseRedo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41235 : {
41236 0 : PyObject *self = pytalloc_new(struct netr_DatabaseRedo, type);
41237 0 : struct netr_DatabaseRedo *_self = (struct netr_DatabaseRedo *)pytalloc_get_ptr(self);
41238 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
41239 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
41240 0 : _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
41241 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
41242 : /* a pointer to a NULL pointer */
41243 0 : _self->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
41244 0 : return self;
41245 : }
41246 :
41247 0 : static PyObject *py_netr_DatabaseRedo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41248 : {
41249 :
41250 :
41251 0 : return PyLong_FromLong(17);
41252 : }
41253 :
41254 0 : static PyObject *py_netr_DatabaseRedo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
41255 : {
41256 0 : const struct ndr_interface_call *call = NULL;
41257 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41258 0 : PyObject *ret = NULL;
41259 0 : struct ndr_push *push = NULL;
41260 : DATA_BLOB blob;
41261 : enum ndr_err_code err;
41262 :
41263 0 : if (ndr_table_netlogon.num_calls < 18) {
41264 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseRedo_ndr_pack");
41265 0 : return NULL;
41266 : }
41267 0 : call = &ndr_table_netlogon.calls[17];
41268 :
41269 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41270 0 : if (push == NULL) {
41271 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41272 0 : return NULL;
41273 : }
41274 :
41275 0 : push->flags |= ndr_push_flags;
41276 :
41277 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41278 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41279 0 : TALLOC_FREE(push);
41280 0 : PyErr_SetNdrError(err);
41281 0 : return NULL;
41282 : }
41283 0 : blob = ndr_push_blob(push);
41284 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
41285 0 : TALLOC_FREE(push);
41286 0 : return ret;
41287 : }
41288 :
41289 0 : static PyObject *py_netr_DatabaseRedo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41290 : {
41291 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41292 0 : PyObject *bigendian_obj = NULL;
41293 0 : PyObject *ndr64_obj = NULL;
41294 0 : uint32_t ndr_push_flags = 0;
41295 :
41296 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
41297 : discard_const_p(char *, kwnames),
41298 : &bigendian_obj,
41299 : &ndr64_obj)) {
41300 0 : return NULL;
41301 : }
41302 :
41303 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41304 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41305 : }
41306 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41307 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41308 : }
41309 :
41310 0 : return py_netr_DatabaseRedo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
41311 : }
41312 :
41313 0 : static PyObject *py_netr_DatabaseRedo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41314 : {
41315 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41316 0 : PyObject *bigendian_obj = NULL;
41317 0 : PyObject *ndr64_obj = NULL;
41318 0 : uint32_t ndr_push_flags = 0;
41319 :
41320 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41321 : discard_const_p(char *, kwnames),
41322 : &bigendian_obj,
41323 : &ndr64_obj)) {
41324 0 : return NULL;
41325 : }
41326 :
41327 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41328 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41329 : }
41330 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41331 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41332 : }
41333 :
41334 0 : return py_netr_DatabaseRedo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41335 : }
41336 :
41337 0 : static PyObject *py_netr_DatabaseRedo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
41338 : {
41339 0 : const struct ndr_interface_call *call = NULL;
41340 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41341 0 : struct ndr_pull *pull = NULL;
41342 : enum ndr_err_code err;
41343 :
41344 0 : if (ndr_table_netlogon.num_calls < 18) {
41345 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseRedo_ndr_unpack");
41346 0 : return NULL;
41347 : }
41348 0 : call = &ndr_table_netlogon.calls[17];
41349 :
41350 0 : pull = ndr_pull_init_blob(blob, object);
41351 0 : if (pull == NULL) {
41352 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41353 0 : return NULL;
41354 : }
41355 :
41356 0 : pull->flags |= ndr_pull_flags;
41357 :
41358 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41359 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41360 0 : TALLOC_FREE(pull);
41361 0 : PyErr_SetNdrError(err);
41362 0 : return NULL;
41363 : }
41364 0 : if (!allow_remaining) {
41365 : uint32_t highest_ofs;
41366 :
41367 0 : if (pull->offset > pull->relative_highest_offset) {
41368 0 : highest_ofs = pull->offset;
41369 : } else {
41370 0 : highest_ofs = pull->relative_highest_offset;
41371 : }
41372 0 : if (highest_ofs < pull->data_size) {
41373 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41374 : "not all bytes consumed ofs[%u] size[%u]",
41375 : highest_ofs, pull->data_size);
41376 0 : TALLOC_FREE(pull);
41377 0 : PyErr_SetNdrError(err);
41378 0 : return NULL;
41379 : }
41380 : }
41381 :
41382 0 : TALLOC_FREE(pull);
41383 0 : Py_RETURN_NONE;
41384 : }
41385 :
41386 0 : static PyObject *py_netr_DatabaseRedo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41387 : {
41388 : DATA_BLOB blob;
41389 0 : Py_ssize_t blob_length = 0;
41390 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41391 0 : PyObject *bigendian_obj = NULL;
41392 0 : PyObject *ndr64_obj = NULL;
41393 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41394 0 : PyObject *allow_remaining_obj = NULL;
41395 0 : bool allow_remaining = false;
41396 :
41397 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41398 : discard_const_p(char *, kwnames),
41399 : &blob.data, &blob_length,
41400 : &bigendian_obj,
41401 : &ndr64_obj,
41402 : &allow_remaining_obj)) {
41403 0 : return NULL;
41404 : }
41405 0 : blob.length = blob_length;
41406 :
41407 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41408 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41409 : }
41410 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41411 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41412 : }
41413 :
41414 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41415 0 : allow_remaining = true;
41416 : }
41417 :
41418 0 : return py_netr_DatabaseRedo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41419 : }
41420 :
41421 0 : static PyObject *py_netr_DatabaseRedo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41422 : {
41423 : DATA_BLOB blob;
41424 0 : Py_ssize_t blob_length = 0;
41425 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41426 0 : PyObject *bigendian_obj = NULL;
41427 0 : PyObject *ndr64_obj = NULL;
41428 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41429 0 : PyObject *allow_remaining_obj = NULL;
41430 0 : bool allow_remaining = false;
41431 :
41432 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41433 : discard_const_p(char *, kwnames),
41434 : &blob.data, &blob_length,
41435 : &bigendian_obj,
41436 : &ndr64_obj,
41437 : &allow_remaining_obj)) {
41438 0 : return NULL;
41439 : }
41440 0 : blob.length = blob_length;
41441 :
41442 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41443 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41444 : }
41445 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41446 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41447 : }
41448 :
41449 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41450 0 : allow_remaining = true;
41451 : }
41452 :
41453 0 : return py_netr_DatabaseRedo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41454 : }
41455 :
41456 0 : static PyObject *py_netr_DatabaseRedo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
41457 : {
41458 0 : const struct ndr_interface_call *call = NULL;
41459 0 : struct netr_DatabaseRedo *object = (struct netr_DatabaseRedo *)pytalloc_get_ptr(py_obj);
41460 : PyObject *ret;
41461 : char *retstr;
41462 :
41463 0 : if (ndr_table_netlogon.num_calls < 18) {
41464 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DatabaseRedo_ndr_print");
41465 0 : return NULL;
41466 : }
41467 0 : call = &ndr_table_netlogon.calls[17];
41468 :
41469 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41470 0 : ret = PyUnicode_FromString(retstr);
41471 0 : TALLOC_FREE(retstr);
41472 :
41473 0 : return ret;
41474 : }
41475 :
41476 0 : static PyObject *py_netr_DatabaseRedo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41477 : {
41478 0 : return py_netr_DatabaseRedo_ndr_print(py_obj, "netr_DatabaseRedo_in", NDR_IN);
41479 : }
41480 :
41481 0 : static PyObject *py_netr_DatabaseRedo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41482 : {
41483 0 : return py_netr_DatabaseRedo_ndr_print(py_obj, "netr_DatabaseRedo_out", NDR_OUT);
41484 : }
41485 :
41486 : static PyMethodDef py_netr_DatabaseRedo_methods[] = {
41487 : { "opnum", (PyCFunction)py_netr_DatabaseRedo_ndr_opnum, METH_NOARGS|METH_CLASS,
41488 : "netlogon.netr_DatabaseRedo.opnum() -> 17 (0x11) " },
41489 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseRedo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41490 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41491 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseRedo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41492 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41493 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseRedo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41494 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41495 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DatabaseRedo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41496 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41497 : { "__ndr_print_in__", (PyCFunction)py_netr_DatabaseRedo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41498 : { "__ndr_print_out__", (PyCFunction)py_netr_DatabaseRedo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41499 : { NULL, NULL, 0, NULL }
41500 : };
41501 :
41502 :
41503 : static PyTypeObject netr_DatabaseRedo_Type = {
41504 : PyVarObject_HEAD_INIT(NULL, 0)
41505 : .tp_name = "netlogon.netr_DatabaseRedo",
41506 : .tp_getset = py_netr_DatabaseRedo_getsetters,
41507 : .tp_methods = py_netr_DatabaseRedo_methods,
41508 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41509 : .tp_new = py_netr_DatabaseRedo_new,
41510 : };
41511 :
41512 0 : static bool pack_py_netr_DatabaseRedo_args_in(PyObject *args, PyObject *kwargs, struct netr_DatabaseRedo *r)
41513 : {
41514 : PyObject *py_logon_server;
41515 : PyObject *py_computername;
41516 : PyObject *py_credential;
41517 : PyObject *py_return_authenticator;
41518 : PyObject *py_change_log_entry;
41519 : PyObject *py_change_log_entry_size;
41520 0 : const char *kwnames[] = {
41521 : "logon_server", "computername", "credential", "return_authenticator", "change_log_entry", "change_log_entry_size", NULL
41522 : };
41523 :
41524 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_DatabaseRedo", discard_const_p(char *, kwnames), &py_logon_server, &py_computername, &py_credential, &py_return_authenticator, &py_change_log_entry, &py_change_log_entry_size)) {
41525 0 : return false;
41526 : }
41527 :
41528 0 : if (py_logon_server == NULL) {
41529 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
41530 0 : return false;
41531 : }
41532 0 : r->in.logon_server = talloc_ptrtype(r, r->in.logon_server);
41533 0 : if (r->in.logon_server == NULL) {
41534 0 : PyErr_NoMemory();
41535 0 : return false;
41536 : }
41537 : {
41538 : const char *test_str;
41539 : const char *talloc_str;
41540 0 : PyObject *unicode = NULL;
41541 0 : if (PyUnicode_Check(py_logon_server)) {
41542 0 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
41543 0 : if (unicode == NULL) {
41544 0 : PyErr_NoMemory();
41545 0 : return false;
41546 : }
41547 0 : test_str = PyBytes_AS_STRING(unicode);
41548 0 : } else if (PyBytes_Check(py_logon_server)) {
41549 0 : test_str = PyBytes_AS_STRING(py_logon_server);
41550 : } else {
41551 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
41552 0 : return false;
41553 : }
41554 0 : talloc_str = talloc_strdup(r, test_str);
41555 0 : if (unicode != NULL) {
41556 0 : Py_DECREF(unicode);
41557 : }
41558 0 : if (talloc_str == NULL) {
41559 0 : PyErr_NoMemory();
41560 0 : return false;
41561 : }
41562 0 : r->in.logon_server = talloc_str;
41563 : }
41564 0 : if (py_computername == NULL) {
41565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computername");
41566 0 : return false;
41567 : }
41568 0 : r->in.computername = talloc_ptrtype(r, r->in.computername);
41569 0 : if (r->in.computername == NULL) {
41570 0 : PyErr_NoMemory();
41571 0 : return false;
41572 : }
41573 : {
41574 : const char *test_str;
41575 : const char *talloc_str;
41576 0 : PyObject *unicode = NULL;
41577 0 : if (PyUnicode_Check(py_computername)) {
41578 0 : unicode = PyUnicode_AsEncodedString(py_computername, "utf-8", "ignore");
41579 0 : if (unicode == NULL) {
41580 0 : PyErr_NoMemory();
41581 0 : return false;
41582 : }
41583 0 : test_str = PyBytes_AS_STRING(unicode);
41584 0 : } else if (PyBytes_Check(py_computername)) {
41585 0 : test_str = PyBytes_AS_STRING(py_computername);
41586 : } else {
41587 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computername)->tp_name);
41588 0 : return false;
41589 : }
41590 0 : talloc_str = talloc_strdup(r, test_str);
41591 0 : if (unicode != NULL) {
41592 0 : Py_DECREF(unicode);
41593 : }
41594 0 : if (talloc_str == NULL) {
41595 0 : PyErr_NoMemory();
41596 0 : return false;
41597 : }
41598 0 : r->in.computername = talloc_str;
41599 : }
41600 0 : if (py_credential == NULL) {
41601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
41602 0 : return false;
41603 : }
41604 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
41605 0 : if (r->in.credential == NULL) {
41606 0 : PyErr_NoMemory();
41607 0 : return false;
41608 : }
41609 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
41610 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
41611 0 : PyErr_NoMemory();
41612 0 : return false;
41613 : }
41614 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
41615 0 : if (py_return_authenticator == NULL) {
41616 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
41617 0 : return false;
41618 : }
41619 0 : r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator);
41620 0 : if (r->in.return_authenticator == NULL) {
41621 0 : PyErr_NoMemory();
41622 0 : return false;
41623 : }
41624 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
41625 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
41626 0 : PyErr_NoMemory();
41627 0 : return false;
41628 : }
41629 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
41630 0 : if (py_change_log_entry == NULL) {
41631 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.change_log_entry");
41632 0 : return false;
41633 : }
41634 0 : PY_CHECK_TYPE(&netr_ChangeLogEntry_Type, py_change_log_entry, return false;);
41635 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_change_log_entry)) == NULL) {
41636 0 : PyErr_NoMemory();
41637 0 : return false;
41638 : }
41639 0 : r->in.change_log_entry = *(struct netr_ChangeLogEntry *)pytalloc_get_ptr(py_change_log_entry);
41640 0 : if (py_change_log_entry_size == NULL) {
41641 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.change_log_entry_size");
41642 0 : return false;
41643 : }
41644 : {
41645 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.change_log_entry_size));
41646 0 : if (PyLong_Check(py_change_log_entry_size)) {
41647 : unsigned long long test_var;
41648 0 : test_var = PyLong_AsUnsignedLongLong(py_change_log_entry_size);
41649 0 : if (PyErr_Occurred() != NULL) {
41650 0 : return false;
41651 : }
41652 0 : if (test_var > uint_max) {
41653 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41654 : PyLong_Type.tp_name, uint_max, test_var);
41655 0 : return false;
41656 : }
41657 0 : r->in.change_log_entry_size = test_var;
41658 : } else {
41659 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41660 : PyLong_Type.tp_name);
41661 0 : return false;
41662 : }
41663 : }
41664 0 : return true;
41665 : }
41666 :
41667 0 : static PyObject *unpack_py_netr_DatabaseRedo_args_out(struct netr_DatabaseRedo *r)
41668 : {
41669 : PyObject *result;
41670 : PyObject *py_return_authenticator;
41671 : PyObject *py_delta_enum_array;
41672 0 : result = PyTuple_New(2);
41673 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
41674 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
41675 0 : if (*r->out.delta_enum_array == NULL) {
41676 0 : py_delta_enum_array = Py_None;
41677 0 : Py_INCREF(py_delta_enum_array);
41678 : } else {
41679 0 : py_delta_enum_array = pytalloc_reference_ex(&netr_DELTA_ENUM_ARRAY_Type, *r->out.delta_enum_array, *r->out.delta_enum_array);
41680 : }
41681 0 : PyTuple_SetItem(result, 1, py_delta_enum_array);
41682 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
41683 0 : PyErr_SetNTSTATUS(r->out.result);
41684 0 : return NULL;
41685 : }
41686 :
41687 0 : return result;
41688 : }
41689 :
41690 :
41691 0 : static PyObject *py_netr_LogonControl2Ex_in_get_logon_server(PyObject *obj, void *closure)
41692 : {
41693 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj);
41694 : PyObject *py_logon_server;
41695 0 : if (object->in.logon_server == NULL) {
41696 0 : Py_RETURN_NONE;
41697 : }
41698 0 : if (object->in.logon_server == NULL) {
41699 0 : py_logon_server = Py_None;
41700 0 : Py_INCREF(py_logon_server);
41701 : } else {
41702 0 : if (object->in.logon_server == NULL) {
41703 0 : py_logon_server = Py_None;
41704 0 : Py_INCREF(py_logon_server);
41705 : } else {
41706 0 : py_logon_server = PyUnicode_Decode(object->in.logon_server, strlen(object->in.logon_server), "utf-8", "ignore");
41707 : }
41708 : }
41709 0 : return py_logon_server;
41710 : }
41711 :
41712 0 : static int py_netr_LogonControl2Ex_in_set_logon_server(PyObject *py_obj, PyObject *value, void *closure)
41713 : {
41714 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
41715 0 : if (value == NULL) {
41716 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_server");
41717 0 : return -1;
41718 : }
41719 0 : if (value == Py_None) {
41720 0 : object->in.logon_server = NULL;
41721 : } else {
41722 0 : object->in.logon_server = NULL;
41723 : {
41724 : const char *test_str;
41725 : const char *talloc_str;
41726 0 : PyObject *unicode = NULL;
41727 0 : if (PyUnicode_Check(value)) {
41728 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
41729 0 : if (unicode == NULL) {
41730 0 : PyErr_NoMemory();
41731 0 : return -1;
41732 : }
41733 0 : test_str = PyBytes_AS_STRING(unicode);
41734 0 : } else if (PyBytes_Check(value)) {
41735 0 : test_str = PyBytes_AS_STRING(value);
41736 : } else {
41737 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
41738 0 : return -1;
41739 : }
41740 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
41741 0 : if (unicode != NULL) {
41742 0 : Py_DECREF(unicode);
41743 : }
41744 0 : if (talloc_str == NULL) {
41745 0 : PyErr_NoMemory();
41746 0 : return -1;
41747 : }
41748 0 : object->in.logon_server = talloc_str;
41749 : }
41750 : }
41751 0 : return 0;
41752 : }
41753 :
41754 0 : static PyObject *py_netr_LogonControl2Ex_in_get_function_code(PyObject *obj, void *closure)
41755 : {
41756 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj);
41757 : PyObject *py_function_code;
41758 0 : py_function_code = PyLong_FromUnsignedLongLong((uint32_t)object->in.function_code);
41759 0 : return py_function_code;
41760 : }
41761 :
41762 0 : static int py_netr_LogonControl2Ex_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure)
41763 : {
41764 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
41765 0 : if (value == NULL) {
41766 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.function_code");
41767 0 : return -1;
41768 : }
41769 : {
41770 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.function_code));
41771 0 : if (PyLong_Check(value)) {
41772 : unsigned long long test_var;
41773 0 : test_var = PyLong_AsUnsignedLongLong(value);
41774 0 : if (PyErr_Occurred() != NULL) {
41775 0 : return -1;
41776 : }
41777 0 : if (test_var > uint_max) {
41778 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41779 : PyLong_Type.tp_name, uint_max, test_var);
41780 0 : return -1;
41781 : }
41782 0 : object->in.function_code = test_var;
41783 : } else {
41784 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41785 : PyLong_Type.tp_name);
41786 0 : return -1;
41787 : }
41788 : }
41789 0 : return 0;
41790 : }
41791 :
41792 0 : static PyObject *py_netr_LogonControl2Ex_in_get_level(PyObject *obj, void *closure)
41793 : {
41794 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj);
41795 : PyObject *py_level;
41796 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level);
41797 0 : return py_level;
41798 : }
41799 :
41800 0 : static int py_netr_LogonControl2Ex_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
41801 : {
41802 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
41803 0 : if (value == NULL) {
41804 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
41805 0 : return -1;
41806 : }
41807 : {
41808 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
41809 0 : if (PyLong_Check(value)) {
41810 : unsigned long long test_var;
41811 0 : test_var = PyLong_AsUnsignedLongLong(value);
41812 0 : if (PyErr_Occurred() != NULL) {
41813 0 : return -1;
41814 : }
41815 0 : if (test_var > uint_max) {
41816 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41817 : PyLong_Type.tp_name, uint_max, test_var);
41818 0 : return -1;
41819 : }
41820 0 : object->in.level = test_var;
41821 : } else {
41822 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41823 : PyLong_Type.tp_name);
41824 0 : return -1;
41825 : }
41826 : }
41827 0 : return 0;
41828 : }
41829 :
41830 0 : static PyObject *py_netr_LogonControl2Ex_in_get_data(PyObject *obj, void *closure)
41831 : {
41832 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj);
41833 : PyObject *py_data;
41834 0 : if (object->in.data == NULL) {
41835 0 : Py_RETURN_NONE;
41836 : }
41837 0 : py_data = pyrpc_import_union(&netr_CONTROL_DATA_INFORMATION_Type, object->in.data, object->in.function_code, object->in.data, "union netr_CONTROL_DATA_INFORMATION");
41838 0 : if (py_data == NULL) {
41839 0 : return NULL;
41840 : }
41841 0 : return py_data;
41842 : }
41843 :
41844 0 : static int py_netr_LogonControl2Ex_in_set_data(PyObject *py_obj, PyObject *value, void *closure)
41845 : {
41846 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
41847 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.data));
41848 0 : if (value == NULL) {
41849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.data");
41850 0 : return -1;
41851 : }
41852 0 : object->in.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data);
41853 0 : if (object->in.data == NULL) {
41854 0 : PyErr_NoMemory();
41855 0 : return -1;
41856 : }
41857 : {
41858 : union netr_CONTROL_DATA_INFORMATION *data_switch_1;
41859 0 : data_switch_1 = (union netr_CONTROL_DATA_INFORMATION *)pyrpc_export_union(&netr_CONTROL_DATA_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.function_code, value, "union netr_CONTROL_DATA_INFORMATION");
41860 0 : if (data_switch_1 == NULL) {
41861 0 : return -1;
41862 : }
41863 0 : object->in.data = data_switch_1;
41864 : }
41865 0 : return 0;
41866 : }
41867 :
41868 0 : static PyObject *py_netr_LogonControl2Ex_out_get_query(PyObject *obj, void *closure)
41869 : {
41870 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj);
41871 : PyObject *py_query;
41872 0 : if (object->out.query == NULL) {
41873 0 : Py_RETURN_NONE;
41874 : }
41875 0 : py_query = pyrpc_import_union(&netr_CONTROL_QUERY_INFORMATION_Type, object->out.query, object->in.level, object->out.query, "union netr_CONTROL_QUERY_INFORMATION");
41876 0 : if (py_query == NULL) {
41877 0 : return NULL;
41878 : }
41879 0 : return py_query;
41880 : }
41881 :
41882 0 : static int py_netr_LogonControl2Ex_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
41883 : {
41884 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
41885 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.query));
41886 0 : if (value == NULL) {
41887 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.query");
41888 0 : return -1;
41889 : }
41890 0 : object->out.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query);
41891 0 : if (object->out.query == NULL) {
41892 0 : PyErr_NoMemory();
41893 0 : return -1;
41894 : }
41895 : {
41896 : union netr_CONTROL_QUERY_INFORMATION *query_switch_1;
41897 0 : query_switch_1 = (union netr_CONTROL_QUERY_INFORMATION *)pyrpc_export_union(&netr_CONTROL_QUERY_INFORMATION_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_CONTROL_QUERY_INFORMATION");
41898 0 : if (query_switch_1 == NULL) {
41899 0 : return -1;
41900 : }
41901 0 : object->out.query = query_switch_1;
41902 : }
41903 0 : return 0;
41904 : }
41905 :
41906 0 : static PyObject *py_netr_LogonControl2Ex_get_result(PyObject *obj, void *closure)
41907 : {
41908 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(obj);
41909 : PyObject *py_result;
41910 0 : py_result = PyErr_FromWERROR(object->out.result);
41911 0 : return py_result;
41912 : }
41913 :
41914 0 : static int py_netr_LogonControl2Ex_set_result(PyObject *py_obj, PyObject *value, void *closure)
41915 : {
41916 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
41917 0 : if (value == NULL) {
41918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
41919 0 : return -1;
41920 : }
41921 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
41922 0 : return 0;
41923 : }
41924 :
41925 : static PyGetSetDef py_netr_LogonControl2Ex_getsetters[] = {
41926 : {
41927 : .name = discard_const_p(char, "in_logon_server"),
41928 : .get = py_netr_LogonControl2Ex_in_get_logon_server,
41929 : .set = py_netr_LogonControl2Ex_in_set_logon_server,
41930 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
41931 : },
41932 : {
41933 : .name = discard_const_p(char, "in_function_code"),
41934 : .get = py_netr_LogonControl2Ex_in_get_function_code,
41935 : .set = py_netr_LogonControl2Ex_in_set_function_code,
41936 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonControlCode")
41937 : },
41938 : {
41939 : .name = discard_const_p(char, "in_level"),
41940 : .get = py_netr_LogonControl2Ex_in_get_level,
41941 : .set = py_netr_LogonControl2Ex_in_set_level,
41942 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41943 : },
41944 : {
41945 : .name = discard_const_p(char, "in_data"),
41946 : .get = py_netr_LogonControl2Ex_in_get_data,
41947 : .set = py_netr_LogonControl2Ex_in_set_data,
41948 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_DATA_INFORMATION")
41949 : },
41950 : {
41951 : .name = discard_const_p(char, "out_query"),
41952 : .get = py_netr_LogonControl2Ex_out_get_query,
41953 : .set = py_netr_LogonControl2Ex_out_set_query,
41954 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_QUERY_INFORMATION")
41955 : },
41956 : {
41957 : .name = discard_const_p(char, "result"),
41958 : .get = py_netr_LogonControl2Ex_get_result,
41959 : .set = py_netr_LogonControl2Ex_set_result,
41960 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
41961 : },
41962 : { .name = NULL }
41963 : };
41964 :
41965 0 : static PyObject *py_netr_LogonControl2Ex_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41966 : {
41967 0 : PyObject *self = pytalloc_new(struct netr_LogonControl2Ex, type);
41968 0 : struct netr_LogonControl2Ex *_self = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(self);
41969 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
41970 0 : _self->in.data = talloc_zero(mem_ctx, union netr_CONTROL_DATA_INFORMATION);
41971 0 : _self->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
41972 0 : return self;
41973 : }
41974 :
41975 0 : static PyObject *py_netr_LogonControl2Ex_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41976 : {
41977 :
41978 :
41979 0 : return PyLong_FromLong(18);
41980 : }
41981 :
41982 0 : static PyObject *py_netr_LogonControl2Ex_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
41983 : {
41984 0 : const struct ndr_interface_call *call = NULL;
41985 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
41986 0 : PyObject *ret = NULL;
41987 0 : struct ndr_push *push = NULL;
41988 : DATA_BLOB blob;
41989 : enum ndr_err_code err;
41990 :
41991 0 : if (ndr_table_netlogon.num_calls < 19) {
41992 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2Ex_ndr_pack");
41993 0 : return NULL;
41994 : }
41995 0 : call = &ndr_table_netlogon.calls[18];
41996 :
41997 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41998 0 : if (push == NULL) {
41999 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42000 0 : return NULL;
42001 : }
42002 :
42003 0 : push->flags |= ndr_push_flags;
42004 :
42005 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42006 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42007 0 : TALLOC_FREE(push);
42008 0 : PyErr_SetNdrError(err);
42009 0 : return NULL;
42010 : }
42011 0 : blob = ndr_push_blob(push);
42012 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42013 0 : TALLOC_FREE(push);
42014 0 : return ret;
42015 : }
42016 :
42017 0 : static PyObject *py_netr_LogonControl2Ex_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42018 : {
42019 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42020 0 : PyObject *bigendian_obj = NULL;
42021 0 : PyObject *ndr64_obj = NULL;
42022 0 : uint32_t ndr_push_flags = 0;
42023 :
42024 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42025 : discard_const_p(char *, kwnames),
42026 : &bigendian_obj,
42027 : &ndr64_obj)) {
42028 0 : return NULL;
42029 : }
42030 :
42031 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42032 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42033 : }
42034 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42035 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42036 : }
42037 :
42038 0 : return py_netr_LogonControl2Ex_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42039 : }
42040 :
42041 0 : static PyObject *py_netr_LogonControl2Ex_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42042 : {
42043 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42044 0 : PyObject *bigendian_obj = NULL;
42045 0 : PyObject *ndr64_obj = NULL;
42046 0 : uint32_t ndr_push_flags = 0;
42047 :
42048 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42049 : discard_const_p(char *, kwnames),
42050 : &bigendian_obj,
42051 : &ndr64_obj)) {
42052 0 : return NULL;
42053 : }
42054 :
42055 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42056 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42057 : }
42058 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42059 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42060 : }
42061 :
42062 0 : return py_netr_LogonControl2Ex_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42063 : }
42064 :
42065 0 : static PyObject *py_netr_LogonControl2Ex_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
42066 : {
42067 0 : const struct ndr_interface_call *call = NULL;
42068 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
42069 0 : struct ndr_pull *pull = NULL;
42070 : enum ndr_err_code err;
42071 :
42072 0 : if (ndr_table_netlogon.num_calls < 19) {
42073 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2Ex_ndr_unpack");
42074 0 : return NULL;
42075 : }
42076 0 : call = &ndr_table_netlogon.calls[18];
42077 :
42078 0 : pull = ndr_pull_init_blob(blob, object);
42079 0 : if (pull == NULL) {
42080 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42081 0 : return NULL;
42082 : }
42083 :
42084 0 : pull->flags |= ndr_pull_flags;
42085 :
42086 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42087 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42088 0 : TALLOC_FREE(pull);
42089 0 : PyErr_SetNdrError(err);
42090 0 : return NULL;
42091 : }
42092 0 : if (!allow_remaining) {
42093 : uint32_t highest_ofs;
42094 :
42095 0 : if (pull->offset > pull->relative_highest_offset) {
42096 0 : highest_ofs = pull->offset;
42097 : } else {
42098 0 : highest_ofs = pull->relative_highest_offset;
42099 : }
42100 0 : if (highest_ofs < pull->data_size) {
42101 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42102 : "not all bytes consumed ofs[%u] size[%u]",
42103 : highest_ofs, pull->data_size);
42104 0 : TALLOC_FREE(pull);
42105 0 : PyErr_SetNdrError(err);
42106 0 : return NULL;
42107 : }
42108 : }
42109 :
42110 0 : TALLOC_FREE(pull);
42111 0 : Py_RETURN_NONE;
42112 : }
42113 :
42114 0 : static PyObject *py_netr_LogonControl2Ex_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42115 : {
42116 : DATA_BLOB blob;
42117 0 : Py_ssize_t blob_length = 0;
42118 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42119 0 : PyObject *bigendian_obj = NULL;
42120 0 : PyObject *ndr64_obj = NULL;
42121 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42122 0 : PyObject *allow_remaining_obj = NULL;
42123 0 : bool allow_remaining = false;
42124 :
42125 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42126 : discard_const_p(char *, kwnames),
42127 : &blob.data, &blob_length,
42128 : &bigendian_obj,
42129 : &ndr64_obj,
42130 : &allow_remaining_obj)) {
42131 0 : return NULL;
42132 : }
42133 0 : blob.length = blob_length;
42134 :
42135 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42136 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42137 : }
42138 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42139 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42140 : }
42141 :
42142 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42143 0 : allow_remaining = true;
42144 : }
42145 :
42146 0 : return py_netr_LogonControl2Ex_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42147 : }
42148 :
42149 0 : static PyObject *py_netr_LogonControl2Ex_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42150 : {
42151 : DATA_BLOB blob;
42152 0 : Py_ssize_t blob_length = 0;
42153 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42154 0 : PyObject *bigendian_obj = NULL;
42155 0 : PyObject *ndr64_obj = NULL;
42156 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42157 0 : PyObject *allow_remaining_obj = NULL;
42158 0 : bool allow_remaining = false;
42159 :
42160 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42161 : discard_const_p(char *, kwnames),
42162 : &blob.data, &blob_length,
42163 : &bigendian_obj,
42164 : &ndr64_obj,
42165 : &allow_remaining_obj)) {
42166 0 : return NULL;
42167 : }
42168 0 : blob.length = blob_length;
42169 :
42170 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42171 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42172 : }
42173 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42174 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42175 : }
42176 :
42177 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42178 0 : allow_remaining = true;
42179 : }
42180 :
42181 0 : return py_netr_LogonControl2Ex_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42182 : }
42183 :
42184 0 : static PyObject *py_netr_LogonControl2Ex_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
42185 : {
42186 0 : const struct ndr_interface_call *call = NULL;
42187 0 : struct netr_LogonControl2Ex *object = (struct netr_LogonControl2Ex *)pytalloc_get_ptr(py_obj);
42188 : PyObject *ret;
42189 : char *retstr;
42190 :
42191 0 : if (ndr_table_netlogon.num_calls < 19) {
42192 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonControl2Ex_ndr_print");
42193 0 : return NULL;
42194 : }
42195 0 : call = &ndr_table_netlogon.calls[18];
42196 :
42197 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42198 0 : ret = PyUnicode_FromString(retstr);
42199 0 : TALLOC_FREE(retstr);
42200 :
42201 0 : return ret;
42202 : }
42203 :
42204 0 : static PyObject *py_netr_LogonControl2Ex_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42205 : {
42206 0 : return py_netr_LogonControl2Ex_ndr_print(py_obj, "netr_LogonControl2Ex_in", NDR_IN);
42207 : }
42208 :
42209 0 : static PyObject *py_netr_LogonControl2Ex_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42210 : {
42211 0 : return py_netr_LogonControl2Ex_ndr_print(py_obj, "netr_LogonControl2Ex_out", NDR_OUT);
42212 : }
42213 :
42214 : static PyMethodDef py_netr_LogonControl2Ex_methods[] = {
42215 : { "opnum", (PyCFunction)py_netr_LogonControl2Ex_ndr_opnum, METH_NOARGS|METH_CLASS,
42216 : "netlogon.netr_LogonControl2Ex.opnum() -> 18 (0x12) " },
42217 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2Ex_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42218 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42219 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2Ex_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42220 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42221 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2Ex_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42222 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42223 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonControl2Ex_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42224 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42225 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonControl2Ex_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42226 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonControl2Ex_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42227 : { NULL, NULL, 0, NULL }
42228 : };
42229 :
42230 :
42231 : static PyTypeObject netr_LogonControl2Ex_Type = {
42232 : PyVarObject_HEAD_INIT(NULL, 0)
42233 : .tp_name = "netlogon.netr_LogonControl2Ex",
42234 : .tp_getset = py_netr_LogonControl2Ex_getsetters,
42235 : .tp_methods = py_netr_LogonControl2Ex_methods,
42236 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42237 : .tp_new = py_netr_LogonControl2Ex_new,
42238 : };
42239 :
42240 81 : static bool pack_py_netr_LogonControl2Ex_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonControl2Ex *r)
42241 : {
42242 : PyObject *py_logon_server;
42243 : PyObject *py_function_code;
42244 : PyObject *py_level;
42245 : PyObject *py_data;
42246 81 : const char *kwnames[] = {
42247 : "logon_server", "function_code", "level", "data", NULL
42248 : };
42249 :
42250 81 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:netr_LogonControl2Ex", discard_const_p(char *, kwnames), &py_logon_server, &py_function_code, &py_level, &py_data)) {
42251 0 : return false;
42252 : }
42253 :
42254 81 : if (py_logon_server == NULL) {
42255 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_server");
42256 0 : return false;
42257 : }
42258 81 : if (py_logon_server == Py_None) {
42259 0 : r->in.logon_server = NULL;
42260 : } else {
42261 81 : r->in.logon_server = NULL;
42262 : {
42263 : const char *test_str;
42264 : const char *talloc_str;
42265 81 : PyObject *unicode = NULL;
42266 81 : if (PyUnicode_Check(py_logon_server)) {
42267 81 : unicode = PyUnicode_AsEncodedString(py_logon_server, "utf-8", "ignore");
42268 81 : if (unicode == NULL) {
42269 0 : PyErr_NoMemory();
42270 0 : return false;
42271 : }
42272 81 : test_str = PyBytes_AS_STRING(unicode);
42273 0 : } else if (PyBytes_Check(py_logon_server)) {
42274 0 : test_str = PyBytes_AS_STRING(py_logon_server);
42275 : } else {
42276 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_logon_server)->tp_name);
42277 0 : return false;
42278 : }
42279 81 : talloc_str = talloc_strdup(r, test_str);
42280 81 : if (unicode != NULL) {
42281 81 : Py_DECREF(unicode);
42282 : }
42283 81 : if (talloc_str == NULL) {
42284 0 : PyErr_NoMemory();
42285 0 : return false;
42286 : }
42287 81 : r->in.logon_server = talloc_str;
42288 : }
42289 : }
42290 81 : if (py_function_code == NULL) {
42291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.function_code");
42292 0 : return false;
42293 : }
42294 : {
42295 81 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.function_code));
42296 81 : if (PyLong_Check(py_function_code)) {
42297 : unsigned long long test_var;
42298 81 : test_var = PyLong_AsUnsignedLongLong(py_function_code);
42299 81 : if (PyErr_Occurred() != NULL) {
42300 0 : return false;
42301 : }
42302 81 : if (test_var > uint_max) {
42303 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42304 : PyLong_Type.tp_name, uint_max, test_var);
42305 0 : return false;
42306 : }
42307 81 : r->in.function_code = test_var;
42308 : } else {
42309 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42310 : PyLong_Type.tp_name);
42311 0 : return false;
42312 : }
42313 : }
42314 81 : if (py_level == NULL) {
42315 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
42316 0 : return false;
42317 : }
42318 : {
42319 81 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
42320 81 : if (PyLong_Check(py_level)) {
42321 : unsigned long long test_var;
42322 81 : test_var = PyLong_AsUnsignedLongLong(py_level);
42323 81 : if (PyErr_Occurred() != NULL) {
42324 0 : return false;
42325 : }
42326 81 : if (test_var > uint_max) {
42327 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42328 : PyLong_Type.tp_name, uint_max, test_var);
42329 0 : return false;
42330 : }
42331 81 : r->in.level = test_var;
42332 : } else {
42333 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42334 : PyLong_Type.tp_name);
42335 0 : return false;
42336 : }
42337 : }
42338 81 : if (py_data == NULL) {
42339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.data");
42340 0 : return false;
42341 : }
42342 81 : r->in.data = talloc_ptrtype(r, r->in.data);
42343 81 : if (r->in.data == NULL) {
42344 0 : PyErr_NoMemory();
42345 0 : return false;
42346 : }
42347 : {
42348 : union netr_CONTROL_DATA_INFORMATION *data_switch_1;
42349 81 : data_switch_1 = (union netr_CONTROL_DATA_INFORMATION *)pyrpc_export_union(&netr_CONTROL_DATA_INFORMATION_Type, r, r->in.function_code, py_data, "union netr_CONTROL_DATA_INFORMATION");
42350 81 : if (data_switch_1 == NULL) {
42351 0 : return false;
42352 : }
42353 81 : r->in.data = data_switch_1;
42354 : }
42355 81 : return true;
42356 : }
42357 :
42358 81 : static PyObject *unpack_py_netr_LogonControl2Ex_args_out(struct netr_LogonControl2Ex *r)
42359 : {
42360 : PyObject *result;
42361 : PyObject *py_query;
42362 81 : py_query = pyrpc_import_union(&netr_CONTROL_QUERY_INFORMATION_Type, r->out.query, r->in.level, r->out.query, "union netr_CONTROL_QUERY_INFORMATION");
42363 81 : if (py_query == NULL) {
42364 0 : return NULL;
42365 : }
42366 81 : result = py_query;
42367 81 : if (!W_ERROR_IS_OK(r->out.result)) {
42368 0 : PyErr_SetWERROR(r->out.result);
42369 0 : return NULL;
42370 : }
42371 :
42372 81 : return result;
42373 : }
42374 :
42375 :
42376 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_in_get_server_name(PyObject *obj, void *closure)
42377 : {
42378 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(obj);
42379 : PyObject *py_server_name;
42380 0 : if (object->in.server_name == NULL) {
42381 0 : Py_RETURN_NONE;
42382 : }
42383 0 : if (object->in.server_name == NULL) {
42384 0 : py_server_name = Py_None;
42385 0 : Py_INCREF(py_server_name);
42386 : } else {
42387 0 : if (object->in.server_name == NULL) {
42388 0 : py_server_name = Py_None;
42389 0 : Py_INCREF(py_server_name);
42390 : } else {
42391 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
42392 : }
42393 : }
42394 0 : return py_server_name;
42395 : }
42396 :
42397 0 : static int py_netr_NetrEnumerateTrustedDomains_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
42398 : {
42399 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj);
42400 0 : if (value == NULL) {
42401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
42402 0 : return -1;
42403 : }
42404 0 : if (value == Py_None) {
42405 0 : object->in.server_name = NULL;
42406 : } else {
42407 0 : object->in.server_name = NULL;
42408 : {
42409 : const char *test_str;
42410 : const char *talloc_str;
42411 0 : PyObject *unicode = NULL;
42412 0 : if (PyUnicode_Check(value)) {
42413 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
42414 0 : if (unicode == NULL) {
42415 0 : PyErr_NoMemory();
42416 0 : return -1;
42417 : }
42418 0 : test_str = PyBytes_AS_STRING(unicode);
42419 0 : } else if (PyBytes_Check(value)) {
42420 0 : test_str = PyBytes_AS_STRING(value);
42421 : } else {
42422 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
42423 0 : return -1;
42424 : }
42425 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
42426 0 : if (unicode != NULL) {
42427 0 : Py_DECREF(unicode);
42428 : }
42429 0 : if (talloc_str == NULL) {
42430 0 : PyErr_NoMemory();
42431 0 : return -1;
42432 : }
42433 0 : object->in.server_name = talloc_str;
42434 : }
42435 : }
42436 0 : return 0;
42437 : }
42438 :
42439 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_out_get_trusted_domains_blob(PyObject *obj, void *closure)
42440 : {
42441 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(obj);
42442 : PyObject *py_trusted_domains_blob;
42443 0 : if (object->out.trusted_domains_blob == NULL) {
42444 0 : Py_RETURN_NONE;
42445 : }
42446 0 : py_trusted_domains_blob = pytalloc_reference_ex(&netr_Blob_Type, object->out.trusted_domains_blob, object->out.trusted_domains_blob);
42447 0 : return py_trusted_domains_blob;
42448 : }
42449 :
42450 0 : static int py_netr_NetrEnumerateTrustedDomains_out_set_trusted_domains_blob(PyObject *py_obj, PyObject *value, void *closure)
42451 : {
42452 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj);
42453 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trusted_domains_blob));
42454 0 : if (value == NULL) {
42455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trusted_domains_blob");
42456 0 : return -1;
42457 : }
42458 0 : object->out.trusted_domains_blob = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trusted_domains_blob);
42459 0 : if (object->out.trusted_domains_blob == NULL) {
42460 0 : PyErr_NoMemory();
42461 0 : return -1;
42462 : }
42463 0 : PY_CHECK_TYPE(&netr_Blob_Type, value, return -1;);
42464 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42465 0 : PyErr_NoMemory();
42466 0 : return -1;
42467 : }
42468 0 : object->out.trusted_domains_blob = (struct netr_Blob *)pytalloc_get_ptr(value);
42469 0 : return 0;
42470 : }
42471 :
42472 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_get_result(PyObject *obj, void *closure)
42473 : {
42474 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(obj);
42475 : PyObject *py_result;
42476 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
42477 0 : return py_result;
42478 : }
42479 :
42480 0 : static int py_netr_NetrEnumerateTrustedDomains_set_result(PyObject *py_obj, PyObject *value, void *closure)
42481 : {
42482 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj);
42483 0 : if (value == NULL) {
42484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
42485 0 : return -1;
42486 : }
42487 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
42488 0 : return 0;
42489 : }
42490 :
42491 : static PyGetSetDef py_netr_NetrEnumerateTrustedDomains_getsetters[] = {
42492 : {
42493 : .name = discard_const_p(char, "in_server_name"),
42494 : .get = py_netr_NetrEnumerateTrustedDomains_in_get_server_name,
42495 : .set = py_netr_NetrEnumerateTrustedDomains_in_set_server_name,
42496 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
42497 : },
42498 : {
42499 : .name = discard_const_p(char, "out_trusted_domains_blob"),
42500 : .get = py_netr_NetrEnumerateTrustedDomains_out_get_trusted_domains_blob,
42501 : .set = py_netr_NetrEnumerateTrustedDomains_out_set_trusted_domains_blob,
42502 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Blob")
42503 : },
42504 : {
42505 : .name = discard_const_p(char, "result"),
42506 : .get = py_netr_NetrEnumerateTrustedDomains_get_result,
42507 : .set = py_netr_NetrEnumerateTrustedDomains_set_result,
42508 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
42509 : },
42510 : { .name = NULL }
42511 : };
42512 :
42513 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42514 : {
42515 0 : PyObject *self = pytalloc_new(struct netr_NetrEnumerateTrustedDomains, type);
42516 0 : struct netr_NetrEnumerateTrustedDomains *_self = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(self);
42517 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42518 0 : _self->out.trusted_domains_blob = talloc_zero(mem_ctx, struct netr_Blob);
42519 0 : return self;
42520 : }
42521 :
42522 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42523 : {
42524 :
42525 :
42526 0 : return PyLong_FromLong(19);
42527 : }
42528 :
42529 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
42530 : {
42531 0 : const struct ndr_interface_call *call = NULL;
42532 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj);
42533 0 : PyObject *ret = NULL;
42534 0 : struct ndr_push *push = NULL;
42535 : DATA_BLOB blob;
42536 : enum ndr_err_code err;
42537 :
42538 0 : if (ndr_table_netlogon.num_calls < 20) {
42539 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomains_ndr_pack");
42540 0 : return NULL;
42541 : }
42542 0 : call = &ndr_table_netlogon.calls[19];
42543 :
42544 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42545 0 : if (push == NULL) {
42546 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42547 0 : return NULL;
42548 : }
42549 :
42550 0 : push->flags |= ndr_push_flags;
42551 :
42552 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42553 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42554 0 : TALLOC_FREE(push);
42555 0 : PyErr_SetNdrError(err);
42556 0 : return NULL;
42557 : }
42558 0 : blob = ndr_push_blob(push);
42559 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42560 0 : TALLOC_FREE(push);
42561 0 : return ret;
42562 : }
42563 :
42564 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42565 : {
42566 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42567 0 : PyObject *bigendian_obj = NULL;
42568 0 : PyObject *ndr64_obj = NULL;
42569 0 : uint32_t ndr_push_flags = 0;
42570 :
42571 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42572 : discard_const_p(char *, kwnames),
42573 : &bigendian_obj,
42574 : &ndr64_obj)) {
42575 0 : return NULL;
42576 : }
42577 :
42578 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42579 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42580 : }
42581 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42582 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42583 : }
42584 :
42585 0 : return py_netr_NetrEnumerateTrustedDomains_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42586 : }
42587 :
42588 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42589 : {
42590 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42591 0 : PyObject *bigendian_obj = NULL;
42592 0 : PyObject *ndr64_obj = NULL;
42593 0 : uint32_t ndr_push_flags = 0;
42594 :
42595 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42596 : discard_const_p(char *, kwnames),
42597 : &bigendian_obj,
42598 : &ndr64_obj)) {
42599 0 : return NULL;
42600 : }
42601 :
42602 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42603 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42604 : }
42605 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42606 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42607 : }
42608 :
42609 0 : return py_netr_NetrEnumerateTrustedDomains_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42610 : }
42611 :
42612 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
42613 : {
42614 0 : const struct ndr_interface_call *call = NULL;
42615 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj);
42616 0 : struct ndr_pull *pull = NULL;
42617 : enum ndr_err_code err;
42618 :
42619 0 : if (ndr_table_netlogon.num_calls < 20) {
42620 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomains_ndr_unpack");
42621 0 : return NULL;
42622 : }
42623 0 : call = &ndr_table_netlogon.calls[19];
42624 :
42625 0 : pull = ndr_pull_init_blob(blob, object);
42626 0 : if (pull == NULL) {
42627 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42628 0 : return NULL;
42629 : }
42630 :
42631 0 : pull->flags |= ndr_pull_flags;
42632 :
42633 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42634 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42635 0 : TALLOC_FREE(pull);
42636 0 : PyErr_SetNdrError(err);
42637 0 : return NULL;
42638 : }
42639 0 : if (!allow_remaining) {
42640 : uint32_t highest_ofs;
42641 :
42642 0 : if (pull->offset > pull->relative_highest_offset) {
42643 0 : highest_ofs = pull->offset;
42644 : } else {
42645 0 : highest_ofs = pull->relative_highest_offset;
42646 : }
42647 0 : if (highest_ofs < pull->data_size) {
42648 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42649 : "not all bytes consumed ofs[%u] size[%u]",
42650 : highest_ofs, pull->data_size);
42651 0 : TALLOC_FREE(pull);
42652 0 : PyErr_SetNdrError(err);
42653 0 : return NULL;
42654 : }
42655 : }
42656 :
42657 0 : TALLOC_FREE(pull);
42658 0 : Py_RETURN_NONE;
42659 : }
42660 :
42661 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42662 : {
42663 : DATA_BLOB blob;
42664 0 : Py_ssize_t blob_length = 0;
42665 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42666 0 : PyObject *bigendian_obj = NULL;
42667 0 : PyObject *ndr64_obj = NULL;
42668 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42669 0 : PyObject *allow_remaining_obj = NULL;
42670 0 : bool allow_remaining = false;
42671 :
42672 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42673 : discard_const_p(char *, kwnames),
42674 : &blob.data, &blob_length,
42675 : &bigendian_obj,
42676 : &ndr64_obj,
42677 : &allow_remaining_obj)) {
42678 0 : return NULL;
42679 : }
42680 0 : blob.length = blob_length;
42681 :
42682 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42683 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42684 : }
42685 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42686 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42687 : }
42688 :
42689 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42690 0 : allow_remaining = true;
42691 : }
42692 :
42693 0 : return py_netr_NetrEnumerateTrustedDomains_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42694 : }
42695 :
42696 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42697 : {
42698 : DATA_BLOB blob;
42699 0 : Py_ssize_t blob_length = 0;
42700 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42701 0 : PyObject *bigendian_obj = NULL;
42702 0 : PyObject *ndr64_obj = NULL;
42703 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42704 0 : PyObject *allow_remaining_obj = NULL;
42705 0 : bool allow_remaining = false;
42706 :
42707 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42708 : discard_const_p(char *, kwnames),
42709 : &blob.data, &blob_length,
42710 : &bigendian_obj,
42711 : &ndr64_obj,
42712 : &allow_remaining_obj)) {
42713 0 : return NULL;
42714 : }
42715 0 : blob.length = blob_length;
42716 :
42717 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42718 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42719 : }
42720 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42721 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42722 : }
42723 :
42724 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42725 0 : allow_remaining = true;
42726 : }
42727 :
42728 0 : return py_netr_NetrEnumerateTrustedDomains_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42729 : }
42730 :
42731 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
42732 : {
42733 0 : const struct ndr_interface_call *call = NULL;
42734 0 : struct netr_NetrEnumerateTrustedDomains *object = (struct netr_NetrEnumerateTrustedDomains *)pytalloc_get_ptr(py_obj);
42735 : PyObject *ret;
42736 : char *retstr;
42737 :
42738 0 : if (ndr_table_netlogon.num_calls < 20) {
42739 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomains_ndr_print");
42740 0 : return NULL;
42741 : }
42742 0 : call = &ndr_table_netlogon.calls[19];
42743 :
42744 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42745 0 : ret = PyUnicode_FromString(retstr);
42746 0 : TALLOC_FREE(retstr);
42747 :
42748 0 : return ret;
42749 : }
42750 :
42751 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42752 : {
42753 0 : return py_netr_NetrEnumerateTrustedDomains_ndr_print(py_obj, "netr_NetrEnumerateTrustedDomains_in", NDR_IN);
42754 : }
42755 :
42756 0 : static PyObject *py_netr_NetrEnumerateTrustedDomains_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42757 : {
42758 0 : return py_netr_NetrEnumerateTrustedDomains_ndr_print(py_obj, "netr_NetrEnumerateTrustedDomains_out", NDR_OUT);
42759 : }
42760 :
42761 : static PyMethodDef py_netr_NetrEnumerateTrustedDomains_methods[] = {
42762 : { "opnum", (PyCFunction)py_netr_NetrEnumerateTrustedDomains_ndr_opnum, METH_NOARGS|METH_CLASS,
42763 : "netlogon.netr_NetrEnumerateTrustedDomains.opnum() -> 19 (0x13) " },
42764 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomains_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42765 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42766 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomains_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42767 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42768 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomains_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42769 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42770 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomains_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42771 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42772 : { "__ndr_print_in__", (PyCFunction)py_netr_NetrEnumerateTrustedDomains_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42773 : { "__ndr_print_out__", (PyCFunction)py_netr_NetrEnumerateTrustedDomains_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42774 : { NULL, NULL, 0, NULL }
42775 : };
42776 :
42777 :
42778 : static PyTypeObject netr_NetrEnumerateTrustedDomains_Type = {
42779 : PyVarObject_HEAD_INIT(NULL, 0)
42780 : .tp_name = "netlogon.netr_NetrEnumerateTrustedDomains",
42781 : .tp_getset = py_netr_NetrEnumerateTrustedDomains_getsetters,
42782 : .tp_methods = py_netr_NetrEnumerateTrustedDomains_methods,
42783 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42784 : .tp_new = py_netr_NetrEnumerateTrustedDomains_new,
42785 : };
42786 :
42787 0 : static bool pack_py_netr_NetrEnumerateTrustedDomains_args_in(PyObject *args, PyObject *kwargs, struct netr_NetrEnumerateTrustedDomains *r)
42788 : {
42789 : PyObject *py_server_name;
42790 0 : const char *kwnames[] = {
42791 : "server_name", NULL
42792 : };
42793 :
42794 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:netr_NetrEnumerateTrustedDomains", discard_const_p(char *, kwnames), &py_server_name)) {
42795 0 : return false;
42796 : }
42797 :
42798 0 : if (py_server_name == NULL) {
42799 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
42800 0 : return false;
42801 : }
42802 0 : if (py_server_name == Py_None) {
42803 0 : r->in.server_name = NULL;
42804 : } else {
42805 0 : r->in.server_name = NULL;
42806 : {
42807 : const char *test_str;
42808 : const char *talloc_str;
42809 0 : PyObject *unicode = NULL;
42810 0 : if (PyUnicode_Check(py_server_name)) {
42811 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
42812 0 : if (unicode == NULL) {
42813 0 : PyErr_NoMemory();
42814 0 : return false;
42815 : }
42816 0 : test_str = PyBytes_AS_STRING(unicode);
42817 0 : } else if (PyBytes_Check(py_server_name)) {
42818 0 : test_str = PyBytes_AS_STRING(py_server_name);
42819 : } else {
42820 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
42821 0 : return false;
42822 : }
42823 0 : talloc_str = talloc_strdup(r, test_str);
42824 0 : if (unicode != NULL) {
42825 0 : Py_DECREF(unicode);
42826 : }
42827 0 : if (talloc_str == NULL) {
42828 0 : PyErr_NoMemory();
42829 0 : return false;
42830 : }
42831 0 : r->in.server_name = talloc_str;
42832 : }
42833 : }
42834 0 : return true;
42835 : }
42836 :
42837 0 : static PyObject *unpack_py_netr_NetrEnumerateTrustedDomains_args_out(struct netr_NetrEnumerateTrustedDomains *r)
42838 : {
42839 : PyObject *result;
42840 : PyObject *py_trusted_domains_blob;
42841 0 : py_trusted_domains_blob = pytalloc_reference_ex(&netr_Blob_Type, r->out.trusted_domains_blob, r->out.trusted_domains_blob);
42842 0 : result = py_trusted_domains_blob;
42843 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
42844 0 : PyErr_SetNTSTATUS(r->out.result);
42845 0 : return NULL;
42846 : }
42847 :
42848 0 : return result;
42849 : }
42850 :
42851 :
42852 0 : static PyObject *py_netr_DsRGetDCName_in_get_server_unc(PyObject *obj, void *closure)
42853 : {
42854 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj);
42855 : PyObject *py_server_unc;
42856 0 : if (object->in.server_unc == NULL) {
42857 0 : Py_RETURN_NONE;
42858 : }
42859 0 : if (object->in.server_unc == NULL) {
42860 0 : py_server_unc = Py_None;
42861 0 : Py_INCREF(py_server_unc);
42862 : } else {
42863 0 : if (object->in.server_unc == NULL) {
42864 0 : py_server_unc = Py_None;
42865 0 : Py_INCREF(py_server_unc);
42866 : } else {
42867 0 : py_server_unc = PyUnicode_Decode(object->in.server_unc, strlen(object->in.server_unc), "utf-8", "ignore");
42868 : }
42869 : }
42870 0 : return py_server_unc;
42871 : }
42872 :
42873 0 : static int py_netr_DsRGetDCName_in_set_server_unc(PyObject *py_obj, PyObject *value, void *closure)
42874 : {
42875 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
42876 0 : if (value == NULL) {
42877 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_unc");
42878 0 : return -1;
42879 : }
42880 0 : if (value == Py_None) {
42881 0 : object->in.server_unc = NULL;
42882 : } else {
42883 0 : object->in.server_unc = NULL;
42884 : {
42885 : const char *test_str;
42886 : const char *talloc_str;
42887 0 : PyObject *unicode = NULL;
42888 0 : if (PyUnicode_Check(value)) {
42889 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
42890 0 : if (unicode == NULL) {
42891 0 : PyErr_NoMemory();
42892 0 : return -1;
42893 : }
42894 0 : test_str = PyBytes_AS_STRING(unicode);
42895 0 : } else if (PyBytes_Check(value)) {
42896 0 : test_str = PyBytes_AS_STRING(value);
42897 : } else {
42898 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
42899 0 : return -1;
42900 : }
42901 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
42902 0 : if (unicode != NULL) {
42903 0 : Py_DECREF(unicode);
42904 : }
42905 0 : if (talloc_str == NULL) {
42906 0 : PyErr_NoMemory();
42907 0 : return -1;
42908 : }
42909 0 : object->in.server_unc = talloc_str;
42910 : }
42911 : }
42912 0 : return 0;
42913 : }
42914 :
42915 0 : static PyObject *py_netr_DsRGetDCName_in_get_domain_name(PyObject *obj, void *closure)
42916 : {
42917 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj);
42918 : PyObject *py_domain_name;
42919 0 : if (object->in.domain_name == NULL) {
42920 0 : Py_RETURN_NONE;
42921 : }
42922 0 : if (object->in.domain_name == NULL) {
42923 0 : py_domain_name = Py_None;
42924 0 : Py_INCREF(py_domain_name);
42925 : } else {
42926 0 : if (object->in.domain_name == NULL) {
42927 0 : py_domain_name = Py_None;
42928 0 : Py_INCREF(py_domain_name);
42929 : } else {
42930 0 : py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
42931 : }
42932 : }
42933 0 : return py_domain_name;
42934 : }
42935 :
42936 0 : static int py_netr_DsRGetDCName_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
42937 : {
42938 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
42939 0 : if (value == NULL) {
42940 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
42941 0 : return -1;
42942 : }
42943 0 : if (value == Py_None) {
42944 0 : object->in.domain_name = NULL;
42945 : } else {
42946 0 : object->in.domain_name = NULL;
42947 : {
42948 : const char *test_str;
42949 : const char *talloc_str;
42950 0 : PyObject *unicode = NULL;
42951 0 : if (PyUnicode_Check(value)) {
42952 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
42953 0 : if (unicode == NULL) {
42954 0 : PyErr_NoMemory();
42955 0 : return -1;
42956 : }
42957 0 : test_str = PyBytes_AS_STRING(unicode);
42958 0 : } else if (PyBytes_Check(value)) {
42959 0 : test_str = PyBytes_AS_STRING(value);
42960 : } else {
42961 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
42962 0 : return -1;
42963 : }
42964 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
42965 0 : if (unicode != NULL) {
42966 0 : Py_DECREF(unicode);
42967 : }
42968 0 : if (talloc_str == NULL) {
42969 0 : PyErr_NoMemory();
42970 0 : return -1;
42971 : }
42972 0 : object->in.domain_name = talloc_str;
42973 : }
42974 : }
42975 0 : return 0;
42976 : }
42977 :
42978 0 : static PyObject *py_netr_DsRGetDCName_in_get_domain_guid(PyObject *obj, void *closure)
42979 : {
42980 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj);
42981 : PyObject *py_domain_guid;
42982 0 : if (object->in.domain_guid == NULL) {
42983 0 : Py_RETURN_NONE;
42984 : }
42985 0 : if (object->in.domain_guid == NULL) {
42986 0 : py_domain_guid = Py_None;
42987 0 : Py_INCREF(py_domain_guid);
42988 : } else {
42989 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, object->in.domain_guid, object->in.domain_guid);
42990 : }
42991 0 : return py_domain_guid;
42992 : }
42993 :
42994 0 : static int py_netr_DsRGetDCName_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
42995 : {
42996 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
42997 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_guid));
42998 0 : if (value == NULL) {
42999 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_guid");
43000 0 : return -1;
43001 : }
43002 0 : if (value == Py_None) {
43003 0 : object->in.domain_guid = NULL;
43004 : } else {
43005 0 : object->in.domain_guid = NULL;
43006 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
43007 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43008 0 : PyErr_NoMemory();
43009 0 : return -1;
43010 : }
43011 0 : object->in.domain_guid = (struct GUID *)pytalloc_get_ptr(value);
43012 : }
43013 0 : return 0;
43014 : }
43015 :
43016 0 : static PyObject *py_netr_DsRGetDCName_in_get_site_guid(PyObject *obj, void *closure)
43017 : {
43018 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj);
43019 : PyObject *py_site_guid;
43020 0 : if (object->in.site_guid == NULL) {
43021 0 : Py_RETURN_NONE;
43022 : }
43023 0 : if (object->in.site_guid == NULL) {
43024 0 : py_site_guid = Py_None;
43025 0 : Py_INCREF(py_site_guid);
43026 : } else {
43027 0 : py_site_guid = pytalloc_reference_ex(GUID_Type, object->in.site_guid, object->in.site_guid);
43028 : }
43029 0 : return py_site_guid;
43030 : }
43031 :
43032 0 : static int py_netr_DsRGetDCName_in_set_site_guid(PyObject *py_obj, PyObject *value, void *closure)
43033 : {
43034 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
43035 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.site_guid));
43036 0 : if (value == NULL) {
43037 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_guid");
43038 0 : return -1;
43039 : }
43040 0 : if (value == Py_None) {
43041 0 : object->in.site_guid = NULL;
43042 : } else {
43043 0 : object->in.site_guid = NULL;
43044 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
43045 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43046 0 : PyErr_NoMemory();
43047 0 : return -1;
43048 : }
43049 0 : object->in.site_guid = (struct GUID *)pytalloc_get_ptr(value);
43050 : }
43051 0 : return 0;
43052 : }
43053 :
43054 0 : static PyObject *py_netr_DsRGetDCName_in_get_flags(PyObject *obj, void *closure)
43055 : {
43056 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj);
43057 : PyObject *py_flags;
43058 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
43059 0 : return py_flags;
43060 : }
43061 :
43062 0 : static int py_netr_DsRGetDCName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
43063 : {
43064 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
43065 0 : if (value == NULL) {
43066 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
43067 0 : return -1;
43068 : }
43069 : {
43070 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
43071 0 : if (PyLong_Check(value)) {
43072 : unsigned long long test_var;
43073 0 : test_var = PyLong_AsUnsignedLongLong(value);
43074 0 : if (PyErr_Occurred() != NULL) {
43075 0 : return -1;
43076 : }
43077 0 : if (test_var > uint_max) {
43078 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43079 : PyLong_Type.tp_name, uint_max, test_var);
43080 0 : return -1;
43081 : }
43082 0 : object->in.flags = test_var;
43083 : } else {
43084 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43085 : PyLong_Type.tp_name);
43086 0 : return -1;
43087 : }
43088 : }
43089 0 : return 0;
43090 : }
43091 :
43092 0 : static PyObject *py_netr_DsRGetDCName_out_get_info(PyObject *obj, void *closure)
43093 : {
43094 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj);
43095 : PyObject *py_info;
43096 0 : if (object->out.info == NULL) {
43097 0 : Py_RETURN_NONE;
43098 : }
43099 0 : if (*object->out.info == NULL) {
43100 0 : py_info = Py_None;
43101 0 : Py_INCREF(py_info);
43102 : } else {
43103 0 : py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *object->out.info, *object->out.info);
43104 : }
43105 0 : return py_info;
43106 : }
43107 :
43108 0 : static int py_netr_DsRGetDCName_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
43109 : {
43110 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
43111 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
43112 0 : if (value == NULL) {
43113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
43114 0 : return -1;
43115 : }
43116 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
43117 0 : if (object->out.info == NULL) {
43118 0 : PyErr_NoMemory();
43119 0 : return -1;
43120 : }
43121 0 : if (value == Py_None) {
43122 0 : *object->out.info = NULL;
43123 : } else {
43124 0 : *object->out.info = NULL;
43125 0 : PY_CHECK_TYPE(&netr_DsRGetDCNameInfo_Type, value, return -1;);
43126 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43127 0 : PyErr_NoMemory();
43128 0 : return -1;
43129 : }
43130 0 : *object->out.info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value);
43131 : }
43132 0 : return 0;
43133 : }
43134 :
43135 0 : static PyObject *py_netr_DsRGetDCName_get_result(PyObject *obj, void *closure)
43136 : {
43137 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(obj);
43138 : PyObject *py_result;
43139 0 : py_result = PyErr_FromWERROR(object->out.result);
43140 0 : return py_result;
43141 : }
43142 :
43143 0 : static int py_netr_DsRGetDCName_set_result(PyObject *py_obj, PyObject *value, void *closure)
43144 : {
43145 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
43146 0 : if (value == NULL) {
43147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
43148 0 : return -1;
43149 : }
43150 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
43151 0 : return 0;
43152 : }
43153 :
43154 : static PyGetSetDef py_netr_DsRGetDCName_getsetters[] = {
43155 : {
43156 : .name = discard_const_p(char, "in_server_unc"),
43157 : .get = py_netr_DsRGetDCName_in_get_server_unc,
43158 : .set = py_netr_DsRGetDCName_in_set_server_unc,
43159 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
43160 : },
43161 : {
43162 : .name = discard_const_p(char, "in_domain_name"),
43163 : .get = py_netr_DsRGetDCName_in_get_domain_name,
43164 : .set = py_netr_DsRGetDCName_in_set_domain_name,
43165 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
43166 : },
43167 : {
43168 : .name = discard_const_p(char, "in_domain_guid"),
43169 : .get = py_netr_DsRGetDCName_in_get_domain_guid,
43170 : .set = py_netr_DsRGetDCName_in_set_domain_guid,
43171 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
43172 : },
43173 : {
43174 : .name = discard_const_p(char, "in_site_guid"),
43175 : .get = py_netr_DsRGetDCName_in_get_site_guid,
43176 : .set = py_netr_DsRGetDCName_in_set_site_guid,
43177 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
43178 : },
43179 : {
43180 : .name = discard_const_p(char, "in_flags"),
43181 : .get = py_netr_DsRGetDCName_in_get_flags,
43182 : .set = py_netr_DsRGetDCName_in_set_flags,
43183 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCName_flags")
43184 : },
43185 : {
43186 : .name = discard_const_p(char, "out_info"),
43187 : .get = py_netr_DsRGetDCName_out_get_info,
43188 : .set = py_netr_DsRGetDCName_out_set_info,
43189 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo")
43190 : },
43191 : {
43192 : .name = discard_const_p(char, "result"),
43193 : .get = py_netr_DsRGetDCName_get_result,
43194 : .set = py_netr_DsRGetDCName_set_result,
43195 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
43196 : },
43197 : { .name = NULL }
43198 : };
43199 :
43200 0 : static PyObject *py_netr_DsRGetDCName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43201 : {
43202 0 : PyObject *self = pytalloc_new(struct netr_DsRGetDCName, type);
43203 0 : struct netr_DsRGetDCName *_self = (struct netr_DsRGetDCName *)pytalloc_get_ptr(self);
43204 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
43205 : /* a pointer to a NULL pointer */
43206 0 : _self->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
43207 0 : return self;
43208 : }
43209 :
43210 0 : static PyObject *py_netr_DsRGetDCName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43211 : {
43212 :
43213 :
43214 0 : return PyLong_FromLong(20);
43215 : }
43216 :
43217 0 : static PyObject *py_netr_DsRGetDCName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
43218 : {
43219 0 : const struct ndr_interface_call *call = NULL;
43220 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
43221 0 : PyObject *ret = NULL;
43222 0 : struct ndr_push *push = NULL;
43223 : DATA_BLOB blob;
43224 : enum ndr_err_code err;
43225 :
43226 0 : if (ndr_table_netlogon.num_calls < 21) {
43227 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCName_ndr_pack");
43228 0 : return NULL;
43229 : }
43230 0 : call = &ndr_table_netlogon.calls[20];
43231 :
43232 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43233 0 : if (push == NULL) {
43234 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43235 0 : return NULL;
43236 : }
43237 :
43238 0 : push->flags |= ndr_push_flags;
43239 :
43240 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43241 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43242 0 : TALLOC_FREE(push);
43243 0 : PyErr_SetNdrError(err);
43244 0 : return NULL;
43245 : }
43246 0 : blob = ndr_push_blob(push);
43247 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43248 0 : TALLOC_FREE(push);
43249 0 : return ret;
43250 : }
43251 :
43252 0 : static PyObject *py_netr_DsRGetDCName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43253 : {
43254 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43255 0 : PyObject *bigendian_obj = NULL;
43256 0 : PyObject *ndr64_obj = NULL;
43257 0 : uint32_t ndr_push_flags = 0;
43258 :
43259 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43260 : discard_const_p(char *, kwnames),
43261 : &bigendian_obj,
43262 : &ndr64_obj)) {
43263 0 : return NULL;
43264 : }
43265 :
43266 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43267 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43268 : }
43269 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43270 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43271 : }
43272 :
43273 0 : return py_netr_DsRGetDCName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43274 : }
43275 :
43276 0 : static PyObject *py_netr_DsRGetDCName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43277 : {
43278 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43279 0 : PyObject *bigendian_obj = NULL;
43280 0 : PyObject *ndr64_obj = NULL;
43281 0 : uint32_t ndr_push_flags = 0;
43282 :
43283 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43284 : discard_const_p(char *, kwnames),
43285 : &bigendian_obj,
43286 : &ndr64_obj)) {
43287 0 : return NULL;
43288 : }
43289 :
43290 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43291 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43292 : }
43293 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43294 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43295 : }
43296 :
43297 0 : return py_netr_DsRGetDCName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
43298 : }
43299 :
43300 0 : static PyObject *py_netr_DsRGetDCName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
43301 : {
43302 0 : const struct ndr_interface_call *call = NULL;
43303 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
43304 0 : struct ndr_pull *pull = NULL;
43305 : enum ndr_err_code err;
43306 :
43307 0 : if (ndr_table_netlogon.num_calls < 21) {
43308 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCName_ndr_unpack");
43309 0 : return NULL;
43310 : }
43311 0 : call = &ndr_table_netlogon.calls[20];
43312 :
43313 0 : pull = ndr_pull_init_blob(blob, object);
43314 0 : if (pull == NULL) {
43315 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43316 0 : return NULL;
43317 : }
43318 :
43319 0 : pull->flags |= ndr_pull_flags;
43320 :
43321 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
43322 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43323 0 : TALLOC_FREE(pull);
43324 0 : PyErr_SetNdrError(err);
43325 0 : return NULL;
43326 : }
43327 0 : if (!allow_remaining) {
43328 : uint32_t highest_ofs;
43329 :
43330 0 : if (pull->offset > pull->relative_highest_offset) {
43331 0 : highest_ofs = pull->offset;
43332 : } else {
43333 0 : highest_ofs = pull->relative_highest_offset;
43334 : }
43335 0 : if (highest_ofs < pull->data_size) {
43336 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
43337 : "not all bytes consumed ofs[%u] size[%u]",
43338 : highest_ofs, pull->data_size);
43339 0 : TALLOC_FREE(pull);
43340 0 : PyErr_SetNdrError(err);
43341 0 : return NULL;
43342 : }
43343 : }
43344 :
43345 0 : TALLOC_FREE(pull);
43346 0 : Py_RETURN_NONE;
43347 : }
43348 :
43349 0 : static PyObject *py_netr_DsRGetDCName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43350 : {
43351 : DATA_BLOB blob;
43352 0 : Py_ssize_t blob_length = 0;
43353 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43354 0 : PyObject *bigendian_obj = NULL;
43355 0 : PyObject *ndr64_obj = NULL;
43356 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43357 0 : PyObject *allow_remaining_obj = NULL;
43358 0 : bool allow_remaining = false;
43359 :
43360 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
43361 : discard_const_p(char *, kwnames),
43362 : &blob.data, &blob_length,
43363 : &bigendian_obj,
43364 : &ndr64_obj,
43365 : &allow_remaining_obj)) {
43366 0 : return NULL;
43367 : }
43368 0 : blob.length = blob_length;
43369 :
43370 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43371 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43372 : }
43373 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43374 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43375 : }
43376 :
43377 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43378 0 : allow_remaining = true;
43379 : }
43380 :
43381 0 : return py_netr_DsRGetDCName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
43382 : }
43383 :
43384 0 : static PyObject *py_netr_DsRGetDCName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43385 : {
43386 : DATA_BLOB blob;
43387 0 : Py_ssize_t blob_length = 0;
43388 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43389 0 : PyObject *bigendian_obj = NULL;
43390 0 : PyObject *ndr64_obj = NULL;
43391 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43392 0 : PyObject *allow_remaining_obj = NULL;
43393 0 : bool allow_remaining = false;
43394 :
43395 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
43396 : discard_const_p(char *, kwnames),
43397 : &blob.data, &blob_length,
43398 : &bigendian_obj,
43399 : &ndr64_obj,
43400 : &allow_remaining_obj)) {
43401 0 : return NULL;
43402 : }
43403 0 : blob.length = blob_length;
43404 :
43405 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43406 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43407 : }
43408 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43409 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43410 : }
43411 :
43412 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43413 0 : allow_remaining = true;
43414 : }
43415 :
43416 0 : return py_netr_DsRGetDCName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
43417 : }
43418 :
43419 0 : static PyObject *py_netr_DsRGetDCName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
43420 : {
43421 0 : const struct ndr_interface_call *call = NULL;
43422 0 : struct netr_DsRGetDCName *object = (struct netr_DsRGetDCName *)pytalloc_get_ptr(py_obj);
43423 : PyObject *ret;
43424 : char *retstr;
43425 :
43426 0 : if (ndr_table_netlogon.num_calls < 21) {
43427 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCName_ndr_print");
43428 0 : return NULL;
43429 : }
43430 0 : call = &ndr_table_netlogon.calls[20];
43431 :
43432 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
43433 0 : ret = PyUnicode_FromString(retstr);
43434 0 : TALLOC_FREE(retstr);
43435 :
43436 0 : return ret;
43437 : }
43438 :
43439 0 : static PyObject *py_netr_DsRGetDCName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43440 : {
43441 0 : return py_netr_DsRGetDCName_ndr_print(py_obj, "netr_DsRGetDCName_in", NDR_IN);
43442 : }
43443 :
43444 0 : static PyObject *py_netr_DsRGetDCName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43445 : {
43446 0 : return py_netr_DsRGetDCName_ndr_print(py_obj, "netr_DsRGetDCName_out", NDR_OUT);
43447 : }
43448 :
43449 : static PyMethodDef py_netr_DsRGetDCName_methods[] = {
43450 : { "opnum", (PyCFunction)py_netr_DsRGetDCName_ndr_opnum, METH_NOARGS|METH_CLASS,
43451 : "netlogon.netr_DsRGetDCName.opnum() -> 20 (0x14) " },
43452 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43453 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43454 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43455 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43456 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43457 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43458 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43459 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43460 : { "__ndr_print_in__", (PyCFunction)py_netr_DsRGetDCName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43461 : { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetDCName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43462 : { NULL, NULL, 0, NULL }
43463 : };
43464 :
43465 :
43466 : static PyTypeObject netr_DsRGetDCName_Type = {
43467 : PyVarObject_HEAD_INIT(NULL, 0)
43468 : .tp_name = "netlogon.netr_DsRGetDCName",
43469 : .tp_getset = py_netr_DsRGetDCName_getsetters,
43470 : .tp_methods = py_netr_DsRGetDCName_methods,
43471 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43472 : .tp_new = py_netr_DsRGetDCName_new,
43473 : };
43474 :
43475 0 : static bool pack_py_netr_DsRGetDCName_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetDCName *r)
43476 : {
43477 : PyObject *py_server_unc;
43478 : PyObject *py_domain_name;
43479 : PyObject *py_domain_guid;
43480 : PyObject *py_site_guid;
43481 : PyObject *py_flags;
43482 0 : const char *kwnames[] = {
43483 : "server_unc", "domain_name", "domain_guid", "site_guid", "flags", NULL
43484 : };
43485 :
43486 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_DsRGetDCName", discard_const_p(char *, kwnames), &py_server_unc, &py_domain_name, &py_domain_guid, &py_site_guid, &py_flags)) {
43487 0 : return false;
43488 : }
43489 :
43490 0 : if (py_server_unc == NULL) {
43491 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_unc");
43492 0 : return false;
43493 : }
43494 0 : if (py_server_unc == Py_None) {
43495 0 : r->in.server_unc = NULL;
43496 : } else {
43497 0 : r->in.server_unc = NULL;
43498 : {
43499 : const char *test_str;
43500 : const char *talloc_str;
43501 0 : PyObject *unicode = NULL;
43502 0 : if (PyUnicode_Check(py_server_unc)) {
43503 0 : unicode = PyUnicode_AsEncodedString(py_server_unc, "utf-8", "ignore");
43504 0 : if (unicode == NULL) {
43505 0 : PyErr_NoMemory();
43506 0 : return false;
43507 : }
43508 0 : test_str = PyBytes_AS_STRING(unicode);
43509 0 : } else if (PyBytes_Check(py_server_unc)) {
43510 0 : test_str = PyBytes_AS_STRING(py_server_unc);
43511 : } else {
43512 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_unc)->tp_name);
43513 0 : return false;
43514 : }
43515 0 : talloc_str = talloc_strdup(r, test_str);
43516 0 : if (unicode != NULL) {
43517 0 : Py_DECREF(unicode);
43518 : }
43519 0 : if (talloc_str == NULL) {
43520 0 : PyErr_NoMemory();
43521 0 : return false;
43522 : }
43523 0 : r->in.server_unc = talloc_str;
43524 : }
43525 : }
43526 0 : if (py_domain_name == NULL) {
43527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
43528 0 : return false;
43529 : }
43530 0 : if (py_domain_name == Py_None) {
43531 0 : r->in.domain_name = NULL;
43532 : } else {
43533 0 : r->in.domain_name = NULL;
43534 : {
43535 : const char *test_str;
43536 : const char *talloc_str;
43537 0 : PyObject *unicode = NULL;
43538 0 : if (PyUnicode_Check(py_domain_name)) {
43539 0 : unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
43540 0 : if (unicode == NULL) {
43541 0 : PyErr_NoMemory();
43542 0 : return false;
43543 : }
43544 0 : test_str = PyBytes_AS_STRING(unicode);
43545 0 : } else if (PyBytes_Check(py_domain_name)) {
43546 0 : test_str = PyBytes_AS_STRING(py_domain_name);
43547 : } else {
43548 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
43549 0 : return false;
43550 : }
43551 0 : talloc_str = talloc_strdup(r, test_str);
43552 0 : if (unicode != NULL) {
43553 0 : Py_DECREF(unicode);
43554 : }
43555 0 : if (talloc_str == NULL) {
43556 0 : PyErr_NoMemory();
43557 0 : return false;
43558 : }
43559 0 : r->in.domain_name = talloc_str;
43560 : }
43561 : }
43562 0 : if (py_domain_guid == NULL) {
43563 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_guid");
43564 0 : return false;
43565 : }
43566 0 : if (py_domain_guid == Py_None) {
43567 0 : r->in.domain_guid = NULL;
43568 : } else {
43569 0 : r->in.domain_guid = NULL;
43570 0 : PY_CHECK_TYPE(GUID_Type, py_domain_guid, return false;);
43571 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_guid)) == NULL) {
43572 0 : PyErr_NoMemory();
43573 0 : return false;
43574 : }
43575 0 : r->in.domain_guid = (struct GUID *)pytalloc_get_ptr(py_domain_guid);
43576 : }
43577 0 : if (py_site_guid == NULL) {
43578 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_guid");
43579 0 : return false;
43580 : }
43581 0 : if (py_site_guid == Py_None) {
43582 0 : r->in.site_guid = NULL;
43583 : } else {
43584 0 : r->in.site_guid = NULL;
43585 0 : PY_CHECK_TYPE(GUID_Type, py_site_guid, return false;);
43586 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_site_guid)) == NULL) {
43587 0 : PyErr_NoMemory();
43588 0 : return false;
43589 : }
43590 0 : r->in.site_guid = (struct GUID *)pytalloc_get_ptr(py_site_guid);
43591 : }
43592 0 : if (py_flags == NULL) {
43593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
43594 0 : return false;
43595 : }
43596 : {
43597 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
43598 0 : if (PyLong_Check(py_flags)) {
43599 : unsigned long long test_var;
43600 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
43601 0 : if (PyErr_Occurred() != NULL) {
43602 0 : return false;
43603 : }
43604 0 : if (test_var > uint_max) {
43605 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43606 : PyLong_Type.tp_name, uint_max, test_var);
43607 0 : return false;
43608 : }
43609 0 : r->in.flags = test_var;
43610 : } else {
43611 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43612 : PyLong_Type.tp_name);
43613 0 : return false;
43614 : }
43615 : }
43616 0 : return true;
43617 : }
43618 :
43619 0 : static PyObject *unpack_py_netr_DsRGetDCName_args_out(struct netr_DsRGetDCName *r)
43620 : {
43621 : PyObject *result;
43622 : PyObject *py_info;
43623 0 : if (*r->out.info == NULL) {
43624 0 : py_info = Py_None;
43625 0 : Py_INCREF(py_info);
43626 : } else {
43627 0 : py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *r->out.info, *r->out.info);
43628 : }
43629 0 : result = py_info;
43630 0 : if (!W_ERROR_IS_OK(r->out.result)) {
43631 0 : PyErr_SetWERROR(r->out.result);
43632 0 : return NULL;
43633 : }
43634 :
43635 0 : return result;
43636 : }
43637 :
43638 :
43639 0 : static PyObject *py_netr_LogonGetCapabilities_in_get_server_name(PyObject *obj, void *closure)
43640 : {
43641 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj);
43642 : PyObject *py_server_name;
43643 0 : if (object->in.server_name == NULL) {
43644 0 : Py_RETURN_NONE;
43645 : }
43646 0 : if (object->in.server_name == NULL) {
43647 0 : py_server_name = Py_None;
43648 0 : Py_INCREF(py_server_name);
43649 : } else {
43650 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
43651 : }
43652 0 : return py_server_name;
43653 : }
43654 :
43655 0 : static int py_netr_LogonGetCapabilities_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
43656 : {
43657 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
43658 0 : if (value == NULL) {
43659 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
43660 0 : return -1;
43661 : }
43662 0 : object->in.server_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.server_name);
43663 0 : if (object->in.server_name == NULL) {
43664 0 : PyErr_NoMemory();
43665 0 : return -1;
43666 : }
43667 : {
43668 : const char *test_str;
43669 : const char *talloc_str;
43670 0 : PyObject *unicode = NULL;
43671 0 : if (PyUnicode_Check(value)) {
43672 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
43673 0 : if (unicode == NULL) {
43674 0 : PyErr_NoMemory();
43675 0 : return -1;
43676 : }
43677 0 : test_str = PyBytes_AS_STRING(unicode);
43678 0 : } else if (PyBytes_Check(value)) {
43679 0 : test_str = PyBytes_AS_STRING(value);
43680 : } else {
43681 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
43682 0 : return -1;
43683 : }
43684 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
43685 0 : if (unicode != NULL) {
43686 0 : Py_DECREF(unicode);
43687 : }
43688 0 : if (talloc_str == NULL) {
43689 0 : PyErr_NoMemory();
43690 0 : return -1;
43691 : }
43692 0 : object->in.server_name = talloc_str;
43693 : }
43694 0 : return 0;
43695 : }
43696 :
43697 0 : static PyObject *py_netr_LogonGetCapabilities_in_get_computer_name(PyObject *obj, void *closure)
43698 : {
43699 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj);
43700 : PyObject *py_computer_name;
43701 0 : if (object->in.computer_name == NULL) {
43702 0 : Py_RETURN_NONE;
43703 : }
43704 0 : if (object->in.computer_name == NULL) {
43705 0 : py_computer_name = Py_None;
43706 0 : Py_INCREF(py_computer_name);
43707 : } else {
43708 0 : if (object->in.computer_name == NULL) {
43709 0 : py_computer_name = Py_None;
43710 0 : Py_INCREF(py_computer_name);
43711 : } else {
43712 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
43713 : }
43714 : }
43715 0 : return py_computer_name;
43716 : }
43717 :
43718 0 : static int py_netr_LogonGetCapabilities_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
43719 : {
43720 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
43721 0 : if (value == NULL) {
43722 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
43723 0 : return -1;
43724 : }
43725 0 : if (value == Py_None) {
43726 0 : object->in.computer_name = NULL;
43727 : } else {
43728 0 : object->in.computer_name = NULL;
43729 : {
43730 : const char *test_str;
43731 : const char *talloc_str;
43732 0 : PyObject *unicode = NULL;
43733 0 : if (PyUnicode_Check(value)) {
43734 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
43735 0 : if (unicode == NULL) {
43736 0 : PyErr_NoMemory();
43737 0 : return -1;
43738 : }
43739 0 : test_str = PyBytes_AS_STRING(unicode);
43740 0 : } else if (PyBytes_Check(value)) {
43741 0 : test_str = PyBytes_AS_STRING(value);
43742 : } else {
43743 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
43744 0 : return -1;
43745 : }
43746 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
43747 0 : if (unicode != NULL) {
43748 0 : Py_DECREF(unicode);
43749 : }
43750 0 : if (talloc_str == NULL) {
43751 0 : PyErr_NoMemory();
43752 0 : return -1;
43753 : }
43754 0 : object->in.computer_name = talloc_str;
43755 : }
43756 : }
43757 0 : return 0;
43758 : }
43759 :
43760 0 : static PyObject *py_netr_LogonGetCapabilities_in_get_credential(PyObject *obj, void *closure)
43761 : {
43762 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj);
43763 : PyObject *py_credential;
43764 0 : if (object->in.credential == NULL) {
43765 0 : Py_RETURN_NONE;
43766 : }
43767 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
43768 0 : return py_credential;
43769 : }
43770 :
43771 0 : static int py_netr_LogonGetCapabilities_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
43772 : {
43773 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
43774 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
43775 0 : if (value == NULL) {
43776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
43777 0 : return -1;
43778 : }
43779 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
43780 0 : if (object->in.credential == NULL) {
43781 0 : PyErr_NoMemory();
43782 0 : return -1;
43783 : }
43784 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
43785 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43786 0 : PyErr_NoMemory();
43787 0 : return -1;
43788 : }
43789 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
43790 0 : return 0;
43791 : }
43792 :
43793 0 : static PyObject *py_netr_LogonGetCapabilities_in_get_return_authenticator(PyObject *obj, void *closure)
43794 : {
43795 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj);
43796 : PyObject *py_return_authenticator;
43797 0 : if (object->in.return_authenticator == NULL) {
43798 0 : Py_RETURN_NONE;
43799 : }
43800 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
43801 0 : return py_return_authenticator;
43802 : }
43803 :
43804 0 : static int py_netr_LogonGetCapabilities_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
43805 : {
43806 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
43807 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
43808 0 : if (value == NULL) {
43809 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
43810 0 : return -1;
43811 : }
43812 0 : object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator);
43813 0 : if (object->in.return_authenticator == NULL) {
43814 0 : PyErr_NoMemory();
43815 0 : return -1;
43816 : }
43817 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
43818 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43819 0 : PyErr_NoMemory();
43820 0 : return -1;
43821 : }
43822 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
43823 0 : return 0;
43824 : }
43825 :
43826 0 : static PyObject *py_netr_LogonGetCapabilities_out_get_return_authenticator(PyObject *obj, void *closure)
43827 : {
43828 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj);
43829 : PyObject *py_return_authenticator;
43830 0 : if (object->out.return_authenticator == NULL) {
43831 0 : Py_RETURN_NONE;
43832 : }
43833 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
43834 0 : return py_return_authenticator;
43835 : }
43836 :
43837 0 : static int py_netr_LogonGetCapabilities_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
43838 : {
43839 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
43840 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
43841 0 : if (value == NULL) {
43842 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
43843 0 : return -1;
43844 : }
43845 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
43846 0 : if (object->out.return_authenticator == NULL) {
43847 0 : PyErr_NoMemory();
43848 0 : return -1;
43849 : }
43850 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
43851 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43852 0 : PyErr_NoMemory();
43853 0 : return -1;
43854 : }
43855 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
43856 0 : return 0;
43857 : }
43858 :
43859 0 : static PyObject *py_netr_LogonGetCapabilities_in_get_query_level(PyObject *obj, void *closure)
43860 : {
43861 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj);
43862 : PyObject *py_query_level;
43863 0 : py_query_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.query_level);
43864 0 : return py_query_level;
43865 : }
43866 :
43867 0 : static int py_netr_LogonGetCapabilities_in_set_query_level(PyObject *py_obj, PyObject *value, void *closure)
43868 : {
43869 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
43870 0 : if (value == NULL) {
43871 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.query_level");
43872 0 : return -1;
43873 : }
43874 : {
43875 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.query_level));
43876 0 : if (PyLong_Check(value)) {
43877 : unsigned long long test_var;
43878 0 : test_var = PyLong_AsUnsignedLongLong(value);
43879 0 : if (PyErr_Occurred() != NULL) {
43880 0 : return -1;
43881 : }
43882 0 : if (test_var > uint_max) {
43883 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43884 : PyLong_Type.tp_name, uint_max, test_var);
43885 0 : return -1;
43886 : }
43887 0 : object->in.query_level = test_var;
43888 : } else {
43889 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43890 : PyLong_Type.tp_name);
43891 0 : return -1;
43892 : }
43893 : }
43894 0 : return 0;
43895 : }
43896 :
43897 0 : static PyObject *py_netr_LogonGetCapabilities_out_get_capabilities(PyObject *obj, void *closure)
43898 : {
43899 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj);
43900 : PyObject *py_capabilities;
43901 0 : if (object->out.capabilities == NULL) {
43902 0 : Py_RETURN_NONE;
43903 : }
43904 0 : py_capabilities = pyrpc_import_union(&netr_Capabilities_Type, object->out.capabilities, object->in.query_level, object->out.capabilities, "union netr_Capabilities");
43905 0 : if (py_capabilities == NULL) {
43906 0 : return NULL;
43907 : }
43908 0 : return py_capabilities;
43909 : }
43910 :
43911 0 : static int py_netr_LogonGetCapabilities_out_set_capabilities(PyObject *py_obj, PyObject *value, void *closure)
43912 : {
43913 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
43914 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.capabilities));
43915 0 : if (value == NULL) {
43916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.capabilities");
43917 0 : return -1;
43918 : }
43919 0 : object->out.capabilities = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.capabilities);
43920 0 : if (object->out.capabilities == NULL) {
43921 0 : PyErr_NoMemory();
43922 0 : return -1;
43923 : }
43924 : {
43925 : union netr_Capabilities *capabilities_switch_1;
43926 0 : capabilities_switch_1 = (union netr_Capabilities *)pyrpc_export_union(&netr_Capabilities_Type, pytalloc_get_mem_ctx(py_obj), object->in.query_level, value, "union netr_Capabilities");
43927 0 : if (capabilities_switch_1 == NULL) {
43928 0 : return -1;
43929 : }
43930 0 : object->out.capabilities = capabilities_switch_1;
43931 : }
43932 0 : return 0;
43933 : }
43934 :
43935 0 : static PyObject *py_netr_LogonGetCapabilities_get_result(PyObject *obj, void *closure)
43936 : {
43937 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(obj);
43938 : PyObject *py_result;
43939 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
43940 0 : return py_result;
43941 : }
43942 :
43943 0 : static int py_netr_LogonGetCapabilities_set_result(PyObject *py_obj, PyObject *value, void *closure)
43944 : {
43945 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
43946 0 : if (value == NULL) {
43947 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
43948 0 : return -1;
43949 : }
43950 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
43951 0 : return 0;
43952 : }
43953 :
43954 : static PyGetSetDef py_netr_LogonGetCapabilities_getsetters[] = {
43955 : {
43956 : .name = discard_const_p(char, "in_server_name"),
43957 : .get = py_netr_LogonGetCapabilities_in_get_server_name,
43958 : .set = py_netr_LogonGetCapabilities_in_set_server_name,
43959 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
43960 : },
43961 : {
43962 : .name = discard_const_p(char, "in_computer_name"),
43963 : .get = py_netr_LogonGetCapabilities_in_get_computer_name,
43964 : .set = py_netr_LogonGetCapabilities_in_set_computer_name,
43965 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
43966 : },
43967 : {
43968 : .name = discard_const_p(char, "in_credential"),
43969 : .get = py_netr_LogonGetCapabilities_in_get_credential,
43970 : .set = py_netr_LogonGetCapabilities_in_set_credential,
43971 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
43972 : },
43973 : {
43974 : .name = discard_const_p(char, "in_return_authenticator"),
43975 : .get = py_netr_LogonGetCapabilities_in_get_return_authenticator,
43976 : .set = py_netr_LogonGetCapabilities_in_set_return_authenticator,
43977 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
43978 : },
43979 : {
43980 : .name = discard_const_p(char, "out_return_authenticator"),
43981 : .get = py_netr_LogonGetCapabilities_out_get_return_authenticator,
43982 : .set = py_netr_LogonGetCapabilities_out_set_return_authenticator,
43983 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
43984 : },
43985 : {
43986 : .name = discard_const_p(char, "in_query_level"),
43987 : .get = py_netr_LogonGetCapabilities_in_get_query_level,
43988 : .set = py_netr_LogonGetCapabilities_in_set_query_level,
43989 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43990 : },
43991 : {
43992 : .name = discard_const_p(char, "out_capabilities"),
43993 : .get = py_netr_LogonGetCapabilities_out_get_capabilities,
43994 : .set = py_netr_LogonGetCapabilities_out_set_capabilities,
43995 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Capabilities")
43996 : },
43997 : {
43998 : .name = discard_const_p(char, "result"),
43999 : .get = py_netr_LogonGetCapabilities_get_result,
44000 : .set = py_netr_LogonGetCapabilities_set_result,
44001 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
44002 : },
44003 : { .name = NULL }
44004 : };
44005 :
44006 0 : static PyObject *py_netr_LogonGetCapabilities_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44007 : {
44008 0 : PyObject *self = pytalloc_new(struct netr_LogonGetCapabilities, type);
44009 0 : struct netr_LogonGetCapabilities *_self = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(self);
44010 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44011 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
44012 0 : _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
44013 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
44014 0 : _self->out.capabilities = talloc_zero(mem_ctx, union netr_Capabilities);
44015 0 : return self;
44016 : }
44017 :
44018 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44019 : {
44020 :
44021 :
44022 0 : return PyLong_FromLong(21);
44023 : }
44024 :
44025 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
44026 : {
44027 0 : const struct ndr_interface_call *call = NULL;
44028 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
44029 0 : PyObject *ret = NULL;
44030 0 : struct ndr_push *push = NULL;
44031 : DATA_BLOB blob;
44032 : enum ndr_err_code err;
44033 :
44034 0 : if (ndr_table_netlogon.num_calls < 22) {
44035 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetCapabilities_ndr_pack");
44036 0 : return NULL;
44037 : }
44038 0 : call = &ndr_table_netlogon.calls[21];
44039 :
44040 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44041 0 : if (push == NULL) {
44042 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44043 0 : return NULL;
44044 : }
44045 :
44046 0 : push->flags |= ndr_push_flags;
44047 :
44048 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44049 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44050 0 : TALLOC_FREE(push);
44051 0 : PyErr_SetNdrError(err);
44052 0 : return NULL;
44053 : }
44054 0 : blob = ndr_push_blob(push);
44055 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44056 0 : TALLOC_FREE(push);
44057 0 : return ret;
44058 : }
44059 :
44060 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44061 : {
44062 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44063 0 : PyObject *bigendian_obj = NULL;
44064 0 : PyObject *ndr64_obj = NULL;
44065 0 : uint32_t ndr_push_flags = 0;
44066 :
44067 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
44068 : discard_const_p(char *, kwnames),
44069 : &bigendian_obj,
44070 : &ndr64_obj)) {
44071 0 : return NULL;
44072 : }
44073 :
44074 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44075 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44076 : }
44077 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44078 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44079 : }
44080 :
44081 0 : return py_netr_LogonGetCapabilities_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
44082 : }
44083 :
44084 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44085 : {
44086 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44087 0 : PyObject *bigendian_obj = NULL;
44088 0 : PyObject *ndr64_obj = NULL;
44089 0 : uint32_t ndr_push_flags = 0;
44090 :
44091 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
44092 : discard_const_p(char *, kwnames),
44093 : &bigendian_obj,
44094 : &ndr64_obj)) {
44095 0 : return NULL;
44096 : }
44097 :
44098 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44099 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44100 : }
44101 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44102 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44103 : }
44104 :
44105 0 : return py_netr_LogonGetCapabilities_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
44106 : }
44107 :
44108 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
44109 : {
44110 0 : const struct ndr_interface_call *call = NULL;
44111 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
44112 0 : struct ndr_pull *pull = NULL;
44113 : enum ndr_err_code err;
44114 :
44115 0 : if (ndr_table_netlogon.num_calls < 22) {
44116 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetCapabilities_ndr_unpack");
44117 0 : return NULL;
44118 : }
44119 0 : call = &ndr_table_netlogon.calls[21];
44120 :
44121 0 : pull = ndr_pull_init_blob(blob, object);
44122 0 : if (pull == NULL) {
44123 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44124 0 : return NULL;
44125 : }
44126 :
44127 0 : pull->flags |= ndr_pull_flags;
44128 :
44129 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
44130 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44131 0 : TALLOC_FREE(pull);
44132 0 : PyErr_SetNdrError(err);
44133 0 : return NULL;
44134 : }
44135 0 : if (!allow_remaining) {
44136 : uint32_t highest_ofs;
44137 :
44138 0 : if (pull->offset > pull->relative_highest_offset) {
44139 0 : highest_ofs = pull->offset;
44140 : } else {
44141 0 : highest_ofs = pull->relative_highest_offset;
44142 : }
44143 0 : if (highest_ofs < pull->data_size) {
44144 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
44145 : "not all bytes consumed ofs[%u] size[%u]",
44146 : highest_ofs, pull->data_size);
44147 0 : TALLOC_FREE(pull);
44148 0 : PyErr_SetNdrError(err);
44149 0 : return NULL;
44150 : }
44151 : }
44152 :
44153 0 : TALLOC_FREE(pull);
44154 0 : Py_RETURN_NONE;
44155 : }
44156 :
44157 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44158 : {
44159 : DATA_BLOB blob;
44160 0 : Py_ssize_t blob_length = 0;
44161 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44162 0 : PyObject *bigendian_obj = NULL;
44163 0 : PyObject *ndr64_obj = NULL;
44164 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44165 0 : PyObject *allow_remaining_obj = NULL;
44166 0 : bool allow_remaining = false;
44167 :
44168 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
44169 : discard_const_p(char *, kwnames),
44170 : &blob.data, &blob_length,
44171 : &bigendian_obj,
44172 : &ndr64_obj,
44173 : &allow_remaining_obj)) {
44174 0 : return NULL;
44175 : }
44176 0 : blob.length = blob_length;
44177 :
44178 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44179 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44180 : }
44181 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44182 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44183 : }
44184 :
44185 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44186 0 : allow_remaining = true;
44187 : }
44188 :
44189 0 : return py_netr_LogonGetCapabilities_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
44190 : }
44191 :
44192 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44193 : {
44194 : DATA_BLOB blob;
44195 0 : Py_ssize_t blob_length = 0;
44196 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44197 0 : PyObject *bigendian_obj = NULL;
44198 0 : PyObject *ndr64_obj = NULL;
44199 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44200 0 : PyObject *allow_remaining_obj = NULL;
44201 0 : bool allow_remaining = false;
44202 :
44203 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
44204 : discard_const_p(char *, kwnames),
44205 : &blob.data, &blob_length,
44206 : &bigendian_obj,
44207 : &ndr64_obj,
44208 : &allow_remaining_obj)) {
44209 0 : return NULL;
44210 : }
44211 0 : blob.length = blob_length;
44212 :
44213 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44214 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44215 : }
44216 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44217 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44218 : }
44219 :
44220 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44221 0 : allow_remaining = true;
44222 : }
44223 :
44224 0 : return py_netr_LogonGetCapabilities_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
44225 : }
44226 :
44227 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
44228 : {
44229 0 : const struct ndr_interface_call *call = NULL;
44230 0 : struct netr_LogonGetCapabilities *object = (struct netr_LogonGetCapabilities *)pytalloc_get_ptr(py_obj);
44231 : PyObject *ret;
44232 : char *retstr;
44233 :
44234 0 : if (ndr_table_netlogon.num_calls < 22) {
44235 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetCapabilities_ndr_print");
44236 0 : return NULL;
44237 : }
44238 0 : call = &ndr_table_netlogon.calls[21];
44239 :
44240 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
44241 0 : ret = PyUnicode_FromString(retstr);
44242 0 : TALLOC_FREE(retstr);
44243 :
44244 0 : return ret;
44245 : }
44246 :
44247 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44248 : {
44249 0 : return py_netr_LogonGetCapabilities_ndr_print(py_obj, "netr_LogonGetCapabilities_in", NDR_IN);
44250 : }
44251 :
44252 0 : static PyObject *py_netr_LogonGetCapabilities_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44253 : {
44254 0 : return py_netr_LogonGetCapabilities_ndr_print(py_obj, "netr_LogonGetCapabilities_out", NDR_OUT);
44255 : }
44256 :
44257 : static PyMethodDef py_netr_LogonGetCapabilities_methods[] = {
44258 : { "opnum", (PyCFunction)py_netr_LogonGetCapabilities_ndr_opnum, METH_NOARGS|METH_CLASS,
44259 : "netlogon.netr_LogonGetCapabilities.opnum() -> 21 (0x15) " },
44260 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetCapabilities_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
44261 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
44262 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetCapabilities_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
44263 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
44264 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetCapabilities_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
44265 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
44266 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetCapabilities_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
44267 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
44268 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonGetCapabilities_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
44269 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonGetCapabilities_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
44270 : { NULL, NULL, 0, NULL }
44271 : };
44272 :
44273 :
44274 : static PyTypeObject netr_LogonGetCapabilities_Type = {
44275 : PyVarObject_HEAD_INIT(NULL, 0)
44276 : .tp_name = "netlogon.netr_LogonGetCapabilities",
44277 : .tp_getset = py_netr_LogonGetCapabilities_getsetters,
44278 : .tp_methods = py_netr_LogonGetCapabilities_methods,
44279 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
44280 : .tp_new = py_netr_LogonGetCapabilities_new,
44281 : };
44282 :
44283 0 : static bool pack_py_netr_LogonGetCapabilities_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonGetCapabilities *r)
44284 : {
44285 : PyObject *py_server_name;
44286 : PyObject *py_computer_name;
44287 : PyObject *py_credential;
44288 : PyObject *py_return_authenticator;
44289 : PyObject *py_query_level;
44290 0 : const char *kwnames[] = {
44291 : "server_name", "computer_name", "credential", "return_authenticator", "query_level", NULL
44292 : };
44293 :
44294 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_LogonGetCapabilities", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_query_level)) {
44295 0 : return false;
44296 : }
44297 :
44298 0 : if (py_server_name == NULL) {
44299 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
44300 0 : return false;
44301 : }
44302 0 : r->in.server_name = talloc_ptrtype(r, r->in.server_name);
44303 0 : if (r->in.server_name == NULL) {
44304 0 : PyErr_NoMemory();
44305 0 : return false;
44306 : }
44307 : {
44308 : const char *test_str;
44309 : const char *talloc_str;
44310 0 : PyObject *unicode = NULL;
44311 0 : if (PyUnicode_Check(py_server_name)) {
44312 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
44313 0 : if (unicode == NULL) {
44314 0 : PyErr_NoMemory();
44315 0 : return false;
44316 : }
44317 0 : test_str = PyBytes_AS_STRING(unicode);
44318 0 : } else if (PyBytes_Check(py_server_name)) {
44319 0 : test_str = PyBytes_AS_STRING(py_server_name);
44320 : } else {
44321 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
44322 0 : return false;
44323 : }
44324 0 : talloc_str = talloc_strdup(r, test_str);
44325 0 : if (unicode != NULL) {
44326 0 : Py_DECREF(unicode);
44327 : }
44328 0 : if (talloc_str == NULL) {
44329 0 : PyErr_NoMemory();
44330 0 : return false;
44331 : }
44332 0 : r->in.server_name = talloc_str;
44333 : }
44334 0 : if (py_computer_name == NULL) {
44335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
44336 0 : return false;
44337 : }
44338 0 : if (py_computer_name == Py_None) {
44339 0 : r->in.computer_name = NULL;
44340 : } else {
44341 0 : r->in.computer_name = NULL;
44342 : {
44343 : const char *test_str;
44344 : const char *talloc_str;
44345 0 : PyObject *unicode = NULL;
44346 0 : if (PyUnicode_Check(py_computer_name)) {
44347 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
44348 0 : if (unicode == NULL) {
44349 0 : PyErr_NoMemory();
44350 0 : return false;
44351 : }
44352 0 : test_str = PyBytes_AS_STRING(unicode);
44353 0 : } else if (PyBytes_Check(py_computer_name)) {
44354 0 : test_str = PyBytes_AS_STRING(py_computer_name);
44355 : } else {
44356 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
44357 0 : return false;
44358 : }
44359 0 : talloc_str = talloc_strdup(r, test_str);
44360 0 : if (unicode != NULL) {
44361 0 : Py_DECREF(unicode);
44362 : }
44363 0 : if (talloc_str == NULL) {
44364 0 : PyErr_NoMemory();
44365 0 : return false;
44366 : }
44367 0 : r->in.computer_name = talloc_str;
44368 : }
44369 : }
44370 0 : if (py_credential == NULL) {
44371 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
44372 0 : return false;
44373 : }
44374 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
44375 0 : if (r->in.credential == NULL) {
44376 0 : PyErr_NoMemory();
44377 0 : return false;
44378 : }
44379 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
44380 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
44381 0 : PyErr_NoMemory();
44382 0 : return false;
44383 : }
44384 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
44385 0 : if (py_return_authenticator == NULL) {
44386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
44387 0 : return false;
44388 : }
44389 0 : r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator);
44390 0 : if (r->in.return_authenticator == NULL) {
44391 0 : PyErr_NoMemory();
44392 0 : return false;
44393 : }
44394 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
44395 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
44396 0 : PyErr_NoMemory();
44397 0 : return false;
44398 : }
44399 0 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
44400 0 : if (py_query_level == NULL) {
44401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.query_level");
44402 0 : return false;
44403 : }
44404 : {
44405 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.query_level));
44406 0 : if (PyLong_Check(py_query_level)) {
44407 : unsigned long long test_var;
44408 0 : test_var = PyLong_AsUnsignedLongLong(py_query_level);
44409 0 : if (PyErr_Occurred() != NULL) {
44410 0 : return false;
44411 : }
44412 0 : if (test_var > uint_max) {
44413 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44414 : PyLong_Type.tp_name, uint_max, test_var);
44415 0 : return false;
44416 : }
44417 0 : r->in.query_level = test_var;
44418 : } else {
44419 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44420 : PyLong_Type.tp_name);
44421 0 : return false;
44422 : }
44423 : }
44424 0 : return true;
44425 : }
44426 :
44427 0 : static PyObject *unpack_py_netr_LogonGetCapabilities_args_out(struct netr_LogonGetCapabilities *r)
44428 : {
44429 : PyObject *result;
44430 : PyObject *py_return_authenticator;
44431 : PyObject *py_capabilities;
44432 0 : result = PyTuple_New(2);
44433 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
44434 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
44435 0 : py_capabilities = pyrpc_import_union(&netr_Capabilities_Type, r->out.capabilities, r->in.query_level, r->out.capabilities, "union netr_Capabilities");
44436 0 : if (py_capabilities == NULL) {
44437 0 : return NULL;
44438 : }
44439 0 : PyTuple_SetItem(result, 1, py_capabilities);
44440 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
44441 0 : PyErr_SetNTSTATUS(r->out.result);
44442 0 : return NULL;
44443 : }
44444 :
44445 0 : return result;
44446 : }
44447 :
44448 :
44449 0 : static PyObject *py_netr_LogonGetTrustRid_in_get_server_name(PyObject *obj, void *closure)
44450 : {
44451 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(obj);
44452 : PyObject *py_server_name;
44453 0 : if (object->in.server_name == NULL) {
44454 0 : Py_RETURN_NONE;
44455 : }
44456 0 : if (object->in.server_name == NULL) {
44457 0 : py_server_name = Py_None;
44458 0 : Py_INCREF(py_server_name);
44459 : } else {
44460 0 : if (object->in.server_name == NULL) {
44461 0 : py_server_name = Py_None;
44462 0 : Py_INCREF(py_server_name);
44463 : } else {
44464 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
44465 : }
44466 : }
44467 0 : return py_server_name;
44468 : }
44469 :
44470 0 : static int py_netr_LogonGetTrustRid_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
44471 : {
44472 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj);
44473 0 : if (value == NULL) {
44474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
44475 0 : return -1;
44476 : }
44477 0 : if (value == Py_None) {
44478 0 : object->in.server_name = NULL;
44479 : } else {
44480 0 : object->in.server_name = NULL;
44481 : {
44482 : const char *test_str;
44483 : const char *talloc_str;
44484 0 : PyObject *unicode = NULL;
44485 0 : if (PyUnicode_Check(value)) {
44486 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
44487 0 : if (unicode == NULL) {
44488 0 : PyErr_NoMemory();
44489 0 : return -1;
44490 : }
44491 0 : test_str = PyBytes_AS_STRING(unicode);
44492 0 : } else if (PyBytes_Check(value)) {
44493 0 : test_str = PyBytes_AS_STRING(value);
44494 : } else {
44495 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
44496 0 : return -1;
44497 : }
44498 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
44499 0 : if (unicode != NULL) {
44500 0 : Py_DECREF(unicode);
44501 : }
44502 0 : if (talloc_str == NULL) {
44503 0 : PyErr_NoMemory();
44504 0 : return -1;
44505 : }
44506 0 : object->in.server_name = talloc_str;
44507 : }
44508 : }
44509 0 : return 0;
44510 : }
44511 :
44512 0 : static PyObject *py_netr_LogonGetTrustRid_in_get_domain_name(PyObject *obj, void *closure)
44513 : {
44514 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(obj);
44515 : PyObject *py_domain_name;
44516 0 : if (object->in.domain_name == NULL) {
44517 0 : Py_RETURN_NONE;
44518 : }
44519 0 : if (object->in.domain_name == NULL) {
44520 0 : py_domain_name = Py_None;
44521 0 : Py_INCREF(py_domain_name);
44522 : } else {
44523 0 : if (object->in.domain_name == NULL) {
44524 0 : py_domain_name = Py_None;
44525 0 : Py_INCREF(py_domain_name);
44526 : } else {
44527 0 : py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
44528 : }
44529 : }
44530 0 : return py_domain_name;
44531 : }
44532 :
44533 0 : static int py_netr_LogonGetTrustRid_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
44534 : {
44535 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj);
44536 0 : if (value == NULL) {
44537 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
44538 0 : return -1;
44539 : }
44540 0 : if (value == Py_None) {
44541 0 : object->in.domain_name = NULL;
44542 : } else {
44543 0 : object->in.domain_name = NULL;
44544 : {
44545 : const char *test_str;
44546 : const char *talloc_str;
44547 0 : PyObject *unicode = NULL;
44548 0 : if (PyUnicode_Check(value)) {
44549 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
44550 0 : if (unicode == NULL) {
44551 0 : PyErr_NoMemory();
44552 0 : return -1;
44553 : }
44554 0 : test_str = PyBytes_AS_STRING(unicode);
44555 0 : } else if (PyBytes_Check(value)) {
44556 0 : test_str = PyBytes_AS_STRING(value);
44557 : } else {
44558 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
44559 0 : return -1;
44560 : }
44561 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
44562 0 : if (unicode != NULL) {
44563 0 : Py_DECREF(unicode);
44564 : }
44565 0 : if (talloc_str == NULL) {
44566 0 : PyErr_NoMemory();
44567 0 : return -1;
44568 : }
44569 0 : object->in.domain_name = talloc_str;
44570 : }
44571 : }
44572 0 : return 0;
44573 : }
44574 :
44575 0 : static PyObject *py_netr_LogonGetTrustRid_out_get_rid(PyObject *obj, void *closure)
44576 : {
44577 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(obj);
44578 : PyObject *py_rid;
44579 0 : if (object->out.rid == NULL) {
44580 0 : Py_RETURN_NONE;
44581 : }
44582 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid);
44583 0 : return py_rid;
44584 : }
44585 :
44586 0 : static int py_netr_LogonGetTrustRid_out_set_rid(PyObject *py_obj, PyObject *value, void *closure)
44587 : {
44588 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj);
44589 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid));
44590 0 : if (value == NULL) {
44591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid");
44592 0 : return -1;
44593 : }
44594 0 : object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid);
44595 0 : if (object->out.rid == NULL) {
44596 0 : PyErr_NoMemory();
44597 0 : return -1;
44598 : }
44599 : {
44600 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid));
44601 0 : if (PyLong_Check(value)) {
44602 : unsigned long long test_var;
44603 0 : test_var = PyLong_AsUnsignedLongLong(value);
44604 0 : if (PyErr_Occurred() != NULL) {
44605 0 : return -1;
44606 : }
44607 0 : if (test_var > uint_max) {
44608 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44609 : PyLong_Type.tp_name, uint_max, test_var);
44610 0 : return -1;
44611 : }
44612 0 : *object->out.rid = test_var;
44613 : } else {
44614 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44615 : PyLong_Type.tp_name);
44616 0 : return -1;
44617 : }
44618 : }
44619 0 : return 0;
44620 : }
44621 :
44622 0 : static PyObject *py_netr_LogonGetTrustRid_get_result(PyObject *obj, void *closure)
44623 : {
44624 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(obj);
44625 : PyObject *py_result;
44626 0 : py_result = PyErr_FromWERROR(object->out.result);
44627 0 : return py_result;
44628 : }
44629 :
44630 0 : static int py_netr_LogonGetTrustRid_set_result(PyObject *py_obj, PyObject *value, void *closure)
44631 : {
44632 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj);
44633 0 : if (value == NULL) {
44634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
44635 0 : return -1;
44636 : }
44637 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
44638 0 : return 0;
44639 : }
44640 :
44641 : static PyGetSetDef py_netr_LogonGetTrustRid_getsetters[] = {
44642 : {
44643 : .name = discard_const_p(char, "in_server_name"),
44644 : .get = py_netr_LogonGetTrustRid_in_get_server_name,
44645 : .set = py_netr_LogonGetTrustRid_in_set_server_name,
44646 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44647 : },
44648 : {
44649 : .name = discard_const_p(char, "in_domain_name"),
44650 : .get = py_netr_LogonGetTrustRid_in_get_domain_name,
44651 : .set = py_netr_LogonGetTrustRid_in_set_domain_name,
44652 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44653 : },
44654 : {
44655 : .name = discard_const_p(char, "out_rid"),
44656 : .get = py_netr_LogonGetTrustRid_out_get_rid,
44657 : .set = py_netr_LogonGetTrustRid_out_set_rid,
44658 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44659 : },
44660 : {
44661 : .name = discard_const_p(char, "result"),
44662 : .get = py_netr_LogonGetTrustRid_get_result,
44663 : .set = py_netr_LogonGetTrustRid_set_result,
44664 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
44665 : },
44666 : { .name = NULL }
44667 : };
44668 :
44669 0 : static PyObject *py_netr_LogonGetTrustRid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44670 : {
44671 0 : PyObject *self = pytalloc_new(struct netr_LogonGetTrustRid, type);
44672 0 : struct netr_LogonGetTrustRid *_self = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(self);
44673 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44674 0 : _self->out.rid = talloc_zero(mem_ctx, uint32_t);
44675 0 : return self;
44676 : }
44677 :
44678 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44679 : {
44680 :
44681 :
44682 0 : return PyLong_FromLong(23);
44683 : }
44684 :
44685 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
44686 : {
44687 0 : const struct ndr_interface_call *call = NULL;
44688 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj);
44689 0 : PyObject *ret = NULL;
44690 0 : struct ndr_push *push = NULL;
44691 : DATA_BLOB blob;
44692 : enum ndr_err_code err;
44693 :
44694 0 : if (ndr_table_netlogon.num_calls < 24) {
44695 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetTrustRid_ndr_pack");
44696 0 : return NULL;
44697 : }
44698 0 : call = &ndr_table_netlogon.calls[23];
44699 :
44700 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44701 0 : if (push == NULL) {
44702 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44703 0 : return NULL;
44704 : }
44705 :
44706 0 : push->flags |= ndr_push_flags;
44707 :
44708 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44709 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44710 0 : TALLOC_FREE(push);
44711 0 : PyErr_SetNdrError(err);
44712 0 : return NULL;
44713 : }
44714 0 : blob = ndr_push_blob(push);
44715 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44716 0 : TALLOC_FREE(push);
44717 0 : return ret;
44718 : }
44719 :
44720 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44721 : {
44722 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44723 0 : PyObject *bigendian_obj = NULL;
44724 0 : PyObject *ndr64_obj = NULL;
44725 0 : uint32_t ndr_push_flags = 0;
44726 :
44727 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
44728 : discard_const_p(char *, kwnames),
44729 : &bigendian_obj,
44730 : &ndr64_obj)) {
44731 0 : return NULL;
44732 : }
44733 :
44734 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44735 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44736 : }
44737 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44738 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44739 : }
44740 :
44741 0 : return py_netr_LogonGetTrustRid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
44742 : }
44743 :
44744 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44745 : {
44746 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44747 0 : PyObject *bigendian_obj = NULL;
44748 0 : PyObject *ndr64_obj = NULL;
44749 0 : uint32_t ndr_push_flags = 0;
44750 :
44751 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
44752 : discard_const_p(char *, kwnames),
44753 : &bigendian_obj,
44754 : &ndr64_obj)) {
44755 0 : return NULL;
44756 : }
44757 :
44758 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44759 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44760 : }
44761 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44762 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44763 : }
44764 :
44765 0 : return py_netr_LogonGetTrustRid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
44766 : }
44767 :
44768 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
44769 : {
44770 0 : const struct ndr_interface_call *call = NULL;
44771 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj);
44772 0 : struct ndr_pull *pull = NULL;
44773 : enum ndr_err_code err;
44774 :
44775 0 : if (ndr_table_netlogon.num_calls < 24) {
44776 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetTrustRid_ndr_unpack");
44777 0 : return NULL;
44778 : }
44779 0 : call = &ndr_table_netlogon.calls[23];
44780 :
44781 0 : pull = ndr_pull_init_blob(blob, object);
44782 0 : if (pull == NULL) {
44783 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44784 0 : return NULL;
44785 : }
44786 :
44787 0 : pull->flags |= ndr_pull_flags;
44788 :
44789 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
44790 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44791 0 : TALLOC_FREE(pull);
44792 0 : PyErr_SetNdrError(err);
44793 0 : return NULL;
44794 : }
44795 0 : if (!allow_remaining) {
44796 : uint32_t highest_ofs;
44797 :
44798 0 : if (pull->offset > pull->relative_highest_offset) {
44799 0 : highest_ofs = pull->offset;
44800 : } else {
44801 0 : highest_ofs = pull->relative_highest_offset;
44802 : }
44803 0 : if (highest_ofs < pull->data_size) {
44804 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
44805 : "not all bytes consumed ofs[%u] size[%u]",
44806 : highest_ofs, pull->data_size);
44807 0 : TALLOC_FREE(pull);
44808 0 : PyErr_SetNdrError(err);
44809 0 : return NULL;
44810 : }
44811 : }
44812 :
44813 0 : TALLOC_FREE(pull);
44814 0 : Py_RETURN_NONE;
44815 : }
44816 :
44817 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44818 : {
44819 : DATA_BLOB blob;
44820 0 : Py_ssize_t blob_length = 0;
44821 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44822 0 : PyObject *bigendian_obj = NULL;
44823 0 : PyObject *ndr64_obj = NULL;
44824 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44825 0 : PyObject *allow_remaining_obj = NULL;
44826 0 : bool allow_remaining = false;
44827 :
44828 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
44829 : discard_const_p(char *, kwnames),
44830 : &blob.data, &blob_length,
44831 : &bigendian_obj,
44832 : &ndr64_obj,
44833 : &allow_remaining_obj)) {
44834 0 : return NULL;
44835 : }
44836 0 : blob.length = blob_length;
44837 :
44838 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44839 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44840 : }
44841 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44842 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44843 : }
44844 :
44845 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44846 0 : allow_remaining = true;
44847 : }
44848 :
44849 0 : return py_netr_LogonGetTrustRid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
44850 : }
44851 :
44852 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44853 : {
44854 : DATA_BLOB blob;
44855 0 : Py_ssize_t blob_length = 0;
44856 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44857 0 : PyObject *bigendian_obj = NULL;
44858 0 : PyObject *ndr64_obj = NULL;
44859 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44860 0 : PyObject *allow_remaining_obj = NULL;
44861 0 : bool allow_remaining = false;
44862 :
44863 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
44864 : discard_const_p(char *, kwnames),
44865 : &blob.data, &blob_length,
44866 : &bigendian_obj,
44867 : &ndr64_obj,
44868 : &allow_remaining_obj)) {
44869 0 : return NULL;
44870 : }
44871 0 : blob.length = blob_length;
44872 :
44873 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44874 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44875 : }
44876 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44877 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44878 : }
44879 :
44880 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44881 0 : allow_remaining = true;
44882 : }
44883 :
44884 0 : return py_netr_LogonGetTrustRid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
44885 : }
44886 :
44887 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
44888 : {
44889 0 : const struct ndr_interface_call *call = NULL;
44890 0 : struct netr_LogonGetTrustRid *object = (struct netr_LogonGetTrustRid *)pytalloc_get_ptr(py_obj);
44891 : PyObject *ret;
44892 : char *retstr;
44893 :
44894 0 : if (ndr_table_netlogon.num_calls < 24) {
44895 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetTrustRid_ndr_print");
44896 0 : return NULL;
44897 : }
44898 0 : call = &ndr_table_netlogon.calls[23];
44899 :
44900 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
44901 0 : ret = PyUnicode_FromString(retstr);
44902 0 : TALLOC_FREE(retstr);
44903 :
44904 0 : return ret;
44905 : }
44906 :
44907 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44908 : {
44909 0 : return py_netr_LogonGetTrustRid_ndr_print(py_obj, "netr_LogonGetTrustRid_in", NDR_IN);
44910 : }
44911 :
44912 0 : static PyObject *py_netr_LogonGetTrustRid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44913 : {
44914 0 : return py_netr_LogonGetTrustRid_ndr_print(py_obj, "netr_LogonGetTrustRid_out", NDR_OUT);
44915 : }
44916 :
44917 : static PyMethodDef py_netr_LogonGetTrustRid_methods[] = {
44918 : { "opnum", (PyCFunction)py_netr_LogonGetTrustRid_ndr_opnum, METH_NOARGS|METH_CLASS,
44919 : "netlogon.netr_LogonGetTrustRid.opnum() -> 23 (0x17) " },
44920 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetTrustRid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
44921 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
44922 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetTrustRid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
44923 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
44924 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetTrustRid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
44925 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
44926 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetTrustRid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
44927 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
44928 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonGetTrustRid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
44929 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonGetTrustRid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
44930 : { NULL, NULL, 0, NULL }
44931 : };
44932 :
44933 :
44934 : static PyTypeObject netr_LogonGetTrustRid_Type = {
44935 : PyVarObject_HEAD_INIT(NULL, 0)
44936 : .tp_name = "netlogon.netr_LogonGetTrustRid",
44937 : .tp_getset = py_netr_LogonGetTrustRid_getsetters,
44938 : .tp_methods = py_netr_LogonGetTrustRid_methods,
44939 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
44940 : .tp_new = py_netr_LogonGetTrustRid_new,
44941 : };
44942 :
44943 0 : static bool pack_py_netr_LogonGetTrustRid_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonGetTrustRid *r)
44944 : {
44945 : PyObject *py_server_name;
44946 : PyObject *py_domain_name;
44947 0 : const char *kwnames[] = {
44948 : "server_name", "domain_name", NULL
44949 : };
44950 :
44951 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_LogonGetTrustRid", discard_const_p(char *, kwnames), &py_server_name, &py_domain_name)) {
44952 0 : return false;
44953 : }
44954 :
44955 0 : if (py_server_name == NULL) {
44956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
44957 0 : return false;
44958 : }
44959 0 : if (py_server_name == Py_None) {
44960 0 : r->in.server_name = NULL;
44961 : } else {
44962 0 : r->in.server_name = NULL;
44963 : {
44964 : const char *test_str;
44965 : const char *talloc_str;
44966 0 : PyObject *unicode = NULL;
44967 0 : if (PyUnicode_Check(py_server_name)) {
44968 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
44969 0 : if (unicode == NULL) {
44970 0 : PyErr_NoMemory();
44971 0 : return false;
44972 : }
44973 0 : test_str = PyBytes_AS_STRING(unicode);
44974 0 : } else if (PyBytes_Check(py_server_name)) {
44975 0 : test_str = PyBytes_AS_STRING(py_server_name);
44976 : } else {
44977 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
44978 0 : return false;
44979 : }
44980 0 : talloc_str = talloc_strdup(r, test_str);
44981 0 : if (unicode != NULL) {
44982 0 : Py_DECREF(unicode);
44983 : }
44984 0 : if (talloc_str == NULL) {
44985 0 : PyErr_NoMemory();
44986 0 : return false;
44987 : }
44988 0 : r->in.server_name = talloc_str;
44989 : }
44990 : }
44991 0 : if (py_domain_name == NULL) {
44992 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
44993 0 : return false;
44994 : }
44995 0 : if (py_domain_name == Py_None) {
44996 0 : r->in.domain_name = NULL;
44997 : } else {
44998 0 : r->in.domain_name = NULL;
44999 : {
45000 : const char *test_str;
45001 : const char *talloc_str;
45002 0 : PyObject *unicode = NULL;
45003 0 : if (PyUnicode_Check(py_domain_name)) {
45004 0 : unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
45005 0 : if (unicode == NULL) {
45006 0 : PyErr_NoMemory();
45007 0 : return false;
45008 : }
45009 0 : test_str = PyBytes_AS_STRING(unicode);
45010 0 : } else if (PyBytes_Check(py_domain_name)) {
45011 0 : test_str = PyBytes_AS_STRING(py_domain_name);
45012 : } else {
45013 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
45014 0 : return false;
45015 : }
45016 0 : talloc_str = talloc_strdup(r, test_str);
45017 0 : if (unicode != NULL) {
45018 0 : Py_DECREF(unicode);
45019 : }
45020 0 : if (talloc_str == NULL) {
45021 0 : PyErr_NoMemory();
45022 0 : return false;
45023 : }
45024 0 : r->in.domain_name = talloc_str;
45025 : }
45026 : }
45027 0 : return true;
45028 : }
45029 :
45030 0 : static PyObject *unpack_py_netr_LogonGetTrustRid_args_out(struct netr_LogonGetTrustRid *r)
45031 : {
45032 : PyObject *result;
45033 : PyObject *py_rid;
45034 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid);
45035 0 : result = py_rid;
45036 0 : if (!W_ERROR_IS_OK(r->out.result)) {
45037 0 : PyErr_SetWERROR(r->out.result);
45038 0 : return NULL;
45039 : }
45040 :
45041 0 : return result;
45042 : }
45043 :
45044 :
45045 0 : static PyObject *py_netr_ServerAuthenticate3_in_get_server_name(PyObject *obj, void *closure)
45046 : {
45047 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45048 : PyObject *py_server_name;
45049 0 : if (object->in.server_name == NULL) {
45050 0 : Py_RETURN_NONE;
45051 : }
45052 0 : if (object->in.server_name == NULL) {
45053 0 : py_server_name = Py_None;
45054 0 : Py_INCREF(py_server_name);
45055 : } else {
45056 0 : if (object->in.server_name == NULL) {
45057 0 : py_server_name = Py_None;
45058 0 : Py_INCREF(py_server_name);
45059 : } else {
45060 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
45061 : }
45062 : }
45063 0 : return py_server_name;
45064 : }
45065 :
45066 0 : static int py_netr_ServerAuthenticate3_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
45067 : {
45068 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45069 0 : if (value == NULL) {
45070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
45071 0 : return -1;
45072 : }
45073 0 : if (value == Py_None) {
45074 0 : object->in.server_name = NULL;
45075 : } else {
45076 0 : object->in.server_name = NULL;
45077 : {
45078 : const char *test_str;
45079 : const char *talloc_str;
45080 0 : PyObject *unicode = NULL;
45081 0 : if (PyUnicode_Check(value)) {
45082 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
45083 0 : if (unicode == NULL) {
45084 0 : PyErr_NoMemory();
45085 0 : return -1;
45086 : }
45087 0 : test_str = PyBytes_AS_STRING(unicode);
45088 0 : } else if (PyBytes_Check(value)) {
45089 0 : test_str = PyBytes_AS_STRING(value);
45090 : } else {
45091 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
45092 0 : return -1;
45093 : }
45094 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
45095 0 : if (unicode != NULL) {
45096 0 : Py_DECREF(unicode);
45097 : }
45098 0 : if (talloc_str == NULL) {
45099 0 : PyErr_NoMemory();
45100 0 : return -1;
45101 : }
45102 0 : object->in.server_name = talloc_str;
45103 : }
45104 : }
45105 0 : return 0;
45106 : }
45107 :
45108 0 : static PyObject *py_netr_ServerAuthenticate3_in_get_account_name(PyObject *obj, void *closure)
45109 : {
45110 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45111 : PyObject *py_account_name;
45112 0 : if (object->in.account_name == NULL) {
45113 0 : Py_RETURN_NONE;
45114 : }
45115 0 : if (object->in.account_name == NULL) {
45116 0 : py_account_name = Py_None;
45117 0 : Py_INCREF(py_account_name);
45118 : } else {
45119 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
45120 : }
45121 0 : return py_account_name;
45122 : }
45123 :
45124 0 : static int py_netr_ServerAuthenticate3_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
45125 : {
45126 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45127 0 : if (value == NULL) {
45128 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
45129 0 : return -1;
45130 : }
45131 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
45132 0 : if (object->in.account_name == NULL) {
45133 0 : PyErr_NoMemory();
45134 0 : return -1;
45135 : }
45136 : {
45137 : const char *test_str;
45138 : const char *talloc_str;
45139 0 : PyObject *unicode = NULL;
45140 0 : if (PyUnicode_Check(value)) {
45141 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
45142 0 : if (unicode == NULL) {
45143 0 : PyErr_NoMemory();
45144 0 : return -1;
45145 : }
45146 0 : test_str = PyBytes_AS_STRING(unicode);
45147 0 : } else if (PyBytes_Check(value)) {
45148 0 : test_str = PyBytes_AS_STRING(value);
45149 : } else {
45150 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
45151 0 : return -1;
45152 : }
45153 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
45154 0 : if (unicode != NULL) {
45155 0 : Py_DECREF(unicode);
45156 : }
45157 0 : if (talloc_str == NULL) {
45158 0 : PyErr_NoMemory();
45159 0 : return -1;
45160 : }
45161 0 : object->in.account_name = talloc_str;
45162 : }
45163 0 : return 0;
45164 : }
45165 :
45166 0 : static PyObject *py_netr_ServerAuthenticate3_in_get_secure_channel_type(PyObject *obj, void *closure)
45167 : {
45168 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45169 : PyObject *py_secure_channel_type;
45170 0 : py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type);
45171 0 : return py_secure_channel_type;
45172 : }
45173 :
45174 0 : static int py_netr_ServerAuthenticate3_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure)
45175 : {
45176 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45177 0 : if (value == NULL) {
45178 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type");
45179 0 : return -1;
45180 : }
45181 : {
45182 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_type));
45183 0 : if (PyLong_Check(value)) {
45184 : unsigned long long test_var;
45185 0 : test_var = PyLong_AsUnsignedLongLong(value);
45186 0 : if (PyErr_Occurred() != NULL) {
45187 0 : return -1;
45188 : }
45189 0 : if (test_var > uint_max) {
45190 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45191 : PyLong_Type.tp_name, uint_max, test_var);
45192 0 : return -1;
45193 : }
45194 0 : object->in.secure_channel_type = test_var;
45195 : } else {
45196 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45197 : PyLong_Type.tp_name);
45198 0 : return -1;
45199 : }
45200 : }
45201 0 : return 0;
45202 : }
45203 :
45204 0 : static PyObject *py_netr_ServerAuthenticate3_in_get_computer_name(PyObject *obj, void *closure)
45205 : {
45206 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45207 : PyObject *py_computer_name;
45208 0 : if (object->in.computer_name == NULL) {
45209 0 : Py_RETURN_NONE;
45210 : }
45211 0 : if (object->in.computer_name == NULL) {
45212 0 : py_computer_name = Py_None;
45213 0 : Py_INCREF(py_computer_name);
45214 : } else {
45215 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
45216 : }
45217 0 : return py_computer_name;
45218 : }
45219 :
45220 0 : static int py_netr_ServerAuthenticate3_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
45221 : {
45222 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45223 0 : if (value == NULL) {
45224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
45225 0 : return -1;
45226 : }
45227 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
45228 0 : if (object->in.computer_name == NULL) {
45229 0 : PyErr_NoMemory();
45230 0 : return -1;
45231 : }
45232 : {
45233 : const char *test_str;
45234 : const char *talloc_str;
45235 0 : PyObject *unicode = NULL;
45236 0 : if (PyUnicode_Check(value)) {
45237 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
45238 0 : if (unicode == NULL) {
45239 0 : PyErr_NoMemory();
45240 0 : return -1;
45241 : }
45242 0 : test_str = PyBytes_AS_STRING(unicode);
45243 0 : } else if (PyBytes_Check(value)) {
45244 0 : test_str = PyBytes_AS_STRING(value);
45245 : } else {
45246 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
45247 0 : return -1;
45248 : }
45249 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
45250 0 : if (unicode != NULL) {
45251 0 : Py_DECREF(unicode);
45252 : }
45253 0 : if (talloc_str == NULL) {
45254 0 : PyErr_NoMemory();
45255 0 : return -1;
45256 : }
45257 0 : object->in.computer_name = talloc_str;
45258 : }
45259 0 : return 0;
45260 : }
45261 :
45262 0 : static PyObject *py_netr_ServerAuthenticate3_in_get_credentials(PyObject *obj, void *closure)
45263 : {
45264 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45265 : PyObject *py_credentials;
45266 0 : if (object->in.credentials == NULL) {
45267 0 : Py_RETURN_NONE;
45268 : }
45269 0 : py_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->in.credentials, object->in.credentials);
45270 0 : return py_credentials;
45271 : }
45272 :
45273 0 : static int py_netr_ServerAuthenticate3_in_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
45274 : {
45275 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45276 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credentials));
45277 0 : if (value == NULL) {
45278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credentials");
45279 0 : return -1;
45280 : }
45281 0 : object->in.credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credentials);
45282 0 : if (object->in.credentials == NULL) {
45283 0 : PyErr_NoMemory();
45284 0 : return -1;
45285 : }
45286 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
45287 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45288 0 : PyErr_NoMemory();
45289 0 : return -1;
45290 : }
45291 0 : object->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(value);
45292 0 : return 0;
45293 : }
45294 :
45295 0 : static PyObject *py_netr_ServerAuthenticate3_out_get_return_credentials(PyObject *obj, void *closure)
45296 : {
45297 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45298 : PyObject *py_return_credentials;
45299 0 : if (object->out.return_credentials == NULL) {
45300 0 : Py_RETURN_NONE;
45301 : }
45302 0 : py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, object->out.return_credentials, object->out.return_credentials);
45303 0 : return py_return_credentials;
45304 : }
45305 :
45306 0 : static int py_netr_ServerAuthenticate3_out_set_return_credentials(PyObject *py_obj, PyObject *value, void *closure)
45307 : {
45308 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45309 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_credentials));
45310 0 : if (value == NULL) {
45311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_credentials");
45312 0 : return -1;
45313 : }
45314 0 : object->out.return_credentials = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_credentials);
45315 0 : if (object->out.return_credentials == NULL) {
45316 0 : PyErr_NoMemory();
45317 0 : return -1;
45318 : }
45319 0 : PY_CHECK_TYPE(&netr_Credential_Type, value, return -1;);
45320 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45321 0 : PyErr_NoMemory();
45322 0 : return -1;
45323 : }
45324 0 : object->out.return_credentials = (struct netr_Credential *)pytalloc_get_ptr(value);
45325 0 : return 0;
45326 : }
45327 :
45328 0 : static PyObject *py_netr_ServerAuthenticate3_in_get_negotiate_flags(PyObject *obj, void *closure)
45329 : {
45330 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45331 : PyObject *py_negotiate_flags;
45332 0 : if (object->in.negotiate_flags == NULL) {
45333 0 : Py_RETURN_NONE;
45334 : }
45335 0 : py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->in.negotiate_flags);
45336 0 : return py_negotiate_flags;
45337 : }
45338 :
45339 0 : static int py_netr_ServerAuthenticate3_in_set_negotiate_flags(PyObject *py_obj, PyObject *value, void *closure)
45340 : {
45341 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45342 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.negotiate_flags));
45343 0 : if (value == NULL) {
45344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.negotiate_flags");
45345 0 : return -1;
45346 : }
45347 0 : object->in.negotiate_flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.negotiate_flags);
45348 0 : if (object->in.negotiate_flags == NULL) {
45349 0 : PyErr_NoMemory();
45350 0 : return -1;
45351 : }
45352 : {
45353 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.negotiate_flags));
45354 0 : if (PyLong_Check(value)) {
45355 : unsigned long long test_var;
45356 0 : test_var = PyLong_AsUnsignedLongLong(value);
45357 0 : if (PyErr_Occurred() != NULL) {
45358 0 : return -1;
45359 : }
45360 0 : if (test_var > uint_max) {
45361 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45362 : PyLong_Type.tp_name, uint_max, test_var);
45363 0 : return -1;
45364 : }
45365 0 : *object->in.negotiate_flags = test_var;
45366 : } else {
45367 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45368 : PyLong_Type.tp_name);
45369 0 : return -1;
45370 : }
45371 : }
45372 0 : return 0;
45373 : }
45374 :
45375 0 : static PyObject *py_netr_ServerAuthenticate3_out_get_negotiate_flags(PyObject *obj, void *closure)
45376 : {
45377 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45378 : PyObject *py_negotiate_flags;
45379 0 : if (object->out.negotiate_flags == NULL) {
45380 0 : Py_RETURN_NONE;
45381 : }
45382 0 : py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.negotiate_flags);
45383 0 : return py_negotiate_flags;
45384 : }
45385 :
45386 0 : static int py_netr_ServerAuthenticate3_out_set_negotiate_flags(PyObject *py_obj, PyObject *value, void *closure)
45387 : {
45388 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45389 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.negotiate_flags));
45390 0 : if (value == NULL) {
45391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.negotiate_flags");
45392 0 : return -1;
45393 : }
45394 0 : object->out.negotiate_flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.negotiate_flags);
45395 0 : if (object->out.negotiate_flags == NULL) {
45396 0 : PyErr_NoMemory();
45397 0 : return -1;
45398 : }
45399 : {
45400 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.negotiate_flags));
45401 0 : if (PyLong_Check(value)) {
45402 : unsigned long long test_var;
45403 0 : test_var = PyLong_AsUnsignedLongLong(value);
45404 0 : if (PyErr_Occurred() != NULL) {
45405 0 : return -1;
45406 : }
45407 0 : if (test_var > uint_max) {
45408 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45409 : PyLong_Type.tp_name, uint_max, test_var);
45410 0 : return -1;
45411 : }
45412 0 : *object->out.negotiate_flags = test_var;
45413 : } else {
45414 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45415 : PyLong_Type.tp_name);
45416 0 : return -1;
45417 : }
45418 : }
45419 0 : return 0;
45420 : }
45421 :
45422 0 : static PyObject *py_netr_ServerAuthenticate3_out_get_rid(PyObject *obj, void *closure)
45423 : {
45424 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45425 : PyObject *py_rid;
45426 0 : if (object->out.rid == NULL) {
45427 0 : Py_RETURN_NONE;
45428 : }
45429 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid);
45430 0 : return py_rid;
45431 : }
45432 :
45433 0 : static int py_netr_ServerAuthenticate3_out_set_rid(PyObject *py_obj, PyObject *value, void *closure)
45434 : {
45435 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45436 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid));
45437 0 : if (value == NULL) {
45438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid");
45439 0 : return -1;
45440 : }
45441 0 : object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid);
45442 0 : if (object->out.rid == NULL) {
45443 0 : PyErr_NoMemory();
45444 0 : return -1;
45445 : }
45446 : {
45447 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid));
45448 0 : if (PyLong_Check(value)) {
45449 : unsigned long long test_var;
45450 0 : test_var = PyLong_AsUnsignedLongLong(value);
45451 0 : if (PyErr_Occurred() != NULL) {
45452 0 : return -1;
45453 : }
45454 0 : if (test_var > uint_max) {
45455 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45456 : PyLong_Type.tp_name, uint_max, test_var);
45457 0 : return -1;
45458 : }
45459 0 : *object->out.rid = test_var;
45460 : } else {
45461 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45462 : PyLong_Type.tp_name);
45463 0 : return -1;
45464 : }
45465 : }
45466 0 : return 0;
45467 : }
45468 :
45469 0 : static PyObject *py_netr_ServerAuthenticate3_get_result(PyObject *obj, void *closure)
45470 : {
45471 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(obj);
45472 : PyObject *py_result;
45473 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
45474 0 : return py_result;
45475 : }
45476 :
45477 0 : static int py_netr_ServerAuthenticate3_set_result(PyObject *py_obj, PyObject *value, void *closure)
45478 : {
45479 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45480 0 : if (value == NULL) {
45481 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
45482 0 : return -1;
45483 : }
45484 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
45485 0 : return 0;
45486 : }
45487 :
45488 : static PyGetSetDef py_netr_ServerAuthenticate3_getsetters[] = {
45489 : {
45490 : .name = discard_const_p(char, "in_server_name"),
45491 : .get = py_netr_ServerAuthenticate3_in_get_server_name,
45492 : .set = py_netr_ServerAuthenticate3_in_set_server_name,
45493 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
45494 : },
45495 : {
45496 : .name = discard_const_p(char, "in_account_name"),
45497 : .get = py_netr_ServerAuthenticate3_in_get_account_name,
45498 : .set = py_netr_ServerAuthenticate3_in_set_account_name,
45499 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
45500 : },
45501 : {
45502 : .name = discard_const_p(char, "in_secure_channel_type"),
45503 : .get = py_netr_ServerAuthenticate3_in_get_secure_channel_type,
45504 : .set = py_netr_ServerAuthenticate3_in_set_secure_channel_type,
45505 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType")
45506 : },
45507 : {
45508 : .name = discard_const_p(char, "in_computer_name"),
45509 : .get = py_netr_ServerAuthenticate3_in_get_computer_name,
45510 : .set = py_netr_ServerAuthenticate3_in_set_computer_name,
45511 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
45512 : },
45513 : {
45514 : .name = discard_const_p(char, "in_credentials"),
45515 : .get = py_netr_ServerAuthenticate3_in_get_credentials,
45516 : .set = py_netr_ServerAuthenticate3_in_set_credentials,
45517 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
45518 : },
45519 : {
45520 : .name = discard_const_p(char, "out_return_credentials"),
45521 : .get = py_netr_ServerAuthenticate3_out_get_return_credentials,
45522 : .set = py_netr_ServerAuthenticate3_out_set_return_credentials,
45523 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Credential")
45524 : },
45525 : {
45526 : .name = discard_const_p(char, "in_negotiate_flags"),
45527 : .get = py_netr_ServerAuthenticate3_in_get_negotiate_flags,
45528 : .set = py_netr_ServerAuthenticate3_in_set_negotiate_flags,
45529 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_NegotiateFlags")
45530 : },
45531 : {
45532 : .name = discard_const_p(char, "out_negotiate_flags"),
45533 : .get = py_netr_ServerAuthenticate3_out_get_negotiate_flags,
45534 : .set = py_netr_ServerAuthenticate3_out_set_negotiate_flags,
45535 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_NegotiateFlags")
45536 : },
45537 : {
45538 : .name = discard_const_p(char, "out_rid"),
45539 : .get = py_netr_ServerAuthenticate3_out_get_rid,
45540 : .set = py_netr_ServerAuthenticate3_out_set_rid,
45541 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
45542 : },
45543 : {
45544 : .name = discard_const_p(char, "result"),
45545 : .get = py_netr_ServerAuthenticate3_get_result,
45546 : .set = py_netr_ServerAuthenticate3_set_result,
45547 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
45548 : },
45549 : { .name = NULL }
45550 : };
45551 :
45552 0 : static PyObject *py_netr_ServerAuthenticate3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
45553 : {
45554 0 : PyObject *self = pytalloc_new(struct netr_ServerAuthenticate3, type);
45555 0 : struct netr_ServerAuthenticate3 *_self = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(self);
45556 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
45557 0 : _self->in.credentials = talloc_zero(mem_ctx, struct netr_Credential);
45558 0 : _self->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
45559 0 : _self->in.negotiate_flags = talloc_zero(mem_ctx, uint32_t);
45560 0 : _self->out.negotiate_flags = talloc_zero(mem_ctx, uint32_t);
45561 0 : _self->out.rid = talloc_zero(mem_ctx, uint32_t);
45562 0 : return self;
45563 : }
45564 :
45565 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
45566 : {
45567 :
45568 :
45569 0 : return PyLong_FromLong(26);
45570 : }
45571 :
45572 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
45573 : {
45574 0 : const struct ndr_interface_call *call = NULL;
45575 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45576 0 : PyObject *ret = NULL;
45577 0 : struct ndr_push *push = NULL;
45578 : DATA_BLOB blob;
45579 : enum ndr_err_code err;
45580 :
45581 0 : if (ndr_table_netlogon.num_calls < 27) {
45582 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate3_ndr_pack");
45583 0 : return NULL;
45584 : }
45585 0 : call = &ndr_table_netlogon.calls[26];
45586 :
45587 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
45588 0 : if (push == NULL) {
45589 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45590 0 : return NULL;
45591 : }
45592 :
45593 0 : push->flags |= ndr_push_flags;
45594 :
45595 0 : err = call->ndr_push(push, ndr_inout_flags, object);
45596 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45597 0 : TALLOC_FREE(push);
45598 0 : PyErr_SetNdrError(err);
45599 0 : return NULL;
45600 : }
45601 0 : blob = ndr_push_blob(push);
45602 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
45603 0 : TALLOC_FREE(push);
45604 0 : return ret;
45605 : }
45606 :
45607 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45608 : {
45609 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45610 0 : PyObject *bigendian_obj = NULL;
45611 0 : PyObject *ndr64_obj = NULL;
45612 0 : uint32_t ndr_push_flags = 0;
45613 :
45614 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45615 : discard_const_p(char *, kwnames),
45616 : &bigendian_obj,
45617 : &ndr64_obj)) {
45618 0 : return NULL;
45619 : }
45620 :
45621 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45622 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45623 : }
45624 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45625 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45626 : }
45627 :
45628 0 : return py_netr_ServerAuthenticate3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45629 : }
45630 :
45631 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45632 : {
45633 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45634 0 : PyObject *bigendian_obj = NULL;
45635 0 : PyObject *ndr64_obj = NULL;
45636 0 : uint32_t ndr_push_flags = 0;
45637 :
45638 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45639 : discard_const_p(char *, kwnames),
45640 : &bigendian_obj,
45641 : &ndr64_obj)) {
45642 0 : return NULL;
45643 : }
45644 :
45645 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45646 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45647 : }
45648 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45649 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45650 : }
45651 :
45652 0 : return py_netr_ServerAuthenticate3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45653 : }
45654 :
45655 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
45656 : {
45657 0 : const struct ndr_interface_call *call = NULL;
45658 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45659 0 : struct ndr_pull *pull = NULL;
45660 : enum ndr_err_code err;
45661 :
45662 0 : if (ndr_table_netlogon.num_calls < 27) {
45663 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate3_ndr_unpack");
45664 0 : return NULL;
45665 : }
45666 0 : call = &ndr_table_netlogon.calls[26];
45667 :
45668 0 : pull = ndr_pull_init_blob(blob, object);
45669 0 : if (pull == NULL) {
45670 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45671 0 : return NULL;
45672 : }
45673 :
45674 0 : pull->flags |= ndr_pull_flags;
45675 :
45676 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45677 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45678 0 : TALLOC_FREE(pull);
45679 0 : PyErr_SetNdrError(err);
45680 0 : return NULL;
45681 : }
45682 0 : if (!allow_remaining) {
45683 : uint32_t highest_ofs;
45684 :
45685 0 : if (pull->offset > pull->relative_highest_offset) {
45686 0 : highest_ofs = pull->offset;
45687 : } else {
45688 0 : highest_ofs = pull->relative_highest_offset;
45689 : }
45690 0 : if (highest_ofs < pull->data_size) {
45691 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45692 : "not all bytes consumed ofs[%u] size[%u]",
45693 : highest_ofs, pull->data_size);
45694 0 : TALLOC_FREE(pull);
45695 0 : PyErr_SetNdrError(err);
45696 0 : return NULL;
45697 : }
45698 : }
45699 :
45700 0 : TALLOC_FREE(pull);
45701 0 : Py_RETURN_NONE;
45702 : }
45703 :
45704 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45705 : {
45706 : DATA_BLOB blob;
45707 0 : Py_ssize_t blob_length = 0;
45708 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45709 0 : PyObject *bigendian_obj = NULL;
45710 0 : PyObject *ndr64_obj = NULL;
45711 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45712 0 : PyObject *allow_remaining_obj = NULL;
45713 0 : bool allow_remaining = false;
45714 :
45715 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45716 : discard_const_p(char *, kwnames),
45717 : &blob.data, &blob_length,
45718 : &bigendian_obj,
45719 : &ndr64_obj,
45720 : &allow_remaining_obj)) {
45721 0 : return NULL;
45722 : }
45723 0 : blob.length = blob_length;
45724 :
45725 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45726 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45727 : }
45728 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45729 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45730 : }
45731 :
45732 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45733 0 : allow_remaining = true;
45734 : }
45735 :
45736 0 : return py_netr_ServerAuthenticate3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
45737 : }
45738 :
45739 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45740 : {
45741 : DATA_BLOB blob;
45742 0 : Py_ssize_t blob_length = 0;
45743 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45744 0 : PyObject *bigendian_obj = NULL;
45745 0 : PyObject *ndr64_obj = NULL;
45746 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45747 0 : PyObject *allow_remaining_obj = NULL;
45748 0 : bool allow_remaining = false;
45749 :
45750 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
45751 : discard_const_p(char *, kwnames),
45752 : &blob.data, &blob_length,
45753 : &bigendian_obj,
45754 : &ndr64_obj,
45755 : &allow_remaining_obj)) {
45756 0 : return NULL;
45757 : }
45758 0 : blob.length = blob_length;
45759 :
45760 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45761 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45762 : }
45763 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45764 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45765 : }
45766 :
45767 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45768 0 : allow_remaining = true;
45769 : }
45770 :
45771 0 : return py_netr_ServerAuthenticate3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
45772 : }
45773 :
45774 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
45775 : {
45776 0 : const struct ndr_interface_call *call = NULL;
45777 0 : struct netr_ServerAuthenticate3 *object = (struct netr_ServerAuthenticate3 *)pytalloc_get_ptr(py_obj);
45778 : PyObject *ret;
45779 : char *retstr;
45780 :
45781 0 : if (ndr_table_netlogon.num_calls < 27) {
45782 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerAuthenticate3_ndr_print");
45783 0 : return NULL;
45784 : }
45785 0 : call = &ndr_table_netlogon.calls[26];
45786 :
45787 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
45788 0 : ret = PyUnicode_FromString(retstr);
45789 0 : TALLOC_FREE(retstr);
45790 :
45791 0 : return ret;
45792 : }
45793 :
45794 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45795 : {
45796 0 : return py_netr_ServerAuthenticate3_ndr_print(py_obj, "netr_ServerAuthenticate3_in", NDR_IN);
45797 : }
45798 :
45799 0 : static PyObject *py_netr_ServerAuthenticate3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45800 : {
45801 0 : return py_netr_ServerAuthenticate3_ndr_print(py_obj, "netr_ServerAuthenticate3_out", NDR_OUT);
45802 : }
45803 :
45804 : static PyMethodDef py_netr_ServerAuthenticate3_methods[] = {
45805 : { "opnum", (PyCFunction)py_netr_ServerAuthenticate3_ndr_opnum, METH_NOARGS|METH_CLASS,
45806 : "netlogon.netr_ServerAuthenticate3.opnum() -> 26 (0x1a) " },
45807 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
45808 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
45809 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
45810 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
45811 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
45812 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
45813 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerAuthenticate3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
45814 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
45815 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerAuthenticate3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
45816 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerAuthenticate3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
45817 : { NULL, NULL, 0, NULL }
45818 : };
45819 :
45820 :
45821 : static PyTypeObject netr_ServerAuthenticate3_Type = {
45822 : PyVarObject_HEAD_INIT(NULL, 0)
45823 : .tp_name = "netlogon.netr_ServerAuthenticate3",
45824 : .tp_getset = py_netr_ServerAuthenticate3_getsetters,
45825 : .tp_methods = py_netr_ServerAuthenticate3_methods,
45826 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
45827 : .tp_new = py_netr_ServerAuthenticate3_new,
45828 : };
45829 :
45830 2 : static bool pack_py_netr_ServerAuthenticate3_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerAuthenticate3 *r)
45831 : {
45832 : PyObject *py_server_name;
45833 : PyObject *py_account_name;
45834 : PyObject *py_secure_channel_type;
45835 : PyObject *py_computer_name;
45836 : PyObject *py_credentials;
45837 : PyObject *py_negotiate_flags;
45838 2 : const char *kwnames[] = {
45839 : "server_name", "account_name", "secure_channel_type", "computer_name", "credentials", "negotiate_flags", NULL
45840 : };
45841 :
45842 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_ServerAuthenticate3", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credentials, &py_negotiate_flags)) {
45843 0 : return false;
45844 : }
45845 :
45846 2 : if (py_server_name == NULL) {
45847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
45848 0 : return false;
45849 : }
45850 2 : if (py_server_name == Py_None) {
45851 0 : r->in.server_name = NULL;
45852 : } else {
45853 2 : r->in.server_name = NULL;
45854 : {
45855 : const char *test_str;
45856 : const char *talloc_str;
45857 2 : PyObject *unicode = NULL;
45858 2 : if (PyUnicode_Check(py_server_name)) {
45859 2 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
45860 2 : if (unicode == NULL) {
45861 0 : PyErr_NoMemory();
45862 0 : return false;
45863 : }
45864 2 : test_str = PyBytes_AS_STRING(unicode);
45865 0 : } else if (PyBytes_Check(py_server_name)) {
45866 0 : test_str = PyBytes_AS_STRING(py_server_name);
45867 : } else {
45868 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
45869 0 : return false;
45870 : }
45871 2 : talloc_str = talloc_strdup(r, test_str);
45872 2 : if (unicode != NULL) {
45873 2 : Py_DECREF(unicode);
45874 : }
45875 2 : if (talloc_str == NULL) {
45876 0 : PyErr_NoMemory();
45877 0 : return false;
45878 : }
45879 2 : r->in.server_name = talloc_str;
45880 : }
45881 : }
45882 2 : if (py_account_name == NULL) {
45883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
45884 0 : return false;
45885 : }
45886 2 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
45887 2 : if (r->in.account_name == NULL) {
45888 0 : PyErr_NoMemory();
45889 0 : return false;
45890 : }
45891 : {
45892 : const char *test_str;
45893 : const char *talloc_str;
45894 2 : PyObject *unicode = NULL;
45895 2 : if (PyUnicode_Check(py_account_name)) {
45896 2 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
45897 2 : if (unicode == NULL) {
45898 0 : PyErr_NoMemory();
45899 0 : return false;
45900 : }
45901 2 : test_str = PyBytes_AS_STRING(unicode);
45902 0 : } else if (PyBytes_Check(py_account_name)) {
45903 0 : test_str = PyBytes_AS_STRING(py_account_name);
45904 : } else {
45905 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
45906 0 : return false;
45907 : }
45908 2 : talloc_str = talloc_strdup(r, test_str);
45909 2 : if (unicode != NULL) {
45910 2 : Py_DECREF(unicode);
45911 : }
45912 2 : if (talloc_str == NULL) {
45913 0 : PyErr_NoMemory();
45914 0 : return false;
45915 : }
45916 2 : r->in.account_name = talloc_str;
45917 : }
45918 2 : if (py_secure_channel_type == NULL) {
45919 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type");
45920 0 : return false;
45921 : }
45922 : {
45923 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type));
45924 2 : if (PyLong_Check(py_secure_channel_type)) {
45925 : unsigned long long test_var;
45926 2 : test_var = PyLong_AsUnsignedLongLong(py_secure_channel_type);
45927 2 : if (PyErr_Occurred() != NULL) {
45928 0 : return false;
45929 : }
45930 2 : if (test_var > uint_max) {
45931 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45932 : PyLong_Type.tp_name, uint_max, test_var);
45933 0 : return false;
45934 : }
45935 2 : r->in.secure_channel_type = test_var;
45936 : } else {
45937 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45938 : PyLong_Type.tp_name);
45939 0 : return false;
45940 : }
45941 : }
45942 2 : if (py_computer_name == NULL) {
45943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
45944 0 : return false;
45945 : }
45946 2 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
45947 2 : if (r->in.computer_name == NULL) {
45948 0 : PyErr_NoMemory();
45949 0 : return false;
45950 : }
45951 : {
45952 : const char *test_str;
45953 : const char *talloc_str;
45954 2 : PyObject *unicode = NULL;
45955 2 : if (PyUnicode_Check(py_computer_name)) {
45956 2 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
45957 2 : if (unicode == NULL) {
45958 0 : PyErr_NoMemory();
45959 0 : return false;
45960 : }
45961 2 : test_str = PyBytes_AS_STRING(unicode);
45962 0 : } else if (PyBytes_Check(py_computer_name)) {
45963 0 : test_str = PyBytes_AS_STRING(py_computer_name);
45964 : } else {
45965 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
45966 0 : return false;
45967 : }
45968 2 : talloc_str = talloc_strdup(r, test_str);
45969 2 : if (unicode != NULL) {
45970 2 : Py_DECREF(unicode);
45971 : }
45972 2 : if (talloc_str == NULL) {
45973 0 : PyErr_NoMemory();
45974 0 : return false;
45975 : }
45976 2 : r->in.computer_name = talloc_str;
45977 : }
45978 2 : if (py_credentials == NULL) {
45979 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credentials");
45980 0 : return false;
45981 : }
45982 2 : r->in.credentials = talloc_ptrtype(r, r->in.credentials);
45983 2 : if (r->in.credentials == NULL) {
45984 0 : PyErr_NoMemory();
45985 0 : return false;
45986 : }
45987 2 : PY_CHECK_TYPE(&netr_Credential_Type, py_credentials, return false;);
45988 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credentials)) == NULL) {
45989 0 : PyErr_NoMemory();
45990 0 : return false;
45991 : }
45992 2 : r->in.credentials = (struct netr_Credential *)pytalloc_get_ptr(py_credentials);
45993 2 : if (py_negotiate_flags == NULL) {
45994 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.negotiate_flags");
45995 0 : return false;
45996 : }
45997 2 : r->in.negotiate_flags = talloc_ptrtype(r, r->in.negotiate_flags);
45998 2 : if (r->in.negotiate_flags == NULL) {
45999 0 : PyErr_NoMemory();
46000 0 : return false;
46001 : }
46002 : {
46003 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.negotiate_flags));
46004 2 : if (PyLong_Check(py_negotiate_flags)) {
46005 : unsigned long long test_var;
46006 2 : test_var = PyLong_AsUnsignedLongLong(py_negotiate_flags);
46007 2 : if (PyErr_Occurred() != NULL) {
46008 0 : return false;
46009 : }
46010 2 : if (test_var > uint_max) {
46011 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46012 : PyLong_Type.tp_name, uint_max, test_var);
46013 0 : return false;
46014 : }
46015 2 : *r->in.negotiate_flags = test_var;
46016 : } else {
46017 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46018 : PyLong_Type.tp_name);
46019 0 : return false;
46020 : }
46021 : }
46022 2 : return true;
46023 : }
46024 :
46025 2 : static PyObject *unpack_py_netr_ServerAuthenticate3_args_out(struct netr_ServerAuthenticate3 *r)
46026 : {
46027 : PyObject *result;
46028 : PyObject *py_return_credentials;
46029 : PyObject *py_negotiate_flags;
46030 : PyObject *py_rid;
46031 2 : result = PyTuple_New(3);
46032 2 : py_return_credentials = pytalloc_reference_ex(&netr_Credential_Type, r->out.return_credentials, r->out.return_credentials);
46033 2 : PyTuple_SetItem(result, 0, py_return_credentials);
46034 2 : py_negotiate_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.negotiate_flags);
46035 2 : PyTuple_SetItem(result, 1, py_negotiate_flags);
46036 2 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid);
46037 2 : PyTuple_SetItem(result, 2, py_rid);
46038 2 : if (NT_STATUS_IS_ERR(r->out.result)) {
46039 2 : PyErr_SetNTSTATUS(r->out.result);
46040 2 : return NULL;
46041 : }
46042 :
46043 0 : return result;
46044 : }
46045 :
46046 :
46047 0 : static PyObject *py_netr_DsRGetDCNameEx_in_get_server_unc(PyObject *obj, void *closure)
46048 : {
46049 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj);
46050 : PyObject *py_server_unc;
46051 0 : if (object->in.server_unc == NULL) {
46052 0 : Py_RETURN_NONE;
46053 : }
46054 0 : if (object->in.server_unc == NULL) {
46055 0 : py_server_unc = Py_None;
46056 0 : Py_INCREF(py_server_unc);
46057 : } else {
46058 0 : if (object->in.server_unc == NULL) {
46059 0 : py_server_unc = Py_None;
46060 0 : Py_INCREF(py_server_unc);
46061 : } else {
46062 0 : py_server_unc = PyUnicode_Decode(object->in.server_unc, strlen(object->in.server_unc), "utf-8", "ignore");
46063 : }
46064 : }
46065 0 : return py_server_unc;
46066 : }
46067 :
46068 0 : static int py_netr_DsRGetDCNameEx_in_set_server_unc(PyObject *py_obj, PyObject *value, void *closure)
46069 : {
46070 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46071 0 : if (value == NULL) {
46072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_unc");
46073 0 : return -1;
46074 : }
46075 0 : if (value == Py_None) {
46076 0 : object->in.server_unc = NULL;
46077 : } else {
46078 0 : object->in.server_unc = NULL;
46079 : {
46080 : const char *test_str;
46081 : const char *talloc_str;
46082 0 : PyObject *unicode = NULL;
46083 0 : if (PyUnicode_Check(value)) {
46084 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
46085 0 : if (unicode == NULL) {
46086 0 : PyErr_NoMemory();
46087 0 : return -1;
46088 : }
46089 0 : test_str = PyBytes_AS_STRING(unicode);
46090 0 : } else if (PyBytes_Check(value)) {
46091 0 : test_str = PyBytes_AS_STRING(value);
46092 : } else {
46093 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
46094 0 : return -1;
46095 : }
46096 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
46097 0 : if (unicode != NULL) {
46098 0 : Py_DECREF(unicode);
46099 : }
46100 0 : if (talloc_str == NULL) {
46101 0 : PyErr_NoMemory();
46102 0 : return -1;
46103 : }
46104 0 : object->in.server_unc = talloc_str;
46105 : }
46106 : }
46107 0 : return 0;
46108 : }
46109 :
46110 0 : static PyObject *py_netr_DsRGetDCNameEx_in_get_domain_name(PyObject *obj, void *closure)
46111 : {
46112 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj);
46113 : PyObject *py_domain_name;
46114 0 : if (object->in.domain_name == NULL) {
46115 0 : Py_RETURN_NONE;
46116 : }
46117 0 : if (object->in.domain_name == NULL) {
46118 0 : py_domain_name = Py_None;
46119 0 : Py_INCREF(py_domain_name);
46120 : } else {
46121 0 : if (object->in.domain_name == NULL) {
46122 0 : py_domain_name = Py_None;
46123 0 : Py_INCREF(py_domain_name);
46124 : } else {
46125 0 : py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
46126 : }
46127 : }
46128 0 : return py_domain_name;
46129 : }
46130 :
46131 0 : static int py_netr_DsRGetDCNameEx_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
46132 : {
46133 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46134 0 : if (value == NULL) {
46135 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
46136 0 : return -1;
46137 : }
46138 0 : if (value == Py_None) {
46139 0 : object->in.domain_name = NULL;
46140 : } else {
46141 0 : object->in.domain_name = NULL;
46142 : {
46143 : const char *test_str;
46144 : const char *talloc_str;
46145 0 : PyObject *unicode = NULL;
46146 0 : if (PyUnicode_Check(value)) {
46147 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
46148 0 : if (unicode == NULL) {
46149 0 : PyErr_NoMemory();
46150 0 : return -1;
46151 : }
46152 0 : test_str = PyBytes_AS_STRING(unicode);
46153 0 : } else if (PyBytes_Check(value)) {
46154 0 : test_str = PyBytes_AS_STRING(value);
46155 : } else {
46156 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
46157 0 : return -1;
46158 : }
46159 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
46160 0 : if (unicode != NULL) {
46161 0 : Py_DECREF(unicode);
46162 : }
46163 0 : if (talloc_str == NULL) {
46164 0 : PyErr_NoMemory();
46165 0 : return -1;
46166 : }
46167 0 : object->in.domain_name = talloc_str;
46168 : }
46169 : }
46170 0 : return 0;
46171 : }
46172 :
46173 0 : static PyObject *py_netr_DsRGetDCNameEx_in_get_domain_guid(PyObject *obj, void *closure)
46174 : {
46175 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj);
46176 : PyObject *py_domain_guid;
46177 0 : if (object->in.domain_guid == NULL) {
46178 0 : Py_RETURN_NONE;
46179 : }
46180 0 : if (object->in.domain_guid == NULL) {
46181 0 : py_domain_guid = Py_None;
46182 0 : Py_INCREF(py_domain_guid);
46183 : } else {
46184 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, object->in.domain_guid, object->in.domain_guid);
46185 : }
46186 0 : return py_domain_guid;
46187 : }
46188 :
46189 0 : static int py_netr_DsRGetDCNameEx_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
46190 : {
46191 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46192 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_guid));
46193 0 : if (value == NULL) {
46194 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_guid");
46195 0 : return -1;
46196 : }
46197 0 : if (value == Py_None) {
46198 0 : object->in.domain_guid = NULL;
46199 : } else {
46200 0 : object->in.domain_guid = NULL;
46201 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
46202 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46203 0 : PyErr_NoMemory();
46204 0 : return -1;
46205 : }
46206 0 : object->in.domain_guid = (struct GUID *)pytalloc_get_ptr(value);
46207 : }
46208 0 : return 0;
46209 : }
46210 :
46211 0 : static PyObject *py_netr_DsRGetDCNameEx_in_get_site_name(PyObject *obj, void *closure)
46212 : {
46213 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj);
46214 : PyObject *py_site_name;
46215 0 : if (object->in.site_name == NULL) {
46216 0 : Py_RETURN_NONE;
46217 : }
46218 0 : if (object->in.site_name == NULL) {
46219 0 : py_site_name = Py_None;
46220 0 : Py_INCREF(py_site_name);
46221 : } else {
46222 0 : if (object->in.site_name == NULL) {
46223 0 : py_site_name = Py_None;
46224 0 : Py_INCREF(py_site_name);
46225 : } else {
46226 0 : py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
46227 : }
46228 : }
46229 0 : return py_site_name;
46230 : }
46231 :
46232 0 : static int py_netr_DsRGetDCNameEx_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
46233 : {
46234 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46235 0 : if (value == NULL) {
46236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_name");
46237 0 : return -1;
46238 : }
46239 0 : if (value == Py_None) {
46240 0 : object->in.site_name = NULL;
46241 : } else {
46242 0 : object->in.site_name = NULL;
46243 : {
46244 : const char *test_str;
46245 : const char *talloc_str;
46246 0 : PyObject *unicode = NULL;
46247 0 : if (PyUnicode_Check(value)) {
46248 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
46249 0 : if (unicode == NULL) {
46250 0 : PyErr_NoMemory();
46251 0 : return -1;
46252 : }
46253 0 : test_str = PyBytes_AS_STRING(unicode);
46254 0 : } else if (PyBytes_Check(value)) {
46255 0 : test_str = PyBytes_AS_STRING(value);
46256 : } else {
46257 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
46258 0 : return -1;
46259 : }
46260 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
46261 0 : if (unicode != NULL) {
46262 0 : Py_DECREF(unicode);
46263 : }
46264 0 : if (talloc_str == NULL) {
46265 0 : PyErr_NoMemory();
46266 0 : return -1;
46267 : }
46268 0 : object->in.site_name = talloc_str;
46269 : }
46270 : }
46271 0 : return 0;
46272 : }
46273 :
46274 0 : static PyObject *py_netr_DsRGetDCNameEx_in_get_flags(PyObject *obj, void *closure)
46275 : {
46276 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj);
46277 : PyObject *py_flags;
46278 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
46279 0 : return py_flags;
46280 : }
46281 :
46282 0 : static int py_netr_DsRGetDCNameEx_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
46283 : {
46284 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46285 0 : if (value == NULL) {
46286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
46287 0 : return -1;
46288 : }
46289 : {
46290 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
46291 0 : if (PyLong_Check(value)) {
46292 : unsigned long long test_var;
46293 0 : test_var = PyLong_AsUnsignedLongLong(value);
46294 0 : if (PyErr_Occurred() != NULL) {
46295 0 : return -1;
46296 : }
46297 0 : if (test_var > uint_max) {
46298 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46299 : PyLong_Type.tp_name, uint_max, test_var);
46300 0 : return -1;
46301 : }
46302 0 : object->in.flags = test_var;
46303 : } else {
46304 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46305 : PyLong_Type.tp_name);
46306 0 : return -1;
46307 : }
46308 : }
46309 0 : return 0;
46310 : }
46311 :
46312 0 : static PyObject *py_netr_DsRGetDCNameEx_out_get_info(PyObject *obj, void *closure)
46313 : {
46314 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj);
46315 : PyObject *py_info;
46316 0 : if (object->out.info == NULL) {
46317 0 : Py_RETURN_NONE;
46318 : }
46319 0 : if (*object->out.info == NULL) {
46320 0 : py_info = Py_None;
46321 0 : Py_INCREF(py_info);
46322 : } else {
46323 0 : py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *object->out.info, *object->out.info);
46324 : }
46325 0 : return py_info;
46326 : }
46327 :
46328 0 : static int py_netr_DsRGetDCNameEx_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
46329 : {
46330 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46331 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
46332 0 : if (value == NULL) {
46333 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
46334 0 : return -1;
46335 : }
46336 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
46337 0 : if (object->out.info == NULL) {
46338 0 : PyErr_NoMemory();
46339 0 : return -1;
46340 : }
46341 0 : if (value == Py_None) {
46342 0 : *object->out.info = NULL;
46343 : } else {
46344 0 : *object->out.info = NULL;
46345 0 : PY_CHECK_TYPE(&netr_DsRGetDCNameInfo_Type, value, return -1;);
46346 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46347 0 : PyErr_NoMemory();
46348 0 : return -1;
46349 : }
46350 0 : *object->out.info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value);
46351 : }
46352 0 : return 0;
46353 : }
46354 :
46355 0 : static PyObject *py_netr_DsRGetDCNameEx_get_result(PyObject *obj, void *closure)
46356 : {
46357 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(obj);
46358 : PyObject *py_result;
46359 0 : py_result = PyErr_FromWERROR(object->out.result);
46360 0 : return py_result;
46361 : }
46362 :
46363 0 : static int py_netr_DsRGetDCNameEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
46364 : {
46365 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46366 0 : if (value == NULL) {
46367 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
46368 0 : return -1;
46369 : }
46370 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
46371 0 : return 0;
46372 : }
46373 :
46374 : static PyGetSetDef py_netr_DsRGetDCNameEx_getsetters[] = {
46375 : {
46376 : .name = discard_const_p(char, "in_server_unc"),
46377 : .get = py_netr_DsRGetDCNameEx_in_get_server_unc,
46378 : .set = py_netr_DsRGetDCNameEx_in_set_server_unc,
46379 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
46380 : },
46381 : {
46382 : .name = discard_const_p(char, "in_domain_name"),
46383 : .get = py_netr_DsRGetDCNameEx_in_get_domain_name,
46384 : .set = py_netr_DsRGetDCNameEx_in_set_domain_name,
46385 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
46386 : },
46387 : {
46388 : .name = discard_const_p(char, "in_domain_guid"),
46389 : .get = py_netr_DsRGetDCNameEx_in_get_domain_guid,
46390 : .set = py_netr_DsRGetDCNameEx_in_set_domain_guid,
46391 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
46392 : },
46393 : {
46394 : .name = discard_const_p(char, "in_site_name"),
46395 : .get = py_netr_DsRGetDCNameEx_in_get_site_name,
46396 : .set = py_netr_DsRGetDCNameEx_in_set_site_name,
46397 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
46398 : },
46399 : {
46400 : .name = discard_const_p(char, "in_flags"),
46401 : .get = py_netr_DsRGetDCNameEx_in_get_flags,
46402 : .set = py_netr_DsRGetDCNameEx_in_set_flags,
46403 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCName_flags")
46404 : },
46405 : {
46406 : .name = discard_const_p(char, "out_info"),
46407 : .get = py_netr_DsRGetDCNameEx_out_get_info,
46408 : .set = py_netr_DsRGetDCNameEx_out_set_info,
46409 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo")
46410 : },
46411 : {
46412 : .name = discard_const_p(char, "result"),
46413 : .get = py_netr_DsRGetDCNameEx_get_result,
46414 : .set = py_netr_DsRGetDCNameEx_set_result,
46415 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
46416 : },
46417 : { .name = NULL }
46418 : };
46419 :
46420 0 : static PyObject *py_netr_DsRGetDCNameEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
46421 : {
46422 0 : PyObject *self = pytalloc_new(struct netr_DsRGetDCNameEx, type);
46423 0 : struct netr_DsRGetDCNameEx *_self = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(self);
46424 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
46425 : /* a pointer to a NULL pointer */
46426 0 : _self->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
46427 0 : return self;
46428 : }
46429 :
46430 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
46431 : {
46432 :
46433 :
46434 0 : return PyLong_FromLong(27);
46435 : }
46436 :
46437 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
46438 : {
46439 0 : const struct ndr_interface_call *call = NULL;
46440 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46441 0 : PyObject *ret = NULL;
46442 0 : struct ndr_push *push = NULL;
46443 : DATA_BLOB blob;
46444 : enum ndr_err_code err;
46445 :
46446 0 : if (ndr_table_netlogon.num_calls < 28) {
46447 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx_ndr_pack");
46448 0 : return NULL;
46449 : }
46450 0 : call = &ndr_table_netlogon.calls[27];
46451 :
46452 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
46453 0 : if (push == NULL) {
46454 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46455 0 : return NULL;
46456 : }
46457 :
46458 0 : push->flags |= ndr_push_flags;
46459 :
46460 0 : err = call->ndr_push(push, ndr_inout_flags, object);
46461 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46462 0 : TALLOC_FREE(push);
46463 0 : PyErr_SetNdrError(err);
46464 0 : return NULL;
46465 : }
46466 0 : blob = ndr_push_blob(push);
46467 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
46468 0 : TALLOC_FREE(push);
46469 0 : return ret;
46470 : }
46471 :
46472 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46473 : {
46474 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46475 0 : PyObject *bigendian_obj = NULL;
46476 0 : PyObject *ndr64_obj = NULL;
46477 0 : uint32_t ndr_push_flags = 0;
46478 :
46479 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
46480 : discard_const_p(char *, kwnames),
46481 : &bigendian_obj,
46482 : &ndr64_obj)) {
46483 0 : return NULL;
46484 : }
46485 :
46486 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46487 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46488 : }
46489 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46490 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46491 : }
46492 :
46493 0 : return py_netr_DsRGetDCNameEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
46494 : }
46495 :
46496 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46497 : {
46498 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46499 0 : PyObject *bigendian_obj = NULL;
46500 0 : PyObject *ndr64_obj = NULL;
46501 0 : uint32_t ndr_push_flags = 0;
46502 :
46503 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
46504 : discard_const_p(char *, kwnames),
46505 : &bigendian_obj,
46506 : &ndr64_obj)) {
46507 0 : return NULL;
46508 : }
46509 :
46510 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46511 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46512 : }
46513 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46514 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46515 : }
46516 :
46517 0 : return py_netr_DsRGetDCNameEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
46518 : }
46519 :
46520 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
46521 : {
46522 0 : const struct ndr_interface_call *call = NULL;
46523 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46524 0 : struct ndr_pull *pull = NULL;
46525 : enum ndr_err_code err;
46526 :
46527 0 : if (ndr_table_netlogon.num_calls < 28) {
46528 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx_ndr_unpack");
46529 0 : return NULL;
46530 : }
46531 0 : call = &ndr_table_netlogon.calls[27];
46532 :
46533 0 : pull = ndr_pull_init_blob(blob, object);
46534 0 : if (pull == NULL) {
46535 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46536 0 : return NULL;
46537 : }
46538 :
46539 0 : pull->flags |= ndr_pull_flags;
46540 :
46541 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
46542 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46543 0 : TALLOC_FREE(pull);
46544 0 : PyErr_SetNdrError(err);
46545 0 : return NULL;
46546 : }
46547 0 : if (!allow_remaining) {
46548 : uint32_t highest_ofs;
46549 :
46550 0 : if (pull->offset > pull->relative_highest_offset) {
46551 0 : highest_ofs = pull->offset;
46552 : } else {
46553 0 : highest_ofs = pull->relative_highest_offset;
46554 : }
46555 0 : if (highest_ofs < pull->data_size) {
46556 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
46557 : "not all bytes consumed ofs[%u] size[%u]",
46558 : highest_ofs, pull->data_size);
46559 0 : TALLOC_FREE(pull);
46560 0 : PyErr_SetNdrError(err);
46561 0 : return NULL;
46562 : }
46563 : }
46564 :
46565 0 : TALLOC_FREE(pull);
46566 0 : Py_RETURN_NONE;
46567 : }
46568 :
46569 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46570 : {
46571 : DATA_BLOB blob;
46572 0 : Py_ssize_t blob_length = 0;
46573 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46574 0 : PyObject *bigendian_obj = NULL;
46575 0 : PyObject *ndr64_obj = NULL;
46576 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46577 0 : PyObject *allow_remaining_obj = NULL;
46578 0 : bool allow_remaining = false;
46579 :
46580 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
46581 : discard_const_p(char *, kwnames),
46582 : &blob.data, &blob_length,
46583 : &bigendian_obj,
46584 : &ndr64_obj,
46585 : &allow_remaining_obj)) {
46586 0 : return NULL;
46587 : }
46588 0 : blob.length = blob_length;
46589 :
46590 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46591 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46592 : }
46593 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46594 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46595 : }
46596 :
46597 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46598 0 : allow_remaining = true;
46599 : }
46600 :
46601 0 : return py_netr_DsRGetDCNameEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46602 : }
46603 :
46604 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46605 : {
46606 : DATA_BLOB blob;
46607 0 : Py_ssize_t blob_length = 0;
46608 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46609 0 : PyObject *bigendian_obj = NULL;
46610 0 : PyObject *ndr64_obj = NULL;
46611 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46612 0 : PyObject *allow_remaining_obj = NULL;
46613 0 : bool allow_remaining = false;
46614 :
46615 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46616 : discard_const_p(char *, kwnames),
46617 : &blob.data, &blob_length,
46618 : &bigendian_obj,
46619 : &ndr64_obj,
46620 : &allow_remaining_obj)) {
46621 0 : return NULL;
46622 : }
46623 0 : blob.length = blob_length;
46624 :
46625 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46626 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46627 : }
46628 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46629 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46630 : }
46631 :
46632 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46633 0 : allow_remaining = true;
46634 : }
46635 :
46636 0 : return py_netr_DsRGetDCNameEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
46637 : }
46638 :
46639 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
46640 : {
46641 0 : const struct ndr_interface_call *call = NULL;
46642 0 : struct netr_DsRGetDCNameEx *object = (struct netr_DsRGetDCNameEx *)pytalloc_get_ptr(py_obj);
46643 : PyObject *ret;
46644 : char *retstr;
46645 :
46646 0 : if (ndr_table_netlogon.num_calls < 28) {
46647 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx_ndr_print");
46648 0 : return NULL;
46649 : }
46650 0 : call = &ndr_table_netlogon.calls[27];
46651 :
46652 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
46653 0 : ret = PyUnicode_FromString(retstr);
46654 0 : TALLOC_FREE(retstr);
46655 :
46656 0 : return ret;
46657 : }
46658 :
46659 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46660 : {
46661 0 : return py_netr_DsRGetDCNameEx_ndr_print(py_obj, "netr_DsRGetDCNameEx_in", NDR_IN);
46662 : }
46663 :
46664 0 : static PyObject *py_netr_DsRGetDCNameEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46665 : {
46666 0 : return py_netr_DsRGetDCNameEx_ndr_print(py_obj, "netr_DsRGetDCNameEx_out", NDR_OUT);
46667 : }
46668 :
46669 : static PyMethodDef py_netr_DsRGetDCNameEx_methods[] = {
46670 : { "opnum", (PyCFunction)py_netr_DsRGetDCNameEx_ndr_opnum, METH_NOARGS|METH_CLASS,
46671 : "netlogon.netr_DsRGetDCNameEx.opnum() -> 27 (0x1b) " },
46672 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
46673 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
46674 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
46675 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
46676 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
46677 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
46678 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
46679 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
46680 : { "__ndr_print_in__", (PyCFunction)py_netr_DsRGetDCNameEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
46681 : { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetDCNameEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
46682 : { NULL, NULL, 0, NULL }
46683 : };
46684 :
46685 :
46686 : static PyTypeObject netr_DsRGetDCNameEx_Type = {
46687 : PyVarObject_HEAD_INIT(NULL, 0)
46688 : .tp_name = "netlogon.netr_DsRGetDCNameEx",
46689 : .tp_getset = py_netr_DsRGetDCNameEx_getsetters,
46690 : .tp_methods = py_netr_DsRGetDCNameEx_methods,
46691 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46692 : .tp_new = py_netr_DsRGetDCNameEx_new,
46693 : };
46694 :
46695 28 : static bool pack_py_netr_DsRGetDCNameEx_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetDCNameEx *r)
46696 : {
46697 : PyObject *py_server_unc;
46698 : PyObject *py_domain_name;
46699 : PyObject *py_domain_guid;
46700 : PyObject *py_site_name;
46701 : PyObject *py_flags;
46702 28 : const char *kwnames[] = {
46703 : "server_unc", "domain_name", "domain_guid", "site_name", "flags", NULL
46704 : };
46705 :
46706 28 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_DsRGetDCNameEx", discard_const_p(char *, kwnames), &py_server_unc, &py_domain_name, &py_domain_guid, &py_site_name, &py_flags)) {
46707 0 : return false;
46708 : }
46709 :
46710 28 : if (py_server_unc == NULL) {
46711 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_unc");
46712 0 : return false;
46713 : }
46714 28 : if (py_server_unc == Py_None) {
46715 0 : r->in.server_unc = NULL;
46716 : } else {
46717 28 : r->in.server_unc = NULL;
46718 : {
46719 : const char *test_str;
46720 : const char *talloc_str;
46721 28 : PyObject *unicode = NULL;
46722 28 : if (PyUnicode_Check(py_server_unc)) {
46723 28 : unicode = PyUnicode_AsEncodedString(py_server_unc, "utf-8", "ignore");
46724 28 : if (unicode == NULL) {
46725 0 : PyErr_NoMemory();
46726 0 : return false;
46727 : }
46728 28 : test_str = PyBytes_AS_STRING(unicode);
46729 0 : } else if (PyBytes_Check(py_server_unc)) {
46730 0 : test_str = PyBytes_AS_STRING(py_server_unc);
46731 : } else {
46732 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_unc)->tp_name);
46733 0 : return false;
46734 : }
46735 28 : talloc_str = talloc_strdup(r, test_str);
46736 28 : if (unicode != NULL) {
46737 28 : Py_DECREF(unicode);
46738 : }
46739 28 : if (talloc_str == NULL) {
46740 0 : PyErr_NoMemory();
46741 0 : return false;
46742 : }
46743 28 : r->in.server_unc = talloc_str;
46744 : }
46745 : }
46746 28 : if (py_domain_name == NULL) {
46747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
46748 0 : return false;
46749 : }
46750 28 : if (py_domain_name == Py_None) {
46751 0 : r->in.domain_name = NULL;
46752 : } else {
46753 28 : r->in.domain_name = NULL;
46754 : {
46755 : const char *test_str;
46756 : const char *talloc_str;
46757 28 : PyObject *unicode = NULL;
46758 28 : if (PyUnicode_Check(py_domain_name)) {
46759 28 : unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
46760 28 : if (unicode == NULL) {
46761 0 : PyErr_NoMemory();
46762 0 : return false;
46763 : }
46764 28 : test_str = PyBytes_AS_STRING(unicode);
46765 0 : } else if (PyBytes_Check(py_domain_name)) {
46766 0 : test_str = PyBytes_AS_STRING(py_domain_name);
46767 : } else {
46768 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
46769 0 : return false;
46770 : }
46771 28 : talloc_str = talloc_strdup(r, test_str);
46772 28 : if (unicode != NULL) {
46773 28 : Py_DECREF(unicode);
46774 : }
46775 28 : if (talloc_str == NULL) {
46776 0 : PyErr_NoMemory();
46777 0 : return false;
46778 : }
46779 28 : r->in.domain_name = talloc_str;
46780 : }
46781 : }
46782 28 : if (py_domain_guid == NULL) {
46783 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_guid");
46784 0 : return false;
46785 : }
46786 28 : if (py_domain_guid == Py_None) {
46787 24 : r->in.domain_guid = NULL;
46788 : } else {
46789 4 : r->in.domain_guid = NULL;
46790 4 : PY_CHECK_TYPE(GUID_Type, py_domain_guid, return false;);
46791 4 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_guid)) == NULL) {
46792 0 : PyErr_NoMemory();
46793 0 : return false;
46794 : }
46795 4 : r->in.domain_guid = (struct GUID *)pytalloc_get_ptr(py_domain_guid);
46796 : }
46797 28 : if (py_site_name == NULL) {
46798 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_name");
46799 0 : return false;
46800 : }
46801 28 : if (py_site_name == Py_None) {
46802 12 : r->in.site_name = NULL;
46803 : } else {
46804 16 : r->in.site_name = NULL;
46805 : {
46806 : const char *test_str;
46807 : const char *talloc_str;
46808 16 : PyObject *unicode = NULL;
46809 16 : if (PyUnicode_Check(py_site_name)) {
46810 16 : unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore");
46811 16 : if (unicode == NULL) {
46812 0 : PyErr_NoMemory();
46813 0 : return false;
46814 : }
46815 16 : test_str = PyBytes_AS_STRING(unicode);
46816 0 : } else if (PyBytes_Check(py_site_name)) {
46817 0 : test_str = PyBytes_AS_STRING(py_site_name);
46818 : } else {
46819 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name);
46820 0 : return false;
46821 : }
46822 16 : talloc_str = talloc_strdup(r, test_str);
46823 16 : if (unicode != NULL) {
46824 16 : Py_DECREF(unicode);
46825 : }
46826 16 : if (talloc_str == NULL) {
46827 0 : PyErr_NoMemory();
46828 0 : return false;
46829 : }
46830 16 : r->in.site_name = talloc_str;
46831 : }
46832 : }
46833 28 : if (py_flags == NULL) {
46834 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
46835 0 : return false;
46836 : }
46837 : {
46838 28 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
46839 28 : if (PyLong_Check(py_flags)) {
46840 : unsigned long long test_var;
46841 28 : test_var = PyLong_AsUnsignedLongLong(py_flags);
46842 28 : if (PyErr_Occurred() != NULL) {
46843 0 : return false;
46844 : }
46845 28 : if (test_var > uint_max) {
46846 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46847 : PyLong_Type.tp_name, uint_max, test_var);
46848 0 : return false;
46849 : }
46850 28 : r->in.flags = test_var;
46851 : } else {
46852 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46853 : PyLong_Type.tp_name);
46854 0 : return false;
46855 : }
46856 : }
46857 28 : return true;
46858 : }
46859 :
46860 28 : static PyObject *unpack_py_netr_DsRGetDCNameEx_args_out(struct netr_DsRGetDCNameEx *r)
46861 : {
46862 : PyObject *result;
46863 : PyObject *py_info;
46864 28 : if (*r->out.info == NULL) {
46865 0 : py_info = Py_None;
46866 0 : Py_INCREF(py_info);
46867 : } else {
46868 28 : py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *r->out.info, *r->out.info);
46869 : }
46870 28 : result = py_info;
46871 28 : if (!W_ERROR_IS_OK(r->out.result)) {
46872 4 : PyErr_SetWERROR(r->out.result);
46873 4 : return NULL;
46874 : }
46875 :
46876 24 : return result;
46877 : }
46878 :
46879 :
46880 0 : static PyObject *py_netr_DsRGetSiteName_in_get_computer_name(PyObject *obj, void *closure)
46881 : {
46882 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(obj);
46883 : PyObject *py_computer_name;
46884 0 : if (object->in.computer_name == NULL) {
46885 0 : Py_RETURN_NONE;
46886 : }
46887 0 : if (object->in.computer_name == NULL) {
46888 0 : py_computer_name = Py_None;
46889 0 : Py_INCREF(py_computer_name);
46890 : } else {
46891 0 : if (object->in.computer_name == NULL) {
46892 0 : py_computer_name = Py_None;
46893 0 : Py_INCREF(py_computer_name);
46894 : } else {
46895 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
46896 : }
46897 : }
46898 0 : return py_computer_name;
46899 : }
46900 :
46901 0 : static int py_netr_DsRGetSiteName_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
46902 : {
46903 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj);
46904 0 : if (value == NULL) {
46905 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
46906 0 : return -1;
46907 : }
46908 0 : if (value == Py_None) {
46909 0 : object->in.computer_name = NULL;
46910 : } else {
46911 0 : object->in.computer_name = NULL;
46912 : {
46913 : const char *test_str;
46914 : const char *talloc_str;
46915 0 : PyObject *unicode = NULL;
46916 0 : if (PyUnicode_Check(value)) {
46917 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
46918 0 : if (unicode == NULL) {
46919 0 : PyErr_NoMemory();
46920 0 : return -1;
46921 : }
46922 0 : test_str = PyBytes_AS_STRING(unicode);
46923 0 : } else if (PyBytes_Check(value)) {
46924 0 : test_str = PyBytes_AS_STRING(value);
46925 : } else {
46926 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
46927 0 : return -1;
46928 : }
46929 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
46930 0 : if (unicode != NULL) {
46931 0 : Py_DECREF(unicode);
46932 : }
46933 0 : if (talloc_str == NULL) {
46934 0 : PyErr_NoMemory();
46935 0 : return -1;
46936 : }
46937 0 : object->in.computer_name = talloc_str;
46938 : }
46939 : }
46940 0 : return 0;
46941 : }
46942 :
46943 0 : static PyObject *py_netr_DsRGetSiteName_out_get_site(PyObject *obj, void *closure)
46944 : {
46945 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(obj);
46946 : PyObject *py_site;
46947 0 : if (object->out.site == NULL) {
46948 0 : Py_RETURN_NONE;
46949 : }
46950 0 : if (*object->out.site == NULL) {
46951 0 : py_site = Py_None;
46952 0 : Py_INCREF(py_site);
46953 : } else {
46954 0 : if (*object->out.site == NULL) {
46955 0 : py_site = Py_None;
46956 0 : Py_INCREF(py_site);
46957 : } else {
46958 0 : py_site = PyUnicode_Decode(*object->out.site, strlen(*object->out.site), "utf-8", "ignore");
46959 : }
46960 : }
46961 0 : return py_site;
46962 : }
46963 :
46964 0 : static int py_netr_DsRGetSiteName_out_set_site(PyObject *py_obj, PyObject *value, void *closure)
46965 : {
46966 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj);
46967 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.site));
46968 0 : if (value == NULL) {
46969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.site");
46970 0 : return -1;
46971 : }
46972 0 : object->out.site = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.site);
46973 0 : if (object->out.site == NULL) {
46974 0 : PyErr_NoMemory();
46975 0 : return -1;
46976 : }
46977 0 : if (value == Py_None) {
46978 0 : *object->out.site = NULL;
46979 : } else {
46980 0 : *object->out.site = NULL;
46981 : {
46982 : const char *test_str;
46983 : const char *talloc_str;
46984 0 : PyObject *unicode = NULL;
46985 0 : if (PyUnicode_Check(value)) {
46986 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
46987 0 : if (unicode == NULL) {
46988 0 : PyErr_NoMemory();
46989 0 : return -1;
46990 : }
46991 0 : test_str = PyBytes_AS_STRING(unicode);
46992 0 : } else if (PyBytes_Check(value)) {
46993 0 : test_str = PyBytes_AS_STRING(value);
46994 : } else {
46995 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
46996 0 : return -1;
46997 : }
46998 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
46999 0 : if (unicode != NULL) {
47000 0 : Py_DECREF(unicode);
47001 : }
47002 0 : if (talloc_str == NULL) {
47003 0 : PyErr_NoMemory();
47004 0 : return -1;
47005 : }
47006 0 : *object->out.site = talloc_str;
47007 : }
47008 : }
47009 0 : return 0;
47010 : }
47011 :
47012 0 : static PyObject *py_netr_DsRGetSiteName_get_result(PyObject *obj, void *closure)
47013 : {
47014 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(obj);
47015 : PyObject *py_result;
47016 0 : py_result = PyErr_FromWERROR(object->out.result);
47017 0 : return py_result;
47018 : }
47019 :
47020 0 : static int py_netr_DsRGetSiteName_set_result(PyObject *py_obj, PyObject *value, void *closure)
47021 : {
47022 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj);
47023 0 : if (value == NULL) {
47024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
47025 0 : return -1;
47026 : }
47027 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
47028 0 : return 0;
47029 : }
47030 :
47031 : static PyGetSetDef py_netr_DsRGetSiteName_getsetters[] = {
47032 : {
47033 : .name = discard_const_p(char, "in_computer_name"),
47034 : .get = py_netr_DsRGetSiteName_in_get_computer_name,
47035 : .set = py_netr_DsRGetSiteName_in_set_computer_name,
47036 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
47037 : },
47038 : {
47039 : .name = discard_const_p(char, "out_site"),
47040 : .get = py_netr_DsRGetSiteName_out_get_site,
47041 : .set = py_netr_DsRGetSiteName_out_set_site,
47042 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
47043 : },
47044 : {
47045 : .name = discard_const_p(char, "result"),
47046 : .get = py_netr_DsRGetSiteName_get_result,
47047 : .set = py_netr_DsRGetSiteName_set_result,
47048 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
47049 : },
47050 : { .name = NULL }
47051 : };
47052 :
47053 0 : static PyObject *py_netr_DsRGetSiteName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47054 : {
47055 0 : PyObject *self = pytalloc_new(struct netr_DsRGetSiteName, type);
47056 0 : return self;
47057 : }
47058 :
47059 0 : static PyObject *py_netr_DsRGetSiteName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
47060 : {
47061 :
47062 :
47063 0 : return PyLong_FromLong(28);
47064 : }
47065 :
47066 0 : static PyObject *py_netr_DsRGetSiteName_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
47067 : {
47068 0 : const struct ndr_interface_call *call = NULL;
47069 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj);
47070 0 : PyObject *ret = NULL;
47071 0 : struct ndr_push *push = NULL;
47072 : DATA_BLOB blob;
47073 : enum ndr_err_code err;
47074 :
47075 0 : if (ndr_table_netlogon.num_calls < 29) {
47076 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetSiteName_ndr_pack");
47077 0 : return NULL;
47078 : }
47079 0 : call = &ndr_table_netlogon.calls[28];
47080 :
47081 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
47082 0 : if (push == NULL) {
47083 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47084 0 : return NULL;
47085 : }
47086 :
47087 0 : push->flags |= ndr_push_flags;
47088 :
47089 0 : err = call->ndr_push(push, ndr_inout_flags, object);
47090 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47091 0 : TALLOC_FREE(push);
47092 0 : PyErr_SetNdrError(err);
47093 0 : return NULL;
47094 : }
47095 0 : blob = ndr_push_blob(push);
47096 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
47097 0 : TALLOC_FREE(push);
47098 0 : return ret;
47099 : }
47100 :
47101 0 : static PyObject *py_netr_DsRGetSiteName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47102 : {
47103 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47104 0 : PyObject *bigendian_obj = NULL;
47105 0 : PyObject *ndr64_obj = NULL;
47106 0 : uint32_t ndr_push_flags = 0;
47107 :
47108 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
47109 : discard_const_p(char *, kwnames),
47110 : &bigendian_obj,
47111 : &ndr64_obj)) {
47112 0 : return NULL;
47113 : }
47114 :
47115 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47116 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47117 : }
47118 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47119 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47120 : }
47121 :
47122 0 : return py_netr_DsRGetSiteName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
47123 : }
47124 :
47125 0 : static PyObject *py_netr_DsRGetSiteName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47126 : {
47127 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47128 0 : PyObject *bigendian_obj = NULL;
47129 0 : PyObject *ndr64_obj = NULL;
47130 0 : uint32_t ndr_push_flags = 0;
47131 :
47132 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
47133 : discard_const_p(char *, kwnames),
47134 : &bigendian_obj,
47135 : &ndr64_obj)) {
47136 0 : return NULL;
47137 : }
47138 :
47139 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47140 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47141 : }
47142 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47143 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47144 : }
47145 :
47146 0 : return py_netr_DsRGetSiteName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
47147 : }
47148 :
47149 0 : static PyObject *py_netr_DsRGetSiteName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
47150 : {
47151 0 : const struct ndr_interface_call *call = NULL;
47152 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj);
47153 0 : struct ndr_pull *pull = NULL;
47154 : enum ndr_err_code err;
47155 :
47156 0 : if (ndr_table_netlogon.num_calls < 29) {
47157 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetSiteName_ndr_unpack");
47158 0 : return NULL;
47159 : }
47160 0 : call = &ndr_table_netlogon.calls[28];
47161 :
47162 0 : pull = ndr_pull_init_blob(blob, object);
47163 0 : if (pull == NULL) {
47164 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47165 0 : return NULL;
47166 : }
47167 :
47168 0 : pull->flags |= ndr_pull_flags;
47169 :
47170 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
47171 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47172 0 : TALLOC_FREE(pull);
47173 0 : PyErr_SetNdrError(err);
47174 0 : return NULL;
47175 : }
47176 0 : if (!allow_remaining) {
47177 : uint32_t highest_ofs;
47178 :
47179 0 : if (pull->offset > pull->relative_highest_offset) {
47180 0 : highest_ofs = pull->offset;
47181 : } else {
47182 0 : highest_ofs = pull->relative_highest_offset;
47183 : }
47184 0 : if (highest_ofs < pull->data_size) {
47185 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
47186 : "not all bytes consumed ofs[%u] size[%u]",
47187 : highest_ofs, pull->data_size);
47188 0 : TALLOC_FREE(pull);
47189 0 : PyErr_SetNdrError(err);
47190 0 : return NULL;
47191 : }
47192 : }
47193 :
47194 0 : TALLOC_FREE(pull);
47195 0 : Py_RETURN_NONE;
47196 : }
47197 :
47198 0 : static PyObject *py_netr_DsRGetSiteName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47199 : {
47200 : DATA_BLOB blob;
47201 0 : Py_ssize_t blob_length = 0;
47202 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47203 0 : PyObject *bigendian_obj = NULL;
47204 0 : PyObject *ndr64_obj = NULL;
47205 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47206 0 : PyObject *allow_remaining_obj = NULL;
47207 0 : bool allow_remaining = false;
47208 :
47209 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
47210 : discard_const_p(char *, kwnames),
47211 : &blob.data, &blob_length,
47212 : &bigendian_obj,
47213 : &ndr64_obj,
47214 : &allow_remaining_obj)) {
47215 0 : return NULL;
47216 : }
47217 0 : blob.length = blob_length;
47218 :
47219 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47220 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47221 : }
47222 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47223 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47224 : }
47225 :
47226 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47227 0 : allow_remaining = true;
47228 : }
47229 :
47230 0 : return py_netr_DsRGetSiteName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
47231 : }
47232 :
47233 0 : static PyObject *py_netr_DsRGetSiteName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47234 : {
47235 : DATA_BLOB blob;
47236 0 : Py_ssize_t blob_length = 0;
47237 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47238 0 : PyObject *bigendian_obj = NULL;
47239 0 : PyObject *ndr64_obj = NULL;
47240 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47241 0 : PyObject *allow_remaining_obj = NULL;
47242 0 : bool allow_remaining = false;
47243 :
47244 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
47245 : discard_const_p(char *, kwnames),
47246 : &blob.data, &blob_length,
47247 : &bigendian_obj,
47248 : &ndr64_obj,
47249 : &allow_remaining_obj)) {
47250 0 : return NULL;
47251 : }
47252 0 : blob.length = blob_length;
47253 :
47254 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47255 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47256 : }
47257 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47258 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47259 : }
47260 :
47261 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47262 0 : allow_remaining = true;
47263 : }
47264 :
47265 0 : return py_netr_DsRGetSiteName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
47266 : }
47267 :
47268 0 : static PyObject *py_netr_DsRGetSiteName_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
47269 : {
47270 0 : const struct ndr_interface_call *call = NULL;
47271 0 : struct netr_DsRGetSiteName *object = (struct netr_DsRGetSiteName *)pytalloc_get_ptr(py_obj);
47272 : PyObject *ret;
47273 : char *retstr;
47274 :
47275 0 : if (ndr_table_netlogon.num_calls < 29) {
47276 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetSiteName_ndr_print");
47277 0 : return NULL;
47278 : }
47279 0 : call = &ndr_table_netlogon.calls[28];
47280 :
47281 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
47282 0 : ret = PyUnicode_FromString(retstr);
47283 0 : TALLOC_FREE(retstr);
47284 :
47285 0 : return ret;
47286 : }
47287 :
47288 0 : static PyObject *py_netr_DsRGetSiteName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47289 : {
47290 0 : return py_netr_DsRGetSiteName_ndr_print(py_obj, "netr_DsRGetSiteName_in", NDR_IN);
47291 : }
47292 :
47293 0 : static PyObject *py_netr_DsRGetSiteName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47294 : {
47295 0 : return py_netr_DsRGetSiteName_ndr_print(py_obj, "netr_DsRGetSiteName_out", NDR_OUT);
47296 : }
47297 :
47298 : static PyMethodDef py_netr_DsRGetSiteName_methods[] = {
47299 : { "opnum", (PyCFunction)py_netr_DsRGetSiteName_ndr_opnum, METH_NOARGS|METH_CLASS,
47300 : "netlogon.netr_DsRGetSiteName.opnum() -> 28 (0x1c) " },
47301 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetSiteName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
47302 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
47303 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetSiteName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
47304 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
47305 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetSiteName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
47306 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
47307 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetSiteName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
47308 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
47309 : { "__ndr_print_in__", (PyCFunction)py_netr_DsRGetSiteName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
47310 : { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetSiteName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
47311 : { NULL, NULL, 0, NULL }
47312 : };
47313 :
47314 :
47315 : static PyTypeObject netr_DsRGetSiteName_Type = {
47316 : PyVarObject_HEAD_INIT(NULL, 0)
47317 : .tp_name = "netlogon.netr_DsRGetSiteName",
47318 : .tp_getset = py_netr_DsRGetSiteName_getsetters,
47319 : .tp_methods = py_netr_DsRGetSiteName_methods,
47320 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47321 : .tp_new = py_netr_DsRGetSiteName_new,
47322 : };
47323 :
47324 0 : static bool pack_py_netr_DsRGetSiteName_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetSiteName *r)
47325 : {
47326 : PyObject *py_computer_name;
47327 0 : const char *kwnames[] = {
47328 : "computer_name", NULL
47329 : };
47330 :
47331 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:netr_DsRGetSiteName", discard_const_p(char *, kwnames), &py_computer_name)) {
47332 0 : return false;
47333 : }
47334 :
47335 0 : if (py_computer_name == NULL) {
47336 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
47337 0 : return false;
47338 : }
47339 0 : if (py_computer_name == Py_None) {
47340 0 : r->in.computer_name = NULL;
47341 : } else {
47342 0 : r->in.computer_name = NULL;
47343 : {
47344 : const char *test_str;
47345 : const char *talloc_str;
47346 0 : PyObject *unicode = NULL;
47347 0 : if (PyUnicode_Check(py_computer_name)) {
47348 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
47349 0 : if (unicode == NULL) {
47350 0 : PyErr_NoMemory();
47351 0 : return false;
47352 : }
47353 0 : test_str = PyBytes_AS_STRING(unicode);
47354 0 : } else if (PyBytes_Check(py_computer_name)) {
47355 0 : test_str = PyBytes_AS_STRING(py_computer_name);
47356 : } else {
47357 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
47358 0 : return false;
47359 : }
47360 0 : talloc_str = talloc_strdup(r, test_str);
47361 0 : if (unicode != NULL) {
47362 0 : Py_DECREF(unicode);
47363 : }
47364 0 : if (talloc_str == NULL) {
47365 0 : PyErr_NoMemory();
47366 0 : return false;
47367 : }
47368 0 : r->in.computer_name = talloc_str;
47369 : }
47370 : }
47371 0 : return true;
47372 : }
47373 :
47374 0 : static PyObject *unpack_py_netr_DsRGetSiteName_args_out(struct netr_DsRGetSiteName *r)
47375 : {
47376 : PyObject *result;
47377 : PyObject *py_site;
47378 0 : if (*r->out.site == NULL) {
47379 0 : py_site = Py_None;
47380 0 : Py_INCREF(py_site);
47381 : } else {
47382 0 : if (*r->out.site == NULL) {
47383 0 : py_site = Py_None;
47384 0 : Py_INCREF(py_site);
47385 : } else {
47386 0 : py_site = PyUnicode_Decode(*r->out.site, strlen(*r->out.site), "utf-8", "ignore");
47387 : }
47388 : }
47389 0 : result = py_site;
47390 0 : if (!W_ERROR_IS_OK(r->out.result)) {
47391 0 : PyErr_SetWERROR(r->out.result);
47392 0 : return NULL;
47393 : }
47394 :
47395 0 : return result;
47396 : }
47397 :
47398 :
47399 0 : static PyObject *py_netr_LogonGetDomainInfo_in_get_server_name(PyObject *obj, void *closure)
47400 : {
47401 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47402 : PyObject *py_server_name;
47403 0 : if (object->in.server_name == NULL) {
47404 0 : Py_RETURN_NONE;
47405 : }
47406 0 : if (object->in.server_name == NULL) {
47407 0 : py_server_name = Py_None;
47408 0 : Py_INCREF(py_server_name);
47409 : } else {
47410 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
47411 : }
47412 0 : return py_server_name;
47413 : }
47414 :
47415 0 : static int py_netr_LogonGetDomainInfo_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
47416 : {
47417 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47418 0 : if (value == NULL) {
47419 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
47420 0 : return -1;
47421 : }
47422 0 : object->in.server_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.server_name);
47423 0 : if (object->in.server_name == NULL) {
47424 0 : PyErr_NoMemory();
47425 0 : return -1;
47426 : }
47427 : {
47428 : const char *test_str;
47429 : const char *talloc_str;
47430 0 : PyObject *unicode = NULL;
47431 0 : if (PyUnicode_Check(value)) {
47432 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
47433 0 : if (unicode == NULL) {
47434 0 : PyErr_NoMemory();
47435 0 : return -1;
47436 : }
47437 0 : test_str = PyBytes_AS_STRING(unicode);
47438 0 : } else if (PyBytes_Check(value)) {
47439 0 : test_str = PyBytes_AS_STRING(value);
47440 : } else {
47441 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
47442 0 : return -1;
47443 : }
47444 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
47445 0 : if (unicode != NULL) {
47446 0 : Py_DECREF(unicode);
47447 : }
47448 0 : if (talloc_str == NULL) {
47449 0 : PyErr_NoMemory();
47450 0 : return -1;
47451 : }
47452 0 : object->in.server_name = talloc_str;
47453 : }
47454 0 : return 0;
47455 : }
47456 :
47457 0 : static PyObject *py_netr_LogonGetDomainInfo_in_get_computer_name(PyObject *obj, void *closure)
47458 : {
47459 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47460 : PyObject *py_computer_name;
47461 0 : if (object->in.computer_name == NULL) {
47462 0 : Py_RETURN_NONE;
47463 : }
47464 0 : if (object->in.computer_name == NULL) {
47465 0 : py_computer_name = Py_None;
47466 0 : Py_INCREF(py_computer_name);
47467 : } else {
47468 0 : if (object->in.computer_name == NULL) {
47469 0 : py_computer_name = Py_None;
47470 0 : Py_INCREF(py_computer_name);
47471 : } else {
47472 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
47473 : }
47474 : }
47475 0 : return py_computer_name;
47476 : }
47477 :
47478 0 : static int py_netr_LogonGetDomainInfo_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
47479 : {
47480 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47481 0 : if (value == NULL) {
47482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
47483 0 : return -1;
47484 : }
47485 0 : if (value == Py_None) {
47486 0 : object->in.computer_name = NULL;
47487 : } else {
47488 0 : object->in.computer_name = NULL;
47489 : {
47490 : const char *test_str;
47491 : const char *talloc_str;
47492 0 : PyObject *unicode = NULL;
47493 0 : if (PyUnicode_Check(value)) {
47494 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
47495 0 : if (unicode == NULL) {
47496 0 : PyErr_NoMemory();
47497 0 : return -1;
47498 : }
47499 0 : test_str = PyBytes_AS_STRING(unicode);
47500 0 : } else if (PyBytes_Check(value)) {
47501 0 : test_str = PyBytes_AS_STRING(value);
47502 : } else {
47503 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
47504 0 : return -1;
47505 : }
47506 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
47507 0 : if (unicode != NULL) {
47508 0 : Py_DECREF(unicode);
47509 : }
47510 0 : if (talloc_str == NULL) {
47511 0 : PyErr_NoMemory();
47512 0 : return -1;
47513 : }
47514 0 : object->in.computer_name = talloc_str;
47515 : }
47516 : }
47517 0 : return 0;
47518 : }
47519 :
47520 0 : static PyObject *py_netr_LogonGetDomainInfo_in_get_credential(PyObject *obj, void *closure)
47521 : {
47522 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47523 : PyObject *py_credential;
47524 0 : if (object->in.credential == NULL) {
47525 0 : Py_RETURN_NONE;
47526 : }
47527 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
47528 0 : return py_credential;
47529 : }
47530 :
47531 0 : static int py_netr_LogonGetDomainInfo_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
47532 : {
47533 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47534 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
47535 0 : if (value == NULL) {
47536 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
47537 0 : return -1;
47538 : }
47539 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
47540 0 : if (object->in.credential == NULL) {
47541 0 : PyErr_NoMemory();
47542 0 : return -1;
47543 : }
47544 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
47545 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
47546 0 : PyErr_NoMemory();
47547 0 : return -1;
47548 : }
47549 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
47550 0 : return 0;
47551 : }
47552 :
47553 0 : static PyObject *py_netr_LogonGetDomainInfo_in_get_return_authenticator(PyObject *obj, void *closure)
47554 : {
47555 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47556 : PyObject *py_return_authenticator;
47557 0 : if (object->in.return_authenticator == NULL) {
47558 0 : Py_RETURN_NONE;
47559 : }
47560 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
47561 0 : return py_return_authenticator;
47562 : }
47563 :
47564 0 : static int py_netr_LogonGetDomainInfo_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
47565 : {
47566 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47567 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
47568 0 : if (value == NULL) {
47569 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
47570 0 : return -1;
47571 : }
47572 0 : object->in.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.return_authenticator);
47573 0 : if (object->in.return_authenticator == NULL) {
47574 0 : PyErr_NoMemory();
47575 0 : return -1;
47576 : }
47577 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
47578 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
47579 0 : PyErr_NoMemory();
47580 0 : return -1;
47581 : }
47582 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
47583 0 : return 0;
47584 : }
47585 :
47586 0 : static PyObject *py_netr_LogonGetDomainInfo_out_get_return_authenticator(PyObject *obj, void *closure)
47587 : {
47588 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47589 : PyObject *py_return_authenticator;
47590 0 : if (object->out.return_authenticator == NULL) {
47591 0 : Py_RETURN_NONE;
47592 : }
47593 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
47594 0 : return py_return_authenticator;
47595 : }
47596 :
47597 0 : static int py_netr_LogonGetDomainInfo_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
47598 : {
47599 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47600 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
47601 0 : if (value == NULL) {
47602 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
47603 0 : return -1;
47604 : }
47605 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
47606 0 : if (object->out.return_authenticator == NULL) {
47607 0 : PyErr_NoMemory();
47608 0 : return -1;
47609 : }
47610 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
47611 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
47612 0 : PyErr_NoMemory();
47613 0 : return -1;
47614 : }
47615 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
47616 0 : return 0;
47617 : }
47618 :
47619 0 : static PyObject *py_netr_LogonGetDomainInfo_in_get_level(PyObject *obj, void *closure)
47620 : {
47621 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47622 : PyObject *py_level;
47623 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)object->in.level);
47624 0 : return py_level;
47625 : }
47626 :
47627 0 : static int py_netr_LogonGetDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
47628 : {
47629 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47630 0 : if (value == NULL) {
47631 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
47632 0 : return -1;
47633 : }
47634 : {
47635 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
47636 0 : if (PyLong_Check(value)) {
47637 : unsigned long long test_var;
47638 0 : test_var = PyLong_AsUnsignedLongLong(value);
47639 0 : if (PyErr_Occurred() != NULL) {
47640 0 : return -1;
47641 : }
47642 0 : if (test_var > uint_max) {
47643 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47644 : PyLong_Type.tp_name, uint_max, test_var);
47645 0 : return -1;
47646 : }
47647 0 : object->in.level = test_var;
47648 : } else {
47649 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47650 : PyLong_Type.tp_name);
47651 0 : return -1;
47652 : }
47653 : }
47654 0 : return 0;
47655 : }
47656 :
47657 0 : static PyObject *py_netr_LogonGetDomainInfo_in_get_query(PyObject *obj, void *closure)
47658 : {
47659 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47660 : PyObject *py_query;
47661 0 : if (object->in.query == NULL) {
47662 0 : Py_RETURN_NONE;
47663 : }
47664 0 : py_query = pyrpc_import_union(&netr_WorkstationInfo_Type, object->in.query, object->in.level, object->in.query, "union netr_WorkstationInfo");
47665 0 : if (py_query == NULL) {
47666 0 : return NULL;
47667 : }
47668 0 : return py_query;
47669 : }
47670 :
47671 0 : static int py_netr_LogonGetDomainInfo_in_set_query(PyObject *py_obj, PyObject *value, void *closure)
47672 : {
47673 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47674 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.query));
47675 0 : if (value == NULL) {
47676 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.query");
47677 0 : return -1;
47678 : }
47679 0 : object->in.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.query);
47680 0 : if (object->in.query == NULL) {
47681 0 : PyErr_NoMemory();
47682 0 : return -1;
47683 : }
47684 : {
47685 : union netr_WorkstationInfo *query_switch_1;
47686 0 : query_switch_1 = (union netr_WorkstationInfo *)pyrpc_export_union(&netr_WorkstationInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_WorkstationInfo");
47687 0 : if (query_switch_1 == NULL) {
47688 0 : return -1;
47689 : }
47690 0 : object->in.query = query_switch_1;
47691 : }
47692 0 : return 0;
47693 : }
47694 :
47695 0 : static PyObject *py_netr_LogonGetDomainInfo_out_get_info(PyObject *obj, void *closure)
47696 : {
47697 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47698 : PyObject *py_info;
47699 0 : if (object->out.info == NULL) {
47700 0 : Py_RETURN_NONE;
47701 : }
47702 0 : py_info = pyrpc_import_union(&netr_DomainInfo_Type, object->out.info, object->in.level, object->out.info, "union netr_DomainInfo");
47703 0 : if (py_info == NULL) {
47704 0 : return NULL;
47705 : }
47706 0 : return py_info;
47707 : }
47708 :
47709 0 : static int py_netr_LogonGetDomainInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
47710 : {
47711 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47712 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
47713 0 : if (value == NULL) {
47714 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
47715 0 : return -1;
47716 : }
47717 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
47718 0 : if (object->out.info == NULL) {
47719 0 : PyErr_NoMemory();
47720 0 : return -1;
47721 : }
47722 : {
47723 : union netr_DomainInfo *info_switch_1;
47724 0 : info_switch_1 = (union netr_DomainInfo *)pyrpc_export_union(&netr_DomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union netr_DomainInfo");
47725 0 : if (info_switch_1 == NULL) {
47726 0 : return -1;
47727 : }
47728 0 : object->out.info = info_switch_1;
47729 : }
47730 0 : return 0;
47731 : }
47732 :
47733 0 : static PyObject *py_netr_LogonGetDomainInfo_get_result(PyObject *obj, void *closure)
47734 : {
47735 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(obj);
47736 : PyObject *py_result;
47737 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
47738 0 : return py_result;
47739 : }
47740 :
47741 0 : static int py_netr_LogonGetDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
47742 : {
47743 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47744 0 : if (value == NULL) {
47745 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
47746 0 : return -1;
47747 : }
47748 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
47749 0 : return 0;
47750 : }
47751 :
47752 : static PyGetSetDef py_netr_LogonGetDomainInfo_getsetters[] = {
47753 : {
47754 : .name = discard_const_p(char, "in_server_name"),
47755 : .get = py_netr_LogonGetDomainInfo_in_get_server_name,
47756 : .set = py_netr_LogonGetDomainInfo_in_set_server_name,
47757 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
47758 : },
47759 : {
47760 : .name = discard_const_p(char, "in_computer_name"),
47761 : .get = py_netr_LogonGetDomainInfo_in_get_computer_name,
47762 : .set = py_netr_LogonGetDomainInfo_in_set_computer_name,
47763 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
47764 : },
47765 : {
47766 : .name = discard_const_p(char, "in_credential"),
47767 : .get = py_netr_LogonGetDomainInfo_in_get_credential,
47768 : .set = py_netr_LogonGetDomainInfo_in_set_credential,
47769 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
47770 : },
47771 : {
47772 : .name = discard_const_p(char, "in_return_authenticator"),
47773 : .get = py_netr_LogonGetDomainInfo_in_get_return_authenticator,
47774 : .set = py_netr_LogonGetDomainInfo_in_set_return_authenticator,
47775 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
47776 : },
47777 : {
47778 : .name = discard_const_p(char, "out_return_authenticator"),
47779 : .get = py_netr_LogonGetDomainInfo_out_get_return_authenticator,
47780 : .set = py_netr_LogonGetDomainInfo_out_set_return_authenticator,
47781 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
47782 : },
47783 : {
47784 : .name = discard_const_p(char, "in_level"),
47785 : .get = py_netr_LogonGetDomainInfo_in_get_level,
47786 : .set = py_netr_LogonGetDomainInfo_in_set_level,
47787 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
47788 : },
47789 : {
47790 : .name = discard_const_p(char, "in_query"),
47791 : .get = py_netr_LogonGetDomainInfo_in_get_query,
47792 : .set = py_netr_LogonGetDomainInfo_in_set_query,
47793 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_WorkstationInfo")
47794 : },
47795 : {
47796 : .name = discard_const_p(char, "out_info"),
47797 : .get = py_netr_LogonGetDomainInfo_out_get_info,
47798 : .set = py_netr_LogonGetDomainInfo_out_set_info,
47799 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainInfo")
47800 : },
47801 : {
47802 : .name = discard_const_p(char, "result"),
47803 : .get = py_netr_LogonGetDomainInfo_get_result,
47804 : .set = py_netr_LogonGetDomainInfo_set_result,
47805 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
47806 : },
47807 : { .name = NULL }
47808 : };
47809 :
47810 0 : static PyObject *py_netr_LogonGetDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47811 : {
47812 0 : PyObject *self = pytalloc_new(struct netr_LogonGetDomainInfo, type);
47813 0 : struct netr_LogonGetDomainInfo *_self = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(self);
47814 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
47815 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
47816 0 : _self->in.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
47817 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
47818 0 : _self->in.query = talloc_zero(mem_ctx, union netr_WorkstationInfo);
47819 0 : _self->out.info = talloc_zero(mem_ctx, union netr_DomainInfo);
47820 0 : return self;
47821 : }
47822 :
47823 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
47824 : {
47825 :
47826 :
47827 0 : return PyLong_FromLong(29);
47828 : }
47829 :
47830 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
47831 : {
47832 0 : const struct ndr_interface_call *call = NULL;
47833 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47834 0 : PyObject *ret = NULL;
47835 0 : struct ndr_push *push = NULL;
47836 : DATA_BLOB blob;
47837 : enum ndr_err_code err;
47838 :
47839 0 : if (ndr_table_netlogon.num_calls < 30) {
47840 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetDomainInfo_ndr_pack");
47841 0 : return NULL;
47842 : }
47843 0 : call = &ndr_table_netlogon.calls[29];
47844 :
47845 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
47846 0 : if (push == NULL) {
47847 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47848 0 : return NULL;
47849 : }
47850 :
47851 0 : push->flags |= ndr_push_flags;
47852 :
47853 0 : err = call->ndr_push(push, ndr_inout_flags, object);
47854 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47855 0 : TALLOC_FREE(push);
47856 0 : PyErr_SetNdrError(err);
47857 0 : return NULL;
47858 : }
47859 0 : blob = ndr_push_blob(push);
47860 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
47861 0 : TALLOC_FREE(push);
47862 0 : return ret;
47863 : }
47864 :
47865 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47866 : {
47867 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47868 0 : PyObject *bigendian_obj = NULL;
47869 0 : PyObject *ndr64_obj = NULL;
47870 0 : uint32_t ndr_push_flags = 0;
47871 :
47872 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
47873 : discard_const_p(char *, kwnames),
47874 : &bigendian_obj,
47875 : &ndr64_obj)) {
47876 0 : return NULL;
47877 : }
47878 :
47879 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47880 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47881 : }
47882 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47883 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47884 : }
47885 :
47886 0 : return py_netr_LogonGetDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
47887 : }
47888 :
47889 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47890 : {
47891 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47892 0 : PyObject *bigendian_obj = NULL;
47893 0 : PyObject *ndr64_obj = NULL;
47894 0 : uint32_t ndr_push_flags = 0;
47895 :
47896 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
47897 : discard_const_p(char *, kwnames),
47898 : &bigendian_obj,
47899 : &ndr64_obj)) {
47900 0 : return NULL;
47901 : }
47902 :
47903 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47904 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47905 : }
47906 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47907 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47908 : }
47909 :
47910 0 : return py_netr_LogonGetDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
47911 : }
47912 :
47913 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
47914 : {
47915 0 : const struct ndr_interface_call *call = NULL;
47916 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
47917 0 : struct ndr_pull *pull = NULL;
47918 : enum ndr_err_code err;
47919 :
47920 0 : if (ndr_table_netlogon.num_calls < 30) {
47921 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetDomainInfo_ndr_unpack");
47922 0 : return NULL;
47923 : }
47924 0 : call = &ndr_table_netlogon.calls[29];
47925 :
47926 0 : pull = ndr_pull_init_blob(blob, object);
47927 0 : if (pull == NULL) {
47928 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47929 0 : return NULL;
47930 : }
47931 :
47932 0 : pull->flags |= ndr_pull_flags;
47933 :
47934 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
47935 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47936 0 : TALLOC_FREE(pull);
47937 0 : PyErr_SetNdrError(err);
47938 0 : return NULL;
47939 : }
47940 0 : if (!allow_remaining) {
47941 : uint32_t highest_ofs;
47942 :
47943 0 : if (pull->offset > pull->relative_highest_offset) {
47944 0 : highest_ofs = pull->offset;
47945 : } else {
47946 0 : highest_ofs = pull->relative_highest_offset;
47947 : }
47948 0 : if (highest_ofs < pull->data_size) {
47949 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
47950 : "not all bytes consumed ofs[%u] size[%u]",
47951 : highest_ofs, pull->data_size);
47952 0 : TALLOC_FREE(pull);
47953 0 : PyErr_SetNdrError(err);
47954 0 : return NULL;
47955 : }
47956 : }
47957 :
47958 0 : TALLOC_FREE(pull);
47959 0 : Py_RETURN_NONE;
47960 : }
47961 :
47962 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47963 : {
47964 : DATA_BLOB blob;
47965 0 : Py_ssize_t blob_length = 0;
47966 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47967 0 : PyObject *bigendian_obj = NULL;
47968 0 : PyObject *ndr64_obj = NULL;
47969 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47970 0 : PyObject *allow_remaining_obj = NULL;
47971 0 : bool allow_remaining = false;
47972 :
47973 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
47974 : discard_const_p(char *, kwnames),
47975 : &blob.data, &blob_length,
47976 : &bigendian_obj,
47977 : &ndr64_obj,
47978 : &allow_remaining_obj)) {
47979 0 : return NULL;
47980 : }
47981 0 : blob.length = blob_length;
47982 :
47983 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47984 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47985 : }
47986 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47987 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47988 : }
47989 :
47990 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47991 0 : allow_remaining = true;
47992 : }
47993 :
47994 0 : return py_netr_LogonGetDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
47995 : }
47996 :
47997 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47998 : {
47999 : DATA_BLOB blob;
48000 0 : Py_ssize_t blob_length = 0;
48001 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48002 0 : PyObject *bigendian_obj = NULL;
48003 0 : PyObject *ndr64_obj = NULL;
48004 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48005 0 : PyObject *allow_remaining_obj = NULL;
48006 0 : bool allow_remaining = false;
48007 :
48008 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
48009 : discard_const_p(char *, kwnames),
48010 : &blob.data, &blob_length,
48011 : &bigendian_obj,
48012 : &ndr64_obj,
48013 : &allow_remaining_obj)) {
48014 0 : return NULL;
48015 : }
48016 0 : blob.length = blob_length;
48017 :
48018 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48019 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48020 : }
48021 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48022 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48023 : }
48024 :
48025 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48026 0 : allow_remaining = true;
48027 : }
48028 :
48029 0 : return py_netr_LogonGetDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
48030 : }
48031 :
48032 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
48033 : {
48034 0 : const struct ndr_interface_call *call = NULL;
48035 0 : struct netr_LogonGetDomainInfo *object = (struct netr_LogonGetDomainInfo *)pytalloc_get_ptr(py_obj);
48036 : PyObject *ret;
48037 : char *retstr;
48038 :
48039 0 : if (ndr_table_netlogon.num_calls < 30) {
48040 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonGetDomainInfo_ndr_print");
48041 0 : return NULL;
48042 : }
48043 0 : call = &ndr_table_netlogon.calls[29];
48044 :
48045 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
48046 0 : ret = PyUnicode_FromString(retstr);
48047 0 : TALLOC_FREE(retstr);
48048 :
48049 0 : return ret;
48050 : }
48051 :
48052 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48053 : {
48054 0 : return py_netr_LogonGetDomainInfo_ndr_print(py_obj, "netr_LogonGetDomainInfo_in", NDR_IN);
48055 : }
48056 :
48057 0 : static PyObject *py_netr_LogonGetDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48058 : {
48059 0 : return py_netr_LogonGetDomainInfo_ndr_print(py_obj, "netr_LogonGetDomainInfo_out", NDR_OUT);
48060 : }
48061 :
48062 : static PyMethodDef py_netr_LogonGetDomainInfo_methods[] = {
48063 : { "opnum", (PyCFunction)py_netr_LogonGetDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
48064 : "netlogon.netr_LogonGetDomainInfo.opnum() -> 29 (0x1d) " },
48065 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
48066 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
48067 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
48068 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
48069 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
48070 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
48071 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonGetDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
48072 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
48073 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonGetDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
48074 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonGetDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
48075 : { NULL, NULL, 0, NULL }
48076 : };
48077 :
48078 :
48079 : static PyTypeObject netr_LogonGetDomainInfo_Type = {
48080 : PyVarObject_HEAD_INIT(NULL, 0)
48081 : .tp_name = "netlogon.netr_LogonGetDomainInfo",
48082 : .tp_getset = py_netr_LogonGetDomainInfo_getsetters,
48083 : .tp_methods = py_netr_LogonGetDomainInfo_methods,
48084 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
48085 : .tp_new = py_netr_LogonGetDomainInfo_new,
48086 : };
48087 :
48088 35 : static bool pack_py_netr_LogonGetDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonGetDomainInfo *r)
48089 : {
48090 : PyObject *py_server_name;
48091 : PyObject *py_computer_name;
48092 : PyObject *py_credential;
48093 : PyObject *py_return_authenticator;
48094 : PyObject *py_level;
48095 : PyObject *py_query;
48096 35 : const char *kwnames[] = {
48097 : "server_name", "computer_name", "credential", "return_authenticator", "level", "query", NULL
48098 : };
48099 :
48100 35 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_LogonGetDomainInfo", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_level, &py_query)) {
48101 0 : return false;
48102 : }
48103 :
48104 35 : if (py_server_name == NULL) {
48105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
48106 0 : return false;
48107 : }
48108 35 : r->in.server_name = talloc_ptrtype(r, r->in.server_name);
48109 35 : if (r->in.server_name == NULL) {
48110 0 : PyErr_NoMemory();
48111 0 : return false;
48112 : }
48113 : {
48114 : const char *test_str;
48115 : const char *talloc_str;
48116 35 : PyObject *unicode = NULL;
48117 35 : if (PyUnicode_Check(py_server_name)) {
48118 35 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
48119 35 : if (unicode == NULL) {
48120 0 : PyErr_NoMemory();
48121 0 : return false;
48122 : }
48123 35 : test_str = PyBytes_AS_STRING(unicode);
48124 0 : } else if (PyBytes_Check(py_server_name)) {
48125 0 : test_str = PyBytes_AS_STRING(py_server_name);
48126 : } else {
48127 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
48128 0 : return false;
48129 : }
48130 35 : talloc_str = talloc_strdup(r, test_str);
48131 35 : if (unicode != NULL) {
48132 35 : Py_DECREF(unicode);
48133 : }
48134 35 : if (talloc_str == NULL) {
48135 0 : PyErr_NoMemory();
48136 0 : return false;
48137 : }
48138 35 : r->in.server_name = talloc_str;
48139 : }
48140 35 : if (py_computer_name == NULL) {
48141 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
48142 0 : return false;
48143 : }
48144 35 : if (py_computer_name == Py_None) {
48145 0 : r->in.computer_name = NULL;
48146 : } else {
48147 35 : r->in.computer_name = NULL;
48148 : {
48149 : const char *test_str;
48150 : const char *talloc_str;
48151 35 : PyObject *unicode = NULL;
48152 35 : if (PyUnicode_Check(py_computer_name)) {
48153 35 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
48154 35 : if (unicode == NULL) {
48155 0 : PyErr_NoMemory();
48156 0 : return false;
48157 : }
48158 35 : test_str = PyBytes_AS_STRING(unicode);
48159 0 : } else if (PyBytes_Check(py_computer_name)) {
48160 0 : test_str = PyBytes_AS_STRING(py_computer_name);
48161 : } else {
48162 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
48163 0 : return false;
48164 : }
48165 35 : talloc_str = talloc_strdup(r, test_str);
48166 35 : if (unicode != NULL) {
48167 35 : Py_DECREF(unicode);
48168 : }
48169 35 : if (talloc_str == NULL) {
48170 0 : PyErr_NoMemory();
48171 0 : return false;
48172 : }
48173 35 : r->in.computer_name = talloc_str;
48174 : }
48175 : }
48176 35 : if (py_credential == NULL) {
48177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
48178 0 : return false;
48179 : }
48180 35 : r->in.credential = talloc_ptrtype(r, r->in.credential);
48181 35 : if (r->in.credential == NULL) {
48182 0 : PyErr_NoMemory();
48183 0 : return false;
48184 : }
48185 35 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
48186 35 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
48187 0 : PyErr_NoMemory();
48188 0 : return false;
48189 : }
48190 35 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
48191 35 : if (py_return_authenticator == NULL) {
48192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
48193 0 : return false;
48194 : }
48195 35 : r->in.return_authenticator = talloc_ptrtype(r, r->in.return_authenticator);
48196 35 : if (r->in.return_authenticator == NULL) {
48197 0 : PyErr_NoMemory();
48198 0 : return false;
48199 : }
48200 35 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
48201 35 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
48202 0 : PyErr_NoMemory();
48203 0 : return false;
48204 : }
48205 35 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
48206 35 : if (py_level == NULL) {
48207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
48208 0 : return false;
48209 : }
48210 : {
48211 35 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
48212 35 : if (PyLong_Check(py_level)) {
48213 : unsigned long long test_var;
48214 35 : test_var = PyLong_AsUnsignedLongLong(py_level);
48215 35 : if (PyErr_Occurred() != NULL) {
48216 0 : return false;
48217 : }
48218 35 : if (test_var > uint_max) {
48219 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48220 : PyLong_Type.tp_name, uint_max, test_var);
48221 0 : return false;
48222 : }
48223 35 : r->in.level = test_var;
48224 : } else {
48225 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48226 : PyLong_Type.tp_name);
48227 0 : return false;
48228 : }
48229 : }
48230 35 : if (py_query == NULL) {
48231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.query");
48232 0 : return false;
48233 : }
48234 35 : r->in.query = talloc_ptrtype(r, r->in.query);
48235 35 : if (r->in.query == NULL) {
48236 0 : PyErr_NoMemory();
48237 0 : return false;
48238 : }
48239 : {
48240 : union netr_WorkstationInfo *query_switch_1;
48241 35 : query_switch_1 = (union netr_WorkstationInfo *)pyrpc_export_union(&netr_WorkstationInfo_Type, r, r->in.level, py_query, "union netr_WorkstationInfo");
48242 35 : if (query_switch_1 == NULL) {
48243 0 : return false;
48244 : }
48245 35 : r->in.query = query_switch_1;
48246 : }
48247 35 : return true;
48248 : }
48249 :
48250 35 : static PyObject *unpack_py_netr_LogonGetDomainInfo_args_out(struct netr_LogonGetDomainInfo *r)
48251 : {
48252 : PyObject *result;
48253 : PyObject *py_return_authenticator;
48254 : PyObject *py_info;
48255 35 : result = PyTuple_New(2);
48256 35 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
48257 35 : PyTuple_SetItem(result, 0, py_return_authenticator);
48258 35 : py_info = pyrpc_import_union(&netr_DomainInfo_Type, r->out.info, r->in.level, r->out.info, "union netr_DomainInfo");
48259 35 : if (py_info == NULL) {
48260 0 : return NULL;
48261 : }
48262 35 : PyTuple_SetItem(result, 1, py_info);
48263 35 : if (NT_STATUS_IS_ERR(r->out.result)) {
48264 0 : PyErr_SetNTSTATUS(r->out.result);
48265 0 : return NULL;
48266 : }
48267 :
48268 35 : return result;
48269 : }
48270 :
48271 :
48272 0 : static PyObject *py_netr_ServerPasswordSet2_in_get_server_name(PyObject *obj, void *closure)
48273 : {
48274 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj);
48275 : PyObject *py_server_name;
48276 0 : if (object->in.server_name == NULL) {
48277 0 : Py_RETURN_NONE;
48278 : }
48279 0 : if (object->in.server_name == NULL) {
48280 0 : py_server_name = Py_None;
48281 0 : Py_INCREF(py_server_name);
48282 : } else {
48283 0 : if (object->in.server_name == NULL) {
48284 0 : py_server_name = Py_None;
48285 0 : Py_INCREF(py_server_name);
48286 : } else {
48287 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
48288 : }
48289 : }
48290 0 : return py_server_name;
48291 : }
48292 :
48293 0 : static int py_netr_ServerPasswordSet2_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
48294 : {
48295 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48296 0 : if (value == NULL) {
48297 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
48298 0 : return -1;
48299 : }
48300 0 : if (value == Py_None) {
48301 0 : object->in.server_name = NULL;
48302 : } else {
48303 0 : object->in.server_name = NULL;
48304 : {
48305 : const char *test_str;
48306 : const char *talloc_str;
48307 0 : PyObject *unicode = NULL;
48308 0 : if (PyUnicode_Check(value)) {
48309 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
48310 0 : if (unicode == NULL) {
48311 0 : PyErr_NoMemory();
48312 0 : return -1;
48313 : }
48314 0 : test_str = PyBytes_AS_STRING(unicode);
48315 0 : } else if (PyBytes_Check(value)) {
48316 0 : test_str = PyBytes_AS_STRING(value);
48317 : } else {
48318 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
48319 0 : return -1;
48320 : }
48321 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
48322 0 : if (unicode != NULL) {
48323 0 : Py_DECREF(unicode);
48324 : }
48325 0 : if (talloc_str == NULL) {
48326 0 : PyErr_NoMemory();
48327 0 : return -1;
48328 : }
48329 0 : object->in.server_name = talloc_str;
48330 : }
48331 : }
48332 0 : return 0;
48333 : }
48334 :
48335 0 : static PyObject *py_netr_ServerPasswordSet2_in_get_account_name(PyObject *obj, void *closure)
48336 : {
48337 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj);
48338 : PyObject *py_account_name;
48339 0 : if (object->in.account_name == NULL) {
48340 0 : Py_RETURN_NONE;
48341 : }
48342 0 : if (object->in.account_name == NULL) {
48343 0 : py_account_name = Py_None;
48344 0 : Py_INCREF(py_account_name);
48345 : } else {
48346 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
48347 : }
48348 0 : return py_account_name;
48349 : }
48350 :
48351 0 : static int py_netr_ServerPasswordSet2_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
48352 : {
48353 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48354 0 : if (value == NULL) {
48355 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
48356 0 : return -1;
48357 : }
48358 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
48359 0 : if (object->in.account_name == NULL) {
48360 0 : PyErr_NoMemory();
48361 0 : return -1;
48362 : }
48363 : {
48364 : const char *test_str;
48365 : const char *talloc_str;
48366 0 : PyObject *unicode = NULL;
48367 0 : if (PyUnicode_Check(value)) {
48368 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
48369 0 : if (unicode == NULL) {
48370 0 : PyErr_NoMemory();
48371 0 : return -1;
48372 : }
48373 0 : test_str = PyBytes_AS_STRING(unicode);
48374 0 : } else if (PyBytes_Check(value)) {
48375 0 : test_str = PyBytes_AS_STRING(value);
48376 : } else {
48377 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
48378 0 : return -1;
48379 : }
48380 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
48381 0 : if (unicode != NULL) {
48382 0 : Py_DECREF(unicode);
48383 : }
48384 0 : if (talloc_str == NULL) {
48385 0 : PyErr_NoMemory();
48386 0 : return -1;
48387 : }
48388 0 : object->in.account_name = talloc_str;
48389 : }
48390 0 : return 0;
48391 : }
48392 :
48393 0 : static PyObject *py_netr_ServerPasswordSet2_in_get_secure_channel_type(PyObject *obj, void *closure)
48394 : {
48395 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj);
48396 : PyObject *py_secure_channel_type;
48397 0 : py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type);
48398 0 : return py_secure_channel_type;
48399 : }
48400 :
48401 0 : static int py_netr_ServerPasswordSet2_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure)
48402 : {
48403 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48404 0 : if (value == NULL) {
48405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type");
48406 0 : return -1;
48407 : }
48408 : {
48409 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_type));
48410 0 : if (PyLong_Check(value)) {
48411 : unsigned long long test_var;
48412 0 : test_var = PyLong_AsUnsignedLongLong(value);
48413 0 : if (PyErr_Occurred() != NULL) {
48414 0 : return -1;
48415 : }
48416 0 : if (test_var > uint_max) {
48417 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48418 : PyLong_Type.tp_name, uint_max, test_var);
48419 0 : return -1;
48420 : }
48421 0 : object->in.secure_channel_type = test_var;
48422 : } else {
48423 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48424 : PyLong_Type.tp_name);
48425 0 : return -1;
48426 : }
48427 : }
48428 0 : return 0;
48429 : }
48430 :
48431 0 : static PyObject *py_netr_ServerPasswordSet2_in_get_computer_name(PyObject *obj, void *closure)
48432 : {
48433 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj);
48434 : PyObject *py_computer_name;
48435 0 : if (object->in.computer_name == NULL) {
48436 0 : Py_RETURN_NONE;
48437 : }
48438 0 : if (object->in.computer_name == NULL) {
48439 0 : py_computer_name = Py_None;
48440 0 : Py_INCREF(py_computer_name);
48441 : } else {
48442 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
48443 : }
48444 0 : return py_computer_name;
48445 : }
48446 :
48447 0 : static int py_netr_ServerPasswordSet2_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
48448 : {
48449 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48450 0 : if (value == NULL) {
48451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
48452 0 : return -1;
48453 : }
48454 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
48455 0 : if (object->in.computer_name == NULL) {
48456 0 : PyErr_NoMemory();
48457 0 : return -1;
48458 : }
48459 : {
48460 : const char *test_str;
48461 : const char *talloc_str;
48462 0 : PyObject *unicode = NULL;
48463 0 : if (PyUnicode_Check(value)) {
48464 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
48465 0 : if (unicode == NULL) {
48466 0 : PyErr_NoMemory();
48467 0 : return -1;
48468 : }
48469 0 : test_str = PyBytes_AS_STRING(unicode);
48470 0 : } else if (PyBytes_Check(value)) {
48471 0 : test_str = PyBytes_AS_STRING(value);
48472 : } else {
48473 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
48474 0 : return -1;
48475 : }
48476 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
48477 0 : if (unicode != NULL) {
48478 0 : Py_DECREF(unicode);
48479 : }
48480 0 : if (talloc_str == NULL) {
48481 0 : PyErr_NoMemory();
48482 0 : return -1;
48483 : }
48484 0 : object->in.computer_name = talloc_str;
48485 : }
48486 0 : return 0;
48487 : }
48488 :
48489 0 : static PyObject *py_netr_ServerPasswordSet2_in_get_credential(PyObject *obj, void *closure)
48490 : {
48491 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj);
48492 : PyObject *py_credential;
48493 0 : if (object->in.credential == NULL) {
48494 0 : Py_RETURN_NONE;
48495 : }
48496 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
48497 0 : return py_credential;
48498 : }
48499 :
48500 0 : static int py_netr_ServerPasswordSet2_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
48501 : {
48502 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48503 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
48504 0 : if (value == NULL) {
48505 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
48506 0 : return -1;
48507 : }
48508 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
48509 0 : if (object->in.credential == NULL) {
48510 0 : PyErr_NoMemory();
48511 0 : return -1;
48512 : }
48513 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
48514 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48515 0 : PyErr_NoMemory();
48516 0 : return -1;
48517 : }
48518 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
48519 0 : return 0;
48520 : }
48521 :
48522 0 : static PyObject *py_netr_ServerPasswordSet2_out_get_return_authenticator(PyObject *obj, void *closure)
48523 : {
48524 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj);
48525 : PyObject *py_return_authenticator;
48526 0 : if (object->out.return_authenticator == NULL) {
48527 0 : Py_RETURN_NONE;
48528 : }
48529 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
48530 0 : return py_return_authenticator;
48531 : }
48532 :
48533 0 : static int py_netr_ServerPasswordSet2_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
48534 : {
48535 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48536 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
48537 0 : if (value == NULL) {
48538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
48539 0 : return -1;
48540 : }
48541 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
48542 0 : if (object->out.return_authenticator == NULL) {
48543 0 : PyErr_NoMemory();
48544 0 : return -1;
48545 : }
48546 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
48547 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48548 0 : PyErr_NoMemory();
48549 0 : return -1;
48550 : }
48551 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
48552 0 : return 0;
48553 : }
48554 :
48555 0 : static PyObject *py_netr_ServerPasswordSet2_in_get_new_password(PyObject *obj, void *closure)
48556 : {
48557 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj);
48558 : PyObject *py_new_password;
48559 0 : if (object->in.new_password == NULL) {
48560 0 : Py_RETURN_NONE;
48561 : }
48562 0 : py_new_password = pytalloc_reference_ex(&netr_CryptPassword_Type, object->in.new_password, object->in.new_password);
48563 0 : return py_new_password;
48564 : }
48565 :
48566 0 : static int py_netr_ServerPasswordSet2_in_set_new_password(PyObject *py_obj, PyObject *value, void *closure)
48567 : {
48568 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48569 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_password));
48570 0 : if (value == NULL) {
48571 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_password");
48572 0 : return -1;
48573 : }
48574 0 : object->in.new_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_password);
48575 0 : if (object->in.new_password == NULL) {
48576 0 : PyErr_NoMemory();
48577 0 : return -1;
48578 : }
48579 0 : PY_CHECK_TYPE(&netr_CryptPassword_Type, value, return -1;);
48580 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48581 0 : PyErr_NoMemory();
48582 0 : return -1;
48583 : }
48584 0 : object->in.new_password = (struct netr_CryptPassword *)pytalloc_get_ptr(value);
48585 0 : return 0;
48586 : }
48587 :
48588 0 : static PyObject *py_netr_ServerPasswordSet2_get_result(PyObject *obj, void *closure)
48589 : {
48590 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(obj);
48591 : PyObject *py_result;
48592 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
48593 0 : return py_result;
48594 : }
48595 :
48596 0 : static int py_netr_ServerPasswordSet2_set_result(PyObject *py_obj, PyObject *value, void *closure)
48597 : {
48598 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48599 0 : if (value == NULL) {
48600 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
48601 0 : return -1;
48602 : }
48603 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
48604 0 : return 0;
48605 : }
48606 :
48607 : static PyGetSetDef py_netr_ServerPasswordSet2_getsetters[] = {
48608 : {
48609 : .name = discard_const_p(char, "in_server_name"),
48610 : .get = py_netr_ServerPasswordSet2_in_get_server_name,
48611 : .set = py_netr_ServerPasswordSet2_in_set_server_name,
48612 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
48613 : },
48614 : {
48615 : .name = discard_const_p(char, "in_account_name"),
48616 : .get = py_netr_ServerPasswordSet2_in_get_account_name,
48617 : .set = py_netr_ServerPasswordSet2_in_set_account_name,
48618 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
48619 : },
48620 : {
48621 : .name = discard_const_p(char, "in_secure_channel_type"),
48622 : .get = py_netr_ServerPasswordSet2_in_get_secure_channel_type,
48623 : .set = py_netr_ServerPasswordSet2_in_set_secure_channel_type,
48624 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType")
48625 : },
48626 : {
48627 : .name = discard_const_p(char, "in_computer_name"),
48628 : .get = py_netr_ServerPasswordSet2_in_get_computer_name,
48629 : .set = py_netr_ServerPasswordSet2_in_set_computer_name,
48630 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
48631 : },
48632 : {
48633 : .name = discard_const_p(char, "in_credential"),
48634 : .get = py_netr_ServerPasswordSet2_in_get_credential,
48635 : .set = py_netr_ServerPasswordSet2_in_set_credential,
48636 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
48637 : },
48638 : {
48639 : .name = discard_const_p(char, "out_return_authenticator"),
48640 : .get = py_netr_ServerPasswordSet2_out_get_return_authenticator,
48641 : .set = py_netr_ServerPasswordSet2_out_set_return_authenticator,
48642 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
48643 : },
48644 : {
48645 : .name = discard_const_p(char, "in_new_password"),
48646 : .get = py_netr_ServerPasswordSet2_in_get_new_password,
48647 : .set = py_netr_ServerPasswordSet2_in_set_new_password,
48648 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CryptPassword")
48649 : },
48650 : {
48651 : .name = discard_const_p(char, "result"),
48652 : .get = py_netr_ServerPasswordSet2_get_result,
48653 : .set = py_netr_ServerPasswordSet2_set_result,
48654 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
48655 : },
48656 : { .name = NULL }
48657 : };
48658 :
48659 0 : static PyObject *py_netr_ServerPasswordSet2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
48660 : {
48661 0 : PyObject *self = pytalloc_new(struct netr_ServerPasswordSet2, type);
48662 0 : struct netr_ServerPasswordSet2 *_self = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(self);
48663 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
48664 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
48665 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
48666 0 : _self->in.new_password = talloc_zero(mem_ctx, struct netr_CryptPassword);
48667 0 : return self;
48668 : }
48669 :
48670 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
48671 : {
48672 :
48673 :
48674 0 : return PyLong_FromLong(30);
48675 : }
48676 :
48677 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
48678 : {
48679 0 : const struct ndr_interface_call *call = NULL;
48680 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48681 0 : PyObject *ret = NULL;
48682 0 : struct ndr_push *push = NULL;
48683 : DATA_BLOB blob;
48684 : enum ndr_err_code err;
48685 :
48686 0 : if (ndr_table_netlogon.num_calls < 31) {
48687 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet2_ndr_pack");
48688 0 : return NULL;
48689 : }
48690 0 : call = &ndr_table_netlogon.calls[30];
48691 :
48692 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
48693 0 : if (push == NULL) {
48694 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
48695 0 : return NULL;
48696 : }
48697 :
48698 0 : push->flags |= ndr_push_flags;
48699 :
48700 0 : err = call->ndr_push(push, ndr_inout_flags, object);
48701 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
48702 0 : TALLOC_FREE(push);
48703 0 : PyErr_SetNdrError(err);
48704 0 : return NULL;
48705 : }
48706 0 : blob = ndr_push_blob(push);
48707 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
48708 0 : TALLOC_FREE(push);
48709 0 : return ret;
48710 : }
48711 :
48712 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48713 : {
48714 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
48715 0 : PyObject *bigendian_obj = NULL;
48716 0 : PyObject *ndr64_obj = NULL;
48717 0 : uint32_t ndr_push_flags = 0;
48718 :
48719 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
48720 : discard_const_p(char *, kwnames),
48721 : &bigendian_obj,
48722 : &ndr64_obj)) {
48723 0 : return NULL;
48724 : }
48725 :
48726 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48727 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
48728 : }
48729 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48730 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
48731 : }
48732 :
48733 0 : return py_netr_ServerPasswordSet2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
48734 : }
48735 :
48736 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48737 : {
48738 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
48739 0 : PyObject *bigendian_obj = NULL;
48740 0 : PyObject *ndr64_obj = NULL;
48741 0 : uint32_t ndr_push_flags = 0;
48742 :
48743 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
48744 : discard_const_p(char *, kwnames),
48745 : &bigendian_obj,
48746 : &ndr64_obj)) {
48747 0 : return NULL;
48748 : }
48749 :
48750 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48751 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
48752 : }
48753 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48754 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
48755 : }
48756 :
48757 0 : return py_netr_ServerPasswordSet2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
48758 : }
48759 :
48760 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
48761 : {
48762 0 : const struct ndr_interface_call *call = NULL;
48763 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48764 0 : struct ndr_pull *pull = NULL;
48765 : enum ndr_err_code err;
48766 :
48767 0 : if (ndr_table_netlogon.num_calls < 31) {
48768 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet2_ndr_unpack");
48769 0 : return NULL;
48770 : }
48771 0 : call = &ndr_table_netlogon.calls[30];
48772 :
48773 0 : pull = ndr_pull_init_blob(blob, object);
48774 0 : if (pull == NULL) {
48775 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
48776 0 : return NULL;
48777 : }
48778 :
48779 0 : pull->flags |= ndr_pull_flags;
48780 :
48781 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
48782 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
48783 0 : TALLOC_FREE(pull);
48784 0 : PyErr_SetNdrError(err);
48785 0 : return NULL;
48786 : }
48787 0 : if (!allow_remaining) {
48788 : uint32_t highest_ofs;
48789 :
48790 0 : if (pull->offset > pull->relative_highest_offset) {
48791 0 : highest_ofs = pull->offset;
48792 : } else {
48793 0 : highest_ofs = pull->relative_highest_offset;
48794 : }
48795 0 : if (highest_ofs < pull->data_size) {
48796 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
48797 : "not all bytes consumed ofs[%u] size[%u]",
48798 : highest_ofs, pull->data_size);
48799 0 : TALLOC_FREE(pull);
48800 0 : PyErr_SetNdrError(err);
48801 0 : return NULL;
48802 : }
48803 : }
48804 :
48805 0 : TALLOC_FREE(pull);
48806 0 : Py_RETURN_NONE;
48807 : }
48808 :
48809 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48810 : {
48811 : DATA_BLOB blob;
48812 0 : Py_ssize_t blob_length = 0;
48813 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48814 0 : PyObject *bigendian_obj = NULL;
48815 0 : PyObject *ndr64_obj = NULL;
48816 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48817 0 : PyObject *allow_remaining_obj = NULL;
48818 0 : bool allow_remaining = false;
48819 :
48820 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
48821 : discard_const_p(char *, kwnames),
48822 : &blob.data, &blob_length,
48823 : &bigendian_obj,
48824 : &ndr64_obj,
48825 : &allow_remaining_obj)) {
48826 0 : return NULL;
48827 : }
48828 0 : blob.length = blob_length;
48829 :
48830 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48831 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48832 : }
48833 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48834 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48835 : }
48836 :
48837 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48838 0 : allow_remaining = true;
48839 : }
48840 :
48841 0 : return py_netr_ServerPasswordSet2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
48842 : }
48843 :
48844 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48845 : {
48846 : DATA_BLOB blob;
48847 0 : Py_ssize_t blob_length = 0;
48848 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48849 0 : PyObject *bigendian_obj = NULL;
48850 0 : PyObject *ndr64_obj = NULL;
48851 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48852 0 : PyObject *allow_remaining_obj = NULL;
48853 0 : bool allow_remaining = false;
48854 :
48855 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
48856 : discard_const_p(char *, kwnames),
48857 : &blob.data, &blob_length,
48858 : &bigendian_obj,
48859 : &ndr64_obj,
48860 : &allow_remaining_obj)) {
48861 0 : return NULL;
48862 : }
48863 0 : blob.length = blob_length;
48864 :
48865 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48866 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48867 : }
48868 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48869 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48870 : }
48871 :
48872 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48873 0 : allow_remaining = true;
48874 : }
48875 :
48876 0 : return py_netr_ServerPasswordSet2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
48877 : }
48878 :
48879 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
48880 : {
48881 0 : const struct ndr_interface_call *call = NULL;
48882 0 : struct netr_ServerPasswordSet2 *object = (struct netr_ServerPasswordSet2 *)pytalloc_get_ptr(py_obj);
48883 : PyObject *ret;
48884 : char *retstr;
48885 :
48886 0 : if (ndr_table_netlogon.num_calls < 31) {
48887 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordSet2_ndr_print");
48888 0 : return NULL;
48889 : }
48890 0 : call = &ndr_table_netlogon.calls[30];
48891 :
48892 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
48893 0 : ret = PyUnicode_FromString(retstr);
48894 0 : TALLOC_FREE(retstr);
48895 :
48896 0 : return ret;
48897 : }
48898 :
48899 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48900 : {
48901 0 : return py_netr_ServerPasswordSet2_ndr_print(py_obj, "netr_ServerPasswordSet2_in", NDR_IN);
48902 : }
48903 :
48904 0 : static PyObject *py_netr_ServerPasswordSet2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48905 : {
48906 0 : return py_netr_ServerPasswordSet2_ndr_print(py_obj, "netr_ServerPasswordSet2_out", NDR_OUT);
48907 : }
48908 :
48909 : static PyMethodDef py_netr_ServerPasswordSet2_methods[] = {
48910 : { "opnum", (PyCFunction)py_netr_ServerPasswordSet2_ndr_opnum, METH_NOARGS|METH_CLASS,
48911 : "netlogon.netr_ServerPasswordSet2.opnum() -> 30 (0x1e) " },
48912 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
48913 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
48914 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
48915 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
48916 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
48917 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
48918 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordSet2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
48919 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
48920 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerPasswordSet2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
48921 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerPasswordSet2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
48922 : { NULL, NULL, 0, NULL }
48923 : };
48924 :
48925 :
48926 : static PyTypeObject netr_ServerPasswordSet2_Type = {
48927 : PyVarObject_HEAD_INIT(NULL, 0)
48928 : .tp_name = "netlogon.netr_ServerPasswordSet2",
48929 : .tp_getset = py_netr_ServerPasswordSet2_getsetters,
48930 : .tp_methods = py_netr_ServerPasswordSet2_methods,
48931 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
48932 : .tp_new = py_netr_ServerPasswordSet2_new,
48933 : };
48934 :
48935 4 : static bool pack_py_netr_ServerPasswordSet2_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerPasswordSet2 *r)
48936 : {
48937 : PyObject *py_server_name;
48938 : PyObject *py_account_name;
48939 : PyObject *py_secure_channel_type;
48940 : PyObject *py_computer_name;
48941 : PyObject *py_credential;
48942 : PyObject *py_new_password;
48943 4 : const char *kwnames[] = {
48944 : "server_name", "account_name", "secure_channel_type", "computer_name", "credential", "new_password", NULL
48945 : };
48946 :
48947 4 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_ServerPasswordSet2", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential, &py_new_password)) {
48948 0 : return false;
48949 : }
48950 :
48951 4 : if (py_server_name == NULL) {
48952 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
48953 0 : return false;
48954 : }
48955 4 : if (py_server_name == Py_None) {
48956 0 : r->in.server_name = NULL;
48957 : } else {
48958 4 : r->in.server_name = NULL;
48959 : {
48960 : const char *test_str;
48961 : const char *talloc_str;
48962 4 : PyObject *unicode = NULL;
48963 4 : if (PyUnicode_Check(py_server_name)) {
48964 4 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
48965 4 : if (unicode == NULL) {
48966 0 : PyErr_NoMemory();
48967 0 : return false;
48968 : }
48969 4 : test_str = PyBytes_AS_STRING(unicode);
48970 0 : } else if (PyBytes_Check(py_server_name)) {
48971 0 : test_str = PyBytes_AS_STRING(py_server_name);
48972 : } else {
48973 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
48974 0 : return false;
48975 : }
48976 4 : talloc_str = talloc_strdup(r, test_str);
48977 4 : if (unicode != NULL) {
48978 4 : Py_DECREF(unicode);
48979 : }
48980 4 : if (talloc_str == NULL) {
48981 0 : PyErr_NoMemory();
48982 0 : return false;
48983 : }
48984 4 : r->in.server_name = talloc_str;
48985 : }
48986 : }
48987 4 : if (py_account_name == NULL) {
48988 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
48989 0 : return false;
48990 : }
48991 4 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
48992 4 : if (r->in.account_name == NULL) {
48993 0 : PyErr_NoMemory();
48994 0 : return false;
48995 : }
48996 : {
48997 : const char *test_str;
48998 : const char *talloc_str;
48999 4 : PyObject *unicode = NULL;
49000 4 : if (PyUnicode_Check(py_account_name)) {
49001 4 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
49002 4 : if (unicode == NULL) {
49003 0 : PyErr_NoMemory();
49004 0 : return false;
49005 : }
49006 4 : test_str = PyBytes_AS_STRING(unicode);
49007 0 : } else if (PyBytes_Check(py_account_name)) {
49008 0 : test_str = PyBytes_AS_STRING(py_account_name);
49009 : } else {
49010 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
49011 0 : return false;
49012 : }
49013 4 : talloc_str = talloc_strdup(r, test_str);
49014 4 : if (unicode != NULL) {
49015 4 : Py_DECREF(unicode);
49016 : }
49017 4 : if (talloc_str == NULL) {
49018 0 : PyErr_NoMemory();
49019 0 : return false;
49020 : }
49021 4 : r->in.account_name = talloc_str;
49022 : }
49023 4 : if (py_secure_channel_type == NULL) {
49024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type");
49025 0 : return false;
49026 : }
49027 : {
49028 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type));
49029 4 : if (PyLong_Check(py_secure_channel_type)) {
49030 : unsigned long long test_var;
49031 4 : test_var = PyLong_AsUnsignedLongLong(py_secure_channel_type);
49032 4 : if (PyErr_Occurred() != NULL) {
49033 0 : return false;
49034 : }
49035 4 : if (test_var > uint_max) {
49036 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49037 : PyLong_Type.tp_name, uint_max, test_var);
49038 0 : return false;
49039 : }
49040 4 : r->in.secure_channel_type = test_var;
49041 : } else {
49042 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49043 : PyLong_Type.tp_name);
49044 0 : return false;
49045 : }
49046 : }
49047 4 : if (py_computer_name == NULL) {
49048 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
49049 0 : return false;
49050 : }
49051 4 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
49052 4 : if (r->in.computer_name == NULL) {
49053 0 : PyErr_NoMemory();
49054 0 : return false;
49055 : }
49056 : {
49057 : const char *test_str;
49058 : const char *talloc_str;
49059 4 : PyObject *unicode = NULL;
49060 4 : if (PyUnicode_Check(py_computer_name)) {
49061 4 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
49062 4 : if (unicode == NULL) {
49063 0 : PyErr_NoMemory();
49064 0 : return false;
49065 : }
49066 4 : test_str = PyBytes_AS_STRING(unicode);
49067 0 : } else if (PyBytes_Check(py_computer_name)) {
49068 0 : test_str = PyBytes_AS_STRING(py_computer_name);
49069 : } else {
49070 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
49071 0 : return false;
49072 : }
49073 4 : talloc_str = talloc_strdup(r, test_str);
49074 4 : if (unicode != NULL) {
49075 4 : Py_DECREF(unicode);
49076 : }
49077 4 : if (talloc_str == NULL) {
49078 0 : PyErr_NoMemory();
49079 0 : return false;
49080 : }
49081 4 : r->in.computer_name = talloc_str;
49082 : }
49083 4 : if (py_credential == NULL) {
49084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
49085 0 : return false;
49086 : }
49087 4 : r->in.credential = talloc_ptrtype(r, r->in.credential);
49088 4 : if (r->in.credential == NULL) {
49089 0 : PyErr_NoMemory();
49090 0 : return false;
49091 : }
49092 4 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
49093 4 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
49094 0 : PyErr_NoMemory();
49095 0 : return false;
49096 : }
49097 4 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
49098 4 : if (py_new_password == NULL) {
49099 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_password");
49100 0 : return false;
49101 : }
49102 4 : r->in.new_password = talloc_ptrtype(r, r->in.new_password);
49103 4 : if (r->in.new_password == NULL) {
49104 0 : PyErr_NoMemory();
49105 0 : return false;
49106 : }
49107 4 : PY_CHECK_TYPE(&netr_CryptPassword_Type, py_new_password, return false;);
49108 4 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_password)) == NULL) {
49109 0 : PyErr_NoMemory();
49110 0 : return false;
49111 : }
49112 4 : r->in.new_password = (struct netr_CryptPassword *)pytalloc_get_ptr(py_new_password);
49113 4 : return true;
49114 : }
49115 :
49116 4 : static PyObject *unpack_py_netr_ServerPasswordSet2_args_out(struct netr_ServerPasswordSet2 *r)
49117 : {
49118 : PyObject *result;
49119 : PyObject *py_return_authenticator;
49120 4 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
49121 4 : result = py_return_authenticator;
49122 4 : if (NT_STATUS_IS_ERR(r->out.result)) {
49123 0 : PyErr_SetNTSTATUS(r->out.result);
49124 0 : return NULL;
49125 : }
49126 :
49127 4 : return result;
49128 : }
49129 :
49130 :
49131 0 : static PyObject *py_netr_ServerPasswordGet_in_get_server_name(PyObject *obj, void *closure)
49132 : {
49133 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj);
49134 : PyObject *py_server_name;
49135 0 : if (object->in.server_name == NULL) {
49136 0 : Py_RETURN_NONE;
49137 : }
49138 0 : if (object->in.server_name == NULL) {
49139 0 : py_server_name = Py_None;
49140 0 : Py_INCREF(py_server_name);
49141 : } else {
49142 0 : if (object->in.server_name == NULL) {
49143 0 : py_server_name = Py_None;
49144 0 : Py_INCREF(py_server_name);
49145 : } else {
49146 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
49147 : }
49148 : }
49149 0 : return py_server_name;
49150 : }
49151 :
49152 0 : static int py_netr_ServerPasswordGet_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
49153 : {
49154 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49155 0 : if (value == NULL) {
49156 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
49157 0 : return -1;
49158 : }
49159 0 : if (value == Py_None) {
49160 0 : object->in.server_name = NULL;
49161 : } else {
49162 0 : object->in.server_name = NULL;
49163 : {
49164 : const char *test_str;
49165 : const char *talloc_str;
49166 0 : PyObject *unicode = NULL;
49167 0 : if (PyUnicode_Check(value)) {
49168 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
49169 0 : if (unicode == NULL) {
49170 0 : PyErr_NoMemory();
49171 0 : return -1;
49172 : }
49173 0 : test_str = PyBytes_AS_STRING(unicode);
49174 0 : } else if (PyBytes_Check(value)) {
49175 0 : test_str = PyBytes_AS_STRING(value);
49176 : } else {
49177 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
49178 0 : return -1;
49179 : }
49180 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
49181 0 : if (unicode != NULL) {
49182 0 : Py_DECREF(unicode);
49183 : }
49184 0 : if (talloc_str == NULL) {
49185 0 : PyErr_NoMemory();
49186 0 : return -1;
49187 : }
49188 0 : object->in.server_name = talloc_str;
49189 : }
49190 : }
49191 0 : return 0;
49192 : }
49193 :
49194 0 : static PyObject *py_netr_ServerPasswordGet_in_get_account_name(PyObject *obj, void *closure)
49195 : {
49196 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj);
49197 : PyObject *py_account_name;
49198 0 : if (object->in.account_name == NULL) {
49199 0 : Py_RETURN_NONE;
49200 : }
49201 0 : if (object->in.account_name == NULL) {
49202 0 : py_account_name = Py_None;
49203 0 : Py_INCREF(py_account_name);
49204 : } else {
49205 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
49206 : }
49207 0 : return py_account_name;
49208 : }
49209 :
49210 0 : static int py_netr_ServerPasswordGet_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
49211 : {
49212 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49213 0 : if (value == NULL) {
49214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
49215 0 : return -1;
49216 : }
49217 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
49218 0 : if (object->in.account_name == NULL) {
49219 0 : PyErr_NoMemory();
49220 0 : return -1;
49221 : }
49222 : {
49223 : const char *test_str;
49224 : const char *talloc_str;
49225 0 : PyObject *unicode = NULL;
49226 0 : if (PyUnicode_Check(value)) {
49227 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
49228 0 : if (unicode == NULL) {
49229 0 : PyErr_NoMemory();
49230 0 : return -1;
49231 : }
49232 0 : test_str = PyBytes_AS_STRING(unicode);
49233 0 : } else if (PyBytes_Check(value)) {
49234 0 : test_str = PyBytes_AS_STRING(value);
49235 : } else {
49236 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
49237 0 : return -1;
49238 : }
49239 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
49240 0 : if (unicode != NULL) {
49241 0 : Py_DECREF(unicode);
49242 : }
49243 0 : if (talloc_str == NULL) {
49244 0 : PyErr_NoMemory();
49245 0 : return -1;
49246 : }
49247 0 : object->in.account_name = talloc_str;
49248 : }
49249 0 : return 0;
49250 : }
49251 :
49252 0 : static PyObject *py_netr_ServerPasswordGet_in_get_secure_channel_type(PyObject *obj, void *closure)
49253 : {
49254 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj);
49255 : PyObject *py_secure_channel_type;
49256 0 : py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type);
49257 0 : return py_secure_channel_type;
49258 : }
49259 :
49260 0 : static int py_netr_ServerPasswordGet_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure)
49261 : {
49262 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49263 0 : if (value == NULL) {
49264 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type");
49265 0 : return -1;
49266 : }
49267 : {
49268 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_type));
49269 0 : if (PyLong_Check(value)) {
49270 : unsigned long long test_var;
49271 0 : test_var = PyLong_AsUnsignedLongLong(value);
49272 0 : if (PyErr_Occurred() != NULL) {
49273 0 : return -1;
49274 : }
49275 0 : if (test_var > uint_max) {
49276 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49277 : PyLong_Type.tp_name, uint_max, test_var);
49278 0 : return -1;
49279 : }
49280 0 : object->in.secure_channel_type = test_var;
49281 : } else {
49282 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49283 : PyLong_Type.tp_name);
49284 0 : return -1;
49285 : }
49286 : }
49287 0 : return 0;
49288 : }
49289 :
49290 0 : static PyObject *py_netr_ServerPasswordGet_in_get_computer_name(PyObject *obj, void *closure)
49291 : {
49292 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj);
49293 : PyObject *py_computer_name;
49294 0 : if (object->in.computer_name == NULL) {
49295 0 : Py_RETURN_NONE;
49296 : }
49297 0 : if (object->in.computer_name == NULL) {
49298 0 : py_computer_name = Py_None;
49299 0 : Py_INCREF(py_computer_name);
49300 : } else {
49301 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
49302 : }
49303 0 : return py_computer_name;
49304 : }
49305 :
49306 0 : static int py_netr_ServerPasswordGet_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
49307 : {
49308 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49309 0 : if (value == NULL) {
49310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
49311 0 : return -1;
49312 : }
49313 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
49314 0 : if (object->in.computer_name == NULL) {
49315 0 : PyErr_NoMemory();
49316 0 : return -1;
49317 : }
49318 : {
49319 : const char *test_str;
49320 : const char *talloc_str;
49321 0 : PyObject *unicode = NULL;
49322 0 : if (PyUnicode_Check(value)) {
49323 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
49324 0 : if (unicode == NULL) {
49325 0 : PyErr_NoMemory();
49326 0 : return -1;
49327 : }
49328 0 : test_str = PyBytes_AS_STRING(unicode);
49329 0 : } else if (PyBytes_Check(value)) {
49330 0 : test_str = PyBytes_AS_STRING(value);
49331 : } else {
49332 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
49333 0 : return -1;
49334 : }
49335 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
49336 0 : if (unicode != NULL) {
49337 0 : Py_DECREF(unicode);
49338 : }
49339 0 : if (talloc_str == NULL) {
49340 0 : PyErr_NoMemory();
49341 0 : return -1;
49342 : }
49343 0 : object->in.computer_name = talloc_str;
49344 : }
49345 0 : return 0;
49346 : }
49347 :
49348 0 : static PyObject *py_netr_ServerPasswordGet_in_get_credential(PyObject *obj, void *closure)
49349 : {
49350 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj);
49351 : PyObject *py_credential;
49352 0 : if (object->in.credential == NULL) {
49353 0 : Py_RETURN_NONE;
49354 : }
49355 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
49356 0 : return py_credential;
49357 : }
49358 :
49359 0 : static int py_netr_ServerPasswordGet_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
49360 : {
49361 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49362 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
49363 0 : if (value == NULL) {
49364 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
49365 0 : return -1;
49366 : }
49367 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
49368 0 : if (object->in.credential == NULL) {
49369 0 : PyErr_NoMemory();
49370 0 : return -1;
49371 : }
49372 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
49373 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49374 0 : PyErr_NoMemory();
49375 0 : return -1;
49376 : }
49377 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
49378 0 : return 0;
49379 : }
49380 :
49381 0 : static PyObject *py_netr_ServerPasswordGet_out_get_return_authenticator(PyObject *obj, void *closure)
49382 : {
49383 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj);
49384 : PyObject *py_return_authenticator;
49385 0 : if (object->out.return_authenticator == NULL) {
49386 0 : Py_RETURN_NONE;
49387 : }
49388 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
49389 0 : return py_return_authenticator;
49390 : }
49391 :
49392 0 : static int py_netr_ServerPasswordGet_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
49393 : {
49394 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49395 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
49396 0 : if (value == NULL) {
49397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
49398 0 : return -1;
49399 : }
49400 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
49401 0 : if (object->out.return_authenticator == NULL) {
49402 0 : PyErr_NoMemory();
49403 0 : return -1;
49404 : }
49405 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
49406 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49407 0 : PyErr_NoMemory();
49408 0 : return -1;
49409 : }
49410 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
49411 0 : return 0;
49412 : }
49413 :
49414 0 : static PyObject *py_netr_ServerPasswordGet_out_get_password(PyObject *obj, void *closure)
49415 : {
49416 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj);
49417 : PyObject *py_password;
49418 0 : if (object->out.password == NULL) {
49419 0 : Py_RETURN_NONE;
49420 : }
49421 0 : py_password = pytalloc_reference_ex(samr_Password_Type, object->out.password, object->out.password);
49422 0 : return py_password;
49423 : }
49424 :
49425 0 : static int py_netr_ServerPasswordGet_out_set_password(PyObject *py_obj, PyObject *value, void *closure)
49426 : {
49427 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49428 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.password));
49429 0 : if (value == NULL) {
49430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.password");
49431 0 : return -1;
49432 : }
49433 0 : object->out.password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.password);
49434 0 : if (object->out.password == NULL) {
49435 0 : PyErr_NoMemory();
49436 0 : return -1;
49437 : }
49438 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
49439 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49440 0 : PyErr_NoMemory();
49441 0 : return -1;
49442 : }
49443 0 : object->out.password = (struct samr_Password *)pytalloc_get_ptr(value);
49444 0 : return 0;
49445 : }
49446 :
49447 0 : static PyObject *py_netr_ServerPasswordGet_get_result(PyObject *obj, void *closure)
49448 : {
49449 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(obj);
49450 : PyObject *py_result;
49451 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
49452 0 : return py_result;
49453 : }
49454 :
49455 0 : static int py_netr_ServerPasswordGet_set_result(PyObject *py_obj, PyObject *value, void *closure)
49456 : {
49457 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49458 0 : if (value == NULL) {
49459 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
49460 0 : return -1;
49461 : }
49462 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
49463 0 : return 0;
49464 : }
49465 :
49466 : static PyGetSetDef py_netr_ServerPasswordGet_getsetters[] = {
49467 : {
49468 : .name = discard_const_p(char, "in_server_name"),
49469 : .get = py_netr_ServerPasswordGet_in_get_server_name,
49470 : .set = py_netr_ServerPasswordGet_in_set_server_name,
49471 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
49472 : },
49473 : {
49474 : .name = discard_const_p(char, "in_account_name"),
49475 : .get = py_netr_ServerPasswordGet_in_get_account_name,
49476 : .set = py_netr_ServerPasswordGet_in_set_account_name,
49477 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
49478 : },
49479 : {
49480 : .name = discard_const_p(char, "in_secure_channel_type"),
49481 : .get = py_netr_ServerPasswordGet_in_get_secure_channel_type,
49482 : .set = py_netr_ServerPasswordGet_in_set_secure_channel_type,
49483 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType")
49484 : },
49485 : {
49486 : .name = discard_const_p(char, "in_computer_name"),
49487 : .get = py_netr_ServerPasswordGet_in_get_computer_name,
49488 : .set = py_netr_ServerPasswordGet_in_set_computer_name,
49489 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
49490 : },
49491 : {
49492 : .name = discard_const_p(char, "in_credential"),
49493 : .get = py_netr_ServerPasswordGet_in_get_credential,
49494 : .set = py_netr_ServerPasswordGet_in_set_credential,
49495 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
49496 : },
49497 : {
49498 : .name = discard_const_p(char, "out_return_authenticator"),
49499 : .get = py_netr_ServerPasswordGet_out_get_return_authenticator,
49500 : .set = py_netr_ServerPasswordGet_out_set_return_authenticator,
49501 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
49502 : },
49503 : {
49504 : .name = discard_const_p(char, "out_password"),
49505 : .get = py_netr_ServerPasswordGet_out_get_password,
49506 : .set = py_netr_ServerPasswordGet_out_set_password,
49507 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
49508 : },
49509 : {
49510 : .name = discard_const_p(char, "result"),
49511 : .get = py_netr_ServerPasswordGet_get_result,
49512 : .set = py_netr_ServerPasswordGet_set_result,
49513 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
49514 : },
49515 : { .name = NULL }
49516 : };
49517 :
49518 0 : static PyObject *py_netr_ServerPasswordGet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
49519 : {
49520 0 : PyObject *self = pytalloc_new(struct netr_ServerPasswordGet, type);
49521 0 : struct netr_ServerPasswordGet *_self = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(self);
49522 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
49523 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
49524 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
49525 0 : _self->out.password = talloc_zero(mem_ctx, struct samr_Password);
49526 0 : return self;
49527 : }
49528 :
49529 0 : static PyObject *py_netr_ServerPasswordGet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
49530 : {
49531 :
49532 :
49533 0 : return PyLong_FromLong(31);
49534 : }
49535 :
49536 0 : static PyObject *py_netr_ServerPasswordGet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
49537 : {
49538 0 : const struct ndr_interface_call *call = NULL;
49539 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49540 0 : PyObject *ret = NULL;
49541 0 : struct ndr_push *push = NULL;
49542 : DATA_BLOB blob;
49543 : enum ndr_err_code err;
49544 :
49545 0 : if (ndr_table_netlogon.num_calls < 32) {
49546 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordGet_ndr_pack");
49547 0 : return NULL;
49548 : }
49549 0 : call = &ndr_table_netlogon.calls[31];
49550 :
49551 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
49552 0 : if (push == NULL) {
49553 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
49554 0 : return NULL;
49555 : }
49556 :
49557 0 : push->flags |= ndr_push_flags;
49558 :
49559 0 : err = call->ndr_push(push, ndr_inout_flags, object);
49560 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
49561 0 : TALLOC_FREE(push);
49562 0 : PyErr_SetNdrError(err);
49563 0 : return NULL;
49564 : }
49565 0 : blob = ndr_push_blob(push);
49566 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
49567 0 : TALLOC_FREE(push);
49568 0 : return ret;
49569 : }
49570 :
49571 0 : static PyObject *py_netr_ServerPasswordGet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49572 : {
49573 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
49574 0 : PyObject *bigendian_obj = NULL;
49575 0 : PyObject *ndr64_obj = NULL;
49576 0 : uint32_t ndr_push_flags = 0;
49577 :
49578 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
49579 : discard_const_p(char *, kwnames),
49580 : &bigendian_obj,
49581 : &ndr64_obj)) {
49582 0 : return NULL;
49583 : }
49584 :
49585 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49586 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
49587 : }
49588 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49589 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
49590 : }
49591 :
49592 0 : return py_netr_ServerPasswordGet_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
49593 : }
49594 :
49595 0 : static PyObject *py_netr_ServerPasswordGet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49596 : {
49597 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
49598 0 : PyObject *bigendian_obj = NULL;
49599 0 : PyObject *ndr64_obj = NULL;
49600 0 : uint32_t ndr_push_flags = 0;
49601 :
49602 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
49603 : discard_const_p(char *, kwnames),
49604 : &bigendian_obj,
49605 : &ndr64_obj)) {
49606 0 : return NULL;
49607 : }
49608 :
49609 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49610 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
49611 : }
49612 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49613 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
49614 : }
49615 :
49616 0 : return py_netr_ServerPasswordGet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
49617 : }
49618 :
49619 0 : static PyObject *py_netr_ServerPasswordGet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
49620 : {
49621 0 : const struct ndr_interface_call *call = NULL;
49622 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49623 0 : struct ndr_pull *pull = NULL;
49624 : enum ndr_err_code err;
49625 :
49626 0 : if (ndr_table_netlogon.num_calls < 32) {
49627 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordGet_ndr_unpack");
49628 0 : return NULL;
49629 : }
49630 0 : call = &ndr_table_netlogon.calls[31];
49631 :
49632 0 : pull = ndr_pull_init_blob(blob, object);
49633 0 : if (pull == NULL) {
49634 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
49635 0 : return NULL;
49636 : }
49637 :
49638 0 : pull->flags |= ndr_pull_flags;
49639 :
49640 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
49641 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
49642 0 : TALLOC_FREE(pull);
49643 0 : PyErr_SetNdrError(err);
49644 0 : return NULL;
49645 : }
49646 0 : if (!allow_remaining) {
49647 : uint32_t highest_ofs;
49648 :
49649 0 : if (pull->offset > pull->relative_highest_offset) {
49650 0 : highest_ofs = pull->offset;
49651 : } else {
49652 0 : highest_ofs = pull->relative_highest_offset;
49653 : }
49654 0 : if (highest_ofs < pull->data_size) {
49655 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
49656 : "not all bytes consumed ofs[%u] size[%u]",
49657 : highest_ofs, pull->data_size);
49658 0 : TALLOC_FREE(pull);
49659 0 : PyErr_SetNdrError(err);
49660 0 : return NULL;
49661 : }
49662 : }
49663 :
49664 0 : TALLOC_FREE(pull);
49665 0 : Py_RETURN_NONE;
49666 : }
49667 :
49668 0 : static PyObject *py_netr_ServerPasswordGet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49669 : {
49670 : DATA_BLOB blob;
49671 0 : Py_ssize_t blob_length = 0;
49672 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
49673 0 : PyObject *bigendian_obj = NULL;
49674 0 : PyObject *ndr64_obj = NULL;
49675 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
49676 0 : PyObject *allow_remaining_obj = NULL;
49677 0 : bool allow_remaining = false;
49678 :
49679 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
49680 : discard_const_p(char *, kwnames),
49681 : &blob.data, &blob_length,
49682 : &bigendian_obj,
49683 : &ndr64_obj,
49684 : &allow_remaining_obj)) {
49685 0 : return NULL;
49686 : }
49687 0 : blob.length = blob_length;
49688 :
49689 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49690 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
49691 : }
49692 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49693 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
49694 : }
49695 :
49696 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
49697 0 : allow_remaining = true;
49698 : }
49699 :
49700 0 : return py_netr_ServerPasswordGet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
49701 : }
49702 :
49703 0 : static PyObject *py_netr_ServerPasswordGet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49704 : {
49705 : DATA_BLOB blob;
49706 0 : Py_ssize_t blob_length = 0;
49707 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
49708 0 : PyObject *bigendian_obj = NULL;
49709 0 : PyObject *ndr64_obj = NULL;
49710 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
49711 0 : PyObject *allow_remaining_obj = NULL;
49712 0 : bool allow_remaining = false;
49713 :
49714 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
49715 : discard_const_p(char *, kwnames),
49716 : &blob.data, &blob_length,
49717 : &bigendian_obj,
49718 : &ndr64_obj,
49719 : &allow_remaining_obj)) {
49720 0 : return NULL;
49721 : }
49722 0 : blob.length = blob_length;
49723 :
49724 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49725 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
49726 : }
49727 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49728 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
49729 : }
49730 :
49731 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
49732 0 : allow_remaining = true;
49733 : }
49734 :
49735 0 : return py_netr_ServerPasswordGet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
49736 : }
49737 :
49738 0 : static PyObject *py_netr_ServerPasswordGet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
49739 : {
49740 0 : const struct ndr_interface_call *call = NULL;
49741 0 : struct netr_ServerPasswordGet *object = (struct netr_ServerPasswordGet *)pytalloc_get_ptr(py_obj);
49742 : PyObject *ret;
49743 : char *retstr;
49744 :
49745 0 : if (ndr_table_netlogon.num_calls < 32) {
49746 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerPasswordGet_ndr_print");
49747 0 : return NULL;
49748 : }
49749 0 : call = &ndr_table_netlogon.calls[31];
49750 :
49751 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
49752 0 : ret = PyUnicode_FromString(retstr);
49753 0 : TALLOC_FREE(retstr);
49754 :
49755 0 : return ret;
49756 : }
49757 :
49758 0 : static PyObject *py_netr_ServerPasswordGet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
49759 : {
49760 0 : return py_netr_ServerPasswordGet_ndr_print(py_obj, "netr_ServerPasswordGet_in", NDR_IN);
49761 : }
49762 :
49763 0 : static PyObject *py_netr_ServerPasswordGet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
49764 : {
49765 0 : return py_netr_ServerPasswordGet_ndr_print(py_obj, "netr_ServerPasswordGet_out", NDR_OUT);
49766 : }
49767 :
49768 : static PyMethodDef py_netr_ServerPasswordGet_methods[] = {
49769 : { "opnum", (PyCFunction)py_netr_ServerPasswordGet_ndr_opnum, METH_NOARGS|METH_CLASS,
49770 : "netlogon.netr_ServerPasswordGet.opnum() -> 31 (0x1f) " },
49771 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordGet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
49772 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
49773 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordGet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
49774 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
49775 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordGet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
49776 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
49777 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerPasswordGet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
49778 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
49779 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerPasswordGet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
49780 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerPasswordGet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
49781 : { NULL, NULL, 0, NULL }
49782 : };
49783 :
49784 :
49785 : static PyTypeObject netr_ServerPasswordGet_Type = {
49786 : PyVarObject_HEAD_INIT(NULL, 0)
49787 : .tp_name = "netlogon.netr_ServerPasswordGet",
49788 : .tp_getset = py_netr_ServerPasswordGet_getsetters,
49789 : .tp_methods = py_netr_ServerPasswordGet_methods,
49790 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
49791 : .tp_new = py_netr_ServerPasswordGet_new,
49792 : };
49793 :
49794 0 : static bool pack_py_netr_ServerPasswordGet_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerPasswordGet *r)
49795 : {
49796 : PyObject *py_server_name;
49797 : PyObject *py_account_name;
49798 : PyObject *py_secure_channel_type;
49799 : PyObject *py_computer_name;
49800 : PyObject *py_credential;
49801 0 : const char *kwnames[] = {
49802 : "server_name", "account_name", "secure_channel_type", "computer_name", "credential", NULL
49803 : };
49804 :
49805 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_ServerPasswordGet", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential)) {
49806 0 : return false;
49807 : }
49808 :
49809 0 : if (py_server_name == NULL) {
49810 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
49811 0 : return false;
49812 : }
49813 0 : if (py_server_name == Py_None) {
49814 0 : r->in.server_name = NULL;
49815 : } else {
49816 0 : r->in.server_name = NULL;
49817 : {
49818 : const char *test_str;
49819 : const char *talloc_str;
49820 0 : PyObject *unicode = NULL;
49821 0 : if (PyUnicode_Check(py_server_name)) {
49822 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
49823 0 : if (unicode == NULL) {
49824 0 : PyErr_NoMemory();
49825 0 : return false;
49826 : }
49827 0 : test_str = PyBytes_AS_STRING(unicode);
49828 0 : } else if (PyBytes_Check(py_server_name)) {
49829 0 : test_str = PyBytes_AS_STRING(py_server_name);
49830 : } else {
49831 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
49832 0 : return false;
49833 : }
49834 0 : talloc_str = talloc_strdup(r, test_str);
49835 0 : if (unicode != NULL) {
49836 0 : Py_DECREF(unicode);
49837 : }
49838 0 : if (talloc_str == NULL) {
49839 0 : PyErr_NoMemory();
49840 0 : return false;
49841 : }
49842 0 : r->in.server_name = talloc_str;
49843 : }
49844 : }
49845 0 : if (py_account_name == NULL) {
49846 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
49847 0 : return false;
49848 : }
49849 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
49850 0 : if (r->in.account_name == NULL) {
49851 0 : PyErr_NoMemory();
49852 0 : return false;
49853 : }
49854 : {
49855 : const char *test_str;
49856 : const char *talloc_str;
49857 0 : PyObject *unicode = NULL;
49858 0 : if (PyUnicode_Check(py_account_name)) {
49859 0 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
49860 0 : if (unicode == NULL) {
49861 0 : PyErr_NoMemory();
49862 0 : return false;
49863 : }
49864 0 : test_str = PyBytes_AS_STRING(unicode);
49865 0 : } else if (PyBytes_Check(py_account_name)) {
49866 0 : test_str = PyBytes_AS_STRING(py_account_name);
49867 : } else {
49868 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
49869 0 : return false;
49870 : }
49871 0 : talloc_str = talloc_strdup(r, test_str);
49872 0 : if (unicode != NULL) {
49873 0 : Py_DECREF(unicode);
49874 : }
49875 0 : if (talloc_str == NULL) {
49876 0 : PyErr_NoMemory();
49877 0 : return false;
49878 : }
49879 0 : r->in.account_name = talloc_str;
49880 : }
49881 0 : if (py_secure_channel_type == NULL) {
49882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type");
49883 0 : return false;
49884 : }
49885 : {
49886 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type));
49887 0 : if (PyLong_Check(py_secure_channel_type)) {
49888 : unsigned long long test_var;
49889 0 : test_var = PyLong_AsUnsignedLongLong(py_secure_channel_type);
49890 0 : if (PyErr_Occurred() != NULL) {
49891 0 : return false;
49892 : }
49893 0 : if (test_var > uint_max) {
49894 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49895 : PyLong_Type.tp_name, uint_max, test_var);
49896 0 : return false;
49897 : }
49898 0 : r->in.secure_channel_type = test_var;
49899 : } else {
49900 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49901 : PyLong_Type.tp_name);
49902 0 : return false;
49903 : }
49904 : }
49905 0 : if (py_computer_name == NULL) {
49906 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
49907 0 : return false;
49908 : }
49909 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
49910 0 : if (r->in.computer_name == NULL) {
49911 0 : PyErr_NoMemory();
49912 0 : return false;
49913 : }
49914 : {
49915 : const char *test_str;
49916 : const char *talloc_str;
49917 0 : PyObject *unicode = NULL;
49918 0 : if (PyUnicode_Check(py_computer_name)) {
49919 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
49920 0 : if (unicode == NULL) {
49921 0 : PyErr_NoMemory();
49922 0 : return false;
49923 : }
49924 0 : test_str = PyBytes_AS_STRING(unicode);
49925 0 : } else if (PyBytes_Check(py_computer_name)) {
49926 0 : test_str = PyBytes_AS_STRING(py_computer_name);
49927 : } else {
49928 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
49929 0 : return false;
49930 : }
49931 0 : talloc_str = talloc_strdup(r, test_str);
49932 0 : if (unicode != NULL) {
49933 0 : Py_DECREF(unicode);
49934 : }
49935 0 : if (talloc_str == NULL) {
49936 0 : PyErr_NoMemory();
49937 0 : return false;
49938 : }
49939 0 : r->in.computer_name = talloc_str;
49940 : }
49941 0 : if (py_credential == NULL) {
49942 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
49943 0 : return false;
49944 : }
49945 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
49946 0 : if (r->in.credential == NULL) {
49947 0 : PyErr_NoMemory();
49948 0 : return false;
49949 : }
49950 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
49951 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
49952 0 : PyErr_NoMemory();
49953 0 : return false;
49954 : }
49955 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
49956 0 : return true;
49957 : }
49958 :
49959 0 : static PyObject *unpack_py_netr_ServerPasswordGet_args_out(struct netr_ServerPasswordGet *r)
49960 : {
49961 : PyObject *result;
49962 : PyObject *py_return_authenticator;
49963 : PyObject *py_password;
49964 0 : result = PyTuple_New(2);
49965 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
49966 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
49967 0 : py_password = pytalloc_reference_ex(samr_Password_Type, r->out.password, r->out.password);
49968 0 : PyTuple_SetItem(result, 1, py_password);
49969 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
49970 0 : PyErr_SetNTSTATUS(r->out.result);
49971 0 : return NULL;
49972 : }
49973 :
49974 0 : return result;
49975 : }
49976 :
49977 :
49978 0 : static PyObject *py_netr_NetrLogonSendToSam_in_get_server_name(PyObject *obj, void *closure)
49979 : {
49980 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj);
49981 : PyObject *py_server_name;
49982 0 : if (object->in.server_name == NULL) {
49983 0 : Py_RETURN_NONE;
49984 : }
49985 0 : if (object->in.server_name == NULL) {
49986 0 : py_server_name = Py_None;
49987 0 : Py_INCREF(py_server_name);
49988 : } else {
49989 0 : if (object->in.server_name == NULL) {
49990 0 : py_server_name = Py_None;
49991 0 : Py_INCREF(py_server_name);
49992 : } else {
49993 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
49994 : }
49995 : }
49996 0 : return py_server_name;
49997 : }
49998 :
49999 0 : static int py_netr_NetrLogonSendToSam_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
50000 : {
50001 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50002 0 : if (value == NULL) {
50003 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
50004 0 : return -1;
50005 : }
50006 0 : if (value == Py_None) {
50007 0 : object->in.server_name = NULL;
50008 : } else {
50009 0 : object->in.server_name = NULL;
50010 : {
50011 : const char *test_str;
50012 : const char *talloc_str;
50013 0 : PyObject *unicode = NULL;
50014 0 : if (PyUnicode_Check(value)) {
50015 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
50016 0 : if (unicode == NULL) {
50017 0 : PyErr_NoMemory();
50018 0 : return -1;
50019 : }
50020 0 : test_str = PyBytes_AS_STRING(unicode);
50021 0 : } else if (PyBytes_Check(value)) {
50022 0 : test_str = PyBytes_AS_STRING(value);
50023 : } else {
50024 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
50025 0 : return -1;
50026 : }
50027 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
50028 0 : if (unicode != NULL) {
50029 0 : Py_DECREF(unicode);
50030 : }
50031 0 : if (talloc_str == NULL) {
50032 0 : PyErr_NoMemory();
50033 0 : return -1;
50034 : }
50035 0 : object->in.server_name = talloc_str;
50036 : }
50037 : }
50038 0 : return 0;
50039 : }
50040 :
50041 0 : static PyObject *py_netr_NetrLogonSendToSam_in_get_computer_name(PyObject *obj, void *closure)
50042 : {
50043 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj);
50044 : PyObject *py_computer_name;
50045 0 : if (object->in.computer_name == NULL) {
50046 0 : Py_RETURN_NONE;
50047 : }
50048 0 : if (object->in.computer_name == NULL) {
50049 0 : py_computer_name = Py_None;
50050 0 : Py_INCREF(py_computer_name);
50051 : } else {
50052 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
50053 : }
50054 0 : return py_computer_name;
50055 : }
50056 :
50057 0 : static int py_netr_NetrLogonSendToSam_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
50058 : {
50059 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50060 0 : if (value == NULL) {
50061 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
50062 0 : return -1;
50063 : }
50064 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
50065 0 : if (object->in.computer_name == NULL) {
50066 0 : PyErr_NoMemory();
50067 0 : return -1;
50068 : }
50069 : {
50070 : const char *test_str;
50071 : const char *talloc_str;
50072 0 : PyObject *unicode = NULL;
50073 0 : if (PyUnicode_Check(value)) {
50074 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
50075 0 : if (unicode == NULL) {
50076 0 : PyErr_NoMemory();
50077 0 : return -1;
50078 : }
50079 0 : test_str = PyBytes_AS_STRING(unicode);
50080 0 : } else if (PyBytes_Check(value)) {
50081 0 : test_str = PyBytes_AS_STRING(value);
50082 : } else {
50083 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
50084 0 : return -1;
50085 : }
50086 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
50087 0 : if (unicode != NULL) {
50088 0 : Py_DECREF(unicode);
50089 : }
50090 0 : if (talloc_str == NULL) {
50091 0 : PyErr_NoMemory();
50092 0 : return -1;
50093 : }
50094 0 : object->in.computer_name = talloc_str;
50095 : }
50096 0 : return 0;
50097 : }
50098 :
50099 0 : static PyObject *py_netr_NetrLogonSendToSam_in_get_credential(PyObject *obj, void *closure)
50100 : {
50101 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj);
50102 : PyObject *py_credential;
50103 0 : if (object->in.credential == NULL) {
50104 0 : Py_RETURN_NONE;
50105 : }
50106 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
50107 0 : return py_credential;
50108 : }
50109 :
50110 0 : static int py_netr_NetrLogonSendToSam_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
50111 : {
50112 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50113 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
50114 0 : if (value == NULL) {
50115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
50116 0 : return -1;
50117 : }
50118 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
50119 0 : if (object->in.credential == NULL) {
50120 0 : PyErr_NoMemory();
50121 0 : return -1;
50122 : }
50123 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
50124 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50125 0 : PyErr_NoMemory();
50126 0 : return -1;
50127 : }
50128 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
50129 0 : return 0;
50130 : }
50131 :
50132 0 : static PyObject *py_netr_NetrLogonSendToSam_out_get_return_authenticator(PyObject *obj, void *closure)
50133 : {
50134 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj);
50135 : PyObject *py_return_authenticator;
50136 0 : if (object->out.return_authenticator == NULL) {
50137 0 : Py_RETURN_NONE;
50138 : }
50139 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
50140 0 : return py_return_authenticator;
50141 : }
50142 :
50143 0 : static int py_netr_NetrLogonSendToSam_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
50144 : {
50145 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50146 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
50147 0 : if (value == NULL) {
50148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
50149 0 : return -1;
50150 : }
50151 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
50152 0 : if (object->out.return_authenticator == NULL) {
50153 0 : PyErr_NoMemory();
50154 0 : return -1;
50155 : }
50156 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
50157 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50158 0 : PyErr_NoMemory();
50159 0 : return -1;
50160 : }
50161 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
50162 0 : return 0;
50163 : }
50164 :
50165 0 : static PyObject *py_netr_NetrLogonSendToSam_in_get_opaque_buffer(PyObject *obj, void *closure)
50166 : {
50167 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj);
50168 : PyObject *py_opaque_buffer;
50169 0 : if (object->in.opaque_buffer == NULL) {
50170 0 : Py_RETURN_NONE;
50171 : }
50172 0 : py_opaque_buffer = PyList_New(object->in.buffer_len);
50173 0 : if (py_opaque_buffer == NULL) {
50174 0 : return NULL;
50175 : }
50176 : {
50177 : int opaque_buffer_cntr_1;
50178 0 : for (opaque_buffer_cntr_1 = 0; opaque_buffer_cntr_1 < (object->in.buffer_len); opaque_buffer_cntr_1++) {
50179 : PyObject *py_opaque_buffer_1;
50180 0 : py_opaque_buffer_1 = PyLong_FromLong((uint16_t)object->in.opaque_buffer[opaque_buffer_cntr_1]);
50181 0 : PyList_SetItem(py_opaque_buffer, opaque_buffer_cntr_1, py_opaque_buffer_1);
50182 : }
50183 : }
50184 0 : return py_opaque_buffer;
50185 : }
50186 :
50187 0 : static int py_netr_NetrLogonSendToSam_in_set_opaque_buffer(PyObject *py_obj, PyObject *value, void *closure)
50188 : {
50189 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50190 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.opaque_buffer));
50191 0 : if (value == NULL) {
50192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.opaque_buffer");
50193 0 : return -1;
50194 : }
50195 0 : object->in.opaque_buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.opaque_buffer);
50196 0 : if (object->in.opaque_buffer == NULL) {
50197 0 : PyErr_NoMemory();
50198 0 : return -1;
50199 : }
50200 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
50201 : {
50202 : int opaque_buffer_cntr_1;
50203 0 : object->in.opaque_buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.opaque_buffer, PyList_GET_SIZE(value));
50204 0 : if (!object->in.opaque_buffer) { return -1;; }
50205 0 : talloc_set_name_const(object->in.opaque_buffer, "ARRAY: object->in.opaque_buffer");
50206 0 : for (opaque_buffer_cntr_1 = 0; opaque_buffer_cntr_1 < PyList_GET_SIZE(value); opaque_buffer_cntr_1++) {
50207 0 : if (PyList_GET_ITEM(value, opaque_buffer_cntr_1) == NULL) {
50208 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.opaque_buffer[opaque_buffer_cntr_1]");
50209 0 : return -1;
50210 : }
50211 : {
50212 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.opaque_buffer[opaque_buffer_cntr_1]));
50213 0 : if (PyLong_Check(PyList_GET_ITEM(value, opaque_buffer_cntr_1))) {
50214 : unsigned long long test_var;
50215 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, opaque_buffer_cntr_1));
50216 0 : if (PyErr_Occurred() != NULL) {
50217 0 : return -1;
50218 : }
50219 0 : if (test_var > uint_max) {
50220 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50221 : PyLong_Type.tp_name, uint_max, test_var);
50222 0 : return -1;
50223 : }
50224 0 : object->in.opaque_buffer[opaque_buffer_cntr_1] = test_var;
50225 : } else {
50226 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50227 : PyLong_Type.tp_name);
50228 0 : return -1;
50229 : }
50230 : }
50231 : }
50232 : }
50233 0 : return 0;
50234 : }
50235 :
50236 0 : static PyObject *py_netr_NetrLogonSendToSam_in_get_buffer_len(PyObject *obj, void *closure)
50237 : {
50238 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj);
50239 : PyObject *py_buffer_len;
50240 0 : py_buffer_len = PyLong_FromUnsignedLongLong((uint32_t)object->in.buffer_len);
50241 0 : return py_buffer_len;
50242 : }
50243 :
50244 0 : static int py_netr_NetrLogonSendToSam_in_set_buffer_len(PyObject *py_obj, PyObject *value, void *closure)
50245 : {
50246 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50247 0 : if (value == NULL) {
50248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buffer_len");
50249 0 : return -1;
50250 : }
50251 : {
50252 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buffer_len));
50253 0 : if (PyLong_Check(value)) {
50254 : unsigned long long test_var;
50255 0 : test_var = PyLong_AsUnsignedLongLong(value);
50256 0 : if (PyErr_Occurred() != NULL) {
50257 0 : return -1;
50258 : }
50259 0 : if (test_var > uint_max) {
50260 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50261 : PyLong_Type.tp_name, uint_max, test_var);
50262 0 : return -1;
50263 : }
50264 0 : object->in.buffer_len = test_var;
50265 : } else {
50266 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50267 : PyLong_Type.tp_name);
50268 0 : return -1;
50269 : }
50270 : }
50271 0 : return 0;
50272 : }
50273 :
50274 0 : static PyObject *py_netr_NetrLogonSendToSam_get_result(PyObject *obj, void *closure)
50275 : {
50276 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(obj);
50277 : PyObject *py_result;
50278 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
50279 0 : return py_result;
50280 : }
50281 :
50282 0 : static int py_netr_NetrLogonSendToSam_set_result(PyObject *py_obj, PyObject *value, void *closure)
50283 : {
50284 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50285 0 : if (value == NULL) {
50286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
50287 0 : return -1;
50288 : }
50289 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
50290 0 : return 0;
50291 : }
50292 :
50293 : static PyGetSetDef py_netr_NetrLogonSendToSam_getsetters[] = {
50294 : {
50295 : .name = discard_const_p(char, "in_server_name"),
50296 : .get = py_netr_NetrLogonSendToSam_in_get_server_name,
50297 : .set = py_netr_NetrLogonSendToSam_in_set_server_name,
50298 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
50299 : },
50300 : {
50301 : .name = discard_const_p(char, "in_computer_name"),
50302 : .get = py_netr_NetrLogonSendToSam_in_get_computer_name,
50303 : .set = py_netr_NetrLogonSendToSam_in_set_computer_name,
50304 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
50305 : },
50306 : {
50307 : .name = discard_const_p(char, "in_credential"),
50308 : .get = py_netr_NetrLogonSendToSam_in_get_credential,
50309 : .set = py_netr_NetrLogonSendToSam_in_set_credential,
50310 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
50311 : },
50312 : {
50313 : .name = discard_const_p(char, "out_return_authenticator"),
50314 : .get = py_netr_NetrLogonSendToSam_out_get_return_authenticator,
50315 : .set = py_netr_NetrLogonSendToSam_out_set_return_authenticator,
50316 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
50317 : },
50318 : {
50319 : .name = discard_const_p(char, "in_opaque_buffer"),
50320 : .get = py_netr_NetrLogonSendToSam_in_get_opaque_buffer,
50321 : .set = py_netr_NetrLogonSendToSam_in_set_opaque_buffer,
50322 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
50323 : },
50324 : {
50325 : .name = discard_const_p(char, "in_buffer_len"),
50326 : .get = py_netr_NetrLogonSendToSam_in_get_buffer_len,
50327 : .set = py_netr_NetrLogonSendToSam_in_set_buffer_len,
50328 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
50329 : },
50330 : {
50331 : .name = discard_const_p(char, "result"),
50332 : .get = py_netr_NetrLogonSendToSam_get_result,
50333 : .set = py_netr_NetrLogonSendToSam_set_result,
50334 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
50335 : },
50336 : { .name = NULL }
50337 : };
50338 :
50339 0 : static PyObject *py_netr_NetrLogonSendToSam_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
50340 : {
50341 0 : PyObject *self = pytalloc_new(struct netr_NetrLogonSendToSam, type);
50342 0 : struct netr_NetrLogonSendToSam *_self = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(self);
50343 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
50344 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
50345 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
50346 0 : _self->in.opaque_buffer = talloc_zero(mem_ctx, uint8_t);
50347 0 : return self;
50348 : }
50349 :
50350 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
50351 : {
50352 :
50353 :
50354 0 : return PyLong_FromLong(32);
50355 : }
50356 :
50357 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
50358 : {
50359 0 : const struct ndr_interface_call *call = NULL;
50360 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50361 0 : PyObject *ret = NULL;
50362 0 : struct ndr_push *push = NULL;
50363 : DATA_BLOB blob;
50364 : enum ndr_err_code err;
50365 :
50366 0 : if (ndr_table_netlogon.num_calls < 33) {
50367 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrLogonSendToSam_ndr_pack");
50368 0 : return NULL;
50369 : }
50370 0 : call = &ndr_table_netlogon.calls[32];
50371 :
50372 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
50373 0 : if (push == NULL) {
50374 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50375 0 : return NULL;
50376 : }
50377 :
50378 0 : push->flags |= ndr_push_flags;
50379 :
50380 0 : err = call->ndr_push(push, ndr_inout_flags, object);
50381 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50382 0 : TALLOC_FREE(push);
50383 0 : PyErr_SetNdrError(err);
50384 0 : return NULL;
50385 : }
50386 0 : blob = ndr_push_blob(push);
50387 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
50388 0 : TALLOC_FREE(push);
50389 0 : return ret;
50390 : }
50391 :
50392 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50393 : {
50394 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50395 0 : PyObject *bigendian_obj = NULL;
50396 0 : PyObject *ndr64_obj = NULL;
50397 0 : uint32_t ndr_push_flags = 0;
50398 :
50399 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
50400 : discard_const_p(char *, kwnames),
50401 : &bigendian_obj,
50402 : &ndr64_obj)) {
50403 0 : return NULL;
50404 : }
50405 :
50406 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50407 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50408 : }
50409 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50410 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50411 : }
50412 :
50413 0 : return py_netr_NetrLogonSendToSam_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
50414 : }
50415 :
50416 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50417 : {
50418 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50419 0 : PyObject *bigendian_obj = NULL;
50420 0 : PyObject *ndr64_obj = NULL;
50421 0 : uint32_t ndr_push_flags = 0;
50422 :
50423 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
50424 : discard_const_p(char *, kwnames),
50425 : &bigendian_obj,
50426 : &ndr64_obj)) {
50427 0 : return NULL;
50428 : }
50429 :
50430 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50431 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50432 : }
50433 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50434 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50435 : }
50436 :
50437 0 : return py_netr_NetrLogonSendToSam_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
50438 : }
50439 :
50440 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
50441 : {
50442 0 : const struct ndr_interface_call *call = NULL;
50443 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50444 0 : struct ndr_pull *pull = NULL;
50445 : enum ndr_err_code err;
50446 :
50447 0 : if (ndr_table_netlogon.num_calls < 33) {
50448 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrLogonSendToSam_ndr_unpack");
50449 0 : return NULL;
50450 : }
50451 0 : call = &ndr_table_netlogon.calls[32];
50452 :
50453 0 : pull = ndr_pull_init_blob(blob, object);
50454 0 : if (pull == NULL) {
50455 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50456 0 : return NULL;
50457 : }
50458 :
50459 0 : pull->flags |= ndr_pull_flags;
50460 :
50461 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
50462 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50463 0 : TALLOC_FREE(pull);
50464 0 : PyErr_SetNdrError(err);
50465 0 : return NULL;
50466 : }
50467 0 : if (!allow_remaining) {
50468 : uint32_t highest_ofs;
50469 :
50470 0 : if (pull->offset > pull->relative_highest_offset) {
50471 0 : highest_ofs = pull->offset;
50472 : } else {
50473 0 : highest_ofs = pull->relative_highest_offset;
50474 : }
50475 0 : if (highest_ofs < pull->data_size) {
50476 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
50477 : "not all bytes consumed ofs[%u] size[%u]",
50478 : highest_ofs, pull->data_size);
50479 0 : TALLOC_FREE(pull);
50480 0 : PyErr_SetNdrError(err);
50481 0 : return NULL;
50482 : }
50483 : }
50484 :
50485 0 : TALLOC_FREE(pull);
50486 0 : Py_RETURN_NONE;
50487 : }
50488 :
50489 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50490 : {
50491 : DATA_BLOB blob;
50492 0 : Py_ssize_t blob_length = 0;
50493 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50494 0 : PyObject *bigendian_obj = NULL;
50495 0 : PyObject *ndr64_obj = NULL;
50496 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50497 0 : PyObject *allow_remaining_obj = NULL;
50498 0 : bool allow_remaining = false;
50499 :
50500 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
50501 : discard_const_p(char *, kwnames),
50502 : &blob.data, &blob_length,
50503 : &bigendian_obj,
50504 : &ndr64_obj,
50505 : &allow_remaining_obj)) {
50506 0 : return NULL;
50507 : }
50508 0 : blob.length = blob_length;
50509 :
50510 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50511 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50512 : }
50513 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50514 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50515 : }
50516 :
50517 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50518 0 : allow_remaining = true;
50519 : }
50520 :
50521 0 : return py_netr_NetrLogonSendToSam_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
50522 : }
50523 :
50524 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50525 : {
50526 : DATA_BLOB blob;
50527 0 : Py_ssize_t blob_length = 0;
50528 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50529 0 : PyObject *bigendian_obj = NULL;
50530 0 : PyObject *ndr64_obj = NULL;
50531 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50532 0 : PyObject *allow_remaining_obj = NULL;
50533 0 : bool allow_remaining = false;
50534 :
50535 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
50536 : discard_const_p(char *, kwnames),
50537 : &blob.data, &blob_length,
50538 : &bigendian_obj,
50539 : &ndr64_obj,
50540 : &allow_remaining_obj)) {
50541 0 : return NULL;
50542 : }
50543 0 : blob.length = blob_length;
50544 :
50545 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50546 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50547 : }
50548 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50549 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50550 : }
50551 :
50552 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50553 0 : allow_remaining = true;
50554 : }
50555 :
50556 0 : return py_netr_NetrLogonSendToSam_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
50557 : }
50558 :
50559 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
50560 : {
50561 0 : const struct ndr_interface_call *call = NULL;
50562 0 : struct netr_NetrLogonSendToSam *object = (struct netr_NetrLogonSendToSam *)pytalloc_get_ptr(py_obj);
50563 : PyObject *ret;
50564 : char *retstr;
50565 :
50566 0 : if (ndr_table_netlogon.num_calls < 33) {
50567 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrLogonSendToSam_ndr_print");
50568 0 : return NULL;
50569 : }
50570 0 : call = &ndr_table_netlogon.calls[32];
50571 :
50572 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
50573 0 : ret = PyUnicode_FromString(retstr);
50574 0 : TALLOC_FREE(retstr);
50575 :
50576 0 : return ret;
50577 : }
50578 :
50579 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
50580 : {
50581 0 : return py_netr_NetrLogonSendToSam_ndr_print(py_obj, "netr_NetrLogonSendToSam_in", NDR_IN);
50582 : }
50583 :
50584 0 : static PyObject *py_netr_NetrLogonSendToSam_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
50585 : {
50586 0 : return py_netr_NetrLogonSendToSam_ndr_print(py_obj, "netr_NetrLogonSendToSam_out", NDR_OUT);
50587 : }
50588 :
50589 : static PyMethodDef py_netr_NetrLogonSendToSam_methods[] = {
50590 : { "opnum", (PyCFunction)py_netr_NetrLogonSendToSam_ndr_opnum, METH_NOARGS|METH_CLASS,
50591 : "netlogon.netr_NetrLogonSendToSam.opnum() -> 32 (0x20) " },
50592 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrLogonSendToSam_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
50593 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
50594 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrLogonSendToSam_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
50595 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
50596 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrLogonSendToSam_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
50597 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
50598 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrLogonSendToSam_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
50599 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
50600 : { "__ndr_print_in__", (PyCFunction)py_netr_NetrLogonSendToSam_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
50601 : { "__ndr_print_out__", (PyCFunction)py_netr_NetrLogonSendToSam_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
50602 : { NULL, NULL, 0, NULL }
50603 : };
50604 :
50605 :
50606 : static PyTypeObject netr_NetrLogonSendToSam_Type = {
50607 : PyVarObject_HEAD_INIT(NULL, 0)
50608 : .tp_name = "netlogon.netr_NetrLogonSendToSam",
50609 : .tp_getset = py_netr_NetrLogonSendToSam_getsetters,
50610 : .tp_methods = py_netr_NetrLogonSendToSam_methods,
50611 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
50612 : .tp_new = py_netr_NetrLogonSendToSam_new,
50613 : };
50614 :
50615 0 : static bool pack_py_netr_NetrLogonSendToSam_args_in(PyObject *args, PyObject *kwargs, struct netr_NetrLogonSendToSam *r)
50616 : {
50617 : PyObject *py_server_name;
50618 : PyObject *py_computer_name;
50619 : PyObject *py_credential;
50620 : PyObject *py_opaque_buffer;
50621 0 : const char *kwnames[] = {
50622 : "server_name", "computer_name", "credential", "opaque_buffer", NULL
50623 : };
50624 :
50625 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:netr_NetrLogonSendToSam", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_opaque_buffer)) {
50626 0 : return false;
50627 : }
50628 :
50629 0 : if (py_server_name == NULL) {
50630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
50631 0 : return false;
50632 : }
50633 0 : if (py_server_name == Py_None) {
50634 0 : r->in.server_name = NULL;
50635 : } else {
50636 0 : r->in.server_name = NULL;
50637 : {
50638 : const char *test_str;
50639 : const char *talloc_str;
50640 0 : PyObject *unicode = NULL;
50641 0 : if (PyUnicode_Check(py_server_name)) {
50642 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
50643 0 : if (unicode == NULL) {
50644 0 : PyErr_NoMemory();
50645 0 : return false;
50646 : }
50647 0 : test_str = PyBytes_AS_STRING(unicode);
50648 0 : } else if (PyBytes_Check(py_server_name)) {
50649 0 : test_str = PyBytes_AS_STRING(py_server_name);
50650 : } else {
50651 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
50652 0 : return false;
50653 : }
50654 0 : talloc_str = talloc_strdup(r, test_str);
50655 0 : if (unicode != NULL) {
50656 0 : Py_DECREF(unicode);
50657 : }
50658 0 : if (talloc_str == NULL) {
50659 0 : PyErr_NoMemory();
50660 0 : return false;
50661 : }
50662 0 : r->in.server_name = talloc_str;
50663 : }
50664 : }
50665 0 : if (py_computer_name == NULL) {
50666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
50667 0 : return false;
50668 : }
50669 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
50670 0 : if (r->in.computer_name == NULL) {
50671 0 : PyErr_NoMemory();
50672 0 : return false;
50673 : }
50674 : {
50675 : const char *test_str;
50676 : const char *talloc_str;
50677 0 : PyObject *unicode = NULL;
50678 0 : if (PyUnicode_Check(py_computer_name)) {
50679 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
50680 0 : if (unicode == NULL) {
50681 0 : PyErr_NoMemory();
50682 0 : return false;
50683 : }
50684 0 : test_str = PyBytes_AS_STRING(unicode);
50685 0 : } else if (PyBytes_Check(py_computer_name)) {
50686 0 : test_str = PyBytes_AS_STRING(py_computer_name);
50687 : } else {
50688 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
50689 0 : return false;
50690 : }
50691 0 : talloc_str = talloc_strdup(r, test_str);
50692 0 : if (unicode != NULL) {
50693 0 : Py_DECREF(unicode);
50694 : }
50695 0 : if (talloc_str == NULL) {
50696 0 : PyErr_NoMemory();
50697 0 : return false;
50698 : }
50699 0 : r->in.computer_name = talloc_str;
50700 : }
50701 0 : if (py_credential == NULL) {
50702 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
50703 0 : return false;
50704 : }
50705 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
50706 0 : if (r->in.credential == NULL) {
50707 0 : PyErr_NoMemory();
50708 0 : return false;
50709 : }
50710 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
50711 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
50712 0 : PyErr_NoMemory();
50713 0 : return false;
50714 : }
50715 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
50716 0 : if (py_opaque_buffer == NULL) {
50717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.opaque_buffer");
50718 0 : return false;
50719 : }
50720 0 : r->in.opaque_buffer = talloc_ptrtype(r, r->in.opaque_buffer);
50721 0 : if (r->in.opaque_buffer == NULL) {
50722 0 : PyErr_NoMemory();
50723 0 : return false;
50724 : }
50725 0 : PY_CHECK_TYPE(&PyList_Type, py_opaque_buffer, return false;);
50726 : {
50727 : int opaque_buffer_cntr_1;
50728 0 : r->in.opaque_buffer = talloc_array_ptrtype(r, r->in.opaque_buffer, PyList_GET_SIZE(py_opaque_buffer));
50729 0 : if (!r->in.opaque_buffer) { return false;; }
50730 0 : talloc_set_name_const(r->in.opaque_buffer, "ARRAY: r->in.opaque_buffer");
50731 0 : for (opaque_buffer_cntr_1 = 0; opaque_buffer_cntr_1 < PyList_GET_SIZE(py_opaque_buffer); opaque_buffer_cntr_1++) {
50732 0 : if (PyList_GET_ITEM(py_opaque_buffer, opaque_buffer_cntr_1) == NULL) {
50733 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.opaque_buffer[opaque_buffer_cntr_1]");
50734 0 : return false;
50735 : }
50736 : {
50737 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.opaque_buffer[opaque_buffer_cntr_1]));
50738 0 : if (PyLong_Check(PyList_GET_ITEM(py_opaque_buffer, opaque_buffer_cntr_1))) {
50739 : unsigned long long test_var;
50740 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_opaque_buffer, opaque_buffer_cntr_1));
50741 0 : if (PyErr_Occurred() != NULL) {
50742 0 : return false;
50743 : }
50744 0 : if (test_var > uint_max) {
50745 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50746 : PyLong_Type.tp_name, uint_max, test_var);
50747 0 : return false;
50748 : }
50749 0 : r->in.opaque_buffer[opaque_buffer_cntr_1] = test_var;
50750 : } else {
50751 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50752 : PyLong_Type.tp_name);
50753 0 : return false;
50754 : }
50755 : }
50756 : }
50757 : }
50758 0 : PY_CHECK_TYPE(&PyList_Type, py_opaque_buffer, return false;);
50759 0 : r->in.buffer_len = PyList_GET_SIZE(py_opaque_buffer);
50760 0 : return true;
50761 : }
50762 :
50763 0 : static PyObject *unpack_py_netr_NetrLogonSendToSam_args_out(struct netr_NetrLogonSendToSam *r)
50764 : {
50765 : PyObject *result;
50766 : PyObject *py_return_authenticator;
50767 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
50768 0 : result = py_return_authenticator;
50769 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
50770 0 : PyErr_SetNTSTATUS(r->out.result);
50771 0 : return NULL;
50772 : }
50773 :
50774 0 : return result;
50775 : }
50776 :
50777 :
50778 0 : static PyObject *py_netr_DsRAddressToSitenamesW_in_get_server_name(PyObject *obj, void *closure)
50779 : {
50780 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj);
50781 : PyObject *py_server_name;
50782 0 : if (object->in.server_name == NULL) {
50783 0 : Py_RETURN_NONE;
50784 : }
50785 0 : if (object->in.server_name == NULL) {
50786 0 : py_server_name = Py_None;
50787 0 : Py_INCREF(py_server_name);
50788 : } else {
50789 0 : if (object->in.server_name == NULL) {
50790 0 : py_server_name = Py_None;
50791 0 : Py_INCREF(py_server_name);
50792 : } else {
50793 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
50794 : }
50795 : }
50796 0 : return py_server_name;
50797 : }
50798 :
50799 0 : static int py_netr_DsRAddressToSitenamesW_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
50800 : {
50801 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj);
50802 0 : if (value == NULL) {
50803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
50804 0 : return -1;
50805 : }
50806 0 : if (value == Py_None) {
50807 0 : object->in.server_name = NULL;
50808 : } else {
50809 0 : object->in.server_name = NULL;
50810 : {
50811 : const char *test_str;
50812 : const char *talloc_str;
50813 0 : PyObject *unicode = NULL;
50814 0 : if (PyUnicode_Check(value)) {
50815 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
50816 0 : if (unicode == NULL) {
50817 0 : PyErr_NoMemory();
50818 0 : return -1;
50819 : }
50820 0 : test_str = PyBytes_AS_STRING(unicode);
50821 0 : } else if (PyBytes_Check(value)) {
50822 0 : test_str = PyBytes_AS_STRING(value);
50823 : } else {
50824 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
50825 0 : return -1;
50826 : }
50827 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
50828 0 : if (unicode != NULL) {
50829 0 : Py_DECREF(unicode);
50830 : }
50831 0 : if (talloc_str == NULL) {
50832 0 : PyErr_NoMemory();
50833 0 : return -1;
50834 : }
50835 0 : object->in.server_name = talloc_str;
50836 : }
50837 : }
50838 0 : return 0;
50839 : }
50840 :
50841 0 : static PyObject *py_netr_DsRAddressToSitenamesW_in_get_count(PyObject *obj, void *closure)
50842 : {
50843 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj);
50844 : PyObject *py_count;
50845 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->in.count);
50846 0 : return py_count;
50847 : }
50848 :
50849 0 : static int py_netr_DsRAddressToSitenamesW_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
50850 : {
50851 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj);
50852 0 : if (value == NULL) {
50853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
50854 0 : return -1;
50855 : }
50856 : {
50857 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.count));
50858 0 : if (PyLong_Check(value)) {
50859 : unsigned long long test_var;
50860 0 : test_var = PyLong_AsUnsignedLongLong(value);
50861 0 : if (PyErr_Occurred() != NULL) {
50862 0 : return -1;
50863 : }
50864 0 : if (test_var > uint_max) {
50865 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50866 : PyLong_Type.tp_name, uint_max, test_var);
50867 0 : return -1;
50868 : }
50869 0 : object->in.count = test_var;
50870 : } else {
50871 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50872 : PyLong_Type.tp_name);
50873 0 : return -1;
50874 : }
50875 : }
50876 0 : return 0;
50877 : }
50878 :
50879 0 : static PyObject *py_netr_DsRAddressToSitenamesW_in_get_addresses(PyObject *obj, void *closure)
50880 : {
50881 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj);
50882 : PyObject *py_addresses;
50883 0 : if (object->in.addresses == NULL) {
50884 0 : Py_RETURN_NONE;
50885 : }
50886 0 : py_addresses = PyList_New(object->in.count);
50887 0 : if (py_addresses == NULL) {
50888 0 : return NULL;
50889 : }
50890 : {
50891 : int addresses_cntr_1;
50892 0 : for (addresses_cntr_1 = 0; addresses_cntr_1 < (object->in.count); addresses_cntr_1++) {
50893 : PyObject *py_addresses_1;
50894 0 : py_addresses_1 = pytalloc_reference_ex(&netr_DsRAddress_Type, object->in.addresses, &object->in.addresses[addresses_cntr_1]);
50895 0 : PyList_SetItem(py_addresses, addresses_cntr_1, py_addresses_1);
50896 : }
50897 : }
50898 0 : return py_addresses;
50899 : }
50900 :
50901 0 : static int py_netr_DsRAddressToSitenamesW_in_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
50902 : {
50903 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj);
50904 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.addresses));
50905 0 : if (value == NULL) {
50906 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.addresses");
50907 0 : return -1;
50908 : }
50909 0 : object->in.addresses = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addresses);
50910 0 : if (object->in.addresses == NULL) {
50911 0 : PyErr_NoMemory();
50912 0 : return -1;
50913 : }
50914 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
50915 : {
50916 : int addresses_cntr_1;
50917 0 : object->in.addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addresses, PyList_GET_SIZE(value));
50918 0 : if (!object->in.addresses) { return -1;; }
50919 0 : talloc_set_name_const(object->in.addresses, "ARRAY: object->in.addresses");
50920 0 : for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(value); addresses_cntr_1++) {
50921 0 : if (PyList_GET_ITEM(value, addresses_cntr_1) == NULL) {
50922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.addresses[addresses_cntr_1]");
50923 0 : return -1;
50924 : }
50925 0 : PY_CHECK_TYPE(&netr_DsRAddress_Type, PyList_GET_ITEM(value, addresses_cntr_1), return -1;);
50926 0 : if (talloc_reference(object->in.addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_1))) == NULL) {
50927 0 : PyErr_NoMemory();
50928 0 : return -1;
50929 : }
50930 0 : object->in.addresses[addresses_cntr_1] = *(struct netr_DsRAddress *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_1));
50931 : }
50932 : }
50933 0 : return 0;
50934 : }
50935 :
50936 0 : static PyObject *py_netr_DsRAddressToSitenamesW_out_get_ctr(PyObject *obj, void *closure)
50937 : {
50938 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj);
50939 : PyObject *py_ctr;
50940 0 : if (object->out.ctr == NULL) {
50941 0 : Py_RETURN_NONE;
50942 : }
50943 0 : if (*object->out.ctr == NULL) {
50944 0 : py_ctr = Py_None;
50945 0 : Py_INCREF(py_ctr);
50946 : } else {
50947 0 : py_ctr = pytalloc_reference_ex(&netr_DsRAddressToSitenamesWCtr_Type, *object->out.ctr, *object->out.ctr);
50948 : }
50949 0 : return py_ctr;
50950 : }
50951 :
50952 0 : static int py_netr_DsRAddressToSitenamesW_out_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
50953 : {
50954 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj);
50955 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ctr));
50956 0 : if (value == NULL) {
50957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ctr");
50958 0 : return -1;
50959 : }
50960 0 : object->out.ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ctr);
50961 0 : if (object->out.ctr == NULL) {
50962 0 : PyErr_NoMemory();
50963 0 : return -1;
50964 : }
50965 0 : if (value == Py_None) {
50966 0 : *object->out.ctr = NULL;
50967 : } else {
50968 0 : *object->out.ctr = NULL;
50969 0 : PY_CHECK_TYPE(&netr_DsRAddressToSitenamesWCtr_Type, value, return -1;);
50970 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50971 0 : PyErr_NoMemory();
50972 0 : return -1;
50973 : }
50974 0 : *object->out.ctr = (struct netr_DsRAddressToSitenamesWCtr *)pytalloc_get_ptr(value);
50975 : }
50976 0 : return 0;
50977 : }
50978 :
50979 0 : static PyObject *py_netr_DsRAddressToSitenamesW_get_result(PyObject *obj, void *closure)
50980 : {
50981 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(obj);
50982 : PyObject *py_result;
50983 0 : py_result = PyErr_FromWERROR(object->out.result);
50984 0 : return py_result;
50985 : }
50986 :
50987 0 : static int py_netr_DsRAddressToSitenamesW_set_result(PyObject *py_obj, PyObject *value, void *closure)
50988 : {
50989 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj);
50990 0 : if (value == NULL) {
50991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
50992 0 : return -1;
50993 : }
50994 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
50995 0 : return 0;
50996 : }
50997 :
50998 : static PyGetSetDef py_netr_DsRAddressToSitenamesW_getsetters[] = {
50999 : {
51000 : .name = discard_const_p(char, "in_server_name"),
51001 : .get = py_netr_DsRAddressToSitenamesW_in_get_server_name,
51002 : .set = py_netr_DsRAddressToSitenamesW_in_set_server_name,
51003 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
51004 : },
51005 : {
51006 : .name = discard_const_p(char, "in_count"),
51007 : .get = py_netr_DsRAddressToSitenamesW_in_get_count,
51008 : .set = py_netr_DsRAddressToSitenamesW_in_set_count,
51009 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
51010 : },
51011 : {
51012 : .name = discard_const_p(char, "in_addresses"),
51013 : .get = py_netr_DsRAddressToSitenamesW_in_get_addresses,
51014 : .set = py_netr_DsRAddressToSitenamesW_in_set_addresses,
51015 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRAddress")
51016 : },
51017 : {
51018 : .name = discard_const_p(char, "out_ctr"),
51019 : .get = py_netr_DsRAddressToSitenamesW_out_get_ctr,
51020 : .set = py_netr_DsRAddressToSitenamesW_out_set_ctr,
51021 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRAddressToSitenamesWCtr")
51022 : },
51023 : {
51024 : .name = discard_const_p(char, "result"),
51025 : .get = py_netr_DsRAddressToSitenamesW_get_result,
51026 : .set = py_netr_DsRAddressToSitenamesW_set_result,
51027 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
51028 : },
51029 : { .name = NULL }
51030 : };
51031 :
51032 0 : static PyObject *py_netr_DsRAddressToSitenamesW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
51033 : {
51034 0 : PyObject *self = pytalloc_new(struct netr_DsRAddressToSitenamesW, type);
51035 0 : struct netr_DsRAddressToSitenamesW *_self = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(self);
51036 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
51037 0 : _self->in.addresses = talloc_zero(mem_ctx, struct netr_DsRAddress);
51038 : /* a pointer to a NULL pointer */
51039 0 : _self->out.ctr = talloc_zero(mem_ctx, struct netr_DsRAddressToSitenamesWCtr *);
51040 0 : return self;
51041 : }
51042 :
51043 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
51044 : {
51045 :
51046 :
51047 0 : return PyLong_FromLong(33);
51048 : }
51049 :
51050 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
51051 : {
51052 0 : const struct ndr_interface_call *call = NULL;
51053 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj);
51054 0 : PyObject *ret = NULL;
51055 0 : struct ndr_push *push = NULL;
51056 : DATA_BLOB blob;
51057 : enum ndr_err_code err;
51058 :
51059 0 : if (ndr_table_netlogon.num_calls < 34) {
51060 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesW_ndr_pack");
51061 0 : return NULL;
51062 : }
51063 0 : call = &ndr_table_netlogon.calls[33];
51064 :
51065 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
51066 0 : if (push == NULL) {
51067 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
51068 0 : return NULL;
51069 : }
51070 :
51071 0 : push->flags |= ndr_push_flags;
51072 :
51073 0 : err = call->ndr_push(push, ndr_inout_flags, object);
51074 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
51075 0 : TALLOC_FREE(push);
51076 0 : PyErr_SetNdrError(err);
51077 0 : return NULL;
51078 : }
51079 0 : blob = ndr_push_blob(push);
51080 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
51081 0 : TALLOC_FREE(push);
51082 0 : return ret;
51083 : }
51084 :
51085 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51086 : {
51087 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
51088 0 : PyObject *bigendian_obj = NULL;
51089 0 : PyObject *ndr64_obj = NULL;
51090 0 : uint32_t ndr_push_flags = 0;
51091 :
51092 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
51093 : discard_const_p(char *, kwnames),
51094 : &bigendian_obj,
51095 : &ndr64_obj)) {
51096 0 : return NULL;
51097 : }
51098 :
51099 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51100 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
51101 : }
51102 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51103 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
51104 : }
51105 :
51106 0 : return py_netr_DsRAddressToSitenamesW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
51107 : }
51108 :
51109 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51110 : {
51111 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
51112 0 : PyObject *bigendian_obj = NULL;
51113 0 : PyObject *ndr64_obj = NULL;
51114 0 : uint32_t ndr_push_flags = 0;
51115 :
51116 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
51117 : discard_const_p(char *, kwnames),
51118 : &bigendian_obj,
51119 : &ndr64_obj)) {
51120 0 : return NULL;
51121 : }
51122 :
51123 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51124 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
51125 : }
51126 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51127 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
51128 : }
51129 :
51130 0 : return py_netr_DsRAddressToSitenamesW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
51131 : }
51132 :
51133 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
51134 : {
51135 0 : const struct ndr_interface_call *call = NULL;
51136 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj);
51137 0 : struct ndr_pull *pull = NULL;
51138 : enum ndr_err_code err;
51139 :
51140 0 : if (ndr_table_netlogon.num_calls < 34) {
51141 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesW_ndr_unpack");
51142 0 : return NULL;
51143 : }
51144 0 : call = &ndr_table_netlogon.calls[33];
51145 :
51146 0 : pull = ndr_pull_init_blob(blob, object);
51147 0 : if (pull == NULL) {
51148 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
51149 0 : return NULL;
51150 : }
51151 :
51152 0 : pull->flags |= ndr_pull_flags;
51153 :
51154 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
51155 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
51156 0 : TALLOC_FREE(pull);
51157 0 : PyErr_SetNdrError(err);
51158 0 : return NULL;
51159 : }
51160 0 : if (!allow_remaining) {
51161 : uint32_t highest_ofs;
51162 :
51163 0 : if (pull->offset > pull->relative_highest_offset) {
51164 0 : highest_ofs = pull->offset;
51165 : } else {
51166 0 : highest_ofs = pull->relative_highest_offset;
51167 : }
51168 0 : if (highest_ofs < pull->data_size) {
51169 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
51170 : "not all bytes consumed ofs[%u] size[%u]",
51171 : highest_ofs, pull->data_size);
51172 0 : TALLOC_FREE(pull);
51173 0 : PyErr_SetNdrError(err);
51174 0 : return NULL;
51175 : }
51176 : }
51177 :
51178 0 : TALLOC_FREE(pull);
51179 0 : Py_RETURN_NONE;
51180 : }
51181 :
51182 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51183 : {
51184 : DATA_BLOB blob;
51185 0 : Py_ssize_t blob_length = 0;
51186 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
51187 0 : PyObject *bigendian_obj = NULL;
51188 0 : PyObject *ndr64_obj = NULL;
51189 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
51190 0 : PyObject *allow_remaining_obj = NULL;
51191 0 : bool allow_remaining = false;
51192 :
51193 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
51194 : discard_const_p(char *, kwnames),
51195 : &blob.data, &blob_length,
51196 : &bigendian_obj,
51197 : &ndr64_obj,
51198 : &allow_remaining_obj)) {
51199 0 : return NULL;
51200 : }
51201 0 : blob.length = blob_length;
51202 :
51203 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51204 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
51205 : }
51206 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51207 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
51208 : }
51209 :
51210 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
51211 0 : allow_remaining = true;
51212 : }
51213 :
51214 0 : return py_netr_DsRAddressToSitenamesW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
51215 : }
51216 :
51217 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51218 : {
51219 : DATA_BLOB blob;
51220 0 : Py_ssize_t blob_length = 0;
51221 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
51222 0 : PyObject *bigendian_obj = NULL;
51223 0 : PyObject *ndr64_obj = NULL;
51224 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
51225 0 : PyObject *allow_remaining_obj = NULL;
51226 0 : bool allow_remaining = false;
51227 :
51228 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
51229 : discard_const_p(char *, kwnames),
51230 : &blob.data, &blob_length,
51231 : &bigendian_obj,
51232 : &ndr64_obj,
51233 : &allow_remaining_obj)) {
51234 0 : return NULL;
51235 : }
51236 0 : blob.length = blob_length;
51237 :
51238 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51239 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
51240 : }
51241 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51242 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
51243 : }
51244 :
51245 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
51246 0 : allow_remaining = true;
51247 : }
51248 :
51249 0 : return py_netr_DsRAddressToSitenamesW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
51250 : }
51251 :
51252 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
51253 : {
51254 0 : const struct ndr_interface_call *call = NULL;
51255 0 : struct netr_DsRAddressToSitenamesW *object = (struct netr_DsRAddressToSitenamesW *)pytalloc_get_ptr(py_obj);
51256 : PyObject *ret;
51257 : char *retstr;
51258 :
51259 0 : if (ndr_table_netlogon.num_calls < 34) {
51260 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesW_ndr_print");
51261 0 : return NULL;
51262 : }
51263 0 : call = &ndr_table_netlogon.calls[33];
51264 :
51265 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
51266 0 : ret = PyUnicode_FromString(retstr);
51267 0 : TALLOC_FREE(retstr);
51268 :
51269 0 : return ret;
51270 : }
51271 :
51272 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
51273 : {
51274 0 : return py_netr_DsRAddressToSitenamesW_ndr_print(py_obj, "netr_DsRAddressToSitenamesW_in", NDR_IN);
51275 : }
51276 :
51277 0 : static PyObject *py_netr_DsRAddressToSitenamesW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
51278 : {
51279 0 : return py_netr_DsRAddressToSitenamesW_ndr_print(py_obj, "netr_DsRAddressToSitenamesW_out", NDR_OUT);
51280 : }
51281 :
51282 : static PyMethodDef py_netr_DsRAddressToSitenamesW_methods[] = {
51283 : { "opnum", (PyCFunction)py_netr_DsRAddressToSitenamesW_ndr_opnum, METH_NOARGS|METH_CLASS,
51284 : "netlogon.netr_DsRAddressToSitenamesW.opnum() -> 33 (0x21) " },
51285 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
51286 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
51287 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
51288 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
51289 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
51290 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
51291 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
51292 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
51293 : { "__ndr_print_in__", (PyCFunction)py_netr_DsRAddressToSitenamesW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
51294 : { "__ndr_print_out__", (PyCFunction)py_netr_DsRAddressToSitenamesW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
51295 : { NULL, NULL, 0, NULL }
51296 : };
51297 :
51298 :
51299 : static PyTypeObject netr_DsRAddressToSitenamesW_Type = {
51300 : PyVarObject_HEAD_INIT(NULL, 0)
51301 : .tp_name = "netlogon.netr_DsRAddressToSitenamesW",
51302 : .tp_getset = py_netr_DsRAddressToSitenamesW_getsetters,
51303 : .tp_methods = py_netr_DsRAddressToSitenamesW_methods,
51304 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
51305 : .tp_new = py_netr_DsRAddressToSitenamesW_new,
51306 : };
51307 :
51308 0 : static bool pack_py_netr_DsRAddressToSitenamesW_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRAddressToSitenamesW *r)
51309 : {
51310 : PyObject *py_server_name;
51311 : PyObject *py_addresses;
51312 0 : const char *kwnames[] = {
51313 : "server_name", "addresses", NULL
51314 : };
51315 :
51316 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_DsRAddressToSitenamesW", discard_const_p(char *, kwnames), &py_server_name, &py_addresses)) {
51317 0 : return false;
51318 : }
51319 :
51320 0 : if (py_server_name == NULL) {
51321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
51322 0 : return false;
51323 : }
51324 0 : if (py_server_name == Py_None) {
51325 0 : r->in.server_name = NULL;
51326 : } else {
51327 0 : r->in.server_name = NULL;
51328 : {
51329 : const char *test_str;
51330 : const char *talloc_str;
51331 0 : PyObject *unicode = NULL;
51332 0 : if (PyUnicode_Check(py_server_name)) {
51333 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
51334 0 : if (unicode == NULL) {
51335 0 : PyErr_NoMemory();
51336 0 : return false;
51337 : }
51338 0 : test_str = PyBytes_AS_STRING(unicode);
51339 0 : } else if (PyBytes_Check(py_server_name)) {
51340 0 : test_str = PyBytes_AS_STRING(py_server_name);
51341 : } else {
51342 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
51343 0 : return false;
51344 : }
51345 0 : talloc_str = talloc_strdup(r, test_str);
51346 0 : if (unicode != NULL) {
51347 0 : Py_DECREF(unicode);
51348 : }
51349 0 : if (talloc_str == NULL) {
51350 0 : PyErr_NoMemory();
51351 0 : return false;
51352 : }
51353 0 : r->in.server_name = talloc_str;
51354 : }
51355 : }
51356 0 : PY_CHECK_TYPE(&PyList_Type, py_addresses, return false;);
51357 0 : r->in.count = PyList_GET_SIZE(py_addresses);
51358 0 : if (py_addresses == NULL) {
51359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.addresses");
51360 0 : return false;
51361 : }
51362 0 : r->in.addresses = talloc_ptrtype(r, r->in.addresses);
51363 0 : if (r->in.addresses == NULL) {
51364 0 : PyErr_NoMemory();
51365 0 : return false;
51366 : }
51367 0 : PY_CHECK_TYPE(&PyList_Type, py_addresses, return false;);
51368 : {
51369 : int addresses_cntr_1;
51370 0 : r->in.addresses = talloc_array_ptrtype(r, r->in.addresses, PyList_GET_SIZE(py_addresses));
51371 0 : if (!r->in.addresses) { return false;; }
51372 0 : talloc_set_name_const(r->in.addresses, "ARRAY: r->in.addresses");
51373 0 : for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(py_addresses); addresses_cntr_1++) {
51374 0 : if (PyList_GET_ITEM(py_addresses, addresses_cntr_1) == NULL) {
51375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.addresses[addresses_cntr_1]");
51376 0 : return false;
51377 : }
51378 0 : PY_CHECK_TYPE(&netr_DsRAddress_Type, PyList_GET_ITEM(py_addresses, addresses_cntr_1), return false;);
51379 0 : if (talloc_reference(r->in.addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_addresses, addresses_cntr_1))) == NULL) {
51380 0 : PyErr_NoMemory();
51381 0 : return false;
51382 : }
51383 0 : r->in.addresses[addresses_cntr_1] = *(struct netr_DsRAddress *)pytalloc_get_ptr(PyList_GET_ITEM(py_addresses, addresses_cntr_1));
51384 : }
51385 : }
51386 0 : return true;
51387 : }
51388 :
51389 0 : static PyObject *unpack_py_netr_DsRAddressToSitenamesW_args_out(struct netr_DsRAddressToSitenamesW *r)
51390 : {
51391 : PyObject *result;
51392 : PyObject *py_ctr;
51393 0 : if (*r->out.ctr == NULL) {
51394 0 : py_ctr = Py_None;
51395 0 : Py_INCREF(py_ctr);
51396 : } else {
51397 0 : py_ctr = pytalloc_reference_ex(&netr_DsRAddressToSitenamesWCtr_Type, *r->out.ctr, *r->out.ctr);
51398 : }
51399 0 : result = py_ctr;
51400 0 : if (!W_ERROR_IS_OK(r->out.result)) {
51401 0 : PyErr_SetWERROR(r->out.result);
51402 0 : return NULL;
51403 : }
51404 :
51405 0 : return result;
51406 : }
51407 :
51408 :
51409 0 : static PyObject *py_netr_DsRGetDCNameEx2_in_get_server_unc(PyObject *obj, void *closure)
51410 : {
51411 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51412 : PyObject *py_server_unc;
51413 0 : if (object->in.server_unc == NULL) {
51414 0 : Py_RETURN_NONE;
51415 : }
51416 0 : if (object->in.server_unc == NULL) {
51417 0 : py_server_unc = Py_None;
51418 0 : Py_INCREF(py_server_unc);
51419 : } else {
51420 0 : if (object->in.server_unc == NULL) {
51421 0 : py_server_unc = Py_None;
51422 0 : Py_INCREF(py_server_unc);
51423 : } else {
51424 0 : py_server_unc = PyUnicode_Decode(object->in.server_unc, strlen(object->in.server_unc), "utf-8", "ignore");
51425 : }
51426 : }
51427 0 : return py_server_unc;
51428 : }
51429 :
51430 0 : static int py_netr_DsRGetDCNameEx2_in_set_server_unc(PyObject *py_obj, PyObject *value, void *closure)
51431 : {
51432 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51433 0 : if (value == NULL) {
51434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_unc");
51435 0 : return -1;
51436 : }
51437 0 : if (value == Py_None) {
51438 0 : object->in.server_unc = NULL;
51439 : } else {
51440 0 : object->in.server_unc = NULL;
51441 : {
51442 : const char *test_str;
51443 : const char *talloc_str;
51444 0 : PyObject *unicode = NULL;
51445 0 : if (PyUnicode_Check(value)) {
51446 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
51447 0 : if (unicode == NULL) {
51448 0 : PyErr_NoMemory();
51449 0 : return -1;
51450 : }
51451 0 : test_str = PyBytes_AS_STRING(unicode);
51452 0 : } else if (PyBytes_Check(value)) {
51453 0 : test_str = PyBytes_AS_STRING(value);
51454 : } else {
51455 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
51456 0 : return -1;
51457 : }
51458 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
51459 0 : if (unicode != NULL) {
51460 0 : Py_DECREF(unicode);
51461 : }
51462 0 : if (talloc_str == NULL) {
51463 0 : PyErr_NoMemory();
51464 0 : return -1;
51465 : }
51466 0 : object->in.server_unc = talloc_str;
51467 : }
51468 : }
51469 0 : return 0;
51470 : }
51471 :
51472 0 : static PyObject *py_netr_DsRGetDCNameEx2_in_get_client_account(PyObject *obj, void *closure)
51473 : {
51474 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51475 : PyObject *py_client_account;
51476 0 : if (object->in.client_account == NULL) {
51477 0 : Py_RETURN_NONE;
51478 : }
51479 0 : if (object->in.client_account == NULL) {
51480 0 : py_client_account = Py_None;
51481 0 : Py_INCREF(py_client_account);
51482 : } else {
51483 0 : if (object->in.client_account == NULL) {
51484 0 : py_client_account = Py_None;
51485 0 : Py_INCREF(py_client_account);
51486 : } else {
51487 0 : py_client_account = PyUnicode_Decode(object->in.client_account, strlen(object->in.client_account), "utf-8", "ignore");
51488 : }
51489 : }
51490 0 : return py_client_account;
51491 : }
51492 :
51493 0 : static int py_netr_DsRGetDCNameEx2_in_set_client_account(PyObject *py_obj, PyObject *value, void *closure)
51494 : {
51495 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51496 0 : if (value == NULL) {
51497 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_account");
51498 0 : return -1;
51499 : }
51500 0 : if (value == Py_None) {
51501 0 : object->in.client_account = NULL;
51502 : } else {
51503 0 : object->in.client_account = NULL;
51504 : {
51505 : const char *test_str;
51506 : const char *talloc_str;
51507 0 : PyObject *unicode = NULL;
51508 0 : if (PyUnicode_Check(value)) {
51509 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
51510 0 : if (unicode == NULL) {
51511 0 : PyErr_NoMemory();
51512 0 : return -1;
51513 : }
51514 0 : test_str = PyBytes_AS_STRING(unicode);
51515 0 : } else if (PyBytes_Check(value)) {
51516 0 : test_str = PyBytes_AS_STRING(value);
51517 : } else {
51518 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
51519 0 : return -1;
51520 : }
51521 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
51522 0 : if (unicode != NULL) {
51523 0 : Py_DECREF(unicode);
51524 : }
51525 0 : if (talloc_str == NULL) {
51526 0 : PyErr_NoMemory();
51527 0 : return -1;
51528 : }
51529 0 : object->in.client_account = talloc_str;
51530 : }
51531 : }
51532 0 : return 0;
51533 : }
51534 :
51535 0 : static PyObject *py_netr_DsRGetDCNameEx2_in_get_mask(PyObject *obj, void *closure)
51536 : {
51537 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51538 : PyObject *py_mask;
51539 0 : py_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.mask);
51540 0 : return py_mask;
51541 : }
51542 :
51543 0 : static int py_netr_DsRGetDCNameEx2_in_set_mask(PyObject *py_obj, PyObject *value, void *closure)
51544 : {
51545 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51546 0 : if (value == NULL) {
51547 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.mask");
51548 0 : return -1;
51549 : }
51550 : {
51551 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.mask));
51552 0 : if (PyLong_Check(value)) {
51553 : unsigned long long test_var;
51554 0 : test_var = PyLong_AsUnsignedLongLong(value);
51555 0 : if (PyErr_Occurred() != NULL) {
51556 0 : return -1;
51557 : }
51558 0 : if (test_var > uint_max) {
51559 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
51560 : PyLong_Type.tp_name, uint_max, test_var);
51561 0 : return -1;
51562 : }
51563 0 : object->in.mask = test_var;
51564 : } else {
51565 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
51566 : PyLong_Type.tp_name);
51567 0 : return -1;
51568 : }
51569 : }
51570 0 : return 0;
51571 : }
51572 :
51573 0 : static PyObject *py_netr_DsRGetDCNameEx2_in_get_domain_name(PyObject *obj, void *closure)
51574 : {
51575 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51576 : PyObject *py_domain_name;
51577 0 : if (object->in.domain_name == NULL) {
51578 0 : Py_RETURN_NONE;
51579 : }
51580 0 : if (object->in.domain_name == NULL) {
51581 0 : py_domain_name = Py_None;
51582 0 : Py_INCREF(py_domain_name);
51583 : } else {
51584 0 : if (object->in.domain_name == NULL) {
51585 0 : py_domain_name = Py_None;
51586 0 : Py_INCREF(py_domain_name);
51587 : } else {
51588 0 : py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
51589 : }
51590 : }
51591 0 : return py_domain_name;
51592 : }
51593 :
51594 0 : static int py_netr_DsRGetDCNameEx2_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
51595 : {
51596 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51597 0 : if (value == NULL) {
51598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
51599 0 : return -1;
51600 : }
51601 0 : if (value == Py_None) {
51602 0 : object->in.domain_name = NULL;
51603 : } else {
51604 0 : object->in.domain_name = NULL;
51605 : {
51606 : const char *test_str;
51607 : const char *talloc_str;
51608 0 : PyObject *unicode = NULL;
51609 0 : if (PyUnicode_Check(value)) {
51610 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
51611 0 : if (unicode == NULL) {
51612 0 : PyErr_NoMemory();
51613 0 : return -1;
51614 : }
51615 0 : test_str = PyBytes_AS_STRING(unicode);
51616 0 : } else if (PyBytes_Check(value)) {
51617 0 : test_str = PyBytes_AS_STRING(value);
51618 : } else {
51619 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
51620 0 : return -1;
51621 : }
51622 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
51623 0 : if (unicode != NULL) {
51624 0 : Py_DECREF(unicode);
51625 : }
51626 0 : if (talloc_str == NULL) {
51627 0 : PyErr_NoMemory();
51628 0 : return -1;
51629 : }
51630 0 : object->in.domain_name = talloc_str;
51631 : }
51632 : }
51633 0 : return 0;
51634 : }
51635 :
51636 0 : static PyObject *py_netr_DsRGetDCNameEx2_in_get_domain_guid(PyObject *obj, void *closure)
51637 : {
51638 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51639 : PyObject *py_domain_guid;
51640 0 : if (object->in.domain_guid == NULL) {
51641 0 : Py_RETURN_NONE;
51642 : }
51643 0 : if (object->in.domain_guid == NULL) {
51644 0 : py_domain_guid = Py_None;
51645 0 : Py_INCREF(py_domain_guid);
51646 : } else {
51647 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, object->in.domain_guid, object->in.domain_guid);
51648 : }
51649 0 : return py_domain_guid;
51650 : }
51651 :
51652 0 : static int py_netr_DsRGetDCNameEx2_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
51653 : {
51654 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51655 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_guid));
51656 0 : if (value == NULL) {
51657 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_guid");
51658 0 : return -1;
51659 : }
51660 0 : if (value == Py_None) {
51661 0 : object->in.domain_guid = NULL;
51662 : } else {
51663 0 : object->in.domain_guid = NULL;
51664 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
51665 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
51666 0 : PyErr_NoMemory();
51667 0 : return -1;
51668 : }
51669 0 : object->in.domain_guid = (struct GUID *)pytalloc_get_ptr(value);
51670 : }
51671 0 : return 0;
51672 : }
51673 :
51674 0 : static PyObject *py_netr_DsRGetDCNameEx2_in_get_site_name(PyObject *obj, void *closure)
51675 : {
51676 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51677 : PyObject *py_site_name;
51678 0 : if (object->in.site_name == NULL) {
51679 0 : Py_RETURN_NONE;
51680 : }
51681 0 : if (object->in.site_name == NULL) {
51682 0 : py_site_name = Py_None;
51683 0 : Py_INCREF(py_site_name);
51684 : } else {
51685 0 : if (object->in.site_name == NULL) {
51686 0 : py_site_name = Py_None;
51687 0 : Py_INCREF(py_site_name);
51688 : } else {
51689 0 : py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
51690 : }
51691 : }
51692 0 : return py_site_name;
51693 : }
51694 :
51695 0 : static int py_netr_DsRGetDCNameEx2_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
51696 : {
51697 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51698 0 : if (value == NULL) {
51699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_name");
51700 0 : return -1;
51701 : }
51702 0 : if (value == Py_None) {
51703 0 : object->in.site_name = NULL;
51704 : } else {
51705 0 : object->in.site_name = NULL;
51706 : {
51707 : const char *test_str;
51708 : const char *talloc_str;
51709 0 : PyObject *unicode = NULL;
51710 0 : if (PyUnicode_Check(value)) {
51711 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
51712 0 : if (unicode == NULL) {
51713 0 : PyErr_NoMemory();
51714 0 : return -1;
51715 : }
51716 0 : test_str = PyBytes_AS_STRING(unicode);
51717 0 : } else if (PyBytes_Check(value)) {
51718 0 : test_str = PyBytes_AS_STRING(value);
51719 : } else {
51720 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
51721 0 : return -1;
51722 : }
51723 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
51724 0 : if (unicode != NULL) {
51725 0 : Py_DECREF(unicode);
51726 : }
51727 0 : if (talloc_str == NULL) {
51728 0 : PyErr_NoMemory();
51729 0 : return -1;
51730 : }
51731 0 : object->in.site_name = talloc_str;
51732 : }
51733 : }
51734 0 : return 0;
51735 : }
51736 :
51737 0 : static PyObject *py_netr_DsRGetDCNameEx2_in_get_flags(PyObject *obj, void *closure)
51738 : {
51739 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51740 : PyObject *py_flags;
51741 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
51742 0 : return py_flags;
51743 : }
51744 :
51745 0 : static int py_netr_DsRGetDCNameEx2_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
51746 : {
51747 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51748 0 : if (value == NULL) {
51749 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
51750 0 : return -1;
51751 : }
51752 : {
51753 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
51754 0 : if (PyLong_Check(value)) {
51755 : unsigned long long test_var;
51756 0 : test_var = PyLong_AsUnsignedLongLong(value);
51757 0 : if (PyErr_Occurred() != NULL) {
51758 0 : return -1;
51759 : }
51760 0 : if (test_var > uint_max) {
51761 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
51762 : PyLong_Type.tp_name, uint_max, test_var);
51763 0 : return -1;
51764 : }
51765 0 : object->in.flags = test_var;
51766 : } else {
51767 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
51768 : PyLong_Type.tp_name);
51769 0 : return -1;
51770 : }
51771 : }
51772 0 : return 0;
51773 : }
51774 :
51775 0 : static PyObject *py_netr_DsRGetDCNameEx2_out_get_info(PyObject *obj, void *closure)
51776 : {
51777 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51778 : PyObject *py_info;
51779 0 : if (object->out.info == NULL) {
51780 0 : Py_RETURN_NONE;
51781 : }
51782 0 : if (*object->out.info == NULL) {
51783 0 : py_info = Py_None;
51784 0 : Py_INCREF(py_info);
51785 : } else {
51786 0 : py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *object->out.info, *object->out.info);
51787 : }
51788 0 : return py_info;
51789 : }
51790 :
51791 0 : static int py_netr_DsRGetDCNameEx2_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
51792 : {
51793 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51794 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
51795 0 : if (value == NULL) {
51796 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
51797 0 : return -1;
51798 : }
51799 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
51800 0 : if (object->out.info == NULL) {
51801 0 : PyErr_NoMemory();
51802 0 : return -1;
51803 : }
51804 0 : if (value == Py_None) {
51805 0 : *object->out.info = NULL;
51806 : } else {
51807 0 : *object->out.info = NULL;
51808 0 : PY_CHECK_TYPE(&netr_DsRGetDCNameInfo_Type, value, return -1;);
51809 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
51810 0 : PyErr_NoMemory();
51811 0 : return -1;
51812 : }
51813 0 : *object->out.info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value);
51814 : }
51815 0 : return 0;
51816 : }
51817 :
51818 0 : static PyObject *py_netr_DsRGetDCNameEx2_get_result(PyObject *obj, void *closure)
51819 : {
51820 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(obj);
51821 : PyObject *py_result;
51822 0 : py_result = PyErr_FromWERROR(object->out.result);
51823 0 : return py_result;
51824 : }
51825 :
51826 0 : static int py_netr_DsRGetDCNameEx2_set_result(PyObject *py_obj, PyObject *value, void *closure)
51827 : {
51828 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51829 0 : if (value == NULL) {
51830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
51831 0 : return -1;
51832 : }
51833 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
51834 0 : return 0;
51835 : }
51836 :
51837 : static PyGetSetDef py_netr_DsRGetDCNameEx2_getsetters[] = {
51838 : {
51839 : .name = discard_const_p(char, "in_server_unc"),
51840 : .get = py_netr_DsRGetDCNameEx2_in_get_server_unc,
51841 : .set = py_netr_DsRGetDCNameEx2_in_set_server_unc,
51842 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
51843 : },
51844 : {
51845 : .name = discard_const_p(char, "in_client_account"),
51846 : .get = py_netr_DsRGetDCNameEx2_in_get_client_account,
51847 : .set = py_netr_DsRGetDCNameEx2_in_set_client_account,
51848 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
51849 : },
51850 : {
51851 : .name = discard_const_p(char, "in_mask"),
51852 : .get = py_netr_DsRGetDCNameEx2_in_get_mask,
51853 : .set = py_netr_DsRGetDCNameEx2_in_set_mask,
51854 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
51855 : },
51856 : {
51857 : .name = discard_const_p(char, "in_domain_name"),
51858 : .get = py_netr_DsRGetDCNameEx2_in_get_domain_name,
51859 : .set = py_netr_DsRGetDCNameEx2_in_set_domain_name,
51860 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
51861 : },
51862 : {
51863 : .name = discard_const_p(char, "in_domain_guid"),
51864 : .get = py_netr_DsRGetDCNameEx2_in_get_domain_guid,
51865 : .set = py_netr_DsRGetDCNameEx2_in_set_domain_guid,
51866 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
51867 : },
51868 : {
51869 : .name = discard_const_p(char, "in_site_name"),
51870 : .get = py_netr_DsRGetDCNameEx2_in_get_site_name,
51871 : .set = py_netr_DsRGetDCNameEx2_in_set_site_name,
51872 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
51873 : },
51874 : {
51875 : .name = discard_const_p(char, "in_flags"),
51876 : .get = py_netr_DsRGetDCNameEx2_in_get_flags,
51877 : .set = py_netr_DsRGetDCNameEx2_in_set_flags,
51878 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCName_flags")
51879 : },
51880 : {
51881 : .name = discard_const_p(char, "out_info"),
51882 : .get = py_netr_DsRGetDCNameEx2_out_get_info,
51883 : .set = py_netr_DsRGetDCNameEx2_out_set_info,
51884 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo")
51885 : },
51886 : {
51887 : .name = discard_const_p(char, "result"),
51888 : .get = py_netr_DsRGetDCNameEx2_get_result,
51889 : .set = py_netr_DsRGetDCNameEx2_set_result,
51890 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
51891 : },
51892 : { .name = NULL }
51893 : };
51894 :
51895 0 : static PyObject *py_netr_DsRGetDCNameEx2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
51896 : {
51897 0 : PyObject *self = pytalloc_new(struct netr_DsRGetDCNameEx2, type);
51898 0 : struct netr_DsRGetDCNameEx2 *_self = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(self);
51899 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
51900 : /* a pointer to a NULL pointer */
51901 0 : _self->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
51902 0 : return self;
51903 : }
51904 :
51905 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
51906 : {
51907 :
51908 :
51909 0 : return PyLong_FromLong(34);
51910 : }
51911 :
51912 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
51913 : {
51914 0 : const struct ndr_interface_call *call = NULL;
51915 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51916 0 : PyObject *ret = NULL;
51917 0 : struct ndr_push *push = NULL;
51918 : DATA_BLOB blob;
51919 : enum ndr_err_code err;
51920 :
51921 0 : if (ndr_table_netlogon.num_calls < 35) {
51922 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx2_ndr_pack");
51923 0 : return NULL;
51924 : }
51925 0 : call = &ndr_table_netlogon.calls[34];
51926 :
51927 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
51928 0 : if (push == NULL) {
51929 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
51930 0 : return NULL;
51931 : }
51932 :
51933 0 : push->flags |= ndr_push_flags;
51934 :
51935 0 : err = call->ndr_push(push, ndr_inout_flags, object);
51936 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
51937 0 : TALLOC_FREE(push);
51938 0 : PyErr_SetNdrError(err);
51939 0 : return NULL;
51940 : }
51941 0 : blob = ndr_push_blob(push);
51942 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
51943 0 : TALLOC_FREE(push);
51944 0 : return ret;
51945 : }
51946 :
51947 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51948 : {
51949 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
51950 0 : PyObject *bigendian_obj = NULL;
51951 0 : PyObject *ndr64_obj = NULL;
51952 0 : uint32_t ndr_push_flags = 0;
51953 :
51954 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
51955 : discard_const_p(char *, kwnames),
51956 : &bigendian_obj,
51957 : &ndr64_obj)) {
51958 0 : return NULL;
51959 : }
51960 :
51961 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51962 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
51963 : }
51964 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51965 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
51966 : }
51967 :
51968 0 : return py_netr_DsRGetDCNameEx2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
51969 : }
51970 :
51971 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51972 : {
51973 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
51974 0 : PyObject *bigendian_obj = NULL;
51975 0 : PyObject *ndr64_obj = NULL;
51976 0 : uint32_t ndr_push_flags = 0;
51977 :
51978 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
51979 : discard_const_p(char *, kwnames),
51980 : &bigendian_obj,
51981 : &ndr64_obj)) {
51982 0 : return NULL;
51983 : }
51984 :
51985 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51986 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
51987 : }
51988 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51989 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
51990 : }
51991 :
51992 0 : return py_netr_DsRGetDCNameEx2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
51993 : }
51994 :
51995 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
51996 : {
51997 0 : const struct ndr_interface_call *call = NULL;
51998 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
51999 0 : struct ndr_pull *pull = NULL;
52000 : enum ndr_err_code err;
52001 :
52002 0 : if (ndr_table_netlogon.num_calls < 35) {
52003 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx2_ndr_unpack");
52004 0 : return NULL;
52005 : }
52006 0 : call = &ndr_table_netlogon.calls[34];
52007 :
52008 0 : pull = ndr_pull_init_blob(blob, object);
52009 0 : if (pull == NULL) {
52010 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
52011 0 : return NULL;
52012 : }
52013 :
52014 0 : pull->flags |= ndr_pull_flags;
52015 :
52016 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
52017 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
52018 0 : TALLOC_FREE(pull);
52019 0 : PyErr_SetNdrError(err);
52020 0 : return NULL;
52021 : }
52022 0 : if (!allow_remaining) {
52023 : uint32_t highest_ofs;
52024 :
52025 0 : if (pull->offset > pull->relative_highest_offset) {
52026 0 : highest_ofs = pull->offset;
52027 : } else {
52028 0 : highest_ofs = pull->relative_highest_offset;
52029 : }
52030 0 : if (highest_ofs < pull->data_size) {
52031 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
52032 : "not all bytes consumed ofs[%u] size[%u]",
52033 : highest_ofs, pull->data_size);
52034 0 : TALLOC_FREE(pull);
52035 0 : PyErr_SetNdrError(err);
52036 0 : return NULL;
52037 : }
52038 : }
52039 :
52040 0 : TALLOC_FREE(pull);
52041 0 : Py_RETURN_NONE;
52042 : }
52043 :
52044 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
52045 : {
52046 : DATA_BLOB blob;
52047 0 : Py_ssize_t blob_length = 0;
52048 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
52049 0 : PyObject *bigendian_obj = NULL;
52050 0 : PyObject *ndr64_obj = NULL;
52051 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
52052 0 : PyObject *allow_remaining_obj = NULL;
52053 0 : bool allow_remaining = false;
52054 :
52055 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
52056 : discard_const_p(char *, kwnames),
52057 : &blob.data, &blob_length,
52058 : &bigendian_obj,
52059 : &ndr64_obj,
52060 : &allow_remaining_obj)) {
52061 0 : return NULL;
52062 : }
52063 0 : blob.length = blob_length;
52064 :
52065 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
52066 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
52067 : }
52068 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
52069 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
52070 : }
52071 :
52072 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
52073 0 : allow_remaining = true;
52074 : }
52075 :
52076 0 : return py_netr_DsRGetDCNameEx2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
52077 : }
52078 :
52079 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
52080 : {
52081 : DATA_BLOB blob;
52082 0 : Py_ssize_t blob_length = 0;
52083 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
52084 0 : PyObject *bigendian_obj = NULL;
52085 0 : PyObject *ndr64_obj = NULL;
52086 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
52087 0 : PyObject *allow_remaining_obj = NULL;
52088 0 : bool allow_remaining = false;
52089 :
52090 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
52091 : discard_const_p(char *, kwnames),
52092 : &blob.data, &blob_length,
52093 : &bigendian_obj,
52094 : &ndr64_obj,
52095 : &allow_remaining_obj)) {
52096 0 : return NULL;
52097 : }
52098 0 : blob.length = blob_length;
52099 :
52100 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
52101 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
52102 : }
52103 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
52104 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
52105 : }
52106 :
52107 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
52108 0 : allow_remaining = true;
52109 : }
52110 :
52111 0 : return py_netr_DsRGetDCNameEx2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
52112 : }
52113 :
52114 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
52115 : {
52116 0 : const struct ndr_interface_call *call = NULL;
52117 0 : struct netr_DsRGetDCNameEx2 *object = (struct netr_DsRGetDCNameEx2 *)pytalloc_get_ptr(py_obj);
52118 : PyObject *ret;
52119 : char *retstr;
52120 :
52121 0 : if (ndr_table_netlogon.num_calls < 35) {
52122 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetDCNameEx2_ndr_print");
52123 0 : return NULL;
52124 : }
52125 0 : call = &ndr_table_netlogon.calls[34];
52126 :
52127 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
52128 0 : ret = PyUnicode_FromString(retstr);
52129 0 : TALLOC_FREE(retstr);
52130 :
52131 0 : return ret;
52132 : }
52133 :
52134 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
52135 : {
52136 0 : return py_netr_DsRGetDCNameEx2_ndr_print(py_obj, "netr_DsRGetDCNameEx2_in", NDR_IN);
52137 : }
52138 :
52139 0 : static PyObject *py_netr_DsRGetDCNameEx2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
52140 : {
52141 0 : return py_netr_DsRGetDCNameEx2_ndr_print(py_obj, "netr_DsRGetDCNameEx2_out", NDR_OUT);
52142 : }
52143 :
52144 : static PyMethodDef py_netr_DsRGetDCNameEx2_methods[] = {
52145 : { "opnum", (PyCFunction)py_netr_DsRGetDCNameEx2_ndr_opnum, METH_NOARGS|METH_CLASS,
52146 : "netlogon.netr_DsRGetDCNameEx2.opnum() -> 34 (0x22) " },
52147 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
52148 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
52149 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
52150 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
52151 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
52152 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
52153 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetDCNameEx2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
52154 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
52155 : { "__ndr_print_in__", (PyCFunction)py_netr_DsRGetDCNameEx2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
52156 : { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetDCNameEx2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
52157 : { NULL, NULL, 0, NULL }
52158 : };
52159 :
52160 :
52161 : static PyTypeObject netr_DsRGetDCNameEx2_Type = {
52162 : PyVarObject_HEAD_INIT(NULL, 0)
52163 : .tp_name = "netlogon.netr_DsRGetDCNameEx2",
52164 : .tp_getset = py_netr_DsRGetDCNameEx2_getsetters,
52165 : .tp_methods = py_netr_DsRGetDCNameEx2_methods,
52166 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
52167 : .tp_new = py_netr_DsRGetDCNameEx2_new,
52168 : };
52169 :
52170 123 : static bool pack_py_netr_DsRGetDCNameEx2_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetDCNameEx2 *r)
52171 : {
52172 : PyObject *py_server_unc;
52173 : PyObject *py_client_account;
52174 : PyObject *py_mask;
52175 : PyObject *py_domain_name;
52176 : PyObject *py_domain_guid;
52177 : PyObject *py_site_name;
52178 : PyObject *py_flags;
52179 123 : const char *kwnames[] = {
52180 : "server_unc", "client_account", "mask", "domain_name", "domain_guid", "site_name", "flags", NULL
52181 : };
52182 :
52183 123 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:netr_DsRGetDCNameEx2", discard_const_p(char *, kwnames), &py_server_unc, &py_client_account, &py_mask, &py_domain_name, &py_domain_guid, &py_site_name, &py_flags)) {
52184 0 : return false;
52185 : }
52186 :
52187 123 : if (py_server_unc == NULL) {
52188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_unc");
52189 0 : return false;
52190 : }
52191 123 : if (py_server_unc == Py_None) {
52192 0 : r->in.server_unc = NULL;
52193 : } else {
52194 123 : r->in.server_unc = NULL;
52195 : {
52196 : const char *test_str;
52197 : const char *talloc_str;
52198 123 : PyObject *unicode = NULL;
52199 123 : if (PyUnicode_Check(py_server_unc)) {
52200 123 : unicode = PyUnicode_AsEncodedString(py_server_unc, "utf-8", "ignore");
52201 123 : if (unicode == NULL) {
52202 0 : PyErr_NoMemory();
52203 0 : return false;
52204 : }
52205 123 : test_str = PyBytes_AS_STRING(unicode);
52206 0 : } else if (PyBytes_Check(py_server_unc)) {
52207 0 : test_str = PyBytes_AS_STRING(py_server_unc);
52208 : } else {
52209 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_unc)->tp_name);
52210 0 : return false;
52211 : }
52212 123 : talloc_str = talloc_strdup(r, test_str);
52213 123 : if (unicode != NULL) {
52214 123 : Py_DECREF(unicode);
52215 : }
52216 123 : if (talloc_str == NULL) {
52217 0 : PyErr_NoMemory();
52218 0 : return false;
52219 : }
52220 123 : r->in.server_unc = talloc_str;
52221 : }
52222 : }
52223 123 : if (py_client_account == NULL) {
52224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_account");
52225 0 : return false;
52226 : }
52227 123 : if (py_client_account == Py_None) {
52228 123 : r->in.client_account = NULL;
52229 : } else {
52230 0 : r->in.client_account = NULL;
52231 : {
52232 : const char *test_str;
52233 : const char *talloc_str;
52234 0 : PyObject *unicode = NULL;
52235 0 : if (PyUnicode_Check(py_client_account)) {
52236 0 : unicode = PyUnicode_AsEncodedString(py_client_account, "utf-8", "ignore");
52237 0 : if (unicode == NULL) {
52238 0 : PyErr_NoMemory();
52239 0 : return false;
52240 : }
52241 0 : test_str = PyBytes_AS_STRING(unicode);
52242 0 : } else if (PyBytes_Check(py_client_account)) {
52243 0 : test_str = PyBytes_AS_STRING(py_client_account);
52244 : } else {
52245 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_account)->tp_name);
52246 0 : return false;
52247 : }
52248 0 : talloc_str = talloc_strdup(r, test_str);
52249 0 : if (unicode != NULL) {
52250 0 : Py_DECREF(unicode);
52251 : }
52252 0 : if (talloc_str == NULL) {
52253 0 : PyErr_NoMemory();
52254 0 : return false;
52255 : }
52256 0 : r->in.client_account = talloc_str;
52257 : }
52258 : }
52259 123 : if (py_mask == NULL) {
52260 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.mask");
52261 0 : return false;
52262 : }
52263 : {
52264 123 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.mask));
52265 123 : if (PyLong_Check(py_mask)) {
52266 : unsigned long long test_var;
52267 123 : test_var = PyLong_AsUnsignedLongLong(py_mask);
52268 123 : if (PyErr_Occurred() != NULL) {
52269 0 : return false;
52270 : }
52271 123 : if (test_var > uint_max) {
52272 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
52273 : PyLong_Type.tp_name, uint_max, test_var);
52274 0 : return false;
52275 : }
52276 123 : r->in.mask = test_var;
52277 : } else {
52278 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
52279 : PyLong_Type.tp_name);
52280 0 : return false;
52281 : }
52282 : }
52283 123 : if (py_domain_name == NULL) {
52284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
52285 0 : return false;
52286 : }
52287 123 : if (py_domain_name == Py_None) {
52288 111 : r->in.domain_name = NULL;
52289 : } else {
52290 12 : r->in.domain_name = NULL;
52291 : {
52292 : const char *test_str;
52293 : const char *talloc_str;
52294 12 : PyObject *unicode = NULL;
52295 12 : if (PyUnicode_Check(py_domain_name)) {
52296 12 : unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
52297 12 : if (unicode == NULL) {
52298 0 : PyErr_NoMemory();
52299 0 : return false;
52300 : }
52301 12 : test_str = PyBytes_AS_STRING(unicode);
52302 0 : } else if (PyBytes_Check(py_domain_name)) {
52303 0 : test_str = PyBytes_AS_STRING(py_domain_name);
52304 : } else {
52305 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
52306 0 : return false;
52307 : }
52308 12 : talloc_str = talloc_strdup(r, test_str);
52309 12 : if (unicode != NULL) {
52310 12 : Py_DECREF(unicode);
52311 : }
52312 12 : if (talloc_str == NULL) {
52313 0 : PyErr_NoMemory();
52314 0 : return false;
52315 : }
52316 12 : r->in.domain_name = talloc_str;
52317 : }
52318 : }
52319 123 : if (py_domain_guid == NULL) {
52320 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_guid");
52321 0 : return false;
52322 : }
52323 123 : if (py_domain_guid == Py_None) {
52324 123 : r->in.domain_guid = NULL;
52325 : } else {
52326 0 : r->in.domain_guid = NULL;
52327 0 : PY_CHECK_TYPE(GUID_Type, py_domain_guid, return false;);
52328 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_guid)) == NULL) {
52329 0 : PyErr_NoMemory();
52330 0 : return false;
52331 : }
52332 0 : r->in.domain_guid = (struct GUID *)pytalloc_get_ptr(py_domain_guid);
52333 : }
52334 123 : if (py_site_name == NULL) {
52335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_name");
52336 0 : return false;
52337 : }
52338 123 : if (py_site_name == Py_None) {
52339 119 : r->in.site_name = NULL;
52340 : } else {
52341 4 : r->in.site_name = NULL;
52342 : {
52343 : const char *test_str;
52344 : const char *talloc_str;
52345 4 : PyObject *unicode = NULL;
52346 4 : if (PyUnicode_Check(py_site_name)) {
52347 4 : unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore");
52348 4 : if (unicode == NULL) {
52349 0 : PyErr_NoMemory();
52350 0 : return false;
52351 : }
52352 4 : test_str = PyBytes_AS_STRING(unicode);
52353 0 : } else if (PyBytes_Check(py_site_name)) {
52354 0 : test_str = PyBytes_AS_STRING(py_site_name);
52355 : } else {
52356 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name);
52357 0 : return false;
52358 : }
52359 4 : talloc_str = talloc_strdup(r, test_str);
52360 4 : if (unicode != NULL) {
52361 4 : Py_DECREF(unicode);
52362 : }
52363 4 : if (talloc_str == NULL) {
52364 0 : PyErr_NoMemory();
52365 0 : return false;
52366 : }
52367 4 : r->in.site_name = talloc_str;
52368 : }
52369 : }
52370 123 : if (py_flags == NULL) {
52371 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
52372 0 : return false;
52373 : }
52374 : {
52375 123 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
52376 123 : if (PyLong_Check(py_flags)) {
52377 : unsigned long long test_var;
52378 123 : test_var = PyLong_AsUnsignedLongLong(py_flags);
52379 123 : if (PyErr_Occurred() != NULL) {
52380 0 : return false;
52381 : }
52382 123 : if (test_var > uint_max) {
52383 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
52384 : PyLong_Type.tp_name, uint_max, test_var);
52385 0 : return false;
52386 : }
52387 123 : r->in.flags = test_var;
52388 : } else {
52389 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
52390 : PyLong_Type.tp_name);
52391 0 : return false;
52392 : }
52393 : }
52394 123 : return true;
52395 : }
52396 :
52397 123 : static PyObject *unpack_py_netr_DsRGetDCNameEx2_args_out(struct netr_DsRGetDCNameEx2 *r)
52398 : {
52399 : PyObject *result;
52400 : PyObject *py_info;
52401 123 : if (*r->out.info == NULL) {
52402 0 : py_info = Py_None;
52403 0 : Py_INCREF(py_info);
52404 : } else {
52405 123 : py_info = pytalloc_reference_ex(&netr_DsRGetDCNameInfo_Type, *r->out.info, *r->out.info);
52406 : }
52407 123 : result = py_info;
52408 123 : if (!W_ERROR_IS_OK(r->out.result)) {
52409 4 : PyErr_SetWERROR(r->out.result);
52410 4 : return NULL;
52411 : }
52412 :
52413 119 : return result;
52414 : }
52415 :
52416 :
52417 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_in_get_server_name(PyObject *obj, void *closure)
52418 : {
52419 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(obj);
52420 : PyObject *py_server_name;
52421 0 : if (object->in.server_name == NULL) {
52422 0 : Py_RETURN_NONE;
52423 : }
52424 0 : if (object->in.server_name == NULL) {
52425 0 : py_server_name = Py_None;
52426 0 : Py_INCREF(py_server_name);
52427 : } else {
52428 0 : if (object->in.server_name == NULL) {
52429 0 : py_server_name = Py_None;
52430 0 : Py_INCREF(py_server_name);
52431 : } else {
52432 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
52433 : }
52434 : }
52435 0 : return py_server_name;
52436 : }
52437 :
52438 0 : static int py_netr_NetrEnumerateTrustedDomainsEx_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
52439 : {
52440 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
52441 0 : if (value == NULL) {
52442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
52443 0 : return -1;
52444 : }
52445 0 : if (value == Py_None) {
52446 0 : object->in.server_name = NULL;
52447 : } else {
52448 0 : object->in.server_name = NULL;
52449 : {
52450 : const char *test_str;
52451 : const char *talloc_str;
52452 0 : PyObject *unicode = NULL;
52453 0 : if (PyUnicode_Check(value)) {
52454 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
52455 0 : if (unicode == NULL) {
52456 0 : PyErr_NoMemory();
52457 0 : return -1;
52458 : }
52459 0 : test_str = PyBytes_AS_STRING(unicode);
52460 0 : } else if (PyBytes_Check(value)) {
52461 0 : test_str = PyBytes_AS_STRING(value);
52462 : } else {
52463 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
52464 0 : return -1;
52465 : }
52466 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
52467 0 : if (unicode != NULL) {
52468 0 : Py_DECREF(unicode);
52469 : }
52470 0 : if (talloc_str == NULL) {
52471 0 : PyErr_NoMemory();
52472 0 : return -1;
52473 : }
52474 0 : object->in.server_name = talloc_str;
52475 : }
52476 : }
52477 0 : return 0;
52478 : }
52479 :
52480 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_out_get_dom_trust_list(PyObject *obj, void *closure)
52481 : {
52482 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(obj);
52483 : PyObject *py_dom_trust_list;
52484 0 : if (object->out.dom_trust_list == NULL) {
52485 0 : Py_RETURN_NONE;
52486 : }
52487 0 : py_dom_trust_list = pytalloc_reference_ex(&netr_DomainTrustList_Type, object->out.dom_trust_list, object->out.dom_trust_list);
52488 0 : return py_dom_trust_list;
52489 : }
52490 :
52491 0 : static int py_netr_NetrEnumerateTrustedDomainsEx_out_set_dom_trust_list(PyObject *py_obj, PyObject *value, void *closure)
52492 : {
52493 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
52494 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dom_trust_list));
52495 0 : if (value == NULL) {
52496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dom_trust_list");
52497 0 : return -1;
52498 : }
52499 0 : object->out.dom_trust_list = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dom_trust_list);
52500 0 : if (object->out.dom_trust_list == NULL) {
52501 0 : PyErr_NoMemory();
52502 0 : return -1;
52503 : }
52504 0 : PY_CHECK_TYPE(&netr_DomainTrustList_Type, value, return -1;);
52505 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
52506 0 : PyErr_NoMemory();
52507 0 : return -1;
52508 : }
52509 0 : object->out.dom_trust_list = (struct netr_DomainTrustList *)pytalloc_get_ptr(value);
52510 0 : return 0;
52511 : }
52512 :
52513 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_get_result(PyObject *obj, void *closure)
52514 : {
52515 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(obj);
52516 : PyObject *py_result;
52517 0 : py_result = PyErr_FromWERROR(object->out.result);
52518 0 : return py_result;
52519 : }
52520 :
52521 0 : static int py_netr_NetrEnumerateTrustedDomainsEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
52522 : {
52523 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
52524 0 : if (value == NULL) {
52525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
52526 0 : return -1;
52527 : }
52528 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
52529 0 : return 0;
52530 : }
52531 :
52532 : static PyGetSetDef py_netr_NetrEnumerateTrustedDomainsEx_getsetters[] = {
52533 : {
52534 : .name = discard_const_p(char, "in_server_name"),
52535 : .get = py_netr_NetrEnumerateTrustedDomainsEx_in_get_server_name,
52536 : .set = py_netr_NetrEnumerateTrustedDomainsEx_in_set_server_name,
52537 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
52538 : },
52539 : {
52540 : .name = discard_const_p(char, "out_dom_trust_list"),
52541 : .get = py_netr_NetrEnumerateTrustedDomainsEx_out_get_dom_trust_list,
52542 : .set = py_netr_NetrEnumerateTrustedDomainsEx_out_set_dom_trust_list,
52543 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainTrustList")
52544 : },
52545 : {
52546 : .name = discard_const_p(char, "result"),
52547 : .get = py_netr_NetrEnumerateTrustedDomainsEx_get_result,
52548 : .set = py_netr_NetrEnumerateTrustedDomainsEx_set_result,
52549 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
52550 : },
52551 : { .name = NULL }
52552 : };
52553 :
52554 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
52555 : {
52556 0 : PyObject *self = pytalloc_new(struct netr_NetrEnumerateTrustedDomainsEx, type);
52557 0 : struct netr_NetrEnumerateTrustedDomainsEx *_self = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(self);
52558 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
52559 0 : _self->out.dom_trust_list = talloc_zero(mem_ctx, struct netr_DomainTrustList);
52560 0 : return self;
52561 : }
52562 :
52563 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
52564 : {
52565 :
52566 :
52567 0 : return PyLong_FromLong(36);
52568 : }
52569 :
52570 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
52571 : {
52572 0 : const struct ndr_interface_call *call = NULL;
52573 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
52574 0 : PyObject *ret = NULL;
52575 0 : struct ndr_push *push = NULL;
52576 : DATA_BLOB blob;
52577 : enum ndr_err_code err;
52578 :
52579 0 : if (ndr_table_netlogon.num_calls < 37) {
52580 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack");
52581 0 : return NULL;
52582 : }
52583 0 : call = &ndr_table_netlogon.calls[36];
52584 :
52585 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
52586 0 : if (push == NULL) {
52587 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
52588 0 : return NULL;
52589 : }
52590 :
52591 0 : push->flags |= ndr_push_flags;
52592 :
52593 0 : err = call->ndr_push(push, ndr_inout_flags, object);
52594 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
52595 0 : TALLOC_FREE(push);
52596 0 : PyErr_SetNdrError(err);
52597 0 : return NULL;
52598 : }
52599 0 : blob = ndr_push_blob(push);
52600 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
52601 0 : TALLOC_FREE(push);
52602 0 : return ret;
52603 : }
52604 :
52605 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
52606 : {
52607 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
52608 0 : PyObject *bigendian_obj = NULL;
52609 0 : PyObject *ndr64_obj = NULL;
52610 0 : uint32_t ndr_push_flags = 0;
52611 :
52612 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
52613 : discard_const_p(char *, kwnames),
52614 : &bigendian_obj,
52615 : &ndr64_obj)) {
52616 0 : return NULL;
52617 : }
52618 :
52619 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
52620 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
52621 : }
52622 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
52623 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
52624 : }
52625 :
52626 0 : return py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
52627 : }
52628 :
52629 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
52630 : {
52631 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
52632 0 : PyObject *bigendian_obj = NULL;
52633 0 : PyObject *ndr64_obj = NULL;
52634 0 : uint32_t ndr_push_flags = 0;
52635 :
52636 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
52637 : discard_const_p(char *, kwnames),
52638 : &bigendian_obj,
52639 : &ndr64_obj)) {
52640 0 : return NULL;
52641 : }
52642 :
52643 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
52644 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
52645 : }
52646 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
52647 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
52648 : }
52649 :
52650 0 : return py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
52651 : }
52652 :
52653 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
52654 : {
52655 0 : const struct ndr_interface_call *call = NULL;
52656 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
52657 0 : struct ndr_pull *pull = NULL;
52658 : enum ndr_err_code err;
52659 :
52660 0 : if (ndr_table_netlogon.num_calls < 37) {
52661 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack");
52662 0 : return NULL;
52663 : }
52664 0 : call = &ndr_table_netlogon.calls[36];
52665 :
52666 0 : pull = ndr_pull_init_blob(blob, object);
52667 0 : if (pull == NULL) {
52668 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
52669 0 : return NULL;
52670 : }
52671 :
52672 0 : pull->flags |= ndr_pull_flags;
52673 :
52674 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
52675 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
52676 0 : TALLOC_FREE(pull);
52677 0 : PyErr_SetNdrError(err);
52678 0 : return NULL;
52679 : }
52680 0 : if (!allow_remaining) {
52681 : uint32_t highest_ofs;
52682 :
52683 0 : if (pull->offset > pull->relative_highest_offset) {
52684 0 : highest_ofs = pull->offset;
52685 : } else {
52686 0 : highest_ofs = pull->relative_highest_offset;
52687 : }
52688 0 : if (highest_ofs < pull->data_size) {
52689 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
52690 : "not all bytes consumed ofs[%u] size[%u]",
52691 : highest_ofs, pull->data_size);
52692 0 : TALLOC_FREE(pull);
52693 0 : PyErr_SetNdrError(err);
52694 0 : return NULL;
52695 : }
52696 : }
52697 :
52698 0 : TALLOC_FREE(pull);
52699 0 : Py_RETURN_NONE;
52700 : }
52701 :
52702 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
52703 : {
52704 : DATA_BLOB blob;
52705 0 : Py_ssize_t blob_length = 0;
52706 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
52707 0 : PyObject *bigendian_obj = NULL;
52708 0 : PyObject *ndr64_obj = NULL;
52709 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
52710 0 : PyObject *allow_remaining_obj = NULL;
52711 0 : bool allow_remaining = false;
52712 :
52713 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
52714 : discard_const_p(char *, kwnames),
52715 : &blob.data, &blob_length,
52716 : &bigendian_obj,
52717 : &ndr64_obj,
52718 : &allow_remaining_obj)) {
52719 0 : return NULL;
52720 : }
52721 0 : blob.length = blob_length;
52722 :
52723 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
52724 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
52725 : }
52726 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
52727 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
52728 : }
52729 :
52730 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
52731 0 : allow_remaining = true;
52732 : }
52733 :
52734 0 : return py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
52735 : }
52736 :
52737 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
52738 : {
52739 : DATA_BLOB blob;
52740 0 : Py_ssize_t blob_length = 0;
52741 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
52742 0 : PyObject *bigendian_obj = NULL;
52743 0 : PyObject *ndr64_obj = NULL;
52744 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
52745 0 : PyObject *allow_remaining_obj = NULL;
52746 0 : bool allow_remaining = false;
52747 :
52748 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
52749 : discard_const_p(char *, kwnames),
52750 : &blob.data, &blob_length,
52751 : &bigendian_obj,
52752 : &ndr64_obj,
52753 : &allow_remaining_obj)) {
52754 0 : return NULL;
52755 : }
52756 0 : blob.length = blob_length;
52757 :
52758 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
52759 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
52760 : }
52761 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
52762 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
52763 : }
52764 :
52765 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
52766 0 : allow_remaining = true;
52767 : }
52768 :
52769 0 : return py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
52770 : }
52771 :
52772 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
52773 : {
52774 0 : const struct ndr_interface_call *call = NULL;
52775 0 : struct netr_NetrEnumerateTrustedDomainsEx *object = (struct netr_NetrEnumerateTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
52776 : PyObject *ret;
52777 : char *retstr;
52778 :
52779 0 : if (ndr_table_netlogon.num_calls < 37) {
52780 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_NetrEnumerateTrustedDomainsEx_ndr_print");
52781 0 : return NULL;
52782 : }
52783 0 : call = &ndr_table_netlogon.calls[36];
52784 :
52785 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
52786 0 : ret = PyUnicode_FromString(retstr);
52787 0 : TALLOC_FREE(retstr);
52788 :
52789 0 : return ret;
52790 : }
52791 :
52792 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
52793 : {
52794 0 : return py_netr_NetrEnumerateTrustedDomainsEx_ndr_print(py_obj, "netr_NetrEnumerateTrustedDomainsEx_in", NDR_IN);
52795 : }
52796 :
52797 0 : static PyObject *py_netr_NetrEnumerateTrustedDomainsEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
52798 : {
52799 0 : return py_netr_NetrEnumerateTrustedDomainsEx_ndr_print(py_obj, "netr_NetrEnumerateTrustedDomainsEx_out", NDR_OUT);
52800 : }
52801 :
52802 : static PyMethodDef py_netr_NetrEnumerateTrustedDomainsEx_methods[] = {
52803 : { "opnum", (PyCFunction)py_netr_NetrEnumerateTrustedDomainsEx_ndr_opnum, METH_NOARGS|METH_CLASS,
52804 : "netlogon.netr_NetrEnumerateTrustedDomainsEx.opnum() -> 36 (0x24) " },
52805 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
52806 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
52807 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomainsEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
52808 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
52809 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
52810 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
52811 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_NetrEnumerateTrustedDomainsEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
52812 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
52813 : { "__ndr_print_in__", (PyCFunction)py_netr_NetrEnumerateTrustedDomainsEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
52814 : { "__ndr_print_out__", (PyCFunction)py_netr_NetrEnumerateTrustedDomainsEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
52815 : { NULL, NULL, 0, NULL }
52816 : };
52817 :
52818 :
52819 : static PyTypeObject netr_NetrEnumerateTrustedDomainsEx_Type = {
52820 : PyVarObject_HEAD_INIT(NULL, 0)
52821 : .tp_name = "netlogon.netr_NetrEnumerateTrustedDomainsEx",
52822 : .tp_getset = py_netr_NetrEnumerateTrustedDomainsEx_getsetters,
52823 : .tp_methods = py_netr_NetrEnumerateTrustedDomainsEx_methods,
52824 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
52825 : .tp_new = py_netr_NetrEnumerateTrustedDomainsEx_new,
52826 : };
52827 :
52828 0 : static bool pack_py_netr_NetrEnumerateTrustedDomainsEx_args_in(PyObject *args, PyObject *kwargs, struct netr_NetrEnumerateTrustedDomainsEx *r)
52829 : {
52830 : PyObject *py_server_name;
52831 0 : const char *kwnames[] = {
52832 : "server_name", NULL
52833 : };
52834 :
52835 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:netr_NetrEnumerateTrustedDomainsEx", discard_const_p(char *, kwnames), &py_server_name)) {
52836 0 : return false;
52837 : }
52838 :
52839 0 : if (py_server_name == NULL) {
52840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
52841 0 : return false;
52842 : }
52843 0 : if (py_server_name == Py_None) {
52844 0 : r->in.server_name = NULL;
52845 : } else {
52846 0 : r->in.server_name = NULL;
52847 : {
52848 : const char *test_str;
52849 : const char *talloc_str;
52850 0 : PyObject *unicode = NULL;
52851 0 : if (PyUnicode_Check(py_server_name)) {
52852 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
52853 0 : if (unicode == NULL) {
52854 0 : PyErr_NoMemory();
52855 0 : return false;
52856 : }
52857 0 : test_str = PyBytes_AS_STRING(unicode);
52858 0 : } else if (PyBytes_Check(py_server_name)) {
52859 0 : test_str = PyBytes_AS_STRING(py_server_name);
52860 : } else {
52861 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
52862 0 : return false;
52863 : }
52864 0 : talloc_str = talloc_strdup(r, test_str);
52865 0 : if (unicode != NULL) {
52866 0 : Py_DECREF(unicode);
52867 : }
52868 0 : if (talloc_str == NULL) {
52869 0 : PyErr_NoMemory();
52870 0 : return false;
52871 : }
52872 0 : r->in.server_name = talloc_str;
52873 : }
52874 : }
52875 0 : return true;
52876 : }
52877 :
52878 0 : static PyObject *unpack_py_netr_NetrEnumerateTrustedDomainsEx_args_out(struct netr_NetrEnumerateTrustedDomainsEx *r)
52879 : {
52880 : PyObject *result;
52881 : PyObject *py_dom_trust_list;
52882 0 : py_dom_trust_list = pytalloc_reference_ex(&netr_DomainTrustList_Type, r->out.dom_trust_list, r->out.dom_trust_list);
52883 0 : result = py_dom_trust_list;
52884 0 : if (!W_ERROR_IS_OK(r->out.result)) {
52885 0 : PyErr_SetWERROR(r->out.result);
52886 0 : return NULL;
52887 : }
52888 :
52889 0 : return result;
52890 : }
52891 :
52892 :
52893 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_in_get_server_name(PyObject *obj, void *closure)
52894 : {
52895 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj);
52896 : PyObject *py_server_name;
52897 0 : if (object->in.server_name == NULL) {
52898 0 : Py_RETURN_NONE;
52899 : }
52900 0 : if (object->in.server_name == NULL) {
52901 0 : py_server_name = Py_None;
52902 0 : Py_INCREF(py_server_name);
52903 : } else {
52904 0 : if (object->in.server_name == NULL) {
52905 0 : py_server_name = Py_None;
52906 0 : Py_INCREF(py_server_name);
52907 : } else {
52908 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
52909 : }
52910 : }
52911 0 : return py_server_name;
52912 : }
52913 :
52914 0 : static int py_netr_DsRAddressToSitenamesExW_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
52915 : {
52916 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj);
52917 0 : if (value == NULL) {
52918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
52919 0 : return -1;
52920 : }
52921 0 : if (value == Py_None) {
52922 0 : object->in.server_name = NULL;
52923 : } else {
52924 0 : object->in.server_name = NULL;
52925 : {
52926 : const char *test_str;
52927 : const char *talloc_str;
52928 0 : PyObject *unicode = NULL;
52929 0 : if (PyUnicode_Check(value)) {
52930 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
52931 0 : if (unicode == NULL) {
52932 0 : PyErr_NoMemory();
52933 0 : return -1;
52934 : }
52935 0 : test_str = PyBytes_AS_STRING(unicode);
52936 0 : } else if (PyBytes_Check(value)) {
52937 0 : test_str = PyBytes_AS_STRING(value);
52938 : } else {
52939 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
52940 0 : return -1;
52941 : }
52942 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
52943 0 : if (unicode != NULL) {
52944 0 : Py_DECREF(unicode);
52945 : }
52946 0 : if (talloc_str == NULL) {
52947 0 : PyErr_NoMemory();
52948 0 : return -1;
52949 : }
52950 0 : object->in.server_name = talloc_str;
52951 : }
52952 : }
52953 0 : return 0;
52954 : }
52955 :
52956 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_in_get_count(PyObject *obj, void *closure)
52957 : {
52958 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj);
52959 : PyObject *py_count;
52960 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->in.count);
52961 0 : return py_count;
52962 : }
52963 :
52964 0 : static int py_netr_DsRAddressToSitenamesExW_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
52965 : {
52966 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj);
52967 0 : if (value == NULL) {
52968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
52969 0 : return -1;
52970 : }
52971 : {
52972 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.count));
52973 0 : if (PyLong_Check(value)) {
52974 : unsigned long long test_var;
52975 0 : test_var = PyLong_AsUnsignedLongLong(value);
52976 0 : if (PyErr_Occurred() != NULL) {
52977 0 : return -1;
52978 : }
52979 0 : if (test_var > uint_max) {
52980 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
52981 : PyLong_Type.tp_name, uint_max, test_var);
52982 0 : return -1;
52983 : }
52984 0 : object->in.count = test_var;
52985 : } else {
52986 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
52987 : PyLong_Type.tp_name);
52988 0 : return -1;
52989 : }
52990 : }
52991 0 : return 0;
52992 : }
52993 :
52994 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_in_get_addresses(PyObject *obj, void *closure)
52995 : {
52996 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj);
52997 : PyObject *py_addresses;
52998 0 : if (object->in.addresses == NULL) {
52999 0 : Py_RETURN_NONE;
53000 : }
53001 0 : py_addresses = PyList_New(object->in.count);
53002 0 : if (py_addresses == NULL) {
53003 0 : return NULL;
53004 : }
53005 : {
53006 : int addresses_cntr_1;
53007 0 : for (addresses_cntr_1 = 0; addresses_cntr_1 < (object->in.count); addresses_cntr_1++) {
53008 : PyObject *py_addresses_1;
53009 0 : py_addresses_1 = pytalloc_reference_ex(&netr_DsRAddress_Type, object->in.addresses, &object->in.addresses[addresses_cntr_1]);
53010 0 : PyList_SetItem(py_addresses, addresses_cntr_1, py_addresses_1);
53011 : }
53012 : }
53013 0 : return py_addresses;
53014 : }
53015 :
53016 0 : static int py_netr_DsRAddressToSitenamesExW_in_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
53017 : {
53018 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj);
53019 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.addresses));
53020 0 : if (value == NULL) {
53021 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.addresses");
53022 0 : return -1;
53023 : }
53024 0 : object->in.addresses = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addresses);
53025 0 : if (object->in.addresses == NULL) {
53026 0 : PyErr_NoMemory();
53027 0 : return -1;
53028 : }
53029 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
53030 : {
53031 : int addresses_cntr_1;
53032 0 : object->in.addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addresses, PyList_GET_SIZE(value));
53033 0 : if (!object->in.addresses) { return -1;; }
53034 0 : talloc_set_name_const(object->in.addresses, "ARRAY: object->in.addresses");
53035 0 : for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(value); addresses_cntr_1++) {
53036 0 : if (PyList_GET_ITEM(value, addresses_cntr_1) == NULL) {
53037 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.addresses[addresses_cntr_1]");
53038 0 : return -1;
53039 : }
53040 0 : PY_CHECK_TYPE(&netr_DsRAddress_Type, PyList_GET_ITEM(value, addresses_cntr_1), return -1;);
53041 0 : if (talloc_reference(object->in.addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_1))) == NULL) {
53042 0 : PyErr_NoMemory();
53043 0 : return -1;
53044 : }
53045 0 : object->in.addresses[addresses_cntr_1] = *(struct netr_DsRAddress *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_1));
53046 : }
53047 : }
53048 0 : return 0;
53049 : }
53050 :
53051 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_out_get_ctr(PyObject *obj, void *closure)
53052 : {
53053 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj);
53054 : PyObject *py_ctr;
53055 0 : if (object->out.ctr == NULL) {
53056 0 : Py_RETURN_NONE;
53057 : }
53058 0 : if (*object->out.ctr == NULL) {
53059 0 : py_ctr = Py_None;
53060 0 : Py_INCREF(py_ctr);
53061 : } else {
53062 0 : py_ctr = pytalloc_reference_ex(&netr_DsRAddressToSitenamesExWCtr_Type, *object->out.ctr, *object->out.ctr);
53063 : }
53064 0 : return py_ctr;
53065 : }
53066 :
53067 0 : static int py_netr_DsRAddressToSitenamesExW_out_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
53068 : {
53069 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj);
53070 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ctr));
53071 0 : if (value == NULL) {
53072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ctr");
53073 0 : return -1;
53074 : }
53075 0 : object->out.ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ctr);
53076 0 : if (object->out.ctr == NULL) {
53077 0 : PyErr_NoMemory();
53078 0 : return -1;
53079 : }
53080 0 : if (value == Py_None) {
53081 0 : *object->out.ctr = NULL;
53082 : } else {
53083 0 : *object->out.ctr = NULL;
53084 0 : PY_CHECK_TYPE(&netr_DsRAddressToSitenamesExWCtr_Type, value, return -1;);
53085 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
53086 0 : PyErr_NoMemory();
53087 0 : return -1;
53088 : }
53089 0 : *object->out.ctr = (struct netr_DsRAddressToSitenamesExWCtr *)pytalloc_get_ptr(value);
53090 : }
53091 0 : return 0;
53092 : }
53093 :
53094 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_get_result(PyObject *obj, void *closure)
53095 : {
53096 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(obj);
53097 : PyObject *py_result;
53098 0 : py_result = PyErr_FromWERROR(object->out.result);
53099 0 : return py_result;
53100 : }
53101 :
53102 0 : static int py_netr_DsRAddressToSitenamesExW_set_result(PyObject *py_obj, PyObject *value, void *closure)
53103 : {
53104 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj);
53105 0 : if (value == NULL) {
53106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
53107 0 : return -1;
53108 : }
53109 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
53110 0 : return 0;
53111 : }
53112 :
53113 : static PyGetSetDef py_netr_DsRAddressToSitenamesExW_getsetters[] = {
53114 : {
53115 : .name = discard_const_p(char, "in_server_name"),
53116 : .get = py_netr_DsRAddressToSitenamesExW_in_get_server_name,
53117 : .set = py_netr_DsRAddressToSitenamesExW_in_set_server_name,
53118 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
53119 : },
53120 : {
53121 : .name = discard_const_p(char, "in_count"),
53122 : .get = py_netr_DsRAddressToSitenamesExW_in_get_count,
53123 : .set = py_netr_DsRAddressToSitenamesExW_in_set_count,
53124 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
53125 : },
53126 : {
53127 : .name = discard_const_p(char, "in_addresses"),
53128 : .get = py_netr_DsRAddressToSitenamesExW_in_get_addresses,
53129 : .set = py_netr_DsRAddressToSitenamesExW_in_set_addresses,
53130 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRAddress")
53131 : },
53132 : {
53133 : .name = discard_const_p(char, "out_ctr"),
53134 : .get = py_netr_DsRAddressToSitenamesExW_out_get_ctr,
53135 : .set = py_netr_DsRAddressToSitenamesExW_out_set_ctr,
53136 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRAddressToSitenamesExWCtr")
53137 : },
53138 : {
53139 : .name = discard_const_p(char, "result"),
53140 : .get = py_netr_DsRAddressToSitenamesExW_get_result,
53141 : .set = py_netr_DsRAddressToSitenamesExW_set_result,
53142 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
53143 : },
53144 : { .name = NULL }
53145 : };
53146 :
53147 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
53148 : {
53149 0 : PyObject *self = pytalloc_new(struct netr_DsRAddressToSitenamesExW, type);
53150 0 : struct netr_DsRAddressToSitenamesExW *_self = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(self);
53151 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
53152 0 : _self->in.addresses = talloc_zero(mem_ctx, struct netr_DsRAddress);
53153 : /* a pointer to a NULL pointer */
53154 0 : _self->out.ctr = talloc_zero(mem_ctx, struct netr_DsRAddressToSitenamesExWCtr *);
53155 0 : return self;
53156 : }
53157 :
53158 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
53159 : {
53160 :
53161 :
53162 0 : return PyLong_FromLong(37);
53163 : }
53164 :
53165 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
53166 : {
53167 0 : const struct ndr_interface_call *call = NULL;
53168 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj);
53169 0 : PyObject *ret = NULL;
53170 0 : struct ndr_push *push = NULL;
53171 : DATA_BLOB blob;
53172 : enum ndr_err_code err;
53173 :
53174 0 : if (ndr_table_netlogon.num_calls < 38) {
53175 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesExW_ndr_pack");
53176 0 : return NULL;
53177 : }
53178 0 : call = &ndr_table_netlogon.calls[37];
53179 :
53180 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
53181 0 : if (push == NULL) {
53182 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
53183 0 : return NULL;
53184 : }
53185 :
53186 0 : push->flags |= ndr_push_flags;
53187 :
53188 0 : err = call->ndr_push(push, ndr_inout_flags, object);
53189 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
53190 0 : TALLOC_FREE(push);
53191 0 : PyErr_SetNdrError(err);
53192 0 : return NULL;
53193 : }
53194 0 : blob = ndr_push_blob(push);
53195 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
53196 0 : TALLOC_FREE(push);
53197 0 : return ret;
53198 : }
53199 :
53200 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
53201 : {
53202 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
53203 0 : PyObject *bigendian_obj = NULL;
53204 0 : PyObject *ndr64_obj = NULL;
53205 0 : uint32_t ndr_push_flags = 0;
53206 :
53207 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
53208 : discard_const_p(char *, kwnames),
53209 : &bigendian_obj,
53210 : &ndr64_obj)) {
53211 0 : return NULL;
53212 : }
53213 :
53214 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
53215 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
53216 : }
53217 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
53218 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
53219 : }
53220 :
53221 0 : return py_netr_DsRAddressToSitenamesExW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
53222 : }
53223 :
53224 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
53225 : {
53226 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
53227 0 : PyObject *bigendian_obj = NULL;
53228 0 : PyObject *ndr64_obj = NULL;
53229 0 : uint32_t ndr_push_flags = 0;
53230 :
53231 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
53232 : discard_const_p(char *, kwnames),
53233 : &bigendian_obj,
53234 : &ndr64_obj)) {
53235 0 : return NULL;
53236 : }
53237 :
53238 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
53239 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
53240 : }
53241 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
53242 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
53243 : }
53244 :
53245 0 : return py_netr_DsRAddressToSitenamesExW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
53246 : }
53247 :
53248 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
53249 : {
53250 0 : const struct ndr_interface_call *call = NULL;
53251 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj);
53252 0 : struct ndr_pull *pull = NULL;
53253 : enum ndr_err_code err;
53254 :
53255 0 : if (ndr_table_netlogon.num_calls < 38) {
53256 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesExW_ndr_unpack");
53257 0 : return NULL;
53258 : }
53259 0 : call = &ndr_table_netlogon.calls[37];
53260 :
53261 0 : pull = ndr_pull_init_blob(blob, object);
53262 0 : if (pull == NULL) {
53263 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
53264 0 : return NULL;
53265 : }
53266 :
53267 0 : pull->flags |= ndr_pull_flags;
53268 :
53269 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
53270 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
53271 0 : TALLOC_FREE(pull);
53272 0 : PyErr_SetNdrError(err);
53273 0 : return NULL;
53274 : }
53275 0 : if (!allow_remaining) {
53276 : uint32_t highest_ofs;
53277 :
53278 0 : if (pull->offset > pull->relative_highest_offset) {
53279 0 : highest_ofs = pull->offset;
53280 : } else {
53281 0 : highest_ofs = pull->relative_highest_offset;
53282 : }
53283 0 : if (highest_ofs < pull->data_size) {
53284 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
53285 : "not all bytes consumed ofs[%u] size[%u]",
53286 : highest_ofs, pull->data_size);
53287 0 : TALLOC_FREE(pull);
53288 0 : PyErr_SetNdrError(err);
53289 0 : return NULL;
53290 : }
53291 : }
53292 :
53293 0 : TALLOC_FREE(pull);
53294 0 : Py_RETURN_NONE;
53295 : }
53296 :
53297 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
53298 : {
53299 : DATA_BLOB blob;
53300 0 : Py_ssize_t blob_length = 0;
53301 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
53302 0 : PyObject *bigendian_obj = NULL;
53303 0 : PyObject *ndr64_obj = NULL;
53304 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
53305 0 : PyObject *allow_remaining_obj = NULL;
53306 0 : bool allow_remaining = false;
53307 :
53308 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
53309 : discard_const_p(char *, kwnames),
53310 : &blob.data, &blob_length,
53311 : &bigendian_obj,
53312 : &ndr64_obj,
53313 : &allow_remaining_obj)) {
53314 0 : return NULL;
53315 : }
53316 0 : blob.length = blob_length;
53317 :
53318 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
53319 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
53320 : }
53321 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
53322 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
53323 : }
53324 :
53325 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
53326 0 : allow_remaining = true;
53327 : }
53328 :
53329 0 : return py_netr_DsRAddressToSitenamesExW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
53330 : }
53331 :
53332 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
53333 : {
53334 : DATA_BLOB blob;
53335 0 : Py_ssize_t blob_length = 0;
53336 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
53337 0 : PyObject *bigendian_obj = NULL;
53338 0 : PyObject *ndr64_obj = NULL;
53339 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
53340 0 : PyObject *allow_remaining_obj = NULL;
53341 0 : bool allow_remaining = false;
53342 :
53343 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
53344 : discard_const_p(char *, kwnames),
53345 : &blob.data, &blob_length,
53346 : &bigendian_obj,
53347 : &ndr64_obj,
53348 : &allow_remaining_obj)) {
53349 0 : return NULL;
53350 : }
53351 0 : blob.length = blob_length;
53352 :
53353 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
53354 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
53355 : }
53356 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
53357 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
53358 : }
53359 :
53360 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
53361 0 : allow_remaining = true;
53362 : }
53363 :
53364 0 : return py_netr_DsRAddressToSitenamesExW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
53365 : }
53366 :
53367 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
53368 : {
53369 0 : const struct ndr_interface_call *call = NULL;
53370 0 : struct netr_DsRAddressToSitenamesExW *object = (struct netr_DsRAddressToSitenamesExW *)pytalloc_get_ptr(py_obj);
53371 : PyObject *ret;
53372 : char *retstr;
53373 :
53374 0 : if (ndr_table_netlogon.num_calls < 38) {
53375 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRAddressToSitenamesExW_ndr_print");
53376 0 : return NULL;
53377 : }
53378 0 : call = &ndr_table_netlogon.calls[37];
53379 :
53380 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
53381 0 : ret = PyUnicode_FromString(retstr);
53382 0 : TALLOC_FREE(retstr);
53383 :
53384 0 : return ret;
53385 : }
53386 :
53387 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
53388 : {
53389 0 : return py_netr_DsRAddressToSitenamesExW_ndr_print(py_obj, "netr_DsRAddressToSitenamesExW_in", NDR_IN);
53390 : }
53391 :
53392 0 : static PyObject *py_netr_DsRAddressToSitenamesExW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
53393 : {
53394 0 : return py_netr_DsRAddressToSitenamesExW_ndr_print(py_obj, "netr_DsRAddressToSitenamesExW_out", NDR_OUT);
53395 : }
53396 :
53397 : static PyMethodDef py_netr_DsRAddressToSitenamesExW_methods[] = {
53398 : { "opnum", (PyCFunction)py_netr_DsRAddressToSitenamesExW_ndr_opnum, METH_NOARGS|METH_CLASS,
53399 : "netlogon.netr_DsRAddressToSitenamesExW.opnum() -> 37 (0x25) " },
53400 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesExW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
53401 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
53402 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesExW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
53403 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
53404 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesExW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
53405 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
53406 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRAddressToSitenamesExW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
53407 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
53408 : { "__ndr_print_in__", (PyCFunction)py_netr_DsRAddressToSitenamesExW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
53409 : { "__ndr_print_out__", (PyCFunction)py_netr_DsRAddressToSitenamesExW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
53410 : { NULL, NULL, 0, NULL }
53411 : };
53412 :
53413 :
53414 : static PyTypeObject netr_DsRAddressToSitenamesExW_Type = {
53415 : PyVarObject_HEAD_INIT(NULL, 0)
53416 : .tp_name = "netlogon.netr_DsRAddressToSitenamesExW",
53417 : .tp_getset = py_netr_DsRAddressToSitenamesExW_getsetters,
53418 : .tp_methods = py_netr_DsRAddressToSitenamesExW_methods,
53419 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
53420 : .tp_new = py_netr_DsRAddressToSitenamesExW_new,
53421 : };
53422 :
53423 0 : static bool pack_py_netr_DsRAddressToSitenamesExW_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRAddressToSitenamesExW *r)
53424 : {
53425 : PyObject *py_server_name;
53426 : PyObject *py_addresses;
53427 0 : const char *kwnames[] = {
53428 : "server_name", "addresses", NULL
53429 : };
53430 :
53431 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_DsRAddressToSitenamesExW", discard_const_p(char *, kwnames), &py_server_name, &py_addresses)) {
53432 0 : return false;
53433 : }
53434 :
53435 0 : if (py_server_name == NULL) {
53436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
53437 0 : return false;
53438 : }
53439 0 : if (py_server_name == Py_None) {
53440 0 : r->in.server_name = NULL;
53441 : } else {
53442 0 : r->in.server_name = NULL;
53443 : {
53444 : const char *test_str;
53445 : const char *talloc_str;
53446 0 : PyObject *unicode = NULL;
53447 0 : if (PyUnicode_Check(py_server_name)) {
53448 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
53449 0 : if (unicode == NULL) {
53450 0 : PyErr_NoMemory();
53451 0 : return false;
53452 : }
53453 0 : test_str = PyBytes_AS_STRING(unicode);
53454 0 : } else if (PyBytes_Check(py_server_name)) {
53455 0 : test_str = PyBytes_AS_STRING(py_server_name);
53456 : } else {
53457 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
53458 0 : return false;
53459 : }
53460 0 : talloc_str = talloc_strdup(r, test_str);
53461 0 : if (unicode != NULL) {
53462 0 : Py_DECREF(unicode);
53463 : }
53464 0 : if (talloc_str == NULL) {
53465 0 : PyErr_NoMemory();
53466 0 : return false;
53467 : }
53468 0 : r->in.server_name = talloc_str;
53469 : }
53470 : }
53471 0 : PY_CHECK_TYPE(&PyList_Type, py_addresses, return false;);
53472 0 : r->in.count = PyList_GET_SIZE(py_addresses);
53473 0 : if (py_addresses == NULL) {
53474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.addresses");
53475 0 : return false;
53476 : }
53477 0 : r->in.addresses = talloc_ptrtype(r, r->in.addresses);
53478 0 : if (r->in.addresses == NULL) {
53479 0 : PyErr_NoMemory();
53480 0 : return false;
53481 : }
53482 0 : PY_CHECK_TYPE(&PyList_Type, py_addresses, return false;);
53483 : {
53484 : int addresses_cntr_1;
53485 0 : r->in.addresses = talloc_array_ptrtype(r, r->in.addresses, PyList_GET_SIZE(py_addresses));
53486 0 : if (!r->in.addresses) { return false;; }
53487 0 : talloc_set_name_const(r->in.addresses, "ARRAY: r->in.addresses");
53488 0 : for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(py_addresses); addresses_cntr_1++) {
53489 0 : if (PyList_GET_ITEM(py_addresses, addresses_cntr_1) == NULL) {
53490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.addresses[addresses_cntr_1]");
53491 0 : return false;
53492 : }
53493 0 : PY_CHECK_TYPE(&netr_DsRAddress_Type, PyList_GET_ITEM(py_addresses, addresses_cntr_1), return false;);
53494 0 : if (talloc_reference(r->in.addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_addresses, addresses_cntr_1))) == NULL) {
53495 0 : PyErr_NoMemory();
53496 0 : return false;
53497 : }
53498 0 : r->in.addresses[addresses_cntr_1] = *(struct netr_DsRAddress *)pytalloc_get_ptr(PyList_GET_ITEM(py_addresses, addresses_cntr_1));
53499 : }
53500 : }
53501 0 : return true;
53502 : }
53503 :
53504 0 : static PyObject *unpack_py_netr_DsRAddressToSitenamesExW_args_out(struct netr_DsRAddressToSitenamesExW *r)
53505 : {
53506 : PyObject *result;
53507 : PyObject *py_ctr;
53508 0 : if (*r->out.ctr == NULL) {
53509 0 : py_ctr = Py_None;
53510 0 : Py_INCREF(py_ctr);
53511 : } else {
53512 0 : py_ctr = pytalloc_reference_ex(&netr_DsRAddressToSitenamesExWCtr_Type, *r->out.ctr, *r->out.ctr);
53513 : }
53514 0 : result = py_ctr;
53515 0 : if (!W_ERROR_IS_OK(r->out.result)) {
53516 0 : PyErr_SetWERROR(r->out.result);
53517 0 : return NULL;
53518 : }
53519 :
53520 0 : return result;
53521 : }
53522 :
53523 :
53524 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_in_get_server_name(PyObject *obj, void *closure)
53525 : {
53526 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(obj);
53527 : PyObject *py_server_name;
53528 0 : if (object->in.server_name == NULL) {
53529 0 : Py_RETURN_NONE;
53530 : }
53531 0 : if (object->in.server_name == NULL) {
53532 0 : py_server_name = Py_None;
53533 0 : Py_INCREF(py_server_name);
53534 : } else {
53535 0 : if (object->in.server_name == NULL) {
53536 0 : py_server_name = Py_None;
53537 0 : Py_INCREF(py_server_name);
53538 : } else {
53539 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
53540 : }
53541 : }
53542 0 : return py_server_name;
53543 : }
53544 :
53545 0 : static int py_netr_DsrGetDcSiteCoverageW_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
53546 : {
53547 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj);
53548 0 : if (value == NULL) {
53549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
53550 0 : return -1;
53551 : }
53552 0 : if (value == Py_None) {
53553 0 : object->in.server_name = NULL;
53554 : } else {
53555 0 : object->in.server_name = NULL;
53556 : {
53557 : const char *test_str;
53558 : const char *talloc_str;
53559 0 : PyObject *unicode = NULL;
53560 0 : if (PyUnicode_Check(value)) {
53561 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
53562 0 : if (unicode == NULL) {
53563 0 : PyErr_NoMemory();
53564 0 : return -1;
53565 : }
53566 0 : test_str = PyBytes_AS_STRING(unicode);
53567 0 : } else if (PyBytes_Check(value)) {
53568 0 : test_str = PyBytes_AS_STRING(value);
53569 : } else {
53570 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
53571 0 : return -1;
53572 : }
53573 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
53574 0 : if (unicode != NULL) {
53575 0 : Py_DECREF(unicode);
53576 : }
53577 0 : if (talloc_str == NULL) {
53578 0 : PyErr_NoMemory();
53579 0 : return -1;
53580 : }
53581 0 : object->in.server_name = talloc_str;
53582 : }
53583 : }
53584 0 : return 0;
53585 : }
53586 :
53587 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_out_get_ctr(PyObject *obj, void *closure)
53588 : {
53589 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(obj);
53590 : PyObject *py_ctr;
53591 0 : if (object->out.ctr == NULL) {
53592 0 : Py_RETURN_NONE;
53593 : }
53594 0 : if (*object->out.ctr == NULL) {
53595 0 : py_ctr = Py_None;
53596 0 : Py_INCREF(py_ctr);
53597 : } else {
53598 0 : py_ctr = pytalloc_reference_ex(&DcSitesCtr_Type, *object->out.ctr, *object->out.ctr);
53599 : }
53600 0 : return py_ctr;
53601 : }
53602 :
53603 0 : static int py_netr_DsrGetDcSiteCoverageW_out_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
53604 : {
53605 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj);
53606 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ctr));
53607 0 : if (value == NULL) {
53608 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.ctr");
53609 0 : return -1;
53610 : }
53611 0 : object->out.ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ctr);
53612 0 : if (object->out.ctr == NULL) {
53613 0 : PyErr_NoMemory();
53614 0 : return -1;
53615 : }
53616 0 : if (value == Py_None) {
53617 0 : *object->out.ctr = NULL;
53618 : } else {
53619 0 : *object->out.ctr = NULL;
53620 0 : PY_CHECK_TYPE(&DcSitesCtr_Type, value, return -1;);
53621 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
53622 0 : PyErr_NoMemory();
53623 0 : return -1;
53624 : }
53625 0 : *object->out.ctr = (struct DcSitesCtr *)pytalloc_get_ptr(value);
53626 : }
53627 0 : return 0;
53628 : }
53629 :
53630 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_get_result(PyObject *obj, void *closure)
53631 : {
53632 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(obj);
53633 : PyObject *py_result;
53634 0 : py_result = PyErr_FromWERROR(object->out.result);
53635 0 : return py_result;
53636 : }
53637 :
53638 0 : static int py_netr_DsrGetDcSiteCoverageW_set_result(PyObject *py_obj, PyObject *value, void *closure)
53639 : {
53640 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj);
53641 0 : if (value == NULL) {
53642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
53643 0 : return -1;
53644 : }
53645 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
53646 0 : return 0;
53647 : }
53648 :
53649 : static PyGetSetDef py_netr_DsrGetDcSiteCoverageW_getsetters[] = {
53650 : {
53651 : .name = discard_const_p(char, "in_server_name"),
53652 : .get = py_netr_DsrGetDcSiteCoverageW_in_get_server_name,
53653 : .set = py_netr_DsrGetDcSiteCoverageW_in_set_server_name,
53654 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
53655 : },
53656 : {
53657 : .name = discard_const_p(char, "out_ctr"),
53658 : .get = py_netr_DsrGetDcSiteCoverageW_out_get_ctr,
53659 : .set = py_netr_DsrGetDcSiteCoverageW_out_set_ctr,
53660 : .doc = discard_const_p(char, "PIDL-generated element of base type DcSitesCtr")
53661 : },
53662 : {
53663 : .name = discard_const_p(char, "result"),
53664 : .get = py_netr_DsrGetDcSiteCoverageW_get_result,
53665 : .set = py_netr_DsrGetDcSiteCoverageW_set_result,
53666 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
53667 : },
53668 : { .name = NULL }
53669 : };
53670 :
53671 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
53672 : {
53673 0 : PyObject *self = pytalloc_new(struct netr_DsrGetDcSiteCoverageW, type);
53674 0 : struct netr_DsrGetDcSiteCoverageW *_self = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(self);
53675 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
53676 : /* a pointer to a NULL pointer */
53677 0 : _self->out.ctr = talloc_zero(mem_ctx, struct DcSitesCtr *);
53678 0 : return self;
53679 : }
53680 :
53681 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
53682 : {
53683 :
53684 :
53685 0 : return PyLong_FromLong(38);
53686 : }
53687 :
53688 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
53689 : {
53690 0 : const struct ndr_interface_call *call = NULL;
53691 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj);
53692 0 : PyObject *ret = NULL;
53693 0 : struct ndr_push *push = NULL;
53694 : DATA_BLOB blob;
53695 : enum ndr_err_code err;
53696 :
53697 0 : if (ndr_table_netlogon.num_calls < 39) {
53698 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrGetDcSiteCoverageW_ndr_pack");
53699 0 : return NULL;
53700 : }
53701 0 : call = &ndr_table_netlogon.calls[38];
53702 :
53703 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
53704 0 : if (push == NULL) {
53705 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
53706 0 : return NULL;
53707 : }
53708 :
53709 0 : push->flags |= ndr_push_flags;
53710 :
53711 0 : err = call->ndr_push(push, ndr_inout_flags, object);
53712 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
53713 0 : TALLOC_FREE(push);
53714 0 : PyErr_SetNdrError(err);
53715 0 : return NULL;
53716 : }
53717 0 : blob = ndr_push_blob(push);
53718 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
53719 0 : TALLOC_FREE(push);
53720 0 : return ret;
53721 : }
53722 :
53723 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
53724 : {
53725 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
53726 0 : PyObject *bigendian_obj = NULL;
53727 0 : PyObject *ndr64_obj = NULL;
53728 0 : uint32_t ndr_push_flags = 0;
53729 :
53730 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
53731 : discard_const_p(char *, kwnames),
53732 : &bigendian_obj,
53733 : &ndr64_obj)) {
53734 0 : return NULL;
53735 : }
53736 :
53737 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
53738 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
53739 : }
53740 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
53741 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
53742 : }
53743 :
53744 0 : return py_netr_DsrGetDcSiteCoverageW_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
53745 : }
53746 :
53747 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
53748 : {
53749 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
53750 0 : PyObject *bigendian_obj = NULL;
53751 0 : PyObject *ndr64_obj = NULL;
53752 0 : uint32_t ndr_push_flags = 0;
53753 :
53754 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
53755 : discard_const_p(char *, kwnames),
53756 : &bigendian_obj,
53757 : &ndr64_obj)) {
53758 0 : return NULL;
53759 : }
53760 :
53761 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
53762 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
53763 : }
53764 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
53765 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
53766 : }
53767 :
53768 0 : return py_netr_DsrGetDcSiteCoverageW_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
53769 : }
53770 :
53771 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
53772 : {
53773 0 : const struct ndr_interface_call *call = NULL;
53774 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj);
53775 0 : struct ndr_pull *pull = NULL;
53776 : enum ndr_err_code err;
53777 :
53778 0 : if (ndr_table_netlogon.num_calls < 39) {
53779 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrGetDcSiteCoverageW_ndr_unpack");
53780 0 : return NULL;
53781 : }
53782 0 : call = &ndr_table_netlogon.calls[38];
53783 :
53784 0 : pull = ndr_pull_init_blob(blob, object);
53785 0 : if (pull == NULL) {
53786 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
53787 0 : return NULL;
53788 : }
53789 :
53790 0 : pull->flags |= ndr_pull_flags;
53791 :
53792 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
53793 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
53794 0 : TALLOC_FREE(pull);
53795 0 : PyErr_SetNdrError(err);
53796 0 : return NULL;
53797 : }
53798 0 : if (!allow_remaining) {
53799 : uint32_t highest_ofs;
53800 :
53801 0 : if (pull->offset > pull->relative_highest_offset) {
53802 0 : highest_ofs = pull->offset;
53803 : } else {
53804 0 : highest_ofs = pull->relative_highest_offset;
53805 : }
53806 0 : if (highest_ofs < pull->data_size) {
53807 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
53808 : "not all bytes consumed ofs[%u] size[%u]",
53809 : highest_ofs, pull->data_size);
53810 0 : TALLOC_FREE(pull);
53811 0 : PyErr_SetNdrError(err);
53812 0 : return NULL;
53813 : }
53814 : }
53815 :
53816 0 : TALLOC_FREE(pull);
53817 0 : Py_RETURN_NONE;
53818 : }
53819 :
53820 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
53821 : {
53822 : DATA_BLOB blob;
53823 0 : Py_ssize_t blob_length = 0;
53824 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
53825 0 : PyObject *bigendian_obj = NULL;
53826 0 : PyObject *ndr64_obj = NULL;
53827 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
53828 0 : PyObject *allow_remaining_obj = NULL;
53829 0 : bool allow_remaining = false;
53830 :
53831 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
53832 : discard_const_p(char *, kwnames),
53833 : &blob.data, &blob_length,
53834 : &bigendian_obj,
53835 : &ndr64_obj,
53836 : &allow_remaining_obj)) {
53837 0 : return NULL;
53838 : }
53839 0 : blob.length = blob_length;
53840 :
53841 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
53842 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
53843 : }
53844 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
53845 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
53846 : }
53847 :
53848 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
53849 0 : allow_remaining = true;
53850 : }
53851 :
53852 0 : return py_netr_DsrGetDcSiteCoverageW_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
53853 : }
53854 :
53855 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
53856 : {
53857 : DATA_BLOB blob;
53858 0 : Py_ssize_t blob_length = 0;
53859 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
53860 0 : PyObject *bigendian_obj = NULL;
53861 0 : PyObject *ndr64_obj = NULL;
53862 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
53863 0 : PyObject *allow_remaining_obj = NULL;
53864 0 : bool allow_remaining = false;
53865 :
53866 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
53867 : discard_const_p(char *, kwnames),
53868 : &blob.data, &blob_length,
53869 : &bigendian_obj,
53870 : &ndr64_obj,
53871 : &allow_remaining_obj)) {
53872 0 : return NULL;
53873 : }
53874 0 : blob.length = blob_length;
53875 :
53876 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
53877 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
53878 : }
53879 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
53880 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
53881 : }
53882 :
53883 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
53884 0 : allow_remaining = true;
53885 : }
53886 :
53887 0 : return py_netr_DsrGetDcSiteCoverageW_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
53888 : }
53889 :
53890 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
53891 : {
53892 0 : const struct ndr_interface_call *call = NULL;
53893 0 : struct netr_DsrGetDcSiteCoverageW *object = (struct netr_DsrGetDcSiteCoverageW *)pytalloc_get_ptr(py_obj);
53894 : PyObject *ret;
53895 : char *retstr;
53896 :
53897 0 : if (ndr_table_netlogon.num_calls < 39) {
53898 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrGetDcSiteCoverageW_ndr_print");
53899 0 : return NULL;
53900 : }
53901 0 : call = &ndr_table_netlogon.calls[38];
53902 :
53903 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
53904 0 : ret = PyUnicode_FromString(retstr);
53905 0 : TALLOC_FREE(retstr);
53906 :
53907 0 : return ret;
53908 : }
53909 :
53910 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
53911 : {
53912 0 : return py_netr_DsrGetDcSiteCoverageW_ndr_print(py_obj, "netr_DsrGetDcSiteCoverageW_in", NDR_IN);
53913 : }
53914 :
53915 0 : static PyObject *py_netr_DsrGetDcSiteCoverageW_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
53916 : {
53917 0 : return py_netr_DsrGetDcSiteCoverageW_ndr_print(py_obj, "netr_DsrGetDcSiteCoverageW_out", NDR_OUT);
53918 : }
53919 :
53920 : static PyMethodDef py_netr_DsrGetDcSiteCoverageW_methods[] = {
53921 : { "opnum", (PyCFunction)py_netr_DsrGetDcSiteCoverageW_ndr_opnum, METH_NOARGS|METH_CLASS,
53922 : "netlogon.netr_DsrGetDcSiteCoverageW.opnum() -> 38 (0x26) " },
53923 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrGetDcSiteCoverageW_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
53924 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
53925 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrGetDcSiteCoverageW_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
53926 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
53927 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrGetDcSiteCoverageW_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
53928 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
53929 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrGetDcSiteCoverageW_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
53930 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
53931 : { "__ndr_print_in__", (PyCFunction)py_netr_DsrGetDcSiteCoverageW_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
53932 : { "__ndr_print_out__", (PyCFunction)py_netr_DsrGetDcSiteCoverageW_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
53933 : { NULL, NULL, 0, NULL }
53934 : };
53935 :
53936 :
53937 : static PyTypeObject netr_DsrGetDcSiteCoverageW_Type = {
53938 : PyVarObject_HEAD_INIT(NULL, 0)
53939 : .tp_name = "netlogon.netr_DsrGetDcSiteCoverageW",
53940 : .tp_getset = py_netr_DsrGetDcSiteCoverageW_getsetters,
53941 : .tp_methods = py_netr_DsrGetDcSiteCoverageW_methods,
53942 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
53943 : .tp_new = py_netr_DsrGetDcSiteCoverageW_new,
53944 : };
53945 :
53946 0 : static bool pack_py_netr_DsrGetDcSiteCoverageW_args_in(PyObject *args, PyObject *kwargs, struct netr_DsrGetDcSiteCoverageW *r)
53947 : {
53948 : PyObject *py_server_name;
53949 0 : const char *kwnames[] = {
53950 : "server_name", NULL
53951 : };
53952 :
53953 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:netr_DsrGetDcSiteCoverageW", discard_const_p(char *, kwnames), &py_server_name)) {
53954 0 : return false;
53955 : }
53956 :
53957 0 : if (py_server_name == NULL) {
53958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
53959 0 : return false;
53960 : }
53961 0 : if (py_server_name == Py_None) {
53962 0 : r->in.server_name = NULL;
53963 : } else {
53964 0 : r->in.server_name = NULL;
53965 : {
53966 : const char *test_str;
53967 : const char *talloc_str;
53968 0 : PyObject *unicode = NULL;
53969 0 : if (PyUnicode_Check(py_server_name)) {
53970 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
53971 0 : if (unicode == NULL) {
53972 0 : PyErr_NoMemory();
53973 0 : return false;
53974 : }
53975 0 : test_str = PyBytes_AS_STRING(unicode);
53976 0 : } else if (PyBytes_Check(py_server_name)) {
53977 0 : test_str = PyBytes_AS_STRING(py_server_name);
53978 : } else {
53979 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
53980 0 : return false;
53981 : }
53982 0 : talloc_str = talloc_strdup(r, test_str);
53983 0 : if (unicode != NULL) {
53984 0 : Py_DECREF(unicode);
53985 : }
53986 0 : if (talloc_str == NULL) {
53987 0 : PyErr_NoMemory();
53988 0 : return false;
53989 : }
53990 0 : r->in.server_name = talloc_str;
53991 : }
53992 : }
53993 0 : return true;
53994 : }
53995 :
53996 0 : static PyObject *unpack_py_netr_DsrGetDcSiteCoverageW_args_out(struct netr_DsrGetDcSiteCoverageW *r)
53997 : {
53998 : PyObject *result;
53999 : PyObject *py_ctr;
54000 0 : if (*r->out.ctr == NULL) {
54001 0 : py_ctr = Py_None;
54002 0 : Py_INCREF(py_ctr);
54003 : } else {
54004 0 : py_ctr = pytalloc_reference_ex(&DcSitesCtr_Type, *r->out.ctr, *r->out.ctr);
54005 : }
54006 0 : result = py_ctr;
54007 0 : if (!W_ERROR_IS_OK(r->out.result)) {
54008 0 : PyErr_SetWERROR(r->out.result);
54009 0 : return NULL;
54010 : }
54011 :
54012 0 : return result;
54013 : }
54014 :
54015 :
54016 0 : static PyObject *py_netr_LogonSamLogonEx_in_get_server_name(PyObject *obj, void *closure)
54017 : {
54018 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54019 : PyObject *py_server_name;
54020 0 : if (object->in.server_name == NULL) {
54021 0 : Py_RETURN_NONE;
54022 : }
54023 0 : if (object->in.server_name == NULL) {
54024 0 : py_server_name = Py_None;
54025 0 : Py_INCREF(py_server_name);
54026 : } else {
54027 0 : if (object->in.server_name == NULL) {
54028 0 : py_server_name = Py_None;
54029 0 : Py_INCREF(py_server_name);
54030 : } else {
54031 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
54032 : }
54033 : }
54034 0 : return py_server_name;
54035 : }
54036 :
54037 0 : static int py_netr_LogonSamLogonEx_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
54038 : {
54039 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54040 0 : if (value == NULL) {
54041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
54042 0 : return -1;
54043 : }
54044 0 : if (value == Py_None) {
54045 0 : object->in.server_name = NULL;
54046 : } else {
54047 0 : object->in.server_name = NULL;
54048 : {
54049 : const char *test_str;
54050 : const char *talloc_str;
54051 0 : PyObject *unicode = NULL;
54052 0 : if (PyUnicode_Check(value)) {
54053 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
54054 0 : if (unicode == NULL) {
54055 0 : PyErr_NoMemory();
54056 0 : return -1;
54057 : }
54058 0 : test_str = PyBytes_AS_STRING(unicode);
54059 0 : } else if (PyBytes_Check(value)) {
54060 0 : test_str = PyBytes_AS_STRING(value);
54061 : } else {
54062 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
54063 0 : return -1;
54064 : }
54065 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
54066 0 : if (unicode != NULL) {
54067 0 : Py_DECREF(unicode);
54068 : }
54069 0 : if (talloc_str == NULL) {
54070 0 : PyErr_NoMemory();
54071 0 : return -1;
54072 : }
54073 0 : object->in.server_name = talloc_str;
54074 : }
54075 : }
54076 0 : return 0;
54077 : }
54078 :
54079 0 : static PyObject *py_netr_LogonSamLogonEx_in_get_computer_name(PyObject *obj, void *closure)
54080 : {
54081 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54082 : PyObject *py_computer_name;
54083 0 : if (object->in.computer_name == NULL) {
54084 0 : Py_RETURN_NONE;
54085 : }
54086 0 : if (object->in.computer_name == NULL) {
54087 0 : py_computer_name = Py_None;
54088 0 : Py_INCREF(py_computer_name);
54089 : } else {
54090 0 : if (object->in.computer_name == NULL) {
54091 0 : py_computer_name = Py_None;
54092 0 : Py_INCREF(py_computer_name);
54093 : } else {
54094 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
54095 : }
54096 : }
54097 0 : return py_computer_name;
54098 : }
54099 :
54100 0 : static int py_netr_LogonSamLogonEx_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
54101 : {
54102 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54103 0 : if (value == NULL) {
54104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
54105 0 : return -1;
54106 : }
54107 0 : if (value == Py_None) {
54108 0 : object->in.computer_name = NULL;
54109 : } else {
54110 0 : object->in.computer_name = NULL;
54111 : {
54112 : const char *test_str;
54113 : const char *talloc_str;
54114 0 : PyObject *unicode = NULL;
54115 0 : if (PyUnicode_Check(value)) {
54116 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
54117 0 : if (unicode == NULL) {
54118 0 : PyErr_NoMemory();
54119 0 : return -1;
54120 : }
54121 0 : test_str = PyBytes_AS_STRING(unicode);
54122 0 : } else if (PyBytes_Check(value)) {
54123 0 : test_str = PyBytes_AS_STRING(value);
54124 : } else {
54125 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
54126 0 : return -1;
54127 : }
54128 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
54129 0 : if (unicode != NULL) {
54130 0 : Py_DECREF(unicode);
54131 : }
54132 0 : if (talloc_str == NULL) {
54133 0 : PyErr_NoMemory();
54134 0 : return -1;
54135 : }
54136 0 : object->in.computer_name = talloc_str;
54137 : }
54138 : }
54139 0 : return 0;
54140 : }
54141 :
54142 0 : static PyObject *py_netr_LogonSamLogonEx_in_get_logon_level(PyObject *obj, void *closure)
54143 : {
54144 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54145 : PyObject *py_logon_level;
54146 0 : py_logon_level = PyLong_FromLong((uint16_t)object->in.logon_level);
54147 0 : return py_logon_level;
54148 : }
54149 :
54150 0 : static int py_netr_LogonSamLogonEx_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure)
54151 : {
54152 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54153 0 : if (value == NULL) {
54154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_level");
54155 0 : return -1;
54156 : }
54157 : {
54158 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_level));
54159 0 : if (PyLong_Check(value)) {
54160 : unsigned long long test_var;
54161 0 : test_var = PyLong_AsUnsignedLongLong(value);
54162 0 : if (PyErr_Occurred() != NULL) {
54163 0 : return -1;
54164 : }
54165 0 : if (test_var > uint_max) {
54166 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
54167 : PyLong_Type.tp_name, uint_max, test_var);
54168 0 : return -1;
54169 : }
54170 0 : object->in.logon_level = test_var;
54171 : } else {
54172 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
54173 : PyLong_Type.tp_name);
54174 0 : return -1;
54175 : }
54176 : }
54177 0 : return 0;
54178 : }
54179 :
54180 0 : static PyObject *py_netr_LogonSamLogonEx_in_get_logon(PyObject *obj, void *closure)
54181 : {
54182 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54183 : PyObject *py_logon;
54184 0 : if (object->in.logon == NULL) {
54185 0 : Py_RETURN_NONE;
54186 : }
54187 0 : py_logon = pyrpc_import_union(&netr_LogonLevel_Type, object->in.logon, object->in.logon_level, object->in.logon, "union netr_LogonLevel");
54188 0 : if (py_logon == NULL) {
54189 0 : return NULL;
54190 : }
54191 0 : return py_logon;
54192 : }
54193 :
54194 0 : static int py_netr_LogonSamLogonEx_in_set_logon(PyObject *py_obj, PyObject *value, void *closure)
54195 : {
54196 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54197 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.logon));
54198 0 : if (value == NULL) {
54199 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon");
54200 0 : return -1;
54201 : }
54202 0 : object->in.logon = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon);
54203 0 : if (object->in.logon == NULL) {
54204 0 : PyErr_NoMemory();
54205 0 : return -1;
54206 : }
54207 : {
54208 : union netr_LogonLevel *logon_switch_1;
54209 0 : logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, pytalloc_get_mem_ctx(py_obj), object->in.logon_level, value, "union netr_LogonLevel");
54210 0 : if (logon_switch_1 == NULL) {
54211 0 : return -1;
54212 : }
54213 0 : object->in.logon = logon_switch_1;
54214 : }
54215 0 : return 0;
54216 : }
54217 :
54218 0 : static PyObject *py_netr_LogonSamLogonEx_in_get_validation_level(PyObject *obj, void *closure)
54219 : {
54220 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54221 : PyObject *py_validation_level;
54222 0 : py_validation_level = PyLong_FromLong((uint16_t)object->in.validation_level);
54223 0 : return py_validation_level;
54224 : }
54225 :
54226 0 : static int py_netr_LogonSamLogonEx_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure)
54227 : {
54228 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54229 0 : if (value == NULL) {
54230 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.validation_level");
54231 0 : return -1;
54232 : }
54233 : {
54234 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.validation_level));
54235 0 : if (PyLong_Check(value)) {
54236 : unsigned long long test_var;
54237 0 : test_var = PyLong_AsUnsignedLongLong(value);
54238 0 : if (PyErr_Occurred() != NULL) {
54239 0 : return -1;
54240 : }
54241 0 : if (test_var > uint_max) {
54242 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
54243 : PyLong_Type.tp_name, uint_max, test_var);
54244 0 : return -1;
54245 : }
54246 0 : object->in.validation_level = test_var;
54247 : } else {
54248 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
54249 : PyLong_Type.tp_name);
54250 0 : return -1;
54251 : }
54252 : }
54253 0 : return 0;
54254 : }
54255 :
54256 0 : static PyObject *py_netr_LogonSamLogonEx_out_get_validation(PyObject *obj, void *closure)
54257 : {
54258 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54259 : PyObject *py_validation;
54260 0 : if (object->out.validation == NULL) {
54261 0 : Py_RETURN_NONE;
54262 : }
54263 0 : py_validation = pyrpc_import_union(&netr_Validation_Type, object->out.validation, object->in.validation_level, object->out.validation, "union netr_Validation");
54264 0 : if (py_validation == NULL) {
54265 0 : return NULL;
54266 : }
54267 0 : return py_validation;
54268 : }
54269 :
54270 0 : static int py_netr_LogonSamLogonEx_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
54271 : {
54272 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54273 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation));
54274 0 : if (value == NULL) {
54275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation");
54276 0 : return -1;
54277 : }
54278 0 : object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation);
54279 0 : if (object->out.validation == NULL) {
54280 0 : PyErr_NoMemory();
54281 0 : return -1;
54282 : }
54283 : {
54284 : union netr_Validation *validation_switch_1;
54285 0 : validation_switch_1 = (union netr_Validation *)pyrpc_export_union(&netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->in.validation_level, value, "union netr_Validation");
54286 0 : if (validation_switch_1 == NULL) {
54287 0 : return -1;
54288 : }
54289 0 : object->out.validation = validation_switch_1;
54290 : }
54291 0 : return 0;
54292 : }
54293 :
54294 0 : static PyObject *py_netr_LogonSamLogonEx_out_get_authoritative(PyObject *obj, void *closure)
54295 : {
54296 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54297 : PyObject *py_authoritative;
54298 0 : if (object->out.authoritative == NULL) {
54299 0 : Py_RETURN_NONE;
54300 : }
54301 0 : py_authoritative = PyLong_FromLong((uint16_t)*object->out.authoritative);
54302 0 : return py_authoritative;
54303 : }
54304 :
54305 0 : static int py_netr_LogonSamLogonEx_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure)
54306 : {
54307 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54308 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authoritative));
54309 0 : if (value == NULL) {
54310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative");
54311 0 : return -1;
54312 : }
54313 0 : object->out.authoritative = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authoritative);
54314 0 : if (object->out.authoritative == NULL) {
54315 0 : PyErr_NoMemory();
54316 0 : return -1;
54317 : }
54318 : {
54319 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.authoritative));
54320 0 : if (PyLong_Check(value)) {
54321 : unsigned long long test_var;
54322 0 : test_var = PyLong_AsUnsignedLongLong(value);
54323 0 : if (PyErr_Occurred() != NULL) {
54324 0 : return -1;
54325 : }
54326 0 : if (test_var > uint_max) {
54327 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
54328 : PyLong_Type.tp_name, uint_max, test_var);
54329 0 : return -1;
54330 : }
54331 0 : *object->out.authoritative = test_var;
54332 : } else {
54333 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
54334 : PyLong_Type.tp_name);
54335 0 : return -1;
54336 : }
54337 : }
54338 0 : return 0;
54339 : }
54340 :
54341 0 : static PyObject *py_netr_LogonSamLogonEx_in_get_flags(PyObject *obj, void *closure)
54342 : {
54343 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54344 : PyObject *py_flags;
54345 0 : if (object->in.flags == NULL) {
54346 0 : Py_RETURN_NONE;
54347 : }
54348 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->in.flags);
54349 0 : return py_flags;
54350 : }
54351 :
54352 0 : static int py_netr_LogonSamLogonEx_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
54353 : {
54354 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54355 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.flags));
54356 0 : if (value == NULL) {
54357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
54358 0 : return -1;
54359 : }
54360 0 : object->in.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.flags);
54361 0 : if (object->in.flags == NULL) {
54362 0 : PyErr_NoMemory();
54363 0 : return -1;
54364 : }
54365 : {
54366 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.flags));
54367 0 : if (PyLong_Check(value)) {
54368 : unsigned long long test_var;
54369 0 : test_var = PyLong_AsUnsignedLongLong(value);
54370 0 : if (PyErr_Occurred() != NULL) {
54371 0 : return -1;
54372 : }
54373 0 : if (test_var > uint_max) {
54374 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
54375 : PyLong_Type.tp_name, uint_max, test_var);
54376 0 : return -1;
54377 : }
54378 0 : *object->in.flags = test_var;
54379 : } else {
54380 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
54381 : PyLong_Type.tp_name);
54382 0 : return -1;
54383 : }
54384 : }
54385 0 : return 0;
54386 : }
54387 :
54388 0 : static PyObject *py_netr_LogonSamLogonEx_out_get_flags(PyObject *obj, void *closure)
54389 : {
54390 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54391 : PyObject *py_flags;
54392 0 : if (object->out.flags == NULL) {
54393 0 : Py_RETURN_NONE;
54394 : }
54395 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.flags);
54396 0 : return py_flags;
54397 : }
54398 :
54399 0 : static int py_netr_LogonSamLogonEx_out_set_flags(PyObject *py_obj, PyObject *value, void *closure)
54400 : {
54401 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54402 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.flags));
54403 0 : if (value == NULL) {
54404 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.flags");
54405 0 : return -1;
54406 : }
54407 0 : object->out.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.flags);
54408 0 : if (object->out.flags == NULL) {
54409 0 : PyErr_NoMemory();
54410 0 : return -1;
54411 : }
54412 : {
54413 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.flags));
54414 0 : if (PyLong_Check(value)) {
54415 : unsigned long long test_var;
54416 0 : test_var = PyLong_AsUnsignedLongLong(value);
54417 0 : if (PyErr_Occurred() != NULL) {
54418 0 : return -1;
54419 : }
54420 0 : if (test_var > uint_max) {
54421 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
54422 : PyLong_Type.tp_name, uint_max, test_var);
54423 0 : return -1;
54424 : }
54425 0 : *object->out.flags = test_var;
54426 : } else {
54427 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
54428 : PyLong_Type.tp_name);
54429 0 : return -1;
54430 : }
54431 : }
54432 0 : return 0;
54433 : }
54434 :
54435 0 : static PyObject *py_netr_LogonSamLogonEx_get_result(PyObject *obj, void *closure)
54436 : {
54437 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(obj);
54438 : PyObject *py_result;
54439 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
54440 0 : return py_result;
54441 : }
54442 :
54443 0 : static int py_netr_LogonSamLogonEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
54444 : {
54445 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54446 0 : if (value == NULL) {
54447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
54448 0 : return -1;
54449 : }
54450 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
54451 0 : return 0;
54452 : }
54453 :
54454 : static PyGetSetDef py_netr_LogonSamLogonEx_getsetters[] = {
54455 : {
54456 : .name = discard_const_p(char, "in_server_name"),
54457 : .get = py_netr_LogonSamLogonEx_in_get_server_name,
54458 : .set = py_netr_LogonSamLogonEx_in_set_server_name,
54459 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
54460 : },
54461 : {
54462 : .name = discard_const_p(char, "in_computer_name"),
54463 : .get = py_netr_LogonSamLogonEx_in_get_computer_name,
54464 : .set = py_netr_LogonSamLogonEx_in_set_computer_name,
54465 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
54466 : },
54467 : {
54468 : .name = discard_const_p(char, "in_logon_level"),
54469 : .get = py_netr_LogonSamLogonEx_in_get_logon_level,
54470 : .set = py_netr_LogonSamLogonEx_in_set_logon_level,
54471 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonInfoClass")
54472 : },
54473 : {
54474 : .name = discard_const_p(char, "in_logon"),
54475 : .get = py_netr_LogonSamLogonEx_in_get_logon,
54476 : .set = py_netr_LogonSamLogonEx_in_set_logon,
54477 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonLevel")
54478 : },
54479 : {
54480 : .name = discard_const_p(char, "in_validation_level"),
54481 : .get = py_netr_LogonSamLogonEx_in_get_validation_level,
54482 : .set = py_netr_LogonSamLogonEx_in_set_validation_level,
54483 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
54484 : },
54485 : {
54486 : .name = discard_const_p(char, "out_validation"),
54487 : .get = py_netr_LogonSamLogonEx_out_get_validation,
54488 : .set = py_netr_LogonSamLogonEx_out_set_validation,
54489 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
54490 : },
54491 : {
54492 : .name = discard_const_p(char, "out_authoritative"),
54493 : .get = py_netr_LogonSamLogonEx_out_get_authoritative,
54494 : .set = py_netr_LogonSamLogonEx_out_set_authoritative,
54495 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
54496 : },
54497 : {
54498 : .name = discard_const_p(char, "in_flags"),
54499 : .get = py_netr_LogonSamLogonEx_in_get_flags,
54500 : .set = py_netr_LogonSamLogonEx_in_set_flags,
54501 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonSamLogon_flags")
54502 : },
54503 : {
54504 : .name = discard_const_p(char, "out_flags"),
54505 : .get = py_netr_LogonSamLogonEx_out_get_flags,
54506 : .set = py_netr_LogonSamLogonEx_out_set_flags,
54507 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonSamLogon_flags")
54508 : },
54509 : {
54510 : .name = discard_const_p(char, "result"),
54511 : .get = py_netr_LogonSamLogonEx_get_result,
54512 : .set = py_netr_LogonSamLogonEx_set_result,
54513 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
54514 : },
54515 : { .name = NULL }
54516 : };
54517 :
54518 0 : static PyObject *py_netr_LogonSamLogonEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
54519 : {
54520 0 : PyObject *self = pytalloc_new(struct netr_LogonSamLogonEx, type);
54521 0 : struct netr_LogonSamLogonEx *_self = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(self);
54522 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
54523 0 : _self->in.logon = talloc_zero(mem_ctx, union netr_LogonLevel);
54524 0 : _self->out.validation = talloc_zero(mem_ctx, union netr_Validation);
54525 0 : _self->out.authoritative = talloc_zero(mem_ctx, uint8_t);
54526 0 : _self->in.flags = talloc_zero(mem_ctx, uint32_t);
54527 0 : _self->out.flags = talloc_zero(mem_ctx, uint32_t);
54528 0 : return self;
54529 : }
54530 :
54531 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
54532 : {
54533 :
54534 :
54535 0 : return PyLong_FromLong(39);
54536 : }
54537 :
54538 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
54539 : {
54540 0 : const struct ndr_interface_call *call = NULL;
54541 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54542 0 : PyObject *ret = NULL;
54543 0 : struct ndr_push *push = NULL;
54544 : DATA_BLOB blob;
54545 : enum ndr_err_code err;
54546 :
54547 0 : if (ndr_table_netlogon.num_calls < 40) {
54548 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonEx_ndr_pack");
54549 0 : return NULL;
54550 : }
54551 0 : call = &ndr_table_netlogon.calls[39];
54552 :
54553 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
54554 0 : if (push == NULL) {
54555 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
54556 0 : return NULL;
54557 : }
54558 :
54559 0 : push->flags |= ndr_push_flags;
54560 :
54561 0 : err = call->ndr_push(push, ndr_inout_flags, object);
54562 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
54563 0 : TALLOC_FREE(push);
54564 0 : PyErr_SetNdrError(err);
54565 0 : return NULL;
54566 : }
54567 0 : blob = ndr_push_blob(push);
54568 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
54569 0 : TALLOC_FREE(push);
54570 0 : return ret;
54571 : }
54572 :
54573 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
54574 : {
54575 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
54576 0 : PyObject *bigendian_obj = NULL;
54577 0 : PyObject *ndr64_obj = NULL;
54578 0 : uint32_t ndr_push_flags = 0;
54579 :
54580 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
54581 : discard_const_p(char *, kwnames),
54582 : &bigendian_obj,
54583 : &ndr64_obj)) {
54584 0 : return NULL;
54585 : }
54586 :
54587 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
54588 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
54589 : }
54590 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
54591 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
54592 : }
54593 :
54594 0 : return py_netr_LogonSamLogonEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
54595 : }
54596 :
54597 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
54598 : {
54599 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
54600 0 : PyObject *bigendian_obj = NULL;
54601 0 : PyObject *ndr64_obj = NULL;
54602 0 : uint32_t ndr_push_flags = 0;
54603 :
54604 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
54605 : discard_const_p(char *, kwnames),
54606 : &bigendian_obj,
54607 : &ndr64_obj)) {
54608 0 : return NULL;
54609 : }
54610 :
54611 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
54612 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
54613 : }
54614 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
54615 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
54616 : }
54617 :
54618 0 : return py_netr_LogonSamLogonEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
54619 : }
54620 :
54621 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
54622 : {
54623 0 : const struct ndr_interface_call *call = NULL;
54624 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54625 0 : struct ndr_pull *pull = NULL;
54626 : enum ndr_err_code err;
54627 :
54628 0 : if (ndr_table_netlogon.num_calls < 40) {
54629 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonEx_ndr_unpack");
54630 0 : return NULL;
54631 : }
54632 0 : call = &ndr_table_netlogon.calls[39];
54633 :
54634 0 : pull = ndr_pull_init_blob(blob, object);
54635 0 : if (pull == NULL) {
54636 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
54637 0 : return NULL;
54638 : }
54639 :
54640 0 : pull->flags |= ndr_pull_flags;
54641 :
54642 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
54643 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
54644 0 : TALLOC_FREE(pull);
54645 0 : PyErr_SetNdrError(err);
54646 0 : return NULL;
54647 : }
54648 0 : if (!allow_remaining) {
54649 : uint32_t highest_ofs;
54650 :
54651 0 : if (pull->offset > pull->relative_highest_offset) {
54652 0 : highest_ofs = pull->offset;
54653 : } else {
54654 0 : highest_ofs = pull->relative_highest_offset;
54655 : }
54656 0 : if (highest_ofs < pull->data_size) {
54657 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
54658 : "not all bytes consumed ofs[%u] size[%u]",
54659 : highest_ofs, pull->data_size);
54660 0 : TALLOC_FREE(pull);
54661 0 : PyErr_SetNdrError(err);
54662 0 : return NULL;
54663 : }
54664 : }
54665 :
54666 0 : TALLOC_FREE(pull);
54667 0 : Py_RETURN_NONE;
54668 : }
54669 :
54670 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
54671 : {
54672 : DATA_BLOB blob;
54673 0 : Py_ssize_t blob_length = 0;
54674 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
54675 0 : PyObject *bigendian_obj = NULL;
54676 0 : PyObject *ndr64_obj = NULL;
54677 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
54678 0 : PyObject *allow_remaining_obj = NULL;
54679 0 : bool allow_remaining = false;
54680 :
54681 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
54682 : discard_const_p(char *, kwnames),
54683 : &blob.data, &blob_length,
54684 : &bigendian_obj,
54685 : &ndr64_obj,
54686 : &allow_remaining_obj)) {
54687 0 : return NULL;
54688 : }
54689 0 : blob.length = blob_length;
54690 :
54691 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
54692 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
54693 : }
54694 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
54695 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
54696 : }
54697 :
54698 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
54699 0 : allow_remaining = true;
54700 : }
54701 :
54702 0 : return py_netr_LogonSamLogonEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
54703 : }
54704 :
54705 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
54706 : {
54707 : DATA_BLOB blob;
54708 0 : Py_ssize_t blob_length = 0;
54709 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
54710 0 : PyObject *bigendian_obj = NULL;
54711 0 : PyObject *ndr64_obj = NULL;
54712 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
54713 0 : PyObject *allow_remaining_obj = NULL;
54714 0 : bool allow_remaining = false;
54715 :
54716 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
54717 : discard_const_p(char *, kwnames),
54718 : &blob.data, &blob_length,
54719 : &bigendian_obj,
54720 : &ndr64_obj,
54721 : &allow_remaining_obj)) {
54722 0 : return NULL;
54723 : }
54724 0 : blob.length = blob_length;
54725 :
54726 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
54727 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
54728 : }
54729 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
54730 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
54731 : }
54732 :
54733 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
54734 0 : allow_remaining = true;
54735 : }
54736 :
54737 0 : return py_netr_LogonSamLogonEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
54738 : }
54739 :
54740 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
54741 : {
54742 0 : const struct ndr_interface_call *call = NULL;
54743 0 : struct netr_LogonSamLogonEx *object = (struct netr_LogonSamLogonEx *)pytalloc_get_ptr(py_obj);
54744 : PyObject *ret;
54745 : char *retstr;
54746 :
54747 0 : if (ndr_table_netlogon.num_calls < 40) {
54748 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonEx_ndr_print");
54749 0 : return NULL;
54750 : }
54751 0 : call = &ndr_table_netlogon.calls[39];
54752 :
54753 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
54754 0 : ret = PyUnicode_FromString(retstr);
54755 0 : TALLOC_FREE(retstr);
54756 :
54757 0 : return ret;
54758 : }
54759 :
54760 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
54761 : {
54762 0 : return py_netr_LogonSamLogonEx_ndr_print(py_obj, "netr_LogonSamLogonEx_in", NDR_IN);
54763 : }
54764 :
54765 0 : static PyObject *py_netr_LogonSamLogonEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
54766 : {
54767 0 : return py_netr_LogonSamLogonEx_ndr_print(py_obj, "netr_LogonSamLogonEx_out", NDR_OUT);
54768 : }
54769 :
54770 : static PyMethodDef py_netr_LogonSamLogonEx_methods[] = {
54771 : { "opnum", (PyCFunction)py_netr_LogonSamLogonEx_ndr_opnum, METH_NOARGS|METH_CLASS,
54772 : "netlogon.netr_LogonSamLogonEx.opnum() -> 39 (0x27) " },
54773 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
54774 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
54775 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
54776 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
54777 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
54778 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
54779 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
54780 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
54781 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonSamLogonEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
54782 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonSamLogonEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
54783 : { NULL, NULL, 0, NULL }
54784 : };
54785 :
54786 :
54787 : static PyTypeObject netr_LogonSamLogonEx_Type = {
54788 : PyVarObject_HEAD_INIT(NULL, 0)
54789 : .tp_name = "netlogon.netr_LogonSamLogonEx",
54790 : .tp_getset = py_netr_LogonSamLogonEx_getsetters,
54791 : .tp_methods = py_netr_LogonSamLogonEx_methods,
54792 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
54793 : .tp_new = py_netr_LogonSamLogonEx_new,
54794 : };
54795 :
54796 14 : static bool pack_py_netr_LogonSamLogonEx_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonSamLogonEx *r)
54797 : {
54798 : PyObject *py_server_name;
54799 : PyObject *py_computer_name;
54800 : PyObject *py_logon_level;
54801 : PyObject *py_logon;
54802 : PyObject *py_validation_level;
54803 : PyObject *py_flags;
54804 14 : const char *kwnames[] = {
54805 : "server_name", "computer_name", "logon_level", "logon", "validation_level", "flags", NULL
54806 : };
54807 :
54808 14 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_LogonSamLogonEx", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_logon_level, &py_logon, &py_validation_level, &py_flags)) {
54809 0 : return false;
54810 : }
54811 :
54812 14 : if (py_server_name == NULL) {
54813 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
54814 0 : return false;
54815 : }
54816 14 : if (py_server_name == Py_None) {
54817 0 : r->in.server_name = NULL;
54818 : } else {
54819 14 : r->in.server_name = NULL;
54820 : {
54821 : const char *test_str;
54822 : const char *talloc_str;
54823 14 : PyObject *unicode = NULL;
54824 14 : if (PyUnicode_Check(py_server_name)) {
54825 14 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
54826 14 : if (unicode == NULL) {
54827 0 : PyErr_NoMemory();
54828 0 : return false;
54829 : }
54830 14 : test_str = PyBytes_AS_STRING(unicode);
54831 0 : } else if (PyBytes_Check(py_server_name)) {
54832 0 : test_str = PyBytes_AS_STRING(py_server_name);
54833 : } else {
54834 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
54835 0 : return false;
54836 : }
54837 14 : talloc_str = talloc_strdup(r, test_str);
54838 14 : if (unicode != NULL) {
54839 14 : Py_DECREF(unicode);
54840 : }
54841 14 : if (talloc_str == NULL) {
54842 0 : PyErr_NoMemory();
54843 0 : return false;
54844 : }
54845 14 : r->in.server_name = talloc_str;
54846 : }
54847 : }
54848 14 : if (py_computer_name == NULL) {
54849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
54850 0 : return false;
54851 : }
54852 14 : if (py_computer_name == Py_None) {
54853 0 : r->in.computer_name = NULL;
54854 : } else {
54855 14 : r->in.computer_name = NULL;
54856 : {
54857 : const char *test_str;
54858 : const char *talloc_str;
54859 14 : PyObject *unicode = NULL;
54860 14 : if (PyUnicode_Check(py_computer_name)) {
54861 14 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
54862 14 : if (unicode == NULL) {
54863 0 : PyErr_NoMemory();
54864 0 : return false;
54865 : }
54866 14 : test_str = PyBytes_AS_STRING(unicode);
54867 0 : } else if (PyBytes_Check(py_computer_name)) {
54868 0 : test_str = PyBytes_AS_STRING(py_computer_name);
54869 : } else {
54870 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
54871 0 : return false;
54872 : }
54873 14 : talloc_str = talloc_strdup(r, test_str);
54874 14 : if (unicode != NULL) {
54875 14 : Py_DECREF(unicode);
54876 : }
54877 14 : if (talloc_str == NULL) {
54878 0 : PyErr_NoMemory();
54879 0 : return false;
54880 : }
54881 14 : r->in.computer_name = talloc_str;
54882 : }
54883 : }
54884 14 : if (py_logon_level == NULL) {
54885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_level");
54886 0 : return false;
54887 : }
54888 : {
54889 14 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_level));
54890 14 : if (PyLong_Check(py_logon_level)) {
54891 : unsigned long long test_var;
54892 14 : test_var = PyLong_AsUnsignedLongLong(py_logon_level);
54893 14 : if (PyErr_Occurred() != NULL) {
54894 0 : return false;
54895 : }
54896 14 : if (test_var > uint_max) {
54897 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
54898 : PyLong_Type.tp_name, uint_max, test_var);
54899 0 : return false;
54900 : }
54901 14 : r->in.logon_level = test_var;
54902 : } else {
54903 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
54904 : PyLong_Type.tp_name);
54905 0 : return false;
54906 : }
54907 : }
54908 14 : if (py_logon == NULL) {
54909 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon");
54910 0 : return false;
54911 : }
54912 14 : r->in.logon = talloc_ptrtype(r, r->in.logon);
54913 14 : if (r->in.logon == NULL) {
54914 0 : PyErr_NoMemory();
54915 0 : return false;
54916 : }
54917 : {
54918 : union netr_LogonLevel *logon_switch_1;
54919 14 : logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel");
54920 14 : if (logon_switch_1 == NULL) {
54921 0 : return false;
54922 : }
54923 14 : r->in.logon = logon_switch_1;
54924 : }
54925 14 : if (py_validation_level == NULL) {
54926 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.validation_level");
54927 0 : return false;
54928 : }
54929 : {
54930 14 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.validation_level));
54931 14 : if (PyLong_Check(py_validation_level)) {
54932 : unsigned long long test_var;
54933 14 : test_var = PyLong_AsUnsignedLongLong(py_validation_level);
54934 14 : if (PyErr_Occurred() != NULL) {
54935 0 : return false;
54936 : }
54937 14 : if (test_var > uint_max) {
54938 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
54939 : PyLong_Type.tp_name, uint_max, test_var);
54940 0 : return false;
54941 : }
54942 14 : r->in.validation_level = test_var;
54943 : } else {
54944 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
54945 : PyLong_Type.tp_name);
54946 0 : return false;
54947 : }
54948 : }
54949 14 : if (py_flags == NULL) {
54950 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
54951 0 : return false;
54952 : }
54953 14 : r->in.flags = talloc_ptrtype(r, r->in.flags);
54954 14 : if (r->in.flags == NULL) {
54955 0 : PyErr_NoMemory();
54956 0 : return false;
54957 : }
54958 : {
54959 14 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.flags));
54960 14 : if (PyLong_Check(py_flags)) {
54961 : unsigned long long test_var;
54962 14 : test_var = PyLong_AsUnsignedLongLong(py_flags);
54963 14 : if (PyErr_Occurred() != NULL) {
54964 0 : return false;
54965 : }
54966 14 : if (test_var > uint_max) {
54967 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
54968 : PyLong_Type.tp_name, uint_max, test_var);
54969 0 : return false;
54970 : }
54971 14 : *r->in.flags = test_var;
54972 : } else {
54973 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
54974 : PyLong_Type.tp_name);
54975 0 : return false;
54976 : }
54977 : }
54978 14 : return true;
54979 : }
54980 :
54981 14 : static PyObject *unpack_py_netr_LogonSamLogonEx_args_out(struct netr_LogonSamLogonEx *r)
54982 : {
54983 : PyObject *result;
54984 : PyObject *py_validation;
54985 : PyObject *py_authoritative;
54986 : PyObject *py_flags;
54987 14 : result = PyTuple_New(3);
54988 14 : py_validation = pyrpc_import_union(&netr_Validation_Type, r->out.validation, r->in.validation_level, r->out.validation, "union netr_Validation");
54989 14 : if (py_validation == NULL) {
54990 0 : return NULL;
54991 : }
54992 14 : PyTuple_SetItem(result, 0, py_validation);
54993 14 : py_authoritative = PyLong_FromLong((uint16_t)*r->out.authoritative);
54994 14 : PyTuple_SetItem(result, 1, py_authoritative);
54995 14 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.flags);
54996 14 : PyTuple_SetItem(result, 2, py_flags);
54997 14 : if (NT_STATUS_IS_ERR(r->out.result)) {
54998 3 : PyErr_SetNTSTATUS(r->out.result);
54999 3 : return NULL;
55000 : }
55001 :
55002 11 : return result;
55003 : }
55004 :
55005 :
55006 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_in_get_server_name(PyObject *obj, void *closure)
55007 : {
55008 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(obj);
55009 : PyObject *py_server_name;
55010 0 : if (object->in.server_name == NULL) {
55011 0 : Py_RETURN_NONE;
55012 : }
55013 0 : if (object->in.server_name == NULL) {
55014 0 : py_server_name = Py_None;
55015 0 : Py_INCREF(py_server_name);
55016 : } else {
55017 0 : if (object->in.server_name == NULL) {
55018 0 : py_server_name = Py_None;
55019 0 : Py_INCREF(py_server_name);
55020 : } else {
55021 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
55022 : }
55023 : }
55024 0 : return py_server_name;
55025 : }
55026 :
55027 0 : static int py_netr_DsrEnumerateDomainTrusts_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
55028 : {
55029 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj);
55030 0 : if (value == NULL) {
55031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
55032 0 : return -1;
55033 : }
55034 0 : if (value == Py_None) {
55035 0 : object->in.server_name = NULL;
55036 : } else {
55037 0 : object->in.server_name = NULL;
55038 : {
55039 : const char *test_str;
55040 : const char *talloc_str;
55041 0 : PyObject *unicode = NULL;
55042 0 : if (PyUnicode_Check(value)) {
55043 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
55044 0 : if (unicode == NULL) {
55045 0 : PyErr_NoMemory();
55046 0 : return -1;
55047 : }
55048 0 : test_str = PyBytes_AS_STRING(unicode);
55049 0 : } else if (PyBytes_Check(value)) {
55050 0 : test_str = PyBytes_AS_STRING(value);
55051 : } else {
55052 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
55053 0 : return -1;
55054 : }
55055 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
55056 0 : if (unicode != NULL) {
55057 0 : Py_DECREF(unicode);
55058 : }
55059 0 : if (talloc_str == NULL) {
55060 0 : PyErr_NoMemory();
55061 0 : return -1;
55062 : }
55063 0 : object->in.server_name = talloc_str;
55064 : }
55065 : }
55066 0 : return 0;
55067 : }
55068 :
55069 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_in_get_trust_flags(PyObject *obj, void *closure)
55070 : {
55071 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(obj);
55072 : PyObject *py_trust_flags;
55073 0 : py_trust_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.trust_flags);
55074 0 : return py_trust_flags;
55075 : }
55076 :
55077 0 : static int py_netr_DsrEnumerateDomainTrusts_in_set_trust_flags(PyObject *py_obj, PyObject *value, void *closure)
55078 : {
55079 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj);
55080 0 : if (value == NULL) {
55081 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trust_flags");
55082 0 : return -1;
55083 : }
55084 : {
55085 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.trust_flags));
55086 0 : if (PyLong_Check(value)) {
55087 : unsigned long long test_var;
55088 0 : test_var = PyLong_AsUnsignedLongLong(value);
55089 0 : if (PyErr_Occurred() != NULL) {
55090 0 : return -1;
55091 : }
55092 0 : if (test_var > uint_max) {
55093 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
55094 : PyLong_Type.tp_name, uint_max, test_var);
55095 0 : return -1;
55096 : }
55097 0 : object->in.trust_flags = test_var;
55098 : } else {
55099 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
55100 : PyLong_Type.tp_name);
55101 0 : return -1;
55102 : }
55103 : }
55104 0 : return 0;
55105 : }
55106 :
55107 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_out_get_trusts(PyObject *obj, void *closure)
55108 : {
55109 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(obj);
55110 : PyObject *py_trusts;
55111 0 : if (object->out.trusts == NULL) {
55112 0 : Py_RETURN_NONE;
55113 : }
55114 0 : py_trusts = pytalloc_reference_ex(&netr_DomainTrustList_Type, object->out.trusts, object->out.trusts);
55115 0 : return py_trusts;
55116 : }
55117 :
55118 0 : static int py_netr_DsrEnumerateDomainTrusts_out_set_trusts(PyObject *py_obj, PyObject *value, void *closure)
55119 : {
55120 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj);
55121 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trusts));
55122 0 : if (value == NULL) {
55123 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trusts");
55124 0 : return -1;
55125 : }
55126 0 : object->out.trusts = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trusts);
55127 0 : if (object->out.trusts == NULL) {
55128 0 : PyErr_NoMemory();
55129 0 : return -1;
55130 : }
55131 0 : PY_CHECK_TYPE(&netr_DomainTrustList_Type, value, return -1;);
55132 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
55133 0 : PyErr_NoMemory();
55134 0 : return -1;
55135 : }
55136 0 : object->out.trusts = (struct netr_DomainTrustList *)pytalloc_get_ptr(value);
55137 0 : return 0;
55138 : }
55139 :
55140 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_get_result(PyObject *obj, void *closure)
55141 : {
55142 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(obj);
55143 : PyObject *py_result;
55144 0 : py_result = PyErr_FromWERROR(object->out.result);
55145 0 : return py_result;
55146 : }
55147 :
55148 0 : static int py_netr_DsrEnumerateDomainTrusts_set_result(PyObject *py_obj, PyObject *value, void *closure)
55149 : {
55150 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj);
55151 0 : if (value == NULL) {
55152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
55153 0 : return -1;
55154 : }
55155 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
55156 0 : return 0;
55157 : }
55158 :
55159 : static PyGetSetDef py_netr_DsrEnumerateDomainTrusts_getsetters[] = {
55160 : {
55161 : .name = discard_const_p(char, "in_server_name"),
55162 : .get = py_netr_DsrEnumerateDomainTrusts_in_get_server_name,
55163 : .set = py_netr_DsrEnumerateDomainTrusts_in_set_server_name,
55164 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
55165 : },
55166 : {
55167 : .name = discard_const_p(char, "in_trust_flags"),
55168 : .get = py_netr_DsrEnumerateDomainTrusts_in_get_trust_flags,
55169 : .set = py_netr_DsrEnumerateDomainTrusts_in_set_trust_flags,
55170 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_TrustFlags")
55171 : },
55172 : {
55173 : .name = discard_const_p(char, "out_trusts"),
55174 : .get = py_netr_DsrEnumerateDomainTrusts_out_get_trusts,
55175 : .set = py_netr_DsrEnumerateDomainTrusts_out_set_trusts,
55176 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainTrustList")
55177 : },
55178 : {
55179 : .name = discard_const_p(char, "result"),
55180 : .get = py_netr_DsrEnumerateDomainTrusts_get_result,
55181 : .set = py_netr_DsrEnumerateDomainTrusts_set_result,
55182 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
55183 : },
55184 : { .name = NULL }
55185 : };
55186 :
55187 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
55188 : {
55189 0 : PyObject *self = pytalloc_new(struct netr_DsrEnumerateDomainTrusts, type);
55190 0 : struct netr_DsrEnumerateDomainTrusts *_self = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(self);
55191 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
55192 0 : _self->out.trusts = talloc_zero(mem_ctx, struct netr_DomainTrustList);
55193 0 : return self;
55194 : }
55195 :
55196 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
55197 : {
55198 :
55199 :
55200 0 : return PyLong_FromLong(40);
55201 : }
55202 :
55203 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
55204 : {
55205 0 : const struct ndr_interface_call *call = NULL;
55206 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj);
55207 0 : PyObject *ret = NULL;
55208 0 : struct ndr_push *push = NULL;
55209 : DATA_BLOB blob;
55210 : enum ndr_err_code err;
55211 :
55212 0 : if (ndr_table_netlogon.num_calls < 41) {
55213 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrEnumerateDomainTrusts_ndr_pack");
55214 0 : return NULL;
55215 : }
55216 0 : call = &ndr_table_netlogon.calls[40];
55217 :
55218 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
55219 0 : if (push == NULL) {
55220 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
55221 0 : return NULL;
55222 : }
55223 :
55224 0 : push->flags |= ndr_push_flags;
55225 :
55226 0 : err = call->ndr_push(push, ndr_inout_flags, object);
55227 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
55228 0 : TALLOC_FREE(push);
55229 0 : PyErr_SetNdrError(err);
55230 0 : return NULL;
55231 : }
55232 0 : blob = ndr_push_blob(push);
55233 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
55234 0 : TALLOC_FREE(push);
55235 0 : return ret;
55236 : }
55237 :
55238 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
55239 : {
55240 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
55241 0 : PyObject *bigendian_obj = NULL;
55242 0 : PyObject *ndr64_obj = NULL;
55243 0 : uint32_t ndr_push_flags = 0;
55244 :
55245 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
55246 : discard_const_p(char *, kwnames),
55247 : &bigendian_obj,
55248 : &ndr64_obj)) {
55249 0 : return NULL;
55250 : }
55251 :
55252 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
55253 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
55254 : }
55255 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
55256 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
55257 : }
55258 :
55259 0 : return py_netr_DsrEnumerateDomainTrusts_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
55260 : }
55261 :
55262 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
55263 : {
55264 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
55265 0 : PyObject *bigendian_obj = NULL;
55266 0 : PyObject *ndr64_obj = NULL;
55267 0 : uint32_t ndr_push_flags = 0;
55268 :
55269 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
55270 : discard_const_p(char *, kwnames),
55271 : &bigendian_obj,
55272 : &ndr64_obj)) {
55273 0 : return NULL;
55274 : }
55275 :
55276 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
55277 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
55278 : }
55279 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
55280 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
55281 : }
55282 :
55283 0 : return py_netr_DsrEnumerateDomainTrusts_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
55284 : }
55285 :
55286 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
55287 : {
55288 0 : const struct ndr_interface_call *call = NULL;
55289 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj);
55290 0 : struct ndr_pull *pull = NULL;
55291 : enum ndr_err_code err;
55292 :
55293 0 : if (ndr_table_netlogon.num_calls < 41) {
55294 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrEnumerateDomainTrusts_ndr_unpack");
55295 0 : return NULL;
55296 : }
55297 0 : call = &ndr_table_netlogon.calls[40];
55298 :
55299 0 : pull = ndr_pull_init_blob(blob, object);
55300 0 : if (pull == NULL) {
55301 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
55302 0 : return NULL;
55303 : }
55304 :
55305 0 : pull->flags |= ndr_pull_flags;
55306 :
55307 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
55308 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
55309 0 : TALLOC_FREE(pull);
55310 0 : PyErr_SetNdrError(err);
55311 0 : return NULL;
55312 : }
55313 0 : if (!allow_remaining) {
55314 : uint32_t highest_ofs;
55315 :
55316 0 : if (pull->offset > pull->relative_highest_offset) {
55317 0 : highest_ofs = pull->offset;
55318 : } else {
55319 0 : highest_ofs = pull->relative_highest_offset;
55320 : }
55321 0 : if (highest_ofs < pull->data_size) {
55322 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
55323 : "not all bytes consumed ofs[%u] size[%u]",
55324 : highest_ofs, pull->data_size);
55325 0 : TALLOC_FREE(pull);
55326 0 : PyErr_SetNdrError(err);
55327 0 : return NULL;
55328 : }
55329 : }
55330 :
55331 0 : TALLOC_FREE(pull);
55332 0 : Py_RETURN_NONE;
55333 : }
55334 :
55335 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
55336 : {
55337 : DATA_BLOB blob;
55338 0 : Py_ssize_t blob_length = 0;
55339 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
55340 0 : PyObject *bigendian_obj = NULL;
55341 0 : PyObject *ndr64_obj = NULL;
55342 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
55343 0 : PyObject *allow_remaining_obj = NULL;
55344 0 : bool allow_remaining = false;
55345 :
55346 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
55347 : discard_const_p(char *, kwnames),
55348 : &blob.data, &blob_length,
55349 : &bigendian_obj,
55350 : &ndr64_obj,
55351 : &allow_remaining_obj)) {
55352 0 : return NULL;
55353 : }
55354 0 : blob.length = blob_length;
55355 :
55356 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
55357 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
55358 : }
55359 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
55360 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
55361 : }
55362 :
55363 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
55364 0 : allow_remaining = true;
55365 : }
55366 :
55367 0 : return py_netr_DsrEnumerateDomainTrusts_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
55368 : }
55369 :
55370 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
55371 : {
55372 : DATA_BLOB blob;
55373 0 : Py_ssize_t blob_length = 0;
55374 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
55375 0 : PyObject *bigendian_obj = NULL;
55376 0 : PyObject *ndr64_obj = NULL;
55377 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
55378 0 : PyObject *allow_remaining_obj = NULL;
55379 0 : bool allow_remaining = false;
55380 :
55381 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
55382 : discard_const_p(char *, kwnames),
55383 : &blob.data, &blob_length,
55384 : &bigendian_obj,
55385 : &ndr64_obj,
55386 : &allow_remaining_obj)) {
55387 0 : return NULL;
55388 : }
55389 0 : blob.length = blob_length;
55390 :
55391 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
55392 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
55393 : }
55394 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
55395 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
55396 : }
55397 :
55398 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
55399 0 : allow_remaining = true;
55400 : }
55401 :
55402 0 : return py_netr_DsrEnumerateDomainTrusts_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
55403 : }
55404 :
55405 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
55406 : {
55407 0 : const struct ndr_interface_call *call = NULL;
55408 0 : struct netr_DsrEnumerateDomainTrusts *object = (struct netr_DsrEnumerateDomainTrusts *)pytalloc_get_ptr(py_obj);
55409 : PyObject *ret;
55410 : char *retstr;
55411 :
55412 0 : if (ndr_table_netlogon.num_calls < 41) {
55413 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrEnumerateDomainTrusts_ndr_print");
55414 0 : return NULL;
55415 : }
55416 0 : call = &ndr_table_netlogon.calls[40];
55417 :
55418 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
55419 0 : ret = PyUnicode_FromString(retstr);
55420 0 : TALLOC_FREE(retstr);
55421 :
55422 0 : return ret;
55423 : }
55424 :
55425 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
55426 : {
55427 0 : return py_netr_DsrEnumerateDomainTrusts_ndr_print(py_obj, "netr_DsrEnumerateDomainTrusts_in", NDR_IN);
55428 : }
55429 :
55430 0 : static PyObject *py_netr_DsrEnumerateDomainTrusts_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
55431 : {
55432 0 : return py_netr_DsrEnumerateDomainTrusts_ndr_print(py_obj, "netr_DsrEnumerateDomainTrusts_out", NDR_OUT);
55433 : }
55434 :
55435 : static PyMethodDef py_netr_DsrEnumerateDomainTrusts_methods[] = {
55436 : { "opnum", (PyCFunction)py_netr_DsrEnumerateDomainTrusts_ndr_opnum, METH_NOARGS|METH_CLASS,
55437 : "netlogon.netr_DsrEnumerateDomainTrusts.opnum() -> 40 (0x28) " },
55438 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrEnumerateDomainTrusts_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
55439 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
55440 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrEnumerateDomainTrusts_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
55441 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
55442 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrEnumerateDomainTrusts_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
55443 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
55444 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrEnumerateDomainTrusts_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
55445 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
55446 : { "__ndr_print_in__", (PyCFunction)py_netr_DsrEnumerateDomainTrusts_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
55447 : { "__ndr_print_out__", (PyCFunction)py_netr_DsrEnumerateDomainTrusts_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
55448 : { NULL, NULL, 0, NULL }
55449 : };
55450 :
55451 :
55452 : static PyTypeObject netr_DsrEnumerateDomainTrusts_Type = {
55453 : PyVarObject_HEAD_INIT(NULL, 0)
55454 : .tp_name = "netlogon.netr_DsrEnumerateDomainTrusts",
55455 : .tp_getset = py_netr_DsrEnumerateDomainTrusts_getsetters,
55456 : .tp_methods = py_netr_DsrEnumerateDomainTrusts_methods,
55457 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
55458 : .tp_new = py_netr_DsrEnumerateDomainTrusts_new,
55459 : };
55460 :
55461 19 : static bool pack_py_netr_DsrEnumerateDomainTrusts_args_in(PyObject *args, PyObject *kwargs, struct netr_DsrEnumerateDomainTrusts *r)
55462 : {
55463 : PyObject *py_server_name;
55464 : PyObject *py_trust_flags;
55465 19 : const char *kwnames[] = {
55466 : "server_name", "trust_flags", NULL
55467 : };
55468 :
55469 19 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:netr_DsrEnumerateDomainTrusts", discard_const_p(char *, kwnames), &py_server_name, &py_trust_flags)) {
55470 0 : return false;
55471 : }
55472 :
55473 19 : if (py_server_name == NULL) {
55474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
55475 0 : return false;
55476 : }
55477 19 : if (py_server_name == Py_None) {
55478 0 : r->in.server_name = NULL;
55479 : } else {
55480 19 : r->in.server_name = NULL;
55481 : {
55482 : const char *test_str;
55483 : const char *talloc_str;
55484 19 : PyObject *unicode = NULL;
55485 19 : if (PyUnicode_Check(py_server_name)) {
55486 19 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
55487 19 : if (unicode == NULL) {
55488 0 : PyErr_NoMemory();
55489 0 : return false;
55490 : }
55491 19 : test_str = PyBytes_AS_STRING(unicode);
55492 0 : } else if (PyBytes_Check(py_server_name)) {
55493 0 : test_str = PyBytes_AS_STRING(py_server_name);
55494 : } else {
55495 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
55496 0 : return false;
55497 : }
55498 19 : talloc_str = talloc_strdup(r, test_str);
55499 19 : if (unicode != NULL) {
55500 19 : Py_DECREF(unicode);
55501 : }
55502 19 : if (talloc_str == NULL) {
55503 0 : PyErr_NoMemory();
55504 0 : return false;
55505 : }
55506 19 : r->in.server_name = talloc_str;
55507 : }
55508 : }
55509 19 : if (py_trust_flags == NULL) {
55510 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trust_flags");
55511 0 : return false;
55512 : }
55513 : {
55514 19 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.trust_flags));
55515 19 : if (PyLong_Check(py_trust_flags)) {
55516 : unsigned long long test_var;
55517 19 : test_var = PyLong_AsUnsignedLongLong(py_trust_flags);
55518 19 : if (PyErr_Occurred() != NULL) {
55519 0 : return false;
55520 : }
55521 19 : if (test_var > uint_max) {
55522 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
55523 : PyLong_Type.tp_name, uint_max, test_var);
55524 0 : return false;
55525 : }
55526 19 : r->in.trust_flags = test_var;
55527 : } else {
55528 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
55529 : PyLong_Type.tp_name);
55530 0 : return false;
55531 : }
55532 : }
55533 19 : return true;
55534 : }
55535 :
55536 19 : static PyObject *unpack_py_netr_DsrEnumerateDomainTrusts_args_out(struct netr_DsrEnumerateDomainTrusts *r)
55537 : {
55538 : PyObject *result;
55539 : PyObject *py_trusts;
55540 19 : py_trusts = pytalloc_reference_ex(&netr_DomainTrustList_Type, r->out.trusts, r->out.trusts);
55541 19 : result = py_trusts;
55542 19 : if (!W_ERROR_IS_OK(r->out.result)) {
55543 0 : PyErr_SetWERROR(r->out.result);
55544 0 : return NULL;
55545 : }
55546 :
55547 19 : return result;
55548 : }
55549 :
55550 :
55551 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_server_name(PyObject *obj, void *closure)
55552 : {
55553 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj);
55554 : PyObject *py_server_name;
55555 0 : if (object->in.server_name == NULL) {
55556 0 : Py_RETURN_NONE;
55557 : }
55558 0 : if (object->in.server_name == NULL) {
55559 0 : py_server_name = Py_None;
55560 0 : Py_INCREF(py_server_name);
55561 : } else {
55562 0 : if (object->in.server_name == NULL) {
55563 0 : py_server_name = Py_None;
55564 0 : Py_INCREF(py_server_name);
55565 : } else {
55566 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
55567 : }
55568 : }
55569 0 : return py_server_name;
55570 : }
55571 :
55572 0 : static int py_netr_DsrDeregisterDNSHostRecords_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
55573 : {
55574 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
55575 0 : if (value == NULL) {
55576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
55577 0 : return -1;
55578 : }
55579 0 : if (value == Py_None) {
55580 0 : object->in.server_name = NULL;
55581 : } else {
55582 0 : object->in.server_name = NULL;
55583 : {
55584 : const char *test_str;
55585 : const char *talloc_str;
55586 0 : PyObject *unicode = NULL;
55587 0 : if (PyUnicode_Check(value)) {
55588 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
55589 0 : if (unicode == NULL) {
55590 0 : PyErr_NoMemory();
55591 0 : return -1;
55592 : }
55593 0 : test_str = PyBytes_AS_STRING(unicode);
55594 0 : } else if (PyBytes_Check(value)) {
55595 0 : test_str = PyBytes_AS_STRING(value);
55596 : } else {
55597 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
55598 0 : return -1;
55599 : }
55600 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
55601 0 : if (unicode != NULL) {
55602 0 : Py_DECREF(unicode);
55603 : }
55604 0 : if (talloc_str == NULL) {
55605 0 : PyErr_NoMemory();
55606 0 : return -1;
55607 : }
55608 0 : object->in.server_name = talloc_str;
55609 : }
55610 : }
55611 0 : return 0;
55612 : }
55613 :
55614 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_domain(PyObject *obj, void *closure)
55615 : {
55616 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj);
55617 : PyObject *py_domain;
55618 0 : if (object->in.domain == NULL) {
55619 0 : Py_RETURN_NONE;
55620 : }
55621 0 : if (object->in.domain == NULL) {
55622 0 : py_domain = Py_None;
55623 0 : Py_INCREF(py_domain);
55624 : } else {
55625 0 : if (object->in.domain == NULL) {
55626 0 : py_domain = Py_None;
55627 0 : Py_INCREF(py_domain);
55628 : } else {
55629 0 : py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore");
55630 : }
55631 : }
55632 0 : return py_domain;
55633 : }
55634 :
55635 0 : static int py_netr_DsrDeregisterDNSHostRecords_in_set_domain(PyObject *py_obj, PyObject *value, void *closure)
55636 : {
55637 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
55638 0 : if (value == NULL) {
55639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain");
55640 0 : return -1;
55641 : }
55642 0 : if (value == Py_None) {
55643 0 : object->in.domain = NULL;
55644 : } else {
55645 0 : object->in.domain = NULL;
55646 : {
55647 : const char *test_str;
55648 : const char *talloc_str;
55649 0 : PyObject *unicode = NULL;
55650 0 : if (PyUnicode_Check(value)) {
55651 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
55652 0 : if (unicode == NULL) {
55653 0 : PyErr_NoMemory();
55654 0 : return -1;
55655 : }
55656 0 : test_str = PyBytes_AS_STRING(unicode);
55657 0 : } else if (PyBytes_Check(value)) {
55658 0 : test_str = PyBytes_AS_STRING(value);
55659 : } else {
55660 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
55661 0 : return -1;
55662 : }
55663 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
55664 0 : if (unicode != NULL) {
55665 0 : Py_DECREF(unicode);
55666 : }
55667 0 : if (talloc_str == NULL) {
55668 0 : PyErr_NoMemory();
55669 0 : return -1;
55670 : }
55671 0 : object->in.domain = talloc_str;
55672 : }
55673 : }
55674 0 : return 0;
55675 : }
55676 :
55677 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_domain_guid(PyObject *obj, void *closure)
55678 : {
55679 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj);
55680 : PyObject *py_domain_guid;
55681 0 : if (object->in.domain_guid == NULL) {
55682 0 : Py_RETURN_NONE;
55683 : }
55684 0 : if (object->in.domain_guid == NULL) {
55685 0 : py_domain_guid = Py_None;
55686 0 : Py_INCREF(py_domain_guid);
55687 : } else {
55688 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, object->in.domain_guid, object->in.domain_guid);
55689 : }
55690 0 : return py_domain_guid;
55691 : }
55692 :
55693 0 : static int py_netr_DsrDeregisterDNSHostRecords_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
55694 : {
55695 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
55696 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_guid));
55697 0 : if (value == NULL) {
55698 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_guid");
55699 0 : return -1;
55700 : }
55701 0 : if (value == Py_None) {
55702 0 : object->in.domain_guid = NULL;
55703 : } else {
55704 0 : object->in.domain_guid = NULL;
55705 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
55706 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
55707 0 : PyErr_NoMemory();
55708 0 : return -1;
55709 : }
55710 0 : object->in.domain_guid = (struct GUID *)pytalloc_get_ptr(value);
55711 : }
55712 0 : return 0;
55713 : }
55714 :
55715 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_dsa_guid(PyObject *obj, void *closure)
55716 : {
55717 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj);
55718 : PyObject *py_dsa_guid;
55719 0 : if (object->in.dsa_guid == NULL) {
55720 0 : Py_RETURN_NONE;
55721 : }
55722 0 : if (object->in.dsa_guid == NULL) {
55723 0 : py_dsa_guid = Py_None;
55724 0 : Py_INCREF(py_dsa_guid);
55725 : } else {
55726 0 : py_dsa_guid = pytalloc_reference_ex(GUID_Type, object->in.dsa_guid, object->in.dsa_guid);
55727 : }
55728 0 : return py_dsa_guid;
55729 : }
55730 :
55731 0 : static int py_netr_DsrDeregisterDNSHostRecords_in_set_dsa_guid(PyObject *py_obj, PyObject *value, void *closure)
55732 : {
55733 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
55734 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dsa_guid));
55735 0 : if (value == NULL) {
55736 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dsa_guid");
55737 0 : return -1;
55738 : }
55739 0 : if (value == Py_None) {
55740 0 : object->in.dsa_guid = NULL;
55741 : } else {
55742 0 : object->in.dsa_guid = NULL;
55743 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
55744 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
55745 0 : PyErr_NoMemory();
55746 0 : return -1;
55747 : }
55748 0 : object->in.dsa_guid = (struct GUID *)pytalloc_get_ptr(value);
55749 : }
55750 0 : return 0;
55751 : }
55752 :
55753 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_in_get_dns_host(PyObject *obj, void *closure)
55754 : {
55755 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj);
55756 : PyObject *py_dns_host;
55757 0 : if (object->in.dns_host == NULL) {
55758 0 : Py_RETURN_NONE;
55759 : }
55760 0 : if (object->in.dns_host == NULL) {
55761 0 : py_dns_host = Py_None;
55762 0 : Py_INCREF(py_dns_host);
55763 : } else {
55764 0 : py_dns_host = PyUnicode_Decode(object->in.dns_host, strlen(object->in.dns_host), "utf-8", "ignore");
55765 : }
55766 0 : return py_dns_host;
55767 : }
55768 :
55769 0 : static int py_netr_DsrDeregisterDNSHostRecords_in_set_dns_host(PyObject *py_obj, PyObject *value, void *closure)
55770 : {
55771 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
55772 0 : if (value == NULL) {
55773 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dns_host");
55774 0 : return -1;
55775 : }
55776 0 : object->in.dns_host = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dns_host);
55777 0 : if (object->in.dns_host == NULL) {
55778 0 : PyErr_NoMemory();
55779 0 : return -1;
55780 : }
55781 : {
55782 : const char *test_str;
55783 : const char *talloc_str;
55784 0 : PyObject *unicode = NULL;
55785 0 : if (PyUnicode_Check(value)) {
55786 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
55787 0 : if (unicode == NULL) {
55788 0 : PyErr_NoMemory();
55789 0 : return -1;
55790 : }
55791 0 : test_str = PyBytes_AS_STRING(unicode);
55792 0 : } else if (PyBytes_Check(value)) {
55793 0 : test_str = PyBytes_AS_STRING(value);
55794 : } else {
55795 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
55796 0 : return -1;
55797 : }
55798 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
55799 0 : if (unicode != NULL) {
55800 0 : Py_DECREF(unicode);
55801 : }
55802 0 : if (talloc_str == NULL) {
55803 0 : PyErr_NoMemory();
55804 0 : return -1;
55805 : }
55806 0 : object->in.dns_host = talloc_str;
55807 : }
55808 0 : return 0;
55809 : }
55810 :
55811 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_get_result(PyObject *obj, void *closure)
55812 : {
55813 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(obj);
55814 : PyObject *py_result;
55815 0 : py_result = PyErr_FromWERROR(object->out.result);
55816 0 : return py_result;
55817 : }
55818 :
55819 0 : static int py_netr_DsrDeregisterDNSHostRecords_set_result(PyObject *py_obj, PyObject *value, void *closure)
55820 : {
55821 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
55822 0 : if (value == NULL) {
55823 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
55824 0 : return -1;
55825 : }
55826 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
55827 0 : return 0;
55828 : }
55829 :
55830 : static PyGetSetDef py_netr_DsrDeregisterDNSHostRecords_getsetters[] = {
55831 : {
55832 : .name = discard_const_p(char, "in_server_name"),
55833 : .get = py_netr_DsrDeregisterDNSHostRecords_in_get_server_name,
55834 : .set = py_netr_DsrDeregisterDNSHostRecords_in_set_server_name,
55835 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
55836 : },
55837 : {
55838 : .name = discard_const_p(char, "in_domain"),
55839 : .get = py_netr_DsrDeregisterDNSHostRecords_in_get_domain,
55840 : .set = py_netr_DsrDeregisterDNSHostRecords_in_set_domain,
55841 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
55842 : },
55843 : {
55844 : .name = discard_const_p(char, "in_domain_guid"),
55845 : .get = py_netr_DsrDeregisterDNSHostRecords_in_get_domain_guid,
55846 : .set = py_netr_DsrDeregisterDNSHostRecords_in_set_domain_guid,
55847 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
55848 : },
55849 : {
55850 : .name = discard_const_p(char, "in_dsa_guid"),
55851 : .get = py_netr_DsrDeregisterDNSHostRecords_in_get_dsa_guid,
55852 : .set = py_netr_DsrDeregisterDNSHostRecords_in_set_dsa_guid,
55853 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
55854 : },
55855 : {
55856 : .name = discard_const_p(char, "in_dns_host"),
55857 : .get = py_netr_DsrDeregisterDNSHostRecords_in_get_dns_host,
55858 : .set = py_netr_DsrDeregisterDNSHostRecords_in_set_dns_host,
55859 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
55860 : },
55861 : {
55862 : .name = discard_const_p(char, "result"),
55863 : .get = py_netr_DsrDeregisterDNSHostRecords_get_result,
55864 : .set = py_netr_DsrDeregisterDNSHostRecords_set_result,
55865 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
55866 : },
55867 : { .name = NULL }
55868 : };
55869 :
55870 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
55871 : {
55872 0 : PyObject *self = pytalloc_new(struct netr_DsrDeregisterDNSHostRecords, type);
55873 0 : return self;
55874 : }
55875 :
55876 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
55877 : {
55878 :
55879 :
55880 0 : return PyLong_FromLong(41);
55881 : }
55882 :
55883 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
55884 : {
55885 0 : const struct ndr_interface_call *call = NULL;
55886 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
55887 0 : PyObject *ret = NULL;
55888 0 : struct ndr_push *push = NULL;
55889 : DATA_BLOB blob;
55890 : enum ndr_err_code err;
55891 :
55892 0 : if (ndr_table_netlogon.num_calls < 42) {
55893 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrDeregisterDNSHostRecords_ndr_pack");
55894 0 : return NULL;
55895 : }
55896 0 : call = &ndr_table_netlogon.calls[41];
55897 :
55898 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
55899 0 : if (push == NULL) {
55900 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
55901 0 : return NULL;
55902 : }
55903 :
55904 0 : push->flags |= ndr_push_flags;
55905 :
55906 0 : err = call->ndr_push(push, ndr_inout_flags, object);
55907 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
55908 0 : TALLOC_FREE(push);
55909 0 : PyErr_SetNdrError(err);
55910 0 : return NULL;
55911 : }
55912 0 : blob = ndr_push_blob(push);
55913 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
55914 0 : TALLOC_FREE(push);
55915 0 : return ret;
55916 : }
55917 :
55918 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
55919 : {
55920 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
55921 0 : PyObject *bigendian_obj = NULL;
55922 0 : PyObject *ndr64_obj = NULL;
55923 0 : uint32_t ndr_push_flags = 0;
55924 :
55925 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
55926 : discard_const_p(char *, kwnames),
55927 : &bigendian_obj,
55928 : &ndr64_obj)) {
55929 0 : return NULL;
55930 : }
55931 :
55932 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
55933 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
55934 : }
55935 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
55936 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
55937 : }
55938 :
55939 0 : return py_netr_DsrDeregisterDNSHostRecords_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
55940 : }
55941 :
55942 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
55943 : {
55944 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
55945 0 : PyObject *bigendian_obj = NULL;
55946 0 : PyObject *ndr64_obj = NULL;
55947 0 : uint32_t ndr_push_flags = 0;
55948 :
55949 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
55950 : discard_const_p(char *, kwnames),
55951 : &bigendian_obj,
55952 : &ndr64_obj)) {
55953 0 : return NULL;
55954 : }
55955 :
55956 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
55957 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
55958 : }
55959 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
55960 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
55961 : }
55962 :
55963 0 : return py_netr_DsrDeregisterDNSHostRecords_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
55964 : }
55965 :
55966 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
55967 : {
55968 0 : const struct ndr_interface_call *call = NULL;
55969 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
55970 0 : struct ndr_pull *pull = NULL;
55971 : enum ndr_err_code err;
55972 :
55973 0 : if (ndr_table_netlogon.num_calls < 42) {
55974 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrDeregisterDNSHostRecords_ndr_unpack");
55975 0 : return NULL;
55976 : }
55977 0 : call = &ndr_table_netlogon.calls[41];
55978 :
55979 0 : pull = ndr_pull_init_blob(blob, object);
55980 0 : if (pull == NULL) {
55981 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
55982 0 : return NULL;
55983 : }
55984 :
55985 0 : pull->flags |= ndr_pull_flags;
55986 :
55987 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
55988 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
55989 0 : TALLOC_FREE(pull);
55990 0 : PyErr_SetNdrError(err);
55991 0 : return NULL;
55992 : }
55993 0 : if (!allow_remaining) {
55994 : uint32_t highest_ofs;
55995 :
55996 0 : if (pull->offset > pull->relative_highest_offset) {
55997 0 : highest_ofs = pull->offset;
55998 : } else {
55999 0 : highest_ofs = pull->relative_highest_offset;
56000 : }
56001 0 : if (highest_ofs < pull->data_size) {
56002 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
56003 : "not all bytes consumed ofs[%u] size[%u]",
56004 : highest_ofs, pull->data_size);
56005 0 : TALLOC_FREE(pull);
56006 0 : PyErr_SetNdrError(err);
56007 0 : return NULL;
56008 : }
56009 : }
56010 :
56011 0 : TALLOC_FREE(pull);
56012 0 : Py_RETURN_NONE;
56013 : }
56014 :
56015 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
56016 : {
56017 : DATA_BLOB blob;
56018 0 : Py_ssize_t blob_length = 0;
56019 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
56020 0 : PyObject *bigendian_obj = NULL;
56021 0 : PyObject *ndr64_obj = NULL;
56022 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
56023 0 : PyObject *allow_remaining_obj = NULL;
56024 0 : bool allow_remaining = false;
56025 :
56026 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
56027 : discard_const_p(char *, kwnames),
56028 : &blob.data, &blob_length,
56029 : &bigendian_obj,
56030 : &ndr64_obj,
56031 : &allow_remaining_obj)) {
56032 0 : return NULL;
56033 : }
56034 0 : blob.length = blob_length;
56035 :
56036 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
56037 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
56038 : }
56039 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
56040 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
56041 : }
56042 :
56043 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
56044 0 : allow_remaining = true;
56045 : }
56046 :
56047 0 : return py_netr_DsrDeregisterDNSHostRecords_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
56048 : }
56049 :
56050 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
56051 : {
56052 : DATA_BLOB blob;
56053 0 : Py_ssize_t blob_length = 0;
56054 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
56055 0 : PyObject *bigendian_obj = NULL;
56056 0 : PyObject *ndr64_obj = NULL;
56057 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
56058 0 : PyObject *allow_remaining_obj = NULL;
56059 0 : bool allow_remaining = false;
56060 :
56061 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
56062 : discard_const_p(char *, kwnames),
56063 : &blob.data, &blob_length,
56064 : &bigendian_obj,
56065 : &ndr64_obj,
56066 : &allow_remaining_obj)) {
56067 0 : return NULL;
56068 : }
56069 0 : blob.length = blob_length;
56070 :
56071 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
56072 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
56073 : }
56074 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
56075 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
56076 : }
56077 :
56078 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
56079 0 : allow_remaining = true;
56080 : }
56081 :
56082 0 : return py_netr_DsrDeregisterDNSHostRecords_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
56083 : }
56084 :
56085 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
56086 : {
56087 0 : const struct ndr_interface_call *call = NULL;
56088 0 : struct netr_DsrDeregisterDNSHostRecords *object = (struct netr_DsrDeregisterDNSHostRecords *)pytalloc_get_ptr(py_obj);
56089 : PyObject *ret;
56090 : char *retstr;
56091 :
56092 0 : if (ndr_table_netlogon.num_calls < 42) {
56093 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrDeregisterDNSHostRecords_ndr_print");
56094 0 : return NULL;
56095 : }
56096 0 : call = &ndr_table_netlogon.calls[41];
56097 :
56098 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
56099 0 : ret = PyUnicode_FromString(retstr);
56100 0 : TALLOC_FREE(retstr);
56101 :
56102 0 : return ret;
56103 : }
56104 :
56105 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
56106 : {
56107 0 : return py_netr_DsrDeregisterDNSHostRecords_ndr_print(py_obj, "netr_DsrDeregisterDNSHostRecords_in", NDR_IN);
56108 : }
56109 :
56110 0 : static PyObject *py_netr_DsrDeregisterDNSHostRecords_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
56111 : {
56112 0 : return py_netr_DsrDeregisterDNSHostRecords_ndr_print(py_obj, "netr_DsrDeregisterDNSHostRecords_out", NDR_OUT);
56113 : }
56114 :
56115 : static PyMethodDef py_netr_DsrDeregisterDNSHostRecords_methods[] = {
56116 : { "opnum", (PyCFunction)py_netr_DsrDeregisterDNSHostRecords_ndr_opnum, METH_NOARGS|METH_CLASS,
56117 : "netlogon.netr_DsrDeregisterDNSHostRecords.opnum() -> 41 (0x29) " },
56118 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrDeregisterDNSHostRecords_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
56119 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
56120 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrDeregisterDNSHostRecords_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
56121 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
56122 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrDeregisterDNSHostRecords_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
56123 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
56124 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrDeregisterDNSHostRecords_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
56125 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
56126 : { "__ndr_print_in__", (PyCFunction)py_netr_DsrDeregisterDNSHostRecords_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
56127 : { "__ndr_print_out__", (PyCFunction)py_netr_DsrDeregisterDNSHostRecords_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
56128 : { NULL, NULL, 0, NULL }
56129 : };
56130 :
56131 :
56132 : static PyTypeObject netr_DsrDeregisterDNSHostRecords_Type = {
56133 : PyVarObject_HEAD_INIT(NULL, 0)
56134 : .tp_name = "netlogon.netr_DsrDeregisterDNSHostRecords",
56135 : .tp_getset = py_netr_DsrDeregisterDNSHostRecords_getsetters,
56136 : .tp_methods = py_netr_DsrDeregisterDNSHostRecords_methods,
56137 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
56138 : .tp_new = py_netr_DsrDeregisterDNSHostRecords_new,
56139 : };
56140 :
56141 0 : static bool pack_py_netr_DsrDeregisterDNSHostRecords_args_in(PyObject *args, PyObject *kwargs, struct netr_DsrDeregisterDNSHostRecords *r)
56142 : {
56143 : PyObject *py_server_name;
56144 : PyObject *py_domain;
56145 : PyObject *py_domain_guid;
56146 : PyObject *py_dsa_guid;
56147 : PyObject *py_dns_host;
56148 0 : const char *kwnames[] = {
56149 : "server_name", "domain", "domain_guid", "dsa_guid", "dns_host", NULL
56150 : };
56151 :
56152 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_DsrDeregisterDNSHostRecords", discard_const_p(char *, kwnames), &py_server_name, &py_domain, &py_domain_guid, &py_dsa_guid, &py_dns_host)) {
56153 0 : return false;
56154 : }
56155 :
56156 0 : if (py_server_name == NULL) {
56157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
56158 0 : return false;
56159 : }
56160 0 : if (py_server_name == Py_None) {
56161 0 : r->in.server_name = NULL;
56162 : } else {
56163 0 : r->in.server_name = NULL;
56164 : {
56165 : const char *test_str;
56166 : const char *talloc_str;
56167 0 : PyObject *unicode = NULL;
56168 0 : if (PyUnicode_Check(py_server_name)) {
56169 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
56170 0 : if (unicode == NULL) {
56171 0 : PyErr_NoMemory();
56172 0 : return false;
56173 : }
56174 0 : test_str = PyBytes_AS_STRING(unicode);
56175 0 : } else if (PyBytes_Check(py_server_name)) {
56176 0 : test_str = PyBytes_AS_STRING(py_server_name);
56177 : } else {
56178 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
56179 0 : return false;
56180 : }
56181 0 : talloc_str = talloc_strdup(r, test_str);
56182 0 : if (unicode != NULL) {
56183 0 : Py_DECREF(unicode);
56184 : }
56185 0 : if (talloc_str == NULL) {
56186 0 : PyErr_NoMemory();
56187 0 : return false;
56188 : }
56189 0 : r->in.server_name = talloc_str;
56190 : }
56191 : }
56192 0 : if (py_domain == NULL) {
56193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain");
56194 0 : return false;
56195 : }
56196 0 : if (py_domain == Py_None) {
56197 0 : r->in.domain = NULL;
56198 : } else {
56199 0 : r->in.domain = NULL;
56200 : {
56201 : const char *test_str;
56202 : const char *talloc_str;
56203 0 : PyObject *unicode = NULL;
56204 0 : if (PyUnicode_Check(py_domain)) {
56205 0 : unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore");
56206 0 : if (unicode == NULL) {
56207 0 : PyErr_NoMemory();
56208 0 : return false;
56209 : }
56210 0 : test_str = PyBytes_AS_STRING(unicode);
56211 0 : } else if (PyBytes_Check(py_domain)) {
56212 0 : test_str = PyBytes_AS_STRING(py_domain);
56213 : } else {
56214 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name);
56215 0 : return false;
56216 : }
56217 0 : talloc_str = talloc_strdup(r, test_str);
56218 0 : if (unicode != NULL) {
56219 0 : Py_DECREF(unicode);
56220 : }
56221 0 : if (talloc_str == NULL) {
56222 0 : PyErr_NoMemory();
56223 0 : return false;
56224 : }
56225 0 : r->in.domain = talloc_str;
56226 : }
56227 : }
56228 0 : if (py_domain_guid == NULL) {
56229 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_guid");
56230 0 : return false;
56231 : }
56232 0 : if (py_domain_guid == Py_None) {
56233 0 : r->in.domain_guid = NULL;
56234 : } else {
56235 0 : r->in.domain_guid = NULL;
56236 0 : PY_CHECK_TYPE(GUID_Type, py_domain_guid, return false;);
56237 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_guid)) == NULL) {
56238 0 : PyErr_NoMemory();
56239 0 : return false;
56240 : }
56241 0 : r->in.domain_guid = (struct GUID *)pytalloc_get_ptr(py_domain_guid);
56242 : }
56243 0 : if (py_dsa_guid == NULL) {
56244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dsa_guid");
56245 0 : return false;
56246 : }
56247 0 : if (py_dsa_guid == Py_None) {
56248 0 : r->in.dsa_guid = NULL;
56249 : } else {
56250 0 : r->in.dsa_guid = NULL;
56251 0 : PY_CHECK_TYPE(GUID_Type, py_dsa_guid, return false;);
56252 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dsa_guid)) == NULL) {
56253 0 : PyErr_NoMemory();
56254 0 : return false;
56255 : }
56256 0 : r->in.dsa_guid = (struct GUID *)pytalloc_get_ptr(py_dsa_guid);
56257 : }
56258 0 : if (py_dns_host == NULL) {
56259 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dns_host");
56260 0 : return false;
56261 : }
56262 0 : r->in.dns_host = talloc_ptrtype(r, r->in.dns_host);
56263 0 : if (r->in.dns_host == NULL) {
56264 0 : PyErr_NoMemory();
56265 0 : return false;
56266 : }
56267 : {
56268 : const char *test_str;
56269 : const char *talloc_str;
56270 0 : PyObject *unicode = NULL;
56271 0 : if (PyUnicode_Check(py_dns_host)) {
56272 0 : unicode = PyUnicode_AsEncodedString(py_dns_host, "utf-8", "ignore");
56273 0 : if (unicode == NULL) {
56274 0 : PyErr_NoMemory();
56275 0 : return false;
56276 : }
56277 0 : test_str = PyBytes_AS_STRING(unicode);
56278 0 : } else if (PyBytes_Check(py_dns_host)) {
56279 0 : test_str = PyBytes_AS_STRING(py_dns_host);
56280 : } else {
56281 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dns_host)->tp_name);
56282 0 : return false;
56283 : }
56284 0 : talloc_str = talloc_strdup(r, test_str);
56285 0 : if (unicode != NULL) {
56286 0 : Py_DECREF(unicode);
56287 : }
56288 0 : if (talloc_str == NULL) {
56289 0 : PyErr_NoMemory();
56290 0 : return false;
56291 : }
56292 0 : r->in.dns_host = talloc_str;
56293 : }
56294 0 : return true;
56295 : }
56296 :
56297 0 : static PyObject *unpack_py_netr_DsrDeregisterDNSHostRecords_args_out(struct netr_DsrDeregisterDNSHostRecords *r)
56298 : {
56299 : PyObject *result;
56300 0 : result = Py_None;
56301 0 : Py_INCREF(result);
56302 0 : if (!W_ERROR_IS_OK(r->out.result)) {
56303 0 : PyErr_SetWERROR(r->out.result);
56304 0 : return NULL;
56305 : }
56306 :
56307 0 : return result;
56308 : }
56309 :
56310 :
56311 0 : static PyObject *py_netr_ServerTrustPasswordsGet_in_get_server_name(PyObject *obj, void *closure)
56312 : {
56313 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56314 : PyObject *py_server_name;
56315 0 : if (object->in.server_name == NULL) {
56316 0 : Py_RETURN_NONE;
56317 : }
56318 0 : if (object->in.server_name == NULL) {
56319 0 : py_server_name = Py_None;
56320 0 : Py_INCREF(py_server_name);
56321 : } else {
56322 0 : if (object->in.server_name == NULL) {
56323 0 : py_server_name = Py_None;
56324 0 : Py_INCREF(py_server_name);
56325 : } else {
56326 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
56327 : }
56328 : }
56329 0 : return py_server_name;
56330 : }
56331 :
56332 0 : static int py_netr_ServerTrustPasswordsGet_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
56333 : {
56334 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56335 0 : if (value == NULL) {
56336 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
56337 0 : return -1;
56338 : }
56339 0 : if (value == Py_None) {
56340 0 : object->in.server_name = NULL;
56341 : } else {
56342 0 : object->in.server_name = NULL;
56343 : {
56344 : const char *test_str;
56345 : const char *talloc_str;
56346 0 : PyObject *unicode = NULL;
56347 0 : if (PyUnicode_Check(value)) {
56348 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
56349 0 : if (unicode == NULL) {
56350 0 : PyErr_NoMemory();
56351 0 : return -1;
56352 : }
56353 0 : test_str = PyBytes_AS_STRING(unicode);
56354 0 : } else if (PyBytes_Check(value)) {
56355 0 : test_str = PyBytes_AS_STRING(value);
56356 : } else {
56357 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
56358 0 : return -1;
56359 : }
56360 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
56361 0 : if (unicode != NULL) {
56362 0 : Py_DECREF(unicode);
56363 : }
56364 0 : if (talloc_str == NULL) {
56365 0 : PyErr_NoMemory();
56366 0 : return -1;
56367 : }
56368 0 : object->in.server_name = talloc_str;
56369 : }
56370 : }
56371 0 : return 0;
56372 : }
56373 :
56374 0 : static PyObject *py_netr_ServerTrustPasswordsGet_in_get_account_name(PyObject *obj, void *closure)
56375 : {
56376 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56377 : PyObject *py_account_name;
56378 0 : if (object->in.account_name == NULL) {
56379 0 : Py_RETURN_NONE;
56380 : }
56381 0 : if (object->in.account_name == NULL) {
56382 0 : py_account_name = Py_None;
56383 0 : Py_INCREF(py_account_name);
56384 : } else {
56385 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
56386 : }
56387 0 : return py_account_name;
56388 : }
56389 :
56390 0 : static int py_netr_ServerTrustPasswordsGet_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
56391 : {
56392 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56393 0 : if (value == NULL) {
56394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
56395 0 : return -1;
56396 : }
56397 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
56398 0 : if (object->in.account_name == NULL) {
56399 0 : PyErr_NoMemory();
56400 0 : return -1;
56401 : }
56402 : {
56403 : const char *test_str;
56404 : const char *talloc_str;
56405 0 : PyObject *unicode = NULL;
56406 0 : if (PyUnicode_Check(value)) {
56407 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
56408 0 : if (unicode == NULL) {
56409 0 : PyErr_NoMemory();
56410 0 : return -1;
56411 : }
56412 0 : test_str = PyBytes_AS_STRING(unicode);
56413 0 : } else if (PyBytes_Check(value)) {
56414 0 : test_str = PyBytes_AS_STRING(value);
56415 : } else {
56416 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
56417 0 : return -1;
56418 : }
56419 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
56420 0 : if (unicode != NULL) {
56421 0 : Py_DECREF(unicode);
56422 : }
56423 0 : if (talloc_str == NULL) {
56424 0 : PyErr_NoMemory();
56425 0 : return -1;
56426 : }
56427 0 : object->in.account_name = talloc_str;
56428 : }
56429 0 : return 0;
56430 : }
56431 :
56432 0 : static PyObject *py_netr_ServerTrustPasswordsGet_in_get_secure_channel_type(PyObject *obj, void *closure)
56433 : {
56434 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56435 : PyObject *py_secure_channel_type;
56436 0 : py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type);
56437 0 : return py_secure_channel_type;
56438 : }
56439 :
56440 0 : static int py_netr_ServerTrustPasswordsGet_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure)
56441 : {
56442 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56443 0 : if (value == NULL) {
56444 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type");
56445 0 : return -1;
56446 : }
56447 : {
56448 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_type));
56449 0 : if (PyLong_Check(value)) {
56450 : unsigned long long test_var;
56451 0 : test_var = PyLong_AsUnsignedLongLong(value);
56452 0 : if (PyErr_Occurred() != NULL) {
56453 0 : return -1;
56454 : }
56455 0 : if (test_var > uint_max) {
56456 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
56457 : PyLong_Type.tp_name, uint_max, test_var);
56458 0 : return -1;
56459 : }
56460 0 : object->in.secure_channel_type = test_var;
56461 : } else {
56462 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
56463 : PyLong_Type.tp_name);
56464 0 : return -1;
56465 : }
56466 : }
56467 0 : return 0;
56468 : }
56469 :
56470 0 : static PyObject *py_netr_ServerTrustPasswordsGet_in_get_computer_name(PyObject *obj, void *closure)
56471 : {
56472 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56473 : PyObject *py_computer_name;
56474 0 : if (object->in.computer_name == NULL) {
56475 0 : Py_RETURN_NONE;
56476 : }
56477 0 : if (object->in.computer_name == NULL) {
56478 0 : py_computer_name = Py_None;
56479 0 : Py_INCREF(py_computer_name);
56480 : } else {
56481 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
56482 : }
56483 0 : return py_computer_name;
56484 : }
56485 :
56486 0 : static int py_netr_ServerTrustPasswordsGet_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
56487 : {
56488 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56489 0 : if (value == NULL) {
56490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
56491 0 : return -1;
56492 : }
56493 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
56494 0 : if (object->in.computer_name == NULL) {
56495 0 : PyErr_NoMemory();
56496 0 : return -1;
56497 : }
56498 : {
56499 : const char *test_str;
56500 : const char *talloc_str;
56501 0 : PyObject *unicode = NULL;
56502 0 : if (PyUnicode_Check(value)) {
56503 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
56504 0 : if (unicode == NULL) {
56505 0 : PyErr_NoMemory();
56506 0 : return -1;
56507 : }
56508 0 : test_str = PyBytes_AS_STRING(unicode);
56509 0 : } else if (PyBytes_Check(value)) {
56510 0 : test_str = PyBytes_AS_STRING(value);
56511 : } else {
56512 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
56513 0 : return -1;
56514 : }
56515 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
56516 0 : if (unicode != NULL) {
56517 0 : Py_DECREF(unicode);
56518 : }
56519 0 : if (talloc_str == NULL) {
56520 0 : PyErr_NoMemory();
56521 0 : return -1;
56522 : }
56523 0 : object->in.computer_name = talloc_str;
56524 : }
56525 0 : return 0;
56526 : }
56527 :
56528 0 : static PyObject *py_netr_ServerTrustPasswordsGet_in_get_credential(PyObject *obj, void *closure)
56529 : {
56530 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56531 : PyObject *py_credential;
56532 0 : if (object->in.credential == NULL) {
56533 0 : Py_RETURN_NONE;
56534 : }
56535 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
56536 0 : return py_credential;
56537 : }
56538 :
56539 0 : static int py_netr_ServerTrustPasswordsGet_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
56540 : {
56541 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56542 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
56543 0 : if (value == NULL) {
56544 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
56545 0 : return -1;
56546 : }
56547 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
56548 0 : if (object->in.credential == NULL) {
56549 0 : PyErr_NoMemory();
56550 0 : return -1;
56551 : }
56552 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
56553 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
56554 0 : PyErr_NoMemory();
56555 0 : return -1;
56556 : }
56557 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
56558 0 : return 0;
56559 : }
56560 :
56561 0 : static PyObject *py_netr_ServerTrustPasswordsGet_out_get_return_authenticator(PyObject *obj, void *closure)
56562 : {
56563 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56564 : PyObject *py_return_authenticator;
56565 0 : if (object->out.return_authenticator == NULL) {
56566 0 : Py_RETURN_NONE;
56567 : }
56568 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
56569 0 : return py_return_authenticator;
56570 : }
56571 :
56572 0 : static int py_netr_ServerTrustPasswordsGet_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
56573 : {
56574 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56575 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
56576 0 : if (value == NULL) {
56577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
56578 0 : return -1;
56579 : }
56580 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
56581 0 : if (object->out.return_authenticator == NULL) {
56582 0 : PyErr_NoMemory();
56583 0 : return -1;
56584 : }
56585 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
56586 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
56587 0 : PyErr_NoMemory();
56588 0 : return -1;
56589 : }
56590 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
56591 0 : return 0;
56592 : }
56593 :
56594 0 : static PyObject *py_netr_ServerTrustPasswordsGet_out_get_new_owf_password(PyObject *obj, void *closure)
56595 : {
56596 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56597 : PyObject *py_new_owf_password;
56598 0 : if (object->out.new_owf_password == NULL) {
56599 0 : Py_RETURN_NONE;
56600 : }
56601 0 : py_new_owf_password = pytalloc_reference_ex(samr_Password_Type, object->out.new_owf_password, object->out.new_owf_password);
56602 0 : return py_new_owf_password;
56603 : }
56604 :
56605 0 : static int py_netr_ServerTrustPasswordsGet_out_set_new_owf_password(PyObject *py_obj, PyObject *value, void *closure)
56606 : {
56607 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56608 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_owf_password));
56609 0 : if (value == NULL) {
56610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.new_owf_password");
56611 0 : return -1;
56612 : }
56613 0 : object->out.new_owf_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.new_owf_password);
56614 0 : if (object->out.new_owf_password == NULL) {
56615 0 : PyErr_NoMemory();
56616 0 : return -1;
56617 : }
56618 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
56619 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
56620 0 : PyErr_NoMemory();
56621 0 : return -1;
56622 : }
56623 0 : object->out.new_owf_password = (struct samr_Password *)pytalloc_get_ptr(value);
56624 0 : return 0;
56625 : }
56626 :
56627 0 : static PyObject *py_netr_ServerTrustPasswordsGet_out_get_old_owf_password(PyObject *obj, void *closure)
56628 : {
56629 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56630 : PyObject *py_old_owf_password;
56631 0 : if (object->out.old_owf_password == NULL) {
56632 0 : Py_RETURN_NONE;
56633 : }
56634 0 : py_old_owf_password = pytalloc_reference_ex(samr_Password_Type, object->out.old_owf_password, object->out.old_owf_password);
56635 0 : return py_old_owf_password;
56636 : }
56637 :
56638 0 : static int py_netr_ServerTrustPasswordsGet_out_set_old_owf_password(PyObject *py_obj, PyObject *value, void *closure)
56639 : {
56640 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56641 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_owf_password));
56642 0 : if (value == NULL) {
56643 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.old_owf_password");
56644 0 : return -1;
56645 : }
56646 0 : object->out.old_owf_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.old_owf_password);
56647 0 : if (object->out.old_owf_password == NULL) {
56648 0 : PyErr_NoMemory();
56649 0 : return -1;
56650 : }
56651 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
56652 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
56653 0 : PyErr_NoMemory();
56654 0 : return -1;
56655 : }
56656 0 : object->out.old_owf_password = (struct samr_Password *)pytalloc_get_ptr(value);
56657 0 : return 0;
56658 : }
56659 :
56660 0 : static PyObject *py_netr_ServerTrustPasswordsGet_get_result(PyObject *obj, void *closure)
56661 : {
56662 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(obj);
56663 : PyObject *py_result;
56664 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
56665 0 : return py_result;
56666 : }
56667 :
56668 0 : static int py_netr_ServerTrustPasswordsGet_set_result(PyObject *py_obj, PyObject *value, void *closure)
56669 : {
56670 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56671 0 : if (value == NULL) {
56672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
56673 0 : return -1;
56674 : }
56675 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
56676 0 : return 0;
56677 : }
56678 :
56679 : static PyGetSetDef py_netr_ServerTrustPasswordsGet_getsetters[] = {
56680 : {
56681 : .name = discard_const_p(char, "in_server_name"),
56682 : .get = py_netr_ServerTrustPasswordsGet_in_get_server_name,
56683 : .set = py_netr_ServerTrustPasswordsGet_in_set_server_name,
56684 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
56685 : },
56686 : {
56687 : .name = discard_const_p(char, "in_account_name"),
56688 : .get = py_netr_ServerTrustPasswordsGet_in_get_account_name,
56689 : .set = py_netr_ServerTrustPasswordsGet_in_set_account_name,
56690 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
56691 : },
56692 : {
56693 : .name = discard_const_p(char, "in_secure_channel_type"),
56694 : .get = py_netr_ServerTrustPasswordsGet_in_get_secure_channel_type,
56695 : .set = py_netr_ServerTrustPasswordsGet_in_set_secure_channel_type,
56696 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType")
56697 : },
56698 : {
56699 : .name = discard_const_p(char, "in_computer_name"),
56700 : .get = py_netr_ServerTrustPasswordsGet_in_get_computer_name,
56701 : .set = py_netr_ServerTrustPasswordsGet_in_set_computer_name,
56702 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
56703 : },
56704 : {
56705 : .name = discard_const_p(char, "in_credential"),
56706 : .get = py_netr_ServerTrustPasswordsGet_in_get_credential,
56707 : .set = py_netr_ServerTrustPasswordsGet_in_set_credential,
56708 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
56709 : },
56710 : {
56711 : .name = discard_const_p(char, "out_return_authenticator"),
56712 : .get = py_netr_ServerTrustPasswordsGet_out_get_return_authenticator,
56713 : .set = py_netr_ServerTrustPasswordsGet_out_set_return_authenticator,
56714 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
56715 : },
56716 : {
56717 : .name = discard_const_p(char, "out_new_owf_password"),
56718 : .get = py_netr_ServerTrustPasswordsGet_out_get_new_owf_password,
56719 : .set = py_netr_ServerTrustPasswordsGet_out_set_new_owf_password,
56720 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
56721 : },
56722 : {
56723 : .name = discard_const_p(char, "out_old_owf_password"),
56724 : .get = py_netr_ServerTrustPasswordsGet_out_get_old_owf_password,
56725 : .set = py_netr_ServerTrustPasswordsGet_out_set_old_owf_password,
56726 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
56727 : },
56728 : {
56729 : .name = discard_const_p(char, "result"),
56730 : .get = py_netr_ServerTrustPasswordsGet_get_result,
56731 : .set = py_netr_ServerTrustPasswordsGet_set_result,
56732 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
56733 : },
56734 : { .name = NULL }
56735 : };
56736 :
56737 0 : static PyObject *py_netr_ServerTrustPasswordsGet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
56738 : {
56739 0 : PyObject *self = pytalloc_new(struct netr_ServerTrustPasswordsGet, type);
56740 0 : struct netr_ServerTrustPasswordsGet *_self = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(self);
56741 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
56742 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
56743 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
56744 0 : _self->out.new_owf_password = talloc_zero(mem_ctx, struct samr_Password);
56745 0 : _self->out.old_owf_password = talloc_zero(mem_ctx, struct samr_Password);
56746 0 : return self;
56747 : }
56748 :
56749 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
56750 : {
56751 :
56752 :
56753 0 : return PyLong_FromLong(42);
56754 : }
56755 :
56756 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
56757 : {
56758 0 : const struct ndr_interface_call *call = NULL;
56759 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56760 0 : PyObject *ret = NULL;
56761 0 : struct ndr_push *push = NULL;
56762 : DATA_BLOB blob;
56763 : enum ndr_err_code err;
56764 :
56765 0 : if (ndr_table_netlogon.num_calls < 43) {
56766 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerTrustPasswordsGet_ndr_pack");
56767 0 : return NULL;
56768 : }
56769 0 : call = &ndr_table_netlogon.calls[42];
56770 :
56771 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
56772 0 : if (push == NULL) {
56773 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
56774 0 : return NULL;
56775 : }
56776 :
56777 0 : push->flags |= ndr_push_flags;
56778 :
56779 0 : err = call->ndr_push(push, ndr_inout_flags, object);
56780 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
56781 0 : TALLOC_FREE(push);
56782 0 : PyErr_SetNdrError(err);
56783 0 : return NULL;
56784 : }
56785 0 : blob = ndr_push_blob(push);
56786 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
56787 0 : TALLOC_FREE(push);
56788 0 : return ret;
56789 : }
56790 :
56791 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
56792 : {
56793 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
56794 0 : PyObject *bigendian_obj = NULL;
56795 0 : PyObject *ndr64_obj = NULL;
56796 0 : uint32_t ndr_push_flags = 0;
56797 :
56798 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
56799 : discard_const_p(char *, kwnames),
56800 : &bigendian_obj,
56801 : &ndr64_obj)) {
56802 0 : return NULL;
56803 : }
56804 :
56805 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
56806 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
56807 : }
56808 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
56809 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
56810 : }
56811 :
56812 0 : return py_netr_ServerTrustPasswordsGet_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
56813 : }
56814 :
56815 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
56816 : {
56817 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
56818 0 : PyObject *bigendian_obj = NULL;
56819 0 : PyObject *ndr64_obj = NULL;
56820 0 : uint32_t ndr_push_flags = 0;
56821 :
56822 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
56823 : discard_const_p(char *, kwnames),
56824 : &bigendian_obj,
56825 : &ndr64_obj)) {
56826 0 : return NULL;
56827 : }
56828 :
56829 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
56830 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
56831 : }
56832 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
56833 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
56834 : }
56835 :
56836 0 : return py_netr_ServerTrustPasswordsGet_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
56837 : }
56838 :
56839 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
56840 : {
56841 0 : const struct ndr_interface_call *call = NULL;
56842 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56843 0 : struct ndr_pull *pull = NULL;
56844 : enum ndr_err_code err;
56845 :
56846 0 : if (ndr_table_netlogon.num_calls < 43) {
56847 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerTrustPasswordsGet_ndr_unpack");
56848 0 : return NULL;
56849 : }
56850 0 : call = &ndr_table_netlogon.calls[42];
56851 :
56852 0 : pull = ndr_pull_init_blob(blob, object);
56853 0 : if (pull == NULL) {
56854 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
56855 0 : return NULL;
56856 : }
56857 :
56858 0 : pull->flags |= ndr_pull_flags;
56859 :
56860 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
56861 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
56862 0 : TALLOC_FREE(pull);
56863 0 : PyErr_SetNdrError(err);
56864 0 : return NULL;
56865 : }
56866 0 : if (!allow_remaining) {
56867 : uint32_t highest_ofs;
56868 :
56869 0 : if (pull->offset > pull->relative_highest_offset) {
56870 0 : highest_ofs = pull->offset;
56871 : } else {
56872 0 : highest_ofs = pull->relative_highest_offset;
56873 : }
56874 0 : if (highest_ofs < pull->data_size) {
56875 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
56876 : "not all bytes consumed ofs[%u] size[%u]",
56877 : highest_ofs, pull->data_size);
56878 0 : TALLOC_FREE(pull);
56879 0 : PyErr_SetNdrError(err);
56880 0 : return NULL;
56881 : }
56882 : }
56883 :
56884 0 : TALLOC_FREE(pull);
56885 0 : Py_RETURN_NONE;
56886 : }
56887 :
56888 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
56889 : {
56890 : DATA_BLOB blob;
56891 0 : Py_ssize_t blob_length = 0;
56892 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
56893 0 : PyObject *bigendian_obj = NULL;
56894 0 : PyObject *ndr64_obj = NULL;
56895 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
56896 0 : PyObject *allow_remaining_obj = NULL;
56897 0 : bool allow_remaining = false;
56898 :
56899 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
56900 : discard_const_p(char *, kwnames),
56901 : &blob.data, &blob_length,
56902 : &bigendian_obj,
56903 : &ndr64_obj,
56904 : &allow_remaining_obj)) {
56905 0 : return NULL;
56906 : }
56907 0 : blob.length = blob_length;
56908 :
56909 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
56910 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
56911 : }
56912 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
56913 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
56914 : }
56915 :
56916 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
56917 0 : allow_remaining = true;
56918 : }
56919 :
56920 0 : return py_netr_ServerTrustPasswordsGet_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
56921 : }
56922 :
56923 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
56924 : {
56925 : DATA_BLOB blob;
56926 0 : Py_ssize_t blob_length = 0;
56927 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
56928 0 : PyObject *bigendian_obj = NULL;
56929 0 : PyObject *ndr64_obj = NULL;
56930 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
56931 0 : PyObject *allow_remaining_obj = NULL;
56932 0 : bool allow_remaining = false;
56933 :
56934 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
56935 : discard_const_p(char *, kwnames),
56936 : &blob.data, &blob_length,
56937 : &bigendian_obj,
56938 : &ndr64_obj,
56939 : &allow_remaining_obj)) {
56940 0 : return NULL;
56941 : }
56942 0 : blob.length = blob_length;
56943 :
56944 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
56945 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
56946 : }
56947 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
56948 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
56949 : }
56950 :
56951 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
56952 0 : allow_remaining = true;
56953 : }
56954 :
56955 0 : return py_netr_ServerTrustPasswordsGet_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
56956 : }
56957 :
56958 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
56959 : {
56960 0 : const struct ndr_interface_call *call = NULL;
56961 0 : struct netr_ServerTrustPasswordsGet *object = (struct netr_ServerTrustPasswordsGet *)pytalloc_get_ptr(py_obj);
56962 : PyObject *ret;
56963 : char *retstr;
56964 :
56965 0 : if (ndr_table_netlogon.num_calls < 43) {
56966 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerTrustPasswordsGet_ndr_print");
56967 0 : return NULL;
56968 : }
56969 0 : call = &ndr_table_netlogon.calls[42];
56970 :
56971 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
56972 0 : ret = PyUnicode_FromString(retstr);
56973 0 : TALLOC_FREE(retstr);
56974 :
56975 0 : return ret;
56976 : }
56977 :
56978 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
56979 : {
56980 0 : return py_netr_ServerTrustPasswordsGet_ndr_print(py_obj, "netr_ServerTrustPasswordsGet_in", NDR_IN);
56981 : }
56982 :
56983 0 : static PyObject *py_netr_ServerTrustPasswordsGet_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
56984 : {
56985 0 : return py_netr_ServerTrustPasswordsGet_ndr_print(py_obj, "netr_ServerTrustPasswordsGet_out", NDR_OUT);
56986 : }
56987 :
56988 : static PyMethodDef py_netr_ServerTrustPasswordsGet_methods[] = {
56989 : { "opnum", (PyCFunction)py_netr_ServerTrustPasswordsGet_ndr_opnum, METH_NOARGS|METH_CLASS,
56990 : "netlogon.netr_ServerTrustPasswordsGet.opnum() -> 42 (0x2a) " },
56991 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerTrustPasswordsGet_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
56992 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
56993 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerTrustPasswordsGet_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
56994 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
56995 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerTrustPasswordsGet_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
56996 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
56997 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerTrustPasswordsGet_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
56998 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
56999 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerTrustPasswordsGet_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
57000 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerTrustPasswordsGet_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
57001 : { NULL, NULL, 0, NULL }
57002 : };
57003 :
57004 :
57005 : static PyTypeObject netr_ServerTrustPasswordsGet_Type = {
57006 : PyVarObject_HEAD_INIT(NULL, 0)
57007 : .tp_name = "netlogon.netr_ServerTrustPasswordsGet",
57008 : .tp_getset = py_netr_ServerTrustPasswordsGet_getsetters,
57009 : .tp_methods = py_netr_ServerTrustPasswordsGet_methods,
57010 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
57011 : .tp_new = py_netr_ServerTrustPasswordsGet_new,
57012 : };
57013 :
57014 0 : static bool pack_py_netr_ServerTrustPasswordsGet_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerTrustPasswordsGet *r)
57015 : {
57016 : PyObject *py_server_name;
57017 : PyObject *py_account_name;
57018 : PyObject *py_secure_channel_type;
57019 : PyObject *py_computer_name;
57020 : PyObject *py_credential;
57021 0 : const char *kwnames[] = {
57022 : "server_name", "account_name", "secure_channel_type", "computer_name", "credential", NULL
57023 : };
57024 :
57025 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_ServerTrustPasswordsGet", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential)) {
57026 0 : return false;
57027 : }
57028 :
57029 0 : if (py_server_name == NULL) {
57030 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
57031 0 : return false;
57032 : }
57033 0 : if (py_server_name == Py_None) {
57034 0 : r->in.server_name = NULL;
57035 : } else {
57036 0 : r->in.server_name = NULL;
57037 : {
57038 : const char *test_str;
57039 : const char *talloc_str;
57040 0 : PyObject *unicode = NULL;
57041 0 : if (PyUnicode_Check(py_server_name)) {
57042 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
57043 0 : if (unicode == NULL) {
57044 0 : PyErr_NoMemory();
57045 0 : return false;
57046 : }
57047 0 : test_str = PyBytes_AS_STRING(unicode);
57048 0 : } else if (PyBytes_Check(py_server_name)) {
57049 0 : test_str = PyBytes_AS_STRING(py_server_name);
57050 : } else {
57051 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
57052 0 : return false;
57053 : }
57054 0 : talloc_str = talloc_strdup(r, test_str);
57055 0 : if (unicode != NULL) {
57056 0 : Py_DECREF(unicode);
57057 : }
57058 0 : if (talloc_str == NULL) {
57059 0 : PyErr_NoMemory();
57060 0 : return false;
57061 : }
57062 0 : r->in.server_name = talloc_str;
57063 : }
57064 : }
57065 0 : if (py_account_name == NULL) {
57066 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
57067 0 : return false;
57068 : }
57069 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
57070 0 : if (r->in.account_name == NULL) {
57071 0 : PyErr_NoMemory();
57072 0 : return false;
57073 : }
57074 : {
57075 : const char *test_str;
57076 : const char *talloc_str;
57077 0 : PyObject *unicode = NULL;
57078 0 : if (PyUnicode_Check(py_account_name)) {
57079 0 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
57080 0 : if (unicode == NULL) {
57081 0 : PyErr_NoMemory();
57082 0 : return false;
57083 : }
57084 0 : test_str = PyBytes_AS_STRING(unicode);
57085 0 : } else if (PyBytes_Check(py_account_name)) {
57086 0 : test_str = PyBytes_AS_STRING(py_account_name);
57087 : } else {
57088 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
57089 0 : return false;
57090 : }
57091 0 : talloc_str = talloc_strdup(r, test_str);
57092 0 : if (unicode != NULL) {
57093 0 : Py_DECREF(unicode);
57094 : }
57095 0 : if (talloc_str == NULL) {
57096 0 : PyErr_NoMemory();
57097 0 : return false;
57098 : }
57099 0 : r->in.account_name = talloc_str;
57100 : }
57101 0 : if (py_secure_channel_type == NULL) {
57102 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type");
57103 0 : return false;
57104 : }
57105 : {
57106 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type));
57107 0 : if (PyLong_Check(py_secure_channel_type)) {
57108 : unsigned long long test_var;
57109 0 : test_var = PyLong_AsUnsignedLongLong(py_secure_channel_type);
57110 0 : if (PyErr_Occurred() != NULL) {
57111 0 : return false;
57112 : }
57113 0 : if (test_var > uint_max) {
57114 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
57115 : PyLong_Type.tp_name, uint_max, test_var);
57116 0 : return false;
57117 : }
57118 0 : r->in.secure_channel_type = test_var;
57119 : } else {
57120 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
57121 : PyLong_Type.tp_name);
57122 0 : return false;
57123 : }
57124 : }
57125 0 : if (py_computer_name == NULL) {
57126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
57127 0 : return false;
57128 : }
57129 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
57130 0 : if (r->in.computer_name == NULL) {
57131 0 : PyErr_NoMemory();
57132 0 : return false;
57133 : }
57134 : {
57135 : const char *test_str;
57136 : const char *talloc_str;
57137 0 : PyObject *unicode = NULL;
57138 0 : if (PyUnicode_Check(py_computer_name)) {
57139 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
57140 0 : if (unicode == NULL) {
57141 0 : PyErr_NoMemory();
57142 0 : return false;
57143 : }
57144 0 : test_str = PyBytes_AS_STRING(unicode);
57145 0 : } else if (PyBytes_Check(py_computer_name)) {
57146 0 : test_str = PyBytes_AS_STRING(py_computer_name);
57147 : } else {
57148 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
57149 0 : return false;
57150 : }
57151 0 : talloc_str = talloc_strdup(r, test_str);
57152 0 : if (unicode != NULL) {
57153 0 : Py_DECREF(unicode);
57154 : }
57155 0 : if (talloc_str == NULL) {
57156 0 : PyErr_NoMemory();
57157 0 : return false;
57158 : }
57159 0 : r->in.computer_name = talloc_str;
57160 : }
57161 0 : if (py_credential == NULL) {
57162 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
57163 0 : return false;
57164 : }
57165 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
57166 0 : if (r->in.credential == NULL) {
57167 0 : PyErr_NoMemory();
57168 0 : return false;
57169 : }
57170 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
57171 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
57172 0 : PyErr_NoMemory();
57173 0 : return false;
57174 : }
57175 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
57176 0 : return true;
57177 : }
57178 :
57179 0 : static PyObject *unpack_py_netr_ServerTrustPasswordsGet_args_out(struct netr_ServerTrustPasswordsGet *r)
57180 : {
57181 : PyObject *result;
57182 : PyObject *py_return_authenticator;
57183 : PyObject *py_new_owf_password;
57184 : PyObject *py_old_owf_password;
57185 0 : result = PyTuple_New(3);
57186 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
57187 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
57188 0 : py_new_owf_password = pytalloc_reference_ex(samr_Password_Type, r->out.new_owf_password, r->out.new_owf_password);
57189 0 : PyTuple_SetItem(result, 1, py_new_owf_password);
57190 0 : py_old_owf_password = pytalloc_reference_ex(samr_Password_Type, r->out.old_owf_password, r->out.old_owf_password);
57191 0 : PyTuple_SetItem(result, 2, py_old_owf_password);
57192 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
57193 0 : PyErr_SetNTSTATUS(r->out.result);
57194 0 : return NULL;
57195 : }
57196 :
57197 0 : return result;
57198 : }
57199 :
57200 :
57201 0 : static PyObject *py_netr_DsRGetForestTrustInformation_in_get_server_name(PyObject *obj, void *closure)
57202 : {
57203 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(obj);
57204 : PyObject *py_server_name;
57205 0 : if (object->in.server_name == NULL) {
57206 0 : Py_RETURN_NONE;
57207 : }
57208 0 : if (object->in.server_name == NULL) {
57209 0 : py_server_name = Py_None;
57210 0 : Py_INCREF(py_server_name);
57211 : } else {
57212 0 : if (object->in.server_name == NULL) {
57213 0 : py_server_name = Py_None;
57214 0 : Py_INCREF(py_server_name);
57215 : } else {
57216 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
57217 : }
57218 : }
57219 0 : return py_server_name;
57220 : }
57221 :
57222 0 : static int py_netr_DsRGetForestTrustInformation_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
57223 : {
57224 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57225 0 : if (value == NULL) {
57226 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
57227 0 : return -1;
57228 : }
57229 0 : if (value == Py_None) {
57230 0 : object->in.server_name = NULL;
57231 : } else {
57232 0 : object->in.server_name = NULL;
57233 : {
57234 : const char *test_str;
57235 : const char *talloc_str;
57236 0 : PyObject *unicode = NULL;
57237 0 : if (PyUnicode_Check(value)) {
57238 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
57239 0 : if (unicode == NULL) {
57240 0 : PyErr_NoMemory();
57241 0 : return -1;
57242 : }
57243 0 : test_str = PyBytes_AS_STRING(unicode);
57244 0 : } else if (PyBytes_Check(value)) {
57245 0 : test_str = PyBytes_AS_STRING(value);
57246 : } else {
57247 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
57248 0 : return -1;
57249 : }
57250 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
57251 0 : if (unicode != NULL) {
57252 0 : Py_DECREF(unicode);
57253 : }
57254 0 : if (talloc_str == NULL) {
57255 0 : PyErr_NoMemory();
57256 0 : return -1;
57257 : }
57258 0 : object->in.server_name = talloc_str;
57259 : }
57260 : }
57261 0 : return 0;
57262 : }
57263 :
57264 0 : static PyObject *py_netr_DsRGetForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
57265 : {
57266 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(obj);
57267 : PyObject *py_trusted_domain_name;
57268 0 : if (object->in.trusted_domain_name == NULL) {
57269 0 : Py_RETURN_NONE;
57270 : }
57271 0 : if (object->in.trusted_domain_name == NULL) {
57272 0 : py_trusted_domain_name = Py_None;
57273 0 : Py_INCREF(py_trusted_domain_name);
57274 : } else {
57275 0 : if (object->in.trusted_domain_name == NULL) {
57276 0 : py_trusted_domain_name = Py_None;
57277 0 : Py_INCREF(py_trusted_domain_name);
57278 : } else {
57279 0 : py_trusted_domain_name = PyUnicode_Decode(object->in.trusted_domain_name, strlen(object->in.trusted_domain_name), "utf-8", "ignore");
57280 : }
57281 : }
57282 0 : return py_trusted_domain_name;
57283 : }
57284 :
57285 0 : static int py_netr_DsRGetForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
57286 : {
57287 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57288 0 : if (value == NULL) {
57289 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain_name");
57290 0 : return -1;
57291 : }
57292 0 : if (value == Py_None) {
57293 0 : object->in.trusted_domain_name = NULL;
57294 : } else {
57295 0 : object->in.trusted_domain_name = NULL;
57296 : {
57297 : const char *test_str;
57298 : const char *talloc_str;
57299 0 : PyObject *unicode = NULL;
57300 0 : if (PyUnicode_Check(value)) {
57301 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
57302 0 : if (unicode == NULL) {
57303 0 : PyErr_NoMemory();
57304 0 : return -1;
57305 : }
57306 0 : test_str = PyBytes_AS_STRING(unicode);
57307 0 : } else if (PyBytes_Check(value)) {
57308 0 : test_str = PyBytes_AS_STRING(value);
57309 : } else {
57310 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
57311 0 : return -1;
57312 : }
57313 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
57314 0 : if (unicode != NULL) {
57315 0 : Py_DECREF(unicode);
57316 : }
57317 0 : if (talloc_str == NULL) {
57318 0 : PyErr_NoMemory();
57319 0 : return -1;
57320 : }
57321 0 : object->in.trusted_domain_name = talloc_str;
57322 : }
57323 : }
57324 0 : return 0;
57325 : }
57326 :
57327 0 : static PyObject *py_netr_DsRGetForestTrustInformation_in_get_flags(PyObject *obj, void *closure)
57328 : {
57329 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(obj);
57330 : PyObject *py_flags;
57331 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
57332 0 : return py_flags;
57333 : }
57334 :
57335 0 : static int py_netr_DsRGetForestTrustInformation_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
57336 : {
57337 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57338 0 : if (value == NULL) {
57339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
57340 0 : return -1;
57341 : }
57342 : {
57343 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
57344 0 : if (PyLong_Check(value)) {
57345 : unsigned long long test_var;
57346 0 : test_var = PyLong_AsUnsignedLongLong(value);
57347 0 : if (PyErr_Occurred() != NULL) {
57348 0 : return -1;
57349 : }
57350 0 : if (test_var > uint_max) {
57351 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
57352 : PyLong_Type.tp_name, uint_max, test_var);
57353 0 : return -1;
57354 : }
57355 0 : object->in.flags = test_var;
57356 : } else {
57357 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
57358 : PyLong_Type.tp_name);
57359 0 : return -1;
57360 : }
57361 : }
57362 0 : return 0;
57363 : }
57364 :
57365 0 : static PyObject *py_netr_DsRGetForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure)
57366 : {
57367 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(obj);
57368 : PyObject *py_forest_trust_info;
57369 0 : if (object->out.forest_trust_info == NULL) {
57370 0 : Py_RETURN_NONE;
57371 : }
57372 0 : if (*object->out.forest_trust_info == NULL) {
57373 0 : py_forest_trust_info = Py_None;
57374 0 : Py_INCREF(py_forest_trust_info);
57375 : } else {
57376 0 : py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *object->out.forest_trust_info, *object->out.forest_trust_info);
57377 : }
57378 0 : return py_forest_trust_info;
57379 : }
57380 :
57381 0 : static int py_netr_DsRGetForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
57382 : {
57383 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57384 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info));
57385 0 : if (value == NULL) {
57386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.forest_trust_info");
57387 0 : return -1;
57388 : }
57389 0 : object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info);
57390 0 : if (object->out.forest_trust_info == NULL) {
57391 0 : PyErr_NoMemory();
57392 0 : return -1;
57393 : }
57394 0 : if (value == Py_None) {
57395 0 : *object->out.forest_trust_info = NULL;
57396 : } else {
57397 0 : *object->out.forest_trust_info = NULL;
57398 0 : PY_CHECK_TYPE(lsa_ForestTrustInformation_Type, value, return -1;);
57399 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
57400 0 : PyErr_NoMemory();
57401 0 : return -1;
57402 : }
57403 0 : *object->out.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
57404 : }
57405 0 : return 0;
57406 : }
57407 :
57408 0 : static PyObject *py_netr_DsRGetForestTrustInformation_get_result(PyObject *obj, void *closure)
57409 : {
57410 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(obj);
57411 : PyObject *py_result;
57412 0 : py_result = PyErr_FromWERROR(object->out.result);
57413 0 : return py_result;
57414 : }
57415 :
57416 0 : static int py_netr_DsRGetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
57417 : {
57418 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57419 0 : if (value == NULL) {
57420 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
57421 0 : return -1;
57422 : }
57423 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
57424 0 : return 0;
57425 : }
57426 :
57427 : static PyGetSetDef py_netr_DsRGetForestTrustInformation_getsetters[] = {
57428 : {
57429 : .name = discard_const_p(char, "in_server_name"),
57430 : .get = py_netr_DsRGetForestTrustInformation_in_get_server_name,
57431 : .set = py_netr_DsRGetForestTrustInformation_in_set_server_name,
57432 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
57433 : },
57434 : {
57435 : .name = discard_const_p(char, "in_trusted_domain_name"),
57436 : .get = py_netr_DsRGetForestTrustInformation_in_get_trusted_domain_name,
57437 : .set = py_netr_DsRGetForestTrustInformation_in_set_trusted_domain_name,
57438 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
57439 : },
57440 : {
57441 : .name = discard_const_p(char, "in_flags"),
57442 : .get = py_netr_DsRGetForestTrustInformation_in_get_flags,
57443 : .set = py_netr_DsRGetForestTrustInformation_in_set_flags,
57444 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
57445 : },
57446 : {
57447 : .name = discard_const_p(char, "out_forest_trust_info"),
57448 : .get = py_netr_DsRGetForestTrustInformation_out_get_forest_trust_info,
57449 : .set = py_netr_DsRGetForestTrustInformation_out_set_forest_trust_info,
57450 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
57451 : },
57452 : {
57453 : .name = discard_const_p(char, "result"),
57454 : .get = py_netr_DsRGetForestTrustInformation_get_result,
57455 : .set = py_netr_DsRGetForestTrustInformation_set_result,
57456 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
57457 : },
57458 : { .name = NULL }
57459 : };
57460 :
57461 0 : static PyObject *py_netr_DsRGetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
57462 : {
57463 0 : PyObject *self = pytalloc_new(struct netr_DsRGetForestTrustInformation, type);
57464 0 : struct netr_DsRGetForestTrustInformation *_self = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(self);
57465 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
57466 : /* a pointer to a NULL pointer */
57467 0 : _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
57468 0 : return self;
57469 : }
57470 :
57471 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
57472 : {
57473 :
57474 :
57475 0 : return PyLong_FromLong(43);
57476 : }
57477 :
57478 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
57479 : {
57480 0 : const struct ndr_interface_call *call = NULL;
57481 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57482 0 : PyObject *ret = NULL;
57483 0 : struct ndr_push *push = NULL;
57484 : DATA_BLOB blob;
57485 : enum ndr_err_code err;
57486 :
57487 0 : if (ndr_table_netlogon.num_calls < 44) {
57488 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetForestTrustInformation_ndr_pack");
57489 0 : return NULL;
57490 : }
57491 0 : call = &ndr_table_netlogon.calls[43];
57492 :
57493 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
57494 0 : if (push == NULL) {
57495 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
57496 0 : return NULL;
57497 : }
57498 :
57499 0 : push->flags |= ndr_push_flags;
57500 :
57501 0 : err = call->ndr_push(push, ndr_inout_flags, object);
57502 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
57503 0 : TALLOC_FREE(push);
57504 0 : PyErr_SetNdrError(err);
57505 0 : return NULL;
57506 : }
57507 0 : blob = ndr_push_blob(push);
57508 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
57509 0 : TALLOC_FREE(push);
57510 0 : return ret;
57511 : }
57512 :
57513 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
57514 : {
57515 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
57516 0 : PyObject *bigendian_obj = NULL;
57517 0 : PyObject *ndr64_obj = NULL;
57518 0 : uint32_t ndr_push_flags = 0;
57519 :
57520 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
57521 : discard_const_p(char *, kwnames),
57522 : &bigendian_obj,
57523 : &ndr64_obj)) {
57524 0 : return NULL;
57525 : }
57526 :
57527 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
57528 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
57529 : }
57530 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
57531 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
57532 : }
57533 :
57534 0 : return py_netr_DsRGetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
57535 : }
57536 :
57537 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
57538 : {
57539 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
57540 0 : PyObject *bigendian_obj = NULL;
57541 0 : PyObject *ndr64_obj = NULL;
57542 0 : uint32_t ndr_push_flags = 0;
57543 :
57544 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
57545 : discard_const_p(char *, kwnames),
57546 : &bigendian_obj,
57547 : &ndr64_obj)) {
57548 0 : return NULL;
57549 : }
57550 :
57551 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
57552 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
57553 : }
57554 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
57555 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
57556 : }
57557 :
57558 0 : return py_netr_DsRGetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
57559 : }
57560 :
57561 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
57562 : {
57563 0 : const struct ndr_interface_call *call = NULL;
57564 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57565 0 : struct ndr_pull *pull = NULL;
57566 : enum ndr_err_code err;
57567 :
57568 0 : if (ndr_table_netlogon.num_calls < 44) {
57569 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetForestTrustInformation_ndr_unpack");
57570 0 : return NULL;
57571 : }
57572 0 : call = &ndr_table_netlogon.calls[43];
57573 :
57574 0 : pull = ndr_pull_init_blob(blob, object);
57575 0 : if (pull == NULL) {
57576 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
57577 0 : return NULL;
57578 : }
57579 :
57580 0 : pull->flags |= ndr_pull_flags;
57581 :
57582 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
57583 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
57584 0 : TALLOC_FREE(pull);
57585 0 : PyErr_SetNdrError(err);
57586 0 : return NULL;
57587 : }
57588 0 : if (!allow_remaining) {
57589 : uint32_t highest_ofs;
57590 :
57591 0 : if (pull->offset > pull->relative_highest_offset) {
57592 0 : highest_ofs = pull->offset;
57593 : } else {
57594 0 : highest_ofs = pull->relative_highest_offset;
57595 : }
57596 0 : if (highest_ofs < pull->data_size) {
57597 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
57598 : "not all bytes consumed ofs[%u] size[%u]",
57599 : highest_ofs, pull->data_size);
57600 0 : TALLOC_FREE(pull);
57601 0 : PyErr_SetNdrError(err);
57602 0 : return NULL;
57603 : }
57604 : }
57605 :
57606 0 : TALLOC_FREE(pull);
57607 0 : Py_RETURN_NONE;
57608 : }
57609 :
57610 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
57611 : {
57612 : DATA_BLOB blob;
57613 0 : Py_ssize_t blob_length = 0;
57614 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
57615 0 : PyObject *bigendian_obj = NULL;
57616 0 : PyObject *ndr64_obj = NULL;
57617 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
57618 0 : PyObject *allow_remaining_obj = NULL;
57619 0 : bool allow_remaining = false;
57620 :
57621 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
57622 : discard_const_p(char *, kwnames),
57623 : &blob.data, &blob_length,
57624 : &bigendian_obj,
57625 : &ndr64_obj,
57626 : &allow_remaining_obj)) {
57627 0 : return NULL;
57628 : }
57629 0 : blob.length = blob_length;
57630 :
57631 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
57632 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
57633 : }
57634 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
57635 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
57636 : }
57637 :
57638 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
57639 0 : allow_remaining = true;
57640 : }
57641 :
57642 0 : return py_netr_DsRGetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
57643 : }
57644 :
57645 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
57646 : {
57647 : DATA_BLOB blob;
57648 0 : Py_ssize_t blob_length = 0;
57649 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
57650 0 : PyObject *bigendian_obj = NULL;
57651 0 : PyObject *ndr64_obj = NULL;
57652 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
57653 0 : PyObject *allow_remaining_obj = NULL;
57654 0 : bool allow_remaining = false;
57655 :
57656 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
57657 : discard_const_p(char *, kwnames),
57658 : &blob.data, &blob_length,
57659 : &bigendian_obj,
57660 : &ndr64_obj,
57661 : &allow_remaining_obj)) {
57662 0 : return NULL;
57663 : }
57664 0 : blob.length = blob_length;
57665 :
57666 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
57667 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
57668 : }
57669 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
57670 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
57671 : }
57672 :
57673 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
57674 0 : allow_remaining = true;
57675 : }
57676 :
57677 0 : return py_netr_DsRGetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
57678 : }
57679 :
57680 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
57681 : {
57682 0 : const struct ndr_interface_call *call = NULL;
57683 0 : struct netr_DsRGetForestTrustInformation *object = (struct netr_DsRGetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57684 : PyObject *ret;
57685 : char *retstr;
57686 :
57687 0 : if (ndr_table_netlogon.num_calls < 44) {
57688 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsRGetForestTrustInformation_ndr_print");
57689 0 : return NULL;
57690 : }
57691 0 : call = &ndr_table_netlogon.calls[43];
57692 :
57693 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
57694 0 : ret = PyUnicode_FromString(retstr);
57695 0 : TALLOC_FREE(retstr);
57696 :
57697 0 : return ret;
57698 : }
57699 :
57700 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
57701 : {
57702 0 : return py_netr_DsRGetForestTrustInformation_ndr_print(py_obj, "netr_DsRGetForestTrustInformation_in", NDR_IN);
57703 : }
57704 :
57705 0 : static PyObject *py_netr_DsRGetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
57706 : {
57707 0 : return py_netr_DsRGetForestTrustInformation_ndr_print(py_obj, "netr_DsRGetForestTrustInformation_out", NDR_OUT);
57708 : }
57709 :
57710 : static PyMethodDef py_netr_DsRGetForestTrustInformation_methods[] = {
57711 : { "opnum", (PyCFunction)py_netr_DsRGetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
57712 : "netlogon.netr_DsRGetForestTrustInformation.opnum() -> 43 (0x2b) " },
57713 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
57714 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
57715 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
57716 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
57717 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
57718 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
57719 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsRGetForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
57720 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
57721 : { "__ndr_print_in__", (PyCFunction)py_netr_DsRGetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
57722 : { "__ndr_print_out__", (PyCFunction)py_netr_DsRGetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
57723 : { NULL, NULL, 0, NULL }
57724 : };
57725 :
57726 :
57727 : static PyTypeObject netr_DsRGetForestTrustInformation_Type = {
57728 : PyVarObject_HEAD_INIT(NULL, 0)
57729 : .tp_name = "netlogon.netr_DsRGetForestTrustInformation",
57730 : .tp_getset = py_netr_DsRGetForestTrustInformation_getsetters,
57731 : .tp_methods = py_netr_DsRGetForestTrustInformation_methods,
57732 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
57733 : .tp_new = py_netr_DsRGetForestTrustInformation_new,
57734 : };
57735 :
57736 138 : static bool pack_py_netr_DsRGetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct netr_DsRGetForestTrustInformation *r)
57737 : {
57738 : PyObject *py_server_name;
57739 : PyObject *py_trusted_domain_name;
57740 : PyObject *py_flags;
57741 138 : const char *kwnames[] = {
57742 : "server_name", "trusted_domain_name", "flags", NULL
57743 : };
57744 :
57745 138 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:netr_DsRGetForestTrustInformation", discard_const_p(char *, kwnames), &py_server_name, &py_trusted_domain_name, &py_flags)) {
57746 0 : return false;
57747 : }
57748 :
57749 138 : if (py_server_name == NULL) {
57750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
57751 0 : return false;
57752 : }
57753 138 : if (py_server_name == Py_None) {
57754 0 : r->in.server_name = NULL;
57755 : } else {
57756 138 : r->in.server_name = NULL;
57757 : {
57758 : const char *test_str;
57759 : const char *talloc_str;
57760 138 : PyObject *unicode = NULL;
57761 138 : if (PyUnicode_Check(py_server_name)) {
57762 138 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
57763 138 : if (unicode == NULL) {
57764 0 : PyErr_NoMemory();
57765 0 : return false;
57766 : }
57767 138 : test_str = PyBytes_AS_STRING(unicode);
57768 0 : } else if (PyBytes_Check(py_server_name)) {
57769 0 : test_str = PyBytes_AS_STRING(py_server_name);
57770 : } else {
57771 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
57772 0 : return false;
57773 : }
57774 138 : talloc_str = talloc_strdup(r, test_str);
57775 138 : if (unicode != NULL) {
57776 138 : Py_DECREF(unicode);
57777 : }
57778 138 : if (talloc_str == NULL) {
57779 0 : PyErr_NoMemory();
57780 0 : return false;
57781 : }
57782 138 : r->in.server_name = talloc_str;
57783 : }
57784 : }
57785 138 : if (py_trusted_domain_name == NULL) {
57786 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain_name");
57787 0 : return false;
57788 : }
57789 138 : if (py_trusted_domain_name == Py_None) {
57790 118 : r->in.trusted_domain_name = NULL;
57791 : } else {
57792 20 : r->in.trusted_domain_name = NULL;
57793 : {
57794 : const char *test_str;
57795 : const char *talloc_str;
57796 20 : PyObject *unicode = NULL;
57797 20 : if (PyUnicode_Check(py_trusted_domain_name)) {
57798 20 : unicode = PyUnicode_AsEncodedString(py_trusted_domain_name, "utf-8", "ignore");
57799 20 : if (unicode == NULL) {
57800 0 : PyErr_NoMemory();
57801 0 : return false;
57802 : }
57803 20 : test_str = PyBytes_AS_STRING(unicode);
57804 0 : } else if (PyBytes_Check(py_trusted_domain_name)) {
57805 0 : test_str = PyBytes_AS_STRING(py_trusted_domain_name);
57806 : } else {
57807 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_trusted_domain_name)->tp_name);
57808 0 : return false;
57809 : }
57810 20 : talloc_str = talloc_strdup(r, test_str);
57811 20 : if (unicode != NULL) {
57812 20 : Py_DECREF(unicode);
57813 : }
57814 20 : if (talloc_str == NULL) {
57815 0 : PyErr_NoMemory();
57816 0 : return false;
57817 : }
57818 20 : r->in.trusted_domain_name = talloc_str;
57819 : }
57820 : }
57821 138 : if (py_flags == NULL) {
57822 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
57823 0 : return false;
57824 : }
57825 : {
57826 138 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
57827 138 : if (PyLong_Check(py_flags)) {
57828 : unsigned long long test_var;
57829 138 : test_var = PyLong_AsUnsignedLongLong(py_flags);
57830 138 : if (PyErr_Occurred() != NULL) {
57831 0 : return false;
57832 : }
57833 138 : if (test_var > uint_max) {
57834 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
57835 : PyLong_Type.tp_name, uint_max, test_var);
57836 0 : return false;
57837 : }
57838 138 : r->in.flags = test_var;
57839 : } else {
57840 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
57841 : PyLong_Type.tp_name);
57842 0 : return false;
57843 : }
57844 : }
57845 138 : return true;
57846 : }
57847 :
57848 138 : static PyObject *unpack_py_netr_DsRGetForestTrustInformation_args_out(struct netr_DsRGetForestTrustInformation *r)
57849 : {
57850 : PyObject *result;
57851 : PyObject *py_forest_trust_info;
57852 138 : if (*r->out.forest_trust_info == NULL) {
57853 4 : py_forest_trust_info = Py_None;
57854 4 : Py_INCREF(py_forest_trust_info);
57855 : } else {
57856 134 : py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
57857 : }
57858 138 : result = py_forest_trust_info;
57859 138 : if (!W_ERROR_IS_OK(r->out.result)) {
57860 4 : PyErr_SetWERROR(r->out.result);
57861 4 : return NULL;
57862 : }
57863 :
57864 134 : return result;
57865 : }
57866 :
57867 :
57868 0 : static PyObject *py_netr_GetForestTrustInformation_in_get_server_name(PyObject *obj, void *closure)
57869 : {
57870 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj);
57871 : PyObject *py_server_name;
57872 0 : if (object->in.server_name == NULL) {
57873 0 : Py_RETURN_NONE;
57874 : }
57875 0 : if (object->in.server_name == NULL) {
57876 0 : py_server_name = Py_None;
57877 0 : Py_INCREF(py_server_name);
57878 : } else {
57879 0 : if (object->in.server_name == NULL) {
57880 0 : py_server_name = Py_None;
57881 0 : Py_INCREF(py_server_name);
57882 : } else {
57883 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
57884 : }
57885 : }
57886 0 : return py_server_name;
57887 : }
57888 :
57889 0 : static int py_netr_GetForestTrustInformation_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
57890 : {
57891 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57892 0 : if (value == NULL) {
57893 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
57894 0 : return -1;
57895 : }
57896 0 : if (value == Py_None) {
57897 0 : object->in.server_name = NULL;
57898 : } else {
57899 0 : object->in.server_name = NULL;
57900 : {
57901 : const char *test_str;
57902 : const char *talloc_str;
57903 0 : PyObject *unicode = NULL;
57904 0 : if (PyUnicode_Check(value)) {
57905 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
57906 0 : if (unicode == NULL) {
57907 0 : PyErr_NoMemory();
57908 0 : return -1;
57909 : }
57910 0 : test_str = PyBytes_AS_STRING(unicode);
57911 0 : } else if (PyBytes_Check(value)) {
57912 0 : test_str = PyBytes_AS_STRING(value);
57913 : } else {
57914 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
57915 0 : return -1;
57916 : }
57917 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
57918 0 : if (unicode != NULL) {
57919 0 : Py_DECREF(unicode);
57920 : }
57921 0 : if (talloc_str == NULL) {
57922 0 : PyErr_NoMemory();
57923 0 : return -1;
57924 : }
57925 0 : object->in.server_name = talloc_str;
57926 : }
57927 : }
57928 0 : return 0;
57929 : }
57930 :
57931 0 : static PyObject *py_netr_GetForestTrustInformation_in_get_computer_name(PyObject *obj, void *closure)
57932 : {
57933 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj);
57934 : PyObject *py_computer_name;
57935 0 : if (object->in.computer_name == NULL) {
57936 0 : Py_RETURN_NONE;
57937 : }
57938 0 : if (object->in.computer_name == NULL) {
57939 0 : py_computer_name = Py_None;
57940 0 : Py_INCREF(py_computer_name);
57941 : } else {
57942 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
57943 : }
57944 0 : return py_computer_name;
57945 : }
57946 :
57947 0 : static int py_netr_GetForestTrustInformation_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
57948 : {
57949 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
57950 0 : if (value == NULL) {
57951 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
57952 0 : return -1;
57953 : }
57954 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
57955 0 : if (object->in.computer_name == NULL) {
57956 0 : PyErr_NoMemory();
57957 0 : return -1;
57958 : }
57959 : {
57960 : const char *test_str;
57961 : const char *talloc_str;
57962 0 : PyObject *unicode = NULL;
57963 0 : if (PyUnicode_Check(value)) {
57964 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
57965 0 : if (unicode == NULL) {
57966 0 : PyErr_NoMemory();
57967 0 : return -1;
57968 : }
57969 0 : test_str = PyBytes_AS_STRING(unicode);
57970 0 : } else if (PyBytes_Check(value)) {
57971 0 : test_str = PyBytes_AS_STRING(value);
57972 : } else {
57973 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
57974 0 : return -1;
57975 : }
57976 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
57977 0 : if (unicode != NULL) {
57978 0 : Py_DECREF(unicode);
57979 : }
57980 0 : if (talloc_str == NULL) {
57981 0 : PyErr_NoMemory();
57982 0 : return -1;
57983 : }
57984 0 : object->in.computer_name = talloc_str;
57985 : }
57986 0 : return 0;
57987 : }
57988 :
57989 0 : static PyObject *py_netr_GetForestTrustInformation_in_get_credential(PyObject *obj, void *closure)
57990 : {
57991 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj);
57992 : PyObject *py_credential;
57993 0 : if (object->in.credential == NULL) {
57994 0 : Py_RETURN_NONE;
57995 : }
57996 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
57997 0 : return py_credential;
57998 : }
57999 :
58000 0 : static int py_netr_GetForestTrustInformation_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
58001 : {
58002 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
58003 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
58004 0 : if (value == NULL) {
58005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
58006 0 : return -1;
58007 : }
58008 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
58009 0 : if (object->in.credential == NULL) {
58010 0 : PyErr_NoMemory();
58011 0 : return -1;
58012 : }
58013 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
58014 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
58015 0 : PyErr_NoMemory();
58016 0 : return -1;
58017 : }
58018 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
58019 0 : return 0;
58020 : }
58021 :
58022 0 : static PyObject *py_netr_GetForestTrustInformation_out_get_return_authenticator(PyObject *obj, void *closure)
58023 : {
58024 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj);
58025 : PyObject *py_return_authenticator;
58026 0 : if (object->out.return_authenticator == NULL) {
58027 0 : Py_RETURN_NONE;
58028 : }
58029 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
58030 0 : return py_return_authenticator;
58031 : }
58032 :
58033 0 : static int py_netr_GetForestTrustInformation_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
58034 : {
58035 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
58036 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
58037 0 : if (value == NULL) {
58038 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
58039 0 : return -1;
58040 : }
58041 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
58042 0 : if (object->out.return_authenticator == NULL) {
58043 0 : PyErr_NoMemory();
58044 0 : return -1;
58045 : }
58046 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
58047 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
58048 0 : PyErr_NoMemory();
58049 0 : return -1;
58050 : }
58051 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
58052 0 : return 0;
58053 : }
58054 :
58055 0 : static PyObject *py_netr_GetForestTrustInformation_in_get_flags(PyObject *obj, void *closure)
58056 : {
58057 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj);
58058 : PyObject *py_flags;
58059 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
58060 0 : return py_flags;
58061 : }
58062 :
58063 0 : static int py_netr_GetForestTrustInformation_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
58064 : {
58065 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
58066 0 : if (value == NULL) {
58067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
58068 0 : return -1;
58069 : }
58070 : {
58071 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
58072 0 : if (PyLong_Check(value)) {
58073 : unsigned long long test_var;
58074 0 : test_var = PyLong_AsUnsignedLongLong(value);
58075 0 : if (PyErr_Occurred() != NULL) {
58076 0 : return -1;
58077 : }
58078 0 : if (test_var > uint_max) {
58079 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
58080 : PyLong_Type.tp_name, uint_max, test_var);
58081 0 : return -1;
58082 : }
58083 0 : object->in.flags = test_var;
58084 : } else {
58085 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
58086 : PyLong_Type.tp_name);
58087 0 : return -1;
58088 : }
58089 : }
58090 0 : return 0;
58091 : }
58092 :
58093 0 : static PyObject *py_netr_GetForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure)
58094 : {
58095 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj);
58096 : PyObject *py_forest_trust_info;
58097 0 : if (object->out.forest_trust_info == NULL) {
58098 0 : Py_RETURN_NONE;
58099 : }
58100 0 : if (*object->out.forest_trust_info == NULL) {
58101 0 : py_forest_trust_info = Py_None;
58102 0 : Py_INCREF(py_forest_trust_info);
58103 : } else {
58104 0 : py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *object->out.forest_trust_info, *object->out.forest_trust_info);
58105 : }
58106 0 : return py_forest_trust_info;
58107 : }
58108 :
58109 0 : static int py_netr_GetForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
58110 : {
58111 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
58112 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info));
58113 0 : if (value == NULL) {
58114 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.forest_trust_info");
58115 0 : return -1;
58116 : }
58117 0 : object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info);
58118 0 : if (object->out.forest_trust_info == NULL) {
58119 0 : PyErr_NoMemory();
58120 0 : return -1;
58121 : }
58122 0 : if (value == Py_None) {
58123 0 : *object->out.forest_trust_info = NULL;
58124 : } else {
58125 0 : *object->out.forest_trust_info = NULL;
58126 0 : PY_CHECK_TYPE(lsa_ForestTrustInformation_Type, value, return -1;);
58127 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
58128 0 : PyErr_NoMemory();
58129 0 : return -1;
58130 : }
58131 0 : *object->out.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
58132 : }
58133 0 : return 0;
58134 : }
58135 :
58136 0 : static PyObject *py_netr_GetForestTrustInformation_get_result(PyObject *obj, void *closure)
58137 : {
58138 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(obj);
58139 : PyObject *py_result;
58140 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
58141 0 : return py_result;
58142 : }
58143 :
58144 0 : static int py_netr_GetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
58145 : {
58146 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
58147 0 : if (value == NULL) {
58148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
58149 0 : return -1;
58150 : }
58151 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
58152 0 : return 0;
58153 : }
58154 :
58155 : static PyGetSetDef py_netr_GetForestTrustInformation_getsetters[] = {
58156 : {
58157 : .name = discard_const_p(char, "in_server_name"),
58158 : .get = py_netr_GetForestTrustInformation_in_get_server_name,
58159 : .set = py_netr_GetForestTrustInformation_in_set_server_name,
58160 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
58161 : },
58162 : {
58163 : .name = discard_const_p(char, "in_computer_name"),
58164 : .get = py_netr_GetForestTrustInformation_in_get_computer_name,
58165 : .set = py_netr_GetForestTrustInformation_in_set_computer_name,
58166 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
58167 : },
58168 : {
58169 : .name = discard_const_p(char, "in_credential"),
58170 : .get = py_netr_GetForestTrustInformation_in_get_credential,
58171 : .set = py_netr_GetForestTrustInformation_in_set_credential,
58172 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
58173 : },
58174 : {
58175 : .name = discard_const_p(char, "out_return_authenticator"),
58176 : .get = py_netr_GetForestTrustInformation_out_get_return_authenticator,
58177 : .set = py_netr_GetForestTrustInformation_out_set_return_authenticator,
58178 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
58179 : },
58180 : {
58181 : .name = discard_const_p(char, "in_flags"),
58182 : .get = py_netr_GetForestTrustInformation_in_get_flags,
58183 : .set = py_netr_GetForestTrustInformation_in_set_flags,
58184 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
58185 : },
58186 : {
58187 : .name = discard_const_p(char, "out_forest_trust_info"),
58188 : .get = py_netr_GetForestTrustInformation_out_get_forest_trust_info,
58189 : .set = py_netr_GetForestTrustInformation_out_set_forest_trust_info,
58190 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
58191 : },
58192 : {
58193 : .name = discard_const_p(char, "result"),
58194 : .get = py_netr_GetForestTrustInformation_get_result,
58195 : .set = py_netr_GetForestTrustInformation_set_result,
58196 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
58197 : },
58198 : { .name = NULL }
58199 : };
58200 :
58201 0 : static PyObject *py_netr_GetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
58202 : {
58203 0 : PyObject *self = pytalloc_new(struct netr_GetForestTrustInformation, type);
58204 0 : struct netr_GetForestTrustInformation *_self = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(self);
58205 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
58206 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
58207 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
58208 : /* a pointer to a NULL pointer */
58209 0 : _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
58210 0 : return self;
58211 : }
58212 :
58213 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
58214 : {
58215 :
58216 :
58217 0 : return PyLong_FromLong(44);
58218 : }
58219 :
58220 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
58221 : {
58222 0 : const struct ndr_interface_call *call = NULL;
58223 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
58224 0 : PyObject *ret = NULL;
58225 0 : struct ndr_push *push = NULL;
58226 : DATA_BLOB blob;
58227 : enum ndr_err_code err;
58228 :
58229 0 : if (ndr_table_netlogon.num_calls < 45) {
58230 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetForestTrustInformation_ndr_pack");
58231 0 : return NULL;
58232 : }
58233 0 : call = &ndr_table_netlogon.calls[44];
58234 :
58235 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
58236 0 : if (push == NULL) {
58237 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
58238 0 : return NULL;
58239 : }
58240 :
58241 0 : push->flags |= ndr_push_flags;
58242 :
58243 0 : err = call->ndr_push(push, ndr_inout_flags, object);
58244 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
58245 0 : TALLOC_FREE(push);
58246 0 : PyErr_SetNdrError(err);
58247 0 : return NULL;
58248 : }
58249 0 : blob = ndr_push_blob(push);
58250 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
58251 0 : TALLOC_FREE(push);
58252 0 : return ret;
58253 : }
58254 :
58255 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
58256 : {
58257 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
58258 0 : PyObject *bigendian_obj = NULL;
58259 0 : PyObject *ndr64_obj = NULL;
58260 0 : uint32_t ndr_push_flags = 0;
58261 :
58262 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
58263 : discard_const_p(char *, kwnames),
58264 : &bigendian_obj,
58265 : &ndr64_obj)) {
58266 0 : return NULL;
58267 : }
58268 :
58269 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
58270 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
58271 : }
58272 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
58273 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
58274 : }
58275 :
58276 0 : return py_netr_GetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
58277 : }
58278 :
58279 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
58280 : {
58281 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
58282 0 : PyObject *bigendian_obj = NULL;
58283 0 : PyObject *ndr64_obj = NULL;
58284 0 : uint32_t ndr_push_flags = 0;
58285 :
58286 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
58287 : discard_const_p(char *, kwnames),
58288 : &bigendian_obj,
58289 : &ndr64_obj)) {
58290 0 : return NULL;
58291 : }
58292 :
58293 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
58294 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
58295 : }
58296 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
58297 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
58298 : }
58299 :
58300 0 : return py_netr_GetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
58301 : }
58302 :
58303 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
58304 : {
58305 0 : const struct ndr_interface_call *call = NULL;
58306 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
58307 0 : struct ndr_pull *pull = NULL;
58308 : enum ndr_err_code err;
58309 :
58310 0 : if (ndr_table_netlogon.num_calls < 45) {
58311 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetForestTrustInformation_ndr_unpack");
58312 0 : return NULL;
58313 : }
58314 0 : call = &ndr_table_netlogon.calls[44];
58315 :
58316 0 : pull = ndr_pull_init_blob(blob, object);
58317 0 : if (pull == NULL) {
58318 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
58319 0 : return NULL;
58320 : }
58321 :
58322 0 : pull->flags |= ndr_pull_flags;
58323 :
58324 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
58325 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
58326 0 : TALLOC_FREE(pull);
58327 0 : PyErr_SetNdrError(err);
58328 0 : return NULL;
58329 : }
58330 0 : if (!allow_remaining) {
58331 : uint32_t highest_ofs;
58332 :
58333 0 : if (pull->offset > pull->relative_highest_offset) {
58334 0 : highest_ofs = pull->offset;
58335 : } else {
58336 0 : highest_ofs = pull->relative_highest_offset;
58337 : }
58338 0 : if (highest_ofs < pull->data_size) {
58339 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
58340 : "not all bytes consumed ofs[%u] size[%u]",
58341 : highest_ofs, pull->data_size);
58342 0 : TALLOC_FREE(pull);
58343 0 : PyErr_SetNdrError(err);
58344 0 : return NULL;
58345 : }
58346 : }
58347 :
58348 0 : TALLOC_FREE(pull);
58349 0 : Py_RETURN_NONE;
58350 : }
58351 :
58352 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
58353 : {
58354 : DATA_BLOB blob;
58355 0 : Py_ssize_t blob_length = 0;
58356 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
58357 0 : PyObject *bigendian_obj = NULL;
58358 0 : PyObject *ndr64_obj = NULL;
58359 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
58360 0 : PyObject *allow_remaining_obj = NULL;
58361 0 : bool allow_remaining = false;
58362 :
58363 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
58364 : discard_const_p(char *, kwnames),
58365 : &blob.data, &blob_length,
58366 : &bigendian_obj,
58367 : &ndr64_obj,
58368 : &allow_remaining_obj)) {
58369 0 : return NULL;
58370 : }
58371 0 : blob.length = blob_length;
58372 :
58373 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
58374 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
58375 : }
58376 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
58377 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
58378 : }
58379 :
58380 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
58381 0 : allow_remaining = true;
58382 : }
58383 :
58384 0 : return py_netr_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
58385 : }
58386 :
58387 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
58388 : {
58389 : DATA_BLOB blob;
58390 0 : Py_ssize_t blob_length = 0;
58391 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
58392 0 : PyObject *bigendian_obj = NULL;
58393 0 : PyObject *ndr64_obj = NULL;
58394 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
58395 0 : PyObject *allow_remaining_obj = NULL;
58396 0 : bool allow_remaining = false;
58397 :
58398 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
58399 : discard_const_p(char *, kwnames),
58400 : &blob.data, &blob_length,
58401 : &bigendian_obj,
58402 : &ndr64_obj,
58403 : &allow_remaining_obj)) {
58404 0 : return NULL;
58405 : }
58406 0 : blob.length = blob_length;
58407 :
58408 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
58409 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
58410 : }
58411 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
58412 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
58413 : }
58414 :
58415 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
58416 0 : allow_remaining = true;
58417 : }
58418 :
58419 0 : return py_netr_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
58420 : }
58421 :
58422 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
58423 : {
58424 0 : const struct ndr_interface_call *call = NULL;
58425 0 : struct netr_GetForestTrustInformation *object = (struct netr_GetForestTrustInformation *)pytalloc_get_ptr(py_obj);
58426 : PyObject *ret;
58427 : char *retstr;
58428 :
58429 0 : if (ndr_table_netlogon.num_calls < 45) {
58430 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_GetForestTrustInformation_ndr_print");
58431 0 : return NULL;
58432 : }
58433 0 : call = &ndr_table_netlogon.calls[44];
58434 :
58435 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
58436 0 : ret = PyUnicode_FromString(retstr);
58437 0 : TALLOC_FREE(retstr);
58438 :
58439 0 : return ret;
58440 : }
58441 :
58442 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
58443 : {
58444 0 : return py_netr_GetForestTrustInformation_ndr_print(py_obj, "netr_GetForestTrustInformation_in", NDR_IN);
58445 : }
58446 :
58447 0 : static PyObject *py_netr_GetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
58448 : {
58449 0 : return py_netr_GetForestTrustInformation_ndr_print(py_obj, "netr_GetForestTrustInformation_out", NDR_OUT);
58450 : }
58451 :
58452 : static PyMethodDef py_netr_GetForestTrustInformation_methods[] = {
58453 : { "opnum", (PyCFunction)py_netr_GetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
58454 : "netlogon.netr_GetForestTrustInformation.opnum() -> 44 (0x2c) " },
58455 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
58456 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
58457 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
58458 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
58459 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
58460 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
58461 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_GetForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
58462 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
58463 : { "__ndr_print_in__", (PyCFunction)py_netr_GetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
58464 : { "__ndr_print_out__", (PyCFunction)py_netr_GetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
58465 : { NULL, NULL, 0, NULL }
58466 : };
58467 :
58468 :
58469 : static PyTypeObject netr_GetForestTrustInformation_Type = {
58470 : PyVarObject_HEAD_INIT(NULL, 0)
58471 : .tp_name = "netlogon.netr_GetForestTrustInformation",
58472 : .tp_getset = py_netr_GetForestTrustInformation_getsetters,
58473 : .tp_methods = py_netr_GetForestTrustInformation_methods,
58474 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
58475 : .tp_new = py_netr_GetForestTrustInformation_new,
58476 : };
58477 :
58478 0 : static bool pack_py_netr_GetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct netr_GetForestTrustInformation *r)
58479 : {
58480 : PyObject *py_server_name;
58481 : PyObject *py_computer_name;
58482 : PyObject *py_credential;
58483 : PyObject *py_flags;
58484 0 : const char *kwnames[] = {
58485 : "server_name", "computer_name", "credential", "flags", NULL
58486 : };
58487 :
58488 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:netr_GetForestTrustInformation", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_flags)) {
58489 0 : return false;
58490 : }
58491 :
58492 0 : if (py_server_name == NULL) {
58493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
58494 0 : return false;
58495 : }
58496 0 : if (py_server_name == Py_None) {
58497 0 : r->in.server_name = NULL;
58498 : } else {
58499 0 : r->in.server_name = NULL;
58500 : {
58501 : const char *test_str;
58502 : const char *talloc_str;
58503 0 : PyObject *unicode = NULL;
58504 0 : if (PyUnicode_Check(py_server_name)) {
58505 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
58506 0 : if (unicode == NULL) {
58507 0 : PyErr_NoMemory();
58508 0 : return false;
58509 : }
58510 0 : test_str = PyBytes_AS_STRING(unicode);
58511 0 : } else if (PyBytes_Check(py_server_name)) {
58512 0 : test_str = PyBytes_AS_STRING(py_server_name);
58513 : } else {
58514 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
58515 0 : return false;
58516 : }
58517 0 : talloc_str = talloc_strdup(r, test_str);
58518 0 : if (unicode != NULL) {
58519 0 : Py_DECREF(unicode);
58520 : }
58521 0 : if (talloc_str == NULL) {
58522 0 : PyErr_NoMemory();
58523 0 : return false;
58524 : }
58525 0 : r->in.server_name = talloc_str;
58526 : }
58527 : }
58528 0 : if (py_computer_name == NULL) {
58529 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
58530 0 : return false;
58531 : }
58532 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
58533 0 : if (r->in.computer_name == NULL) {
58534 0 : PyErr_NoMemory();
58535 0 : return false;
58536 : }
58537 : {
58538 : const char *test_str;
58539 : const char *talloc_str;
58540 0 : PyObject *unicode = NULL;
58541 0 : if (PyUnicode_Check(py_computer_name)) {
58542 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
58543 0 : if (unicode == NULL) {
58544 0 : PyErr_NoMemory();
58545 0 : return false;
58546 : }
58547 0 : test_str = PyBytes_AS_STRING(unicode);
58548 0 : } else if (PyBytes_Check(py_computer_name)) {
58549 0 : test_str = PyBytes_AS_STRING(py_computer_name);
58550 : } else {
58551 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
58552 0 : return false;
58553 : }
58554 0 : talloc_str = talloc_strdup(r, test_str);
58555 0 : if (unicode != NULL) {
58556 0 : Py_DECREF(unicode);
58557 : }
58558 0 : if (talloc_str == NULL) {
58559 0 : PyErr_NoMemory();
58560 0 : return false;
58561 : }
58562 0 : r->in.computer_name = talloc_str;
58563 : }
58564 0 : if (py_credential == NULL) {
58565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
58566 0 : return false;
58567 : }
58568 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
58569 0 : if (r->in.credential == NULL) {
58570 0 : PyErr_NoMemory();
58571 0 : return false;
58572 : }
58573 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
58574 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
58575 0 : PyErr_NoMemory();
58576 0 : return false;
58577 : }
58578 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
58579 0 : if (py_flags == NULL) {
58580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
58581 0 : return false;
58582 : }
58583 : {
58584 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
58585 0 : if (PyLong_Check(py_flags)) {
58586 : unsigned long long test_var;
58587 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
58588 0 : if (PyErr_Occurred() != NULL) {
58589 0 : return false;
58590 : }
58591 0 : if (test_var > uint_max) {
58592 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
58593 : PyLong_Type.tp_name, uint_max, test_var);
58594 0 : return false;
58595 : }
58596 0 : r->in.flags = test_var;
58597 : } else {
58598 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
58599 : PyLong_Type.tp_name);
58600 0 : return false;
58601 : }
58602 : }
58603 0 : return true;
58604 : }
58605 :
58606 0 : static PyObject *unpack_py_netr_GetForestTrustInformation_args_out(struct netr_GetForestTrustInformation *r)
58607 : {
58608 : PyObject *result;
58609 : PyObject *py_return_authenticator;
58610 : PyObject *py_forest_trust_info;
58611 0 : result = PyTuple_New(2);
58612 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
58613 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
58614 0 : if (*r->out.forest_trust_info == NULL) {
58615 0 : py_forest_trust_info = Py_None;
58616 0 : Py_INCREF(py_forest_trust_info);
58617 : } else {
58618 0 : py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
58619 : }
58620 0 : PyTuple_SetItem(result, 1, py_forest_trust_info);
58621 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
58622 0 : PyErr_SetNTSTATUS(r->out.result);
58623 0 : return NULL;
58624 : }
58625 :
58626 0 : return result;
58627 : }
58628 :
58629 :
58630 0 : static PyObject *py_netr_LogonSamLogonWithFlags_in_get_server_name(PyObject *obj, void *closure)
58631 : {
58632 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58633 : PyObject *py_server_name;
58634 0 : if (object->in.server_name == NULL) {
58635 0 : Py_RETURN_NONE;
58636 : }
58637 0 : if (object->in.server_name == NULL) {
58638 0 : py_server_name = Py_None;
58639 0 : Py_INCREF(py_server_name);
58640 : } else {
58641 0 : if (object->in.server_name == NULL) {
58642 0 : py_server_name = Py_None;
58643 0 : Py_INCREF(py_server_name);
58644 : } else {
58645 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
58646 : }
58647 : }
58648 0 : return py_server_name;
58649 : }
58650 :
58651 0 : static int py_netr_LogonSamLogonWithFlags_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
58652 : {
58653 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
58654 0 : if (value == NULL) {
58655 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
58656 0 : return -1;
58657 : }
58658 0 : if (value == Py_None) {
58659 0 : object->in.server_name = NULL;
58660 : } else {
58661 0 : object->in.server_name = NULL;
58662 : {
58663 : const char *test_str;
58664 : const char *talloc_str;
58665 0 : PyObject *unicode = NULL;
58666 0 : if (PyUnicode_Check(value)) {
58667 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
58668 0 : if (unicode == NULL) {
58669 0 : PyErr_NoMemory();
58670 0 : return -1;
58671 : }
58672 0 : test_str = PyBytes_AS_STRING(unicode);
58673 0 : } else if (PyBytes_Check(value)) {
58674 0 : test_str = PyBytes_AS_STRING(value);
58675 : } else {
58676 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
58677 0 : return -1;
58678 : }
58679 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
58680 0 : if (unicode != NULL) {
58681 0 : Py_DECREF(unicode);
58682 : }
58683 0 : if (talloc_str == NULL) {
58684 0 : PyErr_NoMemory();
58685 0 : return -1;
58686 : }
58687 0 : object->in.server_name = talloc_str;
58688 : }
58689 : }
58690 0 : return 0;
58691 : }
58692 :
58693 0 : static PyObject *py_netr_LogonSamLogonWithFlags_in_get_computer_name(PyObject *obj, void *closure)
58694 : {
58695 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58696 : PyObject *py_computer_name;
58697 0 : if (object->in.computer_name == NULL) {
58698 0 : Py_RETURN_NONE;
58699 : }
58700 0 : if (object->in.computer_name == NULL) {
58701 0 : py_computer_name = Py_None;
58702 0 : Py_INCREF(py_computer_name);
58703 : } else {
58704 0 : if (object->in.computer_name == NULL) {
58705 0 : py_computer_name = Py_None;
58706 0 : Py_INCREF(py_computer_name);
58707 : } else {
58708 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
58709 : }
58710 : }
58711 0 : return py_computer_name;
58712 : }
58713 :
58714 0 : static int py_netr_LogonSamLogonWithFlags_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
58715 : {
58716 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
58717 0 : if (value == NULL) {
58718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
58719 0 : return -1;
58720 : }
58721 0 : if (value == Py_None) {
58722 0 : object->in.computer_name = NULL;
58723 : } else {
58724 0 : object->in.computer_name = NULL;
58725 : {
58726 : const char *test_str;
58727 : const char *talloc_str;
58728 0 : PyObject *unicode = NULL;
58729 0 : if (PyUnicode_Check(value)) {
58730 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
58731 0 : if (unicode == NULL) {
58732 0 : PyErr_NoMemory();
58733 0 : return -1;
58734 : }
58735 0 : test_str = PyBytes_AS_STRING(unicode);
58736 0 : } else if (PyBytes_Check(value)) {
58737 0 : test_str = PyBytes_AS_STRING(value);
58738 : } else {
58739 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
58740 0 : return -1;
58741 : }
58742 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
58743 0 : if (unicode != NULL) {
58744 0 : Py_DECREF(unicode);
58745 : }
58746 0 : if (talloc_str == NULL) {
58747 0 : PyErr_NoMemory();
58748 0 : return -1;
58749 : }
58750 0 : object->in.computer_name = talloc_str;
58751 : }
58752 : }
58753 0 : return 0;
58754 : }
58755 :
58756 0 : static PyObject *py_netr_LogonSamLogonWithFlags_in_get_credential(PyObject *obj, void *closure)
58757 : {
58758 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58759 : PyObject *py_credential;
58760 0 : if (object->in.credential == NULL) {
58761 0 : Py_RETURN_NONE;
58762 : }
58763 0 : if (object->in.credential == NULL) {
58764 0 : py_credential = Py_None;
58765 0 : Py_INCREF(py_credential);
58766 : } else {
58767 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
58768 : }
58769 0 : return py_credential;
58770 : }
58771 :
58772 0 : static int py_netr_LogonSamLogonWithFlags_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
58773 : {
58774 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
58775 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
58776 0 : if (value == NULL) {
58777 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
58778 0 : return -1;
58779 : }
58780 0 : if (value == Py_None) {
58781 0 : object->in.credential = NULL;
58782 : } else {
58783 0 : object->in.credential = NULL;
58784 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
58785 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
58786 0 : PyErr_NoMemory();
58787 0 : return -1;
58788 : }
58789 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
58790 : }
58791 0 : return 0;
58792 : }
58793 :
58794 0 : static PyObject *py_netr_LogonSamLogonWithFlags_in_get_return_authenticator(PyObject *obj, void *closure)
58795 : {
58796 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58797 : PyObject *py_return_authenticator;
58798 0 : if (object->in.return_authenticator == NULL) {
58799 0 : Py_RETURN_NONE;
58800 : }
58801 0 : if (object->in.return_authenticator == NULL) {
58802 0 : py_return_authenticator = Py_None;
58803 0 : Py_INCREF(py_return_authenticator);
58804 : } else {
58805 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.return_authenticator, object->in.return_authenticator);
58806 : }
58807 0 : return py_return_authenticator;
58808 : }
58809 :
58810 0 : static int py_netr_LogonSamLogonWithFlags_in_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
58811 : {
58812 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
58813 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.return_authenticator));
58814 0 : if (value == NULL) {
58815 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.return_authenticator");
58816 0 : return -1;
58817 : }
58818 0 : if (value == Py_None) {
58819 0 : object->in.return_authenticator = NULL;
58820 : } else {
58821 0 : object->in.return_authenticator = NULL;
58822 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
58823 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
58824 0 : PyErr_NoMemory();
58825 0 : return -1;
58826 : }
58827 0 : object->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
58828 : }
58829 0 : return 0;
58830 : }
58831 :
58832 0 : static PyObject *py_netr_LogonSamLogonWithFlags_out_get_return_authenticator(PyObject *obj, void *closure)
58833 : {
58834 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58835 : PyObject *py_return_authenticator;
58836 0 : if (object->out.return_authenticator == NULL) {
58837 0 : Py_RETURN_NONE;
58838 : }
58839 0 : if (object->out.return_authenticator == NULL) {
58840 0 : py_return_authenticator = Py_None;
58841 0 : Py_INCREF(py_return_authenticator);
58842 : } else {
58843 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
58844 : }
58845 0 : return py_return_authenticator;
58846 : }
58847 :
58848 0 : static int py_netr_LogonSamLogonWithFlags_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
58849 : {
58850 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
58851 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
58852 0 : if (value == NULL) {
58853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
58854 0 : return -1;
58855 : }
58856 0 : if (value == Py_None) {
58857 0 : object->out.return_authenticator = NULL;
58858 : } else {
58859 0 : object->out.return_authenticator = NULL;
58860 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
58861 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
58862 0 : PyErr_NoMemory();
58863 0 : return -1;
58864 : }
58865 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
58866 : }
58867 0 : return 0;
58868 : }
58869 :
58870 0 : static PyObject *py_netr_LogonSamLogonWithFlags_in_get_logon_level(PyObject *obj, void *closure)
58871 : {
58872 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58873 : PyObject *py_logon_level;
58874 0 : py_logon_level = PyLong_FromLong((uint16_t)object->in.logon_level);
58875 0 : return py_logon_level;
58876 : }
58877 :
58878 0 : static int py_netr_LogonSamLogonWithFlags_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure)
58879 : {
58880 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
58881 0 : if (value == NULL) {
58882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon_level");
58883 0 : return -1;
58884 : }
58885 : {
58886 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_level));
58887 0 : if (PyLong_Check(value)) {
58888 : unsigned long long test_var;
58889 0 : test_var = PyLong_AsUnsignedLongLong(value);
58890 0 : if (PyErr_Occurred() != NULL) {
58891 0 : return -1;
58892 : }
58893 0 : if (test_var > uint_max) {
58894 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
58895 : PyLong_Type.tp_name, uint_max, test_var);
58896 0 : return -1;
58897 : }
58898 0 : object->in.logon_level = test_var;
58899 : } else {
58900 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
58901 : PyLong_Type.tp_name);
58902 0 : return -1;
58903 : }
58904 : }
58905 0 : return 0;
58906 : }
58907 :
58908 0 : static PyObject *py_netr_LogonSamLogonWithFlags_in_get_logon(PyObject *obj, void *closure)
58909 : {
58910 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58911 : PyObject *py_logon;
58912 0 : if (object->in.logon == NULL) {
58913 0 : Py_RETURN_NONE;
58914 : }
58915 0 : py_logon = pyrpc_import_union(&netr_LogonLevel_Type, object->in.logon, object->in.logon_level, object->in.logon, "union netr_LogonLevel");
58916 0 : if (py_logon == NULL) {
58917 0 : return NULL;
58918 : }
58919 0 : return py_logon;
58920 : }
58921 :
58922 0 : static int py_netr_LogonSamLogonWithFlags_in_set_logon(PyObject *py_obj, PyObject *value, void *closure)
58923 : {
58924 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
58925 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.logon));
58926 0 : if (value == NULL) {
58927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.logon");
58928 0 : return -1;
58929 : }
58930 0 : object->in.logon = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.logon);
58931 0 : if (object->in.logon == NULL) {
58932 0 : PyErr_NoMemory();
58933 0 : return -1;
58934 : }
58935 : {
58936 : union netr_LogonLevel *logon_switch_1;
58937 0 : logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, pytalloc_get_mem_ctx(py_obj), object->in.logon_level, value, "union netr_LogonLevel");
58938 0 : if (logon_switch_1 == NULL) {
58939 0 : return -1;
58940 : }
58941 0 : object->in.logon = logon_switch_1;
58942 : }
58943 0 : return 0;
58944 : }
58945 :
58946 0 : static PyObject *py_netr_LogonSamLogonWithFlags_in_get_validation_level(PyObject *obj, void *closure)
58947 : {
58948 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58949 : PyObject *py_validation_level;
58950 0 : py_validation_level = PyLong_FromLong((uint16_t)object->in.validation_level);
58951 0 : return py_validation_level;
58952 : }
58953 :
58954 0 : static int py_netr_LogonSamLogonWithFlags_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure)
58955 : {
58956 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
58957 0 : if (value == NULL) {
58958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.validation_level");
58959 0 : return -1;
58960 : }
58961 : {
58962 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.validation_level));
58963 0 : if (PyLong_Check(value)) {
58964 : unsigned long long test_var;
58965 0 : test_var = PyLong_AsUnsignedLongLong(value);
58966 0 : if (PyErr_Occurred() != NULL) {
58967 0 : return -1;
58968 : }
58969 0 : if (test_var > uint_max) {
58970 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
58971 : PyLong_Type.tp_name, uint_max, test_var);
58972 0 : return -1;
58973 : }
58974 0 : object->in.validation_level = test_var;
58975 : } else {
58976 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
58977 : PyLong_Type.tp_name);
58978 0 : return -1;
58979 : }
58980 : }
58981 0 : return 0;
58982 : }
58983 :
58984 0 : static PyObject *py_netr_LogonSamLogonWithFlags_out_get_validation(PyObject *obj, void *closure)
58985 : {
58986 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
58987 : PyObject *py_validation;
58988 0 : if (object->out.validation == NULL) {
58989 0 : Py_RETURN_NONE;
58990 : }
58991 0 : py_validation = pyrpc_import_union(&netr_Validation_Type, object->out.validation, object->in.validation_level, object->out.validation, "union netr_Validation");
58992 0 : if (py_validation == NULL) {
58993 0 : return NULL;
58994 : }
58995 0 : return py_validation;
58996 : }
58997 :
58998 0 : static int py_netr_LogonSamLogonWithFlags_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
58999 : {
59000 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
59001 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation));
59002 0 : if (value == NULL) {
59003 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.validation");
59004 0 : return -1;
59005 : }
59006 0 : object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation);
59007 0 : if (object->out.validation == NULL) {
59008 0 : PyErr_NoMemory();
59009 0 : return -1;
59010 : }
59011 : {
59012 : union netr_Validation *validation_switch_1;
59013 0 : validation_switch_1 = (union netr_Validation *)pyrpc_export_union(&netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->in.validation_level, value, "union netr_Validation");
59014 0 : if (validation_switch_1 == NULL) {
59015 0 : return -1;
59016 : }
59017 0 : object->out.validation = validation_switch_1;
59018 : }
59019 0 : return 0;
59020 : }
59021 :
59022 0 : static PyObject *py_netr_LogonSamLogonWithFlags_out_get_authoritative(PyObject *obj, void *closure)
59023 : {
59024 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
59025 : PyObject *py_authoritative;
59026 0 : if (object->out.authoritative == NULL) {
59027 0 : Py_RETURN_NONE;
59028 : }
59029 0 : py_authoritative = PyLong_FromLong((uint16_t)*object->out.authoritative);
59030 0 : return py_authoritative;
59031 : }
59032 :
59033 0 : static int py_netr_LogonSamLogonWithFlags_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure)
59034 : {
59035 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
59036 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authoritative));
59037 0 : if (value == NULL) {
59038 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authoritative");
59039 0 : return -1;
59040 : }
59041 0 : object->out.authoritative = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authoritative);
59042 0 : if (object->out.authoritative == NULL) {
59043 0 : PyErr_NoMemory();
59044 0 : return -1;
59045 : }
59046 : {
59047 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.authoritative));
59048 0 : if (PyLong_Check(value)) {
59049 : unsigned long long test_var;
59050 0 : test_var = PyLong_AsUnsignedLongLong(value);
59051 0 : if (PyErr_Occurred() != NULL) {
59052 0 : return -1;
59053 : }
59054 0 : if (test_var > uint_max) {
59055 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
59056 : PyLong_Type.tp_name, uint_max, test_var);
59057 0 : return -1;
59058 : }
59059 0 : *object->out.authoritative = test_var;
59060 : } else {
59061 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
59062 : PyLong_Type.tp_name);
59063 0 : return -1;
59064 : }
59065 : }
59066 0 : return 0;
59067 : }
59068 :
59069 0 : static PyObject *py_netr_LogonSamLogonWithFlags_in_get_flags(PyObject *obj, void *closure)
59070 : {
59071 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
59072 : PyObject *py_flags;
59073 0 : if (object->in.flags == NULL) {
59074 0 : Py_RETURN_NONE;
59075 : }
59076 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->in.flags);
59077 0 : return py_flags;
59078 : }
59079 :
59080 0 : static int py_netr_LogonSamLogonWithFlags_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
59081 : {
59082 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
59083 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.flags));
59084 0 : if (value == NULL) {
59085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
59086 0 : return -1;
59087 : }
59088 0 : object->in.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.flags);
59089 0 : if (object->in.flags == NULL) {
59090 0 : PyErr_NoMemory();
59091 0 : return -1;
59092 : }
59093 : {
59094 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.flags));
59095 0 : if (PyLong_Check(value)) {
59096 : unsigned long long test_var;
59097 0 : test_var = PyLong_AsUnsignedLongLong(value);
59098 0 : if (PyErr_Occurred() != NULL) {
59099 0 : return -1;
59100 : }
59101 0 : if (test_var > uint_max) {
59102 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
59103 : PyLong_Type.tp_name, uint_max, test_var);
59104 0 : return -1;
59105 : }
59106 0 : *object->in.flags = test_var;
59107 : } else {
59108 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
59109 : PyLong_Type.tp_name);
59110 0 : return -1;
59111 : }
59112 : }
59113 0 : return 0;
59114 : }
59115 :
59116 0 : static PyObject *py_netr_LogonSamLogonWithFlags_out_get_flags(PyObject *obj, void *closure)
59117 : {
59118 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
59119 : PyObject *py_flags;
59120 0 : if (object->out.flags == NULL) {
59121 0 : Py_RETURN_NONE;
59122 : }
59123 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)*object->out.flags);
59124 0 : return py_flags;
59125 : }
59126 :
59127 0 : static int py_netr_LogonSamLogonWithFlags_out_set_flags(PyObject *py_obj, PyObject *value, void *closure)
59128 : {
59129 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
59130 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.flags));
59131 0 : if (value == NULL) {
59132 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.flags");
59133 0 : return -1;
59134 : }
59135 0 : object->out.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.flags);
59136 0 : if (object->out.flags == NULL) {
59137 0 : PyErr_NoMemory();
59138 0 : return -1;
59139 : }
59140 : {
59141 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.flags));
59142 0 : if (PyLong_Check(value)) {
59143 : unsigned long long test_var;
59144 0 : test_var = PyLong_AsUnsignedLongLong(value);
59145 0 : if (PyErr_Occurred() != NULL) {
59146 0 : return -1;
59147 : }
59148 0 : if (test_var > uint_max) {
59149 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
59150 : PyLong_Type.tp_name, uint_max, test_var);
59151 0 : return -1;
59152 : }
59153 0 : *object->out.flags = test_var;
59154 : } else {
59155 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
59156 : PyLong_Type.tp_name);
59157 0 : return -1;
59158 : }
59159 : }
59160 0 : return 0;
59161 : }
59162 :
59163 0 : static PyObject *py_netr_LogonSamLogonWithFlags_get_result(PyObject *obj, void *closure)
59164 : {
59165 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(obj);
59166 : PyObject *py_result;
59167 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
59168 0 : return py_result;
59169 : }
59170 :
59171 0 : static int py_netr_LogonSamLogonWithFlags_set_result(PyObject *py_obj, PyObject *value, void *closure)
59172 : {
59173 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
59174 0 : if (value == NULL) {
59175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
59176 0 : return -1;
59177 : }
59178 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
59179 0 : return 0;
59180 : }
59181 :
59182 : static PyGetSetDef py_netr_LogonSamLogonWithFlags_getsetters[] = {
59183 : {
59184 : .name = discard_const_p(char, "in_server_name"),
59185 : .get = py_netr_LogonSamLogonWithFlags_in_get_server_name,
59186 : .set = py_netr_LogonSamLogonWithFlags_in_set_server_name,
59187 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
59188 : },
59189 : {
59190 : .name = discard_const_p(char, "in_computer_name"),
59191 : .get = py_netr_LogonSamLogonWithFlags_in_get_computer_name,
59192 : .set = py_netr_LogonSamLogonWithFlags_in_set_computer_name,
59193 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
59194 : },
59195 : {
59196 : .name = discard_const_p(char, "in_credential"),
59197 : .get = py_netr_LogonSamLogonWithFlags_in_get_credential,
59198 : .set = py_netr_LogonSamLogonWithFlags_in_set_credential,
59199 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
59200 : },
59201 : {
59202 : .name = discard_const_p(char, "in_return_authenticator"),
59203 : .get = py_netr_LogonSamLogonWithFlags_in_get_return_authenticator,
59204 : .set = py_netr_LogonSamLogonWithFlags_in_set_return_authenticator,
59205 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
59206 : },
59207 : {
59208 : .name = discard_const_p(char, "out_return_authenticator"),
59209 : .get = py_netr_LogonSamLogonWithFlags_out_get_return_authenticator,
59210 : .set = py_netr_LogonSamLogonWithFlags_out_set_return_authenticator,
59211 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
59212 : },
59213 : {
59214 : .name = discard_const_p(char, "in_logon_level"),
59215 : .get = py_netr_LogonSamLogonWithFlags_in_get_logon_level,
59216 : .set = py_netr_LogonSamLogonWithFlags_in_set_logon_level,
59217 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonInfoClass")
59218 : },
59219 : {
59220 : .name = discard_const_p(char, "in_logon"),
59221 : .get = py_netr_LogonSamLogonWithFlags_in_get_logon,
59222 : .set = py_netr_LogonSamLogonWithFlags_in_set_logon,
59223 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonLevel")
59224 : },
59225 : {
59226 : .name = discard_const_p(char, "in_validation_level"),
59227 : .get = py_netr_LogonSamLogonWithFlags_in_get_validation_level,
59228 : .set = py_netr_LogonSamLogonWithFlags_in_set_validation_level,
59229 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
59230 : },
59231 : {
59232 : .name = discard_const_p(char, "out_validation"),
59233 : .get = py_netr_LogonSamLogonWithFlags_out_get_validation,
59234 : .set = py_netr_LogonSamLogonWithFlags_out_set_validation,
59235 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
59236 : },
59237 : {
59238 : .name = discard_const_p(char, "out_authoritative"),
59239 : .get = py_netr_LogonSamLogonWithFlags_out_get_authoritative,
59240 : .set = py_netr_LogonSamLogonWithFlags_out_set_authoritative,
59241 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
59242 : },
59243 : {
59244 : .name = discard_const_p(char, "in_flags"),
59245 : .get = py_netr_LogonSamLogonWithFlags_in_get_flags,
59246 : .set = py_netr_LogonSamLogonWithFlags_in_set_flags,
59247 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonSamLogon_flags")
59248 : },
59249 : {
59250 : .name = discard_const_p(char, "out_flags"),
59251 : .get = py_netr_LogonSamLogonWithFlags_out_get_flags,
59252 : .set = py_netr_LogonSamLogonWithFlags_out_set_flags,
59253 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonSamLogon_flags")
59254 : },
59255 : {
59256 : .name = discard_const_p(char, "result"),
59257 : .get = py_netr_LogonSamLogonWithFlags_get_result,
59258 : .set = py_netr_LogonSamLogonWithFlags_set_result,
59259 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
59260 : },
59261 : { .name = NULL }
59262 : };
59263 :
59264 0 : static PyObject *py_netr_LogonSamLogonWithFlags_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
59265 : {
59266 0 : PyObject *self = pytalloc_new(struct netr_LogonSamLogonWithFlags, type);
59267 0 : struct netr_LogonSamLogonWithFlags *_self = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(self);
59268 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
59269 0 : _self->in.logon = talloc_zero(mem_ctx, union netr_LogonLevel);
59270 0 : _self->out.validation = talloc_zero(mem_ctx, union netr_Validation);
59271 0 : _self->out.authoritative = talloc_zero(mem_ctx, uint8_t);
59272 0 : _self->in.flags = talloc_zero(mem_ctx, uint32_t);
59273 0 : _self->out.flags = talloc_zero(mem_ctx, uint32_t);
59274 0 : return self;
59275 : }
59276 :
59277 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
59278 : {
59279 :
59280 :
59281 0 : return PyLong_FromLong(45);
59282 : }
59283 :
59284 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
59285 : {
59286 0 : const struct ndr_interface_call *call = NULL;
59287 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
59288 0 : PyObject *ret = NULL;
59289 0 : struct ndr_push *push = NULL;
59290 : DATA_BLOB blob;
59291 : enum ndr_err_code err;
59292 :
59293 0 : if (ndr_table_netlogon.num_calls < 46) {
59294 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonWithFlags_ndr_pack");
59295 0 : return NULL;
59296 : }
59297 0 : call = &ndr_table_netlogon.calls[45];
59298 :
59299 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
59300 0 : if (push == NULL) {
59301 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
59302 0 : return NULL;
59303 : }
59304 :
59305 0 : push->flags |= ndr_push_flags;
59306 :
59307 0 : err = call->ndr_push(push, ndr_inout_flags, object);
59308 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
59309 0 : TALLOC_FREE(push);
59310 0 : PyErr_SetNdrError(err);
59311 0 : return NULL;
59312 : }
59313 0 : blob = ndr_push_blob(push);
59314 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
59315 0 : TALLOC_FREE(push);
59316 0 : return ret;
59317 : }
59318 :
59319 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
59320 : {
59321 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
59322 0 : PyObject *bigendian_obj = NULL;
59323 0 : PyObject *ndr64_obj = NULL;
59324 0 : uint32_t ndr_push_flags = 0;
59325 :
59326 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
59327 : discard_const_p(char *, kwnames),
59328 : &bigendian_obj,
59329 : &ndr64_obj)) {
59330 0 : return NULL;
59331 : }
59332 :
59333 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
59334 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
59335 : }
59336 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
59337 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
59338 : }
59339 :
59340 0 : return py_netr_LogonSamLogonWithFlags_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
59341 : }
59342 :
59343 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
59344 : {
59345 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
59346 0 : PyObject *bigendian_obj = NULL;
59347 0 : PyObject *ndr64_obj = NULL;
59348 0 : uint32_t ndr_push_flags = 0;
59349 :
59350 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
59351 : discard_const_p(char *, kwnames),
59352 : &bigendian_obj,
59353 : &ndr64_obj)) {
59354 0 : return NULL;
59355 : }
59356 :
59357 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
59358 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
59359 : }
59360 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
59361 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
59362 : }
59363 :
59364 0 : return py_netr_LogonSamLogonWithFlags_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
59365 : }
59366 :
59367 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
59368 : {
59369 0 : const struct ndr_interface_call *call = NULL;
59370 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
59371 0 : struct ndr_pull *pull = NULL;
59372 : enum ndr_err_code err;
59373 :
59374 0 : if (ndr_table_netlogon.num_calls < 46) {
59375 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonWithFlags_ndr_unpack");
59376 0 : return NULL;
59377 : }
59378 0 : call = &ndr_table_netlogon.calls[45];
59379 :
59380 0 : pull = ndr_pull_init_blob(blob, object);
59381 0 : if (pull == NULL) {
59382 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
59383 0 : return NULL;
59384 : }
59385 :
59386 0 : pull->flags |= ndr_pull_flags;
59387 :
59388 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
59389 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
59390 0 : TALLOC_FREE(pull);
59391 0 : PyErr_SetNdrError(err);
59392 0 : return NULL;
59393 : }
59394 0 : if (!allow_remaining) {
59395 : uint32_t highest_ofs;
59396 :
59397 0 : if (pull->offset > pull->relative_highest_offset) {
59398 0 : highest_ofs = pull->offset;
59399 : } else {
59400 0 : highest_ofs = pull->relative_highest_offset;
59401 : }
59402 0 : if (highest_ofs < pull->data_size) {
59403 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
59404 : "not all bytes consumed ofs[%u] size[%u]",
59405 : highest_ofs, pull->data_size);
59406 0 : TALLOC_FREE(pull);
59407 0 : PyErr_SetNdrError(err);
59408 0 : return NULL;
59409 : }
59410 : }
59411 :
59412 0 : TALLOC_FREE(pull);
59413 0 : Py_RETURN_NONE;
59414 : }
59415 :
59416 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
59417 : {
59418 : DATA_BLOB blob;
59419 0 : Py_ssize_t blob_length = 0;
59420 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
59421 0 : PyObject *bigendian_obj = NULL;
59422 0 : PyObject *ndr64_obj = NULL;
59423 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
59424 0 : PyObject *allow_remaining_obj = NULL;
59425 0 : bool allow_remaining = false;
59426 :
59427 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
59428 : discard_const_p(char *, kwnames),
59429 : &blob.data, &blob_length,
59430 : &bigendian_obj,
59431 : &ndr64_obj,
59432 : &allow_remaining_obj)) {
59433 0 : return NULL;
59434 : }
59435 0 : blob.length = blob_length;
59436 :
59437 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
59438 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
59439 : }
59440 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
59441 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
59442 : }
59443 :
59444 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
59445 0 : allow_remaining = true;
59446 : }
59447 :
59448 0 : return py_netr_LogonSamLogonWithFlags_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
59449 : }
59450 :
59451 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
59452 : {
59453 : DATA_BLOB blob;
59454 0 : Py_ssize_t blob_length = 0;
59455 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
59456 0 : PyObject *bigendian_obj = NULL;
59457 0 : PyObject *ndr64_obj = NULL;
59458 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
59459 0 : PyObject *allow_remaining_obj = NULL;
59460 0 : bool allow_remaining = false;
59461 :
59462 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
59463 : discard_const_p(char *, kwnames),
59464 : &blob.data, &blob_length,
59465 : &bigendian_obj,
59466 : &ndr64_obj,
59467 : &allow_remaining_obj)) {
59468 0 : return NULL;
59469 : }
59470 0 : blob.length = blob_length;
59471 :
59472 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
59473 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
59474 : }
59475 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
59476 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
59477 : }
59478 :
59479 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
59480 0 : allow_remaining = true;
59481 : }
59482 :
59483 0 : return py_netr_LogonSamLogonWithFlags_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
59484 : }
59485 :
59486 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
59487 : {
59488 0 : const struct ndr_interface_call *call = NULL;
59489 0 : struct netr_LogonSamLogonWithFlags *object = (struct netr_LogonSamLogonWithFlags *)pytalloc_get_ptr(py_obj);
59490 : PyObject *ret;
59491 : char *retstr;
59492 :
59493 0 : if (ndr_table_netlogon.num_calls < 46) {
59494 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_LogonSamLogonWithFlags_ndr_print");
59495 0 : return NULL;
59496 : }
59497 0 : call = &ndr_table_netlogon.calls[45];
59498 :
59499 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
59500 0 : ret = PyUnicode_FromString(retstr);
59501 0 : TALLOC_FREE(retstr);
59502 :
59503 0 : return ret;
59504 : }
59505 :
59506 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
59507 : {
59508 0 : return py_netr_LogonSamLogonWithFlags_ndr_print(py_obj, "netr_LogonSamLogonWithFlags_in", NDR_IN);
59509 : }
59510 :
59511 0 : static PyObject *py_netr_LogonSamLogonWithFlags_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
59512 : {
59513 0 : return py_netr_LogonSamLogonWithFlags_ndr_print(py_obj, "netr_LogonSamLogonWithFlags_out", NDR_OUT);
59514 : }
59515 :
59516 : static PyMethodDef py_netr_LogonSamLogonWithFlags_methods[] = {
59517 : { "opnum", (PyCFunction)py_netr_LogonSamLogonWithFlags_ndr_opnum, METH_NOARGS|METH_CLASS,
59518 : "netlogon.netr_LogonSamLogonWithFlags.opnum() -> 45 (0x2d) " },
59519 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonWithFlags_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
59520 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
59521 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonWithFlags_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
59522 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
59523 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonWithFlags_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
59524 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
59525 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_LogonSamLogonWithFlags_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
59526 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
59527 : { "__ndr_print_in__", (PyCFunction)py_netr_LogonSamLogonWithFlags_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
59528 : { "__ndr_print_out__", (PyCFunction)py_netr_LogonSamLogonWithFlags_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
59529 : { NULL, NULL, 0, NULL }
59530 : };
59531 :
59532 :
59533 : static PyTypeObject netr_LogonSamLogonWithFlags_Type = {
59534 : PyVarObject_HEAD_INIT(NULL, 0)
59535 : .tp_name = "netlogon.netr_LogonSamLogonWithFlags",
59536 : .tp_getset = py_netr_LogonSamLogonWithFlags_getsetters,
59537 : .tp_methods = py_netr_LogonSamLogonWithFlags_methods,
59538 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
59539 : .tp_new = py_netr_LogonSamLogonWithFlags_new,
59540 : };
59541 :
59542 4 : static bool pack_py_netr_LogonSamLogonWithFlags_args_in(PyObject *args, PyObject *kwargs, struct netr_LogonSamLogonWithFlags *r)
59543 : {
59544 : PyObject *py_server_name;
59545 : PyObject *py_computer_name;
59546 : PyObject *py_credential;
59547 : PyObject *py_return_authenticator;
59548 : PyObject *py_logon_level;
59549 : PyObject *py_logon;
59550 : PyObject *py_validation_level;
59551 : PyObject *py_flags;
59552 4 : const char *kwnames[] = {
59553 : "server_name", "computer_name", "credential", "return_authenticator", "logon_level", "logon", "validation_level", "flags", NULL
59554 : };
59555 :
59556 4 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:netr_LogonSamLogonWithFlags", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_return_authenticator, &py_logon_level, &py_logon, &py_validation_level, &py_flags)) {
59557 0 : return false;
59558 : }
59559 :
59560 4 : if (py_server_name == NULL) {
59561 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
59562 0 : return false;
59563 : }
59564 4 : if (py_server_name == Py_None) {
59565 0 : r->in.server_name = NULL;
59566 : } else {
59567 4 : r->in.server_name = NULL;
59568 : {
59569 : const char *test_str;
59570 : const char *talloc_str;
59571 4 : PyObject *unicode = NULL;
59572 4 : if (PyUnicode_Check(py_server_name)) {
59573 4 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
59574 4 : if (unicode == NULL) {
59575 0 : PyErr_NoMemory();
59576 0 : return false;
59577 : }
59578 4 : test_str = PyBytes_AS_STRING(unicode);
59579 0 : } else if (PyBytes_Check(py_server_name)) {
59580 0 : test_str = PyBytes_AS_STRING(py_server_name);
59581 : } else {
59582 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
59583 0 : return false;
59584 : }
59585 4 : talloc_str = talloc_strdup(r, test_str);
59586 4 : if (unicode != NULL) {
59587 4 : Py_DECREF(unicode);
59588 : }
59589 4 : if (talloc_str == NULL) {
59590 0 : PyErr_NoMemory();
59591 0 : return false;
59592 : }
59593 4 : r->in.server_name = talloc_str;
59594 : }
59595 : }
59596 4 : if (py_computer_name == NULL) {
59597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
59598 0 : return false;
59599 : }
59600 4 : if (py_computer_name == Py_None) {
59601 0 : r->in.computer_name = NULL;
59602 : } else {
59603 4 : r->in.computer_name = NULL;
59604 : {
59605 : const char *test_str;
59606 : const char *talloc_str;
59607 4 : PyObject *unicode = NULL;
59608 4 : if (PyUnicode_Check(py_computer_name)) {
59609 4 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
59610 4 : if (unicode == NULL) {
59611 0 : PyErr_NoMemory();
59612 0 : return false;
59613 : }
59614 4 : test_str = PyBytes_AS_STRING(unicode);
59615 0 : } else if (PyBytes_Check(py_computer_name)) {
59616 0 : test_str = PyBytes_AS_STRING(py_computer_name);
59617 : } else {
59618 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
59619 0 : return false;
59620 : }
59621 4 : talloc_str = talloc_strdup(r, test_str);
59622 4 : if (unicode != NULL) {
59623 4 : Py_DECREF(unicode);
59624 : }
59625 4 : if (talloc_str == NULL) {
59626 0 : PyErr_NoMemory();
59627 0 : return false;
59628 : }
59629 4 : r->in.computer_name = talloc_str;
59630 : }
59631 : }
59632 4 : if (py_credential == NULL) {
59633 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
59634 0 : return false;
59635 : }
59636 4 : if (py_credential == Py_None) {
59637 0 : r->in.credential = NULL;
59638 : } else {
59639 4 : r->in.credential = NULL;
59640 4 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
59641 4 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
59642 0 : PyErr_NoMemory();
59643 0 : return false;
59644 : }
59645 4 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
59646 : }
59647 4 : if (py_return_authenticator == NULL) {
59648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.return_authenticator");
59649 0 : return false;
59650 : }
59651 4 : if (py_return_authenticator == Py_None) {
59652 0 : r->in.return_authenticator = NULL;
59653 : } else {
59654 4 : r->in.return_authenticator = NULL;
59655 4 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_return_authenticator, return false;);
59656 4 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_return_authenticator)) == NULL) {
59657 0 : PyErr_NoMemory();
59658 0 : return false;
59659 : }
59660 4 : r->in.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(py_return_authenticator);
59661 : }
59662 4 : if (py_logon_level == NULL) {
59663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon_level");
59664 0 : return false;
59665 : }
59666 : {
59667 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_level));
59668 4 : if (PyLong_Check(py_logon_level)) {
59669 : unsigned long long test_var;
59670 4 : test_var = PyLong_AsUnsignedLongLong(py_logon_level);
59671 4 : if (PyErr_Occurred() != NULL) {
59672 0 : return false;
59673 : }
59674 4 : if (test_var > uint_max) {
59675 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
59676 : PyLong_Type.tp_name, uint_max, test_var);
59677 0 : return false;
59678 : }
59679 4 : r->in.logon_level = test_var;
59680 : } else {
59681 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
59682 : PyLong_Type.tp_name);
59683 0 : return false;
59684 : }
59685 : }
59686 4 : if (py_logon == NULL) {
59687 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.logon");
59688 0 : return false;
59689 : }
59690 4 : r->in.logon = talloc_ptrtype(r, r->in.logon);
59691 4 : if (r->in.logon == NULL) {
59692 0 : PyErr_NoMemory();
59693 0 : return false;
59694 : }
59695 : {
59696 : union netr_LogonLevel *logon_switch_1;
59697 4 : logon_switch_1 = (union netr_LogonLevel *)pyrpc_export_union(&netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel");
59698 4 : if (logon_switch_1 == NULL) {
59699 0 : return false;
59700 : }
59701 4 : r->in.logon = logon_switch_1;
59702 : }
59703 4 : if (py_validation_level == NULL) {
59704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.validation_level");
59705 0 : return false;
59706 : }
59707 : {
59708 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.validation_level));
59709 4 : if (PyLong_Check(py_validation_level)) {
59710 : unsigned long long test_var;
59711 4 : test_var = PyLong_AsUnsignedLongLong(py_validation_level);
59712 4 : if (PyErr_Occurred() != NULL) {
59713 0 : return false;
59714 : }
59715 4 : if (test_var > uint_max) {
59716 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
59717 : PyLong_Type.tp_name, uint_max, test_var);
59718 0 : return false;
59719 : }
59720 4 : r->in.validation_level = test_var;
59721 : } else {
59722 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
59723 : PyLong_Type.tp_name);
59724 0 : return false;
59725 : }
59726 : }
59727 4 : if (py_flags == NULL) {
59728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
59729 0 : return false;
59730 : }
59731 4 : r->in.flags = talloc_ptrtype(r, r->in.flags);
59732 4 : if (r->in.flags == NULL) {
59733 0 : PyErr_NoMemory();
59734 0 : return false;
59735 : }
59736 : {
59737 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.flags));
59738 4 : if (PyLong_Check(py_flags)) {
59739 : unsigned long long test_var;
59740 4 : test_var = PyLong_AsUnsignedLongLong(py_flags);
59741 4 : if (PyErr_Occurred() != NULL) {
59742 0 : return false;
59743 : }
59744 4 : if (test_var > uint_max) {
59745 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
59746 : PyLong_Type.tp_name, uint_max, test_var);
59747 0 : return false;
59748 : }
59749 4 : *r->in.flags = test_var;
59750 : } else {
59751 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
59752 : PyLong_Type.tp_name);
59753 0 : return false;
59754 : }
59755 : }
59756 4 : return true;
59757 : }
59758 :
59759 4 : static PyObject *unpack_py_netr_LogonSamLogonWithFlags_args_out(struct netr_LogonSamLogonWithFlags *r)
59760 : {
59761 : PyObject *result;
59762 : PyObject *py_return_authenticator;
59763 : PyObject *py_validation;
59764 : PyObject *py_authoritative;
59765 : PyObject *py_flags;
59766 4 : result = PyTuple_New(4);
59767 4 : if (r->out.return_authenticator == NULL) {
59768 0 : py_return_authenticator = Py_None;
59769 0 : Py_INCREF(py_return_authenticator);
59770 : } else {
59771 4 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
59772 : }
59773 4 : PyTuple_SetItem(result, 0, py_return_authenticator);
59774 4 : py_validation = pyrpc_import_union(&netr_Validation_Type, r->out.validation, r->in.validation_level, r->out.validation, "union netr_Validation");
59775 4 : if (py_validation == NULL) {
59776 0 : return NULL;
59777 : }
59778 4 : PyTuple_SetItem(result, 1, py_validation);
59779 4 : py_authoritative = PyLong_FromLong((uint16_t)*r->out.authoritative);
59780 4 : PyTuple_SetItem(result, 2, py_authoritative);
59781 4 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)*r->out.flags);
59782 4 : PyTuple_SetItem(result, 3, py_flags);
59783 4 : if (NT_STATUS_IS_ERR(r->out.result)) {
59784 0 : PyErr_SetNTSTATUS(r->out.result);
59785 0 : return NULL;
59786 : }
59787 :
59788 4 : return result;
59789 : }
59790 :
59791 :
59792 0 : static PyObject *py_netr_ServerGetTrustInfo_in_get_server_name(PyObject *obj, void *closure)
59793 : {
59794 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
59795 : PyObject *py_server_name;
59796 0 : if (object->in.server_name == NULL) {
59797 0 : Py_RETURN_NONE;
59798 : }
59799 0 : if (object->in.server_name == NULL) {
59800 0 : py_server_name = Py_None;
59801 0 : Py_INCREF(py_server_name);
59802 : } else {
59803 0 : if (object->in.server_name == NULL) {
59804 0 : py_server_name = Py_None;
59805 0 : Py_INCREF(py_server_name);
59806 : } else {
59807 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
59808 : }
59809 : }
59810 0 : return py_server_name;
59811 : }
59812 :
59813 0 : static int py_netr_ServerGetTrustInfo_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
59814 : {
59815 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
59816 0 : if (value == NULL) {
59817 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
59818 0 : return -1;
59819 : }
59820 0 : if (value == Py_None) {
59821 0 : object->in.server_name = NULL;
59822 : } else {
59823 0 : object->in.server_name = NULL;
59824 : {
59825 : const char *test_str;
59826 : const char *talloc_str;
59827 0 : PyObject *unicode = NULL;
59828 0 : if (PyUnicode_Check(value)) {
59829 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
59830 0 : if (unicode == NULL) {
59831 0 : PyErr_NoMemory();
59832 0 : return -1;
59833 : }
59834 0 : test_str = PyBytes_AS_STRING(unicode);
59835 0 : } else if (PyBytes_Check(value)) {
59836 0 : test_str = PyBytes_AS_STRING(value);
59837 : } else {
59838 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
59839 0 : return -1;
59840 : }
59841 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
59842 0 : if (unicode != NULL) {
59843 0 : Py_DECREF(unicode);
59844 : }
59845 0 : if (talloc_str == NULL) {
59846 0 : PyErr_NoMemory();
59847 0 : return -1;
59848 : }
59849 0 : object->in.server_name = talloc_str;
59850 : }
59851 : }
59852 0 : return 0;
59853 : }
59854 :
59855 0 : static PyObject *py_netr_ServerGetTrustInfo_in_get_account_name(PyObject *obj, void *closure)
59856 : {
59857 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
59858 : PyObject *py_account_name;
59859 0 : if (object->in.account_name == NULL) {
59860 0 : Py_RETURN_NONE;
59861 : }
59862 0 : if (object->in.account_name == NULL) {
59863 0 : py_account_name = Py_None;
59864 0 : Py_INCREF(py_account_name);
59865 : } else {
59866 0 : py_account_name = PyUnicode_Decode(object->in.account_name, strlen(object->in.account_name), "utf-8", "ignore");
59867 : }
59868 0 : return py_account_name;
59869 : }
59870 :
59871 0 : static int py_netr_ServerGetTrustInfo_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
59872 : {
59873 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
59874 0 : if (value == NULL) {
59875 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
59876 0 : return -1;
59877 : }
59878 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
59879 0 : if (object->in.account_name == NULL) {
59880 0 : PyErr_NoMemory();
59881 0 : return -1;
59882 : }
59883 : {
59884 : const char *test_str;
59885 : const char *talloc_str;
59886 0 : PyObject *unicode = NULL;
59887 0 : if (PyUnicode_Check(value)) {
59888 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
59889 0 : if (unicode == NULL) {
59890 0 : PyErr_NoMemory();
59891 0 : return -1;
59892 : }
59893 0 : test_str = PyBytes_AS_STRING(unicode);
59894 0 : } else if (PyBytes_Check(value)) {
59895 0 : test_str = PyBytes_AS_STRING(value);
59896 : } else {
59897 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
59898 0 : return -1;
59899 : }
59900 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
59901 0 : if (unicode != NULL) {
59902 0 : Py_DECREF(unicode);
59903 : }
59904 0 : if (talloc_str == NULL) {
59905 0 : PyErr_NoMemory();
59906 0 : return -1;
59907 : }
59908 0 : object->in.account_name = talloc_str;
59909 : }
59910 0 : return 0;
59911 : }
59912 :
59913 0 : static PyObject *py_netr_ServerGetTrustInfo_in_get_secure_channel_type(PyObject *obj, void *closure)
59914 : {
59915 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
59916 : PyObject *py_secure_channel_type;
59917 0 : py_secure_channel_type = PyLong_FromLong((uint16_t)object->in.secure_channel_type);
59918 0 : return py_secure_channel_type;
59919 : }
59920 :
59921 0 : static int py_netr_ServerGetTrustInfo_in_set_secure_channel_type(PyObject *py_obj, PyObject *value, void *closure)
59922 : {
59923 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
59924 0 : if (value == NULL) {
59925 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.secure_channel_type");
59926 0 : return -1;
59927 : }
59928 : {
59929 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.secure_channel_type));
59930 0 : if (PyLong_Check(value)) {
59931 : unsigned long long test_var;
59932 0 : test_var = PyLong_AsUnsignedLongLong(value);
59933 0 : if (PyErr_Occurred() != NULL) {
59934 0 : return -1;
59935 : }
59936 0 : if (test_var > uint_max) {
59937 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
59938 : PyLong_Type.tp_name, uint_max, test_var);
59939 0 : return -1;
59940 : }
59941 0 : object->in.secure_channel_type = test_var;
59942 : } else {
59943 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
59944 : PyLong_Type.tp_name);
59945 0 : return -1;
59946 : }
59947 : }
59948 0 : return 0;
59949 : }
59950 :
59951 0 : static PyObject *py_netr_ServerGetTrustInfo_in_get_computer_name(PyObject *obj, void *closure)
59952 : {
59953 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
59954 : PyObject *py_computer_name;
59955 0 : if (object->in.computer_name == NULL) {
59956 0 : Py_RETURN_NONE;
59957 : }
59958 0 : if (object->in.computer_name == NULL) {
59959 0 : py_computer_name = Py_None;
59960 0 : Py_INCREF(py_computer_name);
59961 : } else {
59962 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
59963 : }
59964 0 : return py_computer_name;
59965 : }
59966 :
59967 0 : static int py_netr_ServerGetTrustInfo_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
59968 : {
59969 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
59970 0 : if (value == NULL) {
59971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
59972 0 : return -1;
59973 : }
59974 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
59975 0 : if (object->in.computer_name == NULL) {
59976 0 : PyErr_NoMemory();
59977 0 : return -1;
59978 : }
59979 : {
59980 : const char *test_str;
59981 : const char *talloc_str;
59982 0 : PyObject *unicode = NULL;
59983 0 : if (PyUnicode_Check(value)) {
59984 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
59985 0 : if (unicode == NULL) {
59986 0 : PyErr_NoMemory();
59987 0 : return -1;
59988 : }
59989 0 : test_str = PyBytes_AS_STRING(unicode);
59990 0 : } else if (PyBytes_Check(value)) {
59991 0 : test_str = PyBytes_AS_STRING(value);
59992 : } else {
59993 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
59994 0 : return -1;
59995 : }
59996 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
59997 0 : if (unicode != NULL) {
59998 0 : Py_DECREF(unicode);
59999 : }
60000 0 : if (talloc_str == NULL) {
60001 0 : PyErr_NoMemory();
60002 0 : return -1;
60003 : }
60004 0 : object->in.computer_name = talloc_str;
60005 : }
60006 0 : return 0;
60007 : }
60008 :
60009 0 : static PyObject *py_netr_ServerGetTrustInfo_in_get_credential(PyObject *obj, void *closure)
60010 : {
60011 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
60012 : PyObject *py_credential;
60013 0 : if (object->in.credential == NULL) {
60014 0 : Py_RETURN_NONE;
60015 : }
60016 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
60017 0 : return py_credential;
60018 : }
60019 :
60020 0 : static int py_netr_ServerGetTrustInfo_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
60021 : {
60022 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60023 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
60024 0 : if (value == NULL) {
60025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
60026 0 : return -1;
60027 : }
60028 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
60029 0 : if (object->in.credential == NULL) {
60030 0 : PyErr_NoMemory();
60031 0 : return -1;
60032 : }
60033 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
60034 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
60035 0 : PyErr_NoMemory();
60036 0 : return -1;
60037 : }
60038 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
60039 0 : return 0;
60040 : }
60041 :
60042 0 : static PyObject *py_netr_ServerGetTrustInfo_out_get_return_authenticator(PyObject *obj, void *closure)
60043 : {
60044 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
60045 : PyObject *py_return_authenticator;
60046 0 : if (object->out.return_authenticator == NULL) {
60047 0 : Py_RETURN_NONE;
60048 : }
60049 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
60050 0 : return py_return_authenticator;
60051 : }
60052 :
60053 0 : static int py_netr_ServerGetTrustInfo_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
60054 : {
60055 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60056 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
60057 0 : if (value == NULL) {
60058 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
60059 0 : return -1;
60060 : }
60061 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
60062 0 : if (object->out.return_authenticator == NULL) {
60063 0 : PyErr_NoMemory();
60064 0 : return -1;
60065 : }
60066 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
60067 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
60068 0 : PyErr_NoMemory();
60069 0 : return -1;
60070 : }
60071 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
60072 0 : return 0;
60073 : }
60074 :
60075 0 : static PyObject *py_netr_ServerGetTrustInfo_out_get_new_owf_password(PyObject *obj, void *closure)
60076 : {
60077 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
60078 : PyObject *py_new_owf_password;
60079 0 : if (object->out.new_owf_password == NULL) {
60080 0 : Py_RETURN_NONE;
60081 : }
60082 0 : py_new_owf_password = pytalloc_reference_ex(samr_Password_Type, object->out.new_owf_password, object->out.new_owf_password);
60083 0 : return py_new_owf_password;
60084 : }
60085 :
60086 0 : static int py_netr_ServerGetTrustInfo_out_set_new_owf_password(PyObject *py_obj, PyObject *value, void *closure)
60087 : {
60088 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60089 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_owf_password));
60090 0 : if (value == NULL) {
60091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.new_owf_password");
60092 0 : return -1;
60093 : }
60094 0 : object->out.new_owf_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.new_owf_password);
60095 0 : if (object->out.new_owf_password == NULL) {
60096 0 : PyErr_NoMemory();
60097 0 : return -1;
60098 : }
60099 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
60100 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
60101 0 : PyErr_NoMemory();
60102 0 : return -1;
60103 : }
60104 0 : object->out.new_owf_password = (struct samr_Password *)pytalloc_get_ptr(value);
60105 0 : return 0;
60106 : }
60107 :
60108 0 : static PyObject *py_netr_ServerGetTrustInfo_out_get_old_owf_password(PyObject *obj, void *closure)
60109 : {
60110 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
60111 : PyObject *py_old_owf_password;
60112 0 : if (object->out.old_owf_password == NULL) {
60113 0 : Py_RETURN_NONE;
60114 : }
60115 0 : py_old_owf_password = pytalloc_reference_ex(samr_Password_Type, object->out.old_owf_password, object->out.old_owf_password);
60116 0 : return py_old_owf_password;
60117 : }
60118 :
60119 0 : static int py_netr_ServerGetTrustInfo_out_set_old_owf_password(PyObject *py_obj, PyObject *value, void *closure)
60120 : {
60121 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60122 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_owf_password));
60123 0 : if (value == NULL) {
60124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.old_owf_password");
60125 0 : return -1;
60126 : }
60127 0 : object->out.old_owf_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.old_owf_password);
60128 0 : if (object->out.old_owf_password == NULL) {
60129 0 : PyErr_NoMemory();
60130 0 : return -1;
60131 : }
60132 0 : PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
60133 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
60134 0 : PyErr_NoMemory();
60135 0 : return -1;
60136 : }
60137 0 : object->out.old_owf_password = (struct samr_Password *)pytalloc_get_ptr(value);
60138 0 : return 0;
60139 : }
60140 :
60141 0 : static PyObject *py_netr_ServerGetTrustInfo_out_get_trust_info(PyObject *obj, void *closure)
60142 : {
60143 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
60144 : PyObject *py_trust_info;
60145 0 : if (object->out.trust_info == NULL) {
60146 0 : Py_RETURN_NONE;
60147 : }
60148 0 : if (*object->out.trust_info == NULL) {
60149 0 : py_trust_info = Py_None;
60150 0 : Py_INCREF(py_trust_info);
60151 : } else {
60152 0 : py_trust_info = pytalloc_reference_ex(&netr_TrustInfo_Type, *object->out.trust_info, *object->out.trust_info);
60153 : }
60154 0 : return py_trust_info;
60155 : }
60156 :
60157 0 : static int py_netr_ServerGetTrustInfo_out_set_trust_info(PyObject *py_obj, PyObject *value, void *closure)
60158 : {
60159 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60160 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trust_info));
60161 0 : if (value == NULL) {
60162 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trust_info");
60163 0 : return -1;
60164 : }
60165 0 : object->out.trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trust_info);
60166 0 : if (object->out.trust_info == NULL) {
60167 0 : PyErr_NoMemory();
60168 0 : return -1;
60169 : }
60170 0 : if (value == Py_None) {
60171 0 : *object->out.trust_info = NULL;
60172 : } else {
60173 0 : *object->out.trust_info = NULL;
60174 0 : PY_CHECK_TYPE(&netr_TrustInfo_Type, value, return -1;);
60175 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
60176 0 : PyErr_NoMemory();
60177 0 : return -1;
60178 : }
60179 0 : *object->out.trust_info = (struct netr_TrustInfo *)pytalloc_get_ptr(value);
60180 : }
60181 0 : return 0;
60182 : }
60183 :
60184 0 : static PyObject *py_netr_ServerGetTrustInfo_get_result(PyObject *obj, void *closure)
60185 : {
60186 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(obj);
60187 : PyObject *py_result;
60188 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
60189 0 : return py_result;
60190 : }
60191 :
60192 0 : static int py_netr_ServerGetTrustInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
60193 : {
60194 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60195 0 : if (value == NULL) {
60196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
60197 0 : return -1;
60198 : }
60199 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
60200 0 : return 0;
60201 : }
60202 :
60203 : static PyGetSetDef py_netr_ServerGetTrustInfo_getsetters[] = {
60204 : {
60205 : .name = discard_const_p(char, "in_server_name"),
60206 : .get = py_netr_ServerGetTrustInfo_in_get_server_name,
60207 : .set = py_netr_ServerGetTrustInfo_in_set_server_name,
60208 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
60209 : },
60210 : {
60211 : .name = discard_const_p(char, "in_account_name"),
60212 : .get = py_netr_ServerGetTrustInfo_in_get_account_name,
60213 : .set = py_netr_ServerGetTrustInfo_in_set_account_name,
60214 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
60215 : },
60216 : {
60217 : .name = discard_const_p(char, "in_secure_channel_type"),
60218 : .get = py_netr_ServerGetTrustInfo_in_get_secure_channel_type,
60219 : .set = py_netr_ServerGetTrustInfo_in_set_secure_channel_type,
60220 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SchannelType")
60221 : },
60222 : {
60223 : .name = discard_const_p(char, "in_computer_name"),
60224 : .get = py_netr_ServerGetTrustInfo_in_get_computer_name,
60225 : .set = py_netr_ServerGetTrustInfo_in_set_computer_name,
60226 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
60227 : },
60228 : {
60229 : .name = discard_const_p(char, "in_credential"),
60230 : .get = py_netr_ServerGetTrustInfo_in_get_credential,
60231 : .set = py_netr_ServerGetTrustInfo_in_set_credential,
60232 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
60233 : },
60234 : {
60235 : .name = discard_const_p(char, "out_return_authenticator"),
60236 : .get = py_netr_ServerGetTrustInfo_out_get_return_authenticator,
60237 : .set = py_netr_ServerGetTrustInfo_out_set_return_authenticator,
60238 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
60239 : },
60240 : {
60241 : .name = discard_const_p(char, "out_new_owf_password"),
60242 : .get = py_netr_ServerGetTrustInfo_out_get_new_owf_password,
60243 : .set = py_netr_ServerGetTrustInfo_out_set_new_owf_password,
60244 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
60245 : },
60246 : {
60247 : .name = discard_const_p(char, "out_old_owf_password"),
60248 : .get = py_netr_ServerGetTrustInfo_out_get_old_owf_password,
60249 : .set = py_netr_ServerGetTrustInfo_out_set_old_owf_password,
60250 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
60251 : },
60252 : {
60253 : .name = discard_const_p(char, "out_trust_info"),
60254 : .get = py_netr_ServerGetTrustInfo_out_get_trust_info,
60255 : .set = py_netr_ServerGetTrustInfo_out_set_trust_info,
60256 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_TrustInfo")
60257 : },
60258 : {
60259 : .name = discard_const_p(char, "result"),
60260 : .get = py_netr_ServerGetTrustInfo_get_result,
60261 : .set = py_netr_ServerGetTrustInfo_set_result,
60262 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
60263 : },
60264 : { .name = NULL }
60265 : };
60266 :
60267 0 : static PyObject *py_netr_ServerGetTrustInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
60268 : {
60269 0 : PyObject *self = pytalloc_new(struct netr_ServerGetTrustInfo, type);
60270 0 : struct netr_ServerGetTrustInfo *_self = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(self);
60271 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
60272 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
60273 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
60274 0 : _self->out.new_owf_password = talloc_zero(mem_ctx, struct samr_Password);
60275 0 : _self->out.old_owf_password = talloc_zero(mem_ctx, struct samr_Password);
60276 : /* a pointer to a NULL pointer */
60277 0 : _self->out.trust_info = talloc_zero(mem_ctx, struct netr_TrustInfo *);
60278 0 : return self;
60279 : }
60280 :
60281 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
60282 : {
60283 :
60284 :
60285 0 : return PyLong_FromLong(46);
60286 : }
60287 :
60288 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
60289 : {
60290 0 : const struct ndr_interface_call *call = NULL;
60291 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60292 0 : PyObject *ret = NULL;
60293 0 : struct ndr_push *push = NULL;
60294 : DATA_BLOB blob;
60295 : enum ndr_err_code err;
60296 :
60297 0 : if (ndr_table_netlogon.num_calls < 47) {
60298 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerGetTrustInfo_ndr_pack");
60299 0 : return NULL;
60300 : }
60301 0 : call = &ndr_table_netlogon.calls[46];
60302 :
60303 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
60304 0 : if (push == NULL) {
60305 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
60306 0 : return NULL;
60307 : }
60308 :
60309 0 : push->flags |= ndr_push_flags;
60310 :
60311 0 : err = call->ndr_push(push, ndr_inout_flags, object);
60312 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
60313 0 : TALLOC_FREE(push);
60314 0 : PyErr_SetNdrError(err);
60315 0 : return NULL;
60316 : }
60317 0 : blob = ndr_push_blob(push);
60318 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
60319 0 : TALLOC_FREE(push);
60320 0 : return ret;
60321 : }
60322 :
60323 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
60324 : {
60325 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
60326 0 : PyObject *bigendian_obj = NULL;
60327 0 : PyObject *ndr64_obj = NULL;
60328 0 : uint32_t ndr_push_flags = 0;
60329 :
60330 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
60331 : discard_const_p(char *, kwnames),
60332 : &bigendian_obj,
60333 : &ndr64_obj)) {
60334 0 : return NULL;
60335 : }
60336 :
60337 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
60338 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
60339 : }
60340 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
60341 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
60342 : }
60343 :
60344 0 : return py_netr_ServerGetTrustInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
60345 : }
60346 :
60347 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
60348 : {
60349 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
60350 0 : PyObject *bigendian_obj = NULL;
60351 0 : PyObject *ndr64_obj = NULL;
60352 0 : uint32_t ndr_push_flags = 0;
60353 :
60354 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
60355 : discard_const_p(char *, kwnames),
60356 : &bigendian_obj,
60357 : &ndr64_obj)) {
60358 0 : return NULL;
60359 : }
60360 :
60361 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
60362 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
60363 : }
60364 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
60365 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
60366 : }
60367 :
60368 0 : return py_netr_ServerGetTrustInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
60369 : }
60370 :
60371 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
60372 : {
60373 0 : const struct ndr_interface_call *call = NULL;
60374 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60375 0 : struct ndr_pull *pull = NULL;
60376 : enum ndr_err_code err;
60377 :
60378 0 : if (ndr_table_netlogon.num_calls < 47) {
60379 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerGetTrustInfo_ndr_unpack");
60380 0 : return NULL;
60381 : }
60382 0 : call = &ndr_table_netlogon.calls[46];
60383 :
60384 0 : pull = ndr_pull_init_blob(blob, object);
60385 0 : if (pull == NULL) {
60386 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
60387 0 : return NULL;
60388 : }
60389 :
60390 0 : pull->flags |= ndr_pull_flags;
60391 :
60392 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
60393 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
60394 0 : TALLOC_FREE(pull);
60395 0 : PyErr_SetNdrError(err);
60396 0 : return NULL;
60397 : }
60398 0 : if (!allow_remaining) {
60399 : uint32_t highest_ofs;
60400 :
60401 0 : if (pull->offset > pull->relative_highest_offset) {
60402 0 : highest_ofs = pull->offset;
60403 : } else {
60404 0 : highest_ofs = pull->relative_highest_offset;
60405 : }
60406 0 : if (highest_ofs < pull->data_size) {
60407 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
60408 : "not all bytes consumed ofs[%u] size[%u]",
60409 : highest_ofs, pull->data_size);
60410 0 : TALLOC_FREE(pull);
60411 0 : PyErr_SetNdrError(err);
60412 0 : return NULL;
60413 : }
60414 : }
60415 :
60416 0 : TALLOC_FREE(pull);
60417 0 : Py_RETURN_NONE;
60418 : }
60419 :
60420 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
60421 : {
60422 : DATA_BLOB blob;
60423 0 : Py_ssize_t blob_length = 0;
60424 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
60425 0 : PyObject *bigendian_obj = NULL;
60426 0 : PyObject *ndr64_obj = NULL;
60427 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
60428 0 : PyObject *allow_remaining_obj = NULL;
60429 0 : bool allow_remaining = false;
60430 :
60431 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
60432 : discard_const_p(char *, kwnames),
60433 : &blob.data, &blob_length,
60434 : &bigendian_obj,
60435 : &ndr64_obj,
60436 : &allow_remaining_obj)) {
60437 0 : return NULL;
60438 : }
60439 0 : blob.length = blob_length;
60440 :
60441 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
60442 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
60443 : }
60444 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
60445 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
60446 : }
60447 :
60448 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
60449 0 : allow_remaining = true;
60450 : }
60451 :
60452 0 : return py_netr_ServerGetTrustInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
60453 : }
60454 :
60455 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
60456 : {
60457 : DATA_BLOB blob;
60458 0 : Py_ssize_t blob_length = 0;
60459 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
60460 0 : PyObject *bigendian_obj = NULL;
60461 0 : PyObject *ndr64_obj = NULL;
60462 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
60463 0 : PyObject *allow_remaining_obj = NULL;
60464 0 : bool allow_remaining = false;
60465 :
60466 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
60467 : discard_const_p(char *, kwnames),
60468 : &blob.data, &blob_length,
60469 : &bigendian_obj,
60470 : &ndr64_obj,
60471 : &allow_remaining_obj)) {
60472 0 : return NULL;
60473 : }
60474 0 : blob.length = blob_length;
60475 :
60476 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
60477 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
60478 : }
60479 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
60480 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
60481 : }
60482 :
60483 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
60484 0 : allow_remaining = true;
60485 : }
60486 :
60487 0 : return py_netr_ServerGetTrustInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
60488 : }
60489 :
60490 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
60491 : {
60492 0 : const struct ndr_interface_call *call = NULL;
60493 0 : struct netr_ServerGetTrustInfo *object = (struct netr_ServerGetTrustInfo *)pytalloc_get_ptr(py_obj);
60494 : PyObject *ret;
60495 : char *retstr;
60496 :
60497 0 : if (ndr_table_netlogon.num_calls < 47) {
60498 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_ServerGetTrustInfo_ndr_print");
60499 0 : return NULL;
60500 : }
60501 0 : call = &ndr_table_netlogon.calls[46];
60502 :
60503 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
60504 0 : ret = PyUnicode_FromString(retstr);
60505 0 : TALLOC_FREE(retstr);
60506 :
60507 0 : return ret;
60508 : }
60509 :
60510 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
60511 : {
60512 0 : return py_netr_ServerGetTrustInfo_ndr_print(py_obj, "netr_ServerGetTrustInfo_in", NDR_IN);
60513 : }
60514 :
60515 0 : static PyObject *py_netr_ServerGetTrustInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
60516 : {
60517 0 : return py_netr_ServerGetTrustInfo_ndr_print(py_obj, "netr_ServerGetTrustInfo_out", NDR_OUT);
60518 : }
60519 :
60520 : static PyMethodDef py_netr_ServerGetTrustInfo_methods[] = {
60521 : { "opnum", (PyCFunction)py_netr_ServerGetTrustInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
60522 : "netlogon.netr_ServerGetTrustInfo.opnum() -> 46 (0x2e) " },
60523 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerGetTrustInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
60524 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
60525 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerGetTrustInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
60526 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
60527 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerGetTrustInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
60528 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
60529 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_ServerGetTrustInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
60530 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
60531 : { "__ndr_print_in__", (PyCFunction)py_netr_ServerGetTrustInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
60532 : { "__ndr_print_out__", (PyCFunction)py_netr_ServerGetTrustInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
60533 : { NULL, NULL, 0, NULL }
60534 : };
60535 :
60536 :
60537 : static PyTypeObject netr_ServerGetTrustInfo_Type = {
60538 : PyVarObject_HEAD_INIT(NULL, 0)
60539 : .tp_name = "netlogon.netr_ServerGetTrustInfo",
60540 : .tp_getset = py_netr_ServerGetTrustInfo_getsetters,
60541 : .tp_methods = py_netr_ServerGetTrustInfo_methods,
60542 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
60543 : .tp_new = py_netr_ServerGetTrustInfo_new,
60544 : };
60545 :
60546 0 : static bool pack_py_netr_ServerGetTrustInfo_args_in(PyObject *args, PyObject *kwargs, struct netr_ServerGetTrustInfo *r)
60547 : {
60548 : PyObject *py_server_name;
60549 : PyObject *py_account_name;
60550 : PyObject *py_secure_channel_type;
60551 : PyObject *py_computer_name;
60552 : PyObject *py_credential;
60553 0 : const char *kwnames[] = {
60554 : "server_name", "account_name", "secure_channel_type", "computer_name", "credential", NULL
60555 : };
60556 :
60557 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:netr_ServerGetTrustInfo", discard_const_p(char *, kwnames), &py_server_name, &py_account_name, &py_secure_channel_type, &py_computer_name, &py_credential)) {
60558 0 : return false;
60559 : }
60560 :
60561 0 : if (py_server_name == NULL) {
60562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
60563 0 : return false;
60564 : }
60565 0 : if (py_server_name == Py_None) {
60566 0 : r->in.server_name = NULL;
60567 : } else {
60568 0 : r->in.server_name = NULL;
60569 : {
60570 : const char *test_str;
60571 : const char *talloc_str;
60572 0 : PyObject *unicode = NULL;
60573 0 : if (PyUnicode_Check(py_server_name)) {
60574 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
60575 0 : if (unicode == NULL) {
60576 0 : PyErr_NoMemory();
60577 0 : return false;
60578 : }
60579 0 : test_str = PyBytes_AS_STRING(unicode);
60580 0 : } else if (PyBytes_Check(py_server_name)) {
60581 0 : test_str = PyBytes_AS_STRING(py_server_name);
60582 : } else {
60583 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
60584 0 : return false;
60585 : }
60586 0 : talloc_str = talloc_strdup(r, test_str);
60587 0 : if (unicode != NULL) {
60588 0 : Py_DECREF(unicode);
60589 : }
60590 0 : if (talloc_str == NULL) {
60591 0 : PyErr_NoMemory();
60592 0 : return false;
60593 : }
60594 0 : r->in.server_name = talloc_str;
60595 : }
60596 : }
60597 0 : if (py_account_name == NULL) {
60598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
60599 0 : return false;
60600 : }
60601 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
60602 0 : if (r->in.account_name == NULL) {
60603 0 : PyErr_NoMemory();
60604 0 : return false;
60605 : }
60606 : {
60607 : const char *test_str;
60608 : const char *talloc_str;
60609 0 : PyObject *unicode = NULL;
60610 0 : if (PyUnicode_Check(py_account_name)) {
60611 0 : unicode = PyUnicode_AsEncodedString(py_account_name, "utf-8", "ignore");
60612 0 : if (unicode == NULL) {
60613 0 : PyErr_NoMemory();
60614 0 : return false;
60615 : }
60616 0 : test_str = PyBytes_AS_STRING(unicode);
60617 0 : } else if (PyBytes_Check(py_account_name)) {
60618 0 : test_str = PyBytes_AS_STRING(py_account_name);
60619 : } else {
60620 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_account_name)->tp_name);
60621 0 : return false;
60622 : }
60623 0 : talloc_str = talloc_strdup(r, test_str);
60624 0 : if (unicode != NULL) {
60625 0 : Py_DECREF(unicode);
60626 : }
60627 0 : if (talloc_str == NULL) {
60628 0 : PyErr_NoMemory();
60629 0 : return false;
60630 : }
60631 0 : r->in.account_name = talloc_str;
60632 : }
60633 0 : if (py_secure_channel_type == NULL) {
60634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.secure_channel_type");
60635 0 : return false;
60636 : }
60637 : {
60638 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.secure_channel_type));
60639 0 : if (PyLong_Check(py_secure_channel_type)) {
60640 : unsigned long long test_var;
60641 0 : test_var = PyLong_AsUnsignedLongLong(py_secure_channel_type);
60642 0 : if (PyErr_Occurred() != NULL) {
60643 0 : return false;
60644 : }
60645 0 : if (test_var > uint_max) {
60646 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
60647 : PyLong_Type.tp_name, uint_max, test_var);
60648 0 : return false;
60649 : }
60650 0 : r->in.secure_channel_type = test_var;
60651 : } else {
60652 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
60653 : PyLong_Type.tp_name);
60654 0 : return false;
60655 : }
60656 : }
60657 0 : if (py_computer_name == NULL) {
60658 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
60659 0 : return false;
60660 : }
60661 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
60662 0 : if (r->in.computer_name == NULL) {
60663 0 : PyErr_NoMemory();
60664 0 : return false;
60665 : }
60666 : {
60667 : const char *test_str;
60668 : const char *talloc_str;
60669 0 : PyObject *unicode = NULL;
60670 0 : if (PyUnicode_Check(py_computer_name)) {
60671 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
60672 0 : if (unicode == NULL) {
60673 0 : PyErr_NoMemory();
60674 0 : return false;
60675 : }
60676 0 : test_str = PyBytes_AS_STRING(unicode);
60677 0 : } else if (PyBytes_Check(py_computer_name)) {
60678 0 : test_str = PyBytes_AS_STRING(py_computer_name);
60679 : } else {
60680 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
60681 0 : return false;
60682 : }
60683 0 : talloc_str = talloc_strdup(r, test_str);
60684 0 : if (unicode != NULL) {
60685 0 : Py_DECREF(unicode);
60686 : }
60687 0 : if (talloc_str == NULL) {
60688 0 : PyErr_NoMemory();
60689 0 : return false;
60690 : }
60691 0 : r->in.computer_name = talloc_str;
60692 : }
60693 0 : if (py_credential == NULL) {
60694 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
60695 0 : return false;
60696 : }
60697 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
60698 0 : if (r->in.credential == NULL) {
60699 0 : PyErr_NoMemory();
60700 0 : return false;
60701 : }
60702 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
60703 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
60704 0 : PyErr_NoMemory();
60705 0 : return false;
60706 : }
60707 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
60708 0 : return true;
60709 : }
60710 :
60711 0 : static PyObject *unpack_py_netr_ServerGetTrustInfo_args_out(struct netr_ServerGetTrustInfo *r)
60712 : {
60713 : PyObject *result;
60714 : PyObject *py_return_authenticator;
60715 : PyObject *py_new_owf_password;
60716 : PyObject *py_old_owf_password;
60717 : PyObject *py_trust_info;
60718 0 : result = PyTuple_New(4);
60719 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
60720 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
60721 0 : py_new_owf_password = pytalloc_reference_ex(samr_Password_Type, r->out.new_owf_password, r->out.new_owf_password);
60722 0 : PyTuple_SetItem(result, 1, py_new_owf_password);
60723 0 : py_old_owf_password = pytalloc_reference_ex(samr_Password_Type, r->out.old_owf_password, r->out.old_owf_password);
60724 0 : PyTuple_SetItem(result, 2, py_old_owf_password);
60725 0 : if (*r->out.trust_info == NULL) {
60726 0 : py_trust_info = Py_None;
60727 0 : Py_INCREF(py_trust_info);
60728 : } else {
60729 0 : py_trust_info = pytalloc_reference_ex(&netr_TrustInfo_Type, *r->out.trust_info, *r->out.trust_info);
60730 : }
60731 0 : PyTuple_SetItem(result, 3, py_trust_info);
60732 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
60733 0 : PyErr_SetNTSTATUS(r->out.result);
60734 0 : return NULL;
60735 : }
60736 :
60737 0 : return result;
60738 : }
60739 :
60740 :
60741 0 : static PyObject *py_netr_Unused47_get_result(PyObject *obj, void *closure)
60742 : {
60743 0 : struct netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(obj);
60744 : PyObject *py_result;
60745 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
60746 0 : return py_result;
60747 : }
60748 :
60749 0 : static int py_netr_Unused47_set_result(PyObject *py_obj, PyObject *value, void *closure)
60750 : {
60751 0 : struct netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(py_obj);
60752 0 : if (value == NULL) {
60753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
60754 0 : return -1;
60755 : }
60756 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
60757 0 : return 0;
60758 : }
60759 :
60760 : static PyGetSetDef py_netr_Unused47_getsetters[] = {
60761 : {
60762 : .name = discard_const_p(char, "result"),
60763 : .get = py_netr_Unused47_get_result,
60764 : .set = py_netr_Unused47_set_result,
60765 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
60766 : },
60767 : { .name = NULL }
60768 : };
60769 :
60770 0 : static PyObject *py_netr_Unused47_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
60771 : {
60772 0 : PyObject *self = pytalloc_new(struct netr_Unused47, type);
60773 0 : return self;
60774 : }
60775 :
60776 0 : static PyObject *py_netr_Unused47_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
60777 : {
60778 :
60779 :
60780 0 : return PyLong_FromLong(47);
60781 : }
60782 :
60783 0 : static PyObject *py_netr_Unused47_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
60784 : {
60785 0 : const struct ndr_interface_call *call = NULL;
60786 0 : struct netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(py_obj);
60787 0 : PyObject *ret = NULL;
60788 0 : struct ndr_push *push = NULL;
60789 : DATA_BLOB blob;
60790 : enum ndr_err_code err;
60791 :
60792 0 : if (ndr_table_netlogon.num_calls < 48) {
60793 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_Unused47_ndr_pack");
60794 0 : return NULL;
60795 : }
60796 0 : call = &ndr_table_netlogon.calls[47];
60797 :
60798 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
60799 0 : if (push == NULL) {
60800 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
60801 0 : return NULL;
60802 : }
60803 :
60804 0 : push->flags |= ndr_push_flags;
60805 :
60806 0 : err = call->ndr_push(push, ndr_inout_flags, object);
60807 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
60808 0 : TALLOC_FREE(push);
60809 0 : PyErr_SetNdrError(err);
60810 0 : return NULL;
60811 : }
60812 0 : blob = ndr_push_blob(push);
60813 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
60814 0 : TALLOC_FREE(push);
60815 0 : return ret;
60816 : }
60817 :
60818 0 : static PyObject *py_netr_Unused47_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
60819 : {
60820 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
60821 0 : PyObject *bigendian_obj = NULL;
60822 0 : PyObject *ndr64_obj = NULL;
60823 0 : uint32_t ndr_push_flags = 0;
60824 :
60825 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
60826 : discard_const_p(char *, kwnames),
60827 : &bigendian_obj,
60828 : &ndr64_obj)) {
60829 0 : return NULL;
60830 : }
60831 :
60832 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
60833 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
60834 : }
60835 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
60836 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
60837 : }
60838 :
60839 0 : return py_netr_Unused47_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
60840 : }
60841 :
60842 0 : static PyObject *py_netr_Unused47_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
60843 : {
60844 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
60845 0 : PyObject *bigendian_obj = NULL;
60846 0 : PyObject *ndr64_obj = NULL;
60847 0 : uint32_t ndr_push_flags = 0;
60848 :
60849 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
60850 : discard_const_p(char *, kwnames),
60851 : &bigendian_obj,
60852 : &ndr64_obj)) {
60853 0 : return NULL;
60854 : }
60855 :
60856 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
60857 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
60858 : }
60859 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
60860 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
60861 : }
60862 :
60863 0 : return py_netr_Unused47_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
60864 : }
60865 :
60866 0 : static PyObject *py_netr_Unused47_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
60867 : {
60868 0 : const struct ndr_interface_call *call = NULL;
60869 0 : struct netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(py_obj);
60870 0 : struct ndr_pull *pull = NULL;
60871 : enum ndr_err_code err;
60872 :
60873 0 : if (ndr_table_netlogon.num_calls < 48) {
60874 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_Unused47_ndr_unpack");
60875 0 : return NULL;
60876 : }
60877 0 : call = &ndr_table_netlogon.calls[47];
60878 :
60879 0 : pull = ndr_pull_init_blob(blob, object);
60880 0 : if (pull == NULL) {
60881 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
60882 0 : return NULL;
60883 : }
60884 :
60885 0 : pull->flags |= ndr_pull_flags;
60886 :
60887 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
60888 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
60889 0 : TALLOC_FREE(pull);
60890 0 : PyErr_SetNdrError(err);
60891 0 : return NULL;
60892 : }
60893 0 : if (!allow_remaining) {
60894 : uint32_t highest_ofs;
60895 :
60896 0 : if (pull->offset > pull->relative_highest_offset) {
60897 0 : highest_ofs = pull->offset;
60898 : } else {
60899 0 : highest_ofs = pull->relative_highest_offset;
60900 : }
60901 0 : if (highest_ofs < pull->data_size) {
60902 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
60903 : "not all bytes consumed ofs[%u] size[%u]",
60904 : highest_ofs, pull->data_size);
60905 0 : TALLOC_FREE(pull);
60906 0 : PyErr_SetNdrError(err);
60907 0 : return NULL;
60908 : }
60909 : }
60910 :
60911 0 : TALLOC_FREE(pull);
60912 0 : Py_RETURN_NONE;
60913 : }
60914 :
60915 0 : static PyObject *py_netr_Unused47_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
60916 : {
60917 : DATA_BLOB blob;
60918 0 : Py_ssize_t blob_length = 0;
60919 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
60920 0 : PyObject *bigendian_obj = NULL;
60921 0 : PyObject *ndr64_obj = NULL;
60922 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
60923 0 : PyObject *allow_remaining_obj = NULL;
60924 0 : bool allow_remaining = false;
60925 :
60926 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
60927 : discard_const_p(char *, kwnames),
60928 : &blob.data, &blob_length,
60929 : &bigendian_obj,
60930 : &ndr64_obj,
60931 : &allow_remaining_obj)) {
60932 0 : return NULL;
60933 : }
60934 0 : blob.length = blob_length;
60935 :
60936 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
60937 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
60938 : }
60939 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
60940 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
60941 : }
60942 :
60943 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
60944 0 : allow_remaining = true;
60945 : }
60946 :
60947 0 : return py_netr_Unused47_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
60948 : }
60949 :
60950 0 : static PyObject *py_netr_Unused47_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
60951 : {
60952 : DATA_BLOB blob;
60953 0 : Py_ssize_t blob_length = 0;
60954 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
60955 0 : PyObject *bigendian_obj = NULL;
60956 0 : PyObject *ndr64_obj = NULL;
60957 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
60958 0 : PyObject *allow_remaining_obj = NULL;
60959 0 : bool allow_remaining = false;
60960 :
60961 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
60962 : discard_const_p(char *, kwnames),
60963 : &blob.data, &blob_length,
60964 : &bigendian_obj,
60965 : &ndr64_obj,
60966 : &allow_remaining_obj)) {
60967 0 : return NULL;
60968 : }
60969 0 : blob.length = blob_length;
60970 :
60971 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
60972 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
60973 : }
60974 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
60975 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
60976 : }
60977 :
60978 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
60979 0 : allow_remaining = true;
60980 : }
60981 :
60982 0 : return py_netr_Unused47_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
60983 : }
60984 :
60985 0 : static PyObject *py_netr_Unused47_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
60986 : {
60987 0 : const struct ndr_interface_call *call = NULL;
60988 0 : struct netr_Unused47 *object = (struct netr_Unused47 *)pytalloc_get_ptr(py_obj);
60989 : PyObject *ret;
60990 : char *retstr;
60991 :
60992 0 : if (ndr_table_netlogon.num_calls < 48) {
60993 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_Unused47_ndr_print");
60994 0 : return NULL;
60995 : }
60996 0 : call = &ndr_table_netlogon.calls[47];
60997 :
60998 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
60999 0 : ret = PyUnicode_FromString(retstr);
61000 0 : TALLOC_FREE(retstr);
61001 :
61002 0 : return ret;
61003 : }
61004 :
61005 0 : static PyObject *py_netr_Unused47_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
61006 : {
61007 0 : return py_netr_Unused47_ndr_print(py_obj, "netr_Unused47_in", NDR_IN);
61008 : }
61009 :
61010 0 : static PyObject *py_netr_Unused47_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
61011 : {
61012 0 : return py_netr_Unused47_ndr_print(py_obj, "netr_Unused47_out", NDR_OUT);
61013 : }
61014 :
61015 : static PyMethodDef py_netr_Unused47_methods[] = {
61016 : { "opnum", (PyCFunction)py_netr_Unused47_ndr_opnum, METH_NOARGS|METH_CLASS,
61017 : "netlogon.netr_Unused47.opnum() -> 47 (0x2f) " },
61018 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Unused47_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
61019 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
61020 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Unused47_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
61021 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
61022 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Unused47_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
61023 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
61024 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_Unused47_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
61025 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
61026 : { "__ndr_print_in__", (PyCFunction)py_netr_Unused47_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
61027 : { "__ndr_print_out__", (PyCFunction)py_netr_Unused47_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
61028 : { NULL, NULL, 0, NULL }
61029 : };
61030 :
61031 :
61032 : static PyTypeObject netr_Unused47_Type = {
61033 : PyVarObject_HEAD_INIT(NULL, 0)
61034 : .tp_name = "netlogon.netr_Unused47",
61035 : .tp_getset = py_netr_Unused47_getsetters,
61036 : .tp_methods = py_netr_Unused47_methods,
61037 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
61038 : .tp_new = py_netr_Unused47_new,
61039 : };
61040 :
61041 0 : static bool pack_py_netr_Unused47_args_in(PyObject *args, PyObject *kwargs, struct netr_Unused47 *r)
61042 : {
61043 0 : const char *kwnames[] = {
61044 : NULL
61045 : };
61046 :
61047 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":netr_Unused47", discard_const_p(char *, kwnames))) {
61048 0 : return false;
61049 : }
61050 :
61051 0 : return true;
61052 : }
61053 :
61054 0 : static PyObject *unpack_py_netr_Unused47_args_out(struct netr_Unused47 *r)
61055 : {
61056 : PyObject *result;
61057 0 : result = Py_None;
61058 0 : Py_INCREF(result);
61059 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
61060 0 : PyErr_SetNTSTATUS(r->out.result);
61061 0 : return NULL;
61062 : }
61063 :
61064 0 : return result;
61065 : }
61066 :
61067 :
61068 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_server_name(PyObject *obj, void *closure)
61069 : {
61070 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61071 : PyObject *py_server_name;
61072 0 : if (object->in.server_name == NULL) {
61073 0 : Py_RETURN_NONE;
61074 : }
61075 0 : if (object->in.server_name == NULL) {
61076 0 : py_server_name = Py_None;
61077 0 : Py_INCREF(py_server_name);
61078 : } else {
61079 0 : if (object->in.server_name == NULL) {
61080 0 : py_server_name = Py_None;
61081 0 : Py_INCREF(py_server_name);
61082 : } else {
61083 0 : py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
61084 : }
61085 : }
61086 0 : return py_server_name;
61087 : }
61088 :
61089 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
61090 : {
61091 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61092 0 : if (value == NULL) {
61093 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server_name");
61094 0 : return -1;
61095 : }
61096 0 : if (value == Py_None) {
61097 0 : object->in.server_name = NULL;
61098 : } else {
61099 0 : object->in.server_name = NULL;
61100 : {
61101 : const char *test_str;
61102 : const char *talloc_str;
61103 0 : PyObject *unicode = NULL;
61104 0 : if (PyUnicode_Check(value)) {
61105 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
61106 0 : if (unicode == NULL) {
61107 0 : PyErr_NoMemory();
61108 0 : return -1;
61109 : }
61110 0 : test_str = PyBytes_AS_STRING(unicode);
61111 0 : } else if (PyBytes_Check(value)) {
61112 0 : test_str = PyBytes_AS_STRING(value);
61113 : } else {
61114 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
61115 0 : return -1;
61116 : }
61117 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
61118 0 : if (unicode != NULL) {
61119 0 : Py_DECREF(unicode);
61120 : }
61121 0 : if (talloc_str == NULL) {
61122 0 : PyErr_NoMemory();
61123 0 : return -1;
61124 : }
61125 0 : object->in.server_name = talloc_str;
61126 : }
61127 : }
61128 0 : return 0;
61129 : }
61130 :
61131 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_computer_name(PyObject *obj, void *closure)
61132 : {
61133 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61134 : PyObject *py_computer_name;
61135 0 : if (object->in.computer_name == NULL) {
61136 0 : Py_RETURN_NONE;
61137 : }
61138 0 : if (object->in.computer_name == NULL) {
61139 0 : py_computer_name = Py_None;
61140 0 : Py_INCREF(py_computer_name);
61141 : } else {
61142 0 : py_computer_name = PyUnicode_Decode(object->in.computer_name, strlen(object->in.computer_name), "utf-8", "ignore");
61143 : }
61144 0 : return py_computer_name;
61145 : }
61146 :
61147 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_computer_name(PyObject *py_obj, PyObject *value, void *closure)
61148 : {
61149 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61150 0 : if (value == NULL) {
61151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.computer_name");
61152 0 : return -1;
61153 : }
61154 0 : object->in.computer_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.computer_name);
61155 0 : if (object->in.computer_name == NULL) {
61156 0 : PyErr_NoMemory();
61157 0 : return -1;
61158 : }
61159 : {
61160 : const char *test_str;
61161 : const char *talloc_str;
61162 0 : PyObject *unicode = NULL;
61163 0 : if (PyUnicode_Check(value)) {
61164 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
61165 0 : if (unicode == NULL) {
61166 0 : PyErr_NoMemory();
61167 0 : return -1;
61168 : }
61169 0 : test_str = PyBytes_AS_STRING(unicode);
61170 0 : } else if (PyBytes_Check(value)) {
61171 0 : test_str = PyBytes_AS_STRING(value);
61172 : } else {
61173 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
61174 0 : return -1;
61175 : }
61176 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
61177 0 : if (unicode != NULL) {
61178 0 : Py_DECREF(unicode);
61179 : }
61180 0 : if (talloc_str == NULL) {
61181 0 : PyErr_NoMemory();
61182 0 : return -1;
61183 : }
61184 0 : object->in.computer_name = talloc_str;
61185 : }
61186 0 : return 0;
61187 : }
61188 :
61189 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_credential(PyObject *obj, void *closure)
61190 : {
61191 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61192 : PyObject *py_credential;
61193 0 : if (object->in.credential == NULL) {
61194 0 : Py_RETURN_NONE;
61195 : }
61196 0 : py_credential = pytalloc_reference_ex(&netr_Authenticator_Type, object->in.credential, object->in.credential);
61197 0 : return py_credential;
61198 : }
61199 :
61200 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_credential(PyObject *py_obj, PyObject *value, void *closure)
61201 : {
61202 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61203 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.credential));
61204 0 : if (value == NULL) {
61205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.credential");
61206 0 : return -1;
61207 : }
61208 0 : object->in.credential = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.credential);
61209 0 : if (object->in.credential == NULL) {
61210 0 : PyErr_NoMemory();
61211 0 : return -1;
61212 : }
61213 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
61214 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
61215 0 : PyErr_NoMemory();
61216 0 : return -1;
61217 : }
61218 0 : object->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(value);
61219 0 : return 0;
61220 : }
61221 :
61222 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_out_get_return_authenticator(PyObject *obj, void *closure)
61223 : {
61224 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61225 : PyObject *py_return_authenticator;
61226 0 : if (object->out.return_authenticator == NULL) {
61227 0 : Py_RETURN_NONE;
61228 : }
61229 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, object->out.return_authenticator, object->out.return_authenticator);
61230 0 : return py_return_authenticator;
61231 : }
61232 :
61233 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_out_set_return_authenticator(PyObject *py_obj, PyObject *value, void *closure)
61234 : {
61235 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61236 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.return_authenticator));
61237 0 : if (value == NULL) {
61238 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.return_authenticator");
61239 0 : return -1;
61240 : }
61241 0 : object->out.return_authenticator = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.return_authenticator);
61242 0 : if (object->out.return_authenticator == NULL) {
61243 0 : PyErr_NoMemory();
61244 0 : return -1;
61245 : }
61246 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, value, return -1;);
61247 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
61248 0 : PyErr_NoMemory();
61249 0 : return -1;
61250 : }
61251 0 : object->out.return_authenticator = (struct netr_Authenticator *)pytalloc_get_ptr(value);
61252 0 : return 0;
61253 : }
61254 :
61255 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name(PyObject *obj, void *closure)
61256 : {
61257 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61258 : PyObject *py_site_name;
61259 0 : if (object->in.site_name == NULL) {
61260 0 : Py_RETURN_NONE;
61261 : }
61262 0 : if (object->in.site_name == NULL) {
61263 0 : py_site_name = Py_None;
61264 0 : Py_INCREF(py_site_name);
61265 : } else {
61266 0 : if (object->in.site_name == NULL) {
61267 0 : py_site_name = Py_None;
61268 0 : Py_INCREF(py_site_name);
61269 : } else {
61270 0 : py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
61271 : }
61272 : }
61273 0 : return py_site_name;
61274 : }
61275 :
61276 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
61277 : {
61278 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61279 0 : if (value == NULL) {
61280 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.site_name");
61281 0 : return -1;
61282 : }
61283 0 : if (value == Py_None) {
61284 0 : object->in.site_name = NULL;
61285 : } else {
61286 0 : object->in.site_name = NULL;
61287 : {
61288 : const char *test_str;
61289 : const char *talloc_str;
61290 0 : PyObject *unicode = NULL;
61291 0 : if (PyUnicode_Check(value)) {
61292 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
61293 0 : if (unicode == NULL) {
61294 0 : PyErr_NoMemory();
61295 0 : return -1;
61296 : }
61297 0 : test_str = PyBytes_AS_STRING(unicode);
61298 0 : } else if (PyBytes_Check(value)) {
61299 0 : test_str = PyBytes_AS_STRING(value);
61300 : } else {
61301 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
61302 0 : return -1;
61303 : }
61304 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
61305 0 : if (unicode != NULL) {
61306 0 : Py_DECREF(unicode);
61307 : }
61308 0 : if (talloc_str == NULL) {
61309 0 : PyErr_NoMemory();
61310 0 : return -1;
61311 : }
61312 0 : object->in.site_name = talloc_str;
61313 : }
61314 : }
61315 0 : return 0;
61316 : }
61317 :
61318 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl(PyObject *obj, void *closure)
61319 : {
61320 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61321 : PyObject *py_dns_ttl;
61322 0 : py_dns_ttl = PyLong_FromUnsignedLongLong((uint32_t)object->in.dns_ttl);
61323 0 : return py_dns_ttl;
61324 : }
61325 :
61326 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl(PyObject *py_obj, PyObject *value, void *closure)
61327 : {
61328 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61329 0 : if (value == NULL) {
61330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dns_ttl");
61331 0 : return -1;
61332 : }
61333 : {
61334 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dns_ttl));
61335 0 : if (PyLong_Check(value)) {
61336 : unsigned long long test_var;
61337 0 : test_var = PyLong_AsUnsignedLongLong(value);
61338 0 : if (PyErr_Occurred() != NULL) {
61339 0 : return -1;
61340 : }
61341 0 : if (test_var > uint_max) {
61342 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
61343 : PyLong_Type.tp_name, uint_max, test_var);
61344 0 : return -1;
61345 : }
61346 0 : object->in.dns_ttl = test_var;
61347 : } else {
61348 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
61349 : PyLong_Type.tp_name);
61350 0 : return -1;
61351 : }
61352 : }
61353 0 : return 0;
61354 : }
61355 :
61356 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names(PyObject *obj, void *closure)
61357 : {
61358 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61359 : PyObject *py_dns_names;
61360 0 : if (object->in.dns_names == NULL) {
61361 0 : Py_RETURN_NONE;
61362 : }
61363 0 : py_dns_names = pytalloc_reference_ex(&NL_DNS_NAME_INFO_ARRAY_Type, object->in.dns_names, object->in.dns_names);
61364 0 : return py_dns_names;
61365 : }
61366 :
61367 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names(PyObject *py_obj, PyObject *value, void *closure)
61368 : {
61369 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61370 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dns_names));
61371 0 : if (value == NULL) {
61372 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dns_names");
61373 0 : return -1;
61374 : }
61375 0 : object->in.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dns_names);
61376 0 : if (object->in.dns_names == NULL) {
61377 0 : PyErr_NoMemory();
61378 0 : return -1;
61379 : }
61380 0 : PY_CHECK_TYPE(&NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;);
61381 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
61382 0 : PyErr_NoMemory();
61383 0 : return -1;
61384 : }
61385 0 : object->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value);
61386 0 : return 0;
61387 : }
61388 :
61389 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names(PyObject *obj, void *closure)
61390 : {
61391 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61392 : PyObject *py_dns_names;
61393 0 : if (object->out.dns_names == NULL) {
61394 0 : Py_RETURN_NONE;
61395 : }
61396 0 : py_dns_names = pytalloc_reference_ex(&NL_DNS_NAME_INFO_ARRAY_Type, object->out.dns_names, object->out.dns_names);
61397 0 : return py_dns_names;
61398 : }
61399 :
61400 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names(PyObject *py_obj, PyObject *value, void *closure)
61401 : {
61402 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61403 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dns_names));
61404 0 : if (value == NULL) {
61405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dns_names");
61406 0 : return -1;
61407 : }
61408 0 : object->out.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dns_names);
61409 0 : if (object->out.dns_names == NULL) {
61410 0 : PyErr_NoMemory();
61411 0 : return -1;
61412 : }
61413 0 : PY_CHECK_TYPE(&NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;);
61414 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
61415 0 : PyErr_NoMemory();
61416 0 : return -1;
61417 : }
61418 0 : object->out.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value);
61419 0 : return 0;
61420 : }
61421 :
61422 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_get_result(PyObject *obj, void *closure)
61423 : {
61424 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(obj);
61425 : PyObject *py_result;
61426 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
61427 0 : return py_result;
61428 : }
61429 :
61430 0 : static int py_netr_DsrUpdateReadOnlyServerDnsRecords_set_result(PyObject *py_obj, PyObject *value, void *closure)
61431 : {
61432 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61433 0 : if (value == NULL) {
61434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
61435 0 : return -1;
61436 : }
61437 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
61438 0 : return 0;
61439 : }
61440 :
61441 : static PyGetSetDef py_netr_DsrUpdateReadOnlyServerDnsRecords_getsetters[] = {
61442 : {
61443 : .name = discard_const_p(char, "in_server_name"),
61444 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_server_name,
61445 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_server_name,
61446 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
61447 : },
61448 : {
61449 : .name = discard_const_p(char, "in_computer_name"),
61450 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_computer_name,
61451 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_computer_name,
61452 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
61453 : },
61454 : {
61455 : .name = discard_const_p(char, "in_credential"),
61456 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_credential,
61457 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_credential,
61458 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
61459 : },
61460 : {
61461 : .name = discard_const_p(char, "out_return_authenticator"),
61462 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_out_get_return_authenticator,
61463 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_out_set_return_authenticator,
61464 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Authenticator")
61465 : },
61466 : {
61467 : .name = discard_const_p(char, "in_site_name"),
61468 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name,
61469 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name,
61470 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
61471 : },
61472 : {
61473 : .name = discard_const_p(char, "in_dns_ttl"),
61474 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl,
61475 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl,
61476 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
61477 : },
61478 : {
61479 : .name = discard_const_p(char, "in_dns_names"),
61480 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names,
61481 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names,
61482 : .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY")
61483 : },
61484 : {
61485 : .name = discard_const_p(char, "out_dns_names"),
61486 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names,
61487 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names,
61488 : .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY")
61489 : },
61490 : {
61491 : .name = discard_const_p(char, "result"),
61492 : .get = py_netr_DsrUpdateReadOnlyServerDnsRecords_get_result,
61493 : .set = py_netr_DsrUpdateReadOnlyServerDnsRecords_set_result,
61494 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
61495 : },
61496 : { .name = NULL }
61497 : };
61498 :
61499 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
61500 : {
61501 0 : PyObject *self = pytalloc_new(struct netr_DsrUpdateReadOnlyServerDnsRecords, type);
61502 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *_self = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(self);
61503 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
61504 0 : _self->in.credential = talloc_zero(mem_ctx, struct netr_Authenticator);
61505 0 : _self->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
61506 0 : _self->in.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY);
61507 0 : _self->out.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY);
61508 0 : return self;
61509 : }
61510 :
61511 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
61512 : {
61513 :
61514 :
61515 0 : return PyLong_FromLong(48);
61516 : }
61517 :
61518 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
61519 : {
61520 0 : const struct ndr_interface_call *call = NULL;
61521 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61522 0 : PyObject *ret = NULL;
61523 0 : struct ndr_push *push = NULL;
61524 : DATA_BLOB blob;
61525 : enum ndr_err_code err;
61526 :
61527 0 : if (ndr_table_netlogon.num_calls < 49) {
61528 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack");
61529 0 : return NULL;
61530 : }
61531 0 : call = &ndr_table_netlogon.calls[48];
61532 :
61533 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
61534 0 : if (push == NULL) {
61535 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
61536 0 : return NULL;
61537 : }
61538 :
61539 0 : push->flags |= ndr_push_flags;
61540 :
61541 0 : err = call->ndr_push(push, ndr_inout_flags, object);
61542 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
61543 0 : TALLOC_FREE(push);
61544 0 : PyErr_SetNdrError(err);
61545 0 : return NULL;
61546 : }
61547 0 : blob = ndr_push_blob(push);
61548 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
61549 0 : TALLOC_FREE(push);
61550 0 : return ret;
61551 : }
61552 :
61553 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
61554 : {
61555 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
61556 0 : PyObject *bigendian_obj = NULL;
61557 0 : PyObject *ndr64_obj = NULL;
61558 0 : uint32_t ndr_push_flags = 0;
61559 :
61560 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
61561 : discard_const_p(char *, kwnames),
61562 : &bigendian_obj,
61563 : &ndr64_obj)) {
61564 0 : return NULL;
61565 : }
61566 :
61567 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
61568 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
61569 : }
61570 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
61571 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
61572 : }
61573 :
61574 0 : return py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
61575 : }
61576 :
61577 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
61578 : {
61579 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
61580 0 : PyObject *bigendian_obj = NULL;
61581 0 : PyObject *ndr64_obj = NULL;
61582 0 : uint32_t ndr_push_flags = 0;
61583 :
61584 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
61585 : discard_const_p(char *, kwnames),
61586 : &bigendian_obj,
61587 : &ndr64_obj)) {
61588 0 : return NULL;
61589 : }
61590 :
61591 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
61592 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
61593 : }
61594 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
61595 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
61596 : }
61597 :
61598 0 : return py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
61599 : }
61600 :
61601 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
61602 : {
61603 0 : const struct ndr_interface_call *call = NULL;
61604 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61605 0 : struct ndr_pull *pull = NULL;
61606 : enum ndr_err_code err;
61607 :
61608 0 : if (ndr_table_netlogon.num_calls < 49) {
61609 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack");
61610 0 : return NULL;
61611 : }
61612 0 : call = &ndr_table_netlogon.calls[48];
61613 :
61614 0 : pull = ndr_pull_init_blob(blob, object);
61615 0 : if (pull == NULL) {
61616 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
61617 0 : return NULL;
61618 : }
61619 :
61620 0 : pull->flags |= ndr_pull_flags;
61621 :
61622 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
61623 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
61624 0 : TALLOC_FREE(pull);
61625 0 : PyErr_SetNdrError(err);
61626 0 : return NULL;
61627 : }
61628 0 : if (!allow_remaining) {
61629 : uint32_t highest_ofs;
61630 :
61631 0 : if (pull->offset > pull->relative_highest_offset) {
61632 0 : highest_ofs = pull->offset;
61633 : } else {
61634 0 : highest_ofs = pull->relative_highest_offset;
61635 : }
61636 0 : if (highest_ofs < pull->data_size) {
61637 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
61638 : "not all bytes consumed ofs[%u] size[%u]",
61639 : highest_ofs, pull->data_size);
61640 0 : TALLOC_FREE(pull);
61641 0 : PyErr_SetNdrError(err);
61642 0 : return NULL;
61643 : }
61644 : }
61645 :
61646 0 : TALLOC_FREE(pull);
61647 0 : Py_RETURN_NONE;
61648 : }
61649 :
61650 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
61651 : {
61652 : DATA_BLOB blob;
61653 0 : Py_ssize_t blob_length = 0;
61654 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
61655 0 : PyObject *bigendian_obj = NULL;
61656 0 : PyObject *ndr64_obj = NULL;
61657 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
61658 0 : PyObject *allow_remaining_obj = NULL;
61659 0 : bool allow_remaining = false;
61660 :
61661 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
61662 : discard_const_p(char *, kwnames),
61663 : &blob.data, &blob_length,
61664 : &bigendian_obj,
61665 : &ndr64_obj,
61666 : &allow_remaining_obj)) {
61667 0 : return NULL;
61668 : }
61669 0 : blob.length = blob_length;
61670 :
61671 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
61672 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
61673 : }
61674 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
61675 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
61676 : }
61677 :
61678 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
61679 0 : allow_remaining = true;
61680 : }
61681 :
61682 0 : return py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
61683 : }
61684 :
61685 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
61686 : {
61687 : DATA_BLOB blob;
61688 0 : Py_ssize_t blob_length = 0;
61689 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
61690 0 : PyObject *bigendian_obj = NULL;
61691 0 : PyObject *ndr64_obj = NULL;
61692 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
61693 0 : PyObject *allow_remaining_obj = NULL;
61694 0 : bool allow_remaining = false;
61695 :
61696 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
61697 : discard_const_p(char *, kwnames),
61698 : &blob.data, &blob_length,
61699 : &bigendian_obj,
61700 : &ndr64_obj,
61701 : &allow_remaining_obj)) {
61702 0 : return NULL;
61703 : }
61704 0 : blob.length = blob_length;
61705 :
61706 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
61707 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
61708 : }
61709 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
61710 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
61711 : }
61712 :
61713 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
61714 0 : allow_remaining = true;
61715 : }
61716 :
61717 0 : return py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
61718 : }
61719 :
61720 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
61721 : {
61722 0 : const struct ndr_interface_call *call = NULL;
61723 0 : struct netr_DsrUpdateReadOnlyServerDnsRecords *object = (struct netr_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(py_obj);
61724 : PyObject *ret;
61725 : char *retstr;
61726 :
61727 0 : if (ndr_table_netlogon.num_calls < 49) {
61728 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print");
61729 0 : return NULL;
61730 : }
61731 0 : call = &ndr_table_netlogon.calls[48];
61732 :
61733 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
61734 0 : ret = PyUnicode_FromString(retstr);
61735 0 : TALLOC_FREE(retstr);
61736 :
61737 0 : return ret;
61738 : }
61739 :
61740 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
61741 : {
61742 0 : return py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "netr_DsrUpdateReadOnlyServerDnsRecords_in", NDR_IN);
61743 : }
61744 :
61745 0 : static PyObject *py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
61746 : {
61747 0 : return py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "netr_DsrUpdateReadOnlyServerDnsRecords_out", NDR_OUT);
61748 : }
61749 :
61750 : static PyMethodDef py_netr_DsrUpdateReadOnlyServerDnsRecords_methods[] = {
61751 : { "opnum", (PyCFunction)py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum, METH_NOARGS|METH_CLASS,
61752 : "netlogon.netr_DsrUpdateReadOnlyServerDnsRecords.opnum() -> 48 (0x30) " },
61753 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
61754 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
61755 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
61756 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
61757 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
61758 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
61759 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
61760 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
61761 : { "__ndr_print_in__", (PyCFunction)py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
61762 : { "__ndr_print_out__", (PyCFunction)py_netr_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
61763 : { NULL, NULL, 0, NULL }
61764 : };
61765 :
61766 :
61767 : static PyTypeObject netr_DsrUpdateReadOnlyServerDnsRecords_Type = {
61768 : PyVarObject_HEAD_INIT(NULL, 0)
61769 : .tp_name = "netlogon.netr_DsrUpdateReadOnlyServerDnsRecords",
61770 : .tp_getset = py_netr_DsrUpdateReadOnlyServerDnsRecords_getsetters,
61771 : .tp_methods = py_netr_DsrUpdateReadOnlyServerDnsRecords_methods,
61772 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
61773 : .tp_new = py_netr_DsrUpdateReadOnlyServerDnsRecords_new,
61774 : };
61775 :
61776 0 : static bool pack_py_netr_DsrUpdateReadOnlyServerDnsRecords_args_in(PyObject *args, PyObject *kwargs, struct netr_DsrUpdateReadOnlyServerDnsRecords *r)
61777 : {
61778 : PyObject *py_server_name;
61779 : PyObject *py_computer_name;
61780 : PyObject *py_credential;
61781 : PyObject *py_site_name;
61782 : PyObject *py_dns_ttl;
61783 : PyObject *py_dns_names;
61784 0 : const char *kwnames[] = {
61785 : "server_name", "computer_name", "credential", "site_name", "dns_ttl", "dns_names", NULL
61786 : };
61787 :
61788 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:netr_DsrUpdateReadOnlyServerDnsRecords", discard_const_p(char *, kwnames), &py_server_name, &py_computer_name, &py_credential, &py_site_name, &py_dns_ttl, &py_dns_names)) {
61789 0 : return false;
61790 : }
61791 :
61792 0 : if (py_server_name == NULL) {
61793 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server_name");
61794 0 : return false;
61795 : }
61796 0 : if (py_server_name == Py_None) {
61797 0 : r->in.server_name = NULL;
61798 : } else {
61799 0 : r->in.server_name = NULL;
61800 : {
61801 : const char *test_str;
61802 : const char *talloc_str;
61803 0 : PyObject *unicode = NULL;
61804 0 : if (PyUnicode_Check(py_server_name)) {
61805 0 : unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
61806 0 : if (unicode == NULL) {
61807 0 : PyErr_NoMemory();
61808 0 : return false;
61809 : }
61810 0 : test_str = PyBytes_AS_STRING(unicode);
61811 0 : } else if (PyBytes_Check(py_server_name)) {
61812 0 : test_str = PyBytes_AS_STRING(py_server_name);
61813 : } else {
61814 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
61815 0 : return false;
61816 : }
61817 0 : talloc_str = talloc_strdup(r, test_str);
61818 0 : if (unicode != NULL) {
61819 0 : Py_DECREF(unicode);
61820 : }
61821 0 : if (talloc_str == NULL) {
61822 0 : PyErr_NoMemory();
61823 0 : return false;
61824 : }
61825 0 : r->in.server_name = talloc_str;
61826 : }
61827 : }
61828 0 : if (py_computer_name == NULL) {
61829 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.computer_name");
61830 0 : return false;
61831 : }
61832 0 : r->in.computer_name = talloc_ptrtype(r, r->in.computer_name);
61833 0 : if (r->in.computer_name == NULL) {
61834 0 : PyErr_NoMemory();
61835 0 : return false;
61836 : }
61837 : {
61838 : const char *test_str;
61839 : const char *talloc_str;
61840 0 : PyObject *unicode = NULL;
61841 0 : if (PyUnicode_Check(py_computer_name)) {
61842 0 : unicode = PyUnicode_AsEncodedString(py_computer_name, "utf-8", "ignore");
61843 0 : if (unicode == NULL) {
61844 0 : PyErr_NoMemory();
61845 0 : return false;
61846 : }
61847 0 : test_str = PyBytes_AS_STRING(unicode);
61848 0 : } else if (PyBytes_Check(py_computer_name)) {
61849 0 : test_str = PyBytes_AS_STRING(py_computer_name);
61850 : } else {
61851 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_computer_name)->tp_name);
61852 0 : return false;
61853 : }
61854 0 : talloc_str = talloc_strdup(r, test_str);
61855 0 : if (unicode != NULL) {
61856 0 : Py_DECREF(unicode);
61857 : }
61858 0 : if (talloc_str == NULL) {
61859 0 : PyErr_NoMemory();
61860 0 : return false;
61861 : }
61862 0 : r->in.computer_name = talloc_str;
61863 : }
61864 0 : if (py_credential == NULL) {
61865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.credential");
61866 0 : return false;
61867 : }
61868 0 : r->in.credential = talloc_ptrtype(r, r->in.credential);
61869 0 : if (r->in.credential == NULL) {
61870 0 : PyErr_NoMemory();
61871 0 : return false;
61872 : }
61873 0 : PY_CHECK_TYPE(&netr_Authenticator_Type, py_credential, return false;);
61874 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_credential)) == NULL) {
61875 0 : PyErr_NoMemory();
61876 0 : return false;
61877 : }
61878 0 : r->in.credential = (struct netr_Authenticator *)pytalloc_get_ptr(py_credential);
61879 0 : if (py_site_name == NULL) {
61880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.site_name");
61881 0 : return false;
61882 : }
61883 0 : if (py_site_name == Py_None) {
61884 0 : r->in.site_name = NULL;
61885 : } else {
61886 0 : r->in.site_name = NULL;
61887 : {
61888 : const char *test_str;
61889 : const char *talloc_str;
61890 0 : PyObject *unicode = NULL;
61891 0 : if (PyUnicode_Check(py_site_name)) {
61892 0 : unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore");
61893 0 : if (unicode == NULL) {
61894 0 : PyErr_NoMemory();
61895 0 : return false;
61896 : }
61897 0 : test_str = PyBytes_AS_STRING(unicode);
61898 0 : } else if (PyBytes_Check(py_site_name)) {
61899 0 : test_str = PyBytes_AS_STRING(py_site_name);
61900 : } else {
61901 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name);
61902 0 : return false;
61903 : }
61904 0 : talloc_str = talloc_strdup(r, test_str);
61905 0 : if (unicode != NULL) {
61906 0 : Py_DECREF(unicode);
61907 : }
61908 0 : if (talloc_str == NULL) {
61909 0 : PyErr_NoMemory();
61910 0 : return false;
61911 : }
61912 0 : r->in.site_name = talloc_str;
61913 : }
61914 : }
61915 0 : if (py_dns_ttl == NULL) {
61916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dns_ttl");
61917 0 : return false;
61918 : }
61919 : {
61920 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dns_ttl));
61921 0 : if (PyLong_Check(py_dns_ttl)) {
61922 : unsigned long long test_var;
61923 0 : test_var = PyLong_AsUnsignedLongLong(py_dns_ttl);
61924 0 : if (PyErr_Occurred() != NULL) {
61925 0 : return false;
61926 : }
61927 0 : if (test_var > uint_max) {
61928 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
61929 : PyLong_Type.tp_name, uint_max, test_var);
61930 0 : return false;
61931 : }
61932 0 : r->in.dns_ttl = test_var;
61933 : } else {
61934 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
61935 : PyLong_Type.tp_name);
61936 0 : return false;
61937 : }
61938 : }
61939 0 : if (py_dns_names == NULL) {
61940 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dns_names");
61941 0 : return false;
61942 : }
61943 0 : r->in.dns_names = talloc_ptrtype(r, r->in.dns_names);
61944 0 : if (r->in.dns_names == NULL) {
61945 0 : PyErr_NoMemory();
61946 0 : return false;
61947 : }
61948 0 : PY_CHECK_TYPE(&NL_DNS_NAME_INFO_ARRAY_Type, py_dns_names, return false;);
61949 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dns_names)) == NULL) {
61950 0 : PyErr_NoMemory();
61951 0 : return false;
61952 : }
61953 0 : r->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_dns_names);
61954 0 : return true;
61955 : }
61956 :
61957 0 : static PyObject *unpack_py_netr_DsrUpdateReadOnlyServerDnsRecords_args_out(struct netr_DsrUpdateReadOnlyServerDnsRecords *r)
61958 : {
61959 : PyObject *result;
61960 : PyObject *py_return_authenticator;
61961 : PyObject *py_dns_names;
61962 0 : result = PyTuple_New(2);
61963 0 : py_return_authenticator = pytalloc_reference_ex(&netr_Authenticator_Type, r->out.return_authenticator, r->out.return_authenticator);
61964 0 : PyTuple_SetItem(result, 0, py_return_authenticator);
61965 0 : py_dns_names = pytalloc_reference_ex(&NL_DNS_NAME_INFO_ARRAY_Type, r->out.dns_names, r->out.dns_names);
61966 0 : PyTuple_SetItem(result, 1, py_dns_names);
61967 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
61968 0 : PyErr_SetNTSTATUS(r->out.result);
61969 0 : return NULL;
61970 : }
61971 :
61972 0 : return result;
61973 : }
61974 :
61975 : const struct PyNdrRpcMethodDef py_ndr_netlogon_methods[] = {
61976 : { "netr_LogonUasLogon", "S.netr_LogonUasLogon(server_name, account_name, workstation) -> info", (py_dcerpc_call_fn)dcerpc_netr_LogonUasLogon_r, (py_data_pack_fn)pack_py_netr_LogonUasLogon_args_in, (py_data_unpack_fn)unpack_py_netr_LogonUasLogon_args_out, 0, &ndr_table_netlogon },
61977 : { "netr_LogonUasLogoff", "S.netr_LogonUasLogoff(server_name, account_name, workstation) -> info", (py_dcerpc_call_fn)dcerpc_netr_LogonUasLogoff_r, (py_data_pack_fn)pack_py_netr_LogonUasLogoff_args_in, (py_data_unpack_fn)unpack_py_netr_LogonUasLogoff_args_out, 1, &ndr_table_netlogon },
61978 : { "netr_LogonSamLogon", "S.netr_LogonSamLogon(server_name, computer_name, credential, return_authenticator, logon_level, logon, validation_level) -> (return_authenticator, validation, authoritative)", (py_dcerpc_call_fn)dcerpc_netr_LogonSamLogon_r, (py_data_pack_fn)pack_py_netr_LogonSamLogon_args_in, (py_data_unpack_fn)unpack_py_netr_LogonSamLogon_args_out, 2, &ndr_table_netlogon },
61979 : { "netr_LogonSamLogoff", "S.netr_LogonSamLogoff(server_name, computer_name, credential, return_authenticator, logon_level, logon) -> return_authenticator", (py_dcerpc_call_fn)dcerpc_netr_LogonSamLogoff_r, (py_data_pack_fn)pack_py_netr_LogonSamLogoff_args_in, (py_data_unpack_fn)unpack_py_netr_LogonSamLogoff_args_out, 3, &ndr_table_netlogon },
61980 : { "netr_ServerReqChallenge", "S.netr_ServerReqChallenge(server_name, computer_name, credentials) -> return_credentials", (py_dcerpc_call_fn)dcerpc_netr_ServerReqChallenge_r, (py_data_pack_fn)pack_py_netr_ServerReqChallenge_args_in, (py_data_unpack_fn)unpack_py_netr_ServerReqChallenge_args_out, 4, &ndr_table_netlogon },
61981 : { "netr_ServerAuthenticate", "S.netr_ServerAuthenticate(server_name, account_name, secure_channel_type, computer_name, credentials) -> return_credentials", (py_dcerpc_call_fn)dcerpc_netr_ServerAuthenticate_r, (py_data_pack_fn)pack_py_netr_ServerAuthenticate_args_in, (py_data_unpack_fn)unpack_py_netr_ServerAuthenticate_args_out, 5, &ndr_table_netlogon },
61982 : { "netr_ServerPasswordSet", "S.netr_ServerPasswordSet(server_name, account_name, secure_channel_type, computer_name, credential, new_password) -> return_authenticator", (py_dcerpc_call_fn)dcerpc_netr_ServerPasswordSet_r, (py_data_pack_fn)pack_py_netr_ServerPasswordSet_args_in, (py_data_unpack_fn)unpack_py_netr_ServerPasswordSet_args_out, 6, &ndr_table_netlogon },
61983 : { "netr_DatabaseDeltas", "S.netr_DatabaseDeltas(logon_server, computername, credential, return_authenticator, database_id, sequence_num, preferredmaximumlength) -> (return_authenticator, sequence_num, delta_enum_array)", (py_dcerpc_call_fn)dcerpc_netr_DatabaseDeltas_r, (py_data_pack_fn)pack_py_netr_DatabaseDeltas_args_in, (py_data_unpack_fn)unpack_py_netr_DatabaseDeltas_args_out, 7, &ndr_table_netlogon },
61984 : { "netr_DatabaseSync", "S.netr_DatabaseSync(logon_server, computername, credential, return_authenticator, database_id, sync_context, preferredmaximumlength) -> (return_authenticator, sync_context, delta_enum_array)", (py_dcerpc_call_fn)dcerpc_netr_DatabaseSync_r, (py_data_pack_fn)pack_py_netr_DatabaseSync_args_in, (py_data_unpack_fn)unpack_py_netr_DatabaseSync_args_out, 8, &ndr_table_netlogon },
61985 : { "netr_AccountDeltas", "S.netr_AccountDeltas(logon_server, computername, credential, return_authenticator, uas, count, level, buffersize) -> (return_authenticator, buffer, count_returned, total_entries, recordid)", (py_dcerpc_call_fn)dcerpc_netr_AccountDeltas_r, (py_data_pack_fn)pack_py_netr_AccountDeltas_args_in, (py_data_unpack_fn)unpack_py_netr_AccountDeltas_args_out, 9, &ndr_table_netlogon },
61986 : { "netr_AccountSync", "S.netr_AccountSync(logon_server, computername, credential, return_authenticator, reference, level, buffersize, recordid) -> (return_authenticator, buffer, count_returned, total_entries, next_reference, recordid)", (py_dcerpc_call_fn)dcerpc_netr_AccountSync_r, (py_data_pack_fn)pack_py_netr_AccountSync_args_in, (py_data_unpack_fn)unpack_py_netr_AccountSync_args_out, 10, &ndr_table_netlogon },
61987 : { "netr_GetDcName", "S.netr_GetDcName(logon_server, domainname) -> dcname", (py_dcerpc_call_fn)dcerpc_netr_GetDcName_r, (py_data_pack_fn)pack_py_netr_GetDcName_args_in, (py_data_unpack_fn)unpack_py_netr_GetDcName_args_out, 11, &ndr_table_netlogon },
61988 : { "netr_LogonControl", "S.netr_LogonControl(logon_server, function_code, level) -> query", (py_dcerpc_call_fn)dcerpc_netr_LogonControl_r, (py_data_pack_fn)pack_py_netr_LogonControl_args_in, (py_data_unpack_fn)unpack_py_netr_LogonControl_args_out, 12, &ndr_table_netlogon },
61989 : { "netr_GetAnyDCName", "S.netr_GetAnyDCName(logon_server, domainname) -> dcname", (py_dcerpc_call_fn)dcerpc_netr_GetAnyDCName_r, (py_data_pack_fn)pack_py_netr_GetAnyDCName_args_in, (py_data_unpack_fn)unpack_py_netr_GetAnyDCName_args_out, 13, &ndr_table_netlogon },
61990 : { "netr_LogonControl2", "S.netr_LogonControl2(logon_server, function_code, level, data) -> query", (py_dcerpc_call_fn)dcerpc_netr_LogonControl2_r, (py_data_pack_fn)pack_py_netr_LogonControl2_args_in, (py_data_unpack_fn)unpack_py_netr_LogonControl2_args_out, 14, &ndr_table_netlogon },
61991 : { "netr_ServerAuthenticate2", "S.netr_ServerAuthenticate2(server_name, account_name, secure_channel_type, computer_name, credentials, negotiate_flags) -> (return_credentials, negotiate_flags)", (py_dcerpc_call_fn)dcerpc_netr_ServerAuthenticate2_r, (py_data_pack_fn)pack_py_netr_ServerAuthenticate2_args_in, (py_data_unpack_fn)unpack_py_netr_ServerAuthenticate2_args_out, 15, &ndr_table_netlogon },
61992 : { "netr_DatabaseSync2", "S.netr_DatabaseSync2(logon_server, computername, credential, return_authenticator, database_id, restart_state, sync_context, preferredmaximumlength) -> (return_authenticator, sync_context, delta_enum_array)", (py_dcerpc_call_fn)dcerpc_netr_DatabaseSync2_r, (py_data_pack_fn)pack_py_netr_DatabaseSync2_args_in, (py_data_unpack_fn)unpack_py_netr_DatabaseSync2_args_out, 16, &ndr_table_netlogon },
61993 : { "netr_DatabaseRedo", "S.netr_DatabaseRedo(logon_server, computername, credential, return_authenticator, change_log_entry, change_log_entry_size) -> (return_authenticator, delta_enum_array)", (py_dcerpc_call_fn)dcerpc_netr_DatabaseRedo_r, (py_data_pack_fn)pack_py_netr_DatabaseRedo_args_in, (py_data_unpack_fn)unpack_py_netr_DatabaseRedo_args_out, 17, &ndr_table_netlogon },
61994 : { "netr_LogonControl2Ex", "S.netr_LogonControl2Ex(logon_server, function_code, level, data) -> query", (py_dcerpc_call_fn)dcerpc_netr_LogonControl2Ex_r, (py_data_pack_fn)pack_py_netr_LogonControl2Ex_args_in, (py_data_unpack_fn)unpack_py_netr_LogonControl2Ex_args_out, 18, &ndr_table_netlogon },
61995 : { "netr_NetrEnumerateTrustedDomains", "S.netr_NetrEnumerateTrustedDomains(server_name) -> trusted_domains_blob", (py_dcerpc_call_fn)dcerpc_netr_NetrEnumerateTrustedDomains_r, (py_data_pack_fn)pack_py_netr_NetrEnumerateTrustedDomains_args_in, (py_data_unpack_fn)unpack_py_netr_NetrEnumerateTrustedDomains_args_out, 19, &ndr_table_netlogon },
61996 : { "netr_DsRGetDCName", "S.netr_DsRGetDCName(server_unc, domain_name, domain_guid, site_guid, flags) -> info", (py_dcerpc_call_fn)dcerpc_netr_DsRGetDCName_r, (py_data_pack_fn)pack_py_netr_DsRGetDCName_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetDCName_args_out, 20, &ndr_table_netlogon },
61997 : { "netr_LogonGetCapabilities", "S.netr_LogonGetCapabilities(server_name, computer_name, credential, return_authenticator, query_level) -> (return_authenticator, capabilities)", (py_dcerpc_call_fn)dcerpc_netr_LogonGetCapabilities_r, (py_data_pack_fn)pack_py_netr_LogonGetCapabilities_args_in, (py_data_unpack_fn)unpack_py_netr_LogonGetCapabilities_args_out, 21, &ndr_table_netlogon },
61998 : { "netr_LogonGetTrustRid", "S.netr_LogonGetTrustRid(server_name, domain_name) -> rid", (py_dcerpc_call_fn)dcerpc_netr_LogonGetTrustRid_r, (py_data_pack_fn)pack_py_netr_LogonGetTrustRid_args_in, (py_data_unpack_fn)unpack_py_netr_LogonGetTrustRid_args_out, 23, &ndr_table_netlogon },
61999 : { "netr_ServerAuthenticate3", "S.netr_ServerAuthenticate3(server_name, account_name, secure_channel_type, computer_name, credentials, negotiate_flags) -> (return_credentials, negotiate_flags, rid)", (py_dcerpc_call_fn)dcerpc_netr_ServerAuthenticate3_r, (py_data_pack_fn)pack_py_netr_ServerAuthenticate3_args_in, (py_data_unpack_fn)unpack_py_netr_ServerAuthenticate3_args_out, 26, &ndr_table_netlogon },
62000 : { "netr_DsRGetDCNameEx", "S.netr_DsRGetDCNameEx(server_unc, domain_name, domain_guid, site_name, flags) -> info", (py_dcerpc_call_fn)dcerpc_netr_DsRGetDCNameEx_r, (py_data_pack_fn)pack_py_netr_DsRGetDCNameEx_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetDCNameEx_args_out, 27, &ndr_table_netlogon },
62001 : { "netr_DsRGetSiteName", "S.netr_DsRGetSiteName(computer_name) -> site", (py_dcerpc_call_fn)dcerpc_netr_DsRGetSiteName_r, (py_data_pack_fn)pack_py_netr_DsRGetSiteName_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetSiteName_args_out, 28, &ndr_table_netlogon },
62002 : { "netr_LogonGetDomainInfo", "S.netr_LogonGetDomainInfo(server_name, computer_name, credential, return_authenticator, level, query) -> (return_authenticator, info)", (py_dcerpc_call_fn)dcerpc_netr_LogonGetDomainInfo_r, (py_data_pack_fn)pack_py_netr_LogonGetDomainInfo_args_in, (py_data_unpack_fn)unpack_py_netr_LogonGetDomainInfo_args_out, 29, &ndr_table_netlogon },
62003 : { "netr_ServerPasswordSet2", "S.netr_ServerPasswordSet2(server_name, account_name, secure_channel_type, computer_name, credential, new_password) -> return_authenticator", (py_dcerpc_call_fn)dcerpc_netr_ServerPasswordSet2_r, (py_data_pack_fn)pack_py_netr_ServerPasswordSet2_args_in, (py_data_unpack_fn)unpack_py_netr_ServerPasswordSet2_args_out, 30, &ndr_table_netlogon },
62004 : { "netr_ServerPasswordGet", "S.netr_ServerPasswordGet(server_name, account_name, secure_channel_type, computer_name, credential) -> (return_authenticator, password)", (py_dcerpc_call_fn)dcerpc_netr_ServerPasswordGet_r, (py_data_pack_fn)pack_py_netr_ServerPasswordGet_args_in, (py_data_unpack_fn)unpack_py_netr_ServerPasswordGet_args_out, 31, &ndr_table_netlogon },
62005 : { "netr_NetrLogonSendToSam", "S.netr_NetrLogonSendToSam(server_name, computer_name, credential, opaque_buffer) -> return_authenticator", (py_dcerpc_call_fn)dcerpc_netr_NetrLogonSendToSam_r, (py_data_pack_fn)pack_py_netr_NetrLogonSendToSam_args_in, (py_data_unpack_fn)unpack_py_netr_NetrLogonSendToSam_args_out, 32, &ndr_table_netlogon },
62006 : { "netr_DsRAddressToSitenamesW", "S.netr_DsRAddressToSitenamesW(server_name, addresses) -> ctr", (py_dcerpc_call_fn)dcerpc_netr_DsRAddressToSitenamesW_r, (py_data_pack_fn)pack_py_netr_DsRAddressToSitenamesW_args_in, (py_data_unpack_fn)unpack_py_netr_DsRAddressToSitenamesW_args_out, 33, &ndr_table_netlogon },
62007 : { "netr_DsRGetDCNameEx2", "S.netr_DsRGetDCNameEx2(server_unc, client_account, mask, domain_name, domain_guid, site_name, flags) -> info", (py_dcerpc_call_fn)dcerpc_netr_DsRGetDCNameEx2_r, (py_data_pack_fn)pack_py_netr_DsRGetDCNameEx2_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetDCNameEx2_args_out, 34, &ndr_table_netlogon },
62008 : { "netr_NetrEnumerateTrustedDomainsEx", "S.netr_NetrEnumerateTrustedDomainsEx(server_name) -> dom_trust_list", (py_dcerpc_call_fn)dcerpc_netr_NetrEnumerateTrustedDomainsEx_r, (py_data_pack_fn)pack_py_netr_NetrEnumerateTrustedDomainsEx_args_in, (py_data_unpack_fn)unpack_py_netr_NetrEnumerateTrustedDomainsEx_args_out, 36, &ndr_table_netlogon },
62009 : { "netr_DsRAddressToSitenamesExW", "S.netr_DsRAddressToSitenamesExW(server_name, addresses) -> ctr", (py_dcerpc_call_fn)dcerpc_netr_DsRAddressToSitenamesExW_r, (py_data_pack_fn)pack_py_netr_DsRAddressToSitenamesExW_args_in, (py_data_unpack_fn)unpack_py_netr_DsRAddressToSitenamesExW_args_out, 37, &ndr_table_netlogon },
62010 : { "netr_DsrGetDcSiteCoverageW", "S.netr_DsrGetDcSiteCoverageW(server_name) -> ctr", (py_dcerpc_call_fn)dcerpc_netr_DsrGetDcSiteCoverageW_r, (py_data_pack_fn)pack_py_netr_DsrGetDcSiteCoverageW_args_in, (py_data_unpack_fn)unpack_py_netr_DsrGetDcSiteCoverageW_args_out, 38, &ndr_table_netlogon },
62011 : { "netr_LogonSamLogonEx", "S.netr_LogonSamLogonEx(server_name, computer_name, logon_level, logon, validation_level, flags) -> (validation, authoritative, flags)", (py_dcerpc_call_fn)dcerpc_netr_LogonSamLogonEx_r, (py_data_pack_fn)pack_py_netr_LogonSamLogonEx_args_in, (py_data_unpack_fn)unpack_py_netr_LogonSamLogonEx_args_out, 39, &ndr_table_netlogon },
62012 : { "netr_DsrEnumerateDomainTrusts", "S.netr_DsrEnumerateDomainTrusts(server_name, trust_flags) -> trusts", (py_dcerpc_call_fn)dcerpc_netr_DsrEnumerateDomainTrusts_r, (py_data_pack_fn)pack_py_netr_DsrEnumerateDomainTrusts_args_in, (py_data_unpack_fn)unpack_py_netr_DsrEnumerateDomainTrusts_args_out, 40, &ndr_table_netlogon },
62013 : { "netr_DsrDeregisterDNSHostRecords", "S.netr_DsrDeregisterDNSHostRecords(server_name, domain, domain_guid, dsa_guid, dns_host) -> None", (py_dcerpc_call_fn)dcerpc_netr_DsrDeregisterDNSHostRecords_r, (py_data_pack_fn)pack_py_netr_DsrDeregisterDNSHostRecords_args_in, (py_data_unpack_fn)unpack_py_netr_DsrDeregisterDNSHostRecords_args_out, 41, &ndr_table_netlogon },
62014 : { "netr_ServerTrustPasswordsGet", "S.netr_ServerTrustPasswordsGet(server_name, account_name, secure_channel_type, computer_name, credential) -> (return_authenticator, new_owf_password, old_owf_password)", (py_dcerpc_call_fn)dcerpc_netr_ServerTrustPasswordsGet_r, (py_data_pack_fn)pack_py_netr_ServerTrustPasswordsGet_args_in, (py_data_unpack_fn)unpack_py_netr_ServerTrustPasswordsGet_args_out, 42, &ndr_table_netlogon },
62015 : { "netr_DsRGetForestTrustInformation", "S.netr_DsRGetForestTrustInformation(server_name, trusted_domain_name, flags) -> forest_trust_info", (py_dcerpc_call_fn)dcerpc_netr_DsRGetForestTrustInformation_r, (py_data_pack_fn)pack_py_netr_DsRGetForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_netr_DsRGetForestTrustInformation_args_out, 43, &ndr_table_netlogon },
62016 : { "netr_GetForestTrustInformation", "S.netr_GetForestTrustInformation(server_name, computer_name, credential, flags) -> (return_authenticator, forest_trust_info)", (py_dcerpc_call_fn)dcerpc_netr_GetForestTrustInformation_r, (py_data_pack_fn)pack_py_netr_GetForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_netr_GetForestTrustInformation_args_out, 44, &ndr_table_netlogon },
62017 : { "netr_LogonSamLogonWithFlags", "S.netr_LogonSamLogonWithFlags(server_name, computer_name, credential, return_authenticator, logon_level, logon, validation_level, flags) -> (return_authenticator, validation, authoritative, flags)", (py_dcerpc_call_fn)dcerpc_netr_LogonSamLogonWithFlags_r, (py_data_pack_fn)pack_py_netr_LogonSamLogonWithFlags_args_in, (py_data_unpack_fn)unpack_py_netr_LogonSamLogonWithFlags_args_out, 45, &ndr_table_netlogon },
62018 : { "netr_ServerGetTrustInfo", "S.netr_ServerGetTrustInfo(server_name, account_name, secure_channel_type, computer_name, credential) -> (return_authenticator, new_owf_password, old_owf_password, trust_info)", (py_dcerpc_call_fn)dcerpc_netr_ServerGetTrustInfo_r, (py_data_pack_fn)pack_py_netr_ServerGetTrustInfo_args_in, (py_data_unpack_fn)unpack_py_netr_ServerGetTrustInfo_args_out, 46, &ndr_table_netlogon },
62019 : { "netr_Unused47", "S.netr_Unused47() -> None", (py_dcerpc_call_fn)dcerpc_netr_Unused47_r, (py_data_pack_fn)pack_py_netr_Unused47_args_in, (py_data_unpack_fn)unpack_py_netr_Unused47_args_out, 47, &ndr_table_netlogon },
62020 : { "netr_DsrUpdateReadOnlyServerDnsRecords", "S.netr_DsrUpdateReadOnlyServerDnsRecords(server_name, computer_name, credential, site_name, dns_ttl, dns_names) -> (return_authenticator, dns_names)", (py_dcerpc_call_fn)dcerpc_netr_DsrUpdateReadOnlyServerDnsRecords_r, (py_data_pack_fn)pack_py_netr_DsrUpdateReadOnlyServerDnsRecords_args_in, (py_data_unpack_fn)unpack_py_netr_DsrUpdateReadOnlyServerDnsRecords_args_out, 48, &ndr_table_netlogon },
62021 : {0}
62022 : };
62023 :
62024 262 : static PyObject *interface_netlogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
62025 : {
62026 262 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_netlogon);
62027 : }
62028 :
62029 : static PyTypeObject netlogon_InterfaceType = {
62030 : PyVarObject_HEAD_INIT(NULL, 0)
62031 : .tp_name = "netlogon.netlogon",
62032 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
62033 : .tp_doc = "netlogon(binding, lp_ctx=None, credentials=None) -> connection\n"
62034 : "\n"
62035 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
62036 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
62037 : "credentials should be a credentials.Credentials object.\n\n",
62038 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
62039 : .tp_new = interface_netlogon_new,
62040 : };
62041 :
62042 48 : static PyObject *syntax_netlogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
62043 : {
62044 48 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_netlogon.syntax_id);
62045 : }
62046 :
62047 : static PyTypeObject netlogon_SyntaxType = {
62048 : PyVarObject_HEAD_INIT(NULL, 0)
62049 : .tp_name = "netlogon.netlogon_abstract_syntax",
62050 : .tp_doc = "netlogon_abstract_syntax()\n",
62051 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
62052 : .tp_new = syntax_netlogon_new,
62053 : };
62054 :
62055 : static PyMethodDef netlogon_methods[] = {
62056 : { NULL, NULL, 0, NULL }
62057 : };
62058 :
62059 : static struct PyModuleDef moduledef = {
62060 : PyModuleDef_HEAD_INIT,
62061 : .m_name = "netlogon",
62062 : .m_doc = "netlogon DCE/RPC",
62063 : .m_size = -1,
62064 : .m_methods = netlogon_methods,
62065 : };
62066 2956 : MODULE_INIT_FUNC(netlogon)
62067 : {
62068 2956 : PyObject *m = NULL;
62069 2956 : PyObject *dep_samba_dcerpc_misc = NULL;
62070 2956 : PyObject *dep_samba_dcerpc_lsa = NULL;
62071 2956 : PyObject *dep_samba_dcerpc_samr = NULL;
62072 2956 : PyObject *dep_samba_dcerpc_security = NULL;
62073 2956 : PyObject *dep_talloc = NULL;
62074 2956 : PyObject *dep_samba_dcerpc_base = NULL;
62075 :
62076 2956 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
62077 2956 : if (dep_samba_dcerpc_misc == NULL)
62078 0 : goto out;
62079 :
62080 2956 : dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
62081 2956 : if (dep_samba_dcerpc_lsa == NULL)
62082 0 : goto out;
62083 :
62084 2956 : dep_samba_dcerpc_samr = PyImport_ImportModule("samba.dcerpc.samr");
62085 2956 : if (dep_samba_dcerpc_samr == NULL)
62086 0 : goto out;
62087 :
62088 2956 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
62089 2956 : if (dep_samba_dcerpc_security == NULL)
62090 0 : goto out;
62091 :
62092 2956 : dep_talloc = PyImport_ImportModule("talloc");
62093 2956 : if (dep_talloc == NULL)
62094 0 : goto out;
62095 :
62096 2956 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
62097 2956 : if (dep_samba_dcerpc_base == NULL)
62098 0 : goto out;
62099 :
62100 2956 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
62101 2956 : if (BaseObject_Type == NULL)
62102 0 : goto out;
62103 :
62104 2956 : lsa_String_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "String");
62105 2956 : if (lsa_String_Type == NULL)
62106 0 : goto out;
62107 :
62108 2956 : samr_Password_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "Password");
62109 2956 : if (samr_Password_Type == NULL)
62110 0 : goto out;
62111 :
62112 2956 : samr_RidWithAttributeArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "RidWithAttributeArray");
62113 2956 : if (samr_RidWithAttributeArray_Type == NULL)
62114 0 : goto out;
62115 :
62116 2956 : lsa_StringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "StringLarge");
62117 2956 : if (lsa_StringLarge_Type == NULL)
62118 0 : goto out;
62119 :
62120 2956 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
62121 2956 : if (dom_sid_Type == NULL)
62122 0 : goto out;
62123 :
62124 2956 : samr_LogonHours_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "LogonHours");
62125 2956 : if (samr_LogonHours_Type == NULL)
62126 0 : goto out;
62127 :
62128 2956 : lsa_BinaryString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "BinaryString");
62129 2956 : if (lsa_BinaryString_Type == NULL)
62130 0 : goto out;
62131 :
62132 2956 : sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
62133 2956 : if (sec_desc_buf_Type == NULL)
62134 0 : goto out;
62135 :
62136 2956 : lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray");
62137 2956 : if (lsa_SidArray_Type == NULL)
62138 0 : goto out;
62139 :
62140 2956 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
62141 2956 : if (GUID_Type == NULL)
62142 0 : goto out;
62143 :
62144 2956 : lsa_ForestTrustInformation_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "ForestTrustInformation");
62145 2956 : if (lsa_ForestTrustInformation_Type == NULL)
62146 0 : goto out;
62147 :
62148 2956 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
62149 2956 : if (ClientConnection_Type == NULL)
62150 0 : goto out;
62151 :
62152 2956 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
62153 2956 : if (ndr_syntax_id_Type == NULL)
62154 0 : goto out;
62155 :
62156 2956 : netr_UasInfo_Type.tp_base = BaseObject_Type;
62157 2956 : netr_UasInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62158 :
62159 2956 : netr_UasLogoffInfo_Type.tp_base = BaseObject_Type;
62160 2956 : netr_UasLogoffInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62161 :
62162 2956 : netr_AcctLockStr_Type.tp_base = BaseObject_Type;
62163 2956 : netr_AcctLockStr_Type.tp_basicsize = pytalloc_BaseObject_size();
62164 :
62165 2956 : netr_IdentityInfo_Type.tp_base = BaseObject_Type;
62166 2956 : netr_IdentityInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62167 :
62168 2956 : netr_PasswordInfo_Type.tp_base = BaseObject_Type;
62169 2956 : netr_PasswordInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62170 :
62171 2956 : netr_ChallengeResponse_Type.tp_base = BaseObject_Type;
62172 2956 : netr_ChallengeResponse_Type.tp_basicsize = pytalloc_BaseObject_size();
62173 :
62174 2956 : netr_NetworkInfo_Type.tp_base = BaseObject_Type;
62175 2956 : netr_NetworkInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62176 :
62177 2956 : netr_GenericInfo_Type.tp_base = BaseObject_Type;
62178 2956 : netr_GenericInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62179 :
62180 2956 : netr_LogonLevel_Type.tp_base = BaseObject_Type;
62181 2956 : netr_LogonLevel_Type.tp_basicsize = pytalloc_BaseObject_size();
62182 :
62183 2956 : netr_UserSessionKey_Type.tp_base = BaseObject_Type;
62184 2956 : netr_UserSessionKey_Type.tp_basicsize = pytalloc_BaseObject_size();
62185 :
62186 2956 : netr_LMSessionKey_Type.tp_base = BaseObject_Type;
62187 2956 : netr_LMSessionKey_Type.tp_basicsize = pytalloc_BaseObject_size();
62188 :
62189 2956 : netr_SamBaseInfo_Type.tp_base = BaseObject_Type;
62190 2956 : netr_SamBaseInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62191 :
62192 2956 : netr_SamInfo2_Type.tp_base = BaseObject_Type;
62193 2956 : netr_SamInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();
62194 :
62195 2956 : netr_SidAttr_Type.tp_base = BaseObject_Type;
62196 2956 : netr_SidAttr_Type.tp_basicsize = pytalloc_BaseObject_size();
62197 :
62198 2956 : netr_SamInfo3_Type.tp_base = BaseObject_Type;
62199 2956 : netr_SamInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();
62200 :
62201 2956 : netr_SamInfo6_Type.tp_base = BaseObject_Type;
62202 2956 : netr_SamInfo6_Type.tp_basicsize = pytalloc_BaseObject_size();
62203 :
62204 2956 : netr_PacInfo_Type.tp_base = BaseObject_Type;
62205 2956 : netr_PacInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62206 :
62207 2956 : netr_GenericInfo2_Type.tp_base = BaseObject_Type;
62208 2956 : netr_GenericInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();
62209 :
62210 2956 : netr_Validation_Type.tp_base = BaseObject_Type;
62211 2956 : netr_Validation_Type.tp_basicsize = pytalloc_BaseObject_size();
62212 :
62213 2956 : netr_Credential_Type.tp_base = BaseObject_Type;
62214 2956 : netr_Credential_Type.tp_basicsize = pytalloc_BaseObject_size();
62215 :
62216 2956 : netlogon_server_pipe_state_Type.tp_base = BaseObject_Type;
62217 2956 : netlogon_server_pipe_state_Type.tp_basicsize = pytalloc_BaseObject_size();
62218 :
62219 2956 : netr_Authenticator_Type.tp_base = BaseObject_Type;
62220 2956 : netr_Authenticator_Type.tp_basicsize = pytalloc_BaseObject_size();
62221 :
62222 2956 : netr_DELTA_DELETE_USER_Type.tp_base = BaseObject_Type;
62223 2956 : netr_DELTA_DELETE_USER_Type.tp_basicsize = pytalloc_BaseObject_size();
62224 :
62225 2956 : netr_USER_KEY16_Type.tp_base = BaseObject_Type;
62226 2956 : netr_USER_KEY16_Type.tp_basicsize = pytalloc_BaseObject_size();
62227 :
62228 2956 : netr_PasswordHistory_Type.tp_base = BaseObject_Type;
62229 2956 : netr_PasswordHistory_Type.tp_basicsize = pytalloc_BaseObject_size();
62230 :
62231 2956 : netr_USER_KEYS2_Type.tp_base = BaseObject_Type;
62232 2956 : netr_USER_KEYS2_Type.tp_basicsize = pytalloc_BaseObject_size();
62233 :
62234 2956 : netr_USER_KEY_UNION_Type.tp_base = BaseObject_Type;
62235 2956 : netr_USER_KEY_UNION_Type.tp_basicsize = pytalloc_BaseObject_size();
62236 :
62237 2956 : netr_USER_KEYS_Type.tp_base = BaseObject_Type;
62238 2956 : netr_USER_KEYS_Type.tp_basicsize = pytalloc_BaseObject_size();
62239 :
62240 2956 : netr_USER_PRIVATE_INFO_Type.tp_base = BaseObject_Type;
62241 2956 : netr_USER_PRIVATE_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
62242 :
62243 2956 : netr_DELTA_USER_Type.tp_base = BaseObject_Type;
62244 2956 : netr_DELTA_USER_Type.tp_basicsize = pytalloc_BaseObject_size();
62245 :
62246 2956 : netr_DELTA_DOMAIN_Type.tp_base = BaseObject_Type;
62247 2956 : netr_DELTA_DOMAIN_Type.tp_basicsize = pytalloc_BaseObject_size();
62248 :
62249 2956 : netr_DELTA_GROUP_Type.tp_base = BaseObject_Type;
62250 2956 : netr_DELTA_GROUP_Type.tp_basicsize = pytalloc_BaseObject_size();
62251 :
62252 2956 : netr_DELTA_RENAME_Type.tp_base = BaseObject_Type;
62253 2956 : netr_DELTA_RENAME_Type.tp_basicsize = pytalloc_BaseObject_size();
62254 :
62255 2956 : netr_DELTA_GROUP_MEMBER_Type.tp_base = BaseObject_Type;
62256 2956 : netr_DELTA_GROUP_MEMBER_Type.tp_basicsize = pytalloc_BaseObject_size();
62257 :
62258 2956 : netr_DELTA_ALIAS_Type.tp_base = BaseObject_Type;
62259 2956 : netr_DELTA_ALIAS_Type.tp_basicsize = pytalloc_BaseObject_size();
62260 :
62261 2956 : netr_DELTA_ALIAS_MEMBER_Type.tp_base = BaseObject_Type;
62262 2956 : netr_DELTA_ALIAS_MEMBER_Type.tp_basicsize = pytalloc_BaseObject_size();
62263 :
62264 2956 : netr_QUOTA_LIMITS_Type.tp_base = BaseObject_Type;
62265 2956 : netr_QUOTA_LIMITS_Type.tp_basicsize = pytalloc_BaseObject_size();
62266 :
62267 2956 : netr_DELTA_POLICY_Type.tp_base = BaseObject_Type;
62268 2956 : netr_DELTA_POLICY_Type.tp_basicsize = pytalloc_BaseObject_size();
62269 :
62270 2956 : netr_DELTA_TRUSTED_DOMAIN_Type.tp_base = BaseObject_Type;
62271 2956 : netr_DELTA_TRUSTED_DOMAIN_Type.tp_basicsize = pytalloc_BaseObject_size();
62272 :
62273 2956 : netr_DELTA_ACCOUNT_Type.tp_base = BaseObject_Type;
62274 2956 : netr_DELTA_ACCOUNT_Type.tp_basicsize = pytalloc_BaseObject_size();
62275 :
62276 2956 : netr_CIPHER_VALUE_Type.tp_base = BaseObject_Type;
62277 2956 : netr_CIPHER_VALUE_Type.tp_basicsize = pytalloc_BaseObject_size();
62278 :
62279 2956 : netr_DELTA_SECRET_Type.tp_base = BaseObject_Type;
62280 2956 : netr_DELTA_SECRET_Type.tp_basicsize = pytalloc_BaseObject_size();
62281 :
62282 2956 : netr_DELTA_UNION_Type.tp_base = BaseObject_Type;
62283 2956 : netr_DELTA_UNION_Type.tp_basicsize = pytalloc_BaseObject_size();
62284 :
62285 2956 : netr_DELTA_ID_UNION_Type.tp_base = BaseObject_Type;
62286 2956 : netr_DELTA_ID_UNION_Type.tp_basicsize = pytalloc_BaseObject_size();
62287 :
62288 2956 : netr_DELTA_ENUM_Type.tp_base = BaseObject_Type;
62289 2956 : netr_DELTA_ENUM_Type.tp_basicsize = pytalloc_BaseObject_size();
62290 :
62291 2956 : netr_DELTA_ENUM_ARRAY_Type.tp_base = BaseObject_Type;
62292 2956 : netr_DELTA_ENUM_ARRAY_Type.tp_basicsize = pytalloc_BaseObject_size();
62293 :
62294 2956 : netr_UAS_INFO_0_Type.tp_base = BaseObject_Type;
62295 2956 : netr_UAS_INFO_0_Type.tp_basicsize = pytalloc_BaseObject_size();
62296 :
62297 2956 : netr_AccountBuffer_Type.tp_base = BaseObject_Type;
62298 2956 : netr_AccountBuffer_Type.tp_basicsize = pytalloc_BaseObject_size();
62299 :
62300 2956 : netr_NETLOGON_INFO_1_Type.tp_base = BaseObject_Type;
62301 2956 : netr_NETLOGON_INFO_1_Type.tp_basicsize = pytalloc_BaseObject_size();
62302 :
62303 2956 : netr_NETLOGON_INFO_2_Type.tp_base = BaseObject_Type;
62304 2956 : netr_NETLOGON_INFO_2_Type.tp_basicsize = pytalloc_BaseObject_size();
62305 :
62306 2956 : netr_NETLOGON_INFO_3_Type.tp_base = BaseObject_Type;
62307 2956 : netr_NETLOGON_INFO_3_Type.tp_basicsize = pytalloc_BaseObject_size();
62308 :
62309 2956 : netr_NETLOGON_INFO_4_Type.tp_base = BaseObject_Type;
62310 2956 : netr_NETLOGON_INFO_4_Type.tp_basicsize = pytalloc_BaseObject_size();
62311 :
62312 2956 : netr_CONTROL_QUERY_INFORMATION_Type.tp_base = BaseObject_Type;
62313 2956 : netr_CONTROL_QUERY_INFORMATION_Type.tp_basicsize = pytalloc_BaseObject_size();
62314 :
62315 2956 : netr_CONTROL_DATA_INFORMATION_Type.tp_base = BaseObject_Type;
62316 2956 : netr_CONTROL_DATA_INFORMATION_Type.tp_basicsize = pytalloc_BaseObject_size();
62317 :
62318 2956 : netr_ChangeLogObject_Type.tp_base = BaseObject_Type;
62319 2956 : netr_ChangeLogObject_Type.tp_basicsize = pytalloc_BaseObject_size();
62320 :
62321 2956 : netr_ChangeLogEntry_Type.tp_base = BaseObject_Type;
62322 2956 : netr_ChangeLogEntry_Type.tp_basicsize = pytalloc_BaseObject_size();
62323 :
62324 2956 : netr_Blob_Type.tp_base = BaseObject_Type;
62325 2956 : netr_Blob_Type.tp_basicsize = pytalloc_BaseObject_size();
62326 :
62327 2956 : netr_DsRGetDCNameInfo_Type.tp_base = BaseObject_Type;
62328 2956 : netr_DsRGetDCNameInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62329 :
62330 2956 : netr_Capabilities_Type.tp_base = BaseObject_Type;
62331 2956 : netr_Capabilities_Type.tp_basicsize = pytalloc_BaseObject_size();
62332 :
62333 2956 : netr_LsaPolicyInformation_Type.tp_base = BaseObject_Type;
62334 2956 : netr_LsaPolicyInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
62335 :
62336 2956 : netr_OsVersionInfoEx_Type.tp_base = BaseObject_Type;
62337 2956 : netr_OsVersionInfoEx_Type.tp_basicsize = pytalloc_BaseObject_size();
62338 :
62339 2956 : netr_OsVersion_Type.tp_base = BaseObject_Type;
62340 2956 : netr_OsVersion_Type.tp_basicsize = pytalloc_BaseObject_size();
62341 :
62342 2956 : netr_OsVersionContainer_Type.tp_base = BaseObject_Type;
62343 2956 : netr_OsVersionContainer_Type.tp_basicsize = pytalloc_BaseObject_size();
62344 :
62345 2956 : netr_WorkstationInformation_Type.tp_base = BaseObject_Type;
62346 2956 : netr_WorkstationInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
62347 :
62348 2956 : netr_WorkstationInfo_Type.tp_base = BaseObject_Type;
62349 2956 : netr_WorkstationInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62350 :
62351 2956 : netr_trust_extension_info_Type.tp_base = BaseObject_Type;
62352 2956 : netr_trust_extension_info_Type.tp_basicsize = pytalloc_BaseObject_size();
62353 :
62354 2956 : netr_trust_extension_Type.tp_base = BaseObject_Type;
62355 2956 : netr_trust_extension_Type.tp_basicsize = pytalloc_BaseObject_size();
62356 :
62357 2956 : netr_trust_extension_container_Type.tp_base = BaseObject_Type;
62358 2956 : netr_trust_extension_container_Type.tp_basicsize = pytalloc_BaseObject_size();
62359 :
62360 2956 : netr_OneDomainInfo_Type.tp_base = BaseObject_Type;
62361 2956 : netr_OneDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62362 :
62363 2956 : netr_DomainInformation_Type.tp_base = BaseObject_Type;
62364 2956 : netr_DomainInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
62365 :
62366 2956 : netr_DomainInfo_Type.tp_base = BaseObject_Type;
62367 2956 : netr_DomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62368 :
62369 2956 : NL_PASSWORD_VERSION_Type.tp_base = BaseObject_Type;
62370 2956 : NL_PASSWORD_VERSION_Type.tp_basicsize = pytalloc_BaseObject_size();
62371 :
62372 2956 : netr_CryptPassword_Type.tp_base = BaseObject_Type;
62373 2956 : netr_CryptPassword_Type.tp_basicsize = pytalloc_BaseObject_size();
62374 :
62375 2956 : netr_SendToSamResetBadPasswordCount_Type.tp_base = BaseObject_Type;
62376 2956 : netr_SendToSamResetBadPasswordCount_Type.tp_basicsize = pytalloc_BaseObject_size();
62377 :
62378 2956 : netr_SendToSamMessage_Type.tp_base = BaseObject_Type;
62379 2956 : netr_SendToSamMessage_Type.tp_basicsize = pytalloc_BaseObject_size();
62380 :
62381 2956 : netr_SendToSamBase_Type.tp_base = BaseObject_Type;
62382 2956 : netr_SendToSamBase_Type.tp_basicsize = pytalloc_BaseObject_size();
62383 :
62384 2956 : netr_DsRAddressToSitenamesWCtr_Type.tp_base = BaseObject_Type;
62385 2956 : netr_DsRAddressToSitenamesWCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
62386 :
62387 2956 : netr_DsRAddress_Type.tp_base = BaseObject_Type;
62388 2956 : netr_DsRAddress_Type.tp_basicsize = pytalloc_BaseObject_size();
62389 :
62390 2956 : netr_DomainTrust_Type.tp_base = BaseObject_Type;
62391 2956 : netr_DomainTrust_Type.tp_basicsize = pytalloc_BaseObject_size();
62392 :
62393 2956 : netr_DomainTrustList_Type.tp_base = BaseObject_Type;
62394 2956 : netr_DomainTrustList_Type.tp_basicsize = pytalloc_BaseObject_size();
62395 :
62396 2956 : netr_DsRAddressToSitenamesExWCtr_Type.tp_base = BaseObject_Type;
62397 2956 : netr_DsRAddressToSitenamesExWCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
62398 :
62399 2956 : DcSitesCtr_Type.tp_base = BaseObject_Type;
62400 2956 : DcSitesCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
62401 :
62402 2956 : netr_TrustInfo_Type.tp_base = BaseObject_Type;
62403 2956 : netr_TrustInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62404 :
62405 2956 : NL_DNS_NAME_INFO_Type.tp_base = BaseObject_Type;
62406 2956 : NL_DNS_NAME_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
62407 :
62408 2956 : NL_DNS_NAME_INFO_ARRAY_Type.tp_base = BaseObject_Type;
62409 2956 : NL_DNS_NAME_INFO_ARRAY_Type.tp_basicsize = pytalloc_BaseObject_size();
62410 :
62411 2956 : netr_LogonUasLogon_Type.tp_base = BaseObject_Type;
62412 2956 : netr_LogonUasLogon_Type.tp_basicsize = pytalloc_BaseObject_size();
62413 :
62414 2956 : netr_LogonUasLogoff_Type.tp_base = BaseObject_Type;
62415 2956 : netr_LogonUasLogoff_Type.tp_basicsize = pytalloc_BaseObject_size();
62416 :
62417 2956 : netr_LogonSamLogon_Type.tp_base = BaseObject_Type;
62418 2956 : netr_LogonSamLogon_Type.tp_basicsize = pytalloc_BaseObject_size();
62419 :
62420 2956 : netr_LogonSamLogoff_Type.tp_base = BaseObject_Type;
62421 2956 : netr_LogonSamLogoff_Type.tp_basicsize = pytalloc_BaseObject_size();
62422 :
62423 2956 : netr_ServerReqChallenge_Type.tp_base = BaseObject_Type;
62424 2956 : netr_ServerReqChallenge_Type.tp_basicsize = pytalloc_BaseObject_size();
62425 :
62426 2956 : netr_ServerAuthenticate_Type.tp_base = BaseObject_Type;
62427 2956 : netr_ServerAuthenticate_Type.tp_basicsize = pytalloc_BaseObject_size();
62428 :
62429 2956 : netr_ServerPasswordSet_Type.tp_base = BaseObject_Type;
62430 2956 : netr_ServerPasswordSet_Type.tp_basicsize = pytalloc_BaseObject_size();
62431 :
62432 2956 : netr_DatabaseDeltas_Type.tp_base = BaseObject_Type;
62433 2956 : netr_DatabaseDeltas_Type.tp_basicsize = pytalloc_BaseObject_size();
62434 :
62435 2956 : netr_DatabaseSync_Type.tp_base = BaseObject_Type;
62436 2956 : netr_DatabaseSync_Type.tp_basicsize = pytalloc_BaseObject_size();
62437 :
62438 2956 : netr_AccountDeltas_Type.tp_base = BaseObject_Type;
62439 2956 : netr_AccountDeltas_Type.tp_basicsize = pytalloc_BaseObject_size();
62440 :
62441 2956 : netr_AccountSync_Type.tp_base = BaseObject_Type;
62442 2956 : netr_AccountSync_Type.tp_basicsize = pytalloc_BaseObject_size();
62443 :
62444 2956 : netr_GetDcName_Type.tp_base = BaseObject_Type;
62445 2956 : netr_GetDcName_Type.tp_basicsize = pytalloc_BaseObject_size();
62446 :
62447 2956 : netr_LogonControl_Type.tp_base = BaseObject_Type;
62448 2956 : netr_LogonControl_Type.tp_basicsize = pytalloc_BaseObject_size();
62449 :
62450 2956 : netr_GetAnyDCName_Type.tp_base = BaseObject_Type;
62451 2956 : netr_GetAnyDCName_Type.tp_basicsize = pytalloc_BaseObject_size();
62452 :
62453 2956 : netr_LogonControl2_Type.tp_base = BaseObject_Type;
62454 2956 : netr_LogonControl2_Type.tp_basicsize = pytalloc_BaseObject_size();
62455 :
62456 2956 : netr_ServerAuthenticate2_Type.tp_base = BaseObject_Type;
62457 2956 : netr_ServerAuthenticate2_Type.tp_basicsize = pytalloc_BaseObject_size();
62458 :
62459 2956 : netr_DatabaseSync2_Type.tp_base = BaseObject_Type;
62460 2956 : netr_DatabaseSync2_Type.tp_basicsize = pytalloc_BaseObject_size();
62461 :
62462 2956 : netr_DatabaseRedo_Type.tp_base = BaseObject_Type;
62463 2956 : netr_DatabaseRedo_Type.tp_basicsize = pytalloc_BaseObject_size();
62464 :
62465 2956 : netr_LogonControl2Ex_Type.tp_base = BaseObject_Type;
62466 2956 : netr_LogonControl2Ex_Type.tp_basicsize = pytalloc_BaseObject_size();
62467 :
62468 2956 : netr_NetrEnumerateTrustedDomains_Type.tp_base = BaseObject_Type;
62469 2956 : netr_NetrEnumerateTrustedDomains_Type.tp_basicsize = pytalloc_BaseObject_size();
62470 :
62471 2956 : netr_DsRGetDCName_Type.tp_base = BaseObject_Type;
62472 2956 : netr_DsRGetDCName_Type.tp_basicsize = pytalloc_BaseObject_size();
62473 :
62474 2956 : netr_LogonGetCapabilities_Type.tp_base = BaseObject_Type;
62475 2956 : netr_LogonGetCapabilities_Type.tp_basicsize = pytalloc_BaseObject_size();
62476 :
62477 2956 : netr_LogonGetTrustRid_Type.tp_base = BaseObject_Type;
62478 2956 : netr_LogonGetTrustRid_Type.tp_basicsize = pytalloc_BaseObject_size();
62479 :
62480 2956 : netr_ServerAuthenticate3_Type.tp_base = BaseObject_Type;
62481 2956 : netr_ServerAuthenticate3_Type.tp_basicsize = pytalloc_BaseObject_size();
62482 :
62483 2956 : netr_DsRGetDCNameEx_Type.tp_base = BaseObject_Type;
62484 2956 : netr_DsRGetDCNameEx_Type.tp_basicsize = pytalloc_BaseObject_size();
62485 :
62486 2956 : netr_DsRGetSiteName_Type.tp_base = BaseObject_Type;
62487 2956 : netr_DsRGetSiteName_Type.tp_basicsize = pytalloc_BaseObject_size();
62488 :
62489 2956 : netr_LogonGetDomainInfo_Type.tp_base = BaseObject_Type;
62490 2956 : netr_LogonGetDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62491 :
62492 2956 : netr_ServerPasswordSet2_Type.tp_base = BaseObject_Type;
62493 2956 : netr_ServerPasswordSet2_Type.tp_basicsize = pytalloc_BaseObject_size();
62494 :
62495 2956 : netr_ServerPasswordGet_Type.tp_base = BaseObject_Type;
62496 2956 : netr_ServerPasswordGet_Type.tp_basicsize = pytalloc_BaseObject_size();
62497 :
62498 2956 : netr_NetrLogonSendToSam_Type.tp_base = BaseObject_Type;
62499 2956 : netr_NetrLogonSendToSam_Type.tp_basicsize = pytalloc_BaseObject_size();
62500 :
62501 2956 : netr_DsRAddressToSitenamesW_Type.tp_base = BaseObject_Type;
62502 2956 : netr_DsRAddressToSitenamesW_Type.tp_basicsize = pytalloc_BaseObject_size();
62503 :
62504 2956 : netr_DsRGetDCNameEx2_Type.tp_base = BaseObject_Type;
62505 2956 : netr_DsRGetDCNameEx2_Type.tp_basicsize = pytalloc_BaseObject_size();
62506 :
62507 2956 : netr_NetrEnumerateTrustedDomainsEx_Type.tp_base = BaseObject_Type;
62508 2956 : netr_NetrEnumerateTrustedDomainsEx_Type.tp_basicsize = pytalloc_BaseObject_size();
62509 :
62510 2956 : netr_DsRAddressToSitenamesExW_Type.tp_base = BaseObject_Type;
62511 2956 : netr_DsRAddressToSitenamesExW_Type.tp_basicsize = pytalloc_BaseObject_size();
62512 :
62513 2956 : netr_DsrGetDcSiteCoverageW_Type.tp_base = BaseObject_Type;
62514 2956 : netr_DsrGetDcSiteCoverageW_Type.tp_basicsize = pytalloc_BaseObject_size();
62515 :
62516 2956 : netr_LogonSamLogonEx_Type.tp_base = BaseObject_Type;
62517 2956 : netr_LogonSamLogonEx_Type.tp_basicsize = pytalloc_BaseObject_size();
62518 :
62519 2956 : netr_DsrEnumerateDomainTrusts_Type.tp_base = BaseObject_Type;
62520 2956 : netr_DsrEnumerateDomainTrusts_Type.tp_basicsize = pytalloc_BaseObject_size();
62521 :
62522 2956 : netr_DsrDeregisterDNSHostRecords_Type.tp_base = BaseObject_Type;
62523 2956 : netr_DsrDeregisterDNSHostRecords_Type.tp_basicsize = pytalloc_BaseObject_size();
62524 :
62525 2956 : netr_ServerTrustPasswordsGet_Type.tp_base = BaseObject_Type;
62526 2956 : netr_ServerTrustPasswordsGet_Type.tp_basicsize = pytalloc_BaseObject_size();
62527 :
62528 2956 : netr_DsRGetForestTrustInformation_Type.tp_base = BaseObject_Type;
62529 2956 : netr_DsRGetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
62530 :
62531 2956 : netr_GetForestTrustInformation_Type.tp_base = BaseObject_Type;
62532 2956 : netr_GetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
62533 :
62534 2956 : netr_LogonSamLogonWithFlags_Type.tp_base = BaseObject_Type;
62535 2956 : netr_LogonSamLogonWithFlags_Type.tp_basicsize = pytalloc_BaseObject_size();
62536 :
62537 2956 : netr_ServerGetTrustInfo_Type.tp_base = BaseObject_Type;
62538 2956 : netr_ServerGetTrustInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
62539 :
62540 2956 : netr_Unused47_Type.tp_base = BaseObject_Type;
62541 2956 : netr_Unused47_Type.tp_basicsize = pytalloc_BaseObject_size();
62542 :
62543 2956 : netr_DsrUpdateReadOnlyServerDnsRecords_Type.tp_base = BaseObject_Type;
62544 2956 : netr_DsrUpdateReadOnlyServerDnsRecords_Type.tp_basicsize = pytalloc_BaseObject_size();
62545 :
62546 2956 : netlogon_InterfaceType.tp_base = ClientConnection_Type;
62547 :
62548 2956 : netlogon_SyntaxType.tp_base = ndr_syntax_id_Type;
62549 2956 : netlogon_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
62550 :
62551 2956 : if (PyType_Ready(&netr_UasInfo_Type) < 0)
62552 0 : goto out;
62553 2956 : if (PyType_Ready(&netr_UasLogoffInfo_Type) < 0)
62554 0 : goto out;
62555 2956 : if (PyType_Ready(&netr_AcctLockStr_Type) < 0)
62556 0 : goto out;
62557 2956 : if (PyType_Ready(&netr_IdentityInfo_Type) < 0)
62558 0 : goto out;
62559 2956 : if (PyType_Ready(&netr_PasswordInfo_Type) < 0)
62560 0 : goto out;
62561 2956 : if (PyType_Ready(&netr_ChallengeResponse_Type) < 0)
62562 0 : goto out;
62563 2956 : if (PyType_Ready(&netr_NetworkInfo_Type) < 0)
62564 0 : goto out;
62565 2956 : if (PyType_Ready(&netr_GenericInfo_Type) < 0)
62566 0 : goto out;
62567 2956 : if (PyType_Ready(&netr_LogonLevel_Type) < 0)
62568 0 : goto out;
62569 2956 : if (PyType_Ready(&netr_UserSessionKey_Type) < 0)
62570 0 : goto out;
62571 2956 : if (PyType_Ready(&netr_LMSessionKey_Type) < 0)
62572 0 : goto out;
62573 2956 : if (PyType_Ready(&netr_SamBaseInfo_Type) < 0)
62574 0 : goto out;
62575 2956 : if (PyType_Ready(&netr_SamInfo2_Type) < 0)
62576 0 : goto out;
62577 2956 : if (PyType_Ready(&netr_SidAttr_Type) < 0)
62578 0 : goto out;
62579 2956 : if (PyType_Ready(&netr_SamInfo3_Type) < 0)
62580 0 : goto out;
62581 2956 : if (PyType_Ready(&netr_SamInfo6_Type) < 0)
62582 0 : goto out;
62583 2956 : if (PyType_Ready(&netr_PacInfo_Type) < 0)
62584 0 : goto out;
62585 2956 : if (PyType_Ready(&netr_GenericInfo2_Type) < 0)
62586 0 : goto out;
62587 2956 : if (PyType_Ready(&netr_Validation_Type) < 0)
62588 0 : goto out;
62589 2956 : if (PyType_Ready(&netr_Credential_Type) < 0)
62590 0 : goto out;
62591 2956 : if (PyType_Ready(&netlogon_server_pipe_state_Type) < 0)
62592 0 : goto out;
62593 2956 : if (PyType_Ready(&netr_Authenticator_Type) < 0)
62594 0 : goto out;
62595 2956 : if (PyType_Ready(&netr_DELTA_DELETE_USER_Type) < 0)
62596 0 : goto out;
62597 2956 : if (PyType_Ready(&netr_USER_KEY16_Type) < 0)
62598 0 : goto out;
62599 2956 : if (PyType_Ready(&netr_PasswordHistory_Type) < 0)
62600 0 : goto out;
62601 2956 : if (PyType_Ready(&netr_USER_KEYS2_Type) < 0)
62602 0 : goto out;
62603 2956 : if (PyType_Ready(&netr_USER_KEY_UNION_Type) < 0)
62604 0 : goto out;
62605 2956 : if (PyType_Ready(&netr_USER_KEYS_Type) < 0)
62606 0 : goto out;
62607 2956 : if (PyType_Ready(&netr_USER_PRIVATE_INFO_Type) < 0)
62608 0 : goto out;
62609 2956 : if (PyType_Ready(&netr_DELTA_USER_Type) < 0)
62610 0 : goto out;
62611 2956 : if (PyType_Ready(&netr_DELTA_DOMAIN_Type) < 0)
62612 0 : goto out;
62613 2956 : if (PyType_Ready(&netr_DELTA_GROUP_Type) < 0)
62614 0 : goto out;
62615 2956 : if (PyType_Ready(&netr_DELTA_RENAME_Type) < 0)
62616 0 : goto out;
62617 2956 : if (PyType_Ready(&netr_DELTA_GROUP_MEMBER_Type) < 0)
62618 0 : goto out;
62619 2956 : if (PyType_Ready(&netr_DELTA_ALIAS_Type) < 0)
62620 0 : goto out;
62621 2956 : if (PyType_Ready(&netr_DELTA_ALIAS_MEMBER_Type) < 0)
62622 0 : goto out;
62623 2956 : if (PyType_Ready(&netr_QUOTA_LIMITS_Type) < 0)
62624 0 : goto out;
62625 2956 : if (PyType_Ready(&netr_DELTA_POLICY_Type) < 0)
62626 0 : goto out;
62627 2956 : if (PyType_Ready(&netr_DELTA_TRUSTED_DOMAIN_Type) < 0)
62628 0 : goto out;
62629 2956 : if (PyType_Ready(&netr_DELTA_ACCOUNT_Type) < 0)
62630 0 : goto out;
62631 2956 : if (PyType_Ready(&netr_CIPHER_VALUE_Type) < 0)
62632 0 : goto out;
62633 2956 : if (PyType_Ready(&netr_DELTA_SECRET_Type) < 0)
62634 0 : goto out;
62635 2956 : if (PyType_Ready(&netr_DELTA_UNION_Type) < 0)
62636 0 : goto out;
62637 2956 : if (PyType_Ready(&netr_DELTA_ID_UNION_Type) < 0)
62638 0 : goto out;
62639 2956 : if (PyType_Ready(&netr_DELTA_ENUM_Type) < 0)
62640 0 : goto out;
62641 2956 : if (PyType_Ready(&netr_DELTA_ENUM_ARRAY_Type) < 0)
62642 0 : goto out;
62643 2956 : if (PyType_Ready(&netr_UAS_INFO_0_Type) < 0)
62644 0 : goto out;
62645 2956 : if (PyType_Ready(&netr_AccountBuffer_Type) < 0)
62646 0 : goto out;
62647 2956 : if (PyType_Ready(&netr_NETLOGON_INFO_1_Type) < 0)
62648 0 : goto out;
62649 2956 : if (PyType_Ready(&netr_NETLOGON_INFO_2_Type) < 0)
62650 0 : goto out;
62651 2956 : if (PyType_Ready(&netr_NETLOGON_INFO_3_Type) < 0)
62652 0 : goto out;
62653 2956 : if (PyType_Ready(&netr_NETLOGON_INFO_4_Type) < 0)
62654 0 : goto out;
62655 2956 : if (PyType_Ready(&netr_CONTROL_QUERY_INFORMATION_Type) < 0)
62656 0 : goto out;
62657 2956 : if (PyType_Ready(&netr_CONTROL_DATA_INFORMATION_Type) < 0)
62658 0 : goto out;
62659 2956 : if (PyType_Ready(&netr_ChangeLogObject_Type) < 0)
62660 0 : goto out;
62661 2956 : if (PyType_Ready(&netr_ChangeLogEntry_Type) < 0)
62662 0 : goto out;
62663 2956 : if (PyType_Ready(&netr_Blob_Type) < 0)
62664 0 : goto out;
62665 2956 : if (PyType_Ready(&netr_DsRGetDCNameInfo_Type) < 0)
62666 0 : goto out;
62667 2956 : if (PyType_Ready(&netr_Capabilities_Type) < 0)
62668 0 : goto out;
62669 2956 : if (PyType_Ready(&netr_LsaPolicyInformation_Type) < 0)
62670 0 : goto out;
62671 2956 : if (PyType_Ready(&netr_OsVersionInfoEx_Type) < 0)
62672 0 : goto out;
62673 2956 : if (PyType_Ready(&netr_OsVersion_Type) < 0)
62674 0 : goto out;
62675 2956 : if (PyType_Ready(&netr_OsVersionContainer_Type) < 0)
62676 0 : goto out;
62677 2956 : if (PyType_Ready(&netr_WorkstationInformation_Type) < 0)
62678 0 : goto out;
62679 2956 : if (PyType_Ready(&netr_WorkstationInfo_Type) < 0)
62680 0 : goto out;
62681 2956 : if (PyType_Ready(&netr_trust_extension_info_Type) < 0)
62682 0 : goto out;
62683 2956 : if (PyType_Ready(&netr_trust_extension_Type) < 0)
62684 0 : goto out;
62685 2956 : if (PyType_Ready(&netr_trust_extension_container_Type) < 0)
62686 0 : goto out;
62687 2956 : if (PyType_Ready(&netr_OneDomainInfo_Type) < 0)
62688 0 : goto out;
62689 2956 : if (PyType_Ready(&netr_DomainInformation_Type) < 0)
62690 0 : goto out;
62691 2956 : if (PyType_Ready(&netr_DomainInfo_Type) < 0)
62692 0 : goto out;
62693 2956 : if (PyType_Ready(&NL_PASSWORD_VERSION_Type) < 0)
62694 0 : goto out;
62695 2956 : if (PyType_Ready(&netr_CryptPassword_Type) < 0)
62696 0 : goto out;
62697 2956 : if (PyType_Ready(&netr_SendToSamResetBadPasswordCount_Type) < 0)
62698 0 : goto out;
62699 2956 : if (PyType_Ready(&netr_SendToSamMessage_Type) < 0)
62700 0 : goto out;
62701 2956 : if (PyType_Ready(&netr_SendToSamBase_Type) < 0)
62702 0 : goto out;
62703 2956 : if (PyType_Ready(&netr_DsRAddressToSitenamesWCtr_Type) < 0)
62704 0 : goto out;
62705 2956 : if (PyType_Ready(&netr_DsRAddress_Type) < 0)
62706 0 : goto out;
62707 2956 : if (PyType_Ready(&netr_DomainTrust_Type) < 0)
62708 0 : goto out;
62709 2956 : if (PyType_Ready(&netr_DomainTrustList_Type) < 0)
62710 0 : goto out;
62711 2956 : if (PyType_Ready(&netr_DsRAddressToSitenamesExWCtr_Type) < 0)
62712 0 : goto out;
62713 2956 : if (PyType_Ready(&DcSitesCtr_Type) < 0)
62714 0 : goto out;
62715 2956 : if (PyType_Ready(&netr_TrustInfo_Type) < 0)
62716 0 : goto out;
62717 2956 : if (PyType_Ready(&NL_DNS_NAME_INFO_Type) < 0)
62718 0 : goto out;
62719 2956 : if (PyType_Ready(&NL_DNS_NAME_INFO_ARRAY_Type) < 0)
62720 0 : goto out;
62721 2956 : if (PyType_Ready(&netr_LogonUasLogon_Type) < 0)
62722 0 : goto out;
62723 2956 : if (PyType_Ready(&netr_LogonUasLogoff_Type) < 0)
62724 0 : goto out;
62725 2956 : if (PyType_Ready(&netr_LogonSamLogon_Type) < 0)
62726 0 : goto out;
62727 2956 : if (PyType_Ready(&netr_LogonSamLogoff_Type) < 0)
62728 0 : goto out;
62729 2956 : if (PyType_Ready(&netr_ServerReqChallenge_Type) < 0)
62730 0 : goto out;
62731 2956 : if (PyType_Ready(&netr_ServerAuthenticate_Type) < 0)
62732 0 : goto out;
62733 2956 : if (PyType_Ready(&netr_ServerPasswordSet_Type) < 0)
62734 0 : goto out;
62735 2956 : if (PyType_Ready(&netr_DatabaseDeltas_Type) < 0)
62736 0 : goto out;
62737 2956 : if (PyType_Ready(&netr_DatabaseSync_Type) < 0)
62738 0 : goto out;
62739 2956 : if (PyType_Ready(&netr_AccountDeltas_Type) < 0)
62740 0 : goto out;
62741 2956 : if (PyType_Ready(&netr_AccountSync_Type) < 0)
62742 0 : goto out;
62743 2956 : if (PyType_Ready(&netr_GetDcName_Type) < 0)
62744 0 : goto out;
62745 2956 : if (PyType_Ready(&netr_LogonControl_Type) < 0)
62746 0 : goto out;
62747 2956 : if (PyType_Ready(&netr_GetAnyDCName_Type) < 0)
62748 0 : goto out;
62749 2956 : if (PyType_Ready(&netr_LogonControl2_Type) < 0)
62750 0 : goto out;
62751 2956 : if (PyType_Ready(&netr_ServerAuthenticate2_Type) < 0)
62752 0 : goto out;
62753 2956 : if (PyType_Ready(&netr_DatabaseSync2_Type) < 0)
62754 0 : goto out;
62755 2956 : if (PyType_Ready(&netr_DatabaseRedo_Type) < 0)
62756 0 : goto out;
62757 2956 : if (PyType_Ready(&netr_LogonControl2Ex_Type) < 0)
62758 0 : goto out;
62759 2956 : if (PyType_Ready(&netr_NetrEnumerateTrustedDomains_Type) < 0)
62760 0 : goto out;
62761 2956 : if (PyType_Ready(&netr_DsRGetDCName_Type) < 0)
62762 0 : goto out;
62763 2956 : if (PyType_Ready(&netr_LogonGetCapabilities_Type) < 0)
62764 0 : goto out;
62765 2956 : if (PyType_Ready(&netr_LogonGetTrustRid_Type) < 0)
62766 0 : goto out;
62767 2956 : if (PyType_Ready(&netr_ServerAuthenticate3_Type) < 0)
62768 0 : goto out;
62769 2956 : if (PyType_Ready(&netr_DsRGetDCNameEx_Type) < 0)
62770 0 : goto out;
62771 2956 : if (PyType_Ready(&netr_DsRGetSiteName_Type) < 0)
62772 0 : goto out;
62773 2956 : if (PyType_Ready(&netr_LogonGetDomainInfo_Type) < 0)
62774 0 : goto out;
62775 2956 : if (PyType_Ready(&netr_ServerPasswordSet2_Type) < 0)
62776 0 : goto out;
62777 2956 : if (PyType_Ready(&netr_ServerPasswordGet_Type) < 0)
62778 0 : goto out;
62779 2956 : if (PyType_Ready(&netr_NetrLogonSendToSam_Type) < 0)
62780 0 : goto out;
62781 2956 : if (PyType_Ready(&netr_DsRAddressToSitenamesW_Type) < 0)
62782 0 : goto out;
62783 2956 : if (PyType_Ready(&netr_DsRGetDCNameEx2_Type) < 0)
62784 0 : goto out;
62785 2956 : if (PyType_Ready(&netr_NetrEnumerateTrustedDomainsEx_Type) < 0)
62786 0 : goto out;
62787 2956 : if (PyType_Ready(&netr_DsRAddressToSitenamesExW_Type) < 0)
62788 0 : goto out;
62789 2956 : if (PyType_Ready(&netr_DsrGetDcSiteCoverageW_Type) < 0)
62790 0 : goto out;
62791 2956 : if (PyType_Ready(&netr_LogonSamLogonEx_Type) < 0)
62792 0 : goto out;
62793 2956 : if (PyType_Ready(&netr_DsrEnumerateDomainTrusts_Type) < 0)
62794 0 : goto out;
62795 2956 : if (PyType_Ready(&netr_DsrDeregisterDNSHostRecords_Type) < 0)
62796 0 : goto out;
62797 2956 : if (PyType_Ready(&netr_ServerTrustPasswordsGet_Type) < 0)
62798 0 : goto out;
62799 2956 : if (PyType_Ready(&netr_DsRGetForestTrustInformation_Type) < 0)
62800 0 : goto out;
62801 2956 : if (PyType_Ready(&netr_GetForestTrustInformation_Type) < 0)
62802 0 : goto out;
62803 2956 : if (PyType_Ready(&netr_LogonSamLogonWithFlags_Type) < 0)
62804 0 : goto out;
62805 2956 : if (PyType_Ready(&netr_ServerGetTrustInfo_Type) < 0)
62806 0 : goto out;
62807 2956 : if (PyType_Ready(&netr_Unused47_Type) < 0)
62808 0 : goto out;
62809 2956 : if (PyType_Ready(&netr_DsrUpdateReadOnlyServerDnsRecords_Type) < 0)
62810 0 : goto out;
62811 2956 : if (PyType_Ready(&netlogon_InterfaceType) < 0)
62812 0 : goto out;
62813 2956 : if (PyType_Ready(&netlogon_SyntaxType) < 0)
62814 0 : goto out;
62815 2956 : if (!PyInterface_AddNdrRpcMethods(&netlogon_InterfaceType, py_ndr_netlogon_methods))
62816 0 : return NULL;
62817 :
62818 : #ifdef PY_NETR_UASINFO_PATCH
62819 : PY_NETR_UASINFO_PATCH(&netr_UasInfo_Type);
62820 : #endif
62821 : #ifdef PY_NETR_UASLOGOFFINFO_PATCH
62822 : PY_NETR_UASLOGOFFINFO_PATCH(&netr_UasLogoffInfo_Type);
62823 : #endif
62824 : #ifdef PY_NETR_ACCTLOCKSTR_PATCH
62825 : PY_NETR_ACCTLOCKSTR_PATCH(&netr_AcctLockStr_Type);
62826 : #endif
62827 : #ifdef PY_NETR_IDENTITYINFO_PATCH
62828 : PY_NETR_IDENTITYINFO_PATCH(&netr_IdentityInfo_Type);
62829 : #endif
62830 : #ifdef PY_NETR_PASSWORDINFO_PATCH
62831 : PY_NETR_PASSWORDINFO_PATCH(&netr_PasswordInfo_Type);
62832 : #endif
62833 : #ifdef PY_NETR_CHALLENGERESPONSE_PATCH
62834 : PY_NETR_CHALLENGERESPONSE_PATCH(&netr_ChallengeResponse_Type);
62835 : #endif
62836 : #ifdef PY_NETR_NETWORKINFO_PATCH
62837 : PY_NETR_NETWORKINFO_PATCH(&netr_NetworkInfo_Type);
62838 : #endif
62839 : #ifdef PY_NETR_GENERICINFO_PATCH
62840 : PY_NETR_GENERICINFO_PATCH(&netr_GenericInfo_Type);
62841 : #endif
62842 : #ifdef PY_NETR_LOGONLEVEL_PATCH
62843 : PY_NETR_LOGONLEVEL_PATCH(&netr_LogonLevel_Type);
62844 : #endif
62845 : #ifdef PY_NETR_USERSESSIONKEY_PATCH
62846 : PY_NETR_USERSESSIONKEY_PATCH(&netr_UserSessionKey_Type);
62847 : #endif
62848 : #ifdef PY_NETR_LMSESSIONKEY_PATCH
62849 : PY_NETR_LMSESSIONKEY_PATCH(&netr_LMSessionKey_Type);
62850 : #endif
62851 : #ifdef PY_NETR_SAMBASEINFO_PATCH
62852 : PY_NETR_SAMBASEINFO_PATCH(&netr_SamBaseInfo_Type);
62853 : #endif
62854 : #ifdef PY_NETR_SAMINFO2_PATCH
62855 : PY_NETR_SAMINFO2_PATCH(&netr_SamInfo2_Type);
62856 : #endif
62857 : #ifdef PY_NETR_SIDATTR_PATCH
62858 : PY_NETR_SIDATTR_PATCH(&netr_SidAttr_Type);
62859 : #endif
62860 : #ifdef PY_NETR_SAMINFO3_PATCH
62861 : PY_NETR_SAMINFO3_PATCH(&netr_SamInfo3_Type);
62862 : #endif
62863 : #ifdef PY_NETR_SAMINFO6_PATCH
62864 : PY_NETR_SAMINFO6_PATCH(&netr_SamInfo6_Type);
62865 : #endif
62866 : #ifdef PY_NETR_PACINFO_PATCH
62867 : PY_NETR_PACINFO_PATCH(&netr_PacInfo_Type);
62868 : #endif
62869 : #ifdef PY_NETR_GENERICINFO2_PATCH
62870 : PY_NETR_GENERICINFO2_PATCH(&netr_GenericInfo2_Type);
62871 : #endif
62872 : #ifdef PY_NETR_VALIDATION_PATCH
62873 : PY_NETR_VALIDATION_PATCH(&netr_Validation_Type);
62874 : #endif
62875 : #ifdef PY_NETR_CREDENTIAL_PATCH
62876 : PY_NETR_CREDENTIAL_PATCH(&netr_Credential_Type);
62877 : #endif
62878 : #ifdef PY_SERVER_PIPE_STATE_PATCH
62879 : PY_SERVER_PIPE_STATE_PATCH(&netlogon_server_pipe_state_Type);
62880 : #endif
62881 : #ifdef PY_NETR_AUTHENTICATOR_PATCH
62882 : PY_NETR_AUTHENTICATOR_PATCH(&netr_Authenticator_Type);
62883 : #endif
62884 : #ifdef PY_NETR_DELTA_DELETE_USER_PATCH
62885 : PY_NETR_DELTA_DELETE_USER_PATCH(&netr_DELTA_DELETE_USER_Type);
62886 : #endif
62887 : #ifdef PY_NETR_USER_KEY16_PATCH
62888 : PY_NETR_USER_KEY16_PATCH(&netr_USER_KEY16_Type);
62889 : #endif
62890 : #ifdef PY_NETR_PASSWORDHISTORY_PATCH
62891 : PY_NETR_PASSWORDHISTORY_PATCH(&netr_PasswordHistory_Type);
62892 : #endif
62893 : #ifdef PY_NETR_USER_KEYS2_PATCH
62894 : PY_NETR_USER_KEYS2_PATCH(&netr_USER_KEYS2_Type);
62895 : #endif
62896 : #ifdef PY_NETR_USER_KEY_UNION_PATCH
62897 : PY_NETR_USER_KEY_UNION_PATCH(&netr_USER_KEY_UNION_Type);
62898 : #endif
62899 : #ifdef PY_NETR_USER_KEYS_PATCH
62900 : PY_NETR_USER_KEYS_PATCH(&netr_USER_KEYS_Type);
62901 : #endif
62902 : #ifdef PY_NETR_USER_PRIVATE_INFO_PATCH
62903 : PY_NETR_USER_PRIVATE_INFO_PATCH(&netr_USER_PRIVATE_INFO_Type);
62904 : #endif
62905 : #ifdef PY_NETR_DELTA_USER_PATCH
62906 : PY_NETR_DELTA_USER_PATCH(&netr_DELTA_USER_Type);
62907 : #endif
62908 : #ifdef PY_NETR_DELTA_DOMAIN_PATCH
62909 : PY_NETR_DELTA_DOMAIN_PATCH(&netr_DELTA_DOMAIN_Type);
62910 : #endif
62911 : #ifdef PY_NETR_DELTA_GROUP_PATCH
62912 : PY_NETR_DELTA_GROUP_PATCH(&netr_DELTA_GROUP_Type);
62913 : #endif
62914 : #ifdef PY_NETR_DELTA_RENAME_PATCH
62915 : PY_NETR_DELTA_RENAME_PATCH(&netr_DELTA_RENAME_Type);
62916 : #endif
62917 : #ifdef PY_NETR_DELTA_GROUP_MEMBER_PATCH
62918 : PY_NETR_DELTA_GROUP_MEMBER_PATCH(&netr_DELTA_GROUP_MEMBER_Type);
62919 : #endif
62920 : #ifdef PY_NETR_DELTA_ALIAS_PATCH
62921 : PY_NETR_DELTA_ALIAS_PATCH(&netr_DELTA_ALIAS_Type);
62922 : #endif
62923 : #ifdef PY_NETR_DELTA_ALIAS_MEMBER_PATCH
62924 : PY_NETR_DELTA_ALIAS_MEMBER_PATCH(&netr_DELTA_ALIAS_MEMBER_Type);
62925 : #endif
62926 : #ifdef PY_NETR_QUOTA_LIMITS_PATCH
62927 : PY_NETR_QUOTA_LIMITS_PATCH(&netr_QUOTA_LIMITS_Type);
62928 : #endif
62929 : #ifdef PY_NETR_DELTA_POLICY_PATCH
62930 : PY_NETR_DELTA_POLICY_PATCH(&netr_DELTA_POLICY_Type);
62931 : #endif
62932 : #ifdef PY_NETR_DELTA_TRUSTED_DOMAIN_PATCH
62933 : PY_NETR_DELTA_TRUSTED_DOMAIN_PATCH(&netr_DELTA_TRUSTED_DOMAIN_Type);
62934 : #endif
62935 : #ifdef PY_NETR_DELTA_ACCOUNT_PATCH
62936 : PY_NETR_DELTA_ACCOUNT_PATCH(&netr_DELTA_ACCOUNT_Type);
62937 : #endif
62938 : #ifdef PY_NETR_CIPHER_VALUE_PATCH
62939 : PY_NETR_CIPHER_VALUE_PATCH(&netr_CIPHER_VALUE_Type);
62940 : #endif
62941 : #ifdef PY_NETR_DELTA_SECRET_PATCH
62942 : PY_NETR_DELTA_SECRET_PATCH(&netr_DELTA_SECRET_Type);
62943 : #endif
62944 : #ifdef PY_NETR_DELTA_UNION_PATCH
62945 : PY_NETR_DELTA_UNION_PATCH(&netr_DELTA_UNION_Type);
62946 : #endif
62947 : #ifdef PY_NETR_DELTA_ID_UNION_PATCH
62948 : PY_NETR_DELTA_ID_UNION_PATCH(&netr_DELTA_ID_UNION_Type);
62949 : #endif
62950 : #ifdef PY_NETR_DELTA_ENUM_PATCH
62951 : PY_NETR_DELTA_ENUM_PATCH(&netr_DELTA_ENUM_Type);
62952 : #endif
62953 : #ifdef PY_NETR_DELTA_ENUM_ARRAY_PATCH
62954 : PY_NETR_DELTA_ENUM_ARRAY_PATCH(&netr_DELTA_ENUM_ARRAY_Type);
62955 : #endif
62956 : #ifdef PY_NETR_UAS_INFO_0_PATCH
62957 : PY_NETR_UAS_INFO_0_PATCH(&netr_UAS_INFO_0_Type);
62958 : #endif
62959 : #ifdef PY_NETR_ACCOUNTBUFFER_PATCH
62960 : PY_NETR_ACCOUNTBUFFER_PATCH(&netr_AccountBuffer_Type);
62961 : #endif
62962 : #ifdef PY_NETR_NETLOGON_INFO_1_PATCH
62963 : PY_NETR_NETLOGON_INFO_1_PATCH(&netr_NETLOGON_INFO_1_Type);
62964 : #endif
62965 : #ifdef PY_NETR_NETLOGON_INFO_2_PATCH
62966 : PY_NETR_NETLOGON_INFO_2_PATCH(&netr_NETLOGON_INFO_2_Type);
62967 : #endif
62968 : #ifdef PY_NETR_NETLOGON_INFO_3_PATCH
62969 : PY_NETR_NETLOGON_INFO_3_PATCH(&netr_NETLOGON_INFO_3_Type);
62970 : #endif
62971 : #ifdef PY_NETR_NETLOGON_INFO_4_PATCH
62972 : PY_NETR_NETLOGON_INFO_4_PATCH(&netr_NETLOGON_INFO_4_Type);
62973 : #endif
62974 : #ifdef PY_NETR_CONTROL_QUERY_INFORMATION_PATCH
62975 : PY_NETR_CONTROL_QUERY_INFORMATION_PATCH(&netr_CONTROL_QUERY_INFORMATION_Type);
62976 : #endif
62977 : #ifdef PY_NETR_CONTROL_DATA_INFORMATION_PATCH
62978 : PY_NETR_CONTROL_DATA_INFORMATION_PATCH(&netr_CONTROL_DATA_INFORMATION_Type);
62979 : #endif
62980 : #ifdef PY_NETR_CHANGELOGOBJECT_PATCH
62981 : PY_NETR_CHANGELOGOBJECT_PATCH(&netr_ChangeLogObject_Type);
62982 : #endif
62983 : #ifdef PY_NETR_CHANGELOGENTRY_PATCH
62984 : PY_NETR_CHANGELOGENTRY_PATCH(&netr_ChangeLogEntry_Type);
62985 : #endif
62986 : #ifdef PY_NETR_BLOB_PATCH
62987 : PY_NETR_BLOB_PATCH(&netr_Blob_Type);
62988 : #endif
62989 : #ifdef PY_NETR_DSRGETDCNAMEINFO_PATCH
62990 : PY_NETR_DSRGETDCNAMEINFO_PATCH(&netr_DsRGetDCNameInfo_Type);
62991 : #endif
62992 : #ifdef PY_NETR_CAPABILITIES_PATCH
62993 : PY_NETR_CAPABILITIES_PATCH(&netr_Capabilities_Type);
62994 : #endif
62995 : #ifdef PY_NETR_LSAPOLICYINFORMATION_PATCH
62996 : PY_NETR_LSAPOLICYINFORMATION_PATCH(&netr_LsaPolicyInformation_Type);
62997 : #endif
62998 : #ifdef PY_NETR_OSVERSIONINFOEX_PATCH
62999 : PY_NETR_OSVERSIONINFOEX_PATCH(&netr_OsVersionInfoEx_Type);
63000 : #endif
63001 : #ifdef PY_NETR_OSVERSION_PATCH
63002 : PY_NETR_OSVERSION_PATCH(&netr_OsVersion_Type);
63003 : #endif
63004 : #ifdef PY_NETR_OSVERSIONCONTAINER_PATCH
63005 : PY_NETR_OSVERSIONCONTAINER_PATCH(&netr_OsVersionContainer_Type);
63006 : #endif
63007 : #ifdef PY_NETR_WORKSTATIONINFORMATION_PATCH
63008 : PY_NETR_WORKSTATIONINFORMATION_PATCH(&netr_WorkstationInformation_Type);
63009 : #endif
63010 : #ifdef PY_NETR_WORKSTATIONINFO_PATCH
63011 : PY_NETR_WORKSTATIONINFO_PATCH(&netr_WorkstationInfo_Type);
63012 : #endif
63013 : #ifdef PY_NETR_TRUST_EXTENSION_INFO_PATCH
63014 : PY_NETR_TRUST_EXTENSION_INFO_PATCH(&netr_trust_extension_info_Type);
63015 : #endif
63016 : #ifdef PY_NETR_TRUST_EXTENSION_PATCH
63017 : PY_NETR_TRUST_EXTENSION_PATCH(&netr_trust_extension_Type);
63018 : #endif
63019 : #ifdef PY_NETR_TRUST_EXTENSION_CONTAINER_PATCH
63020 : PY_NETR_TRUST_EXTENSION_CONTAINER_PATCH(&netr_trust_extension_container_Type);
63021 : #endif
63022 : #ifdef PY_NETR_ONEDOMAININFO_PATCH
63023 : PY_NETR_ONEDOMAININFO_PATCH(&netr_OneDomainInfo_Type);
63024 : #endif
63025 : #ifdef PY_NETR_DOMAININFORMATION_PATCH
63026 : PY_NETR_DOMAININFORMATION_PATCH(&netr_DomainInformation_Type);
63027 : #endif
63028 : #ifdef PY_NETR_DOMAININFO_PATCH
63029 : PY_NETR_DOMAININFO_PATCH(&netr_DomainInfo_Type);
63030 : #endif
63031 : #ifdef PY_NL_PASSWORD_VERSION_PATCH
63032 : PY_NL_PASSWORD_VERSION_PATCH(&NL_PASSWORD_VERSION_Type);
63033 : #endif
63034 : #ifdef PY_NETR_CRYPTPASSWORD_PATCH
63035 : PY_NETR_CRYPTPASSWORD_PATCH(&netr_CryptPassword_Type);
63036 : #endif
63037 : #ifdef PY_NETR_SENDTOSAMRESETBADPASSWORDCOUNT_PATCH
63038 : PY_NETR_SENDTOSAMRESETBADPASSWORDCOUNT_PATCH(&netr_SendToSamResetBadPasswordCount_Type);
63039 : #endif
63040 : #ifdef PY_NETR_SENDTOSAMMESSAGE_PATCH
63041 : PY_NETR_SENDTOSAMMESSAGE_PATCH(&netr_SendToSamMessage_Type);
63042 : #endif
63043 : #ifdef PY_NETR_SENDTOSAMBASE_PATCH
63044 : PY_NETR_SENDTOSAMBASE_PATCH(&netr_SendToSamBase_Type);
63045 : #endif
63046 : #ifdef PY_NETR_DSRADDRESSTOSITENAMESWCTR_PATCH
63047 : PY_NETR_DSRADDRESSTOSITENAMESWCTR_PATCH(&netr_DsRAddressToSitenamesWCtr_Type);
63048 : #endif
63049 : #ifdef PY_NETR_DSRADDRESS_PATCH
63050 : PY_NETR_DSRADDRESS_PATCH(&netr_DsRAddress_Type);
63051 : #endif
63052 : #ifdef PY_NETR_DOMAINTRUST_PATCH
63053 : PY_NETR_DOMAINTRUST_PATCH(&netr_DomainTrust_Type);
63054 : #endif
63055 : #ifdef PY_NETR_DOMAINTRUSTLIST_PATCH
63056 : PY_NETR_DOMAINTRUSTLIST_PATCH(&netr_DomainTrustList_Type);
63057 : #endif
63058 : #ifdef PY_NETR_DSRADDRESSTOSITENAMESEXWCTR_PATCH
63059 : PY_NETR_DSRADDRESSTOSITENAMESEXWCTR_PATCH(&netr_DsRAddressToSitenamesExWCtr_Type);
63060 : #endif
63061 : #ifdef PY_DCSITESCTR_PATCH
63062 : PY_DCSITESCTR_PATCH(&DcSitesCtr_Type);
63063 : #endif
63064 : #ifdef PY_NETR_TRUSTINFO_PATCH
63065 : PY_NETR_TRUSTINFO_PATCH(&netr_TrustInfo_Type);
63066 : #endif
63067 : #ifdef PY_NL_DNS_NAME_INFO_PATCH
63068 : PY_NL_DNS_NAME_INFO_PATCH(&NL_DNS_NAME_INFO_Type);
63069 : #endif
63070 : #ifdef PY_NL_DNS_NAME_INFO_ARRAY_PATCH
63071 : PY_NL_DNS_NAME_INFO_ARRAY_PATCH(&NL_DNS_NAME_INFO_ARRAY_Type);
63072 : #endif
63073 : #ifdef PY_NETR_LOGONUASLOGON_PATCH
63074 : PY_NETR_LOGONUASLOGON_PATCH(&netr_LogonUasLogon_Type);
63075 : #endif
63076 : #ifdef PY_NETR_LOGONUASLOGOFF_PATCH
63077 : PY_NETR_LOGONUASLOGOFF_PATCH(&netr_LogonUasLogoff_Type);
63078 : #endif
63079 : #ifdef PY_NETR_LOGONSAMLOGON_PATCH
63080 : PY_NETR_LOGONSAMLOGON_PATCH(&netr_LogonSamLogon_Type);
63081 : #endif
63082 : #ifdef PY_NETR_LOGONSAMLOGOFF_PATCH
63083 : PY_NETR_LOGONSAMLOGOFF_PATCH(&netr_LogonSamLogoff_Type);
63084 : #endif
63085 : #ifdef PY_NETR_SERVERREQCHALLENGE_PATCH
63086 : PY_NETR_SERVERREQCHALLENGE_PATCH(&netr_ServerReqChallenge_Type);
63087 : #endif
63088 : #ifdef PY_NETR_SERVERAUTHENTICATE_PATCH
63089 : PY_NETR_SERVERAUTHENTICATE_PATCH(&netr_ServerAuthenticate_Type);
63090 : #endif
63091 : #ifdef PY_NETR_SERVERPASSWORDSET_PATCH
63092 : PY_NETR_SERVERPASSWORDSET_PATCH(&netr_ServerPasswordSet_Type);
63093 : #endif
63094 : #ifdef PY_NETR_DATABASEDELTAS_PATCH
63095 : PY_NETR_DATABASEDELTAS_PATCH(&netr_DatabaseDeltas_Type);
63096 : #endif
63097 : #ifdef PY_NETR_DATABASESYNC_PATCH
63098 : PY_NETR_DATABASESYNC_PATCH(&netr_DatabaseSync_Type);
63099 : #endif
63100 : #ifdef PY_NETR_ACCOUNTDELTAS_PATCH
63101 : PY_NETR_ACCOUNTDELTAS_PATCH(&netr_AccountDeltas_Type);
63102 : #endif
63103 : #ifdef PY_NETR_ACCOUNTSYNC_PATCH
63104 : PY_NETR_ACCOUNTSYNC_PATCH(&netr_AccountSync_Type);
63105 : #endif
63106 : #ifdef PY_NETR_GETDCNAME_PATCH
63107 : PY_NETR_GETDCNAME_PATCH(&netr_GetDcName_Type);
63108 : #endif
63109 : #ifdef PY_NETR_LOGONCONTROL_PATCH
63110 : PY_NETR_LOGONCONTROL_PATCH(&netr_LogonControl_Type);
63111 : #endif
63112 : #ifdef PY_NETR_GETANYDCNAME_PATCH
63113 : PY_NETR_GETANYDCNAME_PATCH(&netr_GetAnyDCName_Type);
63114 : #endif
63115 : #ifdef PY_NETR_LOGONCONTROL2_PATCH
63116 : PY_NETR_LOGONCONTROL2_PATCH(&netr_LogonControl2_Type);
63117 : #endif
63118 : #ifdef PY_NETR_SERVERAUTHENTICATE2_PATCH
63119 : PY_NETR_SERVERAUTHENTICATE2_PATCH(&netr_ServerAuthenticate2_Type);
63120 : #endif
63121 : #ifdef PY_NETR_DATABASESYNC2_PATCH
63122 : PY_NETR_DATABASESYNC2_PATCH(&netr_DatabaseSync2_Type);
63123 : #endif
63124 : #ifdef PY_NETR_DATABASEREDO_PATCH
63125 : PY_NETR_DATABASEREDO_PATCH(&netr_DatabaseRedo_Type);
63126 : #endif
63127 : #ifdef PY_NETR_LOGONCONTROL2EX_PATCH
63128 : PY_NETR_LOGONCONTROL2EX_PATCH(&netr_LogonControl2Ex_Type);
63129 : #endif
63130 : #ifdef PY_NETR_NETRENUMERATETRUSTEDDOMAINS_PATCH
63131 : PY_NETR_NETRENUMERATETRUSTEDDOMAINS_PATCH(&netr_NetrEnumerateTrustedDomains_Type);
63132 : #endif
63133 : #ifdef PY_NETR_DSRGETDCNAME_PATCH
63134 : PY_NETR_DSRGETDCNAME_PATCH(&netr_DsRGetDCName_Type);
63135 : #endif
63136 : #ifdef PY_NETR_LOGONGETCAPABILITIES_PATCH
63137 : PY_NETR_LOGONGETCAPABILITIES_PATCH(&netr_LogonGetCapabilities_Type);
63138 : #endif
63139 : #ifdef PY_NETR_LOGONGETTRUSTRID_PATCH
63140 : PY_NETR_LOGONGETTRUSTRID_PATCH(&netr_LogonGetTrustRid_Type);
63141 : #endif
63142 : #ifdef PY_NETR_SERVERAUTHENTICATE3_PATCH
63143 : PY_NETR_SERVERAUTHENTICATE3_PATCH(&netr_ServerAuthenticate3_Type);
63144 : #endif
63145 : #ifdef PY_NETR_DSRGETDCNAMEEX_PATCH
63146 : PY_NETR_DSRGETDCNAMEEX_PATCH(&netr_DsRGetDCNameEx_Type);
63147 : #endif
63148 : #ifdef PY_NETR_DSRGETSITENAME_PATCH
63149 : PY_NETR_DSRGETSITENAME_PATCH(&netr_DsRGetSiteName_Type);
63150 : #endif
63151 : #ifdef PY_NETR_LOGONGETDOMAININFO_PATCH
63152 : PY_NETR_LOGONGETDOMAININFO_PATCH(&netr_LogonGetDomainInfo_Type);
63153 : #endif
63154 : #ifdef PY_NETR_SERVERPASSWORDSET2_PATCH
63155 : PY_NETR_SERVERPASSWORDSET2_PATCH(&netr_ServerPasswordSet2_Type);
63156 : #endif
63157 : #ifdef PY_NETR_SERVERPASSWORDGET_PATCH
63158 : PY_NETR_SERVERPASSWORDGET_PATCH(&netr_ServerPasswordGet_Type);
63159 : #endif
63160 : #ifdef PY_NETR_NETRLOGONSENDTOSAM_PATCH
63161 : PY_NETR_NETRLOGONSENDTOSAM_PATCH(&netr_NetrLogonSendToSam_Type);
63162 : #endif
63163 : #ifdef PY_NETR_DSRADDRESSTOSITENAMESW_PATCH
63164 : PY_NETR_DSRADDRESSTOSITENAMESW_PATCH(&netr_DsRAddressToSitenamesW_Type);
63165 : #endif
63166 : #ifdef PY_NETR_DSRGETDCNAMEEX2_PATCH
63167 : PY_NETR_DSRGETDCNAMEEX2_PATCH(&netr_DsRGetDCNameEx2_Type);
63168 : #endif
63169 : #ifdef PY_NETR_NETRENUMERATETRUSTEDDOMAINSEX_PATCH
63170 : PY_NETR_NETRENUMERATETRUSTEDDOMAINSEX_PATCH(&netr_NetrEnumerateTrustedDomainsEx_Type);
63171 : #endif
63172 : #ifdef PY_NETR_DSRADDRESSTOSITENAMESEXW_PATCH
63173 : PY_NETR_DSRADDRESSTOSITENAMESEXW_PATCH(&netr_DsRAddressToSitenamesExW_Type);
63174 : #endif
63175 : #ifdef PY_NETR_DSRGETDCSITECOVERAGEW_PATCH
63176 : PY_NETR_DSRGETDCSITECOVERAGEW_PATCH(&netr_DsrGetDcSiteCoverageW_Type);
63177 : #endif
63178 : #ifdef PY_NETR_LOGONSAMLOGONEX_PATCH
63179 : PY_NETR_LOGONSAMLOGONEX_PATCH(&netr_LogonSamLogonEx_Type);
63180 : #endif
63181 : #ifdef PY_NETR_DSRENUMERATEDOMAINTRUSTS_PATCH
63182 : PY_NETR_DSRENUMERATEDOMAINTRUSTS_PATCH(&netr_DsrEnumerateDomainTrusts_Type);
63183 : #endif
63184 : #ifdef PY_NETR_DSRDEREGISTERDNSHOSTRECORDS_PATCH
63185 : PY_NETR_DSRDEREGISTERDNSHOSTRECORDS_PATCH(&netr_DsrDeregisterDNSHostRecords_Type);
63186 : #endif
63187 : #ifdef PY_NETR_SERVERTRUSTPASSWORDSGET_PATCH
63188 : PY_NETR_SERVERTRUSTPASSWORDSGET_PATCH(&netr_ServerTrustPasswordsGet_Type);
63189 : #endif
63190 : #ifdef PY_NETR_DSRGETFORESTTRUSTINFORMATION_PATCH
63191 : PY_NETR_DSRGETFORESTTRUSTINFORMATION_PATCH(&netr_DsRGetForestTrustInformation_Type);
63192 : #endif
63193 : #ifdef PY_NETR_GETFORESTTRUSTINFORMATION_PATCH
63194 : PY_NETR_GETFORESTTRUSTINFORMATION_PATCH(&netr_GetForestTrustInformation_Type);
63195 : #endif
63196 : #ifdef PY_NETR_LOGONSAMLOGONWITHFLAGS_PATCH
63197 : PY_NETR_LOGONSAMLOGONWITHFLAGS_PATCH(&netr_LogonSamLogonWithFlags_Type);
63198 : #endif
63199 : #ifdef PY_NETR_SERVERGETTRUSTINFO_PATCH
63200 : PY_NETR_SERVERGETTRUSTINFO_PATCH(&netr_ServerGetTrustInfo_Type);
63201 : #endif
63202 : #ifdef PY_NETR_UNUSED47_PATCH
63203 : PY_NETR_UNUSED47_PATCH(&netr_Unused47_Type);
63204 : #endif
63205 : #ifdef PY_NETR_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH
63206 : PY_NETR_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH(&netr_DsrUpdateReadOnlyServerDnsRecords_Type);
63207 : #endif
63208 : #ifdef PY_NETLOGON_PATCH
63209 : PY_NETLOGON_PATCH(&netlogon_InterfaceType);
63210 : #endif
63211 : #ifdef PY_NETLOGON_ABSTRACT_SYNTAX_PATCH
63212 : PY_NETLOGON_ABSTRACT_SYNTAX_PATCH(&netlogon_SyntaxType);
63213 : #endif
63214 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
63215 : PY_ABSTRACT_SYNTAX_PATCH(&netlogon_SyntaxType);
63216 : #endif
63217 :
63218 2956 : m = PyModule_Create(&moduledef);
63219 2956 : if (m == NULL)
63220 0 : goto out;
63221 :
63222 2956 : PyModule_AddObject(m, "NETLOGON_NEG_128BIT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_STRONG_KEYS));
63223 2956 : PyModule_AddObject(m, "NETLOGON_NEG_SCHANNEL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AUTHENTICATED_RPC));
63224 2956 : PyModule_AddObject(m, "DSGETDC_VALID_FLAGS", PyLong_FromLong((DS_FORCE_REDISCOVERY|DS_DIRECTORY_SERVICE_REQUIRED|DS_DIRECTORY_SERVICE_PREFERRED|DS_GC_SERVER_REQUIRED|DS_PDC_REQUIRED|DS_BACKGROUND_ONLY|DS_IP_REQUIRED|DS_KDC_REQUIRED|DS_TIMESERV_REQUIRED|DS_WRITABLE_REQUIRED|DS_GOOD_TIMESERV_PREFERRED|DS_AVOID_SELF|DS_ONLY_LDAP_NEEDED|DS_IS_FLAT_NAME|DS_IS_DNS_NAME|DS_TRY_NEXTCLOSEST_SITE|DS_DIRECTORY_SERVICE_6_REQUIRED|DS_WEB_SERVICE_REQUIRED|DS_RETURN_FLAT_NAME|DS_RETURN_DNS_NAME)));
63225 2956 : PyModule_AddObject(m, "NETLOGON_PASSWORD_VERSION_NUMBER_PRESENT", PyLong_FromUnsignedLongLong(0x02231968));
63226 2956 : PyModule_AddObject(m, "DS_GFTI_UPDATE_TDO", PyLong_FromUnsignedLongLong(0x1));
63227 2956 : PyModule_AddObject(m, "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_CLEARTEXT_PASSWORD_ALLOWED));
63228 2956 : PyModule_AddObject(m, "MSV1_0_UPDATE_LOGON_STATISTICS", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_UPDATE_LOGON_STATISTICS));
63229 2956 : PyModule_AddObject(m, "MSV1_0_RETURN_USER_PARAMETERS", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_RETURN_USER_PARAMETERS));
63230 2956 : PyModule_AddObject(m, "MSV1_0_DONT_TRY_GUEST_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_DONT_TRY_GUEST_ACCOUNT));
63231 2956 : PyModule_AddObject(m, "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT));
63232 2956 : PyModule_AddObject(m, "MSV1_0_RETURN_PASSWORD_EXPIRY", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_RETURN_PASSWORD_EXPIRY));
63233 2956 : PyModule_AddObject(m, "MSV1_0_USE_CLIENT_CHALLENGE", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_USE_CLIENT_CHALLENGE));
63234 2956 : PyModule_AddObject(m, "MSV1_0_TRY_GUEST_ACCOUNT_ONLY", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_TRY_GUEST_ACCOUNT_ONLY));
63235 2956 : PyModule_AddObject(m, "MSV1_0_RETURN_PROFILE_PATH", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_RETURN_PROFILE_PATH));
63236 2956 : PyModule_AddObject(m, "MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY));
63237 2956 : PyModule_AddObject(m, "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT));
63238 2956 : PyModule_AddObject(m, "MSV1_0_DISABLE_PERSONAL_FALLBACK", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_DISABLE_PERSONAL_FALLBACK));
63239 2956 : PyModule_AddObject(m, "MSV1_0_ALLOW_FORCE_GUEST", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_ALLOW_FORCE_GUEST));
63240 2956 : PyModule_AddObject(m, "MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED));
63241 2956 : PyModule_AddObject(m, "MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY));
63242 2956 : PyModule_AddObject(m, "MSV1_0_ALLOW_MSVCHAPV2", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_ALLOW_MSVCHAPV2));
63243 2956 : PyModule_AddObject(m, "MSV1_0_S4U2SELF", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_S4U2SELF));
63244 2956 : PyModule_AddObject(m, "MSV1_0_CHECK_LOGONHOURS_FOR_S4U", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_CHECK_LOGONHOURS_FOR_S4U));
63245 2956 : PyModule_AddObject(m, "MSV1_0_SUBAUTHENTICATION_DLL_EX", PyLong_FromUnsignedLongLong((uint32_t)MSV1_0_SUBAUTHENTICATION_DLL_EX));
63246 2956 : PyModule_AddObject(m, "NetlogonInteractiveInformation", PyLong_FromLong((uint16_t)NetlogonInteractiveInformation));
63247 2956 : PyModule_AddObject(m, "NetlogonNetworkInformation", PyLong_FromLong((uint16_t)NetlogonNetworkInformation));
63248 2956 : PyModule_AddObject(m, "NetlogonServiceInformation", PyLong_FromLong((uint16_t)NetlogonServiceInformation));
63249 2956 : PyModule_AddObject(m, "NetlogonGenericInformation", PyLong_FromLong((uint16_t)NetlogonGenericInformation));
63250 2956 : PyModule_AddObject(m, "NetlogonInteractiveTransitiveInformation", PyLong_FromLong((uint16_t)NetlogonInteractiveTransitiveInformation));
63251 2956 : PyModule_AddObject(m, "NetlogonNetworkTransitiveInformation", PyLong_FromLong((uint16_t)NetlogonNetworkTransitiveInformation));
63252 2956 : PyModule_AddObject(m, "NetlogonServiceTransitiveInformation", PyLong_FromLong((uint16_t)NetlogonServiceTransitiveInformation));
63253 2956 : PyModule_AddObject(m, "NETLOGON_GUEST", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_GUEST));
63254 2956 : PyModule_AddObject(m, "NETLOGON_NOENCRYPTION", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NOENCRYPTION));
63255 2956 : PyModule_AddObject(m, "NETLOGON_CACHED_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CACHED_ACCOUNT));
63256 2956 : PyModule_AddObject(m, "NETLOGON_USED_LM_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_USED_LM_PASSWORD));
63257 2956 : PyModule_AddObject(m, "NETLOGON_EXTRA_SIDS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_EXTRA_SIDS));
63258 2956 : PyModule_AddObject(m, "NETLOGON_SUBAUTH_SESSION_KEY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SUBAUTH_SESSION_KEY));
63259 2956 : PyModule_AddObject(m, "NETLOGON_SERVER_TRUST_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SERVER_TRUST_ACCOUNT));
63260 2956 : PyModule_AddObject(m, "NETLOGON_NTLMV2_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NTLMV2_ENABLED));
63261 2956 : PyModule_AddObject(m, "NETLOGON_RESOURCE_GROUPS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_RESOURCE_GROUPS));
63262 2956 : PyModule_AddObject(m, "NETLOGON_PROFILE_PATH_RETURNED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_PROFILE_PATH_RETURNED));
63263 2956 : PyModule_AddObject(m, "NETLOGON_GRACE_LOGON", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_GRACE_LOGON));
63264 2956 : PyModule_AddObject(m, "NetlogonValidationUasInfo", PyLong_FromLong((uint16_t)NetlogonValidationUasInfo));
63265 2956 : PyModule_AddObject(m, "NetlogonValidationSamInfo", PyLong_FromLong((uint16_t)NetlogonValidationSamInfo));
63266 2956 : PyModule_AddObject(m, "NetlogonValidationSamInfo2", PyLong_FromLong((uint16_t)NetlogonValidationSamInfo2));
63267 2956 : PyModule_AddObject(m, "NetlogonValidationGenericInfo2", PyLong_FromLong((uint16_t)NetlogonValidationGenericInfo2));
63268 2956 : PyModule_AddObject(m, "NetlogonValidationSamInfo4", PyLong_FromLong((uint16_t)NetlogonValidationSamInfo4));
63269 2956 : PyModule_AddObject(m, "NETR_DELTA_DOMAIN", PyLong_FromLong((uint16_t)NETR_DELTA_DOMAIN));
63270 2956 : PyModule_AddObject(m, "NETR_DELTA_GROUP", PyLong_FromLong((uint16_t)NETR_DELTA_GROUP));
63271 2956 : PyModule_AddObject(m, "NETR_DELTA_DELETE_GROUP", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_GROUP));
63272 2956 : PyModule_AddObject(m, "NETR_DELTA_RENAME_GROUP", PyLong_FromLong((uint16_t)NETR_DELTA_RENAME_GROUP));
63273 2956 : PyModule_AddObject(m, "NETR_DELTA_USER", PyLong_FromLong((uint16_t)NETR_DELTA_USER));
63274 2956 : PyModule_AddObject(m, "NETR_DELTA_DELETE_USER", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_USER));
63275 2956 : PyModule_AddObject(m, "NETR_DELTA_RENAME_USER", PyLong_FromLong((uint16_t)NETR_DELTA_RENAME_USER));
63276 2956 : PyModule_AddObject(m, "NETR_DELTA_GROUP_MEMBER", PyLong_FromLong((uint16_t)NETR_DELTA_GROUP_MEMBER));
63277 2956 : PyModule_AddObject(m, "NETR_DELTA_ALIAS", PyLong_FromLong((uint16_t)NETR_DELTA_ALIAS));
63278 2956 : PyModule_AddObject(m, "NETR_DELTA_DELETE_ALIAS", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_ALIAS));
63279 2956 : PyModule_AddObject(m, "NETR_DELTA_RENAME_ALIAS", PyLong_FromLong((uint16_t)NETR_DELTA_RENAME_ALIAS));
63280 2956 : PyModule_AddObject(m, "NETR_DELTA_ALIAS_MEMBER", PyLong_FromLong((uint16_t)NETR_DELTA_ALIAS_MEMBER));
63281 2956 : PyModule_AddObject(m, "NETR_DELTA_POLICY", PyLong_FromLong((uint16_t)NETR_DELTA_POLICY));
63282 2956 : PyModule_AddObject(m, "NETR_DELTA_TRUSTED_DOMAIN", PyLong_FromLong((uint16_t)NETR_DELTA_TRUSTED_DOMAIN));
63283 2956 : PyModule_AddObject(m, "NETR_DELTA_DELETE_TRUST", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_TRUST));
63284 2956 : PyModule_AddObject(m, "NETR_DELTA_ACCOUNT", PyLong_FromLong((uint16_t)NETR_DELTA_ACCOUNT));
63285 2956 : PyModule_AddObject(m, "NETR_DELTA_DELETE_ACCOUNT", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_ACCOUNT));
63286 2956 : PyModule_AddObject(m, "NETR_DELTA_SECRET", PyLong_FromLong((uint16_t)NETR_DELTA_SECRET));
63287 2956 : PyModule_AddObject(m, "NETR_DELTA_DELETE_SECRET", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_SECRET));
63288 2956 : PyModule_AddObject(m, "NETR_DELTA_DELETE_GROUP2", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_GROUP2));
63289 2956 : PyModule_AddObject(m, "NETR_DELTA_DELETE_USER2", PyLong_FromLong((uint16_t)NETR_DELTA_DELETE_USER2));
63290 2956 : PyModule_AddObject(m, "NETR_DELTA_MODIFY_COUNT", PyLong_FromLong((uint16_t)NETR_DELTA_MODIFY_COUNT));
63291 2956 : PyModule_AddObject(m, "NETLOGON_REPLICATION_NEEDED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_REPLICATION_NEEDED));
63292 2956 : PyModule_AddObject(m, "NETLOGON_REPLICATION_IN_PROGRESS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_REPLICATION_IN_PROGRESS));
63293 2956 : PyModule_AddObject(m, "NETLOGON_FULL_SYNC_REPLICATION", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_FULL_SYNC_REPLICATION));
63294 2956 : PyModule_AddObject(m, "NETLOGON_REDO_NEEDED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_REDO_NEEDED));
63295 2956 : PyModule_AddObject(m, "NETLOGON_HAS_IP", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_HAS_IP));
63296 2956 : PyModule_AddObject(m, "NETLOGON_HAS_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_HAS_TIMESERV));
63297 2956 : PyModule_AddObject(m, "NETLOGON_DNS_UPDATE_FAILURE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_DNS_UPDATE_FAILURE));
63298 2956 : PyModule_AddObject(m, "NETLOGON_VERIFY_STATUS_RETURNED", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_VERIFY_STATUS_RETURNED));
63299 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_QUERY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_QUERY));
63300 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_REPLICATE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_REPLICATE));
63301 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_SYNCHRONIZE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_SYNCHRONIZE));
63302 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_PDC_REPLICATE", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_PDC_REPLICATE));
63303 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_REDISCOVER", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_REDISCOVER));
63304 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_TC_QUERY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_TC_QUERY));
63305 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_TRANSPORT_NOTIFY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_TRANSPORT_NOTIFY));
63306 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_FIND_USER", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_FIND_USER));
63307 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_CHANGE_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_CHANGE_PASSWORD));
63308 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_TC_VERIFY", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_TC_VERIFY));
63309 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_FORCE_DNS_REG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_FORCE_DNS_REG));
63310 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_QUERY_DNS_REG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_QUERY_DNS_REG));
63311 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_BACKUP_CHANGE_LOG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_BACKUP_CHANGE_LOG));
63312 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_TRUNCATE_LOG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_TRUNCATE_LOG));
63313 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_SET_DBFLAG", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_SET_DBFLAG));
63314 2956 : PyModule_AddObject(m, "NETLOGON_CONTROL_BREAKPOINT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_CONTROL_BREAKPOINT));
63315 2956 : PyModule_AddObject(m, "NETLOGON_NEG_ACCOUNT_LOCKOUT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_ACCOUNT_LOCKOUT));
63316 2956 : PyModule_AddObject(m, "NETLOGON_NEG_PERSISTENT_SAMREPL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_PERSISTENT_SAMREPL));
63317 2956 : PyModule_AddObject(m, "NETLOGON_NEG_ARCFOUR", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_ARCFOUR));
63318 2956 : PyModule_AddObject(m, "NETLOGON_NEG_PROMOTION_COUNT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_PROMOTION_COUNT));
63319 2956 : PyModule_AddObject(m, "NETLOGON_NEG_CHANGELOG_BDC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_CHANGELOG_BDC));
63320 2956 : PyModule_AddObject(m, "NETLOGON_NEG_FULL_SYNC_REPL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_FULL_SYNC_REPL));
63321 2956 : PyModule_AddObject(m, "NETLOGON_NEG_MULTIPLE_SIDS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_MULTIPLE_SIDS));
63322 2956 : PyModule_AddObject(m, "NETLOGON_NEG_REDO", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_REDO));
63323 2956 : PyModule_AddObject(m, "NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL));
63324 2956 : PyModule_AddObject(m, "NETLOGON_NEG_SEND_PASSWORD_INFO_PDC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_SEND_PASSWORD_INFO_PDC));
63325 2956 : PyModule_AddObject(m, "NETLOGON_NEG_GENERIC_PASSTHROUGH", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_GENERIC_PASSTHROUGH));
63326 2956 : PyModule_AddObject(m, "NETLOGON_NEG_CONCURRENT_RPC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_CONCURRENT_RPC));
63327 2956 : PyModule_AddObject(m, "NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AVOID_ACCOUNT_DB_REPL));
63328 2956 : PyModule_AddObject(m, "NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AVOID_SECURITYAUTH_DB_REPL));
63329 2956 : PyModule_AddObject(m, "NETLOGON_NEG_STRONG_KEYS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_STRONG_KEYS));
63330 2956 : PyModule_AddObject(m, "NETLOGON_NEG_TRANSITIVE_TRUSTS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_TRANSITIVE_TRUSTS));
63331 2956 : PyModule_AddObject(m, "NETLOGON_NEG_DNS_DOMAIN_TRUSTS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_DNS_DOMAIN_TRUSTS));
63332 2956 : PyModule_AddObject(m, "NETLOGON_NEG_PASSWORD_SET2", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_PASSWORD_SET2));
63333 2956 : PyModule_AddObject(m, "NETLOGON_NEG_GETDOMAININFO", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_GETDOMAININFO));
63334 2956 : PyModule_AddObject(m, "NETLOGON_NEG_CROSS_FOREST_TRUSTS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_CROSS_FOREST_TRUSTS));
63335 2956 : PyModule_AddObject(m, "NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_NEUTRALIZE_NT4_EMULATION));
63336 2956 : PyModule_AddObject(m, "NETLOGON_NEG_RODC_PASSTHROUGH", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_RODC_PASSTHROUGH));
63337 2956 : PyModule_AddObject(m, "NETLOGON_NEG_SUPPORTS_AES_SHA2", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_SUPPORTS_AES_SHA2));
63338 2956 : PyModule_AddObject(m, "NETLOGON_NEG_SUPPORTS_AES", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_SUPPORTS_AES));
63339 2956 : PyModule_AddObject(m, "NETLOGON_NEG_AUTHENTICATED_RPC_LSASS", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AUTHENTICATED_RPC_LSASS));
63340 2956 : PyModule_AddObject(m, "NETLOGON_NEG_AUTHENTICATED_RPC", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_NEG_AUTHENTICATED_RPC));
63341 2956 : PyModule_AddObject(m, "SYNCSTATE_NORMAL_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_NORMAL_STATE));
63342 2956 : PyModule_AddObject(m, "SYNCSTATE_DOMAIN_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_DOMAIN_STATE));
63343 2956 : PyModule_AddObject(m, "SYNCSTATE_GROUP_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_GROUP_STATE));
63344 2956 : PyModule_AddObject(m, "SYNCSTATE_UAS_BUILT_IN_GROUP_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_UAS_BUILT_IN_GROUP_STATE));
63345 2956 : PyModule_AddObject(m, "SYNCSTATE_USER_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_USER_STATE));
63346 2956 : PyModule_AddObject(m, "SYNCSTATE_GROUP_MEMBER_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_GROUP_MEMBER_STATE));
63347 2956 : PyModule_AddObject(m, "SYNCSTATE_ALIAS_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_ALIAS_STATE));
63348 2956 : PyModule_AddObject(m, "SYNCSTATE_ALIAS_MEMBER_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_ALIAS_MEMBER_STATE));
63349 2956 : PyModule_AddObject(m, "SYNCSTATE_SAM_DONE_STATE", PyLong_FromLong((uint16_t)SYNCSTATE_SAM_DONE_STATE));
63350 2956 : PyModule_AddObject(m, "NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED", PyLong_FromLong((uint16_t)NETR_CHANGELOG_IMMEDIATE_REPL_REQUIRED));
63351 2956 : PyModule_AddObject(m, "NETR_CHANGELOG_CHANGED_PASSWORD", PyLong_FromLong((uint16_t)NETR_CHANGELOG_CHANGED_PASSWORD));
63352 2956 : PyModule_AddObject(m, "NETR_CHANGELOG_SID_INCLUDED", PyLong_FromLong((uint16_t)NETR_CHANGELOG_SID_INCLUDED));
63353 2956 : PyModule_AddObject(m, "NETR_CHANGELOG_NAME_INCLUDED", PyLong_FromLong((uint16_t)NETR_CHANGELOG_NAME_INCLUDED));
63354 2956 : PyModule_AddObject(m, "NETR_CHANGELOG_FIRST_PROMOTION_OBJ", PyLong_FromLong((uint16_t)NETR_CHANGELOG_FIRST_PROMOTION_OBJ));
63355 2956 : PyModule_AddObject(m, "DS_FORCE_REDISCOVERY", PyLong_FromUnsignedLongLong((uint32_t)DS_FORCE_REDISCOVERY));
63356 2956 : PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_REQUIRED));
63357 2956 : PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_PREFERRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_PREFERRED));
63358 2956 : PyModule_AddObject(m, "DS_GC_SERVER_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_GC_SERVER_REQUIRED));
63359 2956 : PyModule_AddObject(m, "DS_PDC_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_PDC_REQUIRED));
63360 2956 : PyModule_AddObject(m, "DS_BACKGROUND_ONLY", PyLong_FromUnsignedLongLong((uint32_t)DS_BACKGROUND_ONLY));
63361 2956 : PyModule_AddObject(m, "DS_IP_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_IP_REQUIRED));
63362 2956 : PyModule_AddObject(m, "DS_KDC_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_KDC_REQUIRED));
63363 2956 : PyModule_AddObject(m, "DS_TIMESERV_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_TIMESERV_REQUIRED));
63364 2956 : PyModule_AddObject(m, "DS_WRITABLE_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_WRITABLE_REQUIRED));
63365 2956 : PyModule_AddObject(m, "DS_GOOD_TIMESERV_PREFERRED", PyLong_FromUnsignedLongLong((uint32_t)DS_GOOD_TIMESERV_PREFERRED));
63366 2956 : PyModule_AddObject(m, "DS_AVOID_SELF", PyLong_FromUnsignedLongLong((uint32_t)DS_AVOID_SELF));
63367 2956 : PyModule_AddObject(m, "DS_ONLY_LDAP_NEEDED", PyLong_FromUnsignedLongLong((uint32_t)DS_ONLY_LDAP_NEEDED));
63368 2956 : PyModule_AddObject(m, "DS_IS_FLAT_NAME", PyLong_FromUnsignedLongLong((uint32_t)DS_IS_FLAT_NAME));
63369 2956 : PyModule_AddObject(m, "DS_IS_DNS_NAME", PyLong_FromUnsignedLongLong((uint32_t)DS_IS_DNS_NAME));
63370 2956 : PyModule_AddObject(m, "DS_TRY_NEXTCLOSEST_SITE", PyLong_FromUnsignedLongLong((uint32_t)DS_TRY_NEXTCLOSEST_SITE));
63371 2956 : PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_6_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_6_REQUIRED));
63372 2956 : PyModule_AddObject(m, "DS_WEB_SERVICE_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_WEB_SERVICE_REQUIRED));
63373 2956 : PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_8_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_8_REQUIRED));
63374 2956 : PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_9_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_9_REQUIRED));
63375 2956 : PyModule_AddObject(m, "DS_DIRECTORY_SERVICE_10_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)DS_DIRECTORY_SERVICE_10_REQUIRED));
63376 2956 : PyModule_AddObject(m, "DS_RETURN_DNS_NAME", PyLong_FromUnsignedLongLong((uint32_t)DS_RETURN_DNS_NAME));
63377 2956 : PyModule_AddObject(m, "DS_RETURN_FLAT_NAME", PyLong_FromUnsignedLongLong((uint32_t)DS_RETURN_FLAT_NAME));
63378 2956 : PyModule_AddObject(m, "DS_ADDRESS_TYPE_INET", PyLong_FromUnsignedLongLong((uint32_t)DS_ADDRESS_TYPE_INET));
63379 2956 : PyModule_AddObject(m, "DS_ADDRESS_TYPE_NETBIOS", PyLong_FromUnsignedLongLong((uint32_t)DS_ADDRESS_TYPE_NETBIOS));
63380 2956 : PyModule_AddObject(m, "DS_SERVER_PDC", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_PDC));
63381 2956 : PyModule_AddObject(m, "DS_SERVER_GC", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_GC));
63382 2956 : PyModule_AddObject(m, "DS_SERVER_LDAP", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_LDAP));
63383 2956 : PyModule_AddObject(m, "DS_SERVER_DS", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_DS));
63384 2956 : PyModule_AddObject(m, "DS_SERVER_KDC", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_KDC));
63385 2956 : PyModule_AddObject(m, "DS_SERVER_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_TIMESERV));
63386 2956 : PyModule_AddObject(m, "DS_SERVER_CLOSEST", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_CLOSEST));
63387 2956 : PyModule_AddObject(m, "DS_SERVER_WRITABLE", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_WRITABLE));
63388 2956 : PyModule_AddObject(m, "DS_SERVER_GOOD_TIMESERV", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_GOOD_TIMESERV));
63389 2956 : PyModule_AddObject(m, "DS_SERVER_NDNC", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_NDNC));
63390 2956 : PyModule_AddObject(m, "DS_SERVER_SELECT_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_SELECT_SECRET_DOMAIN_6));
63391 2956 : PyModule_AddObject(m, "DS_SERVER_FULL_SECRET_DOMAIN_6", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_FULL_SECRET_DOMAIN_6));
63392 2956 : PyModule_AddObject(m, "DS_SERVER_WEBSERV", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_WEBSERV));
63393 2956 : PyModule_AddObject(m, "DS_SERVER_DS_8", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_DS_8));
63394 2956 : PyModule_AddObject(m, "DS_SERVER_DS_9", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_DS_9));
63395 2956 : PyModule_AddObject(m, "DS_SERVER_DS_10", PyLong_FromUnsignedLongLong((uint32_t)DS_SERVER_DS_10));
63396 2956 : PyModule_AddObject(m, "DS_DNS_CONTROLLER", PyLong_FromUnsignedLongLong((uint32_t)DS_DNS_CONTROLLER));
63397 2956 : PyModule_AddObject(m, "DS_DNS_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)DS_DNS_DOMAIN));
63398 2956 : PyModule_AddObject(m, "DS_DNS_FOREST_ROOT", PyLong_FromUnsignedLongLong((uint32_t)DS_DNS_FOREST_ROOT));
63399 2956 : PyModule_AddObject(m, "NETR_TRUST_FLAG_IN_FOREST", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_IN_FOREST));
63400 2956 : PyModule_AddObject(m, "NETR_TRUST_FLAG_OUTBOUND", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_OUTBOUND));
63401 2956 : PyModule_AddObject(m, "NETR_TRUST_FLAG_TREEROOT", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_TREEROOT));
63402 2956 : PyModule_AddObject(m, "NETR_TRUST_FLAG_PRIMARY", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_PRIMARY));
63403 2956 : PyModule_AddObject(m, "NETR_TRUST_FLAG_NATIVE", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_NATIVE));
63404 2956 : PyModule_AddObject(m, "NETR_TRUST_FLAG_INBOUND", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_INBOUND));
63405 2956 : PyModule_AddObject(m, "NETR_TRUST_FLAG_MIT_KRB5", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_MIT_KRB5));
63406 2956 : PyModule_AddObject(m, "NETR_TRUST_FLAG_AES", PyLong_FromUnsignedLongLong((uint32_t)NETR_TRUST_FLAG_AES));
63407 2956 : PyModule_AddObject(m, "NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS", PyLong_FromUnsignedLongLong((uint32_t)NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS));
63408 2956 : PyModule_AddObject(m, "NETR_WS_FLAG_HANDLES_SPN_UPDATE", PyLong_FromUnsignedLongLong((uint32_t)NETR_WS_FLAG_HANDLES_SPN_UPDATE));
63409 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_BACKOFFICE", PyLong_FromLong((uint16_t)NETR_VER_SUITE_BACKOFFICE));
63410 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_BLADE", PyLong_FromLong((uint16_t)NETR_VER_SUITE_BLADE));
63411 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_COMPUTE_SERVER", PyLong_FromLong((uint16_t)NETR_VER_SUITE_COMPUTE_SERVER));
63412 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_DATACENTER", PyLong_FromLong((uint16_t)NETR_VER_SUITE_DATACENTER));
63413 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_ENTERPRISE", PyLong_FromLong((uint16_t)NETR_VER_SUITE_ENTERPRISE));
63414 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_EMBEDDEDNT", PyLong_FromLong((uint16_t)NETR_VER_SUITE_EMBEDDEDNT));
63415 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_PERSONAL", PyLong_FromLong((uint16_t)NETR_VER_SUITE_PERSONAL));
63416 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_SINGLEUSERTS", PyLong_FromLong((uint16_t)NETR_VER_SUITE_SINGLEUSERTS));
63417 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_SMALLBUSINESS", PyLong_FromLong((uint16_t)NETR_VER_SUITE_SMALLBUSINESS));
63418 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED", PyLong_FromLong((uint16_t)NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED));
63419 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_STORAGE_SERVER", PyLong_FromLong((uint16_t)NETR_VER_SUITE_STORAGE_SERVER));
63420 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_TERMINAL", PyLong_FromLong((uint16_t)NETR_VER_SUITE_TERMINAL));
63421 2956 : PyModule_AddObject(m, "NETR_VER_SUITE_WH_SERVER", PyLong_FromLong((uint16_t)NETR_VER_SUITE_WH_SERVER));
63422 2956 : PyModule_AddObject(m, "NETR_VER_NT_DOMAIN_CONTROLLER", PyLong_FromLong((uint16_t)NETR_VER_NT_DOMAIN_CONTROLLER));
63423 2956 : PyModule_AddObject(m, "NETR_VER_NT_SERVER", PyLong_FromLong((uint16_t)NETR_VER_NT_SERVER));
63424 2956 : PyModule_AddObject(m, "NETR_VER_NT_WORKSTATION", PyLong_FromLong((uint16_t)NETR_VER_NT_WORKSTATION));
63425 2956 : PyModule_AddObject(m, "SendToSamUpdatePassword", PyLong_FromLong((uint16_t)SendToSamUpdatePassword));
63426 2956 : PyModule_AddObject(m, "SendToSamResetBadPasswordCount", PyLong_FromLong((uint16_t)SendToSamResetBadPasswordCount));
63427 2956 : PyModule_AddObject(m, "SendToSamUpdatePasswordForward", PyLong_FromLong((uint16_t)SendToSamUpdatePasswordForward));
63428 2956 : PyModule_AddObject(m, "SendToSamUpdateLastLogonTimestamp", PyLong_FromLong((uint16_t)SendToSamUpdateLastLogonTimestamp));
63429 2956 : PyModule_AddObject(m, "SendToSamResetSmartCardPassword", PyLong_FromLong((uint16_t)SendToSamResetSmartCardPassword));
63430 2956 : PyModule_AddObject(m, "NETLOGON_SAMLOGON_FLAG_PASS_TO_FOREST_ROOT", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SAMLOGON_FLAG_PASS_TO_FOREST_ROOT));
63431 2956 : PyModule_AddObject(m, "NETLOGON_SAMLOGON_FLAG_PASS_CROSS_FOREST_HOP", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SAMLOGON_FLAG_PASS_CROSS_FOREST_HOP));
63432 2956 : PyModule_AddObject(m, "NETLOGON_SAMLOGON_FLAG_RODC_TO_OTHER_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SAMLOGON_FLAG_RODC_TO_OTHER_DOMAIN));
63433 2956 : PyModule_AddObject(m, "NETLOGON_SAMLOGON_FLAG_RODC_NTLM_REQUEST", PyLong_FromUnsignedLongLong((uint32_t)NETLOGON_SAMLOGON_FLAG_RODC_NTLM_REQUEST));
63434 2956 : PyModule_AddObject(m, "NlDnsLdapAtSite", PyLong_FromLong((uint16_t)NlDnsLdapAtSite));
63435 2956 : PyModule_AddObject(m, "NlDnsGcAtSite", PyLong_FromLong((uint16_t)NlDnsGcAtSite));
63436 2956 : PyModule_AddObject(m, "NlDnsDsaCname", PyLong_FromLong((uint16_t)NlDnsDsaCname));
63437 2956 : PyModule_AddObject(m, "NlDnsKdcAtSite", PyLong_FromLong((uint16_t)NlDnsKdcAtSite));
63438 2956 : PyModule_AddObject(m, "NlDnsDcAtSite", PyLong_FromLong((uint16_t)NlDnsDcAtSite));
63439 2956 : PyModule_AddObject(m, "NlDnsRfc1510KdcAtSite", PyLong_FromLong((uint16_t)NlDnsRfc1510KdcAtSite));
63440 2956 : PyModule_AddObject(m, "NlDnsGenericGcAtSite", PyLong_FromLong((uint16_t)NlDnsGenericGcAtSite));
63441 2956 : PyModule_AddObject(m, "NlDnsInfoTypeNone", PyLong_FromLong((uint16_t)NlDnsInfoTypeNone));
63442 2956 : PyModule_AddObject(m, "NlDnsDomainName", PyLong_FromLong((uint16_t)NlDnsDomainName));
63443 2956 : PyModule_AddObject(m, "NlDnsDomainNameAlias", PyLong_FromLong((uint16_t)NlDnsDomainNameAlias));
63444 2956 : PyModule_AddObject(m, "NlDnsForestName", PyLong_FromLong((uint16_t)NlDnsForestName));
63445 2956 : PyModule_AddObject(m, "NlDnsForestNameAlias", PyLong_FromLong((uint16_t)NlDnsForestNameAlias));
63446 2956 : PyModule_AddObject(m, "NlDnsNdncDomainName", PyLong_FromLong((uint16_t)NlDnsNdncDomainName));
63447 2956 : PyModule_AddObject(m, "NlDnsRecordName", PyLong_FromLong((uint16_t)NlDnsRecordName));
63448 2956 : Py_INCREF((PyObject *)(void *)&netr_UasInfo_Type);
63449 2956 : PyModule_AddObject(m, "netr_UasInfo", (PyObject *)(void *)&netr_UasInfo_Type);
63450 2956 : Py_INCREF((PyObject *)(void *)&netr_UasLogoffInfo_Type);
63451 2956 : PyModule_AddObject(m, "netr_UasLogoffInfo", (PyObject *)(void *)&netr_UasLogoffInfo_Type);
63452 2956 : Py_INCREF((PyObject *)(void *)&netr_AcctLockStr_Type);
63453 2956 : PyModule_AddObject(m, "netr_AcctLockStr", (PyObject *)(void *)&netr_AcctLockStr_Type);
63454 2956 : Py_INCREF((PyObject *)(void *)&netr_IdentityInfo_Type);
63455 2956 : PyModule_AddObject(m, "netr_IdentityInfo", (PyObject *)(void *)&netr_IdentityInfo_Type);
63456 2956 : Py_INCREF((PyObject *)(void *)&netr_PasswordInfo_Type);
63457 2956 : PyModule_AddObject(m, "netr_PasswordInfo", (PyObject *)(void *)&netr_PasswordInfo_Type);
63458 2956 : Py_INCREF((PyObject *)(void *)&netr_ChallengeResponse_Type);
63459 2956 : PyModule_AddObject(m, "netr_ChallengeResponse", (PyObject *)(void *)&netr_ChallengeResponse_Type);
63460 2956 : Py_INCREF((PyObject *)(void *)&netr_NetworkInfo_Type);
63461 2956 : PyModule_AddObject(m, "netr_NetworkInfo", (PyObject *)(void *)&netr_NetworkInfo_Type);
63462 2956 : Py_INCREF((PyObject *)(void *)&netr_GenericInfo_Type);
63463 2956 : PyModule_AddObject(m, "netr_GenericInfo", (PyObject *)(void *)&netr_GenericInfo_Type);
63464 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonLevel_Type);
63465 2956 : PyModule_AddObject(m, "netr_LogonLevel", (PyObject *)(void *)&netr_LogonLevel_Type);
63466 2956 : Py_INCREF((PyObject *)(void *)&netr_UserSessionKey_Type);
63467 2956 : PyModule_AddObject(m, "netr_UserSessionKey", (PyObject *)(void *)&netr_UserSessionKey_Type);
63468 2956 : Py_INCREF((PyObject *)(void *)&netr_LMSessionKey_Type);
63469 2956 : PyModule_AddObject(m, "netr_LMSessionKey", (PyObject *)(void *)&netr_LMSessionKey_Type);
63470 2956 : Py_INCREF((PyObject *)(void *)&netr_SamBaseInfo_Type);
63471 2956 : PyModule_AddObject(m, "netr_SamBaseInfo", (PyObject *)(void *)&netr_SamBaseInfo_Type);
63472 2956 : Py_INCREF((PyObject *)(void *)&netr_SamInfo2_Type);
63473 2956 : PyModule_AddObject(m, "netr_SamInfo2", (PyObject *)(void *)&netr_SamInfo2_Type);
63474 2956 : Py_INCREF((PyObject *)(void *)&netr_SidAttr_Type);
63475 2956 : PyModule_AddObject(m, "netr_SidAttr", (PyObject *)(void *)&netr_SidAttr_Type);
63476 2956 : Py_INCREF((PyObject *)(void *)&netr_SamInfo3_Type);
63477 2956 : PyModule_AddObject(m, "netr_SamInfo3", (PyObject *)(void *)&netr_SamInfo3_Type);
63478 2956 : Py_INCREF((PyObject *)(void *)&netr_SamInfo6_Type);
63479 2956 : PyModule_AddObject(m, "netr_SamInfo6", (PyObject *)(void *)&netr_SamInfo6_Type);
63480 2956 : Py_INCREF((PyObject *)(void *)&netr_PacInfo_Type);
63481 2956 : PyModule_AddObject(m, "netr_PacInfo", (PyObject *)(void *)&netr_PacInfo_Type);
63482 2956 : Py_INCREF((PyObject *)(void *)&netr_GenericInfo2_Type);
63483 2956 : PyModule_AddObject(m, "netr_GenericInfo2", (PyObject *)(void *)&netr_GenericInfo2_Type);
63484 2956 : Py_INCREF((PyObject *)(void *)&netr_Validation_Type);
63485 2956 : PyModule_AddObject(m, "netr_Validation", (PyObject *)(void *)&netr_Validation_Type);
63486 2956 : Py_INCREF((PyObject *)(void *)&netr_Credential_Type);
63487 2956 : PyModule_AddObject(m, "netr_Credential", (PyObject *)(void *)&netr_Credential_Type);
63488 2956 : Py_INCREF((PyObject *)(void *)&netlogon_server_pipe_state_Type);
63489 2956 : PyModule_AddObject(m, "server_pipe_state", (PyObject *)(void *)&netlogon_server_pipe_state_Type);
63490 2956 : Py_INCREF((PyObject *)(void *)&netr_Authenticator_Type);
63491 2956 : PyModule_AddObject(m, "netr_Authenticator", (PyObject *)(void *)&netr_Authenticator_Type);
63492 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_DELETE_USER_Type);
63493 2956 : PyModule_AddObject(m, "netr_DELTA_DELETE_USER", (PyObject *)(void *)&netr_DELTA_DELETE_USER_Type);
63494 2956 : Py_INCREF((PyObject *)(void *)&netr_USER_KEY16_Type);
63495 2956 : PyModule_AddObject(m, "netr_USER_KEY16", (PyObject *)(void *)&netr_USER_KEY16_Type);
63496 2956 : Py_INCREF((PyObject *)(void *)&netr_PasswordHistory_Type);
63497 2956 : PyModule_AddObject(m, "netr_PasswordHistory", (PyObject *)(void *)&netr_PasswordHistory_Type);
63498 2956 : Py_INCREF((PyObject *)(void *)&netr_USER_KEYS2_Type);
63499 2956 : PyModule_AddObject(m, "netr_USER_KEYS2", (PyObject *)(void *)&netr_USER_KEYS2_Type);
63500 2956 : Py_INCREF((PyObject *)(void *)&netr_USER_KEY_UNION_Type);
63501 2956 : PyModule_AddObject(m, "netr_USER_KEY_UNION", (PyObject *)(void *)&netr_USER_KEY_UNION_Type);
63502 2956 : Py_INCREF((PyObject *)(void *)&netr_USER_KEYS_Type);
63503 2956 : PyModule_AddObject(m, "netr_USER_KEYS", (PyObject *)(void *)&netr_USER_KEYS_Type);
63504 2956 : Py_INCREF((PyObject *)(void *)&netr_USER_PRIVATE_INFO_Type);
63505 2956 : PyModule_AddObject(m, "netr_USER_PRIVATE_INFO", (PyObject *)(void *)&netr_USER_PRIVATE_INFO_Type);
63506 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_USER_Type);
63507 2956 : PyModule_AddObject(m, "netr_DELTA_USER", (PyObject *)(void *)&netr_DELTA_USER_Type);
63508 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_DOMAIN_Type);
63509 2956 : PyModule_AddObject(m, "netr_DELTA_DOMAIN", (PyObject *)(void *)&netr_DELTA_DOMAIN_Type);
63510 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_GROUP_Type);
63511 2956 : PyModule_AddObject(m, "netr_DELTA_GROUP", (PyObject *)(void *)&netr_DELTA_GROUP_Type);
63512 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_RENAME_Type);
63513 2956 : PyModule_AddObject(m, "netr_DELTA_RENAME", (PyObject *)(void *)&netr_DELTA_RENAME_Type);
63514 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_GROUP_MEMBER_Type);
63515 2956 : PyModule_AddObject(m, "netr_DELTA_GROUP_MEMBER", (PyObject *)(void *)&netr_DELTA_GROUP_MEMBER_Type);
63516 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_ALIAS_Type);
63517 2956 : PyModule_AddObject(m, "netr_DELTA_ALIAS", (PyObject *)(void *)&netr_DELTA_ALIAS_Type);
63518 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_ALIAS_MEMBER_Type);
63519 2956 : PyModule_AddObject(m, "netr_DELTA_ALIAS_MEMBER", (PyObject *)(void *)&netr_DELTA_ALIAS_MEMBER_Type);
63520 2956 : Py_INCREF((PyObject *)(void *)&netr_QUOTA_LIMITS_Type);
63521 2956 : PyModule_AddObject(m, "netr_QUOTA_LIMITS", (PyObject *)(void *)&netr_QUOTA_LIMITS_Type);
63522 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_POLICY_Type);
63523 2956 : PyModule_AddObject(m, "netr_DELTA_POLICY", (PyObject *)(void *)&netr_DELTA_POLICY_Type);
63524 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_TRUSTED_DOMAIN_Type);
63525 2956 : PyModule_AddObject(m, "netr_DELTA_TRUSTED_DOMAIN", (PyObject *)(void *)&netr_DELTA_TRUSTED_DOMAIN_Type);
63526 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_ACCOUNT_Type);
63527 2956 : PyModule_AddObject(m, "netr_DELTA_ACCOUNT", (PyObject *)(void *)&netr_DELTA_ACCOUNT_Type);
63528 2956 : Py_INCREF((PyObject *)(void *)&netr_CIPHER_VALUE_Type);
63529 2956 : PyModule_AddObject(m, "netr_CIPHER_VALUE", (PyObject *)(void *)&netr_CIPHER_VALUE_Type);
63530 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_SECRET_Type);
63531 2956 : PyModule_AddObject(m, "netr_DELTA_SECRET", (PyObject *)(void *)&netr_DELTA_SECRET_Type);
63532 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_UNION_Type);
63533 2956 : PyModule_AddObject(m, "netr_DELTA_UNION", (PyObject *)(void *)&netr_DELTA_UNION_Type);
63534 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_ID_UNION_Type);
63535 2956 : PyModule_AddObject(m, "netr_DELTA_ID_UNION", (PyObject *)(void *)&netr_DELTA_ID_UNION_Type);
63536 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_ENUM_Type);
63537 2956 : PyModule_AddObject(m, "netr_DELTA_ENUM", (PyObject *)(void *)&netr_DELTA_ENUM_Type);
63538 2956 : Py_INCREF((PyObject *)(void *)&netr_DELTA_ENUM_ARRAY_Type);
63539 2956 : PyModule_AddObject(m, "netr_DELTA_ENUM_ARRAY", (PyObject *)(void *)&netr_DELTA_ENUM_ARRAY_Type);
63540 2956 : Py_INCREF((PyObject *)(void *)&netr_UAS_INFO_0_Type);
63541 2956 : PyModule_AddObject(m, "netr_UAS_INFO_0", (PyObject *)(void *)&netr_UAS_INFO_0_Type);
63542 2956 : Py_INCREF((PyObject *)(void *)&netr_AccountBuffer_Type);
63543 2956 : PyModule_AddObject(m, "netr_AccountBuffer", (PyObject *)(void *)&netr_AccountBuffer_Type);
63544 2956 : Py_INCREF((PyObject *)(void *)&netr_NETLOGON_INFO_1_Type);
63545 2956 : PyModule_AddObject(m, "netr_NETLOGON_INFO_1", (PyObject *)(void *)&netr_NETLOGON_INFO_1_Type);
63546 2956 : Py_INCREF((PyObject *)(void *)&netr_NETLOGON_INFO_2_Type);
63547 2956 : PyModule_AddObject(m, "netr_NETLOGON_INFO_2", (PyObject *)(void *)&netr_NETLOGON_INFO_2_Type);
63548 2956 : Py_INCREF((PyObject *)(void *)&netr_NETLOGON_INFO_3_Type);
63549 2956 : PyModule_AddObject(m, "netr_NETLOGON_INFO_3", (PyObject *)(void *)&netr_NETLOGON_INFO_3_Type);
63550 2956 : Py_INCREF((PyObject *)(void *)&netr_NETLOGON_INFO_4_Type);
63551 2956 : PyModule_AddObject(m, "netr_NETLOGON_INFO_4", (PyObject *)(void *)&netr_NETLOGON_INFO_4_Type);
63552 2956 : Py_INCREF((PyObject *)(void *)&netr_CONTROL_QUERY_INFORMATION_Type);
63553 2956 : PyModule_AddObject(m, "netr_CONTROL_QUERY_INFORMATION", (PyObject *)(void *)&netr_CONTROL_QUERY_INFORMATION_Type);
63554 2956 : Py_INCREF((PyObject *)(void *)&netr_CONTROL_DATA_INFORMATION_Type);
63555 2956 : PyModule_AddObject(m, "netr_CONTROL_DATA_INFORMATION", (PyObject *)(void *)&netr_CONTROL_DATA_INFORMATION_Type);
63556 2956 : Py_INCREF((PyObject *)(void *)&netr_ChangeLogObject_Type);
63557 2956 : PyModule_AddObject(m, "netr_ChangeLogObject", (PyObject *)(void *)&netr_ChangeLogObject_Type);
63558 2956 : Py_INCREF((PyObject *)(void *)&netr_ChangeLogEntry_Type);
63559 2956 : PyModule_AddObject(m, "netr_ChangeLogEntry", (PyObject *)(void *)&netr_ChangeLogEntry_Type);
63560 2956 : Py_INCREF((PyObject *)(void *)&netr_Blob_Type);
63561 2956 : PyModule_AddObject(m, "netr_Blob", (PyObject *)(void *)&netr_Blob_Type);
63562 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRGetDCNameInfo_Type);
63563 2956 : PyModule_AddObject(m, "netr_DsRGetDCNameInfo", (PyObject *)(void *)&netr_DsRGetDCNameInfo_Type);
63564 2956 : Py_INCREF((PyObject *)(void *)&netr_Capabilities_Type);
63565 2956 : PyModule_AddObject(m, "netr_Capabilities", (PyObject *)(void *)&netr_Capabilities_Type);
63566 2956 : Py_INCREF((PyObject *)(void *)&netr_LsaPolicyInformation_Type);
63567 2956 : PyModule_AddObject(m, "netr_LsaPolicyInformation", (PyObject *)(void *)&netr_LsaPolicyInformation_Type);
63568 2956 : Py_INCREF((PyObject *)(void *)&netr_OsVersionInfoEx_Type);
63569 2956 : PyModule_AddObject(m, "netr_OsVersionInfoEx", (PyObject *)(void *)&netr_OsVersionInfoEx_Type);
63570 2956 : Py_INCREF((PyObject *)(void *)&netr_OsVersion_Type);
63571 2956 : PyModule_AddObject(m, "netr_OsVersion", (PyObject *)(void *)&netr_OsVersion_Type);
63572 2956 : Py_INCREF((PyObject *)(void *)&netr_OsVersionContainer_Type);
63573 2956 : PyModule_AddObject(m, "netr_OsVersionContainer", (PyObject *)(void *)&netr_OsVersionContainer_Type);
63574 2956 : Py_INCREF((PyObject *)(void *)&netr_WorkstationInformation_Type);
63575 2956 : PyModule_AddObject(m, "netr_WorkstationInformation", (PyObject *)(void *)&netr_WorkstationInformation_Type);
63576 2956 : Py_INCREF((PyObject *)(void *)&netr_WorkstationInfo_Type);
63577 2956 : PyModule_AddObject(m, "netr_WorkstationInfo", (PyObject *)(void *)&netr_WorkstationInfo_Type);
63578 2956 : Py_INCREF((PyObject *)(void *)&netr_trust_extension_info_Type);
63579 2956 : PyModule_AddObject(m, "netr_trust_extension_info", (PyObject *)(void *)&netr_trust_extension_info_Type);
63580 2956 : Py_INCREF((PyObject *)(void *)&netr_trust_extension_Type);
63581 2956 : PyModule_AddObject(m, "netr_trust_extension", (PyObject *)(void *)&netr_trust_extension_Type);
63582 2956 : Py_INCREF((PyObject *)(void *)&netr_trust_extension_container_Type);
63583 2956 : PyModule_AddObject(m, "netr_trust_extension_container", (PyObject *)(void *)&netr_trust_extension_container_Type);
63584 2956 : Py_INCREF((PyObject *)(void *)&netr_OneDomainInfo_Type);
63585 2956 : PyModule_AddObject(m, "netr_OneDomainInfo", (PyObject *)(void *)&netr_OneDomainInfo_Type);
63586 2956 : Py_INCREF((PyObject *)(void *)&netr_DomainInformation_Type);
63587 2956 : PyModule_AddObject(m, "netr_DomainInformation", (PyObject *)(void *)&netr_DomainInformation_Type);
63588 2956 : Py_INCREF((PyObject *)(void *)&netr_DomainInfo_Type);
63589 2956 : PyModule_AddObject(m, "netr_DomainInfo", (PyObject *)(void *)&netr_DomainInfo_Type);
63590 2956 : Py_INCREF((PyObject *)(void *)&NL_PASSWORD_VERSION_Type);
63591 2956 : PyModule_AddObject(m, "NL_PASSWORD_VERSION", (PyObject *)(void *)&NL_PASSWORD_VERSION_Type);
63592 2956 : Py_INCREF((PyObject *)(void *)&netr_CryptPassword_Type);
63593 2956 : PyModule_AddObject(m, "netr_CryptPassword", (PyObject *)(void *)&netr_CryptPassword_Type);
63594 2956 : Py_INCREF((PyObject *)(void *)&netr_SendToSamResetBadPasswordCount_Type);
63595 2956 : PyModule_AddObject(m, "netr_SendToSamResetBadPasswordCount", (PyObject *)(void *)&netr_SendToSamResetBadPasswordCount_Type);
63596 2956 : Py_INCREF((PyObject *)(void *)&netr_SendToSamMessage_Type);
63597 2956 : PyModule_AddObject(m, "netr_SendToSamMessage", (PyObject *)(void *)&netr_SendToSamMessage_Type);
63598 2956 : Py_INCREF((PyObject *)(void *)&netr_SendToSamBase_Type);
63599 2956 : PyModule_AddObject(m, "netr_SendToSamBase", (PyObject *)(void *)&netr_SendToSamBase_Type);
63600 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRAddressToSitenamesWCtr_Type);
63601 2956 : PyModule_AddObject(m, "netr_DsRAddressToSitenamesWCtr", (PyObject *)(void *)&netr_DsRAddressToSitenamesWCtr_Type);
63602 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRAddress_Type);
63603 2956 : PyModule_AddObject(m, "netr_DsRAddress", (PyObject *)(void *)&netr_DsRAddress_Type);
63604 2956 : Py_INCREF((PyObject *)(void *)&netr_DomainTrust_Type);
63605 2956 : PyModule_AddObject(m, "netr_DomainTrust", (PyObject *)(void *)&netr_DomainTrust_Type);
63606 2956 : Py_INCREF((PyObject *)(void *)&netr_DomainTrustList_Type);
63607 2956 : PyModule_AddObject(m, "netr_DomainTrustList", (PyObject *)(void *)&netr_DomainTrustList_Type);
63608 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRAddressToSitenamesExWCtr_Type);
63609 2956 : PyModule_AddObject(m, "netr_DsRAddressToSitenamesExWCtr", (PyObject *)(void *)&netr_DsRAddressToSitenamesExWCtr_Type);
63610 2956 : Py_INCREF((PyObject *)(void *)&DcSitesCtr_Type);
63611 2956 : PyModule_AddObject(m, "DcSitesCtr", (PyObject *)(void *)&DcSitesCtr_Type);
63612 2956 : Py_INCREF((PyObject *)(void *)&netr_TrustInfo_Type);
63613 2956 : PyModule_AddObject(m, "netr_TrustInfo", (PyObject *)(void *)&netr_TrustInfo_Type);
63614 2956 : Py_INCREF((PyObject *)(void *)&NL_DNS_NAME_INFO_Type);
63615 2956 : PyModule_AddObject(m, "NL_DNS_NAME_INFO", (PyObject *)(void *)&NL_DNS_NAME_INFO_Type);
63616 2956 : Py_INCREF((PyObject *)(void *)&NL_DNS_NAME_INFO_ARRAY_Type);
63617 2956 : PyModule_AddObject(m, "NL_DNS_NAME_INFO_ARRAY", (PyObject *)(void *)&NL_DNS_NAME_INFO_ARRAY_Type);
63618 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonUasLogon_Type);
63619 2956 : PyModule_AddObject(m, "netr_LogonUasLogon", (PyObject *)(void *)&netr_LogonUasLogon_Type);
63620 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonUasLogoff_Type);
63621 2956 : PyModule_AddObject(m, "netr_LogonUasLogoff", (PyObject *)(void *)&netr_LogonUasLogoff_Type);
63622 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonSamLogon_Type);
63623 2956 : PyModule_AddObject(m, "netr_LogonSamLogon", (PyObject *)(void *)&netr_LogonSamLogon_Type);
63624 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonSamLogoff_Type);
63625 2956 : PyModule_AddObject(m, "netr_LogonSamLogoff", (PyObject *)(void *)&netr_LogonSamLogoff_Type);
63626 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerReqChallenge_Type);
63627 2956 : PyModule_AddObject(m, "netr_ServerReqChallenge", (PyObject *)(void *)&netr_ServerReqChallenge_Type);
63628 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerAuthenticate_Type);
63629 2956 : PyModule_AddObject(m, "netr_ServerAuthenticate", (PyObject *)(void *)&netr_ServerAuthenticate_Type);
63630 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerPasswordSet_Type);
63631 2956 : PyModule_AddObject(m, "netr_ServerPasswordSet", (PyObject *)(void *)&netr_ServerPasswordSet_Type);
63632 2956 : Py_INCREF((PyObject *)(void *)&netr_DatabaseDeltas_Type);
63633 2956 : PyModule_AddObject(m, "netr_DatabaseDeltas", (PyObject *)(void *)&netr_DatabaseDeltas_Type);
63634 2956 : Py_INCREF((PyObject *)(void *)&netr_DatabaseSync_Type);
63635 2956 : PyModule_AddObject(m, "netr_DatabaseSync", (PyObject *)(void *)&netr_DatabaseSync_Type);
63636 2956 : Py_INCREF((PyObject *)(void *)&netr_AccountDeltas_Type);
63637 2956 : PyModule_AddObject(m, "netr_AccountDeltas", (PyObject *)(void *)&netr_AccountDeltas_Type);
63638 2956 : Py_INCREF((PyObject *)(void *)&netr_AccountSync_Type);
63639 2956 : PyModule_AddObject(m, "netr_AccountSync", (PyObject *)(void *)&netr_AccountSync_Type);
63640 2956 : Py_INCREF((PyObject *)(void *)&netr_GetDcName_Type);
63641 2956 : PyModule_AddObject(m, "netr_GetDcName", (PyObject *)(void *)&netr_GetDcName_Type);
63642 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonControl_Type);
63643 2956 : PyModule_AddObject(m, "netr_LogonControl", (PyObject *)(void *)&netr_LogonControl_Type);
63644 2956 : Py_INCREF((PyObject *)(void *)&netr_GetAnyDCName_Type);
63645 2956 : PyModule_AddObject(m, "netr_GetAnyDCName", (PyObject *)(void *)&netr_GetAnyDCName_Type);
63646 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonControl2_Type);
63647 2956 : PyModule_AddObject(m, "netr_LogonControl2", (PyObject *)(void *)&netr_LogonControl2_Type);
63648 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerAuthenticate2_Type);
63649 2956 : PyModule_AddObject(m, "netr_ServerAuthenticate2", (PyObject *)(void *)&netr_ServerAuthenticate2_Type);
63650 2956 : Py_INCREF((PyObject *)(void *)&netr_DatabaseSync2_Type);
63651 2956 : PyModule_AddObject(m, "netr_DatabaseSync2", (PyObject *)(void *)&netr_DatabaseSync2_Type);
63652 2956 : Py_INCREF((PyObject *)(void *)&netr_DatabaseRedo_Type);
63653 2956 : PyModule_AddObject(m, "netr_DatabaseRedo", (PyObject *)(void *)&netr_DatabaseRedo_Type);
63654 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonControl2Ex_Type);
63655 2956 : PyModule_AddObject(m, "netr_LogonControl2Ex", (PyObject *)(void *)&netr_LogonControl2Ex_Type);
63656 2956 : Py_INCREF((PyObject *)(void *)&netr_NetrEnumerateTrustedDomains_Type);
63657 2956 : PyModule_AddObject(m, "netr_NetrEnumerateTrustedDomains", (PyObject *)(void *)&netr_NetrEnumerateTrustedDomains_Type);
63658 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRGetDCName_Type);
63659 2956 : PyModule_AddObject(m, "netr_DsRGetDCName", (PyObject *)(void *)&netr_DsRGetDCName_Type);
63660 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonGetCapabilities_Type);
63661 2956 : PyModule_AddObject(m, "netr_LogonGetCapabilities", (PyObject *)(void *)&netr_LogonGetCapabilities_Type);
63662 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonGetTrustRid_Type);
63663 2956 : PyModule_AddObject(m, "netr_LogonGetTrustRid", (PyObject *)(void *)&netr_LogonGetTrustRid_Type);
63664 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerAuthenticate3_Type);
63665 2956 : PyModule_AddObject(m, "netr_ServerAuthenticate3", (PyObject *)(void *)&netr_ServerAuthenticate3_Type);
63666 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRGetDCNameEx_Type);
63667 2956 : PyModule_AddObject(m, "netr_DsRGetDCNameEx", (PyObject *)(void *)&netr_DsRGetDCNameEx_Type);
63668 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRGetSiteName_Type);
63669 2956 : PyModule_AddObject(m, "netr_DsRGetSiteName", (PyObject *)(void *)&netr_DsRGetSiteName_Type);
63670 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonGetDomainInfo_Type);
63671 2956 : PyModule_AddObject(m, "netr_LogonGetDomainInfo", (PyObject *)(void *)&netr_LogonGetDomainInfo_Type);
63672 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerPasswordSet2_Type);
63673 2956 : PyModule_AddObject(m, "netr_ServerPasswordSet2", (PyObject *)(void *)&netr_ServerPasswordSet2_Type);
63674 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerPasswordGet_Type);
63675 2956 : PyModule_AddObject(m, "netr_ServerPasswordGet", (PyObject *)(void *)&netr_ServerPasswordGet_Type);
63676 2956 : Py_INCREF((PyObject *)(void *)&netr_NetrLogonSendToSam_Type);
63677 2956 : PyModule_AddObject(m, "netr_NetrLogonSendToSam", (PyObject *)(void *)&netr_NetrLogonSendToSam_Type);
63678 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRAddressToSitenamesW_Type);
63679 2956 : PyModule_AddObject(m, "netr_DsRAddressToSitenamesW", (PyObject *)(void *)&netr_DsRAddressToSitenamesW_Type);
63680 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRGetDCNameEx2_Type);
63681 2956 : PyModule_AddObject(m, "netr_DsRGetDCNameEx2", (PyObject *)(void *)&netr_DsRGetDCNameEx2_Type);
63682 2956 : Py_INCREF((PyObject *)(void *)&netr_NetrEnumerateTrustedDomainsEx_Type);
63683 2956 : PyModule_AddObject(m, "netr_NetrEnumerateTrustedDomainsEx", (PyObject *)(void *)&netr_NetrEnumerateTrustedDomainsEx_Type);
63684 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRAddressToSitenamesExW_Type);
63685 2956 : PyModule_AddObject(m, "netr_DsRAddressToSitenamesExW", (PyObject *)(void *)&netr_DsRAddressToSitenamesExW_Type);
63686 2956 : Py_INCREF((PyObject *)(void *)&netr_DsrGetDcSiteCoverageW_Type);
63687 2956 : PyModule_AddObject(m, "netr_DsrGetDcSiteCoverageW", (PyObject *)(void *)&netr_DsrGetDcSiteCoverageW_Type);
63688 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonSamLogonEx_Type);
63689 2956 : PyModule_AddObject(m, "netr_LogonSamLogonEx", (PyObject *)(void *)&netr_LogonSamLogonEx_Type);
63690 2956 : Py_INCREF((PyObject *)(void *)&netr_DsrEnumerateDomainTrusts_Type);
63691 2956 : PyModule_AddObject(m, "netr_DsrEnumerateDomainTrusts", (PyObject *)(void *)&netr_DsrEnumerateDomainTrusts_Type);
63692 2956 : Py_INCREF((PyObject *)(void *)&netr_DsrDeregisterDNSHostRecords_Type);
63693 2956 : PyModule_AddObject(m, "netr_DsrDeregisterDNSHostRecords", (PyObject *)(void *)&netr_DsrDeregisterDNSHostRecords_Type);
63694 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerTrustPasswordsGet_Type);
63695 2956 : PyModule_AddObject(m, "netr_ServerTrustPasswordsGet", (PyObject *)(void *)&netr_ServerTrustPasswordsGet_Type);
63696 2956 : Py_INCREF((PyObject *)(void *)&netr_DsRGetForestTrustInformation_Type);
63697 2956 : PyModule_AddObject(m, "netr_DsRGetForestTrustInformation", (PyObject *)(void *)&netr_DsRGetForestTrustInformation_Type);
63698 2956 : Py_INCREF((PyObject *)(void *)&netr_GetForestTrustInformation_Type);
63699 2956 : PyModule_AddObject(m, "netr_GetForestTrustInformation", (PyObject *)(void *)&netr_GetForestTrustInformation_Type);
63700 2956 : Py_INCREF((PyObject *)(void *)&netr_LogonSamLogonWithFlags_Type);
63701 2956 : PyModule_AddObject(m, "netr_LogonSamLogonWithFlags", (PyObject *)(void *)&netr_LogonSamLogonWithFlags_Type);
63702 2956 : Py_INCREF((PyObject *)(void *)&netr_ServerGetTrustInfo_Type);
63703 2956 : PyModule_AddObject(m, "netr_ServerGetTrustInfo", (PyObject *)(void *)&netr_ServerGetTrustInfo_Type);
63704 2956 : Py_INCREF((PyObject *)(void *)&netr_Unused47_Type);
63705 2956 : PyModule_AddObject(m, "netr_Unused47", (PyObject *)(void *)&netr_Unused47_Type);
63706 2956 : Py_INCREF((PyObject *)(void *)&netr_DsrUpdateReadOnlyServerDnsRecords_Type);
63707 2956 : PyModule_AddObject(m, "netr_DsrUpdateReadOnlyServerDnsRecords", (PyObject *)(void *)&netr_DsrUpdateReadOnlyServerDnsRecords_Type);
63708 2956 : Py_INCREF((PyObject *)(void *)&netlogon_InterfaceType);
63709 2956 : PyModule_AddObject(m, "netlogon", (PyObject *)(void *)&netlogon_InterfaceType);
63710 2956 : Py_INCREF((PyObject *)(void *)&netlogon_SyntaxType);
63711 2956 : PyModule_AddObject(m, "netlogon_abstract_syntax", (PyObject *)(void *)&netlogon_SyntaxType);
63712 2956 : Py_INCREF((PyObject *)(void *)&netlogon_SyntaxType);
63713 2956 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&netlogon_SyntaxType);
63714 : #ifdef PY_MOD_NETLOGON_PATCH
63715 : PY_MOD_NETLOGON_PATCH(m);
63716 : #endif
63717 2956 : out:
63718 2956 : Py_XDECREF(dep_samba_dcerpc_misc);
63719 2956 : Py_XDECREF(dep_samba_dcerpc_lsa);
63720 2956 : Py_XDECREF(dep_samba_dcerpc_samr);
63721 2956 : Py_XDECREF(dep_samba_dcerpc_security);
63722 2956 : Py_XDECREF(dep_talloc);
63723 2956 : Py_XDECREF(dep_samba_dcerpc_base);
63724 2956 : return m;
63725 :
63726 : }
|