Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include "lib/replace/system/python.h"
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_winbind.h"
12 : #include "bin/default/librpc/gen_ndr/ndr_winbind_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 5 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 5 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 5 : case 4:
38 5 : return UINT32_MAX;
39 0 : case 2:
40 0 : return UINT16_MAX;
41 0 : case 1:
42 0 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 : switch (var_size) {
51 : case 8:
52 : return INT64_MAX;
53 : case 4:
54 : return INT32_MAX;
55 : case 2:
56 : return INT16_MAX;
57 : case 1:
58 : return INT8_MAX;
59 : }
60 :
61 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/lsa.h"
65 : #include "librpc/gen_ndr/netlogon.h"
66 : #include "librpc/gen_ndr/samr.h"
67 : #include "librpc/gen_ndr/misc.h"
68 : #include "librpc/gen_ndr/security.h"
69 : #include "librpc/gen_ndr/idmap.h"
70 : static PyTypeObject wbint_TransID_Type;
71 : static PyTypeObject wbint_TransIDArray_Type;
72 : static PyTypeObject wbint_userinfo_Type;
73 : static PyTypeObject wbint_SidArray_Type;
74 : static PyTypeObject wbint_RidArray_Type;
75 : static PyTypeObject wbint_Principal_Type;
76 : static PyTypeObject wbint_Principals_Type;
77 : static PyTypeObject wbint_userinfos_Type;
78 : static PyTypeObject wbint_Validation_Type;
79 : static PyTypeObject wbint_AuthUserInfo_Type;
80 : static PyTypeObject wbint_PamAuthCrapValidation_Type;
81 : static PyTypeObject winbind_InterfaceType;
82 : static PyTypeObject wbint_Ping_Type;
83 : static PyTypeObject wbint_LookupSid_Type;
84 : static PyTypeObject wbint_LookupSids_Type;
85 : static PyTypeObject wbint_LookupName_Type;
86 : static PyTypeObject wbint_Sids2UnixIDs_Type;
87 : static PyTypeObject wbint_UnixIDs2Sids_Type;
88 : static PyTypeObject wbint_AllocateUid_Type;
89 : static PyTypeObject wbint_AllocateGid_Type;
90 : static PyTypeObject wbint_GetNssInfo_Type;
91 : static PyTypeObject wbint_LookupUserAliases_Type;
92 : static PyTypeObject wbint_LookupUserGroups_Type;
93 : static PyTypeObject wbint_QuerySequenceNumber_Type;
94 : static PyTypeObject wbint_LookupGroupMembers_Type;
95 : static PyTypeObject wbint_LookupAliasMembers_Type;
96 : static PyTypeObject wbint_QueryGroupList_Type;
97 : static PyTypeObject wbint_QueryUserRidList_Type;
98 : static PyTypeObject wbint_DsGetDcName_Type;
99 : static PyTypeObject wbint_LookupRids_Type;
100 : static PyTypeObject wbint_CheckMachineAccount_Type;
101 : static PyTypeObject wbint_ChangeMachineAccount_Type;
102 : static PyTypeObject wbint_PingDc_Type;
103 : static PyTypeObject wbint_ListTrustedDomains_Type;
104 : static PyTypeObject wbint_PamAuth_Type;
105 : static PyTypeObject wbint_PamAuthCrap_Type;
106 : static PyTypeObject wbint_PamLogOff_Type;
107 : static PyTypeObject wbint_PamAuthCrapChangePassword_Type;
108 : static PyTypeObject wbint_PamAuthChangePassword_Type;
109 : static PyTypeObject wbint_InitConnection_Type;
110 : static PyTypeObject winbind_SamLogon_Type;
111 : static PyTypeObject winbind_DsrUpdateReadOnlyServerDnsRecords_Type;
112 : static PyTypeObject winbind_LogonControl_Type;
113 : static PyTypeObject winbind_GetForestTrustInformation_Type;
114 : static PyTypeObject winbind_SendToSam_Type;
115 :
116 : static PyTypeObject *unixid_Type;
117 : static PyTypeObject *BaseObject_Type;
118 : static PyTypeObject *dom_sid_Type;
119 : static PyTypeObject *netr_Validation_Type;
120 : static PyTypeObject *lsa_SidArray_Type;
121 : static PyTypeObject *lsa_RefDomainList_Type;
122 : static PyTypeObject *lsa_TransNameArray_Type;
123 : static PyTypeObject *GUID_Type;
124 : static PyTypeObject *netr_DsRGetDCNameInfo_Type;
125 : static PyTypeObject *netr_DomainTrustList_Type;
126 : static PyTypeObject *samr_DomInfo1_Type;
127 : static PyTypeObject *netr_LogonLevel_Type;
128 : static PyTypeObject *NL_DNS_NAME_INFO_ARRAY_Type;
129 : static PyTypeObject *netr_CONTROL_DATA_INFORMATION_Type;
130 : static PyTypeObject *netr_CONTROL_QUERY_INFORMATION_Type;
131 : static PyTypeObject *lsa_ForestTrustInformation_Type;
132 : static PyTypeObject *netr_SendToSamBase_Type;
133 : static PyTypeObject *ClientConnection_Type;
134 : static PyTypeObject *ndr_syntax_id_Type;
135 :
136 0 : static PyObject *py_wbint_TransID_get_type_hint(PyObject *obj, void *closure)
137 : {
138 0 : struct wbint_TransID *object = pytalloc_get_ptr(obj);
139 0 : PyObject *py_type_hint;
140 0 : py_type_hint = PyLong_FromLong((uint16_t)(object->type_hint));
141 0 : return py_type_hint;
142 : }
143 :
144 0 : static int py_wbint_TransID_set_type_hint(PyObject *py_obj, PyObject *value, void *closure)
145 : {
146 0 : struct wbint_TransID *object = pytalloc_get_ptr(py_obj);
147 0 : if (value == NULL) {
148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type_hint");
149 0 : return -1;
150 : }
151 : {
152 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type_hint));
153 0 : if (PyLong_Check(value)) {
154 0 : unsigned long long test_var;
155 0 : test_var = PyLong_AsUnsignedLongLong(value);
156 0 : if (PyErr_Occurred() != NULL) {
157 0 : return -1;
158 : }
159 0 : if (test_var > uint_max) {
160 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
161 : PyLong_Type.tp_name, uint_max, test_var);
162 0 : return -1;
163 : }
164 0 : object->type_hint = test_var;
165 : } else {
166 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
167 : PyLong_Type.tp_name);
168 0 : return -1;
169 : }
170 : }
171 0 : return 0;
172 : }
173 :
174 0 : static PyObject *py_wbint_TransID_get_domain_index(PyObject *obj, void *closure)
175 : {
176 0 : struct wbint_TransID *object = pytalloc_get_ptr(obj);
177 0 : PyObject *py_domain_index;
178 0 : py_domain_index = PyLong_FromUnsignedLongLong((uint32_t)(object->domain_index));
179 0 : return py_domain_index;
180 : }
181 :
182 0 : static int py_wbint_TransID_set_domain_index(PyObject *py_obj, PyObject *value, void *closure)
183 : {
184 0 : struct wbint_TransID *object = pytalloc_get_ptr(py_obj);
185 0 : if (value == NULL) {
186 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_index");
187 0 : return -1;
188 : }
189 : {
190 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_index));
191 0 : if (PyLong_Check(value)) {
192 0 : unsigned long long test_var;
193 0 : test_var = PyLong_AsUnsignedLongLong(value);
194 0 : if (PyErr_Occurred() != NULL) {
195 0 : return -1;
196 : }
197 0 : if (test_var > uint_max) {
198 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
199 : PyLong_Type.tp_name, uint_max, test_var);
200 0 : return -1;
201 : }
202 0 : object->domain_index = test_var;
203 : } else {
204 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
205 : PyLong_Type.tp_name);
206 0 : return -1;
207 : }
208 : }
209 0 : return 0;
210 : }
211 :
212 0 : static PyObject *py_wbint_TransID_get_rid(PyObject *obj, void *closure)
213 : {
214 0 : struct wbint_TransID *object = pytalloc_get_ptr(obj);
215 0 : PyObject *py_rid;
216 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)(object->rid));
217 0 : return py_rid;
218 : }
219 :
220 0 : static int py_wbint_TransID_set_rid(PyObject *py_obj, PyObject *value, void *closure)
221 : {
222 0 : struct wbint_TransID *object = pytalloc_get_ptr(py_obj);
223 0 : if (value == NULL) {
224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rid");
225 0 : return -1;
226 : }
227 : {
228 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
229 0 : if (PyLong_Check(value)) {
230 0 : unsigned long long test_var;
231 0 : test_var = PyLong_AsUnsignedLongLong(value);
232 0 : if (PyErr_Occurred() != NULL) {
233 0 : return -1;
234 : }
235 0 : if (test_var > uint_max) {
236 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
237 : PyLong_Type.tp_name, uint_max, test_var);
238 0 : return -1;
239 : }
240 0 : object->rid = test_var;
241 : } else {
242 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
243 : PyLong_Type.tp_name);
244 0 : return -1;
245 : }
246 : }
247 0 : return 0;
248 : }
249 :
250 0 : static PyObject *py_wbint_TransID_get_xid(PyObject *obj, void *closure)
251 : {
252 0 : struct wbint_TransID *object = pytalloc_get_ptr(obj);
253 0 : PyObject *py_xid;
254 0 : py_xid = pytalloc_reference_ex(unixid_Type, pytalloc_get_mem_ctx(obj), &object->xid);
255 0 : return py_xid;
256 : }
257 :
258 0 : static int py_wbint_TransID_set_xid(PyObject *py_obj, PyObject *value, void *closure)
259 : {
260 0 : struct wbint_TransID *object = pytalloc_get_ptr(py_obj);
261 0 : if (value == NULL) {
262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->xid");
263 0 : return -1;
264 : }
265 0 : PY_CHECK_TYPE(unixid_Type, value, return -1;);
266 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
267 0 : PyErr_NoMemory();
268 0 : return -1;
269 : }
270 0 : object->xid = *(struct unixid *)pytalloc_get_ptr(value);
271 0 : return 0;
272 : }
273 :
274 : static PyGetSetDef py_wbint_TransID_getsetters[] = {
275 : {
276 : .name = discard_const_p(char, "type_hint"),
277 : .get = py_wbint_TransID_get_type_hint,
278 : .set = py_wbint_TransID_set_type_hint,
279 : .doc = discard_const_p(char, "PIDL-generated element of base type id_type")
280 : },
281 : {
282 : .name = discard_const_p(char, "domain_index"),
283 : .get = py_wbint_TransID_get_domain_index,
284 : .set = py_wbint_TransID_set_domain_index,
285 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
286 : },
287 : {
288 : .name = discard_const_p(char, "rid"),
289 : .get = py_wbint_TransID_get_rid,
290 : .set = py_wbint_TransID_set_rid,
291 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
292 : },
293 : {
294 : .name = discard_const_p(char, "xid"),
295 : .get = py_wbint_TransID_get_xid,
296 : .set = py_wbint_TransID_set_xid,
297 : .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
298 : },
299 : { .name = NULL }
300 : };
301 :
302 0 : static PyObject *py_wbint_TransID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
303 : {
304 0 : return pytalloc_new(struct wbint_TransID, type);
305 : }
306 :
307 :
308 : static PyTypeObject wbint_TransID_Type = {
309 : PyVarObject_HEAD_INIT(NULL, 0)
310 : .tp_name = "winbind.wbint_TransID",
311 : .tp_getset = py_wbint_TransID_getsetters,
312 : .tp_methods = NULL,
313 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
314 : .tp_new = py_wbint_TransID_new,
315 : };
316 :
317 :
318 0 : static PyObject *py_wbint_TransIDArray_get_num_ids(PyObject *obj, void *closure)
319 : {
320 0 : struct wbint_TransIDArray *object = pytalloc_get_ptr(obj);
321 0 : PyObject *py_num_ids;
322 0 : py_num_ids = PyLong_FromUnsignedLongLong((uint32_t)(object->num_ids));
323 0 : return py_num_ids;
324 : }
325 :
326 0 : static int py_wbint_TransIDArray_set_num_ids(PyObject *py_obj, PyObject *value, void *closure)
327 : {
328 0 : struct wbint_TransIDArray *object = pytalloc_get_ptr(py_obj);
329 0 : if (value == NULL) {
330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_ids");
331 0 : return -1;
332 : }
333 : {
334 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_ids));
335 0 : if (PyLong_Check(value)) {
336 0 : unsigned long long test_var;
337 0 : test_var = PyLong_AsUnsignedLongLong(value);
338 0 : if (PyErr_Occurred() != NULL) {
339 0 : return -1;
340 : }
341 0 : if (test_var > uint_max) {
342 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
343 : PyLong_Type.tp_name, uint_max, test_var);
344 0 : return -1;
345 : }
346 0 : object->num_ids = test_var;
347 : } else {
348 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
349 : PyLong_Type.tp_name);
350 0 : return -1;
351 : }
352 : }
353 0 : return 0;
354 : }
355 :
356 0 : static PyObject *py_wbint_TransIDArray_get_ids(PyObject *obj, void *closure)
357 : {
358 0 : struct wbint_TransIDArray *object = pytalloc_get_ptr(obj);
359 0 : PyObject *py_ids;
360 0 : py_ids = PyList_New(object->num_ids);
361 0 : if (py_ids == NULL) {
362 0 : return NULL;
363 : }
364 : {
365 : int ids_cntr_0;
366 0 : for (ids_cntr_0 = 0; ids_cntr_0 < (object->num_ids); ids_cntr_0++) {
367 0 : PyObject *py_ids_0;
368 0 : py_ids_0 = pytalloc_reference_ex(&wbint_TransID_Type, object->ids, &(object->ids)[ids_cntr_0]);
369 0 : PyList_SetItem(py_ids, ids_cntr_0, py_ids_0);
370 : }
371 : }
372 0 : return py_ids;
373 : }
374 :
375 0 : static int py_wbint_TransIDArray_set_ids(PyObject *py_obj, PyObject *value, void *closure)
376 : {
377 0 : struct wbint_TransIDArray *object = pytalloc_get_ptr(py_obj);
378 0 : if (value == NULL) {
379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ids");
380 0 : return -1;
381 : }
382 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
383 : {
384 0 : int ids_cntr_0;
385 0 : object->ids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ids, PyList_GET_SIZE(value));
386 0 : if (!object->ids) { return -1; }
387 0 : talloc_set_name_const(object->ids, "ARRAY: object->ids");
388 0 : for (ids_cntr_0 = 0; ids_cntr_0 < PyList_GET_SIZE(value); ids_cntr_0++) {
389 0 : if (PyList_GET_ITEM(value, ids_cntr_0) == NULL) {
390 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->ids)[ids_cntr_0]");
391 0 : return -1;
392 : }
393 0 : PY_CHECK_TYPE(&wbint_TransID_Type, PyList_GET_ITEM(value, ids_cntr_0), return -1;);
394 0 : if (talloc_reference(object->ids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ids_cntr_0))) == NULL) {
395 0 : PyErr_NoMemory();
396 0 : return -1;
397 : }
398 0 : (object->ids)[ids_cntr_0] = *(struct wbint_TransID *)pytalloc_get_ptr(PyList_GET_ITEM(value, ids_cntr_0));
399 : }
400 : }
401 0 : return 0;
402 : }
403 :
404 : static PyGetSetDef py_wbint_TransIDArray_getsetters[] = {
405 : {
406 : .name = discard_const_p(char, "num_ids"),
407 : .get = py_wbint_TransIDArray_get_num_ids,
408 : .set = py_wbint_TransIDArray_set_num_ids,
409 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
410 : },
411 : {
412 : .name = discard_const_p(char, "ids"),
413 : .get = py_wbint_TransIDArray_get_ids,
414 : .set = py_wbint_TransIDArray_set_ids,
415 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransID")
416 : },
417 : { .name = NULL }
418 : };
419 :
420 0 : static PyObject *py_wbint_TransIDArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
421 : {
422 0 : return pytalloc_new(struct wbint_TransIDArray, type);
423 : }
424 :
425 :
426 : static PyTypeObject wbint_TransIDArray_Type = {
427 : PyVarObject_HEAD_INIT(NULL, 0)
428 : .tp_name = "winbind.wbint_TransIDArray",
429 : .tp_getset = py_wbint_TransIDArray_getsetters,
430 : .tp_methods = NULL,
431 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
432 : .tp_new = py_wbint_TransIDArray_new,
433 : };
434 :
435 :
436 0 : static PyObject *py_wbint_userinfo_get_domain_name(PyObject *obj, void *closure)
437 : {
438 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
439 0 : PyObject *py_domain_name;
440 0 : if (object->domain_name == NULL) {
441 0 : Py_RETURN_NONE;
442 : }
443 0 : if (object->domain_name == NULL) {
444 0 : py_domain_name = Py_None;
445 0 : Py_INCREF(py_domain_name);
446 : } else {
447 0 : if (object->domain_name == NULL) {
448 0 : py_domain_name = Py_None;
449 0 : Py_INCREF(py_domain_name);
450 : } else {
451 0 : py_domain_name = PyUnicode_Decode(object->domain_name, strlen(object->domain_name), "utf-8", "ignore");
452 : }
453 : }
454 0 : return py_domain_name;
455 : }
456 :
457 0 : static int py_wbint_userinfo_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
458 : {
459 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
460 0 : if (value == NULL) {
461 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_name");
462 0 : return -1;
463 : }
464 0 : if (value == Py_None) {
465 0 : object->domain_name = NULL;
466 : } else {
467 0 : object->domain_name = NULL;
468 : {
469 0 : const char *test_str;
470 0 : const char *talloc_str;
471 0 : PyObject *unicode = NULL;
472 0 : if (PyUnicode_Check(value)) {
473 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
474 0 : if (unicode == NULL) {
475 0 : return -1;
476 : }
477 0 : test_str = PyBytes_AS_STRING(unicode);
478 0 : } else if (PyBytes_Check(value)) {
479 0 : test_str = PyBytes_AS_STRING(value);
480 : } else {
481 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
482 0 : return -1;
483 : }
484 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
485 0 : if (unicode != NULL) {
486 0 : Py_DECREF(unicode);
487 : }
488 0 : if (talloc_str == NULL) {
489 0 : PyErr_NoMemory();
490 0 : return -1;
491 : }
492 0 : object->domain_name = talloc_str;
493 : }
494 : }
495 0 : return 0;
496 : }
497 :
498 0 : static PyObject *py_wbint_userinfo_get_acct_name(PyObject *obj, void *closure)
499 : {
500 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
501 0 : PyObject *py_acct_name;
502 0 : if (object->acct_name == NULL) {
503 0 : Py_RETURN_NONE;
504 : }
505 0 : if (object->acct_name == NULL) {
506 0 : py_acct_name = Py_None;
507 0 : Py_INCREF(py_acct_name);
508 : } else {
509 0 : if (object->acct_name == NULL) {
510 0 : py_acct_name = Py_None;
511 0 : Py_INCREF(py_acct_name);
512 : } else {
513 0 : py_acct_name = PyUnicode_Decode(object->acct_name, strlen(object->acct_name), "utf-8", "ignore");
514 : }
515 : }
516 0 : return py_acct_name;
517 : }
518 :
519 0 : static int py_wbint_userinfo_set_acct_name(PyObject *py_obj, PyObject *value, void *closure)
520 : {
521 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
522 0 : if (value == NULL) {
523 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->acct_name");
524 0 : return -1;
525 : }
526 0 : if (value == Py_None) {
527 0 : object->acct_name = NULL;
528 : } else {
529 0 : object->acct_name = NULL;
530 : {
531 0 : const char *test_str;
532 0 : const char *talloc_str;
533 0 : PyObject *unicode = NULL;
534 0 : if (PyUnicode_Check(value)) {
535 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
536 0 : if (unicode == NULL) {
537 0 : return -1;
538 : }
539 0 : test_str = PyBytes_AS_STRING(unicode);
540 0 : } else if (PyBytes_Check(value)) {
541 0 : test_str = PyBytes_AS_STRING(value);
542 : } else {
543 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
544 0 : return -1;
545 : }
546 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
547 0 : if (unicode != NULL) {
548 0 : Py_DECREF(unicode);
549 : }
550 0 : if (talloc_str == NULL) {
551 0 : PyErr_NoMemory();
552 0 : return -1;
553 : }
554 0 : object->acct_name = talloc_str;
555 : }
556 : }
557 0 : return 0;
558 : }
559 :
560 0 : static PyObject *py_wbint_userinfo_get_full_name(PyObject *obj, void *closure)
561 : {
562 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
563 0 : PyObject *py_full_name;
564 0 : if (object->full_name == NULL) {
565 0 : Py_RETURN_NONE;
566 : }
567 0 : if (object->full_name == NULL) {
568 0 : py_full_name = Py_None;
569 0 : Py_INCREF(py_full_name);
570 : } else {
571 0 : if (object->full_name == NULL) {
572 0 : py_full_name = Py_None;
573 0 : Py_INCREF(py_full_name);
574 : } else {
575 0 : py_full_name = PyUnicode_Decode(object->full_name, strlen(object->full_name), "utf-8", "ignore");
576 : }
577 : }
578 0 : return py_full_name;
579 : }
580 :
581 0 : static int py_wbint_userinfo_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
582 : {
583 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
584 0 : if (value == NULL) {
585 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->full_name");
586 0 : return -1;
587 : }
588 0 : if (value == Py_None) {
589 0 : object->full_name = NULL;
590 : } else {
591 0 : object->full_name = NULL;
592 : {
593 0 : const char *test_str;
594 0 : const char *talloc_str;
595 0 : PyObject *unicode = NULL;
596 0 : if (PyUnicode_Check(value)) {
597 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
598 0 : if (unicode == NULL) {
599 0 : return -1;
600 : }
601 0 : test_str = PyBytes_AS_STRING(unicode);
602 0 : } else if (PyBytes_Check(value)) {
603 0 : test_str = PyBytes_AS_STRING(value);
604 : } else {
605 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
606 0 : return -1;
607 : }
608 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
609 0 : if (unicode != NULL) {
610 0 : Py_DECREF(unicode);
611 : }
612 0 : if (talloc_str == NULL) {
613 0 : PyErr_NoMemory();
614 0 : return -1;
615 : }
616 0 : object->full_name = talloc_str;
617 : }
618 : }
619 0 : return 0;
620 : }
621 :
622 0 : static PyObject *py_wbint_userinfo_get_homedir(PyObject *obj, void *closure)
623 : {
624 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
625 0 : PyObject *py_homedir;
626 0 : if (object->homedir == NULL) {
627 0 : Py_RETURN_NONE;
628 : }
629 0 : if (object->homedir == NULL) {
630 0 : py_homedir = Py_None;
631 0 : Py_INCREF(py_homedir);
632 : } else {
633 0 : if (object->homedir == NULL) {
634 0 : py_homedir = Py_None;
635 0 : Py_INCREF(py_homedir);
636 : } else {
637 0 : py_homedir = PyUnicode_Decode(object->homedir, strlen(object->homedir), "utf-8", "ignore");
638 : }
639 : }
640 0 : return py_homedir;
641 : }
642 :
643 0 : static int py_wbint_userinfo_set_homedir(PyObject *py_obj, PyObject *value, void *closure)
644 : {
645 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
646 0 : if (value == NULL) {
647 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->homedir");
648 0 : return -1;
649 : }
650 0 : if (value == Py_None) {
651 0 : object->homedir = NULL;
652 : } else {
653 0 : object->homedir = NULL;
654 : {
655 0 : const char *test_str;
656 0 : const char *talloc_str;
657 0 : PyObject *unicode = NULL;
658 0 : if (PyUnicode_Check(value)) {
659 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
660 0 : if (unicode == NULL) {
661 0 : return -1;
662 : }
663 0 : test_str = PyBytes_AS_STRING(unicode);
664 0 : } else if (PyBytes_Check(value)) {
665 0 : test_str = PyBytes_AS_STRING(value);
666 : } else {
667 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
668 0 : return -1;
669 : }
670 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
671 0 : if (unicode != NULL) {
672 0 : Py_DECREF(unicode);
673 : }
674 0 : if (talloc_str == NULL) {
675 0 : PyErr_NoMemory();
676 0 : return -1;
677 : }
678 0 : object->homedir = talloc_str;
679 : }
680 : }
681 0 : return 0;
682 : }
683 :
684 0 : static PyObject *py_wbint_userinfo_get_shell(PyObject *obj, void *closure)
685 : {
686 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
687 0 : PyObject *py_shell;
688 0 : if (object->shell == NULL) {
689 0 : Py_RETURN_NONE;
690 : }
691 0 : if (object->shell == NULL) {
692 0 : py_shell = Py_None;
693 0 : Py_INCREF(py_shell);
694 : } else {
695 0 : if (object->shell == NULL) {
696 0 : py_shell = Py_None;
697 0 : Py_INCREF(py_shell);
698 : } else {
699 0 : py_shell = PyUnicode_Decode(object->shell, strlen(object->shell), "utf-8", "ignore");
700 : }
701 : }
702 0 : return py_shell;
703 : }
704 :
705 0 : static int py_wbint_userinfo_set_shell(PyObject *py_obj, PyObject *value, void *closure)
706 : {
707 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
708 0 : if (value == NULL) {
709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->shell");
710 0 : return -1;
711 : }
712 0 : if (value == Py_None) {
713 0 : object->shell = NULL;
714 : } else {
715 0 : object->shell = NULL;
716 : {
717 0 : const char *test_str;
718 0 : const char *talloc_str;
719 0 : PyObject *unicode = NULL;
720 0 : if (PyUnicode_Check(value)) {
721 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
722 0 : if (unicode == NULL) {
723 0 : return -1;
724 : }
725 0 : test_str = PyBytes_AS_STRING(unicode);
726 0 : } else if (PyBytes_Check(value)) {
727 0 : test_str = PyBytes_AS_STRING(value);
728 : } else {
729 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
730 0 : return -1;
731 : }
732 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
733 0 : if (unicode != NULL) {
734 0 : Py_DECREF(unicode);
735 : }
736 0 : if (talloc_str == NULL) {
737 0 : PyErr_NoMemory();
738 0 : return -1;
739 : }
740 0 : object->shell = talloc_str;
741 : }
742 : }
743 0 : return 0;
744 : }
745 :
746 0 : static PyObject *py_wbint_userinfo_get_uid(PyObject *obj, void *closure)
747 : {
748 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
749 0 : PyObject *py_uid;
750 0 : py_uid = PyLong_FromUnsignedLongLong(object->uid);
751 0 : return py_uid;
752 : }
753 :
754 0 : static int py_wbint_userinfo_set_uid(PyObject *py_obj, PyObject *value, void *closure)
755 : {
756 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
757 0 : if (value == NULL) {
758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->uid");
759 0 : return -1;
760 : }
761 : {
762 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid));
763 0 : if (PyLong_Check(value)) {
764 0 : unsigned long long test_var;
765 0 : test_var = PyLong_AsUnsignedLongLong(value);
766 0 : if (PyErr_Occurred() != NULL) {
767 0 : return -1;
768 : }
769 0 : if (test_var > uint_max) {
770 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
771 : PyLong_Type.tp_name, uint_max, test_var);
772 0 : return -1;
773 : }
774 0 : object->uid = test_var;
775 : } else {
776 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
777 : PyLong_Type.tp_name);
778 0 : return -1;
779 : }
780 : }
781 0 : return 0;
782 : }
783 :
784 0 : static PyObject *py_wbint_userinfo_get_primary_gid(PyObject *obj, void *closure)
785 : {
786 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
787 0 : PyObject *py_primary_gid;
788 0 : py_primary_gid = PyLong_FromUnsignedLongLong(object->primary_gid);
789 0 : return py_primary_gid;
790 : }
791 :
792 0 : static int py_wbint_userinfo_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
793 : {
794 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
795 0 : if (value == NULL) {
796 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->primary_gid");
797 0 : return -1;
798 : }
799 : {
800 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
801 0 : if (PyLong_Check(value)) {
802 0 : unsigned long long test_var;
803 0 : test_var = PyLong_AsUnsignedLongLong(value);
804 0 : if (PyErr_Occurred() != NULL) {
805 0 : return -1;
806 : }
807 0 : if (test_var > uint_max) {
808 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
809 : PyLong_Type.tp_name, uint_max, test_var);
810 0 : return -1;
811 : }
812 0 : object->primary_gid = test_var;
813 : } else {
814 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
815 : PyLong_Type.tp_name);
816 0 : return -1;
817 : }
818 : }
819 0 : return 0;
820 : }
821 :
822 0 : static PyObject *py_wbint_userinfo_get_primary_group_name(PyObject *obj, void *closure)
823 : {
824 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
825 0 : PyObject *py_primary_group_name;
826 0 : if (object->primary_group_name == NULL) {
827 0 : Py_RETURN_NONE;
828 : }
829 0 : if (object->primary_group_name == NULL) {
830 0 : py_primary_group_name = Py_None;
831 0 : Py_INCREF(py_primary_group_name);
832 : } else {
833 0 : if (object->primary_group_name == NULL) {
834 0 : py_primary_group_name = Py_None;
835 0 : Py_INCREF(py_primary_group_name);
836 : } else {
837 0 : py_primary_group_name = PyUnicode_Decode(object->primary_group_name, strlen(object->primary_group_name), "utf-8", "ignore");
838 : }
839 : }
840 0 : return py_primary_group_name;
841 : }
842 :
843 0 : static int py_wbint_userinfo_set_primary_group_name(PyObject *py_obj, PyObject *value, void *closure)
844 : {
845 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
846 0 : if (value == NULL) {
847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->primary_group_name");
848 0 : return -1;
849 : }
850 0 : if (value == Py_None) {
851 0 : object->primary_group_name = NULL;
852 : } else {
853 0 : object->primary_group_name = NULL;
854 : {
855 0 : const char *test_str;
856 0 : const char *talloc_str;
857 0 : PyObject *unicode = NULL;
858 0 : if (PyUnicode_Check(value)) {
859 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
860 0 : if (unicode == NULL) {
861 0 : return -1;
862 : }
863 0 : test_str = PyBytes_AS_STRING(unicode);
864 0 : } else if (PyBytes_Check(value)) {
865 0 : test_str = PyBytes_AS_STRING(value);
866 : } else {
867 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
868 0 : return -1;
869 : }
870 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
871 0 : if (unicode != NULL) {
872 0 : Py_DECREF(unicode);
873 : }
874 0 : if (talloc_str == NULL) {
875 0 : PyErr_NoMemory();
876 0 : return -1;
877 : }
878 0 : object->primary_group_name = talloc_str;
879 : }
880 : }
881 0 : return 0;
882 : }
883 :
884 0 : static PyObject *py_wbint_userinfo_get_user_sid(PyObject *obj, void *closure)
885 : {
886 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
887 0 : PyObject *py_user_sid;
888 0 : py_user_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->user_sid);
889 0 : return py_user_sid;
890 : }
891 :
892 0 : static int py_wbint_userinfo_set_user_sid(PyObject *py_obj, PyObject *value, void *closure)
893 : {
894 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
895 0 : if (value == NULL) {
896 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_sid");
897 0 : return -1;
898 : }
899 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
900 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
901 0 : PyErr_NoMemory();
902 0 : return -1;
903 : }
904 0 : object->user_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
905 0 : return 0;
906 : }
907 :
908 0 : static PyObject *py_wbint_userinfo_get_group_sid(PyObject *obj, void *closure)
909 : {
910 0 : struct wbint_userinfo *object = pytalloc_get_ptr(obj);
911 0 : PyObject *py_group_sid;
912 0 : py_group_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->group_sid);
913 0 : return py_group_sid;
914 : }
915 :
916 0 : static int py_wbint_userinfo_set_group_sid(PyObject *py_obj, PyObject *value, void *closure)
917 : {
918 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
919 0 : if (value == NULL) {
920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->group_sid");
921 0 : return -1;
922 : }
923 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
924 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
925 0 : PyErr_NoMemory();
926 0 : return -1;
927 : }
928 0 : object->group_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
929 0 : return 0;
930 : }
931 :
932 : static PyGetSetDef py_wbint_userinfo_getsetters[] = {
933 : {
934 : .name = discard_const_p(char, "domain_name"),
935 : .get = py_wbint_userinfo_get_domain_name,
936 : .set = py_wbint_userinfo_set_domain_name,
937 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
938 : },
939 : {
940 : .name = discard_const_p(char, "acct_name"),
941 : .get = py_wbint_userinfo_get_acct_name,
942 : .set = py_wbint_userinfo_set_acct_name,
943 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
944 : },
945 : {
946 : .name = discard_const_p(char, "full_name"),
947 : .get = py_wbint_userinfo_get_full_name,
948 : .set = py_wbint_userinfo_set_full_name,
949 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
950 : },
951 : {
952 : .name = discard_const_p(char, "homedir"),
953 : .get = py_wbint_userinfo_get_homedir,
954 : .set = py_wbint_userinfo_set_homedir,
955 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
956 : },
957 : {
958 : .name = discard_const_p(char, "shell"),
959 : .get = py_wbint_userinfo_get_shell,
960 : .set = py_wbint_userinfo_set_shell,
961 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
962 : },
963 : {
964 : .name = discard_const_p(char, "uid"),
965 : .get = py_wbint_userinfo_get_uid,
966 : .set = py_wbint_userinfo_set_uid,
967 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
968 : },
969 : {
970 : .name = discard_const_p(char, "primary_gid"),
971 : .get = py_wbint_userinfo_get_primary_gid,
972 : .set = py_wbint_userinfo_set_primary_gid,
973 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
974 : },
975 : {
976 : .name = discard_const_p(char, "primary_group_name"),
977 : .get = py_wbint_userinfo_get_primary_group_name,
978 : .set = py_wbint_userinfo_set_primary_group_name,
979 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
980 : },
981 : {
982 : .name = discard_const_p(char, "user_sid"),
983 : .get = py_wbint_userinfo_get_user_sid,
984 : .set = py_wbint_userinfo_set_user_sid,
985 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
986 : },
987 : {
988 : .name = discard_const_p(char, "group_sid"),
989 : .get = py_wbint_userinfo_get_group_sid,
990 : .set = py_wbint_userinfo_set_group_sid,
991 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
992 : },
993 : { .name = NULL }
994 : };
995 :
996 0 : static PyObject *py_wbint_userinfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
997 : {
998 0 : return pytalloc_new(struct wbint_userinfo, type);
999 : }
1000 :
1001 0 : static PyObject *py_wbint_userinfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1002 : {
1003 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
1004 0 : PyObject *ret = NULL;
1005 0 : DATA_BLOB blob;
1006 0 : enum ndr_err_code err;
1007 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1008 0 : if (tmp_ctx == NULL) {
1009 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1010 0 : return NULL;
1011 : }
1012 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_userinfo);
1013 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1014 0 : TALLOC_FREE(tmp_ctx);
1015 0 : PyErr_SetNdrError(err);
1016 0 : return NULL;
1017 : }
1018 :
1019 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1020 0 : TALLOC_FREE(tmp_ctx);
1021 0 : return ret;
1022 : }
1023 :
1024 0 : static PyObject *py_wbint_userinfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1025 : {
1026 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
1027 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1028 0 : Py_ssize_t blob_length = 0;
1029 0 : enum ndr_err_code err;
1030 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1031 0 : PyObject *allow_remaining_obj = NULL;
1032 0 : bool allow_remaining = false;
1033 :
1034 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1035 : discard_const_p(char *, kwnames),
1036 : &blob.data, &blob_length,
1037 : &allow_remaining_obj)) {
1038 0 : return NULL;
1039 : }
1040 0 : blob.length = blob_length;
1041 :
1042 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1043 0 : allow_remaining = true;
1044 : }
1045 :
1046 0 : if (allow_remaining) {
1047 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfo);
1048 : } else {
1049 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfo);
1050 : }
1051 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1052 0 : PyErr_SetNdrError(err);
1053 0 : return NULL;
1054 : }
1055 :
1056 0 : Py_RETURN_NONE;
1057 : }
1058 :
1059 0 : static PyObject *py_wbint_userinfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1060 : {
1061 0 : struct wbint_userinfo *object = pytalloc_get_ptr(py_obj);
1062 0 : PyObject *ret;
1063 0 : char *retstr;
1064 :
1065 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_userinfo, "wbint_userinfo", object);
1066 0 : ret = PyUnicode_FromString(retstr);
1067 0 : talloc_free(retstr);
1068 :
1069 0 : return ret;
1070 : }
1071 :
1072 : static PyMethodDef py_wbint_userinfo_methods[] = {
1073 : { "__ndr_pack__", (PyCFunction)py_wbint_userinfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1074 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_userinfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1075 : { "__ndr_print__", (PyCFunction)py_wbint_userinfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1076 : { NULL, NULL, 0, NULL }
1077 : };
1078 :
1079 :
1080 : static PyTypeObject wbint_userinfo_Type = {
1081 : PyVarObject_HEAD_INIT(NULL, 0)
1082 : .tp_name = "winbind.wbint_userinfo",
1083 : .tp_getset = py_wbint_userinfo_getsetters,
1084 : .tp_methods = py_wbint_userinfo_methods,
1085 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1086 : .tp_new = py_wbint_userinfo_new,
1087 : };
1088 :
1089 :
1090 0 : static PyObject *py_wbint_SidArray_get_num_sids(PyObject *obj, void *closure)
1091 : {
1092 0 : struct wbint_SidArray *object = pytalloc_get_ptr(obj);
1093 0 : PyObject *py_num_sids;
1094 0 : py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)(object->num_sids));
1095 0 : return py_num_sids;
1096 : }
1097 :
1098 0 : static int py_wbint_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
1099 : {
1100 0 : struct wbint_SidArray *object = pytalloc_get_ptr(py_obj);
1101 0 : if (value == NULL) {
1102 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_sids");
1103 0 : return -1;
1104 : }
1105 : {
1106 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
1107 0 : if (PyLong_Check(value)) {
1108 0 : unsigned long long test_var;
1109 0 : test_var = PyLong_AsUnsignedLongLong(value);
1110 0 : if (PyErr_Occurred() != NULL) {
1111 0 : return -1;
1112 : }
1113 0 : if (test_var > uint_max) {
1114 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1115 : PyLong_Type.tp_name, uint_max, test_var);
1116 0 : return -1;
1117 : }
1118 0 : object->num_sids = test_var;
1119 : } else {
1120 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1121 : PyLong_Type.tp_name);
1122 0 : return -1;
1123 : }
1124 : }
1125 0 : return 0;
1126 : }
1127 :
1128 0 : static PyObject *py_wbint_SidArray_get_sids(PyObject *obj, void *closure)
1129 : {
1130 0 : struct wbint_SidArray *object = pytalloc_get_ptr(obj);
1131 0 : PyObject *py_sids;
1132 0 : py_sids = PyList_New(object->num_sids);
1133 0 : if (py_sids == NULL) {
1134 0 : return NULL;
1135 : }
1136 : {
1137 : int sids_cntr_0;
1138 0 : for (sids_cntr_0 = 0; sids_cntr_0 < (object->num_sids); sids_cntr_0++) {
1139 0 : PyObject *py_sids_0;
1140 0 : py_sids_0 = pytalloc_reference_ex(dom_sid_Type, object->sids, &(object->sids)[sids_cntr_0]);
1141 0 : PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
1142 : }
1143 : }
1144 0 : return py_sids;
1145 : }
1146 :
1147 0 : static int py_wbint_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
1148 : {
1149 0 : struct wbint_SidArray *object = pytalloc_get_ptr(py_obj);
1150 0 : if (value == NULL) {
1151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sids");
1152 0 : return -1;
1153 : }
1154 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1155 : {
1156 0 : int sids_cntr_0;
1157 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
1158 0 : if (!object->sids) { return -1; }
1159 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
1160 0 : for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
1161 0 : if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
1162 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->sids)[sids_cntr_0]");
1163 0 : return -1;
1164 : }
1165 0 : PY_CHECK_TYPE(dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
1166 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
1167 0 : PyErr_NoMemory();
1168 0 : return -1;
1169 : }
1170 0 : (object->sids)[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
1171 : }
1172 : }
1173 0 : return 0;
1174 : }
1175 :
1176 : static PyGetSetDef py_wbint_SidArray_getsetters[] = {
1177 : {
1178 : .name = discard_const_p(char, "num_sids"),
1179 : .get = py_wbint_SidArray_get_num_sids,
1180 : .set = py_wbint_SidArray_set_num_sids,
1181 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1182 : },
1183 : {
1184 : .name = discard_const_p(char, "sids"),
1185 : .get = py_wbint_SidArray_get_sids,
1186 : .set = py_wbint_SidArray_set_sids,
1187 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
1188 : },
1189 : { .name = NULL }
1190 : };
1191 :
1192 0 : static PyObject *py_wbint_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1193 : {
1194 0 : return pytalloc_new(struct wbint_SidArray, type);
1195 : }
1196 :
1197 0 : static PyObject *py_wbint_SidArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1198 : {
1199 0 : struct wbint_SidArray *object = pytalloc_get_ptr(py_obj);
1200 0 : PyObject *ret = NULL;
1201 0 : DATA_BLOB blob;
1202 0 : enum ndr_err_code err;
1203 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1204 0 : if (tmp_ctx == NULL) {
1205 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1206 0 : return NULL;
1207 : }
1208 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_SidArray);
1209 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1210 0 : TALLOC_FREE(tmp_ctx);
1211 0 : PyErr_SetNdrError(err);
1212 0 : return NULL;
1213 : }
1214 :
1215 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1216 0 : TALLOC_FREE(tmp_ctx);
1217 0 : return ret;
1218 : }
1219 :
1220 0 : static PyObject *py_wbint_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1221 : {
1222 0 : struct wbint_SidArray *object = pytalloc_get_ptr(py_obj);
1223 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1224 0 : Py_ssize_t blob_length = 0;
1225 0 : enum ndr_err_code err;
1226 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1227 0 : PyObject *allow_remaining_obj = NULL;
1228 0 : bool allow_remaining = false;
1229 :
1230 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1231 : discard_const_p(char *, kwnames),
1232 : &blob.data, &blob_length,
1233 : &allow_remaining_obj)) {
1234 0 : return NULL;
1235 : }
1236 0 : blob.length = blob_length;
1237 :
1238 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1239 0 : allow_remaining = true;
1240 : }
1241 :
1242 0 : if (allow_remaining) {
1243 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_SidArray);
1244 : } else {
1245 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_SidArray);
1246 : }
1247 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1248 0 : PyErr_SetNdrError(err);
1249 0 : return NULL;
1250 : }
1251 :
1252 0 : Py_RETURN_NONE;
1253 : }
1254 :
1255 0 : static PyObject *py_wbint_SidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1256 : {
1257 0 : struct wbint_SidArray *object = pytalloc_get_ptr(py_obj);
1258 0 : PyObject *ret;
1259 0 : char *retstr;
1260 :
1261 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_SidArray, "wbint_SidArray", object);
1262 0 : ret = PyUnicode_FromString(retstr);
1263 0 : talloc_free(retstr);
1264 :
1265 0 : return ret;
1266 : }
1267 :
1268 : static PyMethodDef py_wbint_SidArray_methods[] = {
1269 : { "__ndr_pack__", (PyCFunction)py_wbint_SidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1270 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_SidArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1271 : { "__ndr_print__", (PyCFunction)py_wbint_SidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1272 : { NULL, NULL, 0, NULL }
1273 : };
1274 :
1275 :
1276 : static PyTypeObject wbint_SidArray_Type = {
1277 : PyVarObject_HEAD_INIT(NULL, 0)
1278 : .tp_name = "winbind.wbint_SidArray",
1279 : .tp_getset = py_wbint_SidArray_getsetters,
1280 : .tp_methods = py_wbint_SidArray_methods,
1281 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1282 : .tp_new = py_wbint_SidArray_new,
1283 : };
1284 :
1285 :
1286 0 : static PyObject *py_wbint_RidArray_get_num_rids(PyObject *obj, void *closure)
1287 : {
1288 0 : struct wbint_RidArray *object = pytalloc_get_ptr(obj);
1289 0 : PyObject *py_num_rids;
1290 0 : py_num_rids = PyLong_FromUnsignedLongLong((uint32_t)(object->num_rids));
1291 0 : return py_num_rids;
1292 : }
1293 :
1294 0 : static int py_wbint_RidArray_set_num_rids(PyObject *py_obj, PyObject *value, void *closure)
1295 : {
1296 0 : struct wbint_RidArray *object = pytalloc_get_ptr(py_obj);
1297 0 : if (value == NULL) {
1298 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_rids");
1299 0 : return -1;
1300 : }
1301 : {
1302 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_rids));
1303 0 : if (PyLong_Check(value)) {
1304 0 : unsigned long long test_var;
1305 0 : test_var = PyLong_AsUnsignedLongLong(value);
1306 0 : if (PyErr_Occurred() != NULL) {
1307 0 : return -1;
1308 : }
1309 0 : if (test_var > uint_max) {
1310 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1311 : PyLong_Type.tp_name, uint_max, test_var);
1312 0 : return -1;
1313 : }
1314 0 : object->num_rids = test_var;
1315 : } else {
1316 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1317 : PyLong_Type.tp_name);
1318 0 : return -1;
1319 : }
1320 : }
1321 0 : return 0;
1322 : }
1323 :
1324 0 : static PyObject *py_wbint_RidArray_get_rids(PyObject *obj, void *closure)
1325 : {
1326 0 : struct wbint_RidArray *object = pytalloc_get_ptr(obj);
1327 0 : PyObject *py_rids;
1328 0 : py_rids = PyList_New(object->num_rids);
1329 0 : if (py_rids == NULL) {
1330 0 : return NULL;
1331 : }
1332 : {
1333 : int rids_cntr_0;
1334 0 : for (rids_cntr_0 = 0; rids_cntr_0 < (object->num_rids); rids_cntr_0++) {
1335 0 : PyObject *py_rids_0;
1336 0 : py_rids_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->rids)[rids_cntr_0]));
1337 0 : PyList_SetItem(py_rids, rids_cntr_0, py_rids_0);
1338 : }
1339 : }
1340 0 : return py_rids;
1341 : }
1342 :
1343 0 : static int py_wbint_RidArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
1344 : {
1345 0 : struct wbint_RidArray *object = pytalloc_get_ptr(py_obj);
1346 0 : if (value == NULL) {
1347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rids");
1348 0 : return -1;
1349 : }
1350 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1351 : {
1352 0 : int rids_cntr_0;
1353 0 : object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value));
1354 0 : if (!object->rids) { return -1; }
1355 0 : talloc_set_name_const(object->rids, "ARRAY: object->rids");
1356 0 : for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(value); rids_cntr_0++) {
1357 0 : if (PyList_GET_ITEM(value, rids_cntr_0) == NULL) {
1358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->rids)[rids_cntr_0]");
1359 0 : return -1;
1360 : }
1361 : {
1362 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->rids)[rids_cntr_0]));
1363 0 : if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_0))) {
1364 0 : unsigned long long test_var;
1365 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_0));
1366 0 : if (PyErr_Occurred() != NULL) {
1367 0 : return -1;
1368 : }
1369 0 : if (test_var > uint_max) {
1370 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1371 : PyLong_Type.tp_name, uint_max, test_var);
1372 0 : return -1;
1373 : }
1374 0 : (object->rids)[rids_cntr_0] = test_var;
1375 : } else {
1376 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1377 : PyLong_Type.tp_name);
1378 0 : return -1;
1379 : }
1380 : }
1381 : }
1382 : }
1383 0 : return 0;
1384 : }
1385 :
1386 : static PyGetSetDef py_wbint_RidArray_getsetters[] = {
1387 : {
1388 : .name = discard_const_p(char, "num_rids"),
1389 : .get = py_wbint_RidArray_get_num_rids,
1390 : .set = py_wbint_RidArray_set_num_rids,
1391 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1392 : },
1393 : {
1394 : .name = discard_const_p(char, "rids"),
1395 : .get = py_wbint_RidArray_get_rids,
1396 : .set = py_wbint_RidArray_set_rids,
1397 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1398 : },
1399 : { .name = NULL }
1400 : };
1401 :
1402 0 : static PyObject *py_wbint_RidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1403 : {
1404 0 : return pytalloc_new(struct wbint_RidArray, type);
1405 : }
1406 :
1407 0 : static PyObject *py_wbint_RidArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1408 : {
1409 0 : struct wbint_RidArray *object = pytalloc_get_ptr(py_obj);
1410 0 : PyObject *ret = NULL;
1411 0 : DATA_BLOB blob;
1412 0 : enum ndr_err_code err;
1413 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1414 0 : if (tmp_ctx == NULL) {
1415 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1416 0 : return NULL;
1417 : }
1418 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_RidArray);
1419 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1420 0 : TALLOC_FREE(tmp_ctx);
1421 0 : PyErr_SetNdrError(err);
1422 0 : return NULL;
1423 : }
1424 :
1425 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1426 0 : TALLOC_FREE(tmp_ctx);
1427 0 : return ret;
1428 : }
1429 :
1430 0 : static PyObject *py_wbint_RidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1431 : {
1432 0 : struct wbint_RidArray *object = pytalloc_get_ptr(py_obj);
1433 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1434 0 : Py_ssize_t blob_length = 0;
1435 0 : enum ndr_err_code err;
1436 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1437 0 : PyObject *allow_remaining_obj = NULL;
1438 0 : bool allow_remaining = false;
1439 :
1440 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1441 : discard_const_p(char *, kwnames),
1442 : &blob.data, &blob_length,
1443 : &allow_remaining_obj)) {
1444 0 : return NULL;
1445 : }
1446 0 : blob.length = blob_length;
1447 :
1448 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1449 0 : allow_remaining = true;
1450 : }
1451 :
1452 0 : if (allow_remaining) {
1453 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_RidArray);
1454 : } else {
1455 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_RidArray);
1456 : }
1457 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1458 0 : PyErr_SetNdrError(err);
1459 0 : return NULL;
1460 : }
1461 :
1462 0 : Py_RETURN_NONE;
1463 : }
1464 :
1465 0 : static PyObject *py_wbint_RidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1466 : {
1467 0 : struct wbint_RidArray *object = pytalloc_get_ptr(py_obj);
1468 0 : PyObject *ret;
1469 0 : char *retstr;
1470 :
1471 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_RidArray, "wbint_RidArray", object);
1472 0 : ret = PyUnicode_FromString(retstr);
1473 0 : talloc_free(retstr);
1474 :
1475 0 : return ret;
1476 : }
1477 :
1478 : static PyMethodDef py_wbint_RidArray_methods[] = {
1479 : { "__ndr_pack__", (PyCFunction)py_wbint_RidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1480 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_RidArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1481 : { "__ndr_print__", (PyCFunction)py_wbint_RidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1482 : { NULL, NULL, 0, NULL }
1483 : };
1484 :
1485 :
1486 : static PyTypeObject wbint_RidArray_Type = {
1487 : PyVarObject_HEAD_INIT(NULL, 0)
1488 : .tp_name = "winbind.wbint_RidArray",
1489 : .tp_getset = py_wbint_RidArray_getsetters,
1490 : .tp_methods = py_wbint_RidArray_methods,
1491 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1492 : .tp_new = py_wbint_RidArray_new,
1493 : };
1494 :
1495 :
1496 44 : static PyObject *py_wbint_Principal_get_sid(PyObject *obj, void *closure)
1497 : {
1498 44 : struct wbint_Principal *object = pytalloc_get_ptr(obj);
1499 44 : PyObject *py_sid;
1500 44 : py_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->sid);
1501 44 : return py_sid;
1502 : }
1503 :
1504 65558 : static int py_wbint_Principal_set_sid(PyObject *py_obj, PyObject *value, void *closure)
1505 : {
1506 65558 : struct wbint_Principal *object = pytalloc_get_ptr(py_obj);
1507 65558 : if (value == NULL) {
1508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
1509 0 : return -1;
1510 : }
1511 65558 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
1512 65558 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1513 0 : PyErr_NoMemory();
1514 0 : return -1;
1515 : }
1516 65558 : object->sid = *(struct dom_sid *)pytalloc_get_ptr(value);
1517 65558 : return 0;
1518 : }
1519 :
1520 44 : static PyObject *py_wbint_Principal_get_type(PyObject *obj, void *closure)
1521 : {
1522 44 : struct wbint_Principal *object = pytalloc_get_ptr(obj);
1523 44 : PyObject *py_type;
1524 44 : py_type = PyLong_FromLong((uint16_t)(object->type));
1525 44 : return py_type;
1526 : }
1527 :
1528 65558 : static int py_wbint_Principal_set_type(PyObject *py_obj, PyObject *value, void *closure)
1529 : {
1530 65558 : struct wbint_Principal *object = pytalloc_get_ptr(py_obj);
1531 65558 : if (value == NULL) {
1532 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
1533 0 : return -1;
1534 : }
1535 : {
1536 65558 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
1537 65558 : if (PyLong_Check(value)) {
1538 65558 : unsigned long long test_var;
1539 65558 : test_var = PyLong_AsUnsignedLongLong(value);
1540 65558 : if (PyErr_Occurred() != NULL) {
1541 0 : return -1;
1542 : }
1543 65558 : if (test_var > uint_max) {
1544 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1545 : PyLong_Type.tp_name, uint_max, test_var);
1546 0 : return -1;
1547 : }
1548 65558 : object->type = test_var;
1549 : } else {
1550 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1551 : PyLong_Type.tp_name);
1552 0 : return -1;
1553 : }
1554 : }
1555 65558 : return 0;
1556 : }
1557 :
1558 44 : static PyObject *py_wbint_Principal_get_name(PyObject *obj, void *closure)
1559 : {
1560 44 : struct wbint_Principal *object = pytalloc_get_ptr(obj);
1561 44 : PyObject *py_name;
1562 44 : if (object->name == NULL) {
1563 22 : Py_RETURN_NONE;
1564 : }
1565 22 : if (object->name == NULL) {
1566 0 : py_name = Py_None;
1567 0 : Py_INCREF(py_name);
1568 : } else {
1569 22 : if (object->name == NULL) {
1570 0 : py_name = Py_None;
1571 0 : Py_INCREF(py_name);
1572 : } else {
1573 22 : py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
1574 : }
1575 : }
1576 22 : return py_name;
1577 : }
1578 :
1579 65558 : static int py_wbint_Principal_set_name(PyObject *py_obj, PyObject *value, void *closure)
1580 : {
1581 65558 : struct wbint_Principal *object = pytalloc_get_ptr(py_obj);
1582 65558 : if (value == NULL) {
1583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
1584 0 : return -1;
1585 : }
1586 65558 : if (value == Py_None) {
1587 11 : object->name = NULL;
1588 : } else {
1589 65547 : object->name = NULL;
1590 : {
1591 65547 : const char *test_str;
1592 65547 : const char *talloc_str;
1593 65547 : PyObject *unicode = NULL;
1594 65547 : if (PyUnicode_Check(value)) {
1595 65547 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1596 65547 : if (unicode == NULL) {
1597 0 : return -1;
1598 : }
1599 65547 : test_str = PyBytes_AS_STRING(unicode);
1600 0 : } else if (PyBytes_Check(value)) {
1601 0 : test_str = PyBytes_AS_STRING(value);
1602 : } else {
1603 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1604 0 : return -1;
1605 : }
1606 65547 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1607 65547 : if (unicode != NULL) {
1608 65547 : Py_DECREF(unicode);
1609 : }
1610 65547 : if (talloc_str == NULL) {
1611 0 : PyErr_NoMemory();
1612 0 : return -1;
1613 : }
1614 65547 : object->name = talloc_str;
1615 : }
1616 : }
1617 0 : return 0;
1618 : }
1619 :
1620 : static PyGetSetDef py_wbint_Principal_getsetters[] = {
1621 : {
1622 : .name = discard_const_p(char, "sid"),
1623 : .get = py_wbint_Principal_get_sid,
1624 : .set = py_wbint_Principal_set_sid,
1625 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
1626 : },
1627 : {
1628 : .name = discard_const_p(char, "type"),
1629 : .get = py_wbint_Principal_get_type,
1630 : .set = py_wbint_Principal_set_type,
1631 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
1632 : },
1633 : {
1634 : .name = discard_const_p(char, "name"),
1635 : .get = py_wbint_Principal_get_name,
1636 : .set = py_wbint_Principal_set_name,
1637 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1638 : },
1639 : { .name = NULL }
1640 : };
1641 :
1642 65560 : static PyObject *py_wbint_Principal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1643 : {
1644 65560 : return pytalloc_new(struct wbint_Principal, type);
1645 : }
1646 :
1647 2 : static PyObject *py_wbint_Principal_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1648 : {
1649 2 : struct wbint_Principal *object = pytalloc_get_ptr(py_obj);
1650 2 : PyObject *ret = NULL;
1651 2 : DATA_BLOB blob;
1652 2 : enum ndr_err_code err;
1653 2 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1654 2 : if (tmp_ctx == NULL) {
1655 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1656 0 : return NULL;
1657 : }
1658 2 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Principal);
1659 2 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1660 0 : TALLOC_FREE(tmp_ctx);
1661 0 : PyErr_SetNdrError(err);
1662 0 : return NULL;
1663 : }
1664 :
1665 2 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1666 2 : TALLOC_FREE(tmp_ctx);
1667 2 : return ret;
1668 : }
1669 :
1670 2 : static PyObject *py_wbint_Principal_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1671 : {
1672 2 : struct wbint_Principal *object = pytalloc_get_ptr(py_obj);
1673 2 : DATA_BLOB blob = {.data = NULL, .length = 0};
1674 2 : Py_ssize_t blob_length = 0;
1675 2 : enum ndr_err_code err;
1676 2 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1677 2 : PyObject *allow_remaining_obj = NULL;
1678 2 : bool allow_remaining = false;
1679 :
1680 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1681 : discard_const_p(char *, kwnames),
1682 : &blob.data, &blob_length,
1683 : &allow_remaining_obj)) {
1684 0 : return NULL;
1685 : }
1686 2 : blob.length = blob_length;
1687 :
1688 2 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1689 0 : allow_remaining = true;
1690 : }
1691 :
1692 0 : if (allow_remaining) {
1693 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principal);
1694 : } else {
1695 2 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principal);
1696 : }
1697 2 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1698 0 : PyErr_SetNdrError(err);
1699 0 : return NULL;
1700 : }
1701 :
1702 2 : Py_RETURN_NONE;
1703 : }
1704 :
1705 0 : static PyObject *py_wbint_Principal_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1706 : {
1707 0 : struct wbint_Principal *object = pytalloc_get_ptr(py_obj);
1708 0 : PyObject *ret;
1709 0 : char *retstr;
1710 :
1711 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Principal, "wbint_Principal", object);
1712 0 : ret = PyUnicode_FromString(retstr);
1713 0 : talloc_free(retstr);
1714 :
1715 0 : return ret;
1716 : }
1717 :
1718 : static PyMethodDef py_wbint_Principal_methods[] = {
1719 : { "__ndr_pack__", (PyCFunction)py_wbint_Principal_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1720 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Principal_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1721 : { "__ndr_print__", (PyCFunction)py_wbint_Principal_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1722 : { NULL, NULL, 0, NULL }
1723 : };
1724 :
1725 :
1726 : static PyTypeObject wbint_Principal_Type = {
1727 : PyVarObject_HEAD_INIT(NULL, 0)
1728 : .tp_name = "winbind.wbint_Principal",
1729 : .tp_getset = py_wbint_Principal_getsetters,
1730 : .tp_methods = py_wbint_Principal_methods,
1731 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1732 : .tp_new = py_wbint_Principal_new,
1733 : };
1734 :
1735 :
1736 6 : static PyObject *py_wbint_Principals_get_num_principals(PyObject *obj, void *closure)
1737 : {
1738 6 : struct wbint_Principals *object = pytalloc_get_ptr(obj);
1739 6 : PyObject *py_num_principals;
1740 6 : py_num_principals = PyLong_FromUnsignedLongLong((uint32_t)(object->num_principals));
1741 6 : return py_num_principals;
1742 : }
1743 :
1744 3 : static int py_wbint_Principals_set_num_principals(PyObject *py_obj, PyObject *value, void *closure)
1745 : {
1746 3 : struct wbint_Principals *object = pytalloc_get_ptr(py_obj);
1747 3 : if (value == NULL) {
1748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_principals");
1749 0 : return -1;
1750 : }
1751 : {
1752 3 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_principals));
1753 3 : if (PyLong_Check(value)) {
1754 3 : unsigned long long test_var;
1755 3 : test_var = PyLong_AsUnsignedLongLong(value);
1756 3 : if (PyErr_Occurred() != NULL) {
1757 0 : return -1;
1758 : }
1759 3 : 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 3 : object->num_principals = 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 3 : return 0;
1772 : }
1773 :
1774 20 : static PyObject *py_wbint_Principals_get_principals(PyObject *obj, void *closure)
1775 : {
1776 20 : struct wbint_Principals *object = pytalloc_get_ptr(obj);
1777 20 : PyObject *py_principals;
1778 20 : py_principals = PyList_New(object->num_principals);
1779 20 : if (py_principals == NULL) {
1780 0 : return NULL;
1781 : }
1782 : {
1783 : int principals_cntr_0;
1784 220 : for (principals_cntr_0 = 0; principals_cntr_0 < (object->num_principals); principals_cntr_0++) {
1785 200 : PyObject *py_principals_0;
1786 200 : py_principals_0 = pytalloc_reference_ex(&wbint_Principal_Type, object->principals, &(object->principals)[principals_cntr_0]);
1787 200 : PyList_SetItem(py_principals, principals_cntr_0, py_principals_0);
1788 : }
1789 : }
1790 0 : return py_principals;
1791 : }
1792 :
1793 3 : static int py_wbint_Principals_set_principals(PyObject *py_obj, PyObject *value, void *closure)
1794 : {
1795 3 : struct wbint_Principals *object = pytalloc_get_ptr(py_obj);
1796 3 : if (value == NULL) {
1797 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->principals");
1798 0 : return -1;
1799 : }
1800 3 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1801 : {
1802 3 : int principals_cntr_0;
1803 3 : object->principals = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->principals, PyList_GET_SIZE(value));
1804 3 : if (!object->principals) { return -1; }
1805 3 : talloc_set_name_const(object->principals, "ARRAY: object->principals");
1806 65562 : for (principals_cntr_0 = 0; principals_cntr_0 < PyList_GET_SIZE(value); principals_cntr_0++) {
1807 65556 : if (PyList_GET_ITEM(value, principals_cntr_0) == NULL) {
1808 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->principals)[principals_cntr_0]");
1809 0 : return -1;
1810 : }
1811 65556 : PY_CHECK_TYPE(&wbint_Principal_Type, PyList_GET_ITEM(value, principals_cntr_0), return -1;);
1812 65556 : if (talloc_reference(object->principals, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, principals_cntr_0))) == NULL) {
1813 0 : PyErr_NoMemory();
1814 0 : return -1;
1815 : }
1816 65556 : (object->principals)[principals_cntr_0] = *(struct wbint_Principal *)pytalloc_get_ptr(PyList_GET_ITEM(value, principals_cntr_0));
1817 : }
1818 : }
1819 0 : return 0;
1820 : }
1821 :
1822 : static PyGetSetDef py_wbint_Principals_getsetters[] = {
1823 : {
1824 : .name = discard_const_p(char, "num_principals"),
1825 : .get = py_wbint_Principals_get_num_principals,
1826 : .set = py_wbint_Principals_set_num_principals,
1827 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1828 : },
1829 : {
1830 : .name = discard_const_p(char, "principals"),
1831 : .get = py_wbint_Principals_get_principals,
1832 : .set = py_wbint_Principals_set_principals,
1833 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principal")
1834 : },
1835 : { .name = NULL }
1836 : };
1837 :
1838 6 : static PyObject *py_wbint_Principals_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1839 : {
1840 6 : return pytalloc_new(struct wbint_Principals, type);
1841 : }
1842 :
1843 3 : static PyObject *py_wbint_Principals_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1844 : {
1845 3 : struct wbint_Principals *object = pytalloc_get_ptr(py_obj);
1846 3 : PyObject *ret = NULL;
1847 3 : DATA_BLOB blob;
1848 3 : enum ndr_err_code err;
1849 3 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1850 3 : if (tmp_ctx == NULL) {
1851 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1852 0 : return NULL;
1853 : }
1854 3 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Principals);
1855 3 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1856 0 : TALLOC_FREE(tmp_ctx);
1857 0 : PyErr_SetNdrError(err);
1858 0 : return NULL;
1859 : }
1860 :
1861 3 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1862 3 : TALLOC_FREE(tmp_ctx);
1863 3 : return ret;
1864 : }
1865 :
1866 3 : static PyObject *py_wbint_Principals_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1867 : {
1868 3 : struct wbint_Principals *object = pytalloc_get_ptr(py_obj);
1869 3 : DATA_BLOB blob = {.data = NULL, .length = 0};
1870 3 : Py_ssize_t blob_length = 0;
1871 3 : enum ndr_err_code err;
1872 3 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1873 3 : PyObject *allow_remaining_obj = NULL;
1874 3 : bool allow_remaining = false;
1875 :
1876 3 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1877 : discard_const_p(char *, kwnames),
1878 : &blob.data, &blob_length,
1879 : &allow_remaining_obj)) {
1880 0 : return NULL;
1881 : }
1882 3 : blob.length = blob_length;
1883 :
1884 3 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1885 0 : allow_remaining = true;
1886 : }
1887 :
1888 0 : if (allow_remaining) {
1889 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principals);
1890 : } else {
1891 3 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Principals);
1892 : }
1893 3 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1894 0 : PyErr_SetNdrError(err);
1895 0 : return NULL;
1896 : }
1897 :
1898 3 : Py_RETURN_NONE;
1899 : }
1900 :
1901 0 : static PyObject *py_wbint_Principals_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1902 : {
1903 0 : struct wbint_Principals *object = pytalloc_get_ptr(py_obj);
1904 0 : PyObject *ret;
1905 0 : char *retstr;
1906 :
1907 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Principals, "wbint_Principals", object);
1908 0 : ret = PyUnicode_FromString(retstr);
1909 0 : talloc_free(retstr);
1910 :
1911 0 : return ret;
1912 : }
1913 :
1914 : static PyMethodDef py_wbint_Principals_methods[] = {
1915 : { "__ndr_pack__", (PyCFunction)py_wbint_Principals_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1916 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Principals_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1917 : { "__ndr_print__", (PyCFunction)py_wbint_Principals_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1918 : { NULL, NULL, 0, NULL }
1919 : };
1920 :
1921 :
1922 : static PyTypeObject wbint_Principals_Type = {
1923 : PyVarObject_HEAD_INIT(NULL, 0)
1924 : .tp_name = "winbind.wbint_Principals",
1925 : .tp_getset = py_wbint_Principals_getsetters,
1926 : .tp_methods = py_wbint_Principals_methods,
1927 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1928 : .tp_new = py_wbint_Principals_new,
1929 : };
1930 :
1931 :
1932 0 : static PyObject *py_wbint_userinfos_get_num_userinfos(PyObject *obj, void *closure)
1933 : {
1934 0 : struct wbint_userinfos *object = pytalloc_get_ptr(obj);
1935 0 : PyObject *py_num_userinfos;
1936 0 : py_num_userinfos = PyLong_FromUnsignedLongLong((uint32_t)(object->num_userinfos));
1937 0 : return py_num_userinfos;
1938 : }
1939 :
1940 0 : static int py_wbint_userinfos_set_num_userinfos(PyObject *py_obj, PyObject *value, void *closure)
1941 : {
1942 0 : struct wbint_userinfos *object = pytalloc_get_ptr(py_obj);
1943 0 : if (value == NULL) {
1944 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_userinfos");
1945 0 : return -1;
1946 : }
1947 : {
1948 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_userinfos));
1949 0 : if (PyLong_Check(value)) {
1950 0 : unsigned long long test_var;
1951 0 : test_var = PyLong_AsUnsignedLongLong(value);
1952 0 : if (PyErr_Occurred() != NULL) {
1953 0 : return -1;
1954 : }
1955 0 : if (test_var > uint_max) {
1956 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1957 : PyLong_Type.tp_name, uint_max, test_var);
1958 0 : return -1;
1959 : }
1960 0 : object->num_userinfos = test_var;
1961 : } else {
1962 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1963 : PyLong_Type.tp_name);
1964 0 : return -1;
1965 : }
1966 : }
1967 0 : return 0;
1968 : }
1969 :
1970 0 : static PyObject *py_wbint_userinfos_get_userinfos(PyObject *obj, void *closure)
1971 : {
1972 0 : struct wbint_userinfos *object = pytalloc_get_ptr(obj);
1973 0 : PyObject *py_userinfos;
1974 0 : py_userinfos = PyList_New(object->num_userinfos);
1975 0 : if (py_userinfos == NULL) {
1976 0 : return NULL;
1977 : }
1978 : {
1979 : int userinfos_cntr_0;
1980 0 : for (userinfos_cntr_0 = 0; userinfos_cntr_0 < (object->num_userinfos); userinfos_cntr_0++) {
1981 0 : PyObject *py_userinfos_0;
1982 0 : py_userinfos_0 = pytalloc_reference_ex(&wbint_userinfo_Type, object->userinfos, &(object->userinfos)[userinfos_cntr_0]);
1983 0 : PyList_SetItem(py_userinfos, userinfos_cntr_0, py_userinfos_0);
1984 : }
1985 : }
1986 0 : return py_userinfos;
1987 : }
1988 :
1989 0 : static int py_wbint_userinfos_set_userinfos(PyObject *py_obj, PyObject *value, void *closure)
1990 : {
1991 0 : struct wbint_userinfos *object = pytalloc_get_ptr(py_obj);
1992 0 : if (value == NULL) {
1993 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->userinfos");
1994 0 : return -1;
1995 : }
1996 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1997 : {
1998 0 : int userinfos_cntr_0;
1999 0 : object->userinfos = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->userinfos, PyList_GET_SIZE(value));
2000 0 : if (!object->userinfos) { return -1; }
2001 0 : talloc_set_name_const(object->userinfos, "ARRAY: object->userinfos");
2002 0 : for (userinfos_cntr_0 = 0; userinfos_cntr_0 < PyList_GET_SIZE(value); userinfos_cntr_0++) {
2003 0 : if (PyList_GET_ITEM(value, userinfos_cntr_0) == NULL) {
2004 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->userinfos)[userinfos_cntr_0]");
2005 0 : return -1;
2006 : }
2007 0 : PY_CHECK_TYPE(&wbint_userinfo_Type, PyList_GET_ITEM(value, userinfos_cntr_0), return -1;);
2008 0 : if (talloc_reference(object->userinfos, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, userinfos_cntr_0))) == NULL) {
2009 0 : PyErr_NoMemory();
2010 0 : return -1;
2011 : }
2012 0 : (object->userinfos)[userinfos_cntr_0] = *(struct wbint_userinfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, userinfos_cntr_0));
2013 : }
2014 : }
2015 0 : return 0;
2016 : }
2017 :
2018 : static PyGetSetDef py_wbint_userinfos_getsetters[] = {
2019 : {
2020 : .name = discard_const_p(char, "num_userinfos"),
2021 : .get = py_wbint_userinfos_get_num_userinfos,
2022 : .set = py_wbint_userinfos_set_num_userinfos,
2023 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2024 : },
2025 : {
2026 : .name = discard_const_p(char, "userinfos"),
2027 : .get = py_wbint_userinfos_get_userinfos,
2028 : .set = py_wbint_userinfos_set_userinfos,
2029 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
2030 : },
2031 : { .name = NULL }
2032 : };
2033 :
2034 0 : static PyObject *py_wbint_userinfos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2035 : {
2036 0 : return pytalloc_new(struct wbint_userinfos, type);
2037 : }
2038 :
2039 0 : static PyObject *py_wbint_userinfos_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2040 : {
2041 0 : struct wbint_userinfos *object = pytalloc_get_ptr(py_obj);
2042 0 : PyObject *ret = NULL;
2043 0 : DATA_BLOB blob;
2044 0 : enum ndr_err_code err;
2045 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2046 0 : if (tmp_ctx == NULL) {
2047 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2048 0 : return NULL;
2049 : }
2050 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_userinfos);
2051 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2052 0 : TALLOC_FREE(tmp_ctx);
2053 0 : PyErr_SetNdrError(err);
2054 0 : return NULL;
2055 : }
2056 :
2057 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2058 0 : TALLOC_FREE(tmp_ctx);
2059 0 : return ret;
2060 : }
2061 :
2062 0 : static PyObject *py_wbint_userinfos_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2063 : {
2064 0 : struct wbint_userinfos *object = pytalloc_get_ptr(py_obj);
2065 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2066 0 : Py_ssize_t blob_length = 0;
2067 0 : enum ndr_err_code err;
2068 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2069 0 : PyObject *allow_remaining_obj = NULL;
2070 0 : bool allow_remaining = false;
2071 :
2072 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2073 : discard_const_p(char *, kwnames),
2074 : &blob.data, &blob_length,
2075 : &allow_remaining_obj)) {
2076 0 : return NULL;
2077 : }
2078 0 : blob.length = blob_length;
2079 :
2080 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2081 0 : allow_remaining = true;
2082 : }
2083 :
2084 0 : if (allow_remaining) {
2085 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfos);
2086 : } else {
2087 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_userinfos);
2088 : }
2089 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2090 0 : PyErr_SetNdrError(err);
2091 0 : return NULL;
2092 : }
2093 :
2094 0 : Py_RETURN_NONE;
2095 : }
2096 :
2097 0 : static PyObject *py_wbint_userinfos_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2098 : {
2099 0 : struct wbint_userinfos *object = pytalloc_get_ptr(py_obj);
2100 0 : PyObject *ret;
2101 0 : char *retstr;
2102 :
2103 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_userinfos, "wbint_userinfos", object);
2104 0 : ret = PyUnicode_FromString(retstr);
2105 0 : talloc_free(retstr);
2106 :
2107 0 : return ret;
2108 : }
2109 :
2110 : static PyMethodDef py_wbint_userinfos_methods[] = {
2111 : { "__ndr_pack__", (PyCFunction)py_wbint_userinfos_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2112 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_userinfos_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2113 : { "__ndr_print__", (PyCFunction)py_wbint_userinfos_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2114 : { NULL, NULL, 0, NULL }
2115 : };
2116 :
2117 :
2118 : static PyTypeObject wbint_userinfos_Type = {
2119 : PyVarObject_HEAD_INIT(NULL, 0)
2120 : .tp_name = "winbind.wbint_userinfos",
2121 : .tp_getset = py_wbint_userinfos_getsetters,
2122 : .tp_methods = py_wbint_userinfos_methods,
2123 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2124 : .tp_new = py_wbint_userinfos_new,
2125 : };
2126 :
2127 :
2128 0 : static PyObject *py_wbint_Validation_get_level(PyObject *obj, void *closure)
2129 : {
2130 0 : struct wbint_Validation *object = pytalloc_get_ptr(obj);
2131 0 : PyObject *py_level;
2132 0 : py_level = PyLong_FromLong((uint16_t)(object->level));
2133 0 : return py_level;
2134 : }
2135 :
2136 0 : static int py_wbint_Validation_set_level(PyObject *py_obj, PyObject *value, void *closure)
2137 : {
2138 0 : struct wbint_Validation *object = pytalloc_get_ptr(py_obj);
2139 0 : if (value == NULL) {
2140 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
2141 0 : return -1;
2142 : }
2143 : {
2144 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
2145 0 : if (PyLong_Check(value)) {
2146 0 : unsigned long long test_var;
2147 0 : test_var = PyLong_AsUnsignedLongLong(value);
2148 0 : if (PyErr_Occurred() != NULL) {
2149 0 : return -1;
2150 : }
2151 0 : if (test_var > uint_max) {
2152 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2153 : PyLong_Type.tp_name, uint_max, test_var);
2154 0 : return -1;
2155 : }
2156 0 : object->level = test_var;
2157 : } else {
2158 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2159 : PyLong_Type.tp_name);
2160 0 : return -1;
2161 : }
2162 : }
2163 0 : return 0;
2164 : }
2165 :
2166 0 : static PyObject *py_wbint_Validation_get_validation(PyObject *obj, void *closure)
2167 : {
2168 0 : struct wbint_Validation *object = pytalloc_get_ptr(obj);
2169 0 : PyObject *py_validation;
2170 0 : if (object->validation == NULL) {
2171 0 : Py_RETURN_NONE;
2172 : }
2173 0 : if (object->validation == NULL) {
2174 0 : py_validation = Py_None;
2175 0 : Py_INCREF(py_validation);
2176 : } else {
2177 0 : py_validation = pyrpc_import_union(netr_Validation_Type, object->validation, object->level, object->validation, "union netr_Validation");
2178 0 : if (py_validation == NULL) {
2179 0 : return NULL;
2180 : }
2181 : }
2182 0 : return py_validation;
2183 : }
2184 :
2185 0 : static int py_wbint_Validation_set_validation(PyObject *py_obj, PyObject *value, void *closure)
2186 : {
2187 0 : struct wbint_Validation *object = pytalloc_get_ptr(py_obj);
2188 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->validation));
2189 0 : if (value == NULL) {
2190 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->validation");
2191 0 : return -1;
2192 : }
2193 0 : if (value == Py_None) {
2194 0 : object->validation = NULL;
2195 : } else {
2196 0 : object->validation = NULL;
2197 : {
2198 0 : union netr_Validation *validation_switch_1;
2199 0 : validation_switch_1 = (union netr_Validation *)pyrpc_export_union(netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union netr_Validation");
2200 0 : if (validation_switch_1 == NULL) {
2201 0 : return -1;
2202 : }
2203 0 : object->validation = validation_switch_1;
2204 : }
2205 : }
2206 0 : return 0;
2207 : }
2208 :
2209 0 : static PyObject *py_wbint_Validation_get_krb5ccname(PyObject *obj, void *closure)
2210 : {
2211 0 : struct wbint_Validation *object = pytalloc_get_ptr(obj);
2212 0 : PyObject *py_krb5ccname;
2213 0 : if (object->krb5ccname == NULL) {
2214 0 : Py_RETURN_NONE;
2215 : }
2216 0 : if (object->krb5ccname == NULL) {
2217 0 : py_krb5ccname = Py_None;
2218 0 : Py_INCREF(py_krb5ccname);
2219 : } else {
2220 0 : if (object->krb5ccname == NULL) {
2221 0 : py_krb5ccname = Py_None;
2222 0 : Py_INCREF(py_krb5ccname);
2223 : } else {
2224 0 : py_krb5ccname = PyUnicode_Decode(object->krb5ccname, strlen(object->krb5ccname), "utf-8", "ignore");
2225 : }
2226 : }
2227 0 : return py_krb5ccname;
2228 : }
2229 :
2230 0 : static int py_wbint_Validation_set_krb5ccname(PyObject *py_obj, PyObject *value, void *closure)
2231 : {
2232 0 : struct wbint_Validation *object = pytalloc_get_ptr(py_obj);
2233 0 : if (value == NULL) {
2234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->krb5ccname");
2235 0 : return -1;
2236 : }
2237 0 : if (value == Py_None) {
2238 0 : object->krb5ccname = NULL;
2239 : } else {
2240 0 : object->krb5ccname = NULL;
2241 : {
2242 0 : const char *test_str;
2243 0 : const char *talloc_str;
2244 0 : PyObject *unicode = NULL;
2245 0 : if (PyUnicode_Check(value)) {
2246 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2247 0 : if (unicode == NULL) {
2248 0 : return -1;
2249 : }
2250 0 : test_str = PyBytes_AS_STRING(unicode);
2251 0 : } else if (PyBytes_Check(value)) {
2252 0 : test_str = PyBytes_AS_STRING(value);
2253 : } else {
2254 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2255 0 : return -1;
2256 : }
2257 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2258 0 : if (unicode != NULL) {
2259 0 : Py_DECREF(unicode);
2260 : }
2261 0 : if (talloc_str == NULL) {
2262 0 : PyErr_NoMemory();
2263 0 : return -1;
2264 : }
2265 0 : object->krb5ccname = talloc_str;
2266 : }
2267 : }
2268 0 : return 0;
2269 : }
2270 :
2271 : static PyGetSetDef py_wbint_Validation_getsetters[] = {
2272 : {
2273 : .name = discard_const_p(char, "level"),
2274 : .get = py_wbint_Validation_get_level,
2275 : .set = py_wbint_Validation_set_level,
2276 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2277 : },
2278 : {
2279 : .name = discard_const_p(char, "validation"),
2280 : .get = py_wbint_Validation_get_validation,
2281 : .set = py_wbint_Validation_set_validation,
2282 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
2283 : },
2284 : {
2285 : .name = discard_const_p(char, "krb5ccname"),
2286 : .get = py_wbint_Validation_get_krb5ccname,
2287 : .set = py_wbint_Validation_set_krb5ccname,
2288 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2289 : },
2290 : { .name = NULL }
2291 : };
2292 :
2293 0 : static PyObject *py_wbint_Validation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2294 : {
2295 0 : return pytalloc_new(struct wbint_Validation, type);
2296 : }
2297 :
2298 0 : static PyObject *py_wbint_Validation_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2299 : {
2300 0 : struct wbint_Validation *object = pytalloc_get_ptr(py_obj);
2301 0 : PyObject *ret = NULL;
2302 0 : DATA_BLOB blob;
2303 0 : enum ndr_err_code err;
2304 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2305 0 : if (tmp_ctx == NULL) {
2306 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2307 0 : return NULL;
2308 : }
2309 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_Validation);
2310 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2311 0 : TALLOC_FREE(tmp_ctx);
2312 0 : PyErr_SetNdrError(err);
2313 0 : return NULL;
2314 : }
2315 :
2316 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2317 0 : TALLOC_FREE(tmp_ctx);
2318 0 : return ret;
2319 : }
2320 :
2321 0 : static PyObject *py_wbint_Validation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2322 : {
2323 0 : struct wbint_Validation *object = pytalloc_get_ptr(py_obj);
2324 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2325 0 : Py_ssize_t blob_length = 0;
2326 0 : enum ndr_err_code err;
2327 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2328 0 : PyObject *allow_remaining_obj = NULL;
2329 0 : bool allow_remaining = false;
2330 :
2331 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2332 : discard_const_p(char *, kwnames),
2333 : &blob.data, &blob_length,
2334 : &allow_remaining_obj)) {
2335 0 : return NULL;
2336 : }
2337 0 : blob.length = blob_length;
2338 :
2339 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2340 0 : allow_remaining = true;
2341 : }
2342 :
2343 0 : if (allow_remaining) {
2344 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Validation);
2345 : } else {
2346 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_Validation);
2347 : }
2348 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2349 0 : PyErr_SetNdrError(err);
2350 0 : return NULL;
2351 : }
2352 :
2353 0 : Py_RETURN_NONE;
2354 : }
2355 :
2356 0 : static PyObject *py_wbint_Validation_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2357 : {
2358 0 : struct wbint_Validation *object = pytalloc_get_ptr(py_obj);
2359 0 : PyObject *ret;
2360 0 : char *retstr;
2361 :
2362 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_Validation, "wbint_Validation", object);
2363 0 : ret = PyUnicode_FromString(retstr);
2364 0 : talloc_free(retstr);
2365 :
2366 0 : return ret;
2367 : }
2368 :
2369 : static PyMethodDef py_wbint_Validation_methods[] = {
2370 : { "__ndr_pack__", (PyCFunction)py_wbint_Validation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2371 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Validation_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2372 : { "__ndr_print__", (PyCFunction)py_wbint_Validation_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2373 : { NULL, NULL, 0, NULL }
2374 : };
2375 :
2376 :
2377 : static PyTypeObject wbint_Validation_Type = {
2378 : PyVarObject_HEAD_INIT(NULL, 0)
2379 : .tp_name = "winbind.wbint_Validation",
2380 : .tp_getset = py_wbint_Validation_getsetters,
2381 : .tp_methods = py_wbint_Validation_methods,
2382 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2383 : .tp_new = py_wbint_Validation_new,
2384 : };
2385 :
2386 :
2387 0 : static PyObject *py_wbint_AuthUserInfo_get_username(PyObject *obj, void *closure)
2388 : {
2389 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(obj);
2390 0 : PyObject *py_username;
2391 0 : if (object->username == NULL) {
2392 0 : Py_RETURN_NONE;
2393 : }
2394 0 : if (object->username == NULL) {
2395 0 : py_username = Py_None;
2396 0 : Py_INCREF(py_username);
2397 : } else {
2398 0 : if (object->username == NULL) {
2399 0 : py_username = Py_None;
2400 0 : Py_INCREF(py_username);
2401 : } else {
2402 0 : py_username = PyUnicode_Decode(object->username, strlen(object->username), "utf-8", "ignore");
2403 : }
2404 : }
2405 0 : return py_username;
2406 : }
2407 :
2408 0 : static int py_wbint_AuthUserInfo_set_username(PyObject *py_obj, PyObject *value, void *closure)
2409 : {
2410 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(py_obj);
2411 0 : if (value == NULL) {
2412 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->username");
2413 0 : return -1;
2414 : }
2415 0 : if (value == Py_None) {
2416 0 : object->username = NULL;
2417 : } else {
2418 0 : object->username = NULL;
2419 : {
2420 0 : const char *test_str;
2421 0 : const char *talloc_str;
2422 0 : PyObject *unicode = NULL;
2423 0 : if (PyUnicode_Check(value)) {
2424 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2425 0 : if (unicode == NULL) {
2426 0 : return -1;
2427 : }
2428 0 : test_str = PyBytes_AS_STRING(unicode);
2429 0 : } else if (PyBytes_Check(value)) {
2430 0 : test_str = PyBytes_AS_STRING(value);
2431 : } else {
2432 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2433 0 : return -1;
2434 : }
2435 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2436 0 : if (unicode != NULL) {
2437 0 : Py_DECREF(unicode);
2438 : }
2439 0 : if (talloc_str == NULL) {
2440 0 : PyErr_NoMemory();
2441 0 : return -1;
2442 : }
2443 0 : object->username = talloc_str;
2444 : }
2445 : }
2446 0 : return 0;
2447 : }
2448 :
2449 0 : static PyObject *py_wbint_AuthUserInfo_get_password(PyObject *obj, void *closure)
2450 : {
2451 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(obj);
2452 0 : PyObject *py_password;
2453 0 : if (object->password == NULL) {
2454 0 : Py_RETURN_NONE;
2455 : }
2456 0 : if (object->password == NULL) {
2457 0 : py_password = Py_None;
2458 0 : Py_INCREF(py_password);
2459 : } else {
2460 0 : if (object->password == NULL) {
2461 0 : py_password = Py_None;
2462 0 : Py_INCREF(py_password);
2463 : } else {
2464 0 : py_password = PyUnicode_Decode(object->password, strlen(object->password), "utf-8", "ignore");
2465 : }
2466 : }
2467 0 : return py_password;
2468 : }
2469 :
2470 0 : static int py_wbint_AuthUserInfo_set_password(PyObject *py_obj, PyObject *value, void *closure)
2471 : {
2472 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(py_obj);
2473 0 : if (value == NULL) {
2474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->password");
2475 0 : return -1;
2476 : }
2477 0 : if (value == Py_None) {
2478 0 : object->password = NULL;
2479 : } else {
2480 0 : object->password = NULL;
2481 : {
2482 0 : const char *test_str;
2483 0 : const char *talloc_str;
2484 0 : PyObject *unicode = NULL;
2485 0 : if (PyUnicode_Check(value)) {
2486 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2487 0 : if (unicode == NULL) {
2488 0 : return -1;
2489 : }
2490 0 : test_str = PyBytes_AS_STRING(unicode);
2491 0 : } else if (PyBytes_Check(value)) {
2492 0 : test_str = PyBytes_AS_STRING(value);
2493 : } else {
2494 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2495 0 : return -1;
2496 : }
2497 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2498 0 : if (unicode != NULL) {
2499 0 : Py_DECREF(unicode);
2500 : }
2501 0 : if (talloc_str == NULL) {
2502 0 : PyErr_NoMemory();
2503 0 : return -1;
2504 : }
2505 0 : object->password = talloc_str;
2506 : }
2507 : }
2508 0 : return 0;
2509 : }
2510 :
2511 0 : static PyObject *py_wbint_AuthUserInfo_get_krb5_cc_type(PyObject *obj, void *closure)
2512 : {
2513 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(obj);
2514 0 : PyObject *py_krb5_cc_type;
2515 0 : if (object->krb5_cc_type == NULL) {
2516 0 : Py_RETURN_NONE;
2517 : }
2518 0 : if (object->krb5_cc_type == NULL) {
2519 0 : py_krb5_cc_type = Py_None;
2520 0 : Py_INCREF(py_krb5_cc_type);
2521 : } else {
2522 0 : if (object->krb5_cc_type == NULL) {
2523 0 : py_krb5_cc_type = Py_None;
2524 0 : Py_INCREF(py_krb5_cc_type);
2525 : } else {
2526 0 : py_krb5_cc_type = PyUnicode_Decode(object->krb5_cc_type, strlen(object->krb5_cc_type), "utf-8", "ignore");
2527 : }
2528 : }
2529 0 : return py_krb5_cc_type;
2530 : }
2531 :
2532 0 : static int py_wbint_AuthUserInfo_set_krb5_cc_type(PyObject *py_obj, PyObject *value, void *closure)
2533 : {
2534 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(py_obj);
2535 0 : if (value == NULL) {
2536 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->krb5_cc_type");
2537 0 : return -1;
2538 : }
2539 0 : if (value == Py_None) {
2540 0 : object->krb5_cc_type = NULL;
2541 : } else {
2542 0 : object->krb5_cc_type = NULL;
2543 : {
2544 0 : const char *test_str;
2545 0 : const char *talloc_str;
2546 0 : PyObject *unicode = NULL;
2547 0 : if (PyUnicode_Check(value)) {
2548 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2549 0 : if (unicode == NULL) {
2550 0 : return -1;
2551 : }
2552 0 : test_str = PyBytes_AS_STRING(unicode);
2553 0 : } else if (PyBytes_Check(value)) {
2554 0 : test_str = PyBytes_AS_STRING(value);
2555 : } else {
2556 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2557 0 : return -1;
2558 : }
2559 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2560 0 : if (unicode != NULL) {
2561 0 : Py_DECREF(unicode);
2562 : }
2563 0 : if (talloc_str == NULL) {
2564 0 : PyErr_NoMemory();
2565 0 : return -1;
2566 : }
2567 0 : object->krb5_cc_type = talloc_str;
2568 : }
2569 : }
2570 0 : return 0;
2571 : }
2572 :
2573 0 : static PyObject *py_wbint_AuthUserInfo_get_uid(PyObject *obj, void *closure)
2574 : {
2575 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(obj);
2576 0 : PyObject *py_uid;
2577 0 : py_uid = PyLong_FromUnsignedLongLong(object->uid);
2578 0 : return py_uid;
2579 : }
2580 :
2581 0 : static int py_wbint_AuthUserInfo_set_uid(PyObject *py_obj, PyObject *value, void *closure)
2582 : {
2583 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(py_obj);
2584 0 : if (value == NULL) {
2585 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->uid");
2586 0 : return -1;
2587 : }
2588 : {
2589 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->uid));
2590 0 : if (PyLong_Check(value)) {
2591 0 : unsigned long long test_var;
2592 0 : test_var = PyLong_AsUnsignedLongLong(value);
2593 0 : if (PyErr_Occurred() != NULL) {
2594 0 : return -1;
2595 : }
2596 0 : if (test_var > uint_max) {
2597 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2598 : PyLong_Type.tp_name, uint_max, test_var);
2599 0 : return -1;
2600 : }
2601 0 : object->uid = test_var;
2602 : } else {
2603 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2604 : PyLong_Type.tp_name);
2605 0 : return -1;
2606 : }
2607 : }
2608 0 : return 0;
2609 : }
2610 :
2611 : static PyGetSetDef py_wbint_AuthUserInfo_getsetters[] = {
2612 : {
2613 : .name = discard_const_p(char, "username"),
2614 : .get = py_wbint_AuthUserInfo_get_username,
2615 : .set = py_wbint_AuthUserInfo_set_username,
2616 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2617 : },
2618 : {
2619 : .name = discard_const_p(char, "password"),
2620 : .get = py_wbint_AuthUserInfo_get_password,
2621 : .set = py_wbint_AuthUserInfo_set_password,
2622 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2623 : },
2624 : {
2625 : .name = discard_const_p(char, "krb5_cc_type"),
2626 : .get = py_wbint_AuthUserInfo_get_krb5_cc_type,
2627 : .set = py_wbint_AuthUserInfo_set_krb5_cc_type,
2628 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2629 : },
2630 : {
2631 : .name = discard_const_p(char, "uid"),
2632 : .get = py_wbint_AuthUserInfo_get_uid,
2633 : .set = py_wbint_AuthUserInfo_set_uid,
2634 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2635 : },
2636 : { .name = NULL }
2637 : };
2638 :
2639 0 : static PyObject *py_wbint_AuthUserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2640 : {
2641 0 : return pytalloc_new(struct wbint_AuthUserInfo, type);
2642 : }
2643 :
2644 0 : static PyObject *py_wbint_AuthUserInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2645 : {
2646 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(py_obj);
2647 0 : PyObject *ret = NULL;
2648 0 : DATA_BLOB blob;
2649 0 : enum ndr_err_code err;
2650 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2651 0 : if (tmp_ctx == NULL) {
2652 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2653 0 : return NULL;
2654 : }
2655 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_AuthUserInfo);
2656 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2657 0 : TALLOC_FREE(tmp_ctx);
2658 0 : PyErr_SetNdrError(err);
2659 0 : return NULL;
2660 : }
2661 :
2662 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2663 0 : TALLOC_FREE(tmp_ctx);
2664 0 : return ret;
2665 : }
2666 :
2667 0 : static PyObject *py_wbint_AuthUserInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2668 : {
2669 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(py_obj);
2670 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2671 0 : Py_ssize_t blob_length = 0;
2672 0 : enum ndr_err_code err;
2673 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2674 0 : PyObject *allow_remaining_obj = NULL;
2675 0 : bool allow_remaining = false;
2676 :
2677 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2678 : discard_const_p(char *, kwnames),
2679 : &blob.data, &blob_length,
2680 : &allow_remaining_obj)) {
2681 0 : return NULL;
2682 : }
2683 0 : blob.length = blob_length;
2684 :
2685 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2686 0 : allow_remaining = true;
2687 : }
2688 :
2689 0 : if (allow_remaining) {
2690 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_AuthUserInfo);
2691 : } else {
2692 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_AuthUserInfo);
2693 : }
2694 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2695 0 : PyErr_SetNdrError(err);
2696 0 : return NULL;
2697 : }
2698 :
2699 0 : Py_RETURN_NONE;
2700 : }
2701 :
2702 0 : static PyObject *py_wbint_AuthUserInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2703 : {
2704 0 : struct wbint_AuthUserInfo *object = pytalloc_get_ptr(py_obj);
2705 0 : PyObject *ret;
2706 0 : char *retstr;
2707 :
2708 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_AuthUserInfo, "wbint_AuthUserInfo", object);
2709 0 : ret = PyUnicode_FromString(retstr);
2710 0 : talloc_free(retstr);
2711 :
2712 0 : return ret;
2713 : }
2714 :
2715 : static PyMethodDef py_wbint_AuthUserInfo_methods[] = {
2716 : { "__ndr_pack__", (PyCFunction)py_wbint_AuthUserInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2717 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AuthUserInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2718 : { "__ndr_print__", (PyCFunction)py_wbint_AuthUserInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2719 : { NULL, NULL, 0, NULL }
2720 : };
2721 :
2722 :
2723 : static PyTypeObject wbint_AuthUserInfo_Type = {
2724 : PyVarObject_HEAD_INIT(NULL, 0)
2725 : .tp_name = "winbind.wbint_AuthUserInfo",
2726 : .tp_getset = py_wbint_AuthUserInfo_getsetters,
2727 : .tp_methods = py_wbint_AuthUserInfo_methods,
2728 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2729 : .tp_new = py_wbint_AuthUserInfo_new,
2730 : };
2731 :
2732 :
2733 0 : static PyObject *py_wbint_PamAuthCrapValidation_get_level(PyObject *obj, void *closure)
2734 : {
2735 0 : struct wbint_PamAuthCrapValidation *object = pytalloc_get_ptr(obj);
2736 0 : PyObject *py_level;
2737 0 : py_level = PyLong_FromLong((uint16_t)(object->level));
2738 0 : return py_level;
2739 : }
2740 :
2741 0 : static int py_wbint_PamAuthCrapValidation_set_level(PyObject *py_obj, PyObject *value, void *closure)
2742 : {
2743 0 : struct wbint_PamAuthCrapValidation *object = pytalloc_get_ptr(py_obj);
2744 0 : if (value == NULL) {
2745 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
2746 0 : return -1;
2747 : }
2748 : {
2749 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
2750 0 : if (PyLong_Check(value)) {
2751 0 : unsigned long long test_var;
2752 0 : test_var = PyLong_AsUnsignedLongLong(value);
2753 0 : if (PyErr_Occurred() != NULL) {
2754 0 : return -1;
2755 : }
2756 0 : if (test_var > uint_max) {
2757 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2758 : PyLong_Type.tp_name, uint_max, test_var);
2759 0 : return -1;
2760 : }
2761 0 : object->level = test_var;
2762 : } else {
2763 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2764 : PyLong_Type.tp_name);
2765 0 : return -1;
2766 : }
2767 : }
2768 0 : return 0;
2769 : }
2770 :
2771 0 : static PyObject *py_wbint_PamAuthCrapValidation_get_validation(PyObject *obj, void *closure)
2772 : {
2773 0 : struct wbint_PamAuthCrapValidation *object = pytalloc_get_ptr(obj);
2774 0 : PyObject *py_validation;
2775 0 : if (object->validation == NULL) {
2776 0 : Py_RETURN_NONE;
2777 : }
2778 0 : if (object->validation == NULL) {
2779 0 : py_validation = Py_None;
2780 0 : Py_INCREF(py_validation);
2781 : } else {
2782 0 : py_validation = pyrpc_import_union(netr_Validation_Type, object->validation, object->level, object->validation, "union netr_Validation");
2783 0 : if (py_validation == NULL) {
2784 0 : return NULL;
2785 : }
2786 : }
2787 0 : return py_validation;
2788 : }
2789 :
2790 0 : static int py_wbint_PamAuthCrapValidation_set_validation(PyObject *py_obj, PyObject *value, void *closure)
2791 : {
2792 0 : struct wbint_PamAuthCrapValidation *object = pytalloc_get_ptr(py_obj);
2793 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->validation));
2794 0 : if (value == NULL) {
2795 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->validation");
2796 0 : return -1;
2797 : }
2798 0 : if (value == Py_None) {
2799 0 : object->validation = NULL;
2800 : } else {
2801 0 : object->validation = NULL;
2802 : {
2803 0 : union netr_Validation *validation_switch_1;
2804 0 : validation_switch_1 = (union netr_Validation *)pyrpc_export_union(netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union netr_Validation");
2805 0 : if (validation_switch_1 == NULL) {
2806 0 : return -1;
2807 : }
2808 0 : object->validation = validation_switch_1;
2809 : }
2810 : }
2811 0 : return 0;
2812 : }
2813 :
2814 : static PyGetSetDef py_wbint_PamAuthCrapValidation_getsetters[] = {
2815 : {
2816 : .name = discard_const_p(char, "level"),
2817 : .get = py_wbint_PamAuthCrapValidation_get_level,
2818 : .set = py_wbint_PamAuthCrapValidation_set_level,
2819 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2820 : },
2821 : {
2822 : .name = discard_const_p(char, "validation"),
2823 : .get = py_wbint_PamAuthCrapValidation_get_validation,
2824 : .set = py_wbint_PamAuthCrapValidation_set_validation,
2825 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
2826 : },
2827 : { .name = NULL }
2828 : };
2829 :
2830 0 : static PyObject *py_wbint_PamAuthCrapValidation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2831 : {
2832 0 : return pytalloc_new(struct wbint_PamAuthCrapValidation, type);
2833 : }
2834 :
2835 0 : static PyObject *py_wbint_PamAuthCrapValidation_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2836 : {
2837 0 : struct wbint_PamAuthCrapValidation *object = pytalloc_get_ptr(py_obj);
2838 0 : PyObject *ret = NULL;
2839 0 : DATA_BLOB blob;
2840 0 : enum ndr_err_code err;
2841 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2842 0 : if (tmp_ctx == NULL) {
2843 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2844 0 : return NULL;
2845 : }
2846 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_wbint_PamAuthCrapValidation);
2847 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2848 0 : TALLOC_FREE(tmp_ctx);
2849 0 : PyErr_SetNdrError(err);
2850 0 : return NULL;
2851 : }
2852 :
2853 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2854 0 : TALLOC_FREE(tmp_ctx);
2855 0 : return ret;
2856 : }
2857 :
2858 0 : static PyObject *py_wbint_PamAuthCrapValidation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2859 : {
2860 0 : struct wbint_PamAuthCrapValidation *object = pytalloc_get_ptr(py_obj);
2861 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2862 0 : Py_ssize_t blob_length = 0;
2863 0 : enum ndr_err_code err;
2864 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2865 0 : PyObject *allow_remaining_obj = NULL;
2866 0 : bool allow_remaining = false;
2867 :
2868 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2869 : discard_const_p(char *, kwnames),
2870 : &blob.data, &blob_length,
2871 : &allow_remaining_obj)) {
2872 0 : return NULL;
2873 : }
2874 0 : blob.length = blob_length;
2875 :
2876 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2877 0 : allow_remaining = true;
2878 : }
2879 :
2880 0 : if (allow_remaining) {
2881 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_PamAuthCrapValidation);
2882 : } else {
2883 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_wbint_PamAuthCrapValidation);
2884 : }
2885 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2886 0 : PyErr_SetNdrError(err);
2887 0 : return NULL;
2888 : }
2889 :
2890 0 : Py_RETURN_NONE;
2891 : }
2892 :
2893 0 : static PyObject *py_wbint_PamAuthCrapValidation_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2894 : {
2895 0 : struct wbint_PamAuthCrapValidation *object = pytalloc_get_ptr(py_obj);
2896 0 : PyObject *ret;
2897 0 : char *retstr;
2898 :
2899 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_wbint_PamAuthCrapValidation, "wbint_PamAuthCrapValidation", object);
2900 0 : ret = PyUnicode_FromString(retstr);
2901 0 : talloc_free(retstr);
2902 :
2903 0 : return ret;
2904 : }
2905 :
2906 : static PyMethodDef py_wbint_PamAuthCrapValidation_methods[] = {
2907 : { "__ndr_pack__", (PyCFunction)py_wbint_PamAuthCrapValidation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2908 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapValidation_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2909 : { "__ndr_print__", (PyCFunction)py_wbint_PamAuthCrapValidation_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2910 : { NULL, NULL, 0, NULL }
2911 : };
2912 :
2913 :
2914 : static PyTypeObject wbint_PamAuthCrapValidation_Type = {
2915 : PyVarObject_HEAD_INIT(NULL, 0)
2916 : .tp_name = "winbind.wbint_PamAuthCrapValidation",
2917 : .tp_getset = py_wbint_PamAuthCrapValidation_getsetters,
2918 : .tp_methods = py_wbint_PamAuthCrapValidation_methods,
2919 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2920 : .tp_new = py_wbint_PamAuthCrapValidation_new,
2921 : };
2922 :
2923 :
2924 :
2925 0 : static PyObject *py_wbint_Ping_in_get_in_data(PyObject *obj, void *closure)
2926 : {
2927 0 : struct wbint_Ping *object = pytalloc_get_ptr(obj);
2928 0 : PyObject *py_in_data;
2929 0 : py_in_data = PyLong_FromUnsignedLongLong((uint32_t)(object->in.in_data));
2930 0 : return py_in_data;
2931 : }
2932 :
2933 0 : static int py_wbint_Ping_in_set_in_data(PyObject *py_obj, PyObject *value, void *closure)
2934 : {
2935 0 : struct wbint_Ping *object = pytalloc_get_ptr(py_obj);
2936 0 : if (value == NULL) {
2937 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.in_data");
2938 0 : return -1;
2939 : }
2940 : {
2941 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.in_data));
2942 0 : if (PyLong_Check(value)) {
2943 0 : unsigned long long test_var;
2944 0 : test_var = PyLong_AsUnsignedLongLong(value);
2945 0 : if (PyErr_Occurred() != NULL) {
2946 0 : return -1;
2947 : }
2948 0 : if (test_var > uint_max) {
2949 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2950 : PyLong_Type.tp_name, uint_max, test_var);
2951 0 : return -1;
2952 : }
2953 0 : object->in.in_data = test_var;
2954 : } else {
2955 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2956 : PyLong_Type.tp_name);
2957 0 : return -1;
2958 : }
2959 : }
2960 0 : return 0;
2961 : }
2962 :
2963 0 : static PyObject *py_wbint_Ping_out_get_out_data(PyObject *obj, void *closure)
2964 : {
2965 0 : struct wbint_Ping *object = pytalloc_get_ptr(obj);
2966 0 : PyObject *py_out_data;
2967 0 : if (object->out.out_data == NULL) {
2968 0 : Py_RETURN_NONE;
2969 : }
2970 0 : py_out_data = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.out_data));
2971 0 : return py_out_data;
2972 : }
2973 :
2974 0 : static int py_wbint_Ping_out_set_out_data(PyObject *py_obj, PyObject *value, void *closure)
2975 : {
2976 0 : struct wbint_Ping *object = pytalloc_get_ptr(py_obj);
2977 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.out_data));
2978 0 : if (value == NULL) {
2979 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.out_data");
2980 0 : return -1;
2981 : }
2982 0 : object->out.out_data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_data);
2983 0 : if (object->out.out_data == NULL) {
2984 0 : PyErr_NoMemory();
2985 0 : return -1;
2986 : }
2987 : {
2988 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.out_data));
2989 0 : if (PyLong_Check(value)) {
2990 0 : unsigned long long test_var;
2991 0 : test_var = PyLong_AsUnsignedLongLong(value);
2992 0 : if (PyErr_Occurred() != NULL) {
2993 0 : return -1;
2994 : }
2995 0 : if (test_var > uint_max) {
2996 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2997 : PyLong_Type.tp_name, uint_max, test_var);
2998 0 : return -1;
2999 : }
3000 0 : *object->out.out_data = test_var;
3001 : } else {
3002 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3003 : PyLong_Type.tp_name);
3004 0 : return -1;
3005 : }
3006 : }
3007 0 : return 0;
3008 : }
3009 :
3010 0 : static PyObject *py_wbint_Ping_get_result(PyObject *obj, void *closure)
3011 : {
3012 0 : struct wbint_Ping *object = pytalloc_get_ptr(obj);
3013 0 : PyObject *py_result;
3014 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
3015 0 : return py_result;
3016 : }
3017 :
3018 0 : static int py_wbint_Ping_set_result(PyObject *py_obj, PyObject *value, void *closure)
3019 : {
3020 0 : struct wbint_Ping *object = pytalloc_get_ptr(py_obj);
3021 0 : if (value == NULL) {
3022 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
3023 0 : return -1;
3024 : }
3025 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
3026 0 : return 0;
3027 : }
3028 :
3029 : static PyGetSetDef py_wbint_Ping_getsetters[] = {
3030 : {
3031 : .name = discard_const_p(char, "in_in_data"),
3032 : .get = py_wbint_Ping_in_get_in_data,
3033 : .set = py_wbint_Ping_in_set_in_data,
3034 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3035 : },
3036 : {
3037 : .name = discard_const_p(char, "out_out_data"),
3038 : .get = py_wbint_Ping_out_get_out_data,
3039 : .set = py_wbint_Ping_out_set_out_data,
3040 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3041 : },
3042 : {
3043 : .name = discard_const_p(char, "result"),
3044 : .get = py_wbint_Ping_get_result,
3045 : .set = py_wbint_Ping_set_result,
3046 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
3047 : },
3048 : { .name = NULL }
3049 : };
3050 :
3051 0 : static PyObject *py_wbint_Ping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3052 : {
3053 0 : PyObject *self = pytalloc_new(struct wbint_Ping, type);
3054 0 : struct wbint_Ping *_self = (struct wbint_Ping *)pytalloc_get_ptr(self);
3055 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
3056 0 : _self->out.out_data = talloc_zero(mem_ctx, uint32_t);
3057 0 : return self;
3058 : }
3059 :
3060 0 : static PyObject *py_wbint_Ping_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
3061 : {
3062 :
3063 :
3064 0 : return PyLong_FromLong(0);
3065 : }
3066 :
3067 0 : static PyObject *py_wbint_Ping_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
3068 : {
3069 0 : const struct ndr_interface_call *call = NULL;
3070 0 : struct wbint_Ping *object = pytalloc_get_ptr(py_obj);
3071 0 : PyObject *ret = NULL;
3072 0 : struct ndr_push *push = NULL;
3073 0 : DATA_BLOB blob;
3074 0 : enum ndr_err_code err;
3075 :
3076 0 : if (ndr_table_winbind.num_calls < 1) {
3077 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_pack");
3078 0 : return NULL;
3079 : }
3080 0 : call = &ndr_table_winbind.calls[0];
3081 :
3082 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
3083 0 : if (push == NULL) {
3084 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3085 0 : return NULL;
3086 : }
3087 :
3088 0 : push->flags |= ndr_push_flags;
3089 :
3090 0 : err = call->ndr_push(push, ndr_inout_flags, object);
3091 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3092 0 : TALLOC_FREE(push);
3093 0 : PyErr_SetNdrError(err);
3094 0 : return NULL;
3095 : }
3096 0 : blob = ndr_push_blob(push);
3097 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3098 0 : TALLOC_FREE(push);
3099 0 : return ret;
3100 : }
3101 :
3102 0 : static PyObject *py_wbint_Ping_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3103 : {
3104 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3105 0 : PyObject *bigendian_obj = NULL;
3106 0 : PyObject *ndr64_obj = NULL;
3107 0 : libndr_flags ndr_push_flags = 0;
3108 :
3109 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
3110 : discard_const_p(char *, kwnames),
3111 : &bigendian_obj,
3112 : &ndr64_obj)) {
3113 0 : return NULL;
3114 : }
3115 :
3116 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3117 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3118 : }
3119 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3120 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3121 : }
3122 :
3123 0 : return py_wbint_Ping_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
3124 : }
3125 :
3126 0 : static PyObject *py_wbint_Ping_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3127 : {
3128 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3129 0 : PyObject *bigendian_obj = NULL;
3130 0 : PyObject *ndr64_obj = NULL;
3131 0 : libndr_flags ndr_push_flags = 0;
3132 :
3133 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
3134 : discard_const_p(char *, kwnames),
3135 : &bigendian_obj,
3136 : &ndr64_obj)) {
3137 0 : return NULL;
3138 : }
3139 :
3140 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3141 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3142 : }
3143 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3144 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3145 : }
3146 :
3147 0 : return py_wbint_Ping_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
3148 : }
3149 :
3150 0 : static PyObject *py_wbint_Ping_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
3151 : {
3152 0 : const struct ndr_interface_call *call = NULL;
3153 0 : struct wbint_Ping *object = pytalloc_get_ptr(py_obj);
3154 0 : struct ndr_pull *pull = NULL;
3155 0 : enum ndr_err_code err;
3156 :
3157 0 : if (ndr_table_winbind.num_calls < 1) {
3158 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_unpack");
3159 0 : return NULL;
3160 : }
3161 0 : call = &ndr_table_winbind.calls[0];
3162 :
3163 0 : pull = ndr_pull_init_blob(blob, object);
3164 0 : if (pull == NULL) {
3165 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3166 0 : return NULL;
3167 : }
3168 :
3169 0 : pull->flags |= ndr_pull_flags;
3170 :
3171 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
3172 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3173 0 : TALLOC_FREE(pull);
3174 0 : PyErr_SetNdrError(err);
3175 0 : return NULL;
3176 : }
3177 0 : if (!allow_remaining) {
3178 0 : uint32_t highest_ofs;
3179 :
3180 0 : if (pull->offset > pull->relative_highest_offset) {
3181 0 : highest_ofs = pull->offset;
3182 : } else {
3183 0 : highest_ofs = pull->relative_highest_offset;
3184 : }
3185 0 : if (highest_ofs < pull->data_size) {
3186 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
3187 : "not all bytes consumed ofs[%u] size[%u]",
3188 : highest_ofs, pull->data_size);
3189 0 : TALLOC_FREE(pull);
3190 0 : PyErr_SetNdrError(err);
3191 0 : return NULL;
3192 : }
3193 : }
3194 :
3195 0 : TALLOC_FREE(pull);
3196 0 : Py_RETURN_NONE;
3197 : }
3198 :
3199 0 : static PyObject *py_wbint_Ping_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3200 : {
3201 0 : DATA_BLOB blob;
3202 0 : Py_ssize_t blob_length = 0;
3203 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3204 0 : PyObject *bigendian_obj = NULL;
3205 0 : PyObject *ndr64_obj = NULL;
3206 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3207 0 : PyObject *allow_remaining_obj = NULL;
3208 0 : bool allow_remaining = false;
3209 :
3210 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
3211 : discard_const_p(char *, kwnames),
3212 : &blob.data, &blob_length,
3213 : &bigendian_obj,
3214 : &ndr64_obj,
3215 : &allow_remaining_obj)) {
3216 0 : return NULL;
3217 : }
3218 0 : blob.length = blob_length;
3219 :
3220 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3221 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3222 : }
3223 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3224 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3225 : }
3226 :
3227 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3228 0 : allow_remaining = true;
3229 : }
3230 :
3231 0 : return py_wbint_Ping_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
3232 : }
3233 :
3234 0 : static PyObject *py_wbint_Ping_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3235 : {
3236 0 : DATA_BLOB blob;
3237 0 : Py_ssize_t blob_length = 0;
3238 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3239 0 : PyObject *bigendian_obj = NULL;
3240 0 : PyObject *ndr64_obj = NULL;
3241 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3242 0 : PyObject *allow_remaining_obj = NULL;
3243 0 : bool allow_remaining = false;
3244 :
3245 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3246 : discard_const_p(char *, kwnames),
3247 : &blob.data, &blob_length,
3248 : &bigendian_obj,
3249 : &ndr64_obj,
3250 : &allow_remaining_obj)) {
3251 0 : return NULL;
3252 : }
3253 0 : blob.length = blob_length;
3254 :
3255 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3256 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3257 : }
3258 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3259 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3260 : }
3261 :
3262 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3263 0 : allow_remaining = true;
3264 : }
3265 :
3266 0 : return py_wbint_Ping_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3267 : }
3268 :
3269 0 : static PyObject *py_wbint_Ping_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
3270 : {
3271 0 : const struct ndr_interface_call *call = NULL;
3272 0 : struct wbint_Ping *object = pytalloc_get_ptr(py_obj);
3273 0 : PyObject *ret;
3274 0 : char *retstr;
3275 :
3276 0 : if (ndr_table_winbind.num_calls < 1) {
3277 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Ping_ndr_print");
3278 0 : return NULL;
3279 : }
3280 0 : call = &ndr_table_winbind.calls[0];
3281 :
3282 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3283 0 : ret = PyUnicode_FromString(retstr);
3284 0 : TALLOC_FREE(retstr);
3285 :
3286 0 : return ret;
3287 : }
3288 :
3289 0 : static PyObject *py_wbint_Ping_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3290 : {
3291 0 : return py_wbint_Ping_ndr_print(py_obj, "wbint_Ping_in", NDR_IN);
3292 : }
3293 :
3294 0 : static PyObject *py_wbint_Ping_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3295 : {
3296 0 : return py_wbint_Ping_ndr_print(py_obj, "wbint_Ping_out", NDR_OUT);
3297 : }
3298 :
3299 : static PyMethodDef py_wbint_Ping_methods[] = {
3300 : { "opnum", (PyCFunction)py_wbint_Ping_ndr_opnum, METH_NOARGS|METH_CLASS,
3301 : "winbind.wbint_Ping.opnum() -> 0 (0x00) " },
3302 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3303 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3304 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3305 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3306 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3307 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3308 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Ping_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3309 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3310 : { "__ndr_print_in__", (PyCFunction)py_wbint_Ping_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3311 : { "__ndr_print_out__", (PyCFunction)py_wbint_Ping_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3312 : { NULL, NULL, 0, NULL }
3313 : };
3314 :
3315 :
3316 : static PyTypeObject wbint_Ping_Type = {
3317 : PyVarObject_HEAD_INIT(NULL, 0)
3318 : .tp_name = "winbind.wbint_Ping",
3319 : .tp_getset = py_wbint_Ping_getsetters,
3320 : .tp_methods = py_wbint_Ping_methods,
3321 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3322 : .tp_new = py_wbint_Ping_new,
3323 : };
3324 :
3325 0 : static bool pack_py_wbint_Ping_args_in(PyObject *args, PyObject *kwargs, struct wbint_Ping *r)
3326 : {
3327 0 : PyObject *py_in_data;
3328 0 : const char *kwnames[] = {
3329 : "in_data", NULL
3330 : };
3331 :
3332 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_Ping", discard_const_p(char *, kwnames), &py_in_data)) {
3333 0 : return false;
3334 : }
3335 :
3336 0 : if (py_in_data == NULL) {
3337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.in_data");
3338 0 : return false;
3339 : }
3340 : {
3341 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.in_data));
3342 0 : if (PyLong_Check(py_in_data)) {
3343 0 : unsigned long long test_var;
3344 0 : test_var = PyLong_AsUnsignedLongLong(py_in_data);
3345 0 : if (PyErr_Occurred() != NULL) {
3346 0 : return false;
3347 : }
3348 0 : if (test_var > uint_max) {
3349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3350 : PyLong_Type.tp_name, uint_max, test_var);
3351 0 : return false;
3352 : }
3353 0 : r->in.in_data = test_var;
3354 : } else {
3355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3356 : PyLong_Type.tp_name);
3357 0 : return false;
3358 : }
3359 : }
3360 0 : return true;
3361 : }
3362 :
3363 0 : static PyObject *unpack_py_wbint_Ping_args_out(struct wbint_Ping *r)
3364 : {
3365 0 : PyObject *result;
3366 0 : PyObject *py_out_data;
3367 0 : py_out_data = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.out_data));
3368 0 : result = py_out_data;
3369 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
3370 0 : PyErr_SetNTSTATUS(r->out.result);
3371 0 : return NULL;
3372 : }
3373 :
3374 0 : return result;
3375 : }
3376 :
3377 :
3378 0 : static PyObject *py_wbint_LookupSid_in_get_sid(PyObject *obj, void *closure)
3379 : {
3380 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(obj);
3381 0 : PyObject *py_sid;
3382 0 : if (object->in.sid == NULL) {
3383 0 : Py_RETURN_NONE;
3384 : }
3385 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
3386 0 : return py_sid;
3387 : }
3388 :
3389 0 : static int py_wbint_LookupSid_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3390 : {
3391 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(py_obj);
3392 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
3393 0 : if (value == NULL) {
3394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
3395 0 : return -1;
3396 : }
3397 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
3398 0 : if (object->in.sid == NULL) {
3399 0 : PyErr_NoMemory();
3400 0 : return -1;
3401 : }
3402 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3403 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3404 0 : PyErr_NoMemory();
3405 0 : return -1;
3406 : }
3407 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
3408 0 : return 0;
3409 : }
3410 :
3411 0 : static PyObject *py_wbint_LookupSid_out_get_type(PyObject *obj, void *closure)
3412 : {
3413 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(obj);
3414 0 : PyObject *py_type;
3415 0 : if (object->out.type == NULL) {
3416 0 : Py_RETURN_NONE;
3417 : }
3418 0 : py_type = PyLong_FromLong((uint16_t)(*object->out.type));
3419 0 : return py_type;
3420 : }
3421 :
3422 0 : static int py_wbint_LookupSid_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
3423 : {
3424 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(py_obj);
3425 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
3426 0 : if (value == NULL) {
3427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.type");
3428 0 : return -1;
3429 : }
3430 0 : object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
3431 0 : if (object->out.type == NULL) {
3432 0 : PyErr_NoMemory();
3433 0 : return -1;
3434 : }
3435 : {
3436 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
3437 0 : if (PyLong_Check(value)) {
3438 0 : unsigned long long test_var;
3439 0 : test_var = PyLong_AsUnsignedLongLong(value);
3440 0 : if (PyErr_Occurred() != NULL) {
3441 0 : return -1;
3442 : }
3443 0 : if (test_var > uint_max) {
3444 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3445 : PyLong_Type.tp_name, uint_max, test_var);
3446 0 : return -1;
3447 : }
3448 0 : *object->out.type = test_var;
3449 : } else {
3450 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3451 : PyLong_Type.tp_name);
3452 0 : return -1;
3453 : }
3454 : }
3455 0 : return 0;
3456 : }
3457 :
3458 0 : static PyObject *py_wbint_LookupSid_out_get_domain(PyObject *obj, void *closure)
3459 : {
3460 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(obj);
3461 0 : PyObject *py_domain;
3462 0 : if (object->out.domain == NULL) {
3463 0 : Py_RETURN_NONE;
3464 : }
3465 0 : if (*object->out.domain == NULL) {
3466 0 : py_domain = Py_None;
3467 0 : Py_INCREF(py_domain);
3468 : } else {
3469 0 : if (*object->out.domain == NULL) {
3470 0 : py_domain = Py_None;
3471 0 : Py_INCREF(py_domain);
3472 : } else {
3473 0 : py_domain = PyUnicode_Decode(*object->out.domain, strlen(*object->out.domain), "utf-8", "ignore");
3474 : }
3475 : }
3476 0 : return py_domain;
3477 : }
3478 :
3479 0 : static int py_wbint_LookupSid_out_set_domain(PyObject *py_obj, PyObject *value, void *closure)
3480 : {
3481 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(py_obj);
3482 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain));
3483 0 : if (value == NULL) {
3484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domain");
3485 0 : return -1;
3486 : }
3487 0 : object->out.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain);
3488 0 : if (object->out.domain == NULL) {
3489 0 : PyErr_NoMemory();
3490 0 : return -1;
3491 : }
3492 0 : if (value == Py_None) {
3493 0 : *object->out.domain = NULL;
3494 : } else {
3495 0 : *object->out.domain = NULL;
3496 : {
3497 0 : const char *test_str;
3498 0 : const char *talloc_str;
3499 0 : PyObject *unicode = NULL;
3500 0 : if (PyUnicode_Check(value)) {
3501 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3502 0 : if (unicode == NULL) {
3503 0 : return -1;
3504 : }
3505 0 : test_str = PyBytes_AS_STRING(unicode);
3506 0 : } else if (PyBytes_Check(value)) {
3507 0 : test_str = PyBytes_AS_STRING(value);
3508 : } else {
3509 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3510 0 : return -1;
3511 : }
3512 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3513 0 : if (unicode != NULL) {
3514 0 : Py_DECREF(unicode);
3515 : }
3516 0 : if (talloc_str == NULL) {
3517 0 : PyErr_NoMemory();
3518 0 : return -1;
3519 : }
3520 0 : *object->out.domain = talloc_str;
3521 : }
3522 : }
3523 0 : return 0;
3524 : }
3525 :
3526 0 : static PyObject *py_wbint_LookupSid_out_get_name(PyObject *obj, void *closure)
3527 : {
3528 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(obj);
3529 0 : PyObject *py_name;
3530 0 : if (object->out.name == NULL) {
3531 0 : Py_RETURN_NONE;
3532 : }
3533 0 : if (*object->out.name == NULL) {
3534 0 : py_name = Py_None;
3535 0 : Py_INCREF(py_name);
3536 : } else {
3537 0 : if (*object->out.name == NULL) {
3538 0 : py_name = Py_None;
3539 0 : Py_INCREF(py_name);
3540 : } else {
3541 0 : py_name = PyUnicode_Decode(*object->out.name, strlen(*object->out.name), "utf-8", "ignore");
3542 : }
3543 : }
3544 0 : return py_name;
3545 : }
3546 :
3547 0 : static int py_wbint_LookupSid_out_set_name(PyObject *py_obj, PyObject *value, void *closure)
3548 : {
3549 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(py_obj);
3550 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name));
3551 0 : if (value == NULL) {
3552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.name");
3553 0 : return -1;
3554 : }
3555 0 : object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name);
3556 0 : if (object->out.name == NULL) {
3557 0 : PyErr_NoMemory();
3558 0 : return -1;
3559 : }
3560 0 : if (value == Py_None) {
3561 0 : *object->out.name = NULL;
3562 : } else {
3563 0 : *object->out.name = NULL;
3564 : {
3565 0 : const char *test_str;
3566 0 : const char *talloc_str;
3567 0 : PyObject *unicode = NULL;
3568 0 : if (PyUnicode_Check(value)) {
3569 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3570 0 : if (unicode == NULL) {
3571 0 : return -1;
3572 : }
3573 0 : test_str = PyBytes_AS_STRING(unicode);
3574 0 : } else if (PyBytes_Check(value)) {
3575 0 : test_str = PyBytes_AS_STRING(value);
3576 : } else {
3577 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3578 0 : return -1;
3579 : }
3580 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3581 0 : if (unicode != NULL) {
3582 0 : Py_DECREF(unicode);
3583 : }
3584 0 : if (talloc_str == NULL) {
3585 0 : PyErr_NoMemory();
3586 0 : return -1;
3587 : }
3588 0 : *object->out.name = talloc_str;
3589 : }
3590 : }
3591 0 : return 0;
3592 : }
3593 :
3594 0 : static PyObject *py_wbint_LookupSid_get_result(PyObject *obj, void *closure)
3595 : {
3596 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(obj);
3597 0 : PyObject *py_result;
3598 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
3599 0 : return py_result;
3600 : }
3601 :
3602 0 : static int py_wbint_LookupSid_set_result(PyObject *py_obj, PyObject *value, void *closure)
3603 : {
3604 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(py_obj);
3605 0 : if (value == NULL) {
3606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
3607 0 : return -1;
3608 : }
3609 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
3610 0 : return 0;
3611 : }
3612 :
3613 : static PyGetSetDef py_wbint_LookupSid_getsetters[] = {
3614 : {
3615 : .name = discard_const_p(char, "in_sid"),
3616 : .get = py_wbint_LookupSid_in_get_sid,
3617 : .set = py_wbint_LookupSid_in_set_sid,
3618 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
3619 : },
3620 : {
3621 : .name = discard_const_p(char, "out_type"),
3622 : .get = py_wbint_LookupSid_out_get_type,
3623 : .set = py_wbint_LookupSid_out_set_type,
3624 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
3625 : },
3626 : {
3627 : .name = discard_const_p(char, "out_domain"),
3628 : .get = py_wbint_LookupSid_out_get_domain,
3629 : .set = py_wbint_LookupSid_out_set_domain,
3630 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3631 : },
3632 : {
3633 : .name = discard_const_p(char, "out_name"),
3634 : .get = py_wbint_LookupSid_out_get_name,
3635 : .set = py_wbint_LookupSid_out_set_name,
3636 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3637 : },
3638 : {
3639 : .name = discard_const_p(char, "result"),
3640 : .get = py_wbint_LookupSid_get_result,
3641 : .set = py_wbint_LookupSid_set_result,
3642 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
3643 : },
3644 : { .name = NULL }
3645 : };
3646 :
3647 0 : static PyObject *py_wbint_LookupSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3648 : {
3649 0 : PyObject *self = pytalloc_new(struct wbint_LookupSid, type);
3650 0 : struct wbint_LookupSid *_self = (struct wbint_LookupSid *)pytalloc_get_ptr(self);
3651 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
3652 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
3653 0 : _self->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
3654 0 : return self;
3655 : }
3656 :
3657 0 : static PyObject *py_wbint_LookupSid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
3658 : {
3659 :
3660 :
3661 0 : return PyLong_FromLong(1);
3662 : }
3663 :
3664 0 : static PyObject *py_wbint_LookupSid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
3665 : {
3666 0 : const struct ndr_interface_call *call = NULL;
3667 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(py_obj);
3668 0 : PyObject *ret = NULL;
3669 0 : struct ndr_push *push = NULL;
3670 0 : DATA_BLOB blob;
3671 0 : enum ndr_err_code err;
3672 :
3673 0 : if (ndr_table_winbind.num_calls < 2) {
3674 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_pack");
3675 0 : return NULL;
3676 : }
3677 0 : call = &ndr_table_winbind.calls[1];
3678 :
3679 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
3680 0 : if (push == NULL) {
3681 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3682 0 : return NULL;
3683 : }
3684 :
3685 0 : push->flags |= ndr_push_flags;
3686 :
3687 0 : err = call->ndr_push(push, ndr_inout_flags, object);
3688 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3689 0 : TALLOC_FREE(push);
3690 0 : PyErr_SetNdrError(err);
3691 0 : return NULL;
3692 : }
3693 0 : blob = ndr_push_blob(push);
3694 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3695 0 : TALLOC_FREE(push);
3696 0 : return ret;
3697 : }
3698 :
3699 0 : static PyObject *py_wbint_LookupSid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3700 : {
3701 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3702 0 : PyObject *bigendian_obj = NULL;
3703 0 : PyObject *ndr64_obj = NULL;
3704 0 : libndr_flags ndr_push_flags = 0;
3705 :
3706 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
3707 : discard_const_p(char *, kwnames),
3708 : &bigendian_obj,
3709 : &ndr64_obj)) {
3710 0 : return NULL;
3711 : }
3712 :
3713 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3714 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3715 : }
3716 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3717 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3718 : }
3719 :
3720 0 : return py_wbint_LookupSid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
3721 : }
3722 :
3723 0 : static PyObject *py_wbint_LookupSid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3724 : {
3725 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3726 0 : PyObject *bigendian_obj = NULL;
3727 0 : PyObject *ndr64_obj = NULL;
3728 0 : libndr_flags ndr_push_flags = 0;
3729 :
3730 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
3731 : discard_const_p(char *, kwnames),
3732 : &bigendian_obj,
3733 : &ndr64_obj)) {
3734 0 : return NULL;
3735 : }
3736 :
3737 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3738 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3739 : }
3740 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3741 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3742 : }
3743 :
3744 0 : return py_wbint_LookupSid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
3745 : }
3746 :
3747 0 : static PyObject *py_wbint_LookupSid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
3748 : {
3749 0 : const struct ndr_interface_call *call = NULL;
3750 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(py_obj);
3751 0 : struct ndr_pull *pull = NULL;
3752 0 : enum ndr_err_code err;
3753 :
3754 0 : if (ndr_table_winbind.num_calls < 2) {
3755 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_unpack");
3756 0 : return NULL;
3757 : }
3758 0 : call = &ndr_table_winbind.calls[1];
3759 :
3760 0 : pull = ndr_pull_init_blob(blob, object);
3761 0 : if (pull == NULL) {
3762 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3763 0 : return NULL;
3764 : }
3765 :
3766 0 : pull->flags |= ndr_pull_flags;
3767 :
3768 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
3769 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3770 0 : TALLOC_FREE(pull);
3771 0 : PyErr_SetNdrError(err);
3772 0 : return NULL;
3773 : }
3774 0 : if (!allow_remaining) {
3775 0 : uint32_t highest_ofs;
3776 :
3777 0 : if (pull->offset > pull->relative_highest_offset) {
3778 0 : highest_ofs = pull->offset;
3779 : } else {
3780 0 : highest_ofs = pull->relative_highest_offset;
3781 : }
3782 0 : if (highest_ofs < pull->data_size) {
3783 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
3784 : "not all bytes consumed ofs[%u] size[%u]",
3785 : highest_ofs, pull->data_size);
3786 0 : TALLOC_FREE(pull);
3787 0 : PyErr_SetNdrError(err);
3788 0 : return NULL;
3789 : }
3790 : }
3791 :
3792 0 : TALLOC_FREE(pull);
3793 0 : Py_RETURN_NONE;
3794 : }
3795 :
3796 0 : static PyObject *py_wbint_LookupSid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3797 : {
3798 0 : DATA_BLOB blob;
3799 0 : Py_ssize_t blob_length = 0;
3800 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3801 0 : PyObject *bigendian_obj = NULL;
3802 0 : PyObject *ndr64_obj = NULL;
3803 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3804 0 : PyObject *allow_remaining_obj = NULL;
3805 0 : bool allow_remaining = false;
3806 :
3807 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
3808 : discard_const_p(char *, kwnames),
3809 : &blob.data, &blob_length,
3810 : &bigendian_obj,
3811 : &ndr64_obj,
3812 : &allow_remaining_obj)) {
3813 0 : return NULL;
3814 : }
3815 0 : blob.length = blob_length;
3816 :
3817 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3818 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3819 : }
3820 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3821 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3822 : }
3823 :
3824 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3825 0 : allow_remaining = true;
3826 : }
3827 :
3828 0 : return py_wbint_LookupSid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
3829 : }
3830 :
3831 0 : static PyObject *py_wbint_LookupSid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3832 : {
3833 0 : DATA_BLOB blob;
3834 0 : Py_ssize_t blob_length = 0;
3835 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3836 0 : PyObject *bigendian_obj = NULL;
3837 0 : PyObject *ndr64_obj = NULL;
3838 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3839 0 : PyObject *allow_remaining_obj = NULL;
3840 0 : bool allow_remaining = false;
3841 :
3842 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3843 : discard_const_p(char *, kwnames),
3844 : &blob.data, &blob_length,
3845 : &bigendian_obj,
3846 : &ndr64_obj,
3847 : &allow_remaining_obj)) {
3848 0 : return NULL;
3849 : }
3850 0 : blob.length = blob_length;
3851 :
3852 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3853 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3854 : }
3855 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3856 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3857 : }
3858 :
3859 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3860 0 : allow_remaining = true;
3861 : }
3862 :
3863 0 : return py_wbint_LookupSid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3864 : }
3865 :
3866 0 : static PyObject *py_wbint_LookupSid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
3867 : {
3868 0 : const struct ndr_interface_call *call = NULL;
3869 0 : struct wbint_LookupSid *object = pytalloc_get_ptr(py_obj);
3870 0 : PyObject *ret;
3871 0 : char *retstr;
3872 :
3873 0 : if (ndr_table_winbind.num_calls < 2) {
3874 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSid_ndr_print");
3875 0 : return NULL;
3876 : }
3877 0 : call = &ndr_table_winbind.calls[1];
3878 :
3879 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3880 0 : ret = PyUnicode_FromString(retstr);
3881 0 : TALLOC_FREE(retstr);
3882 :
3883 0 : return ret;
3884 : }
3885 :
3886 0 : static PyObject *py_wbint_LookupSid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3887 : {
3888 0 : return py_wbint_LookupSid_ndr_print(py_obj, "wbint_LookupSid_in", NDR_IN);
3889 : }
3890 :
3891 0 : static PyObject *py_wbint_LookupSid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3892 : {
3893 0 : return py_wbint_LookupSid_ndr_print(py_obj, "wbint_LookupSid_out", NDR_OUT);
3894 : }
3895 :
3896 : static PyMethodDef py_wbint_LookupSid_methods[] = {
3897 : { "opnum", (PyCFunction)py_wbint_LookupSid_ndr_opnum, METH_NOARGS|METH_CLASS,
3898 : "winbind.wbint_LookupSid.opnum() -> 1 (0x01) " },
3899 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3900 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3901 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3902 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3903 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3904 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3905 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3906 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3907 : { "__ndr_print_in__", (PyCFunction)py_wbint_LookupSid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3908 : { "__ndr_print_out__", (PyCFunction)py_wbint_LookupSid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3909 : { NULL, NULL, 0, NULL }
3910 : };
3911 :
3912 :
3913 : static PyTypeObject wbint_LookupSid_Type = {
3914 : PyVarObject_HEAD_INIT(NULL, 0)
3915 : .tp_name = "winbind.wbint_LookupSid",
3916 : .tp_getset = py_wbint_LookupSid_getsetters,
3917 : .tp_methods = py_wbint_LookupSid_methods,
3918 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3919 : .tp_new = py_wbint_LookupSid_new,
3920 : };
3921 :
3922 0 : static bool pack_py_wbint_LookupSid_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupSid *r)
3923 : {
3924 0 : PyObject *py_sid;
3925 0 : const char *kwnames[] = {
3926 : "sid", NULL
3927 : };
3928 :
3929 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupSid", discard_const_p(char *, kwnames), &py_sid)) {
3930 0 : return false;
3931 : }
3932 :
3933 0 : if (py_sid == NULL) {
3934 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
3935 0 : return false;
3936 : }
3937 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
3938 0 : if (r->in.sid == NULL) {
3939 0 : PyErr_NoMemory();
3940 0 : return false;
3941 : }
3942 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
3943 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
3944 0 : PyErr_NoMemory();
3945 0 : return false;
3946 : }
3947 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
3948 0 : return true;
3949 : }
3950 :
3951 0 : static PyObject *unpack_py_wbint_LookupSid_args_out(struct wbint_LookupSid *r)
3952 : {
3953 0 : PyObject *result;
3954 0 : PyObject *py_type;
3955 0 : PyObject *py_domain;
3956 0 : PyObject *py_name;
3957 0 : result = PyTuple_New(3);
3958 0 : py_type = PyLong_FromLong((uint16_t)(*r->out.type));
3959 0 : PyTuple_SetItem(result, 0, py_type);
3960 0 : if (*r->out.domain == NULL) {
3961 0 : py_domain = Py_None;
3962 0 : Py_INCREF(py_domain);
3963 : } else {
3964 0 : if (*r->out.domain == NULL) {
3965 0 : py_domain = Py_None;
3966 0 : Py_INCREF(py_domain);
3967 : } else {
3968 0 : py_domain = PyUnicode_Decode(*r->out.domain, strlen(*r->out.domain), "utf-8", "ignore");
3969 : }
3970 : }
3971 0 : PyTuple_SetItem(result, 1, py_domain);
3972 0 : if (*r->out.name == NULL) {
3973 0 : py_name = Py_None;
3974 0 : Py_INCREF(py_name);
3975 : } else {
3976 0 : if (*r->out.name == NULL) {
3977 0 : py_name = Py_None;
3978 0 : Py_INCREF(py_name);
3979 : } else {
3980 0 : py_name = PyUnicode_Decode(*r->out.name, strlen(*r->out.name), "utf-8", "ignore");
3981 : }
3982 : }
3983 0 : PyTuple_SetItem(result, 2, py_name);
3984 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
3985 0 : PyErr_SetNTSTATUS(r->out.result);
3986 0 : return NULL;
3987 : }
3988 :
3989 0 : return result;
3990 : }
3991 :
3992 :
3993 0 : static PyObject *py_wbint_LookupSids_in_get_sids(PyObject *obj, void *closure)
3994 : {
3995 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(obj);
3996 0 : PyObject *py_sids;
3997 0 : if (object->in.sids == NULL) {
3998 0 : Py_RETURN_NONE;
3999 : }
4000 0 : py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids);
4001 0 : return py_sids;
4002 : }
4003 :
4004 0 : static int py_wbint_LookupSids_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
4005 : {
4006 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(py_obj);
4007 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
4008 0 : if (value == NULL) {
4009 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
4010 0 : return -1;
4011 : }
4012 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
4013 0 : if (object->in.sids == NULL) {
4014 0 : PyErr_NoMemory();
4015 0 : return -1;
4016 : }
4017 0 : PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;);
4018 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4019 0 : PyErr_NoMemory();
4020 0 : return -1;
4021 : }
4022 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
4023 0 : return 0;
4024 : }
4025 :
4026 0 : static PyObject *py_wbint_LookupSids_out_get_domains(PyObject *obj, void *closure)
4027 : {
4028 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(obj);
4029 0 : PyObject *py_domains;
4030 0 : if (object->out.domains == NULL) {
4031 0 : Py_RETURN_NONE;
4032 : }
4033 0 : py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, object->out.domains, object->out.domains);
4034 0 : return py_domains;
4035 : }
4036 :
4037 0 : static int py_wbint_LookupSids_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
4038 : {
4039 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(py_obj);
4040 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
4041 0 : if (value == NULL) {
4042 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
4043 0 : return -1;
4044 : }
4045 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
4046 0 : if (object->out.domains == NULL) {
4047 0 : PyErr_NoMemory();
4048 0 : return -1;
4049 : }
4050 0 : PY_CHECK_TYPE(lsa_RefDomainList_Type, value, return -1;);
4051 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4052 0 : PyErr_NoMemory();
4053 0 : return -1;
4054 : }
4055 0 : object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
4056 0 : return 0;
4057 : }
4058 :
4059 0 : static PyObject *py_wbint_LookupSids_out_get_names(PyObject *obj, void *closure)
4060 : {
4061 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(obj);
4062 0 : PyObject *py_names;
4063 0 : if (object->out.names == NULL) {
4064 0 : Py_RETURN_NONE;
4065 : }
4066 0 : py_names = pytalloc_reference_ex(lsa_TransNameArray_Type, object->out.names, object->out.names);
4067 0 : return py_names;
4068 : }
4069 :
4070 0 : static int py_wbint_LookupSids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
4071 : {
4072 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(py_obj);
4073 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
4074 0 : if (value == NULL) {
4075 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.names");
4076 0 : return -1;
4077 : }
4078 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
4079 0 : if (object->out.names == NULL) {
4080 0 : PyErr_NoMemory();
4081 0 : return -1;
4082 : }
4083 0 : PY_CHECK_TYPE(lsa_TransNameArray_Type, value, return -1;);
4084 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4085 0 : PyErr_NoMemory();
4086 0 : return -1;
4087 : }
4088 0 : object->out.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
4089 0 : return 0;
4090 : }
4091 :
4092 0 : static PyObject *py_wbint_LookupSids_get_result(PyObject *obj, void *closure)
4093 : {
4094 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(obj);
4095 0 : PyObject *py_result;
4096 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
4097 0 : return py_result;
4098 : }
4099 :
4100 0 : static int py_wbint_LookupSids_set_result(PyObject *py_obj, PyObject *value, void *closure)
4101 : {
4102 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(py_obj);
4103 0 : if (value == NULL) {
4104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
4105 0 : return -1;
4106 : }
4107 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
4108 0 : return 0;
4109 : }
4110 :
4111 : static PyGetSetDef py_wbint_LookupSids_getsetters[] = {
4112 : {
4113 : .name = discard_const_p(char, "in_sids"),
4114 : .get = py_wbint_LookupSids_in_get_sids,
4115 : .set = py_wbint_LookupSids_in_set_sids,
4116 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
4117 : },
4118 : {
4119 : .name = discard_const_p(char, "out_domains"),
4120 : .get = py_wbint_LookupSids_out_get_domains,
4121 : .set = py_wbint_LookupSids_out_set_domains,
4122 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
4123 : },
4124 : {
4125 : .name = discard_const_p(char, "out_names"),
4126 : .get = py_wbint_LookupSids_out_get_names,
4127 : .set = py_wbint_LookupSids_out_set_names,
4128 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
4129 : },
4130 : {
4131 : .name = discard_const_p(char, "result"),
4132 : .get = py_wbint_LookupSids_get_result,
4133 : .set = py_wbint_LookupSids_set_result,
4134 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
4135 : },
4136 : { .name = NULL }
4137 : };
4138 :
4139 0 : static PyObject *py_wbint_LookupSids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4140 : {
4141 0 : PyObject *self = pytalloc_new(struct wbint_LookupSids, type);
4142 0 : struct wbint_LookupSids *_self = (struct wbint_LookupSids *)pytalloc_get_ptr(self);
4143 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
4144 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
4145 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList);
4146 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
4147 0 : return self;
4148 : }
4149 :
4150 0 : static PyObject *py_wbint_LookupSids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
4151 : {
4152 :
4153 :
4154 0 : return PyLong_FromLong(2);
4155 : }
4156 :
4157 0 : static PyObject *py_wbint_LookupSids_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
4158 : {
4159 0 : const struct ndr_interface_call *call = NULL;
4160 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(py_obj);
4161 0 : PyObject *ret = NULL;
4162 0 : struct ndr_push *push = NULL;
4163 0 : DATA_BLOB blob;
4164 0 : enum ndr_err_code err;
4165 :
4166 0 : if (ndr_table_winbind.num_calls < 3) {
4167 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_pack");
4168 0 : return NULL;
4169 : }
4170 0 : call = &ndr_table_winbind.calls[2];
4171 :
4172 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
4173 0 : if (push == NULL) {
4174 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4175 0 : return NULL;
4176 : }
4177 :
4178 0 : push->flags |= ndr_push_flags;
4179 :
4180 0 : err = call->ndr_push(push, ndr_inout_flags, object);
4181 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4182 0 : TALLOC_FREE(push);
4183 0 : PyErr_SetNdrError(err);
4184 0 : return NULL;
4185 : }
4186 0 : blob = ndr_push_blob(push);
4187 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4188 0 : TALLOC_FREE(push);
4189 0 : return ret;
4190 : }
4191 :
4192 0 : static PyObject *py_wbint_LookupSids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4193 : {
4194 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4195 0 : PyObject *bigendian_obj = NULL;
4196 0 : PyObject *ndr64_obj = NULL;
4197 0 : libndr_flags ndr_push_flags = 0;
4198 :
4199 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
4200 : discard_const_p(char *, kwnames),
4201 : &bigendian_obj,
4202 : &ndr64_obj)) {
4203 0 : return NULL;
4204 : }
4205 :
4206 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4207 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4208 : }
4209 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4210 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4211 : }
4212 :
4213 0 : return py_wbint_LookupSids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
4214 : }
4215 :
4216 0 : static PyObject *py_wbint_LookupSids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4217 : {
4218 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4219 0 : PyObject *bigendian_obj = NULL;
4220 0 : PyObject *ndr64_obj = NULL;
4221 0 : libndr_flags ndr_push_flags = 0;
4222 :
4223 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
4224 : discard_const_p(char *, kwnames),
4225 : &bigendian_obj,
4226 : &ndr64_obj)) {
4227 0 : return NULL;
4228 : }
4229 :
4230 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4231 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4232 : }
4233 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4234 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4235 : }
4236 :
4237 0 : return py_wbint_LookupSids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
4238 : }
4239 :
4240 0 : static PyObject *py_wbint_LookupSids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
4241 : {
4242 0 : const struct ndr_interface_call *call = NULL;
4243 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(py_obj);
4244 0 : struct ndr_pull *pull = NULL;
4245 0 : enum ndr_err_code err;
4246 :
4247 0 : if (ndr_table_winbind.num_calls < 3) {
4248 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_unpack");
4249 0 : return NULL;
4250 : }
4251 0 : call = &ndr_table_winbind.calls[2];
4252 :
4253 0 : pull = ndr_pull_init_blob(blob, object);
4254 0 : if (pull == NULL) {
4255 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4256 0 : return NULL;
4257 : }
4258 :
4259 0 : pull->flags |= ndr_pull_flags;
4260 :
4261 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
4262 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4263 0 : TALLOC_FREE(pull);
4264 0 : PyErr_SetNdrError(err);
4265 0 : return NULL;
4266 : }
4267 0 : if (!allow_remaining) {
4268 0 : uint32_t highest_ofs;
4269 :
4270 0 : if (pull->offset > pull->relative_highest_offset) {
4271 0 : highest_ofs = pull->offset;
4272 : } else {
4273 0 : highest_ofs = pull->relative_highest_offset;
4274 : }
4275 0 : if (highest_ofs < pull->data_size) {
4276 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
4277 : "not all bytes consumed ofs[%u] size[%u]",
4278 : highest_ofs, pull->data_size);
4279 0 : TALLOC_FREE(pull);
4280 0 : PyErr_SetNdrError(err);
4281 0 : return NULL;
4282 : }
4283 : }
4284 :
4285 0 : TALLOC_FREE(pull);
4286 0 : Py_RETURN_NONE;
4287 : }
4288 :
4289 0 : static PyObject *py_wbint_LookupSids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4290 : {
4291 0 : DATA_BLOB blob;
4292 0 : Py_ssize_t blob_length = 0;
4293 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4294 0 : PyObject *bigendian_obj = NULL;
4295 0 : PyObject *ndr64_obj = NULL;
4296 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4297 0 : PyObject *allow_remaining_obj = NULL;
4298 0 : bool allow_remaining = false;
4299 :
4300 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
4301 : discard_const_p(char *, kwnames),
4302 : &blob.data, &blob_length,
4303 : &bigendian_obj,
4304 : &ndr64_obj,
4305 : &allow_remaining_obj)) {
4306 0 : return NULL;
4307 : }
4308 0 : blob.length = blob_length;
4309 :
4310 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4311 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4312 : }
4313 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4314 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4315 : }
4316 :
4317 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4318 0 : allow_remaining = true;
4319 : }
4320 :
4321 0 : return py_wbint_LookupSids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
4322 : }
4323 :
4324 0 : static PyObject *py_wbint_LookupSids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4325 : {
4326 0 : DATA_BLOB blob;
4327 0 : Py_ssize_t blob_length = 0;
4328 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4329 0 : PyObject *bigendian_obj = NULL;
4330 0 : PyObject *ndr64_obj = NULL;
4331 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4332 0 : PyObject *allow_remaining_obj = NULL;
4333 0 : bool allow_remaining = false;
4334 :
4335 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
4336 : discard_const_p(char *, kwnames),
4337 : &blob.data, &blob_length,
4338 : &bigendian_obj,
4339 : &ndr64_obj,
4340 : &allow_remaining_obj)) {
4341 0 : return NULL;
4342 : }
4343 0 : blob.length = blob_length;
4344 :
4345 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4346 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4347 : }
4348 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4349 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4350 : }
4351 :
4352 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4353 0 : allow_remaining = true;
4354 : }
4355 :
4356 0 : return py_wbint_LookupSids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
4357 : }
4358 :
4359 0 : static PyObject *py_wbint_LookupSids_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
4360 : {
4361 0 : const struct ndr_interface_call *call = NULL;
4362 0 : struct wbint_LookupSids *object = pytalloc_get_ptr(py_obj);
4363 0 : PyObject *ret;
4364 0 : char *retstr;
4365 :
4366 0 : if (ndr_table_winbind.num_calls < 3) {
4367 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupSids_ndr_print");
4368 0 : return NULL;
4369 : }
4370 0 : call = &ndr_table_winbind.calls[2];
4371 :
4372 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
4373 0 : ret = PyUnicode_FromString(retstr);
4374 0 : TALLOC_FREE(retstr);
4375 :
4376 0 : return ret;
4377 : }
4378 :
4379 0 : static PyObject *py_wbint_LookupSids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4380 : {
4381 0 : return py_wbint_LookupSids_ndr_print(py_obj, "wbint_LookupSids_in", NDR_IN);
4382 : }
4383 :
4384 0 : static PyObject *py_wbint_LookupSids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4385 : {
4386 0 : return py_wbint_LookupSids_ndr_print(py_obj, "wbint_LookupSids_out", NDR_OUT);
4387 : }
4388 :
4389 : static PyMethodDef py_wbint_LookupSids_methods[] = {
4390 : { "opnum", (PyCFunction)py_wbint_LookupSids_ndr_opnum, METH_NOARGS|METH_CLASS,
4391 : "winbind.wbint_LookupSids.opnum() -> 2 (0x02) " },
4392 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
4393 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
4394 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
4395 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
4396 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
4397 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
4398 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupSids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
4399 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
4400 : { "__ndr_print_in__", (PyCFunction)py_wbint_LookupSids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
4401 : { "__ndr_print_out__", (PyCFunction)py_wbint_LookupSids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
4402 : { NULL, NULL, 0, NULL }
4403 : };
4404 :
4405 :
4406 : static PyTypeObject wbint_LookupSids_Type = {
4407 : PyVarObject_HEAD_INIT(NULL, 0)
4408 : .tp_name = "winbind.wbint_LookupSids",
4409 : .tp_getset = py_wbint_LookupSids_getsetters,
4410 : .tp_methods = py_wbint_LookupSids_methods,
4411 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4412 : .tp_new = py_wbint_LookupSids_new,
4413 : };
4414 :
4415 0 : static bool pack_py_wbint_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupSids *r)
4416 : {
4417 0 : PyObject *py_sids;
4418 0 : const char *kwnames[] = {
4419 : "sids", NULL
4420 : };
4421 :
4422 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupSids", discard_const_p(char *, kwnames), &py_sids)) {
4423 0 : return false;
4424 : }
4425 :
4426 0 : if (py_sids == NULL) {
4427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
4428 0 : return false;
4429 : }
4430 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
4431 0 : if (r->in.sids == NULL) {
4432 0 : PyErr_NoMemory();
4433 0 : return false;
4434 : }
4435 0 : PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
4436 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
4437 0 : PyErr_NoMemory();
4438 0 : return false;
4439 : }
4440 0 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
4441 0 : return true;
4442 : }
4443 :
4444 0 : static PyObject *unpack_py_wbint_LookupSids_args_out(struct wbint_LookupSids *r)
4445 : {
4446 0 : PyObject *result;
4447 0 : PyObject *py_domains;
4448 0 : PyObject *py_names;
4449 0 : result = PyTuple_New(2);
4450 0 : py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, r->out.domains, r->out.domains);
4451 0 : PyTuple_SetItem(result, 0, py_domains);
4452 0 : py_names = pytalloc_reference_ex(lsa_TransNameArray_Type, r->out.names, r->out.names);
4453 0 : PyTuple_SetItem(result, 1, py_names);
4454 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
4455 0 : PyErr_SetNTSTATUS(r->out.result);
4456 0 : return NULL;
4457 : }
4458 :
4459 0 : return result;
4460 : }
4461 :
4462 :
4463 0 : static PyObject *py_wbint_LookupName_in_get_domain(PyObject *obj, void *closure)
4464 : {
4465 0 : struct wbint_LookupName *object = pytalloc_get_ptr(obj);
4466 0 : PyObject *py_domain;
4467 0 : if (object->in.domain == NULL) {
4468 0 : Py_RETURN_NONE;
4469 : }
4470 0 : if (object->in.domain == NULL) {
4471 0 : py_domain = Py_None;
4472 0 : Py_INCREF(py_domain);
4473 : } else {
4474 0 : py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore");
4475 : }
4476 0 : return py_domain;
4477 : }
4478 :
4479 0 : static int py_wbint_LookupName_in_set_domain(PyObject *py_obj, PyObject *value, void *closure)
4480 : {
4481 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4482 0 : if (value == NULL) {
4483 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain");
4484 0 : return -1;
4485 : }
4486 0 : object->in.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain);
4487 0 : if (object->in.domain == NULL) {
4488 0 : PyErr_NoMemory();
4489 0 : return -1;
4490 : }
4491 : {
4492 0 : const char *test_str;
4493 0 : const char *talloc_str;
4494 0 : PyObject *unicode = NULL;
4495 0 : if (PyUnicode_Check(value)) {
4496 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
4497 0 : if (unicode == NULL) {
4498 0 : return -1;
4499 : }
4500 0 : test_str = PyBytes_AS_STRING(unicode);
4501 0 : } else if (PyBytes_Check(value)) {
4502 0 : test_str = PyBytes_AS_STRING(value);
4503 : } else {
4504 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
4505 0 : return -1;
4506 : }
4507 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
4508 0 : if (unicode != NULL) {
4509 0 : Py_DECREF(unicode);
4510 : }
4511 0 : if (talloc_str == NULL) {
4512 0 : PyErr_NoMemory();
4513 0 : return -1;
4514 : }
4515 0 : object->in.domain = talloc_str;
4516 : }
4517 0 : return 0;
4518 : }
4519 :
4520 0 : static PyObject *py_wbint_LookupName_in_get_name(PyObject *obj, void *closure)
4521 : {
4522 0 : struct wbint_LookupName *object = pytalloc_get_ptr(obj);
4523 0 : PyObject *py_name;
4524 0 : if (object->in.name == NULL) {
4525 0 : Py_RETURN_NONE;
4526 : }
4527 0 : if (object->in.name == NULL) {
4528 0 : py_name = Py_None;
4529 0 : Py_INCREF(py_name);
4530 : } else {
4531 0 : py_name = PyUnicode_Decode(object->in.name, strlen(object->in.name), "utf-8", "ignore");
4532 : }
4533 0 : return py_name;
4534 : }
4535 :
4536 0 : static int py_wbint_LookupName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
4537 : {
4538 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4539 0 : if (value == NULL) {
4540 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
4541 0 : return -1;
4542 : }
4543 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
4544 0 : if (object->in.name == NULL) {
4545 0 : PyErr_NoMemory();
4546 0 : return -1;
4547 : }
4548 : {
4549 0 : const char *test_str;
4550 0 : const char *talloc_str;
4551 0 : PyObject *unicode = NULL;
4552 0 : if (PyUnicode_Check(value)) {
4553 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
4554 0 : if (unicode == NULL) {
4555 0 : return -1;
4556 : }
4557 0 : test_str = PyBytes_AS_STRING(unicode);
4558 0 : } else if (PyBytes_Check(value)) {
4559 0 : test_str = PyBytes_AS_STRING(value);
4560 : } else {
4561 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
4562 0 : return -1;
4563 : }
4564 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
4565 0 : if (unicode != NULL) {
4566 0 : Py_DECREF(unicode);
4567 : }
4568 0 : if (talloc_str == NULL) {
4569 0 : PyErr_NoMemory();
4570 0 : return -1;
4571 : }
4572 0 : object->in.name = talloc_str;
4573 : }
4574 0 : return 0;
4575 : }
4576 :
4577 0 : static PyObject *py_wbint_LookupName_in_get_flags(PyObject *obj, void *closure)
4578 : {
4579 0 : struct wbint_LookupName *object = pytalloc_get_ptr(obj);
4580 0 : PyObject *py_flags;
4581 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
4582 0 : return py_flags;
4583 : }
4584 :
4585 0 : static int py_wbint_LookupName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
4586 : {
4587 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4588 0 : if (value == NULL) {
4589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
4590 0 : return -1;
4591 : }
4592 : {
4593 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
4594 0 : if (PyLong_Check(value)) {
4595 0 : unsigned long long test_var;
4596 0 : test_var = PyLong_AsUnsignedLongLong(value);
4597 0 : if (PyErr_Occurred() != NULL) {
4598 0 : return -1;
4599 : }
4600 0 : if (test_var > uint_max) {
4601 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4602 : PyLong_Type.tp_name, uint_max, test_var);
4603 0 : return -1;
4604 : }
4605 0 : object->in.flags = test_var;
4606 : } else {
4607 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4608 : PyLong_Type.tp_name);
4609 0 : return -1;
4610 : }
4611 : }
4612 0 : return 0;
4613 : }
4614 :
4615 0 : static PyObject *py_wbint_LookupName_out_get_type(PyObject *obj, void *closure)
4616 : {
4617 0 : struct wbint_LookupName *object = pytalloc_get_ptr(obj);
4618 0 : PyObject *py_type;
4619 0 : if (object->out.type == NULL) {
4620 0 : Py_RETURN_NONE;
4621 : }
4622 0 : py_type = PyLong_FromLong((uint16_t)(*object->out.type));
4623 0 : return py_type;
4624 : }
4625 :
4626 0 : static int py_wbint_LookupName_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
4627 : {
4628 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4629 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
4630 0 : if (value == NULL) {
4631 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.type");
4632 0 : return -1;
4633 : }
4634 0 : object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
4635 0 : if (object->out.type == NULL) {
4636 0 : PyErr_NoMemory();
4637 0 : return -1;
4638 : }
4639 : {
4640 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
4641 0 : if (PyLong_Check(value)) {
4642 0 : unsigned long long test_var;
4643 0 : test_var = PyLong_AsUnsignedLongLong(value);
4644 0 : if (PyErr_Occurred() != NULL) {
4645 0 : return -1;
4646 : }
4647 0 : if (test_var > uint_max) {
4648 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4649 : PyLong_Type.tp_name, uint_max, test_var);
4650 0 : return -1;
4651 : }
4652 0 : *object->out.type = test_var;
4653 : } else {
4654 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4655 : PyLong_Type.tp_name);
4656 0 : return -1;
4657 : }
4658 : }
4659 0 : return 0;
4660 : }
4661 :
4662 0 : static PyObject *py_wbint_LookupName_out_get_sid(PyObject *obj, void *closure)
4663 : {
4664 0 : struct wbint_LookupName *object = pytalloc_get_ptr(obj);
4665 0 : PyObject *py_sid;
4666 0 : if (object->out.sid == NULL) {
4667 0 : Py_RETURN_NONE;
4668 : }
4669 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->out.sid, object->out.sid);
4670 0 : return py_sid;
4671 : }
4672 :
4673 0 : static int py_wbint_LookupName_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
4674 : {
4675 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4676 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
4677 0 : if (value == NULL) {
4678 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sid");
4679 0 : return -1;
4680 : }
4681 0 : object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
4682 0 : if (object->out.sid == NULL) {
4683 0 : PyErr_NoMemory();
4684 0 : return -1;
4685 : }
4686 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
4687 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4688 0 : PyErr_NoMemory();
4689 0 : return -1;
4690 : }
4691 0 : object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
4692 0 : return 0;
4693 : }
4694 :
4695 0 : static PyObject *py_wbint_LookupName_get_result(PyObject *obj, void *closure)
4696 : {
4697 0 : struct wbint_LookupName *object = pytalloc_get_ptr(obj);
4698 0 : PyObject *py_result;
4699 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
4700 0 : return py_result;
4701 : }
4702 :
4703 0 : static int py_wbint_LookupName_set_result(PyObject *py_obj, PyObject *value, void *closure)
4704 : {
4705 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4706 0 : if (value == NULL) {
4707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
4708 0 : return -1;
4709 : }
4710 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
4711 0 : return 0;
4712 : }
4713 :
4714 : static PyGetSetDef py_wbint_LookupName_getsetters[] = {
4715 : {
4716 : .name = discard_const_p(char, "in_domain"),
4717 : .get = py_wbint_LookupName_in_get_domain,
4718 : .set = py_wbint_LookupName_in_set_domain,
4719 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4720 : },
4721 : {
4722 : .name = discard_const_p(char, "in_name"),
4723 : .get = py_wbint_LookupName_in_get_name,
4724 : .set = py_wbint_LookupName_in_set_name,
4725 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4726 : },
4727 : {
4728 : .name = discard_const_p(char, "in_flags"),
4729 : .get = py_wbint_LookupName_in_get_flags,
4730 : .set = py_wbint_LookupName_in_set_flags,
4731 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4732 : },
4733 : {
4734 : .name = discard_const_p(char, "out_type"),
4735 : .get = py_wbint_LookupName_out_get_type,
4736 : .set = py_wbint_LookupName_out_set_type,
4737 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
4738 : },
4739 : {
4740 : .name = discard_const_p(char, "out_sid"),
4741 : .get = py_wbint_LookupName_out_get_sid,
4742 : .set = py_wbint_LookupName_out_set_sid,
4743 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
4744 : },
4745 : {
4746 : .name = discard_const_p(char, "result"),
4747 : .get = py_wbint_LookupName_get_result,
4748 : .set = py_wbint_LookupName_set_result,
4749 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
4750 : },
4751 : { .name = NULL }
4752 : };
4753 :
4754 0 : static PyObject *py_wbint_LookupName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4755 : {
4756 0 : PyObject *self = pytalloc_new(struct wbint_LookupName, type);
4757 0 : struct wbint_LookupName *_self = (struct wbint_LookupName *)pytalloc_get_ptr(self);
4758 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
4759 0 : _self->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
4760 0 : _self->out.sid = talloc_zero(mem_ctx, struct dom_sid);
4761 0 : return self;
4762 : }
4763 :
4764 0 : static PyObject *py_wbint_LookupName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
4765 : {
4766 :
4767 :
4768 0 : return PyLong_FromLong(3);
4769 : }
4770 :
4771 0 : static PyObject *py_wbint_LookupName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
4772 : {
4773 0 : const struct ndr_interface_call *call = NULL;
4774 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4775 0 : PyObject *ret = NULL;
4776 0 : struct ndr_push *push = NULL;
4777 0 : DATA_BLOB blob;
4778 0 : enum ndr_err_code err;
4779 :
4780 0 : if (ndr_table_winbind.num_calls < 4) {
4781 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_pack");
4782 0 : return NULL;
4783 : }
4784 0 : call = &ndr_table_winbind.calls[3];
4785 :
4786 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
4787 0 : if (push == NULL) {
4788 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4789 0 : return NULL;
4790 : }
4791 :
4792 0 : push->flags |= ndr_push_flags;
4793 :
4794 0 : err = call->ndr_push(push, ndr_inout_flags, object);
4795 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4796 0 : TALLOC_FREE(push);
4797 0 : PyErr_SetNdrError(err);
4798 0 : return NULL;
4799 : }
4800 0 : blob = ndr_push_blob(push);
4801 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4802 0 : TALLOC_FREE(push);
4803 0 : return ret;
4804 : }
4805 :
4806 0 : static PyObject *py_wbint_LookupName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4807 : {
4808 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4809 0 : PyObject *bigendian_obj = NULL;
4810 0 : PyObject *ndr64_obj = NULL;
4811 0 : libndr_flags ndr_push_flags = 0;
4812 :
4813 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
4814 : discard_const_p(char *, kwnames),
4815 : &bigendian_obj,
4816 : &ndr64_obj)) {
4817 0 : return NULL;
4818 : }
4819 :
4820 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4821 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4822 : }
4823 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4824 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4825 : }
4826 :
4827 0 : return py_wbint_LookupName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
4828 : }
4829 :
4830 0 : static PyObject *py_wbint_LookupName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4831 : {
4832 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4833 0 : PyObject *bigendian_obj = NULL;
4834 0 : PyObject *ndr64_obj = NULL;
4835 0 : libndr_flags ndr_push_flags = 0;
4836 :
4837 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
4838 : discard_const_p(char *, kwnames),
4839 : &bigendian_obj,
4840 : &ndr64_obj)) {
4841 0 : return NULL;
4842 : }
4843 :
4844 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4845 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4846 : }
4847 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4848 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4849 : }
4850 :
4851 0 : return py_wbint_LookupName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
4852 : }
4853 :
4854 0 : static PyObject *py_wbint_LookupName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
4855 : {
4856 0 : const struct ndr_interface_call *call = NULL;
4857 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4858 0 : struct ndr_pull *pull = NULL;
4859 0 : enum ndr_err_code err;
4860 :
4861 0 : if (ndr_table_winbind.num_calls < 4) {
4862 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_unpack");
4863 0 : return NULL;
4864 : }
4865 0 : call = &ndr_table_winbind.calls[3];
4866 :
4867 0 : pull = ndr_pull_init_blob(blob, object);
4868 0 : if (pull == NULL) {
4869 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4870 0 : return NULL;
4871 : }
4872 :
4873 0 : pull->flags |= ndr_pull_flags;
4874 :
4875 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
4876 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4877 0 : TALLOC_FREE(pull);
4878 0 : PyErr_SetNdrError(err);
4879 0 : return NULL;
4880 : }
4881 0 : if (!allow_remaining) {
4882 0 : uint32_t highest_ofs;
4883 :
4884 0 : if (pull->offset > pull->relative_highest_offset) {
4885 0 : highest_ofs = pull->offset;
4886 : } else {
4887 0 : highest_ofs = pull->relative_highest_offset;
4888 : }
4889 0 : if (highest_ofs < pull->data_size) {
4890 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
4891 : "not all bytes consumed ofs[%u] size[%u]",
4892 : highest_ofs, pull->data_size);
4893 0 : TALLOC_FREE(pull);
4894 0 : PyErr_SetNdrError(err);
4895 0 : return NULL;
4896 : }
4897 : }
4898 :
4899 0 : TALLOC_FREE(pull);
4900 0 : Py_RETURN_NONE;
4901 : }
4902 :
4903 0 : static PyObject *py_wbint_LookupName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4904 : {
4905 0 : DATA_BLOB blob;
4906 0 : Py_ssize_t blob_length = 0;
4907 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4908 0 : PyObject *bigendian_obj = NULL;
4909 0 : PyObject *ndr64_obj = NULL;
4910 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4911 0 : PyObject *allow_remaining_obj = NULL;
4912 0 : bool allow_remaining = false;
4913 :
4914 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
4915 : discard_const_p(char *, kwnames),
4916 : &blob.data, &blob_length,
4917 : &bigendian_obj,
4918 : &ndr64_obj,
4919 : &allow_remaining_obj)) {
4920 0 : return NULL;
4921 : }
4922 0 : blob.length = blob_length;
4923 :
4924 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4925 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4926 : }
4927 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4928 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4929 : }
4930 :
4931 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4932 0 : allow_remaining = true;
4933 : }
4934 :
4935 0 : return py_wbint_LookupName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
4936 : }
4937 :
4938 0 : static PyObject *py_wbint_LookupName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4939 : {
4940 0 : DATA_BLOB blob;
4941 0 : Py_ssize_t blob_length = 0;
4942 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4943 0 : PyObject *bigendian_obj = NULL;
4944 0 : PyObject *ndr64_obj = NULL;
4945 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4946 0 : PyObject *allow_remaining_obj = NULL;
4947 0 : bool allow_remaining = false;
4948 :
4949 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
4950 : discard_const_p(char *, kwnames),
4951 : &blob.data, &blob_length,
4952 : &bigendian_obj,
4953 : &ndr64_obj,
4954 : &allow_remaining_obj)) {
4955 0 : return NULL;
4956 : }
4957 0 : blob.length = blob_length;
4958 :
4959 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4960 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4961 : }
4962 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4963 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4964 : }
4965 :
4966 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4967 0 : allow_remaining = true;
4968 : }
4969 :
4970 0 : return py_wbint_LookupName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
4971 : }
4972 :
4973 0 : static PyObject *py_wbint_LookupName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
4974 : {
4975 0 : const struct ndr_interface_call *call = NULL;
4976 0 : struct wbint_LookupName *object = pytalloc_get_ptr(py_obj);
4977 0 : PyObject *ret;
4978 0 : char *retstr;
4979 :
4980 0 : if (ndr_table_winbind.num_calls < 4) {
4981 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupName_ndr_print");
4982 0 : return NULL;
4983 : }
4984 0 : call = &ndr_table_winbind.calls[3];
4985 :
4986 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
4987 0 : ret = PyUnicode_FromString(retstr);
4988 0 : TALLOC_FREE(retstr);
4989 :
4990 0 : return ret;
4991 : }
4992 :
4993 0 : static PyObject *py_wbint_LookupName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4994 : {
4995 0 : return py_wbint_LookupName_ndr_print(py_obj, "wbint_LookupName_in", NDR_IN);
4996 : }
4997 :
4998 0 : static PyObject *py_wbint_LookupName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4999 : {
5000 0 : return py_wbint_LookupName_ndr_print(py_obj, "wbint_LookupName_out", NDR_OUT);
5001 : }
5002 :
5003 : static PyMethodDef py_wbint_LookupName_methods[] = {
5004 : { "opnum", (PyCFunction)py_wbint_LookupName_ndr_opnum, METH_NOARGS|METH_CLASS,
5005 : "winbind.wbint_LookupName.opnum() -> 3 (0x03) " },
5006 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
5007 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
5008 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
5009 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
5010 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
5011 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
5012 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
5013 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
5014 : { "__ndr_print_in__", (PyCFunction)py_wbint_LookupName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
5015 : { "__ndr_print_out__", (PyCFunction)py_wbint_LookupName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
5016 : { NULL, NULL, 0, NULL }
5017 : };
5018 :
5019 :
5020 : static PyTypeObject wbint_LookupName_Type = {
5021 : PyVarObject_HEAD_INIT(NULL, 0)
5022 : .tp_name = "winbind.wbint_LookupName",
5023 : .tp_getset = py_wbint_LookupName_getsetters,
5024 : .tp_methods = py_wbint_LookupName_methods,
5025 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5026 : .tp_new = py_wbint_LookupName_new,
5027 : };
5028 :
5029 0 : static bool pack_py_wbint_LookupName_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupName *r)
5030 : {
5031 0 : PyObject *py_domain;
5032 0 : PyObject *py_name;
5033 0 : PyObject *py_flags;
5034 0 : const char *kwnames[] = {
5035 : "domain", "name", "flags", NULL
5036 : };
5037 :
5038 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:wbint_LookupName", discard_const_p(char *, kwnames), &py_domain, &py_name, &py_flags)) {
5039 0 : return false;
5040 : }
5041 :
5042 0 : if (py_domain == NULL) {
5043 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain");
5044 0 : return false;
5045 : }
5046 0 : r->in.domain = talloc_ptrtype(r, r->in.domain);
5047 0 : if (r->in.domain == NULL) {
5048 0 : PyErr_NoMemory();
5049 0 : return false;
5050 : }
5051 : {
5052 0 : const char *test_str;
5053 0 : const char *talloc_str;
5054 0 : PyObject *unicode = NULL;
5055 0 : if (PyUnicode_Check(py_domain)) {
5056 0 : unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore");
5057 0 : if (unicode == NULL) {
5058 0 : return false;
5059 : }
5060 0 : test_str = PyBytes_AS_STRING(unicode);
5061 0 : } else if (PyBytes_Check(py_domain)) {
5062 0 : test_str = PyBytes_AS_STRING(py_domain);
5063 : } else {
5064 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name);
5065 0 : return false;
5066 : }
5067 0 : talloc_str = talloc_strdup(r, test_str);
5068 0 : if (unicode != NULL) {
5069 0 : Py_DECREF(unicode);
5070 : }
5071 0 : if (talloc_str == NULL) {
5072 0 : PyErr_NoMemory();
5073 0 : return false;
5074 : }
5075 0 : r->in.domain = talloc_str;
5076 : }
5077 0 : if (py_name == NULL) {
5078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
5079 0 : return false;
5080 : }
5081 0 : r->in.name = talloc_ptrtype(r, r->in.name);
5082 0 : if (r->in.name == NULL) {
5083 0 : PyErr_NoMemory();
5084 0 : return false;
5085 : }
5086 : {
5087 0 : const char *test_str;
5088 0 : const char *talloc_str;
5089 0 : PyObject *unicode = NULL;
5090 0 : if (PyUnicode_Check(py_name)) {
5091 0 : unicode = PyUnicode_AsEncodedString(py_name, "utf-8", "ignore");
5092 0 : if (unicode == NULL) {
5093 0 : return false;
5094 : }
5095 0 : test_str = PyBytes_AS_STRING(unicode);
5096 0 : } else if (PyBytes_Check(py_name)) {
5097 0 : test_str = PyBytes_AS_STRING(py_name);
5098 : } else {
5099 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_name)->tp_name);
5100 0 : return false;
5101 : }
5102 0 : talloc_str = talloc_strdup(r, test_str);
5103 0 : if (unicode != NULL) {
5104 0 : Py_DECREF(unicode);
5105 : }
5106 0 : if (talloc_str == NULL) {
5107 0 : PyErr_NoMemory();
5108 0 : return false;
5109 : }
5110 0 : r->in.name = talloc_str;
5111 : }
5112 0 : if (py_flags == NULL) {
5113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
5114 0 : return false;
5115 : }
5116 : {
5117 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
5118 0 : if (PyLong_Check(py_flags)) {
5119 0 : unsigned long long test_var;
5120 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
5121 0 : if (PyErr_Occurred() != NULL) {
5122 0 : return false;
5123 : }
5124 0 : if (test_var > uint_max) {
5125 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5126 : PyLong_Type.tp_name, uint_max, test_var);
5127 0 : return false;
5128 : }
5129 0 : r->in.flags = test_var;
5130 : } else {
5131 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5132 : PyLong_Type.tp_name);
5133 0 : return false;
5134 : }
5135 : }
5136 0 : return true;
5137 : }
5138 :
5139 0 : static PyObject *unpack_py_wbint_LookupName_args_out(struct wbint_LookupName *r)
5140 : {
5141 0 : PyObject *result;
5142 0 : PyObject *py_type;
5143 0 : PyObject *py_sid;
5144 0 : result = PyTuple_New(2);
5145 0 : py_type = PyLong_FromLong((uint16_t)(*r->out.type));
5146 0 : PyTuple_SetItem(result, 0, py_type);
5147 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, r->out.sid, r->out.sid);
5148 0 : PyTuple_SetItem(result, 1, py_sid);
5149 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
5150 0 : PyErr_SetNTSTATUS(r->out.result);
5151 0 : return NULL;
5152 : }
5153 :
5154 0 : return result;
5155 : }
5156 :
5157 :
5158 0 : static PyObject *py_wbint_Sids2UnixIDs_in_get_domains(PyObject *obj, void *closure)
5159 : {
5160 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(obj);
5161 0 : PyObject *py_domains;
5162 0 : if (object->in.domains == NULL) {
5163 0 : Py_RETURN_NONE;
5164 : }
5165 0 : py_domains = pytalloc_reference_ex(lsa_RefDomainList_Type, object->in.domains, object->in.domains);
5166 0 : return py_domains;
5167 : }
5168 :
5169 0 : static int py_wbint_Sids2UnixIDs_in_set_domains(PyObject *py_obj, PyObject *value, void *closure)
5170 : {
5171 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(py_obj);
5172 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domains));
5173 0 : if (value == NULL) {
5174 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domains");
5175 0 : return -1;
5176 : }
5177 0 : object->in.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domains);
5178 0 : if (object->in.domains == NULL) {
5179 0 : PyErr_NoMemory();
5180 0 : return -1;
5181 : }
5182 0 : PY_CHECK_TYPE(lsa_RefDomainList_Type, value, return -1;);
5183 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5184 0 : PyErr_NoMemory();
5185 0 : return -1;
5186 : }
5187 0 : object->in.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
5188 0 : return 0;
5189 : }
5190 :
5191 0 : static PyObject *py_wbint_Sids2UnixIDs_in_get_ids(PyObject *obj, void *closure)
5192 : {
5193 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(obj);
5194 0 : PyObject *py_ids;
5195 0 : if (object->in.ids == NULL) {
5196 0 : Py_RETURN_NONE;
5197 : }
5198 0 : py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, object->in.ids, object->in.ids);
5199 0 : return py_ids;
5200 : }
5201 :
5202 0 : static int py_wbint_Sids2UnixIDs_in_set_ids(PyObject *py_obj, PyObject *value, void *closure)
5203 : {
5204 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(py_obj);
5205 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.ids));
5206 0 : if (value == NULL) {
5207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.ids");
5208 0 : return -1;
5209 : }
5210 0 : object->in.ids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.ids);
5211 0 : if (object->in.ids == NULL) {
5212 0 : PyErr_NoMemory();
5213 0 : return -1;
5214 : }
5215 0 : PY_CHECK_TYPE(&wbint_TransIDArray_Type, value, return -1;);
5216 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5217 0 : PyErr_NoMemory();
5218 0 : return -1;
5219 : }
5220 0 : object->in.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(value);
5221 0 : return 0;
5222 : }
5223 :
5224 0 : static PyObject *py_wbint_Sids2UnixIDs_out_get_ids(PyObject *obj, void *closure)
5225 : {
5226 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(obj);
5227 0 : PyObject *py_ids;
5228 0 : if (object->out.ids == NULL) {
5229 0 : Py_RETURN_NONE;
5230 : }
5231 0 : py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, object->out.ids, object->out.ids);
5232 0 : return py_ids;
5233 : }
5234 :
5235 0 : static int py_wbint_Sids2UnixIDs_out_set_ids(PyObject *py_obj, PyObject *value, void *closure)
5236 : {
5237 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(py_obj);
5238 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ids));
5239 0 : if (value == NULL) {
5240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.ids");
5241 0 : return -1;
5242 : }
5243 0 : object->out.ids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ids);
5244 0 : if (object->out.ids == NULL) {
5245 0 : PyErr_NoMemory();
5246 0 : return -1;
5247 : }
5248 0 : PY_CHECK_TYPE(&wbint_TransIDArray_Type, value, return -1;);
5249 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5250 0 : PyErr_NoMemory();
5251 0 : return -1;
5252 : }
5253 0 : object->out.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(value);
5254 0 : return 0;
5255 : }
5256 :
5257 0 : static PyObject *py_wbint_Sids2UnixIDs_get_result(PyObject *obj, void *closure)
5258 : {
5259 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(obj);
5260 0 : PyObject *py_result;
5261 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
5262 0 : return py_result;
5263 : }
5264 :
5265 0 : static int py_wbint_Sids2UnixIDs_set_result(PyObject *py_obj, PyObject *value, void *closure)
5266 : {
5267 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(py_obj);
5268 0 : if (value == NULL) {
5269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
5270 0 : return -1;
5271 : }
5272 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
5273 0 : return 0;
5274 : }
5275 :
5276 : static PyGetSetDef py_wbint_Sids2UnixIDs_getsetters[] = {
5277 : {
5278 : .name = discard_const_p(char, "in_domains"),
5279 : .get = py_wbint_Sids2UnixIDs_in_get_domains,
5280 : .set = py_wbint_Sids2UnixIDs_in_set_domains,
5281 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
5282 : },
5283 : {
5284 : .name = discard_const_p(char, "in_ids"),
5285 : .get = py_wbint_Sids2UnixIDs_in_get_ids,
5286 : .set = py_wbint_Sids2UnixIDs_in_set_ids,
5287 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransIDArray")
5288 : },
5289 : {
5290 : .name = discard_const_p(char, "out_ids"),
5291 : .get = py_wbint_Sids2UnixIDs_out_get_ids,
5292 : .set = py_wbint_Sids2UnixIDs_out_set_ids,
5293 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_TransIDArray")
5294 : },
5295 : {
5296 : .name = discard_const_p(char, "result"),
5297 : .get = py_wbint_Sids2UnixIDs_get_result,
5298 : .set = py_wbint_Sids2UnixIDs_set_result,
5299 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
5300 : },
5301 : { .name = NULL }
5302 : };
5303 :
5304 0 : static PyObject *py_wbint_Sids2UnixIDs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5305 : {
5306 0 : PyObject *self = pytalloc_new(struct wbint_Sids2UnixIDs, type);
5307 0 : struct wbint_Sids2UnixIDs *_self = (struct wbint_Sids2UnixIDs *)pytalloc_get_ptr(self);
5308 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
5309 0 : _self->in.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList);
5310 0 : _self->in.ids = talloc_zero(mem_ctx, struct wbint_TransIDArray);
5311 0 : _self->out.ids = talloc_zero(mem_ctx, struct wbint_TransIDArray);
5312 0 : return self;
5313 : }
5314 :
5315 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5316 : {
5317 :
5318 :
5319 0 : return PyLong_FromLong(4);
5320 : }
5321 :
5322 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
5323 : {
5324 0 : const struct ndr_interface_call *call = NULL;
5325 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(py_obj);
5326 0 : PyObject *ret = NULL;
5327 0 : struct ndr_push *push = NULL;
5328 0 : DATA_BLOB blob;
5329 0 : enum ndr_err_code err;
5330 :
5331 0 : if (ndr_table_winbind.num_calls < 5) {
5332 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_pack");
5333 0 : return NULL;
5334 : }
5335 0 : call = &ndr_table_winbind.calls[4];
5336 :
5337 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5338 0 : if (push == NULL) {
5339 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5340 0 : return NULL;
5341 : }
5342 :
5343 0 : push->flags |= ndr_push_flags;
5344 :
5345 0 : err = call->ndr_push(push, ndr_inout_flags, object);
5346 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5347 0 : TALLOC_FREE(push);
5348 0 : PyErr_SetNdrError(err);
5349 0 : return NULL;
5350 : }
5351 0 : blob = ndr_push_blob(push);
5352 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5353 0 : TALLOC_FREE(push);
5354 0 : return ret;
5355 : }
5356 :
5357 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5358 : {
5359 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5360 0 : PyObject *bigendian_obj = NULL;
5361 0 : PyObject *ndr64_obj = NULL;
5362 0 : libndr_flags ndr_push_flags = 0;
5363 :
5364 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5365 : discard_const_p(char *, kwnames),
5366 : &bigendian_obj,
5367 : &ndr64_obj)) {
5368 0 : return NULL;
5369 : }
5370 :
5371 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5372 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5373 : }
5374 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5375 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5376 : }
5377 :
5378 0 : return py_wbint_Sids2UnixIDs_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
5379 : }
5380 :
5381 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5382 : {
5383 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5384 0 : PyObject *bigendian_obj = NULL;
5385 0 : PyObject *ndr64_obj = NULL;
5386 0 : libndr_flags ndr_push_flags = 0;
5387 :
5388 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
5389 : discard_const_p(char *, kwnames),
5390 : &bigendian_obj,
5391 : &ndr64_obj)) {
5392 0 : return NULL;
5393 : }
5394 :
5395 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5396 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5397 : }
5398 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5399 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5400 : }
5401 :
5402 0 : return py_wbint_Sids2UnixIDs_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
5403 : }
5404 :
5405 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
5406 : {
5407 0 : const struct ndr_interface_call *call = NULL;
5408 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(py_obj);
5409 0 : struct ndr_pull *pull = NULL;
5410 0 : enum ndr_err_code err;
5411 :
5412 0 : if (ndr_table_winbind.num_calls < 5) {
5413 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_unpack");
5414 0 : return NULL;
5415 : }
5416 0 : call = &ndr_table_winbind.calls[4];
5417 :
5418 0 : pull = ndr_pull_init_blob(blob, object);
5419 0 : if (pull == NULL) {
5420 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5421 0 : return NULL;
5422 : }
5423 :
5424 0 : pull->flags |= ndr_pull_flags;
5425 :
5426 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
5427 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5428 0 : TALLOC_FREE(pull);
5429 0 : PyErr_SetNdrError(err);
5430 0 : return NULL;
5431 : }
5432 0 : if (!allow_remaining) {
5433 0 : uint32_t highest_ofs;
5434 :
5435 0 : if (pull->offset > pull->relative_highest_offset) {
5436 0 : highest_ofs = pull->offset;
5437 : } else {
5438 0 : highest_ofs = pull->relative_highest_offset;
5439 : }
5440 0 : if (highest_ofs < pull->data_size) {
5441 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
5442 : "not all bytes consumed ofs[%u] size[%u]",
5443 : highest_ofs, pull->data_size);
5444 0 : TALLOC_FREE(pull);
5445 0 : PyErr_SetNdrError(err);
5446 0 : return NULL;
5447 : }
5448 : }
5449 :
5450 0 : TALLOC_FREE(pull);
5451 0 : Py_RETURN_NONE;
5452 : }
5453 :
5454 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5455 : {
5456 0 : DATA_BLOB blob;
5457 0 : Py_ssize_t blob_length = 0;
5458 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5459 0 : PyObject *bigendian_obj = NULL;
5460 0 : PyObject *ndr64_obj = NULL;
5461 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5462 0 : PyObject *allow_remaining_obj = NULL;
5463 0 : bool allow_remaining = false;
5464 :
5465 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
5466 : discard_const_p(char *, kwnames),
5467 : &blob.data, &blob_length,
5468 : &bigendian_obj,
5469 : &ndr64_obj,
5470 : &allow_remaining_obj)) {
5471 0 : return NULL;
5472 : }
5473 0 : blob.length = blob_length;
5474 :
5475 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5476 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5477 : }
5478 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5479 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5480 : }
5481 :
5482 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5483 0 : allow_remaining = true;
5484 : }
5485 :
5486 0 : return py_wbint_Sids2UnixIDs_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
5487 : }
5488 :
5489 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5490 : {
5491 0 : DATA_BLOB blob;
5492 0 : Py_ssize_t blob_length = 0;
5493 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5494 0 : PyObject *bigendian_obj = NULL;
5495 0 : PyObject *ndr64_obj = NULL;
5496 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5497 0 : PyObject *allow_remaining_obj = NULL;
5498 0 : bool allow_remaining = false;
5499 :
5500 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
5501 : discard_const_p(char *, kwnames),
5502 : &blob.data, &blob_length,
5503 : &bigendian_obj,
5504 : &ndr64_obj,
5505 : &allow_remaining_obj)) {
5506 0 : return NULL;
5507 : }
5508 0 : blob.length = blob_length;
5509 :
5510 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5511 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5512 : }
5513 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5514 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5515 : }
5516 :
5517 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5518 0 : allow_remaining = true;
5519 : }
5520 :
5521 0 : return py_wbint_Sids2UnixIDs_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
5522 : }
5523 :
5524 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
5525 : {
5526 0 : const struct ndr_interface_call *call = NULL;
5527 0 : struct wbint_Sids2UnixIDs *object = pytalloc_get_ptr(py_obj);
5528 0 : PyObject *ret;
5529 0 : char *retstr;
5530 :
5531 0 : if (ndr_table_winbind.num_calls < 5) {
5532 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_Sids2UnixIDs_ndr_print");
5533 0 : return NULL;
5534 : }
5535 0 : call = &ndr_table_winbind.calls[4];
5536 :
5537 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
5538 0 : ret = PyUnicode_FromString(retstr);
5539 0 : TALLOC_FREE(retstr);
5540 :
5541 0 : return ret;
5542 : }
5543 :
5544 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5545 : {
5546 0 : return py_wbint_Sids2UnixIDs_ndr_print(py_obj, "wbint_Sids2UnixIDs_in", NDR_IN);
5547 : }
5548 :
5549 0 : static PyObject *py_wbint_Sids2UnixIDs_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5550 : {
5551 0 : return py_wbint_Sids2UnixIDs_ndr_print(py_obj, "wbint_Sids2UnixIDs_out", NDR_OUT);
5552 : }
5553 :
5554 : static PyMethodDef py_wbint_Sids2UnixIDs_methods[] = {
5555 : { "opnum", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_opnum, METH_NOARGS|METH_CLASS,
5556 : "winbind.wbint_Sids2UnixIDs.opnum() -> 4 (0x04) " },
5557 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
5558 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
5559 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
5560 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
5561 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
5562 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
5563 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_Sids2UnixIDs_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
5564 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
5565 : { "__ndr_print_in__", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
5566 : { "__ndr_print_out__", (PyCFunction)py_wbint_Sids2UnixIDs_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
5567 : { NULL, NULL, 0, NULL }
5568 : };
5569 :
5570 :
5571 : static PyTypeObject wbint_Sids2UnixIDs_Type = {
5572 : PyVarObject_HEAD_INIT(NULL, 0)
5573 : .tp_name = "winbind.wbint_Sids2UnixIDs",
5574 : .tp_getset = py_wbint_Sids2UnixIDs_getsetters,
5575 : .tp_methods = py_wbint_Sids2UnixIDs_methods,
5576 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5577 : .tp_new = py_wbint_Sids2UnixIDs_new,
5578 : };
5579 :
5580 0 : static bool pack_py_wbint_Sids2UnixIDs_args_in(PyObject *args, PyObject *kwargs, struct wbint_Sids2UnixIDs *r)
5581 : {
5582 0 : PyObject *py_domains;
5583 0 : PyObject *py_ids;
5584 0 : const char *kwnames[] = {
5585 : "domains", "ids", NULL
5586 : };
5587 :
5588 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_Sids2UnixIDs", discard_const_p(char *, kwnames), &py_domains, &py_ids)) {
5589 0 : return false;
5590 : }
5591 :
5592 0 : if (py_domains == NULL) {
5593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domains");
5594 0 : return false;
5595 : }
5596 0 : r->in.domains = talloc_ptrtype(r, r->in.domains);
5597 0 : if (r->in.domains == NULL) {
5598 0 : PyErr_NoMemory();
5599 0 : return false;
5600 : }
5601 0 : PY_CHECK_TYPE(lsa_RefDomainList_Type, py_domains, return false;);
5602 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domains)) == NULL) {
5603 0 : PyErr_NoMemory();
5604 0 : return false;
5605 : }
5606 0 : r->in.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_domains);
5607 0 : if (py_ids == NULL) {
5608 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.ids");
5609 0 : return false;
5610 : }
5611 0 : r->in.ids = talloc_ptrtype(r, r->in.ids);
5612 0 : if (r->in.ids == NULL) {
5613 0 : PyErr_NoMemory();
5614 0 : return false;
5615 : }
5616 0 : PY_CHECK_TYPE(&wbint_TransIDArray_Type, py_ids, return false;);
5617 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_ids)) == NULL) {
5618 0 : PyErr_NoMemory();
5619 0 : return false;
5620 : }
5621 0 : r->in.ids = (struct wbint_TransIDArray *)pytalloc_get_ptr(py_ids);
5622 0 : return true;
5623 : }
5624 :
5625 0 : static PyObject *unpack_py_wbint_Sids2UnixIDs_args_out(struct wbint_Sids2UnixIDs *r)
5626 : {
5627 0 : PyObject *result;
5628 0 : PyObject *py_ids;
5629 0 : py_ids = pytalloc_reference_ex(&wbint_TransIDArray_Type, r->out.ids, r->out.ids);
5630 0 : result = py_ids;
5631 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
5632 0 : PyErr_SetNTSTATUS(r->out.result);
5633 0 : return NULL;
5634 : }
5635 :
5636 0 : return result;
5637 : }
5638 :
5639 :
5640 0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_domain_name(PyObject *obj, void *closure)
5641 : {
5642 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(obj);
5643 0 : PyObject *py_domain_name;
5644 0 : if (object->in.domain_name == NULL) {
5645 0 : Py_RETURN_NONE;
5646 : }
5647 0 : if (object->in.domain_name == NULL) {
5648 0 : py_domain_name = Py_None;
5649 0 : Py_INCREF(py_domain_name);
5650 : } else {
5651 0 : py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
5652 : }
5653 0 : return py_domain_name;
5654 : }
5655 :
5656 0 : static int py_wbint_UnixIDs2Sids_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
5657 : {
5658 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
5659 0 : if (value == NULL) {
5660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain_name");
5661 0 : return -1;
5662 : }
5663 0 : object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name);
5664 0 : if (object->in.domain_name == NULL) {
5665 0 : PyErr_NoMemory();
5666 0 : return -1;
5667 : }
5668 : {
5669 0 : const char *test_str;
5670 0 : const char *talloc_str;
5671 0 : PyObject *unicode = NULL;
5672 0 : if (PyUnicode_Check(value)) {
5673 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
5674 0 : if (unicode == NULL) {
5675 0 : return -1;
5676 : }
5677 0 : test_str = PyBytes_AS_STRING(unicode);
5678 0 : } else if (PyBytes_Check(value)) {
5679 0 : test_str = PyBytes_AS_STRING(value);
5680 : } else {
5681 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
5682 0 : return -1;
5683 : }
5684 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
5685 0 : if (unicode != NULL) {
5686 0 : Py_DECREF(unicode);
5687 : }
5688 0 : if (talloc_str == NULL) {
5689 0 : PyErr_NoMemory();
5690 0 : return -1;
5691 : }
5692 0 : object->in.domain_name = talloc_str;
5693 : }
5694 0 : return 0;
5695 : }
5696 :
5697 0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_domain_sid(PyObject *obj, void *closure)
5698 : {
5699 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(obj);
5700 0 : PyObject *py_domain_sid;
5701 0 : py_domain_sid = pytalloc_reference_ex(dom_sid_Type, pytalloc_get_mem_ctx(obj), &object->in.domain_sid);
5702 0 : return py_domain_sid;
5703 : }
5704 :
5705 0 : static int py_wbint_UnixIDs2Sids_in_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
5706 : {
5707 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
5708 0 : if (value == NULL) {
5709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain_sid");
5710 0 : return -1;
5711 : }
5712 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
5713 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5714 0 : PyErr_NoMemory();
5715 0 : return -1;
5716 : }
5717 0 : object->in.domain_sid = *(struct dom_sid *)pytalloc_get_ptr(value);
5718 0 : return 0;
5719 : }
5720 :
5721 0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_num_ids(PyObject *obj, void *closure)
5722 : {
5723 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(obj);
5724 0 : PyObject *py_num_ids;
5725 0 : py_num_ids = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_ids));
5726 0 : return py_num_ids;
5727 : }
5728 :
5729 0 : static int py_wbint_UnixIDs2Sids_in_set_num_ids(PyObject *py_obj, PyObject *value, void *closure)
5730 : {
5731 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
5732 0 : if (value == NULL) {
5733 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_ids");
5734 0 : return -1;
5735 : }
5736 : {
5737 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_ids));
5738 0 : if (PyLong_Check(value)) {
5739 0 : unsigned long long test_var;
5740 0 : test_var = PyLong_AsUnsignedLongLong(value);
5741 0 : if (PyErr_Occurred() != NULL) {
5742 0 : return -1;
5743 : }
5744 0 : if (test_var > uint_max) {
5745 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5746 : PyLong_Type.tp_name, uint_max, test_var);
5747 0 : return -1;
5748 : }
5749 0 : object->in.num_ids = test_var;
5750 : } else {
5751 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5752 : PyLong_Type.tp_name);
5753 0 : return -1;
5754 : }
5755 : }
5756 0 : return 0;
5757 : }
5758 :
5759 0 : static PyObject *py_wbint_UnixIDs2Sids_in_get_xids(PyObject *obj, void *closure)
5760 : {
5761 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(obj);
5762 0 : PyObject *py_xids;
5763 0 : py_xids = PyList_New(object->in.num_ids);
5764 0 : if (py_xids == NULL) {
5765 0 : return NULL;
5766 : }
5767 : {
5768 : int xids_cntr_0;
5769 0 : for (xids_cntr_0 = 0; xids_cntr_0 < (object->in.num_ids); xids_cntr_0++) {
5770 0 : PyObject *py_xids_0;
5771 0 : py_xids_0 = pytalloc_reference_ex(unixid_Type, object->in.xids, &(object->in.xids)[xids_cntr_0]);
5772 0 : PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
5773 : }
5774 : }
5775 0 : return py_xids;
5776 : }
5777 :
5778 0 : static int py_wbint_UnixIDs2Sids_in_set_xids(PyObject *py_obj, PyObject *value, void *closure)
5779 : {
5780 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
5781 0 : if (value == NULL) {
5782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.xids");
5783 0 : return -1;
5784 : }
5785 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5786 : {
5787 0 : int xids_cntr_0;
5788 0 : object->in.xids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.xids, PyList_GET_SIZE(value));
5789 0 : if (!object->in.xids) { return -1; }
5790 0 : talloc_set_name_const(object->in.xids, "ARRAY: object->in.xids");
5791 0 : for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(value); xids_cntr_0++) {
5792 0 : if (PyList_GET_ITEM(value, xids_cntr_0) == NULL) {
5793 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.xids)[xids_cntr_0]");
5794 0 : return -1;
5795 : }
5796 0 : PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(value, xids_cntr_0), return -1;);
5797 0 : if (talloc_reference(object->in.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, xids_cntr_0))) == NULL) {
5798 0 : PyErr_NoMemory();
5799 0 : return -1;
5800 : }
5801 0 : (object->in.xids)[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(value, xids_cntr_0));
5802 : }
5803 : }
5804 0 : return 0;
5805 : }
5806 :
5807 0 : static PyObject *py_wbint_UnixIDs2Sids_out_get_xids(PyObject *obj, void *closure)
5808 : {
5809 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(obj);
5810 0 : PyObject *py_xids;
5811 0 : py_xids = PyList_New(object->in.num_ids);
5812 0 : if (py_xids == NULL) {
5813 0 : return NULL;
5814 : }
5815 : {
5816 : int xids_cntr_0;
5817 0 : for (xids_cntr_0 = 0; xids_cntr_0 < (object->in.num_ids); xids_cntr_0++) {
5818 0 : PyObject *py_xids_0;
5819 0 : py_xids_0 = pytalloc_reference_ex(unixid_Type, object->out.xids, &(object->out.xids)[xids_cntr_0]);
5820 0 : PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
5821 : }
5822 : }
5823 0 : return py_xids;
5824 : }
5825 :
5826 0 : static int py_wbint_UnixIDs2Sids_out_set_xids(PyObject *py_obj, PyObject *value, void *closure)
5827 : {
5828 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
5829 0 : if (value == NULL) {
5830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.xids");
5831 0 : return -1;
5832 : }
5833 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5834 : {
5835 0 : int xids_cntr_0;
5836 0 : object->out.xids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.xids, PyList_GET_SIZE(value));
5837 0 : if (!object->out.xids) { return -1; }
5838 0 : talloc_set_name_const(object->out.xids, "ARRAY: object->out.xids");
5839 0 : for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(value); xids_cntr_0++) {
5840 0 : if (PyList_GET_ITEM(value, xids_cntr_0) == NULL) {
5841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.xids)[xids_cntr_0]");
5842 0 : return -1;
5843 : }
5844 0 : PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(value, xids_cntr_0), return -1;);
5845 0 : if (talloc_reference(object->out.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, xids_cntr_0))) == NULL) {
5846 0 : PyErr_NoMemory();
5847 0 : return -1;
5848 : }
5849 0 : (object->out.xids)[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(value, xids_cntr_0));
5850 : }
5851 : }
5852 0 : return 0;
5853 : }
5854 :
5855 0 : static PyObject *py_wbint_UnixIDs2Sids_out_get_sids(PyObject *obj, void *closure)
5856 : {
5857 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(obj);
5858 0 : PyObject *py_sids;
5859 0 : py_sids = PyList_New(object->in.num_ids);
5860 0 : if (py_sids == NULL) {
5861 0 : return NULL;
5862 : }
5863 : {
5864 : int sids_cntr_0;
5865 0 : for (sids_cntr_0 = 0; sids_cntr_0 < (object->in.num_ids); sids_cntr_0++) {
5866 0 : PyObject *py_sids_0;
5867 0 : py_sids_0 = pytalloc_reference_ex(dom_sid_Type, object->out.sids, &(object->out.sids)[sids_cntr_0]);
5868 0 : PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
5869 : }
5870 : }
5871 0 : return py_sids;
5872 : }
5873 :
5874 0 : static int py_wbint_UnixIDs2Sids_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
5875 : {
5876 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
5877 0 : if (value == NULL) {
5878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
5879 0 : return -1;
5880 : }
5881 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5882 : {
5883 0 : int sids_cntr_0;
5884 0 : object->out.sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids, PyList_GET_SIZE(value));
5885 0 : if (!object->out.sids) { return -1; }
5886 0 : talloc_set_name_const(object->out.sids, "ARRAY: object->out.sids");
5887 0 : for (sids_cntr_0 = 0; sids_cntr_0 < PyList_GET_SIZE(value); sids_cntr_0++) {
5888 0 : if (PyList_GET_ITEM(value, sids_cntr_0) == NULL) {
5889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.sids)[sids_cntr_0]");
5890 0 : return -1;
5891 : }
5892 0 : PY_CHECK_TYPE(dom_sid_Type, PyList_GET_ITEM(value, sids_cntr_0), return -1;);
5893 0 : if (talloc_reference(object->out.sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_0))) == NULL) {
5894 0 : PyErr_NoMemory();
5895 0 : return -1;
5896 : }
5897 0 : (object->out.sids)[sids_cntr_0] = *(struct dom_sid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_0));
5898 : }
5899 : }
5900 0 : return 0;
5901 : }
5902 :
5903 0 : static PyObject *py_wbint_UnixIDs2Sids_get_result(PyObject *obj, void *closure)
5904 : {
5905 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(obj);
5906 0 : PyObject *py_result;
5907 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
5908 0 : return py_result;
5909 : }
5910 :
5911 0 : static int py_wbint_UnixIDs2Sids_set_result(PyObject *py_obj, PyObject *value, void *closure)
5912 : {
5913 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
5914 0 : if (value == NULL) {
5915 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
5916 0 : return -1;
5917 : }
5918 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
5919 0 : return 0;
5920 : }
5921 :
5922 : static PyGetSetDef py_wbint_UnixIDs2Sids_getsetters[] = {
5923 : {
5924 : .name = discard_const_p(char, "in_domain_name"),
5925 : .get = py_wbint_UnixIDs2Sids_in_get_domain_name,
5926 : .set = py_wbint_UnixIDs2Sids_in_set_domain_name,
5927 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5928 : },
5929 : {
5930 : .name = discard_const_p(char, "in_domain_sid"),
5931 : .get = py_wbint_UnixIDs2Sids_in_get_domain_sid,
5932 : .set = py_wbint_UnixIDs2Sids_in_set_domain_sid,
5933 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
5934 : },
5935 : {
5936 : .name = discard_const_p(char, "in_num_ids"),
5937 : .get = py_wbint_UnixIDs2Sids_in_get_num_ids,
5938 : .set = py_wbint_UnixIDs2Sids_in_set_num_ids,
5939 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5940 : },
5941 : {
5942 : .name = discard_const_p(char, "in_xids"),
5943 : .get = py_wbint_UnixIDs2Sids_in_get_xids,
5944 : .set = py_wbint_UnixIDs2Sids_in_set_xids,
5945 : .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
5946 : },
5947 : {
5948 : .name = discard_const_p(char, "out_xids"),
5949 : .get = py_wbint_UnixIDs2Sids_out_get_xids,
5950 : .set = py_wbint_UnixIDs2Sids_out_set_xids,
5951 : .doc = discard_const_p(char, "PIDL-generated element of base type unixid")
5952 : },
5953 : {
5954 : .name = discard_const_p(char, "out_sids"),
5955 : .get = py_wbint_UnixIDs2Sids_out_get_sids,
5956 : .set = py_wbint_UnixIDs2Sids_out_set_sids,
5957 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
5958 : },
5959 : {
5960 : .name = discard_const_p(char, "result"),
5961 : .get = py_wbint_UnixIDs2Sids_get_result,
5962 : .set = py_wbint_UnixIDs2Sids_set_result,
5963 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
5964 : },
5965 : { .name = NULL }
5966 : };
5967 :
5968 0 : static PyObject *py_wbint_UnixIDs2Sids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5969 : {
5970 0 : PyObject *self = pytalloc_new(struct wbint_UnixIDs2Sids, type);
5971 0 : return self;
5972 : }
5973 :
5974 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5975 : {
5976 :
5977 :
5978 0 : return PyLong_FromLong(5);
5979 : }
5980 :
5981 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
5982 : {
5983 0 : const struct ndr_interface_call *call = NULL;
5984 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
5985 0 : PyObject *ret = NULL;
5986 0 : struct ndr_push *push = NULL;
5987 0 : DATA_BLOB blob;
5988 0 : enum ndr_err_code err;
5989 :
5990 0 : if (ndr_table_winbind.num_calls < 6) {
5991 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_pack");
5992 0 : return NULL;
5993 : }
5994 0 : call = &ndr_table_winbind.calls[5];
5995 :
5996 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5997 0 : if (push == NULL) {
5998 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5999 0 : return NULL;
6000 : }
6001 :
6002 0 : push->flags |= ndr_push_flags;
6003 :
6004 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6005 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6006 0 : TALLOC_FREE(push);
6007 0 : PyErr_SetNdrError(err);
6008 0 : return NULL;
6009 : }
6010 0 : blob = ndr_push_blob(push);
6011 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6012 0 : TALLOC_FREE(push);
6013 0 : return ret;
6014 : }
6015 :
6016 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6017 : {
6018 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6019 0 : PyObject *bigendian_obj = NULL;
6020 0 : PyObject *ndr64_obj = NULL;
6021 0 : libndr_flags ndr_push_flags = 0;
6022 :
6023 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6024 : discard_const_p(char *, kwnames),
6025 : &bigendian_obj,
6026 : &ndr64_obj)) {
6027 0 : return NULL;
6028 : }
6029 :
6030 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6031 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6032 : }
6033 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6034 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6035 : }
6036 :
6037 0 : return py_wbint_UnixIDs2Sids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6038 : }
6039 :
6040 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6041 : {
6042 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6043 0 : PyObject *bigendian_obj = NULL;
6044 0 : PyObject *ndr64_obj = NULL;
6045 0 : libndr_flags ndr_push_flags = 0;
6046 :
6047 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6048 : discard_const_p(char *, kwnames),
6049 : &bigendian_obj,
6050 : &ndr64_obj)) {
6051 0 : return NULL;
6052 : }
6053 :
6054 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6055 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6056 : }
6057 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6058 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6059 : }
6060 :
6061 0 : return py_wbint_UnixIDs2Sids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6062 : }
6063 :
6064 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
6065 : {
6066 0 : const struct ndr_interface_call *call = NULL;
6067 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
6068 0 : struct ndr_pull *pull = NULL;
6069 0 : enum ndr_err_code err;
6070 :
6071 0 : if (ndr_table_winbind.num_calls < 6) {
6072 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_unpack");
6073 0 : return NULL;
6074 : }
6075 0 : call = &ndr_table_winbind.calls[5];
6076 :
6077 0 : pull = ndr_pull_init_blob(blob, object);
6078 0 : if (pull == NULL) {
6079 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6080 0 : return NULL;
6081 : }
6082 :
6083 0 : pull->flags |= ndr_pull_flags;
6084 :
6085 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6086 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6087 0 : TALLOC_FREE(pull);
6088 0 : PyErr_SetNdrError(err);
6089 0 : return NULL;
6090 : }
6091 0 : if (!allow_remaining) {
6092 0 : uint32_t highest_ofs;
6093 :
6094 0 : if (pull->offset > pull->relative_highest_offset) {
6095 0 : highest_ofs = pull->offset;
6096 : } else {
6097 0 : highest_ofs = pull->relative_highest_offset;
6098 : }
6099 0 : if (highest_ofs < pull->data_size) {
6100 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6101 : "not all bytes consumed ofs[%u] size[%u]",
6102 : highest_ofs, pull->data_size);
6103 0 : TALLOC_FREE(pull);
6104 0 : PyErr_SetNdrError(err);
6105 0 : return NULL;
6106 : }
6107 : }
6108 :
6109 0 : TALLOC_FREE(pull);
6110 0 : Py_RETURN_NONE;
6111 : }
6112 :
6113 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6114 : {
6115 0 : DATA_BLOB blob;
6116 0 : Py_ssize_t blob_length = 0;
6117 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6118 0 : PyObject *bigendian_obj = NULL;
6119 0 : PyObject *ndr64_obj = NULL;
6120 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6121 0 : PyObject *allow_remaining_obj = NULL;
6122 0 : bool allow_remaining = false;
6123 :
6124 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6125 : discard_const_p(char *, kwnames),
6126 : &blob.data, &blob_length,
6127 : &bigendian_obj,
6128 : &ndr64_obj,
6129 : &allow_remaining_obj)) {
6130 0 : return NULL;
6131 : }
6132 0 : blob.length = blob_length;
6133 :
6134 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6135 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6136 : }
6137 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6138 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6139 : }
6140 :
6141 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6142 0 : allow_remaining = true;
6143 : }
6144 :
6145 0 : return py_wbint_UnixIDs2Sids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6146 : }
6147 :
6148 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6149 : {
6150 0 : DATA_BLOB blob;
6151 0 : Py_ssize_t blob_length = 0;
6152 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6153 0 : PyObject *bigendian_obj = NULL;
6154 0 : PyObject *ndr64_obj = NULL;
6155 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6156 0 : PyObject *allow_remaining_obj = NULL;
6157 0 : bool allow_remaining = false;
6158 :
6159 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6160 : discard_const_p(char *, kwnames),
6161 : &blob.data, &blob_length,
6162 : &bigendian_obj,
6163 : &ndr64_obj,
6164 : &allow_remaining_obj)) {
6165 0 : return NULL;
6166 : }
6167 0 : blob.length = blob_length;
6168 :
6169 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6170 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6171 : }
6172 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6173 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6174 : }
6175 :
6176 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6177 0 : allow_remaining = true;
6178 : }
6179 :
6180 0 : return py_wbint_UnixIDs2Sids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6181 : }
6182 :
6183 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
6184 : {
6185 0 : const struct ndr_interface_call *call = NULL;
6186 0 : struct wbint_UnixIDs2Sids *object = pytalloc_get_ptr(py_obj);
6187 0 : PyObject *ret;
6188 0 : char *retstr;
6189 :
6190 0 : if (ndr_table_winbind.num_calls < 6) {
6191 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_UnixIDs2Sids_ndr_print");
6192 0 : return NULL;
6193 : }
6194 0 : call = &ndr_table_winbind.calls[5];
6195 :
6196 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6197 0 : ret = PyUnicode_FromString(retstr);
6198 0 : TALLOC_FREE(retstr);
6199 :
6200 0 : return ret;
6201 : }
6202 :
6203 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6204 : {
6205 0 : return py_wbint_UnixIDs2Sids_ndr_print(py_obj, "wbint_UnixIDs2Sids_in", NDR_IN);
6206 : }
6207 :
6208 0 : static PyObject *py_wbint_UnixIDs2Sids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6209 : {
6210 0 : return py_wbint_UnixIDs2Sids_ndr_print(py_obj, "wbint_UnixIDs2Sids_out", NDR_OUT);
6211 : }
6212 :
6213 : static PyMethodDef py_wbint_UnixIDs2Sids_methods[] = {
6214 : { "opnum", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_opnum, METH_NOARGS|METH_CLASS,
6215 : "winbind.wbint_UnixIDs2Sids.opnum() -> 5 (0x05) " },
6216 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6217 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6218 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6219 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6220 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6221 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6222 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_UnixIDs2Sids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6223 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6224 : { "__ndr_print_in__", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6225 : { "__ndr_print_out__", (PyCFunction)py_wbint_UnixIDs2Sids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6226 : { NULL, NULL, 0, NULL }
6227 : };
6228 :
6229 :
6230 : static PyTypeObject wbint_UnixIDs2Sids_Type = {
6231 : PyVarObject_HEAD_INIT(NULL, 0)
6232 : .tp_name = "winbind.wbint_UnixIDs2Sids",
6233 : .tp_getset = py_wbint_UnixIDs2Sids_getsetters,
6234 : .tp_methods = py_wbint_UnixIDs2Sids_methods,
6235 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6236 : .tp_new = py_wbint_UnixIDs2Sids_new,
6237 : };
6238 :
6239 0 : static bool pack_py_wbint_UnixIDs2Sids_args_in(PyObject *args, PyObject *kwargs, struct wbint_UnixIDs2Sids *r)
6240 : {
6241 0 : PyObject *py_domain_name;
6242 0 : PyObject *py_domain_sid;
6243 0 : PyObject *py_num_ids;
6244 0 : PyObject *py_xids;
6245 0 : const char *kwnames[] = {
6246 : "domain_name", "domain_sid", "num_ids", "xids", NULL
6247 : };
6248 :
6249 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:wbint_UnixIDs2Sids", discard_const_p(char *, kwnames), &py_domain_name, &py_domain_sid, &py_num_ids, &py_xids)) {
6250 0 : return false;
6251 : }
6252 :
6253 0 : if (py_domain_name == NULL) {
6254 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain_name");
6255 0 : return false;
6256 : }
6257 0 : r->in.domain_name = talloc_ptrtype(r, r->in.domain_name);
6258 0 : if (r->in.domain_name == NULL) {
6259 0 : PyErr_NoMemory();
6260 0 : return false;
6261 : }
6262 : {
6263 0 : const char *test_str;
6264 0 : const char *talloc_str;
6265 0 : PyObject *unicode = NULL;
6266 0 : if (PyUnicode_Check(py_domain_name)) {
6267 0 : unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
6268 0 : if (unicode == NULL) {
6269 0 : return false;
6270 : }
6271 0 : test_str = PyBytes_AS_STRING(unicode);
6272 0 : } else if (PyBytes_Check(py_domain_name)) {
6273 0 : test_str = PyBytes_AS_STRING(py_domain_name);
6274 : } else {
6275 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
6276 0 : return false;
6277 : }
6278 0 : talloc_str = talloc_strdup(r, test_str);
6279 0 : if (unicode != NULL) {
6280 0 : Py_DECREF(unicode);
6281 : }
6282 0 : if (talloc_str == NULL) {
6283 0 : PyErr_NoMemory();
6284 0 : return false;
6285 : }
6286 0 : r->in.domain_name = talloc_str;
6287 : }
6288 0 : if (py_domain_sid == NULL) {
6289 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain_sid");
6290 0 : return false;
6291 : }
6292 0 : PY_CHECK_TYPE(dom_sid_Type, py_domain_sid, return false;);
6293 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_sid)) == NULL) {
6294 0 : PyErr_NoMemory();
6295 0 : return false;
6296 : }
6297 0 : r->in.domain_sid = *(struct dom_sid *)pytalloc_get_ptr(py_domain_sid);
6298 0 : if (py_num_ids == NULL) {
6299 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.num_ids");
6300 0 : return false;
6301 : }
6302 : {
6303 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_ids));
6304 0 : if (PyLong_Check(py_num_ids)) {
6305 0 : unsigned long long test_var;
6306 0 : test_var = PyLong_AsUnsignedLongLong(py_num_ids);
6307 0 : if (PyErr_Occurred() != NULL) {
6308 0 : return false;
6309 : }
6310 0 : if (test_var > uint_max) {
6311 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6312 : PyLong_Type.tp_name, uint_max, test_var);
6313 0 : return false;
6314 : }
6315 0 : r->in.num_ids = test_var;
6316 : } else {
6317 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6318 : PyLong_Type.tp_name);
6319 0 : return false;
6320 : }
6321 : }
6322 0 : if (py_xids == NULL) {
6323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.xids");
6324 0 : return false;
6325 : }
6326 0 : PY_CHECK_TYPE(&PyList_Type, py_xids, return false;);
6327 : {
6328 0 : int xids_cntr_0;
6329 0 : r->in.xids = talloc_array_ptrtype(r, r->in.xids, PyList_GET_SIZE(py_xids));
6330 0 : if (!r->in.xids) { return false; }
6331 0 : talloc_set_name_const(r->in.xids, "ARRAY: r->in.xids");
6332 0 : for (xids_cntr_0 = 0; xids_cntr_0 < PyList_GET_SIZE(py_xids); xids_cntr_0++) {
6333 0 : if (PyList_GET_ITEM(py_xids, xids_cntr_0) == NULL) {
6334 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.xids)[xids_cntr_0]");
6335 0 : return false;
6336 : }
6337 0 : PY_CHECK_TYPE(unixid_Type, PyList_GET_ITEM(py_xids, xids_cntr_0), return false;);
6338 0 : if (talloc_reference(r->in.xids, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_xids, xids_cntr_0))) == NULL) {
6339 0 : PyErr_NoMemory();
6340 0 : return false;
6341 : }
6342 0 : (r->in.xids)[xids_cntr_0] = *(struct unixid *)pytalloc_get_ptr(PyList_GET_ITEM(py_xids, xids_cntr_0));
6343 : }
6344 : }
6345 0 : return true;
6346 : }
6347 :
6348 0 : static PyObject *unpack_py_wbint_UnixIDs2Sids_args_out(struct wbint_UnixIDs2Sids *r)
6349 : {
6350 0 : PyObject *result;
6351 0 : PyObject *py_xids;
6352 0 : PyObject *py_sids;
6353 0 : result = PyTuple_New(2);
6354 0 : py_xids = PyList_New(r->in.num_ids);
6355 0 : if (py_xids == NULL) {
6356 0 : return NULL;
6357 : }
6358 : {
6359 : int xids_cntr_0;
6360 0 : for (xids_cntr_0 = 0; xids_cntr_0 < (r->in.num_ids); xids_cntr_0++) {
6361 0 : PyObject *py_xids_0;
6362 0 : py_xids_0 = pytalloc_reference_ex(unixid_Type, r->out.xids, &(r->out.xids)[xids_cntr_0]);
6363 0 : PyList_SetItem(py_xids, xids_cntr_0, py_xids_0);
6364 : }
6365 : }
6366 0 : PyTuple_SetItem(result, 0, py_xids);
6367 0 : py_sids = PyList_New(r->in.num_ids);
6368 0 : if (py_sids == NULL) {
6369 0 : return NULL;
6370 : }
6371 : {
6372 : int sids_cntr_0;
6373 0 : for (sids_cntr_0 = 0; sids_cntr_0 < (r->in.num_ids); sids_cntr_0++) {
6374 0 : PyObject *py_sids_0;
6375 0 : py_sids_0 = pytalloc_reference_ex(dom_sid_Type, r->out.sids, &(r->out.sids)[sids_cntr_0]);
6376 0 : PyList_SetItem(py_sids, sids_cntr_0, py_sids_0);
6377 : }
6378 : }
6379 0 : PyTuple_SetItem(result, 1, py_sids);
6380 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
6381 0 : PyErr_SetNTSTATUS(r->out.result);
6382 0 : return NULL;
6383 : }
6384 :
6385 0 : return result;
6386 : }
6387 :
6388 :
6389 0 : static PyObject *py_wbint_AllocateUid_out_get_uid(PyObject *obj, void *closure)
6390 : {
6391 0 : struct wbint_AllocateUid *object = pytalloc_get_ptr(obj);
6392 0 : PyObject *py_uid;
6393 0 : if (object->out.uid == NULL) {
6394 0 : Py_RETURN_NONE;
6395 : }
6396 0 : py_uid = PyLong_FromUnsignedLongLong(*object->out.uid);
6397 0 : return py_uid;
6398 : }
6399 :
6400 0 : static int py_wbint_AllocateUid_out_set_uid(PyObject *py_obj, PyObject *value, void *closure)
6401 : {
6402 0 : struct wbint_AllocateUid *object = pytalloc_get_ptr(py_obj);
6403 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.uid));
6404 0 : if (value == NULL) {
6405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.uid");
6406 0 : return -1;
6407 : }
6408 0 : object->out.uid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.uid);
6409 0 : if (object->out.uid == NULL) {
6410 0 : PyErr_NoMemory();
6411 0 : return -1;
6412 : }
6413 : {
6414 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.uid));
6415 0 : if (PyLong_Check(value)) {
6416 0 : unsigned long long test_var;
6417 0 : test_var = PyLong_AsUnsignedLongLong(value);
6418 0 : if (PyErr_Occurred() != NULL) {
6419 0 : return -1;
6420 : }
6421 0 : if (test_var > uint_max) {
6422 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6423 : PyLong_Type.tp_name, uint_max, test_var);
6424 0 : return -1;
6425 : }
6426 0 : *object->out.uid = test_var;
6427 : } else {
6428 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6429 : PyLong_Type.tp_name);
6430 0 : return -1;
6431 : }
6432 : }
6433 0 : return 0;
6434 : }
6435 :
6436 0 : static PyObject *py_wbint_AllocateUid_get_result(PyObject *obj, void *closure)
6437 : {
6438 0 : struct wbint_AllocateUid *object = pytalloc_get_ptr(obj);
6439 0 : PyObject *py_result;
6440 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
6441 0 : return py_result;
6442 : }
6443 :
6444 0 : static int py_wbint_AllocateUid_set_result(PyObject *py_obj, PyObject *value, void *closure)
6445 : {
6446 0 : struct wbint_AllocateUid *object = pytalloc_get_ptr(py_obj);
6447 0 : if (value == NULL) {
6448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
6449 0 : return -1;
6450 : }
6451 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
6452 0 : return 0;
6453 : }
6454 :
6455 : static PyGetSetDef py_wbint_AllocateUid_getsetters[] = {
6456 : {
6457 : .name = discard_const_p(char, "out_uid"),
6458 : .get = py_wbint_AllocateUid_out_get_uid,
6459 : .set = py_wbint_AllocateUid_out_set_uid,
6460 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
6461 : },
6462 : {
6463 : .name = discard_const_p(char, "result"),
6464 : .get = py_wbint_AllocateUid_get_result,
6465 : .set = py_wbint_AllocateUid_set_result,
6466 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
6467 : },
6468 : { .name = NULL }
6469 : };
6470 :
6471 0 : static PyObject *py_wbint_AllocateUid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6472 : {
6473 0 : PyObject *self = pytalloc_new(struct wbint_AllocateUid, type);
6474 0 : struct wbint_AllocateUid *_self = (struct wbint_AllocateUid *)pytalloc_get_ptr(self);
6475 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
6476 0 : _self->out.uid = talloc_zero(mem_ctx, uint64_t);
6477 0 : return self;
6478 : }
6479 :
6480 0 : static PyObject *py_wbint_AllocateUid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
6481 : {
6482 :
6483 :
6484 0 : return PyLong_FromLong(6);
6485 : }
6486 :
6487 0 : static PyObject *py_wbint_AllocateUid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
6488 : {
6489 0 : const struct ndr_interface_call *call = NULL;
6490 0 : struct wbint_AllocateUid *object = pytalloc_get_ptr(py_obj);
6491 0 : PyObject *ret = NULL;
6492 0 : struct ndr_push *push = NULL;
6493 0 : DATA_BLOB blob;
6494 0 : enum ndr_err_code err;
6495 :
6496 0 : if (ndr_table_winbind.num_calls < 7) {
6497 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_pack");
6498 0 : return NULL;
6499 : }
6500 0 : call = &ndr_table_winbind.calls[6];
6501 :
6502 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
6503 0 : if (push == NULL) {
6504 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6505 0 : return NULL;
6506 : }
6507 :
6508 0 : push->flags |= ndr_push_flags;
6509 :
6510 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6511 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6512 0 : TALLOC_FREE(push);
6513 0 : PyErr_SetNdrError(err);
6514 0 : return NULL;
6515 : }
6516 0 : blob = ndr_push_blob(push);
6517 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6518 0 : TALLOC_FREE(push);
6519 0 : return ret;
6520 : }
6521 :
6522 0 : static PyObject *py_wbint_AllocateUid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6523 : {
6524 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6525 0 : PyObject *bigendian_obj = NULL;
6526 0 : PyObject *ndr64_obj = NULL;
6527 0 : libndr_flags ndr_push_flags = 0;
6528 :
6529 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6530 : discard_const_p(char *, kwnames),
6531 : &bigendian_obj,
6532 : &ndr64_obj)) {
6533 0 : return NULL;
6534 : }
6535 :
6536 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6537 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6538 : }
6539 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6540 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6541 : }
6542 :
6543 0 : return py_wbint_AllocateUid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6544 : }
6545 :
6546 0 : static PyObject *py_wbint_AllocateUid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6547 : {
6548 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6549 0 : PyObject *bigendian_obj = NULL;
6550 0 : PyObject *ndr64_obj = NULL;
6551 0 : libndr_flags ndr_push_flags = 0;
6552 :
6553 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6554 : discard_const_p(char *, kwnames),
6555 : &bigendian_obj,
6556 : &ndr64_obj)) {
6557 0 : return NULL;
6558 : }
6559 :
6560 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6561 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6562 : }
6563 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6564 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6565 : }
6566 :
6567 0 : return py_wbint_AllocateUid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6568 : }
6569 :
6570 0 : static PyObject *py_wbint_AllocateUid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
6571 : {
6572 0 : const struct ndr_interface_call *call = NULL;
6573 0 : struct wbint_AllocateUid *object = pytalloc_get_ptr(py_obj);
6574 0 : struct ndr_pull *pull = NULL;
6575 0 : enum ndr_err_code err;
6576 :
6577 0 : if (ndr_table_winbind.num_calls < 7) {
6578 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_unpack");
6579 0 : return NULL;
6580 : }
6581 0 : call = &ndr_table_winbind.calls[6];
6582 :
6583 0 : pull = ndr_pull_init_blob(blob, object);
6584 0 : if (pull == NULL) {
6585 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6586 0 : return NULL;
6587 : }
6588 :
6589 0 : pull->flags |= ndr_pull_flags;
6590 :
6591 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6592 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6593 0 : TALLOC_FREE(pull);
6594 0 : PyErr_SetNdrError(err);
6595 0 : return NULL;
6596 : }
6597 0 : if (!allow_remaining) {
6598 0 : uint32_t highest_ofs;
6599 :
6600 0 : if (pull->offset > pull->relative_highest_offset) {
6601 0 : highest_ofs = pull->offset;
6602 : } else {
6603 0 : highest_ofs = pull->relative_highest_offset;
6604 : }
6605 0 : if (highest_ofs < pull->data_size) {
6606 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6607 : "not all bytes consumed ofs[%u] size[%u]",
6608 : highest_ofs, pull->data_size);
6609 0 : TALLOC_FREE(pull);
6610 0 : PyErr_SetNdrError(err);
6611 0 : return NULL;
6612 : }
6613 : }
6614 :
6615 0 : TALLOC_FREE(pull);
6616 0 : Py_RETURN_NONE;
6617 : }
6618 :
6619 0 : static PyObject *py_wbint_AllocateUid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6620 : {
6621 0 : DATA_BLOB blob;
6622 0 : Py_ssize_t blob_length = 0;
6623 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6624 0 : PyObject *bigendian_obj = NULL;
6625 0 : PyObject *ndr64_obj = NULL;
6626 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6627 0 : PyObject *allow_remaining_obj = NULL;
6628 0 : bool allow_remaining = false;
6629 :
6630 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6631 : discard_const_p(char *, kwnames),
6632 : &blob.data, &blob_length,
6633 : &bigendian_obj,
6634 : &ndr64_obj,
6635 : &allow_remaining_obj)) {
6636 0 : return NULL;
6637 : }
6638 0 : blob.length = blob_length;
6639 :
6640 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6641 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6642 : }
6643 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6644 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6645 : }
6646 :
6647 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6648 0 : allow_remaining = true;
6649 : }
6650 :
6651 0 : return py_wbint_AllocateUid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6652 : }
6653 :
6654 0 : static PyObject *py_wbint_AllocateUid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6655 : {
6656 0 : DATA_BLOB blob;
6657 0 : Py_ssize_t blob_length = 0;
6658 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6659 0 : PyObject *bigendian_obj = NULL;
6660 0 : PyObject *ndr64_obj = NULL;
6661 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6662 0 : PyObject *allow_remaining_obj = NULL;
6663 0 : bool allow_remaining = false;
6664 :
6665 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6666 : discard_const_p(char *, kwnames),
6667 : &blob.data, &blob_length,
6668 : &bigendian_obj,
6669 : &ndr64_obj,
6670 : &allow_remaining_obj)) {
6671 0 : return NULL;
6672 : }
6673 0 : blob.length = blob_length;
6674 :
6675 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6676 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6677 : }
6678 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6679 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6680 : }
6681 :
6682 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6683 0 : allow_remaining = true;
6684 : }
6685 :
6686 0 : return py_wbint_AllocateUid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6687 : }
6688 :
6689 0 : static PyObject *py_wbint_AllocateUid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
6690 : {
6691 0 : const struct ndr_interface_call *call = NULL;
6692 0 : struct wbint_AllocateUid *object = pytalloc_get_ptr(py_obj);
6693 0 : PyObject *ret;
6694 0 : char *retstr;
6695 :
6696 0 : if (ndr_table_winbind.num_calls < 7) {
6697 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateUid_ndr_print");
6698 0 : return NULL;
6699 : }
6700 0 : call = &ndr_table_winbind.calls[6];
6701 :
6702 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6703 0 : ret = PyUnicode_FromString(retstr);
6704 0 : TALLOC_FREE(retstr);
6705 :
6706 0 : return ret;
6707 : }
6708 :
6709 0 : static PyObject *py_wbint_AllocateUid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6710 : {
6711 0 : return py_wbint_AllocateUid_ndr_print(py_obj, "wbint_AllocateUid_in", NDR_IN);
6712 : }
6713 :
6714 0 : static PyObject *py_wbint_AllocateUid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6715 : {
6716 0 : return py_wbint_AllocateUid_ndr_print(py_obj, "wbint_AllocateUid_out", NDR_OUT);
6717 : }
6718 :
6719 : static PyMethodDef py_wbint_AllocateUid_methods[] = {
6720 : { "opnum", (PyCFunction)py_wbint_AllocateUid_ndr_opnum, METH_NOARGS|METH_CLASS,
6721 : "winbind.wbint_AllocateUid.opnum() -> 6 (0x06) " },
6722 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6723 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6724 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6725 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6726 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6727 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6728 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateUid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6729 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6730 : { "__ndr_print_in__", (PyCFunction)py_wbint_AllocateUid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6731 : { "__ndr_print_out__", (PyCFunction)py_wbint_AllocateUid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6732 : { NULL, NULL, 0, NULL }
6733 : };
6734 :
6735 :
6736 : static PyTypeObject wbint_AllocateUid_Type = {
6737 : PyVarObject_HEAD_INIT(NULL, 0)
6738 : .tp_name = "winbind.wbint_AllocateUid",
6739 : .tp_getset = py_wbint_AllocateUid_getsetters,
6740 : .tp_methods = py_wbint_AllocateUid_methods,
6741 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6742 : .tp_new = py_wbint_AllocateUid_new,
6743 : };
6744 :
6745 0 : static bool pack_py_wbint_AllocateUid_args_in(PyObject *args, PyObject *kwargs, struct wbint_AllocateUid *r)
6746 : {
6747 0 : const char *kwnames[] = {
6748 : NULL
6749 : };
6750 :
6751 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_AllocateUid", discard_const_p(char *, kwnames))) {
6752 0 : return false;
6753 : }
6754 :
6755 0 : return true;
6756 : }
6757 :
6758 0 : static PyObject *unpack_py_wbint_AllocateUid_args_out(struct wbint_AllocateUid *r)
6759 : {
6760 0 : PyObject *result;
6761 0 : PyObject *py_uid;
6762 0 : py_uid = PyLong_FromUnsignedLongLong(*r->out.uid);
6763 0 : result = py_uid;
6764 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
6765 0 : PyErr_SetNTSTATUS(r->out.result);
6766 0 : return NULL;
6767 : }
6768 :
6769 0 : return result;
6770 : }
6771 :
6772 :
6773 0 : static PyObject *py_wbint_AllocateGid_out_get_gid(PyObject *obj, void *closure)
6774 : {
6775 0 : struct wbint_AllocateGid *object = pytalloc_get_ptr(obj);
6776 0 : PyObject *py_gid;
6777 0 : if (object->out.gid == NULL) {
6778 0 : Py_RETURN_NONE;
6779 : }
6780 0 : py_gid = PyLong_FromUnsignedLongLong(*object->out.gid);
6781 0 : return py_gid;
6782 : }
6783 :
6784 0 : static int py_wbint_AllocateGid_out_set_gid(PyObject *py_obj, PyObject *value, void *closure)
6785 : {
6786 0 : struct wbint_AllocateGid *object = pytalloc_get_ptr(py_obj);
6787 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.gid));
6788 0 : if (value == NULL) {
6789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.gid");
6790 0 : return -1;
6791 : }
6792 0 : object->out.gid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.gid);
6793 0 : if (object->out.gid == NULL) {
6794 0 : PyErr_NoMemory();
6795 0 : return -1;
6796 : }
6797 : {
6798 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.gid));
6799 0 : if (PyLong_Check(value)) {
6800 0 : unsigned long long test_var;
6801 0 : test_var = PyLong_AsUnsignedLongLong(value);
6802 0 : if (PyErr_Occurred() != NULL) {
6803 0 : return -1;
6804 : }
6805 0 : if (test_var > uint_max) {
6806 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6807 : PyLong_Type.tp_name, uint_max, test_var);
6808 0 : return -1;
6809 : }
6810 0 : *object->out.gid = test_var;
6811 : } else {
6812 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6813 : PyLong_Type.tp_name);
6814 0 : return -1;
6815 : }
6816 : }
6817 0 : return 0;
6818 : }
6819 :
6820 0 : static PyObject *py_wbint_AllocateGid_get_result(PyObject *obj, void *closure)
6821 : {
6822 0 : struct wbint_AllocateGid *object = pytalloc_get_ptr(obj);
6823 0 : PyObject *py_result;
6824 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
6825 0 : return py_result;
6826 : }
6827 :
6828 0 : static int py_wbint_AllocateGid_set_result(PyObject *py_obj, PyObject *value, void *closure)
6829 : {
6830 0 : struct wbint_AllocateGid *object = pytalloc_get_ptr(py_obj);
6831 0 : if (value == NULL) {
6832 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
6833 0 : return -1;
6834 : }
6835 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
6836 0 : return 0;
6837 : }
6838 :
6839 : static PyGetSetDef py_wbint_AllocateGid_getsetters[] = {
6840 : {
6841 : .name = discard_const_p(char, "out_gid"),
6842 : .get = py_wbint_AllocateGid_out_get_gid,
6843 : .set = py_wbint_AllocateGid_out_set_gid,
6844 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
6845 : },
6846 : {
6847 : .name = discard_const_p(char, "result"),
6848 : .get = py_wbint_AllocateGid_get_result,
6849 : .set = py_wbint_AllocateGid_set_result,
6850 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
6851 : },
6852 : { .name = NULL }
6853 : };
6854 :
6855 0 : static PyObject *py_wbint_AllocateGid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6856 : {
6857 0 : PyObject *self = pytalloc_new(struct wbint_AllocateGid, type);
6858 0 : struct wbint_AllocateGid *_self = (struct wbint_AllocateGid *)pytalloc_get_ptr(self);
6859 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
6860 0 : _self->out.gid = talloc_zero(mem_ctx, uint64_t);
6861 0 : return self;
6862 : }
6863 :
6864 0 : static PyObject *py_wbint_AllocateGid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
6865 : {
6866 :
6867 :
6868 0 : return PyLong_FromLong(7);
6869 : }
6870 :
6871 0 : static PyObject *py_wbint_AllocateGid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
6872 : {
6873 0 : const struct ndr_interface_call *call = NULL;
6874 0 : struct wbint_AllocateGid *object = pytalloc_get_ptr(py_obj);
6875 0 : PyObject *ret = NULL;
6876 0 : struct ndr_push *push = NULL;
6877 0 : DATA_BLOB blob;
6878 0 : enum ndr_err_code err;
6879 :
6880 0 : if (ndr_table_winbind.num_calls < 8) {
6881 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_pack");
6882 0 : return NULL;
6883 : }
6884 0 : call = &ndr_table_winbind.calls[7];
6885 :
6886 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
6887 0 : if (push == NULL) {
6888 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6889 0 : return NULL;
6890 : }
6891 :
6892 0 : push->flags |= ndr_push_flags;
6893 :
6894 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6895 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6896 0 : TALLOC_FREE(push);
6897 0 : PyErr_SetNdrError(err);
6898 0 : return NULL;
6899 : }
6900 0 : blob = ndr_push_blob(push);
6901 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6902 0 : TALLOC_FREE(push);
6903 0 : return ret;
6904 : }
6905 :
6906 0 : static PyObject *py_wbint_AllocateGid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6907 : {
6908 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6909 0 : PyObject *bigendian_obj = NULL;
6910 0 : PyObject *ndr64_obj = NULL;
6911 0 : libndr_flags ndr_push_flags = 0;
6912 :
6913 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6914 : discard_const_p(char *, kwnames),
6915 : &bigendian_obj,
6916 : &ndr64_obj)) {
6917 0 : return NULL;
6918 : }
6919 :
6920 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6921 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6922 : }
6923 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6924 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6925 : }
6926 :
6927 0 : return py_wbint_AllocateGid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6928 : }
6929 :
6930 0 : static PyObject *py_wbint_AllocateGid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6931 : {
6932 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6933 0 : PyObject *bigendian_obj = NULL;
6934 0 : PyObject *ndr64_obj = NULL;
6935 0 : libndr_flags ndr_push_flags = 0;
6936 :
6937 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6938 : discard_const_p(char *, kwnames),
6939 : &bigendian_obj,
6940 : &ndr64_obj)) {
6941 0 : return NULL;
6942 : }
6943 :
6944 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6945 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6946 : }
6947 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6948 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6949 : }
6950 :
6951 0 : return py_wbint_AllocateGid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6952 : }
6953 :
6954 0 : static PyObject *py_wbint_AllocateGid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
6955 : {
6956 0 : const struct ndr_interface_call *call = NULL;
6957 0 : struct wbint_AllocateGid *object = pytalloc_get_ptr(py_obj);
6958 0 : struct ndr_pull *pull = NULL;
6959 0 : enum ndr_err_code err;
6960 :
6961 0 : if (ndr_table_winbind.num_calls < 8) {
6962 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_unpack");
6963 0 : return NULL;
6964 : }
6965 0 : call = &ndr_table_winbind.calls[7];
6966 :
6967 0 : pull = ndr_pull_init_blob(blob, object);
6968 0 : if (pull == NULL) {
6969 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6970 0 : return NULL;
6971 : }
6972 :
6973 0 : pull->flags |= ndr_pull_flags;
6974 :
6975 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6976 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6977 0 : TALLOC_FREE(pull);
6978 0 : PyErr_SetNdrError(err);
6979 0 : return NULL;
6980 : }
6981 0 : if (!allow_remaining) {
6982 0 : uint32_t highest_ofs;
6983 :
6984 0 : if (pull->offset > pull->relative_highest_offset) {
6985 0 : highest_ofs = pull->offset;
6986 : } else {
6987 0 : highest_ofs = pull->relative_highest_offset;
6988 : }
6989 0 : if (highest_ofs < pull->data_size) {
6990 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6991 : "not all bytes consumed ofs[%u] size[%u]",
6992 : highest_ofs, pull->data_size);
6993 0 : TALLOC_FREE(pull);
6994 0 : PyErr_SetNdrError(err);
6995 0 : return NULL;
6996 : }
6997 : }
6998 :
6999 0 : TALLOC_FREE(pull);
7000 0 : Py_RETURN_NONE;
7001 : }
7002 :
7003 0 : static PyObject *py_wbint_AllocateGid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7004 : {
7005 0 : DATA_BLOB blob;
7006 0 : Py_ssize_t blob_length = 0;
7007 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7008 0 : PyObject *bigendian_obj = NULL;
7009 0 : PyObject *ndr64_obj = NULL;
7010 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7011 0 : PyObject *allow_remaining_obj = NULL;
7012 0 : bool allow_remaining = false;
7013 :
7014 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
7015 : discard_const_p(char *, kwnames),
7016 : &blob.data, &blob_length,
7017 : &bigendian_obj,
7018 : &ndr64_obj,
7019 : &allow_remaining_obj)) {
7020 0 : return NULL;
7021 : }
7022 0 : blob.length = blob_length;
7023 :
7024 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7025 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7026 : }
7027 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7028 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7029 : }
7030 :
7031 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7032 0 : allow_remaining = true;
7033 : }
7034 :
7035 0 : return py_wbint_AllocateGid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
7036 : }
7037 :
7038 0 : static PyObject *py_wbint_AllocateGid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7039 : {
7040 0 : DATA_BLOB blob;
7041 0 : Py_ssize_t blob_length = 0;
7042 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7043 0 : PyObject *bigendian_obj = NULL;
7044 0 : PyObject *ndr64_obj = NULL;
7045 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7046 0 : PyObject *allow_remaining_obj = NULL;
7047 0 : bool allow_remaining = false;
7048 :
7049 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
7050 : discard_const_p(char *, kwnames),
7051 : &blob.data, &blob_length,
7052 : &bigendian_obj,
7053 : &ndr64_obj,
7054 : &allow_remaining_obj)) {
7055 0 : return NULL;
7056 : }
7057 0 : blob.length = blob_length;
7058 :
7059 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7060 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7061 : }
7062 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7063 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7064 : }
7065 :
7066 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7067 0 : allow_remaining = true;
7068 : }
7069 :
7070 0 : return py_wbint_AllocateGid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
7071 : }
7072 :
7073 0 : static PyObject *py_wbint_AllocateGid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
7074 : {
7075 0 : const struct ndr_interface_call *call = NULL;
7076 0 : struct wbint_AllocateGid *object = pytalloc_get_ptr(py_obj);
7077 0 : PyObject *ret;
7078 0 : char *retstr;
7079 :
7080 0 : if (ndr_table_winbind.num_calls < 8) {
7081 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_AllocateGid_ndr_print");
7082 0 : return NULL;
7083 : }
7084 0 : call = &ndr_table_winbind.calls[7];
7085 :
7086 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
7087 0 : ret = PyUnicode_FromString(retstr);
7088 0 : TALLOC_FREE(retstr);
7089 :
7090 0 : return ret;
7091 : }
7092 :
7093 0 : static PyObject *py_wbint_AllocateGid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7094 : {
7095 0 : return py_wbint_AllocateGid_ndr_print(py_obj, "wbint_AllocateGid_in", NDR_IN);
7096 : }
7097 :
7098 0 : static PyObject *py_wbint_AllocateGid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7099 : {
7100 0 : return py_wbint_AllocateGid_ndr_print(py_obj, "wbint_AllocateGid_out", NDR_OUT);
7101 : }
7102 :
7103 : static PyMethodDef py_wbint_AllocateGid_methods[] = {
7104 : { "opnum", (PyCFunction)py_wbint_AllocateGid_ndr_opnum, METH_NOARGS|METH_CLASS,
7105 : "winbind.wbint_AllocateGid.opnum() -> 7 (0x07) " },
7106 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
7107 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
7108 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
7109 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
7110 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
7111 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
7112 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_AllocateGid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
7113 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
7114 : { "__ndr_print_in__", (PyCFunction)py_wbint_AllocateGid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
7115 : { "__ndr_print_out__", (PyCFunction)py_wbint_AllocateGid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
7116 : { NULL, NULL, 0, NULL }
7117 : };
7118 :
7119 :
7120 : static PyTypeObject wbint_AllocateGid_Type = {
7121 : PyVarObject_HEAD_INIT(NULL, 0)
7122 : .tp_name = "winbind.wbint_AllocateGid",
7123 : .tp_getset = py_wbint_AllocateGid_getsetters,
7124 : .tp_methods = py_wbint_AllocateGid_methods,
7125 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7126 : .tp_new = py_wbint_AllocateGid_new,
7127 : };
7128 :
7129 0 : static bool pack_py_wbint_AllocateGid_args_in(PyObject *args, PyObject *kwargs, struct wbint_AllocateGid *r)
7130 : {
7131 0 : const char *kwnames[] = {
7132 : NULL
7133 : };
7134 :
7135 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_AllocateGid", discard_const_p(char *, kwnames))) {
7136 0 : return false;
7137 : }
7138 :
7139 0 : return true;
7140 : }
7141 :
7142 0 : static PyObject *unpack_py_wbint_AllocateGid_args_out(struct wbint_AllocateGid *r)
7143 : {
7144 0 : PyObject *result;
7145 0 : PyObject *py_gid;
7146 0 : py_gid = PyLong_FromUnsignedLongLong(*r->out.gid);
7147 0 : result = py_gid;
7148 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
7149 0 : PyErr_SetNTSTATUS(r->out.result);
7150 0 : return NULL;
7151 : }
7152 :
7153 0 : return result;
7154 : }
7155 :
7156 :
7157 0 : static PyObject *py_wbint_GetNssInfo_in_get_info(PyObject *obj, void *closure)
7158 : {
7159 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(obj);
7160 0 : PyObject *py_info;
7161 0 : if (object->in.info == NULL) {
7162 0 : Py_RETURN_NONE;
7163 : }
7164 0 : py_info = pytalloc_reference_ex(&wbint_userinfo_Type, object->in.info, object->in.info);
7165 0 : return py_info;
7166 : }
7167 :
7168 0 : static int py_wbint_GetNssInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
7169 : {
7170 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(py_obj);
7171 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
7172 0 : if (value == NULL) {
7173 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
7174 0 : return -1;
7175 : }
7176 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
7177 0 : if (object->in.info == NULL) {
7178 0 : PyErr_NoMemory();
7179 0 : return -1;
7180 : }
7181 0 : PY_CHECK_TYPE(&wbint_userinfo_Type, value, return -1;);
7182 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7183 0 : PyErr_NoMemory();
7184 0 : return -1;
7185 : }
7186 0 : object->in.info = (struct wbint_userinfo *)pytalloc_get_ptr(value);
7187 0 : return 0;
7188 : }
7189 :
7190 0 : static PyObject *py_wbint_GetNssInfo_out_get_info(PyObject *obj, void *closure)
7191 : {
7192 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(obj);
7193 0 : PyObject *py_info;
7194 0 : if (object->out.info == NULL) {
7195 0 : Py_RETURN_NONE;
7196 : }
7197 0 : py_info = pytalloc_reference_ex(&wbint_userinfo_Type, object->out.info, object->out.info);
7198 0 : return py_info;
7199 : }
7200 :
7201 0 : static int py_wbint_GetNssInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
7202 : {
7203 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(py_obj);
7204 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
7205 0 : if (value == NULL) {
7206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
7207 0 : return -1;
7208 : }
7209 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
7210 0 : if (object->out.info == NULL) {
7211 0 : PyErr_NoMemory();
7212 0 : return -1;
7213 : }
7214 0 : PY_CHECK_TYPE(&wbint_userinfo_Type, value, return -1;);
7215 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7216 0 : PyErr_NoMemory();
7217 0 : return -1;
7218 : }
7219 0 : object->out.info = (struct wbint_userinfo *)pytalloc_get_ptr(value);
7220 0 : return 0;
7221 : }
7222 :
7223 0 : static PyObject *py_wbint_GetNssInfo_get_result(PyObject *obj, void *closure)
7224 : {
7225 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(obj);
7226 0 : PyObject *py_result;
7227 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
7228 0 : return py_result;
7229 : }
7230 :
7231 0 : static int py_wbint_GetNssInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
7232 : {
7233 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(py_obj);
7234 0 : if (value == NULL) {
7235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
7236 0 : return -1;
7237 : }
7238 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
7239 0 : return 0;
7240 : }
7241 :
7242 : static PyGetSetDef py_wbint_GetNssInfo_getsetters[] = {
7243 : {
7244 : .name = discard_const_p(char, "in_info"),
7245 : .get = py_wbint_GetNssInfo_in_get_info,
7246 : .set = py_wbint_GetNssInfo_in_set_info,
7247 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
7248 : },
7249 : {
7250 : .name = discard_const_p(char, "out_info"),
7251 : .get = py_wbint_GetNssInfo_out_get_info,
7252 : .set = py_wbint_GetNssInfo_out_set_info,
7253 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_userinfo")
7254 : },
7255 : {
7256 : .name = discard_const_p(char, "result"),
7257 : .get = py_wbint_GetNssInfo_get_result,
7258 : .set = py_wbint_GetNssInfo_set_result,
7259 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
7260 : },
7261 : { .name = NULL }
7262 : };
7263 :
7264 0 : static PyObject *py_wbint_GetNssInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7265 : {
7266 0 : PyObject *self = pytalloc_new(struct wbint_GetNssInfo, type);
7267 0 : struct wbint_GetNssInfo *_self = (struct wbint_GetNssInfo *)pytalloc_get_ptr(self);
7268 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
7269 0 : _self->in.info = talloc_zero(mem_ctx, struct wbint_userinfo);
7270 0 : _self->out.info = talloc_zero(mem_ctx, struct wbint_userinfo);
7271 0 : return self;
7272 : }
7273 :
7274 0 : static PyObject *py_wbint_GetNssInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
7275 : {
7276 :
7277 :
7278 0 : return PyLong_FromLong(8);
7279 : }
7280 :
7281 0 : static PyObject *py_wbint_GetNssInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
7282 : {
7283 0 : const struct ndr_interface_call *call = NULL;
7284 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(py_obj);
7285 0 : PyObject *ret = NULL;
7286 0 : struct ndr_push *push = NULL;
7287 0 : DATA_BLOB blob;
7288 0 : enum ndr_err_code err;
7289 :
7290 0 : if (ndr_table_winbind.num_calls < 9) {
7291 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_pack");
7292 0 : return NULL;
7293 : }
7294 0 : call = &ndr_table_winbind.calls[8];
7295 :
7296 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
7297 0 : if (push == NULL) {
7298 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7299 0 : return NULL;
7300 : }
7301 :
7302 0 : push->flags |= ndr_push_flags;
7303 :
7304 0 : err = call->ndr_push(push, ndr_inout_flags, object);
7305 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7306 0 : TALLOC_FREE(push);
7307 0 : PyErr_SetNdrError(err);
7308 0 : return NULL;
7309 : }
7310 0 : blob = ndr_push_blob(push);
7311 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7312 0 : TALLOC_FREE(push);
7313 0 : return ret;
7314 : }
7315 :
7316 0 : static PyObject *py_wbint_GetNssInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7317 : {
7318 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7319 0 : PyObject *bigendian_obj = NULL;
7320 0 : PyObject *ndr64_obj = NULL;
7321 0 : libndr_flags ndr_push_flags = 0;
7322 :
7323 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
7324 : discard_const_p(char *, kwnames),
7325 : &bigendian_obj,
7326 : &ndr64_obj)) {
7327 0 : return NULL;
7328 : }
7329 :
7330 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7331 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7332 : }
7333 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7334 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7335 : }
7336 :
7337 0 : return py_wbint_GetNssInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
7338 : }
7339 :
7340 0 : static PyObject *py_wbint_GetNssInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7341 : {
7342 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7343 0 : PyObject *bigendian_obj = NULL;
7344 0 : PyObject *ndr64_obj = NULL;
7345 0 : libndr_flags ndr_push_flags = 0;
7346 :
7347 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
7348 : discard_const_p(char *, kwnames),
7349 : &bigendian_obj,
7350 : &ndr64_obj)) {
7351 0 : return NULL;
7352 : }
7353 :
7354 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7355 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7356 : }
7357 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7358 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7359 : }
7360 :
7361 0 : return py_wbint_GetNssInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
7362 : }
7363 :
7364 0 : static PyObject *py_wbint_GetNssInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
7365 : {
7366 0 : const struct ndr_interface_call *call = NULL;
7367 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(py_obj);
7368 0 : struct ndr_pull *pull = NULL;
7369 0 : enum ndr_err_code err;
7370 :
7371 0 : if (ndr_table_winbind.num_calls < 9) {
7372 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_unpack");
7373 0 : return NULL;
7374 : }
7375 0 : call = &ndr_table_winbind.calls[8];
7376 :
7377 0 : pull = ndr_pull_init_blob(blob, object);
7378 0 : if (pull == NULL) {
7379 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7380 0 : return NULL;
7381 : }
7382 :
7383 0 : pull->flags |= ndr_pull_flags;
7384 :
7385 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
7386 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7387 0 : TALLOC_FREE(pull);
7388 0 : PyErr_SetNdrError(err);
7389 0 : return NULL;
7390 : }
7391 0 : if (!allow_remaining) {
7392 0 : uint32_t highest_ofs;
7393 :
7394 0 : if (pull->offset > pull->relative_highest_offset) {
7395 0 : highest_ofs = pull->offset;
7396 : } else {
7397 0 : highest_ofs = pull->relative_highest_offset;
7398 : }
7399 0 : if (highest_ofs < pull->data_size) {
7400 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
7401 : "not all bytes consumed ofs[%u] size[%u]",
7402 : highest_ofs, pull->data_size);
7403 0 : TALLOC_FREE(pull);
7404 0 : PyErr_SetNdrError(err);
7405 0 : return NULL;
7406 : }
7407 : }
7408 :
7409 0 : TALLOC_FREE(pull);
7410 0 : Py_RETURN_NONE;
7411 : }
7412 :
7413 0 : static PyObject *py_wbint_GetNssInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7414 : {
7415 0 : DATA_BLOB blob;
7416 0 : Py_ssize_t blob_length = 0;
7417 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7418 0 : PyObject *bigendian_obj = NULL;
7419 0 : PyObject *ndr64_obj = NULL;
7420 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7421 0 : PyObject *allow_remaining_obj = NULL;
7422 0 : bool allow_remaining = false;
7423 :
7424 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
7425 : discard_const_p(char *, kwnames),
7426 : &blob.data, &blob_length,
7427 : &bigendian_obj,
7428 : &ndr64_obj,
7429 : &allow_remaining_obj)) {
7430 0 : return NULL;
7431 : }
7432 0 : blob.length = blob_length;
7433 :
7434 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7435 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7436 : }
7437 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7438 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7439 : }
7440 :
7441 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7442 0 : allow_remaining = true;
7443 : }
7444 :
7445 0 : return py_wbint_GetNssInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
7446 : }
7447 :
7448 0 : static PyObject *py_wbint_GetNssInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7449 : {
7450 0 : DATA_BLOB blob;
7451 0 : Py_ssize_t blob_length = 0;
7452 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7453 0 : PyObject *bigendian_obj = NULL;
7454 0 : PyObject *ndr64_obj = NULL;
7455 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7456 0 : PyObject *allow_remaining_obj = NULL;
7457 0 : bool allow_remaining = false;
7458 :
7459 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
7460 : discard_const_p(char *, kwnames),
7461 : &blob.data, &blob_length,
7462 : &bigendian_obj,
7463 : &ndr64_obj,
7464 : &allow_remaining_obj)) {
7465 0 : return NULL;
7466 : }
7467 0 : blob.length = blob_length;
7468 :
7469 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7470 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7471 : }
7472 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7473 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7474 : }
7475 :
7476 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7477 0 : allow_remaining = true;
7478 : }
7479 :
7480 0 : return py_wbint_GetNssInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
7481 : }
7482 :
7483 0 : static PyObject *py_wbint_GetNssInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
7484 : {
7485 0 : const struct ndr_interface_call *call = NULL;
7486 0 : struct wbint_GetNssInfo *object = pytalloc_get_ptr(py_obj);
7487 0 : PyObject *ret;
7488 0 : char *retstr;
7489 :
7490 0 : if (ndr_table_winbind.num_calls < 9) {
7491 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_GetNssInfo_ndr_print");
7492 0 : return NULL;
7493 : }
7494 0 : call = &ndr_table_winbind.calls[8];
7495 :
7496 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
7497 0 : ret = PyUnicode_FromString(retstr);
7498 0 : TALLOC_FREE(retstr);
7499 :
7500 0 : return ret;
7501 : }
7502 :
7503 0 : static PyObject *py_wbint_GetNssInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7504 : {
7505 0 : return py_wbint_GetNssInfo_ndr_print(py_obj, "wbint_GetNssInfo_in", NDR_IN);
7506 : }
7507 :
7508 0 : static PyObject *py_wbint_GetNssInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7509 : {
7510 0 : return py_wbint_GetNssInfo_ndr_print(py_obj, "wbint_GetNssInfo_out", NDR_OUT);
7511 : }
7512 :
7513 : static PyMethodDef py_wbint_GetNssInfo_methods[] = {
7514 : { "opnum", (PyCFunction)py_wbint_GetNssInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
7515 : "winbind.wbint_GetNssInfo.opnum() -> 8 (0x08) " },
7516 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
7517 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
7518 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
7519 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
7520 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
7521 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
7522 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_GetNssInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
7523 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
7524 : { "__ndr_print_in__", (PyCFunction)py_wbint_GetNssInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
7525 : { "__ndr_print_out__", (PyCFunction)py_wbint_GetNssInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
7526 : { NULL, NULL, 0, NULL }
7527 : };
7528 :
7529 :
7530 : static PyTypeObject wbint_GetNssInfo_Type = {
7531 : PyVarObject_HEAD_INIT(NULL, 0)
7532 : .tp_name = "winbind.wbint_GetNssInfo",
7533 : .tp_getset = py_wbint_GetNssInfo_getsetters,
7534 : .tp_methods = py_wbint_GetNssInfo_methods,
7535 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7536 : .tp_new = py_wbint_GetNssInfo_new,
7537 : };
7538 :
7539 0 : static bool pack_py_wbint_GetNssInfo_args_in(PyObject *args, PyObject *kwargs, struct wbint_GetNssInfo *r)
7540 : {
7541 0 : PyObject *py_info;
7542 0 : const char *kwnames[] = {
7543 : "info", NULL
7544 : };
7545 :
7546 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_GetNssInfo", discard_const_p(char *, kwnames), &py_info)) {
7547 0 : return false;
7548 : }
7549 :
7550 0 : if (py_info == NULL) {
7551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
7552 0 : return false;
7553 : }
7554 0 : r->in.info = talloc_ptrtype(r, r->in.info);
7555 0 : if (r->in.info == NULL) {
7556 0 : PyErr_NoMemory();
7557 0 : return false;
7558 : }
7559 0 : PY_CHECK_TYPE(&wbint_userinfo_Type, py_info, return false;);
7560 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
7561 0 : PyErr_NoMemory();
7562 0 : return false;
7563 : }
7564 0 : r->in.info = (struct wbint_userinfo *)pytalloc_get_ptr(py_info);
7565 0 : return true;
7566 : }
7567 :
7568 0 : static PyObject *unpack_py_wbint_GetNssInfo_args_out(struct wbint_GetNssInfo *r)
7569 : {
7570 0 : PyObject *result;
7571 0 : PyObject *py_info;
7572 0 : py_info = pytalloc_reference_ex(&wbint_userinfo_Type, r->out.info, r->out.info);
7573 0 : result = py_info;
7574 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
7575 0 : PyErr_SetNTSTATUS(r->out.result);
7576 0 : return NULL;
7577 : }
7578 :
7579 0 : return result;
7580 : }
7581 :
7582 :
7583 0 : static PyObject *py_wbint_LookupUserAliases_in_get_sids(PyObject *obj, void *closure)
7584 : {
7585 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(obj);
7586 0 : PyObject *py_sids;
7587 0 : if (object->in.sids == NULL) {
7588 0 : Py_RETURN_NONE;
7589 : }
7590 0 : py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->in.sids, object->in.sids);
7591 0 : return py_sids;
7592 : }
7593 :
7594 0 : static int py_wbint_LookupUserAliases_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
7595 : {
7596 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(py_obj);
7597 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
7598 0 : if (value == NULL) {
7599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
7600 0 : return -1;
7601 : }
7602 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
7603 0 : if (object->in.sids == NULL) {
7604 0 : PyErr_NoMemory();
7605 0 : return -1;
7606 : }
7607 0 : PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
7608 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7609 0 : PyErr_NoMemory();
7610 0 : return -1;
7611 : }
7612 0 : object->in.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value);
7613 0 : return 0;
7614 : }
7615 :
7616 0 : static PyObject *py_wbint_LookupUserAliases_out_get_rids(PyObject *obj, void *closure)
7617 : {
7618 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(obj);
7619 0 : PyObject *py_rids;
7620 0 : if (object->out.rids == NULL) {
7621 0 : Py_RETURN_NONE;
7622 : }
7623 0 : py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->out.rids, object->out.rids);
7624 0 : return py_rids;
7625 : }
7626 :
7627 0 : static int py_wbint_LookupUserAliases_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
7628 : {
7629 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(py_obj);
7630 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
7631 0 : if (value == NULL) {
7632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.rids");
7633 0 : return -1;
7634 : }
7635 0 : object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
7636 0 : if (object->out.rids == NULL) {
7637 0 : PyErr_NoMemory();
7638 0 : return -1;
7639 : }
7640 0 : PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;);
7641 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7642 0 : PyErr_NoMemory();
7643 0 : return -1;
7644 : }
7645 0 : object->out.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value);
7646 0 : return 0;
7647 : }
7648 :
7649 0 : static PyObject *py_wbint_LookupUserAliases_get_result(PyObject *obj, void *closure)
7650 : {
7651 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(obj);
7652 0 : PyObject *py_result;
7653 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
7654 0 : return py_result;
7655 : }
7656 :
7657 0 : static int py_wbint_LookupUserAliases_set_result(PyObject *py_obj, PyObject *value, void *closure)
7658 : {
7659 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(py_obj);
7660 0 : if (value == NULL) {
7661 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
7662 0 : return -1;
7663 : }
7664 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
7665 0 : return 0;
7666 : }
7667 :
7668 : static PyGetSetDef py_wbint_LookupUserAliases_getsetters[] = {
7669 : {
7670 : .name = discard_const_p(char, "in_sids"),
7671 : .get = py_wbint_LookupUserAliases_in_get_sids,
7672 : .set = py_wbint_LookupUserAliases_in_set_sids,
7673 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
7674 : },
7675 : {
7676 : .name = discard_const_p(char, "out_rids"),
7677 : .get = py_wbint_LookupUserAliases_out_get_rids,
7678 : .set = py_wbint_LookupUserAliases_out_set_rids,
7679 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray")
7680 : },
7681 : {
7682 : .name = discard_const_p(char, "result"),
7683 : .get = py_wbint_LookupUserAliases_get_result,
7684 : .set = py_wbint_LookupUserAliases_set_result,
7685 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
7686 : },
7687 : { .name = NULL }
7688 : };
7689 :
7690 0 : static PyObject *py_wbint_LookupUserAliases_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7691 : {
7692 0 : PyObject *self = pytalloc_new(struct wbint_LookupUserAliases, type);
7693 0 : struct wbint_LookupUserAliases *_self = (struct wbint_LookupUserAliases *)pytalloc_get_ptr(self);
7694 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
7695 0 : _self->in.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
7696 0 : _self->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
7697 0 : return self;
7698 : }
7699 :
7700 0 : static PyObject *py_wbint_LookupUserAliases_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
7701 : {
7702 :
7703 :
7704 0 : return PyLong_FromLong(9);
7705 : }
7706 :
7707 0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
7708 : {
7709 0 : const struct ndr_interface_call *call = NULL;
7710 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(py_obj);
7711 0 : PyObject *ret = NULL;
7712 0 : struct ndr_push *push = NULL;
7713 0 : DATA_BLOB blob;
7714 0 : enum ndr_err_code err;
7715 :
7716 0 : if (ndr_table_winbind.num_calls < 10) {
7717 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_pack");
7718 0 : return NULL;
7719 : }
7720 0 : call = &ndr_table_winbind.calls[9];
7721 :
7722 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
7723 0 : if (push == NULL) {
7724 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7725 0 : return NULL;
7726 : }
7727 :
7728 0 : push->flags |= ndr_push_flags;
7729 :
7730 0 : err = call->ndr_push(push, ndr_inout_flags, object);
7731 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7732 0 : TALLOC_FREE(push);
7733 0 : PyErr_SetNdrError(err);
7734 0 : return NULL;
7735 : }
7736 0 : blob = ndr_push_blob(push);
7737 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7738 0 : TALLOC_FREE(push);
7739 0 : return ret;
7740 : }
7741 :
7742 0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7743 : {
7744 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7745 0 : PyObject *bigendian_obj = NULL;
7746 0 : PyObject *ndr64_obj = NULL;
7747 0 : libndr_flags ndr_push_flags = 0;
7748 :
7749 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
7750 : discard_const_p(char *, kwnames),
7751 : &bigendian_obj,
7752 : &ndr64_obj)) {
7753 0 : return NULL;
7754 : }
7755 :
7756 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7757 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7758 : }
7759 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7760 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7761 : }
7762 :
7763 0 : return py_wbint_LookupUserAliases_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
7764 : }
7765 :
7766 0 : static PyObject *py_wbint_LookupUserAliases_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7767 : {
7768 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7769 0 : PyObject *bigendian_obj = NULL;
7770 0 : PyObject *ndr64_obj = NULL;
7771 0 : libndr_flags ndr_push_flags = 0;
7772 :
7773 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
7774 : discard_const_p(char *, kwnames),
7775 : &bigendian_obj,
7776 : &ndr64_obj)) {
7777 0 : return NULL;
7778 : }
7779 :
7780 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7781 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7782 : }
7783 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7784 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7785 : }
7786 :
7787 0 : return py_wbint_LookupUserAliases_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
7788 : }
7789 :
7790 0 : static PyObject *py_wbint_LookupUserAliases_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
7791 : {
7792 0 : const struct ndr_interface_call *call = NULL;
7793 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(py_obj);
7794 0 : struct ndr_pull *pull = NULL;
7795 0 : enum ndr_err_code err;
7796 :
7797 0 : if (ndr_table_winbind.num_calls < 10) {
7798 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_unpack");
7799 0 : return NULL;
7800 : }
7801 0 : call = &ndr_table_winbind.calls[9];
7802 :
7803 0 : pull = ndr_pull_init_blob(blob, object);
7804 0 : if (pull == NULL) {
7805 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7806 0 : return NULL;
7807 : }
7808 :
7809 0 : pull->flags |= ndr_pull_flags;
7810 :
7811 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
7812 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7813 0 : TALLOC_FREE(pull);
7814 0 : PyErr_SetNdrError(err);
7815 0 : return NULL;
7816 : }
7817 0 : if (!allow_remaining) {
7818 0 : uint32_t highest_ofs;
7819 :
7820 0 : if (pull->offset > pull->relative_highest_offset) {
7821 0 : highest_ofs = pull->offset;
7822 : } else {
7823 0 : highest_ofs = pull->relative_highest_offset;
7824 : }
7825 0 : if (highest_ofs < pull->data_size) {
7826 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
7827 : "not all bytes consumed ofs[%u] size[%u]",
7828 : highest_ofs, pull->data_size);
7829 0 : TALLOC_FREE(pull);
7830 0 : PyErr_SetNdrError(err);
7831 0 : return NULL;
7832 : }
7833 : }
7834 :
7835 0 : TALLOC_FREE(pull);
7836 0 : Py_RETURN_NONE;
7837 : }
7838 :
7839 0 : static PyObject *py_wbint_LookupUserAliases_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7840 : {
7841 0 : DATA_BLOB blob;
7842 0 : Py_ssize_t blob_length = 0;
7843 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7844 0 : PyObject *bigendian_obj = NULL;
7845 0 : PyObject *ndr64_obj = NULL;
7846 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7847 0 : PyObject *allow_remaining_obj = NULL;
7848 0 : bool allow_remaining = false;
7849 :
7850 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
7851 : discard_const_p(char *, kwnames),
7852 : &blob.data, &blob_length,
7853 : &bigendian_obj,
7854 : &ndr64_obj,
7855 : &allow_remaining_obj)) {
7856 0 : return NULL;
7857 : }
7858 0 : blob.length = blob_length;
7859 :
7860 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7861 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7862 : }
7863 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7864 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7865 : }
7866 :
7867 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7868 0 : allow_remaining = true;
7869 : }
7870 :
7871 0 : return py_wbint_LookupUserAliases_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
7872 : }
7873 :
7874 0 : static PyObject *py_wbint_LookupUserAliases_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7875 : {
7876 0 : DATA_BLOB blob;
7877 0 : Py_ssize_t blob_length = 0;
7878 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7879 0 : PyObject *bigendian_obj = NULL;
7880 0 : PyObject *ndr64_obj = NULL;
7881 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7882 0 : PyObject *allow_remaining_obj = NULL;
7883 0 : bool allow_remaining = false;
7884 :
7885 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
7886 : discard_const_p(char *, kwnames),
7887 : &blob.data, &blob_length,
7888 : &bigendian_obj,
7889 : &ndr64_obj,
7890 : &allow_remaining_obj)) {
7891 0 : return NULL;
7892 : }
7893 0 : blob.length = blob_length;
7894 :
7895 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7896 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7897 : }
7898 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7899 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7900 : }
7901 :
7902 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7903 0 : allow_remaining = true;
7904 : }
7905 :
7906 0 : return py_wbint_LookupUserAliases_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
7907 : }
7908 :
7909 0 : static PyObject *py_wbint_LookupUserAliases_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
7910 : {
7911 0 : const struct ndr_interface_call *call = NULL;
7912 0 : struct wbint_LookupUserAliases *object = pytalloc_get_ptr(py_obj);
7913 0 : PyObject *ret;
7914 0 : char *retstr;
7915 :
7916 0 : if (ndr_table_winbind.num_calls < 10) {
7917 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserAliases_ndr_print");
7918 0 : return NULL;
7919 : }
7920 0 : call = &ndr_table_winbind.calls[9];
7921 :
7922 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
7923 0 : ret = PyUnicode_FromString(retstr);
7924 0 : TALLOC_FREE(retstr);
7925 :
7926 0 : return ret;
7927 : }
7928 :
7929 0 : static PyObject *py_wbint_LookupUserAliases_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7930 : {
7931 0 : return py_wbint_LookupUserAliases_ndr_print(py_obj, "wbint_LookupUserAliases_in", NDR_IN);
7932 : }
7933 :
7934 0 : static PyObject *py_wbint_LookupUserAliases_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7935 : {
7936 0 : return py_wbint_LookupUserAliases_ndr_print(py_obj, "wbint_LookupUserAliases_out", NDR_OUT);
7937 : }
7938 :
7939 : static PyMethodDef py_wbint_LookupUserAliases_methods[] = {
7940 : { "opnum", (PyCFunction)py_wbint_LookupUserAliases_ndr_opnum, METH_NOARGS|METH_CLASS,
7941 : "winbind.wbint_LookupUserAliases.opnum() -> 9 (0x09) " },
7942 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
7943 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
7944 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
7945 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
7946 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
7947 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
7948 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserAliases_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
7949 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
7950 : { "__ndr_print_in__", (PyCFunction)py_wbint_LookupUserAliases_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
7951 : { "__ndr_print_out__", (PyCFunction)py_wbint_LookupUserAliases_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
7952 : { NULL, NULL, 0, NULL }
7953 : };
7954 :
7955 :
7956 : static PyTypeObject wbint_LookupUserAliases_Type = {
7957 : PyVarObject_HEAD_INIT(NULL, 0)
7958 : .tp_name = "winbind.wbint_LookupUserAliases",
7959 : .tp_getset = py_wbint_LookupUserAliases_getsetters,
7960 : .tp_methods = py_wbint_LookupUserAliases_methods,
7961 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7962 : .tp_new = py_wbint_LookupUserAliases_new,
7963 : };
7964 :
7965 0 : static bool pack_py_wbint_LookupUserAliases_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupUserAliases *r)
7966 : {
7967 0 : PyObject *py_sids;
7968 0 : const char *kwnames[] = {
7969 : "sids", NULL
7970 : };
7971 :
7972 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupUserAliases", discard_const_p(char *, kwnames), &py_sids)) {
7973 0 : return false;
7974 : }
7975 :
7976 0 : if (py_sids == NULL) {
7977 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
7978 0 : return false;
7979 : }
7980 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
7981 0 : if (r->in.sids == NULL) {
7982 0 : PyErr_NoMemory();
7983 0 : return false;
7984 : }
7985 0 : PY_CHECK_TYPE(&wbint_SidArray_Type, py_sids, return false;);
7986 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
7987 0 : PyErr_NoMemory();
7988 0 : return false;
7989 : }
7990 0 : r->in.sids = (struct wbint_SidArray *)pytalloc_get_ptr(py_sids);
7991 0 : return true;
7992 : }
7993 :
7994 0 : static PyObject *unpack_py_wbint_LookupUserAliases_args_out(struct wbint_LookupUserAliases *r)
7995 : {
7996 0 : PyObject *result;
7997 0 : PyObject *py_rids;
7998 0 : py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, r->out.rids, r->out.rids);
7999 0 : result = py_rids;
8000 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
8001 0 : PyErr_SetNTSTATUS(r->out.result);
8002 0 : return NULL;
8003 : }
8004 :
8005 0 : return result;
8006 : }
8007 :
8008 :
8009 0 : static PyObject *py_wbint_LookupUserGroups_in_get_sid(PyObject *obj, void *closure)
8010 : {
8011 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(obj);
8012 0 : PyObject *py_sid;
8013 0 : if (object->in.sid == NULL) {
8014 0 : Py_RETURN_NONE;
8015 : }
8016 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
8017 0 : return py_sid;
8018 : }
8019 :
8020 0 : static int py_wbint_LookupUserGroups_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
8021 : {
8022 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(py_obj);
8023 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
8024 0 : if (value == NULL) {
8025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
8026 0 : return -1;
8027 : }
8028 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
8029 0 : if (object->in.sid == NULL) {
8030 0 : PyErr_NoMemory();
8031 0 : return -1;
8032 : }
8033 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
8034 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8035 0 : PyErr_NoMemory();
8036 0 : return -1;
8037 : }
8038 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
8039 0 : return 0;
8040 : }
8041 :
8042 0 : static PyObject *py_wbint_LookupUserGroups_out_get_sids(PyObject *obj, void *closure)
8043 : {
8044 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(obj);
8045 0 : PyObject *py_sids;
8046 0 : if (object->out.sids == NULL) {
8047 0 : Py_RETURN_NONE;
8048 : }
8049 0 : py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->out.sids, object->out.sids);
8050 0 : return py_sids;
8051 : }
8052 :
8053 0 : static int py_wbint_LookupUserGroups_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
8054 : {
8055 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(py_obj);
8056 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
8057 0 : if (value == NULL) {
8058 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
8059 0 : return -1;
8060 : }
8061 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
8062 0 : if (object->out.sids == NULL) {
8063 0 : PyErr_NoMemory();
8064 0 : return -1;
8065 : }
8066 0 : PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
8067 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8068 0 : PyErr_NoMemory();
8069 0 : return -1;
8070 : }
8071 0 : object->out.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value);
8072 0 : return 0;
8073 : }
8074 :
8075 0 : static PyObject *py_wbint_LookupUserGroups_get_result(PyObject *obj, void *closure)
8076 : {
8077 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(obj);
8078 0 : PyObject *py_result;
8079 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
8080 0 : return py_result;
8081 : }
8082 :
8083 0 : static int py_wbint_LookupUserGroups_set_result(PyObject *py_obj, PyObject *value, void *closure)
8084 : {
8085 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(py_obj);
8086 0 : if (value == NULL) {
8087 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
8088 0 : return -1;
8089 : }
8090 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
8091 0 : return 0;
8092 : }
8093 :
8094 : static PyGetSetDef py_wbint_LookupUserGroups_getsetters[] = {
8095 : {
8096 : .name = discard_const_p(char, "in_sid"),
8097 : .get = py_wbint_LookupUserGroups_in_get_sid,
8098 : .set = py_wbint_LookupUserGroups_in_set_sid,
8099 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
8100 : },
8101 : {
8102 : .name = discard_const_p(char, "out_sids"),
8103 : .get = py_wbint_LookupUserGroups_out_get_sids,
8104 : .set = py_wbint_LookupUserGroups_out_set_sids,
8105 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
8106 : },
8107 : {
8108 : .name = discard_const_p(char, "result"),
8109 : .get = py_wbint_LookupUserGroups_get_result,
8110 : .set = py_wbint_LookupUserGroups_set_result,
8111 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
8112 : },
8113 : { .name = NULL }
8114 : };
8115 :
8116 0 : static PyObject *py_wbint_LookupUserGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8117 : {
8118 0 : PyObject *self = pytalloc_new(struct wbint_LookupUserGroups, type);
8119 0 : struct wbint_LookupUserGroups *_self = (struct wbint_LookupUserGroups *)pytalloc_get_ptr(self);
8120 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
8121 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
8122 0 : _self->out.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
8123 0 : return self;
8124 : }
8125 :
8126 0 : static PyObject *py_wbint_LookupUserGroups_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
8127 : {
8128 :
8129 :
8130 0 : return PyLong_FromLong(10);
8131 : }
8132 :
8133 0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
8134 : {
8135 0 : const struct ndr_interface_call *call = NULL;
8136 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(py_obj);
8137 0 : PyObject *ret = NULL;
8138 0 : struct ndr_push *push = NULL;
8139 0 : DATA_BLOB blob;
8140 0 : enum ndr_err_code err;
8141 :
8142 0 : if (ndr_table_winbind.num_calls < 11) {
8143 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_pack");
8144 0 : return NULL;
8145 : }
8146 0 : call = &ndr_table_winbind.calls[10];
8147 :
8148 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
8149 0 : if (push == NULL) {
8150 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8151 0 : return NULL;
8152 : }
8153 :
8154 0 : push->flags |= ndr_push_flags;
8155 :
8156 0 : err = call->ndr_push(push, ndr_inout_flags, object);
8157 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8158 0 : TALLOC_FREE(push);
8159 0 : PyErr_SetNdrError(err);
8160 0 : return NULL;
8161 : }
8162 0 : blob = ndr_push_blob(push);
8163 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8164 0 : TALLOC_FREE(push);
8165 0 : return ret;
8166 : }
8167 :
8168 0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8169 : {
8170 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8171 0 : PyObject *bigendian_obj = NULL;
8172 0 : PyObject *ndr64_obj = NULL;
8173 0 : libndr_flags ndr_push_flags = 0;
8174 :
8175 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
8176 : discard_const_p(char *, kwnames),
8177 : &bigendian_obj,
8178 : &ndr64_obj)) {
8179 0 : return NULL;
8180 : }
8181 :
8182 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8183 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8184 : }
8185 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8186 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8187 : }
8188 :
8189 0 : return py_wbint_LookupUserGroups_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
8190 : }
8191 :
8192 0 : static PyObject *py_wbint_LookupUserGroups_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8193 : {
8194 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8195 0 : PyObject *bigendian_obj = NULL;
8196 0 : PyObject *ndr64_obj = NULL;
8197 0 : libndr_flags ndr_push_flags = 0;
8198 :
8199 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
8200 : discard_const_p(char *, kwnames),
8201 : &bigendian_obj,
8202 : &ndr64_obj)) {
8203 0 : return NULL;
8204 : }
8205 :
8206 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8207 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8208 : }
8209 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8210 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8211 : }
8212 :
8213 0 : return py_wbint_LookupUserGroups_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
8214 : }
8215 :
8216 0 : static PyObject *py_wbint_LookupUserGroups_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
8217 : {
8218 0 : const struct ndr_interface_call *call = NULL;
8219 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(py_obj);
8220 0 : struct ndr_pull *pull = NULL;
8221 0 : enum ndr_err_code err;
8222 :
8223 0 : if (ndr_table_winbind.num_calls < 11) {
8224 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_unpack");
8225 0 : return NULL;
8226 : }
8227 0 : call = &ndr_table_winbind.calls[10];
8228 :
8229 0 : pull = ndr_pull_init_blob(blob, object);
8230 0 : if (pull == NULL) {
8231 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8232 0 : return NULL;
8233 : }
8234 :
8235 0 : pull->flags |= ndr_pull_flags;
8236 :
8237 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
8238 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8239 0 : TALLOC_FREE(pull);
8240 0 : PyErr_SetNdrError(err);
8241 0 : return NULL;
8242 : }
8243 0 : if (!allow_remaining) {
8244 0 : uint32_t highest_ofs;
8245 :
8246 0 : if (pull->offset > pull->relative_highest_offset) {
8247 0 : highest_ofs = pull->offset;
8248 : } else {
8249 0 : highest_ofs = pull->relative_highest_offset;
8250 : }
8251 0 : if (highest_ofs < pull->data_size) {
8252 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
8253 : "not all bytes consumed ofs[%u] size[%u]",
8254 : highest_ofs, pull->data_size);
8255 0 : TALLOC_FREE(pull);
8256 0 : PyErr_SetNdrError(err);
8257 0 : return NULL;
8258 : }
8259 : }
8260 :
8261 0 : TALLOC_FREE(pull);
8262 0 : Py_RETURN_NONE;
8263 : }
8264 :
8265 0 : static PyObject *py_wbint_LookupUserGroups_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8266 : {
8267 0 : DATA_BLOB blob;
8268 0 : Py_ssize_t blob_length = 0;
8269 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8270 0 : PyObject *bigendian_obj = NULL;
8271 0 : PyObject *ndr64_obj = NULL;
8272 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8273 0 : PyObject *allow_remaining_obj = NULL;
8274 0 : bool allow_remaining = false;
8275 :
8276 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
8277 : discard_const_p(char *, kwnames),
8278 : &blob.data, &blob_length,
8279 : &bigendian_obj,
8280 : &ndr64_obj,
8281 : &allow_remaining_obj)) {
8282 0 : return NULL;
8283 : }
8284 0 : blob.length = blob_length;
8285 :
8286 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8287 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8288 : }
8289 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8290 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8291 : }
8292 :
8293 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8294 0 : allow_remaining = true;
8295 : }
8296 :
8297 0 : return py_wbint_LookupUserGroups_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
8298 : }
8299 :
8300 0 : static PyObject *py_wbint_LookupUserGroups_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8301 : {
8302 0 : DATA_BLOB blob;
8303 0 : Py_ssize_t blob_length = 0;
8304 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8305 0 : PyObject *bigendian_obj = NULL;
8306 0 : PyObject *ndr64_obj = NULL;
8307 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8308 0 : PyObject *allow_remaining_obj = NULL;
8309 0 : bool allow_remaining = false;
8310 :
8311 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
8312 : discard_const_p(char *, kwnames),
8313 : &blob.data, &blob_length,
8314 : &bigendian_obj,
8315 : &ndr64_obj,
8316 : &allow_remaining_obj)) {
8317 0 : return NULL;
8318 : }
8319 0 : blob.length = blob_length;
8320 :
8321 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8322 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8323 : }
8324 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8325 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8326 : }
8327 :
8328 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8329 0 : allow_remaining = true;
8330 : }
8331 :
8332 0 : return py_wbint_LookupUserGroups_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
8333 : }
8334 :
8335 0 : static PyObject *py_wbint_LookupUserGroups_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
8336 : {
8337 0 : const struct ndr_interface_call *call = NULL;
8338 0 : struct wbint_LookupUserGroups *object = pytalloc_get_ptr(py_obj);
8339 0 : PyObject *ret;
8340 0 : char *retstr;
8341 :
8342 0 : if (ndr_table_winbind.num_calls < 11) {
8343 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupUserGroups_ndr_print");
8344 0 : return NULL;
8345 : }
8346 0 : call = &ndr_table_winbind.calls[10];
8347 :
8348 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
8349 0 : ret = PyUnicode_FromString(retstr);
8350 0 : TALLOC_FREE(retstr);
8351 :
8352 0 : return ret;
8353 : }
8354 :
8355 0 : static PyObject *py_wbint_LookupUserGroups_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8356 : {
8357 0 : return py_wbint_LookupUserGroups_ndr_print(py_obj, "wbint_LookupUserGroups_in", NDR_IN);
8358 : }
8359 :
8360 0 : static PyObject *py_wbint_LookupUserGroups_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8361 : {
8362 0 : return py_wbint_LookupUserGroups_ndr_print(py_obj, "wbint_LookupUserGroups_out", NDR_OUT);
8363 : }
8364 :
8365 : static PyMethodDef py_wbint_LookupUserGroups_methods[] = {
8366 : { "opnum", (PyCFunction)py_wbint_LookupUserGroups_ndr_opnum, METH_NOARGS|METH_CLASS,
8367 : "winbind.wbint_LookupUserGroups.opnum() -> 10 (0x0a) " },
8368 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
8369 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
8370 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
8371 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
8372 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
8373 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
8374 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupUserGroups_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
8375 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
8376 : { "__ndr_print_in__", (PyCFunction)py_wbint_LookupUserGroups_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
8377 : { "__ndr_print_out__", (PyCFunction)py_wbint_LookupUserGroups_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
8378 : { NULL, NULL, 0, NULL }
8379 : };
8380 :
8381 :
8382 : static PyTypeObject wbint_LookupUserGroups_Type = {
8383 : PyVarObject_HEAD_INIT(NULL, 0)
8384 : .tp_name = "winbind.wbint_LookupUserGroups",
8385 : .tp_getset = py_wbint_LookupUserGroups_getsetters,
8386 : .tp_methods = py_wbint_LookupUserGroups_methods,
8387 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8388 : .tp_new = py_wbint_LookupUserGroups_new,
8389 : };
8390 :
8391 0 : static bool pack_py_wbint_LookupUserGroups_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupUserGroups *r)
8392 : {
8393 0 : PyObject *py_sid;
8394 0 : const char *kwnames[] = {
8395 : "sid", NULL
8396 : };
8397 :
8398 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_LookupUserGroups", discard_const_p(char *, kwnames), &py_sid)) {
8399 0 : return false;
8400 : }
8401 :
8402 0 : if (py_sid == NULL) {
8403 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
8404 0 : return false;
8405 : }
8406 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
8407 0 : if (r->in.sid == NULL) {
8408 0 : PyErr_NoMemory();
8409 0 : return false;
8410 : }
8411 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
8412 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
8413 0 : PyErr_NoMemory();
8414 0 : return false;
8415 : }
8416 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
8417 0 : return true;
8418 : }
8419 :
8420 0 : static PyObject *unpack_py_wbint_LookupUserGroups_args_out(struct wbint_LookupUserGroups *r)
8421 : {
8422 0 : PyObject *result;
8423 0 : PyObject *py_sids;
8424 0 : py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, r->out.sids, r->out.sids);
8425 0 : result = py_sids;
8426 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
8427 0 : PyErr_SetNTSTATUS(r->out.result);
8428 0 : return NULL;
8429 : }
8430 :
8431 0 : return result;
8432 : }
8433 :
8434 :
8435 0 : static PyObject *py_wbint_QuerySequenceNumber_out_get_sequence(PyObject *obj, void *closure)
8436 : {
8437 0 : struct wbint_QuerySequenceNumber *object = pytalloc_get_ptr(obj);
8438 0 : PyObject *py_sequence;
8439 0 : if (object->out.sequence == NULL) {
8440 0 : Py_RETURN_NONE;
8441 : }
8442 0 : py_sequence = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.sequence));
8443 0 : return py_sequence;
8444 : }
8445 :
8446 0 : static int py_wbint_QuerySequenceNumber_out_set_sequence(PyObject *py_obj, PyObject *value, void *closure)
8447 : {
8448 0 : struct wbint_QuerySequenceNumber *object = pytalloc_get_ptr(py_obj);
8449 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sequence));
8450 0 : if (value == NULL) {
8451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sequence");
8452 0 : return -1;
8453 : }
8454 0 : object->out.sequence = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sequence);
8455 0 : if (object->out.sequence == NULL) {
8456 0 : PyErr_NoMemory();
8457 0 : return -1;
8458 : }
8459 : {
8460 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.sequence));
8461 0 : if (PyLong_Check(value)) {
8462 0 : unsigned long long test_var;
8463 0 : test_var = PyLong_AsUnsignedLongLong(value);
8464 0 : if (PyErr_Occurred() != NULL) {
8465 0 : return -1;
8466 : }
8467 0 : if (test_var > uint_max) {
8468 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8469 : PyLong_Type.tp_name, uint_max, test_var);
8470 0 : return -1;
8471 : }
8472 0 : *object->out.sequence = test_var;
8473 : } else {
8474 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8475 : PyLong_Type.tp_name);
8476 0 : return -1;
8477 : }
8478 : }
8479 0 : return 0;
8480 : }
8481 :
8482 0 : static PyObject *py_wbint_QuerySequenceNumber_get_result(PyObject *obj, void *closure)
8483 : {
8484 0 : struct wbint_QuerySequenceNumber *object = pytalloc_get_ptr(obj);
8485 0 : PyObject *py_result;
8486 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
8487 0 : return py_result;
8488 : }
8489 :
8490 0 : static int py_wbint_QuerySequenceNumber_set_result(PyObject *py_obj, PyObject *value, void *closure)
8491 : {
8492 0 : struct wbint_QuerySequenceNumber *object = pytalloc_get_ptr(py_obj);
8493 0 : if (value == NULL) {
8494 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
8495 0 : return -1;
8496 : }
8497 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
8498 0 : return 0;
8499 : }
8500 :
8501 : static PyGetSetDef py_wbint_QuerySequenceNumber_getsetters[] = {
8502 : {
8503 : .name = discard_const_p(char, "out_sequence"),
8504 : .get = py_wbint_QuerySequenceNumber_out_get_sequence,
8505 : .set = py_wbint_QuerySequenceNumber_out_set_sequence,
8506 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8507 : },
8508 : {
8509 : .name = discard_const_p(char, "result"),
8510 : .get = py_wbint_QuerySequenceNumber_get_result,
8511 : .set = py_wbint_QuerySequenceNumber_set_result,
8512 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
8513 : },
8514 : { .name = NULL }
8515 : };
8516 :
8517 0 : static PyObject *py_wbint_QuerySequenceNumber_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8518 : {
8519 0 : PyObject *self = pytalloc_new(struct wbint_QuerySequenceNumber, type);
8520 0 : struct wbint_QuerySequenceNumber *_self = (struct wbint_QuerySequenceNumber *)pytalloc_get_ptr(self);
8521 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
8522 0 : _self->out.sequence = talloc_zero(mem_ctx, uint32_t);
8523 0 : return self;
8524 : }
8525 :
8526 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
8527 : {
8528 :
8529 :
8530 0 : return PyLong_FromLong(11);
8531 : }
8532 :
8533 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
8534 : {
8535 0 : const struct ndr_interface_call *call = NULL;
8536 0 : struct wbint_QuerySequenceNumber *object = pytalloc_get_ptr(py_obj);
8537 0 : PyObject *ret = NULL;
8538 0 : struct ndr_push *push = NULL;
8539 0 : DATA_BLOB blob;
8540 0 : enum ndr_err_code err;
8541 :
8542 0 : if (ndr_table_winbind.num_calls < 12) {
8543 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_pack");
8544 0 : return NULL;
8545 : }
8546 0 : call = &ndr_table_winbind.calls[11];
8547 :
8548 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
8549 0 : if (push == NULL) {
8550 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8551 0 : return NULL;
8552 : }
8553 :
8554 0 : push->flags |= ndr_push_flags;
8555 :
8556 0 : err = call->ndr_push(push, ndr_inout_flags, object);
8557 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8558 0 : TALLOC_FREE(push);
8559 0 : PyErr_SetNdrError(err);
8560 0 : return NULL;
8561 : }
8562 0 : blob = ndr_push_blob(push);
8563 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8564 0 : TALLOC_FREE(push);
8565 0 : return ret;
8566 : }
8567 :
8568 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8569 : {
8570 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8571 0 : PyObject *bigendian_obj = NULL;
8572 0 : PyObject *ndr64_obj = NULL;
8573 0 : libndr_flags ndr_push_flags = 0;
8574 :
8575 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
8576 : discard_const_p(char *, kwnames),
8577 : &bigendian_obj,
8578 : &ndr64_obj)) {
8579 0 : return NULL;
8580 : }
8581 :
8582 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8583 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8584 : }
8585 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8586 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8587 : }
8588 :
8589 0 : return py_wbint_QuerySequenceNumber_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
8590 : }
8591 :
8592 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8593 : {
8594 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8595 0 : PyObject *bigendian_obj = NULL;
8596 0 : PyObject *ndr64_obj = NULL;
8597 0 : libndr_flags ndr_push_flags = 0;
8598 :
8599 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
8600 : discard_const_p(char *, kwnames),
8601 : &bigendian_obj,
8602 : &ndr64_obj)) {
8603 0 : return NULL;
8604 : }
8605 :
8606 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8607 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8608 : }
8609 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8610 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8611 : }
8612 :
8613 0 : return py_wbint_QuerySequenceNumber_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
8614 : }
8615 :
8616 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
8617 : {
8618 0 : const struct ndr_interface_call *call = NULL;
8619 0 : struct wbint_QuerySequenceNumber *object = pytalloc_get_ptr(py_obj);
8620 0 : struct ndr_pull *pull = NULL;
8621 0 : enum ndr_err_code err;
8622 :
8623 0 : if (ndr_table_winbind.num_calls < 12) {
8624 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_unpack");
8625 0 : return NULL;
8626 : }
8627 0 : call = &ndr_table_winbind.calls[11];
8628 :
8629 0 : pull = ndr_pull_init_blob(blob, object);
8630 0 : if (pull == NULL) {
8631 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8632 0 : return NULL;
8633 : }
8634 :
8635 0 : pull->flags |= ndr_pull_flags;
8636 :
8637 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
8638 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8639 0 : TALLOC_FREE(pull);
8640 0 : PyErr_SetNdrError(err);
8641 0 : return NULL;
8642 : }
8643 0 : if (!allow_remaining) {
8644 0 : uint32_t highest_ofs;
8645 :
8646 0 : if (pull->offset > pull->relative_highest_offset) {
8647 0 : highest_ofs = pull->offset;
8648 : } else {
8649 0 : highest_ofs = pull->relative_highest_offset;
8650 : }
8651 0 : if (highest_ofs < pull->data_size) {
8652 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
8653 : "not all bytes consumed ofs[%u] size[%u]",
8654 : highest_ofs, pull->data_size);
8655 0 : TALLOC_FREE(pull);
8656 0 : PyErr_SetNdrError(err);
8657 0 : return NULL;
8658 : }
8659 : }
8660 :
8661 0 : TALLOC_FREE(pull);
8662 0 : Py_RETURN_NONE;
8663 : }
8664 :
8665 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8666 : {
8667 0 : DATA_BLOB blob;
8668 0 : Py_ssize_t blob_length = 0;
8669 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8670 0 : PyObject *bigendian_obj = NULL;
8671 0 : PyObject *ndr64_obj = NULL;
8672 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8673 0 : PyObject *allow_remaining_obj = NULL;
8674 0 : bool allow_remaining = false;
8675 :
8676 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
8677 : discard_const_p(char *, kwnames),
8678 : &blob.data, &blob_length,
8679 : &bigendian_obj,
8680 : &ndr64_obj,
8681 : &allow_remaining_obj)) {
8682 0 : return NULL;
8683 : }
8684 0 : blob.length = blob_length;
8685 :
8686 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8687 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8688 : }
8689 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8690 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8691 : }
8692 :
8693 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8694 0 : allow_remaining = true;
8695 : }
8696 :
8697 0 : return py_wbint_QuerySequenceNumber_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
8698 : }
8699 :
8700 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8701 : {
8702 0 : DATA_BLOB blob;
8703 0 : Py_ssize_t blob_length = 0;
8704 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8705 0 : PyObject *bigendian_obj = NULL;
8706 0 : PyObject *ndr64_obj = NULL;
8707 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8708 0 : PyObject *allow_remaining_obj = NULL;
8709 0 : bool allow_remaining = false;
8710 :
8711 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
8712 : discard_const_p(char *, kwnames),
8713 : &blob.data, &blob_length,
8714 : &bigendian_obj,
8715 : &ndr64_obj,
8716 : &allow_remaining_obj)) {
8717 0 : return NULL;
8718 : }
8719 0 : blob.length = blob_length;
8720 :
8721 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8722 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8723 : }
8724 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8725 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8726 : }
8727 :
8728 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8729 0 : allow_remaining = true;
8730 : }
8731 :
8732 0 : return py_wbint_QuerySequenceNumber_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
8733 : }
8734 :
8735 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
8736 : {
8737 0 : const struct ndr_interface_call *call = NULL;
8738 0 : struct wbint_QuerySequenceNumber *object = pytalloc_get_ptr(py_obj);
8739 0 : PyObject *ret;
8740 0 : char *retstr;
8741 :
8742 0 : if (ndr_table_winbind.num_calls < 12) {
8743 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QuerySequenceNumber_ndr_print");
8744 0 : return NULL;
8745 : }
8746 0 : call = &ndr_table_winbind.calls[11];
8747 :
8748 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
8749 0 : ret = PyUnicode_FromString(retstr);
8750 0 : TALLOC_FREE(retstr);
8751 :
8752 0 : return ret;
8753 : }
8754 :
8755 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8756 : {
8757 0 : return py_wbint_QuerySequenceNumber_ndr_print(py_obj, "wbint_QuerySequenceNumber_in", NDR_IN);
8758 : }
8759 :
8760 0 : static PyObject *py_wbint_QuerySequenceNumber_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8761 : {
8762 0 : return py_wbint_QuerySequenceNumber_ndr_print(py_obj, "wbint_QuerySequenceNumber_out", NDR_OUT);
8763 : }
8764 :
8765 : static PyMethodDef py_wbint_QuerySequenceNumber_methods[] = {
8766 : { "opnum", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_opnum, METH_NOARGS|METH_CLASS,
8767 : "winbind.wbint_QuerySequenceNumber.opnum() -> 11 (0x0b) " },
8768 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
8769 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
8770 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
8771 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
8772 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
8773 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
8774 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QuerySequenceNumber_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
8775 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
8776 : { "__ndr_print_in__", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
8777 : { "__ndr_print_out__", (PyCFunction)py_wbint_QuerySequenceNumber_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
8778 : { NULL, NULL, 0, NULL }
8779 : };
8780 :
8781 :
8782 : static PyTypeObject wbint_QuerySequenceNumber_Type = {
8783 : PyVarObject_HEAD_INIT(NULL, 0)
8784 : .tp_name = "winbind.wbint_QuerySequenceNumber",
8785 : .tp_getset = py_wbint_QuerySequenceNumber_getsetters,
8786 : .tp_methods = py_wbint_QuerySequenceNumber_methods,
8787 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8788 : .tp_new = py_wbint_QuerySequenceNumber_new,
8789 : };
8790 :
8791 0 : static bool pack_py_wbint_QuerySequenceNumber_args_in(PyObject *args, PyObject *kwargs, struct wbint_QuerySequenceNumber *r)
8792 : {
8793 0 : const char *kwnames[] = {
8794 : NULL
8795 : };
8796 :
8797 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QuerySequenceNumber", discard_const_p(char *, kwnames))) {
8798 0 : return false;
8799 : }
8800 :
8801 0 : return true;
8802 : }
8803 :
8804 0 : static PyObject *unpack_py_wbint_QuerySequenceNumber_args_out(struct wbint_QuerySequenceNumber *r)
8805 : {
8806 0 : PyObject *result;
8807 0 : PyObject *py_sequence;
8808 0 : py_sequence = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.sequence));
8809 0 : result = py_sequence;
8810 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
8811 0 : PyErr_SetNTSTATUS(r->out.result);
8812 0 : return NULL;
8813 : }
8814 :
8815 0 : return result;
8816 : }
8817 :
8818 :
8819 0 : static PyObject *py_wbint_LookupGroupMembers_in_get_sid(PyObject *obj, void *closure)
8820 : {
8821 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(obj);
8822 0 : PyObject *py_sid;
8823 0 : if (object->in.sid == NULL) {
8824 0 : Py_RETURN_NONE;
8825 : }
8826 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
8827 0 : return py_sid;
8828 : }
8829 :
8830 0 : static int py_wbint_LookupGroupMembers_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
8831 : {
8832 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(py_obj);
8833 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
8834 0 : if (value == NULL) {
8835 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
8836 0 : return -1;
8837 : }
8838 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
8839 0 : if (object->in.sid == NULL) {
8840 0 : PyErr_NoMemory();
8841 0 : return -1;
8842 : }
8843 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
8844 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8845 0 : PyErr_NoMemory();
8846 0 : return -1;
8847 : }
8848 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
8849 0 : return 0;
8850 : }
8851 :
8852 0 : static PyObject *py_wbint_LookupGroupMembers_in_get_type(PyObject *obj, void *closure)
8853 : {
8854 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(obj);
8855 0 : PyObject *py_type;
8856 0 : py_type = PyLong_FromLong((uint16_t)(object->in.type));
8857 0 : return py_type;
8858 : }
8859 :
8860 0 : static int py_wbint_LookupGroupMembers_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
8861 : {
8862 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(py_obj);
8863 0 : if (value == NULL) {
8864 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.type");
8865 0 : return -1;
8866 : }
8867 : {
8868 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
8869 0 : if (PyLong_Check(value)) {
8870 0 : unsigned long long test_var;
8871 0 : test_var = PyLong_AsUnsignedLongLong(value);
8872 0 : if (PyErr_Occurred() != NULL) {
8873 0 : return -1;
8874 : }
8875 0 : if (test_var > uint_max) {
8876 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8877 : PyLong_Type.tp_name, uint_max, test_var);
8878 0 : return -1;
8879 : }
8880 0 : object->in.type = test_var;
8881 : } else {
8882 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8883 : PyLong_Type.tp_name);
8884 0 : return -1;
8885 : }
8886 : }
8887 0 : return 0;
8888 : }
8889 :
8890 0 : static PyObject *py_wbint_LookupGroupMembers_out_get_members(PyObject *obj, void *closure)
8891 : {
8892 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(obj);
8893 0 : PyObject *py_members;
8894 0 : if (object->out.members == NULL) {
8895 0 : Py_RETURN_NONE;
8896 : }
8897 0 : py_members = pytalloc_reference_ex(&wbint_Principals_Type, object->out.members, object->out.members);
8898 0 : return py_members;
8899 : }
8900 :
8901 0 : static int py_wbint_LookupGroupMembers_out_set_members(PyObject *py_obj, PyObject *value, void *closure)
8902 : {
8903 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(py_obj);
8904 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.members));
8905 0 : if (value == NULL) {
8906 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.members");
8907 0 : return -1;
8908 : }
8909 0 : object->out.members = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.members);
8910 0 : if (object->out.members == NULL) {
8911 0 : PyErr_NoMemory();
8912 0 : return -1;
8913 : }
8914 0 : PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;);
8915 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8916 0 : PyErr_NoMemory();
8917 0 : return -1;
8918 : }
8919 0 : object->out.members = (struct wbint_Principals *)pytalloc_get_ptr(value);
8920 0 : return 0;
8921 : }
8922 :
8923 0 : static PyObject *py_wbint_LookupGroupMembers_get_result(PyObject *obj, void *closure)
8924 : {
8925 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(obj);
8926 0 : PyObject *py_result;
8927 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
8928 0 : return py_result;
8929 : }
8930 :
8931 0 : static int py_wbint_LookupGroupMembers_set_result(PyObject *py_obj, PyObject *value, void *closure)
8932 : {
8933 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(py_obj);
8934 0 : if (value == NULL) {
8935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
8936 0 : return -1;
8937 : }
8938 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
8939 0 : return 0;
8940 : }
8941 :
8942 : static PyGetSetDef py_wbint_LookupGroupMembers_getsetters[] = {
8943 : {
8944 : .name = discard_const_p(char, "in_sid"),
8945 : .get = py_wbint_LookupGroupMembers_in_get_sid,
8946 : .set = py_wbint_LookupGroupMembers_in_set_sid,
8947 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
8948 : },
8949 : {
8950 : .name = discard_const_p(char, "in_type"),
8951 : .get = py_wbint_LookupGroupMembers_in_get_type,
8952 : .set = py_wbint_LookupGroupMembers_in_set_type,
8953 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
8954 : },
8955 : {
8956 : .name = discard_const_p(char, "out_members"),
8957 : .get = py_wbint_LookupGroupMembers_out_get_members,
8958 : .set = py_wbint_LookupGroupMembers_out_set_members,
8959 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals")
8960 : },
8961 : {
8962 : .name = discard_const_p(char, "result"),
8963 : .get = py_wbint_LookupGroupMembers_get_result,
8964 : .set = py_wbint_LookupGroupMembers_set_result,
8965 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
8966 : },
8967 : { .name = NULL }
8968 : };
8969 :
8970 0 : static PyObject *py_wbint_LookupGroupMembers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8971 : {
8972 0 : PyObject *self = pytalloc_new(struct wbint_LookupGroupMembers, type);
8973 0 : struct wbint_LookupGroupMembers *_self = (struct wbint_LookupGroupMembers *)pytalloc_get_ptr(self);
8974 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
8975 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
8976 0 : _self->out.members = talloc_zero(mem_ctx, struct wbint_Principals);
8977 0 : return self;
8978 : }
8979 :
8980 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
8981 : {
8982 :
8983 :
8984 0 : return PyLong_FromLong(12);
8985 : }
8986 :
8987 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
8988 : {
8989 0 : const struct ndr_interface_call *call = NULL;
8990 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(py_obj);
8991 0 : PyObject *ret = NULL;
8992 0 : struct ndr_push *push = NULL;
8993 0 : DATA_BLOB blob;
8994 0 : enum ndr_err_code err;
8995 :
8996 0 : if (ndr_table_winbind.num_calls < 13) {
8997 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_pack");
8998 0 : return NULL;
8999 : }
9000 0 : call = &ndr_table_winbind.calls[12];
9001 :
9002 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
9003 0 : if (push == NULL) {
9004 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9005 0 : return NULL;
9006 : }
9007 :
9008 0 : push->flags |= ndr_push_flags;
9009 :
9010 0 : err = call->ndr_push(push, ndr_inout_flags, object);
9011 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9012 0 : TALLOC_FREE(push);
9013 0 : PyErr_SetNdrError(err);
9014 0 : return NULL;
9015 : }
9016 0 : blob = ndr_push_blob(push);
9017 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9018 0 : TALLOC_FREE(push);
9019 0 : return ret;
9020 : }
9021 :
9022 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9023 : {
9024 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9025 0 : PyObject *bigendian_obj = NULL;
9026 0 : PyObject *ndr64_obj = NULL;
9027 0 : libndr_flags ndr_push_flags = 0;
9028 :
9029 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
9030 : discard_const_p(char *, kwnames),
9031 : &bigendian_obj,
9032 : &ndr64_obj)) {
9033 0 : return NULL;
9034 : }
9035 :
9036 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9037 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9038 : }
9039 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9040 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9041 : }
9042 :
9043 0 : return py_wbint_LookupGroupMembers_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
9044 : }
9045 :
9046 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9047 : {
9048 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9049 0 : PyObject *bigendian_obj = NULL;
9050 0 : PyObject *ndr64_obj = NULL;
9051 0 : libndr_flags ndr_push_flags = 0;
9052 :
9053 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
9054 : discard_const_p(char *, kwnames),
9055 : &bigendian_obj,
9056 : &ndr64_obj)) {
9057 0 : return NULL;
9058 : }
9059 :
9060 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9061 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9062 : }
9063 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9064 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9065 : }
9066 :
9067 0 : return py_wbint_LookupGroupMembers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
9068 : }
9069 :
9070 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
9071 : {
9072 0 : const struct ndr_interface_call *call = NULL;
9073 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(py_obj);
9074 0 : struct ndr_pull *pull = NULL;
9075 0 : enum ndr_err_code err;
9076 :
9077 0 : if (ndr_table_winbind.num_calls < 13) {
9078 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_unpack");
9079 0 : return NULL;
9080 : }
9081 0 : call = &ndr_table_winbind.calls[12];
9082 :
9083 0 : pull = ndr_pull_init_blob(blob, object);
9084 0 : if (pull == NULL) {
9085 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9086 0 : return NULL;
9087 : }
9088 :
9089 0 : pull->flags |= ndr_pull_flags;
9090 :
9091 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
9092 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9093 0 : TALLOC_FREE(pull);
9094 0 : PyErr_SetNdrError(err);
9095 0 : return NULL;
9096 : }
9097 0 : if (!allow_remaining) {
9098 0 : uint32_t highest_ofs;
9099 :
9100 0 : if (pull->offset > pull->relative_highest_offset) {
9101 0 : highest_ofs = pull->offset;
9102 : } else {
9103 0 : highest_ofs = pull->relative_highest_offset;
9104 : }
9105 0 : if (highest_ofs < pull->data_size) {
9106 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
9107 : "not all bytes consumed ofs[%u] size[%u]",
9108 : highest_ofs, pull->data_size);
9109 0 : TALLOC_FREE(pull);
9110 0 : PyErr_SetNdrError(err);
9111 0 : return NULL;
9112 : }
9113 : }
9114 :
9115 0 : TALLOC_FREE(pull);
9116 0 : Py_RETURN_NONE;
9117 : }
9118 :
9119 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9120 : {
9121 0 : DATA_BLOB blob;
9122 0 : Py_ssize_t blob_length = 0;
9123 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9124 0 : PyObject *bigendian_obj = NULL;
9125 0 : PyObject *ndr64_obj = NULL;
9126 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9127 0 : PyObject *allow_remaining_obj = NULL;
9128 0 : bool allow_remaining = false;
9129 :
9130 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
9131 : discard_const_p(char *, kwnames),
9132 : &blob.data, &blob_length,
9133 : &bigendian_obj,
9134 : &ndr64_obj,
9135 : &allow_remaining_obj)) {
9136 0 : return NULL;
9137 : }
9138 0 : blob.length = blob_length;
9139 :
9140 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9141 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9142 : }
9143 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9144 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9145 : }
9146 :
9147 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9148 0 : allow_remaining = true;
9149 : }
9150 :
9151 0 : return py_wbint_LookupGroupMembers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
9152 : }
9153 :
9154 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9155 : {
9156 0 : DATA_BLOB blob;
9157 0 : Py_ssize_t blob_length = 0;
9158 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9159 0 : PyObject *bigendian_obj = NULL;
9160 0 : PyObject *ndr64_obj = NULL;
9161 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9162 0 : PyObject *allow_remaining_obj = NULL;
9163 0 : bool allow_remaining = false;
9164 :
9165 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
9166 : discard_const_p(char *, kwnames),
9167 : &blob.data, &blob_length,
9168 : &bigendian_obj,
9169 : &ndr64_obj,
9170 : &allow_remaining_obj)) {
9171 0 : return NULL;
9172 : }
9173 0 : blob.length = blob_length;
9174 :
9175 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9176 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9177 : }
9178 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9179 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9180 : }
9181 :
9182 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9183 0 : allow_remaining = true;
9184 : }
9185 :
9186 0 : return py_wbint_LookupGroupMembers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
9187 : }
9188 :
9189 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
9190 : {
9191 0 : const struct ndr_interface_call *call = NULL;
9192 0 : struct wbint_LookupGroupMembers *object = pytalloc_get_ptr(py_obj);
9193 0 : PyObject *ret;
9194 0 : char *retstr;
9195 :
9196 0 : if (ndr_table_winbind.num_calls < 13) {
9197 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupGroupMembers_ndr_print");
9198 0 : return NULL;
9199 : }
9200 0 : call = &ndr_table_winbind.calls[12];
9201 :
9202 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
9203 0 : ret = PyUnicode_FromString(retstr);
9204 0 : TALLOC_FREE(retstr);
9205 :
9206 0 : return ret;
9207 : }
9208 :
9209 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9210 : {
9211 0 : return py_wbint_LookupGroupMembers_ndr_print(py_obj, "wbint_LookupGroupMembers_in", NDR_IN);
9212 : }
9213 :
9214 0 : static PyObject *py_wbint_LookupGroupMembers_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9215 : {
9216 0 : return py_wbint_LookupGroupMembers_ndr_print(py_obj, "wbint_LookupGroupMembers_out", NDR_OUT);
9217 : }
9218 :
9219 : static PyMethodDef py_wbint_LookupGroupMembers_methods[] = {
9220 : { "opnum", (PyCFunction)py_wbint_LookupGroupMembers_ndr_opnum, METH_NOARGS|METH_CLASS,
9221 : "winbind.wbint_LookupGroupMembers.opnum() -> 12 (0x0c) " },
9222 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
9223 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
9224 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
9225 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
9226 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
9227 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
9228 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupGroupMembers_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
9229 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
9230 : { "__ndr_print_in__", (PyCFunction)py_wbint_LookupGroupMembers_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
9231 : { "__ndr_print_out__", (PyCFunction)py_wbint_LookupGroupMembers_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
9232 : { NULL, NULL, 0, NULL }
9233 : };
9234 :
9235 :
9236 : static PyTypeObject wbint_LookupGroupMembers_Type = {
9237 : PyVarObject_HEAD_INIT(NULL, 0)
9238 : .tp_name = "winbind.wbint_LookupGroupMembers",
9239 : .tp_getset = py_wbint_LookupGroupMembers_getsetters,
9240 : .tp_methods = py_wbint_LookupGroupMembers_methods,
9241 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9242 : .tp_new = py_wbint_LookupGroupMembers_new,
9243 : };
9244 :
9245 0 : static bool pack_py_wbint_LookupGroupMembers_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupGroupMembers *r)
9246 : {
9247 0 : PyObject *py_sid;
9248 0 : PyObject *py_type;
9249 0 : const char *kwnames[] = {
9250 : "sid", "type", NULL
9251 : };
9252 :
9253 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_LookupGroupMembers", discard_const_p(char *, kwnames), &py_sid, &py_type)) {
9254 0 : return false;
9255 : }
9256 :
9257 0 : if (py_sid == NULL) {
9258 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
9259 0 : return false;
9260 : }
9261 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
9262 0 : if (r->in.sid == NULL) {
9263 0 : PyErr_NoMemory();
9264 0 : return false;
9265 : }
9266 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
9267 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
9268 0 : PyErr_NoMemory();
9269 0 : return false;
9270 : }
9271 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
9272 0 : if (py_type == NULL) {
9273 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.type");
9274 0 : return false;
9275 : }
9276 : {
9277 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
9278 0 : if (PyLong_Check(py_type)) {
9279 0 : unsigned long long test_var;
9280 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
9281 0 : if (PyErr_Occurred() != NULL) {
9282 0 : return false;
9283 : }
9284 0 : if (test_var > uint_max) {
9285 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9286 : PyLong_Type.tp_name, uint_max, test_var);
9287 0 : return false;
9288 : }
9289 0 : r->in.type = test_var;
9290 : } else {
9291 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9292 : PyLong_Type.tp_name);
9293 0 : return false;
9294 : }
9295 : }
9296 0 : return true;
9297 : }
9298 :
9299 0 : static PyObject *unpack_py_wbint_LookupGroupMembers_args_out(struct wbint_LookupGroupMembers *r)
9300 : {
9301 0 : PyObject *result;
9302 0 : PyObject *py_members;
9303 0 : py_members = pytalloc_reference_ex(&wbint_Principals_Type, r->out.members, r->out.members);
9304 0 : result = py_members;
9305 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
9306 0 : PyErr_SetNTSTATUS(r->out.result);
9307 0 : return NULL;
9308 : }
9309 :
9310 0 : return result;
9311 : }
9312 :
9313 :
9314 0 : static PyObject *py_wbint_LookupAliasMembers_in_get_sid(PyObject *obj, void *closure)
9315 : {
9316 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(obj);
9317 0 : PyObject *py_sid;
9318 0 : if (object->in.sid == NULL) {
9319 0 : Py_RETURN_NONE;
9320 : }
9321 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
9322 0 : return py_sid;
9323 : }
9324 :
9325 0 : static int py_wbint_LookupAliasMembers_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
9326 : {
9327 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(py_obj);
9328 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
9329 0 : if (value == NULL) {
9330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
9331 0 : return -1;
9332 : }
9333 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
9334 0 : if (object->in.sid == NULL) {
9335 0 : PyErr_NoMemory();
9336 0 : return -1;
9337 : }
9338 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
9339 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9340 0 : PyErr_NoMemory();
9341 0 : return -1;
9342 : }
9343 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
9344 0 : return 0;
9345 : }
9346 :
9347 0 : static PyObject *py_wbint_LookupAliasMembers_in_get_type(PyObject *obj, void *closure)
9348 : {
9349 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(obj);
9350 0 : PyObject *py_type;
9351 0 : py_type = PyLong_FromLong((uint16_t)(object->in.type));
9352 0 : return py_type;
9353 : }
9354 :
9355 0 : static int py_wbint_LookupAliasMembers_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
9356 : {
9357 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(py_obj);
9358 0 : if (value == NULL) {
9359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.type");
9360 0 : return -1;
9361 : }
9362 : {
9363 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
9364 0 : if (PyLong_Check(value)) {
9365 0 : unsigned long long test_var;
9366 0 : test_var = PyLong_AsUnsignedLongLong(value);
9367 0 : if (PyErr_Occurred() != NULL) {
9368 0 : return -1;
9369 : }
9370 0 : if (test_var > uint_max) {
9371 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9372 : PyLong_Type.tp_name, uint_max, test_var);
9373 0 : return -1;
9374 : }
9375 0 : object->in.type = test_var;
9376 : } else {
9377 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9378 : PyLong_Type.tp_name);
9379 0 : return -1;
9380 : }
9381 : }
9382 0 : return 0;
9383 : }
9384 :
9385 0 : static PyObject *py_wbint_LookupAliasMembers_out_get_sids(PyObject *obj, void *closure)
9386 : {
9387 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(obj);
9388 0 : PyObject *py_sids;
9389 0 : if (object->out.sids == NULL) {
9390 0 : Py_RETURN_NONE;
9391 : }
9392 0 : py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, object->out.sids, object->out.sids);
9393 0 : return py_sids;
9394 : }
9395 :
9396 0 : static int py_wbint_LookupAliasMembers_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
9397 : {
9398 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(py_obj);
9399 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
9400 0 : if (value == NULL) {
9401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
9402 0 : return -1;
9403 : }
9404 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
9405 0 : if (object->out.sids == NULL) {
9406 0 : PyErr_NoMemory();
9407 0 : return -1;
9408 : }
9409 0 : PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
9410 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9411 0 : PyErr_NoMemory();
9412 0 : return -1;
9413 : }
9414 0 : object->out.sids = (struct wbint_SidArray *)pytalloc_get_ptr(value);
9415 0 : return 0;
9416 : }
9417 :
9418 0 : static PyObject *py_wbint_LookupAliasMembers_get_result(PyObject *obj, void *closure)
9419 : {
9420 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(obj);
9421 0 : PyObject *py_result;
9422 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
9423 0 : return py_result;
9424 : }
9425 :
9426 0 : static int py_wbint_LookupAliasMembers_set_result(PyObject *py_obj, PyObject *value, void *closure)
9427 : {
9428 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(py_obj);
9429 0 : if (value == NULL) {
9430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
9431 0 : return -1;
9432 : }
9433 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
9434 0 : return 0;
9435 : }
9436 :
9437 : static PyGetSetDef py_wbint_LookupAliasMembers_getsetters[] = {
9438 : {
9439 : .name = discard_const_p(char, "in_sid"),
9440 : .get = py_wbint_LookupAliasMembers_in_get_sid,
9441 : .set = py_wbint_LookupAliasMembers_in_set_sid,
9442 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
9443 : },
9444 : {
9445 : .name = discard_const_p(char, "in_type"),
9446 : .get = py_wbint_LookupAliasMembers_in_get_type,
9447 : .set = py_wbint_LookupAliasMembers_in_set_type,
9448 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
9449 : },
9450 : {
9451 : .name = discard_const_p(char, "out_sids"),
9452 : .get = py_wbint_LookupAliasMembers_out_get_sids,
9453 : .set = py_wbint_LookupAliasMembers_out_set_sids,
9454 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
9455 : },
9456 : {
9457 : .name = discard_const_p(char, "result"),
9458 : .get = py_wbint_LookupAliasMembers_get_result,
9459 : .set = py_wbint_LookupAliasMembers_set_result,
9460 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
9461 : },
9462 : { .name = NULL }
9463 : };
9464 :
9465 0 : static PyObject *py_wbint_LookupAliasMembers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9466 : {
9467 0 : PyObject *self = pytalloc_new(struct wbint_LookupAliasMembers, type);
9468 0 : struct wbint_LookupAliasMembers *_self = (struct wbint_LookupAliasMembers *)pytalloc_get_ptr(self);
9469 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
9470 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid);
9471 0 : _self->out.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
9472 0 : return self;
9473 : }
9474 :
9475 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
9476 : {
9477 :
9478 :
9479 0 : return PyLong_FromLong(13);
9480 : }
9481 :
9482 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
9483 : {
9484 0 : const struct ndr_interface_call *call = NULL;
9485 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(py_obj);
9486 0 : PyObject *ret = NULL;
9487 0 : struct ndr_push *push = NULL;
9488 0 : DATA_BLOB blob;
9489 0 : enum ndr_err_code err;
9490 :
9491 0 : if (ndr_table_winbind.num_calls < 14) {
9492 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupAliasMembers_ndr_pack");
9493 0 : return NULL;
9494 : }
9495 0 : call = &ndr_table_winbind.calls[13];
9496 :
9497 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
9498 0 : if (push == NULL) {
9499 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9500 0 : return NULL;
9501 : }
9502 :
9503 0 : push->flags |= ndr_push_flags;
9504 :
9505 0 : err = call->ndr_push(push, ndr_inout_flags, object);
9506 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9507 0 : TALLOC_FREE(push);
9508 0 : PyErr_SetNdrError(err);
9509 0 : return NULL;
9510 : }
9511 0 : blob = ndr_push_blob(push);
9512 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9513 0 : TALLOC_FREE(push);
9514 0 : return ret;
9515 : }
9516 :
9517 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9518 : {
9519 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9520 0 : PyObject *bigendian_obj = NULL;
9521 0 : PyObject *ndr64_obj = NULL;
9522 0 : libndr_flags ndr_push_flags = 0;
9523 :
9524 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
9525 : discard_const_p(char *, kwnames),
9526 : &bigendian_obj,
9527 : &ndr64_obj)) {
9528 0 : return NULL;
9529 : }
9530 :
9531 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9532 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9533 : }
9534 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9535 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9536 : }
9537 :
9538 0 : return py_wbint_LookupAliasMembers_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
9539 : }
9540 :
9541 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9542 : {
9543 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9544 0 : PyObject *bigendian_obj = NULL;
9545 0 : PyObject *ndr64_obj = NULL;
9546 0 : libndr_flags ndr_push_flags = 0;
9547 :
9548 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
9549 : discard_const_p(char *, kwnames),
9550 : &bigendian_obj,
9551 : &ndr64_obj)) {
9552 0 : return NULL;
9553 : }
9554 :
9555 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9556 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9557 : }
9558 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9559 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9560 : }
9561 :
9562 0 : return py_wbint_LookupAliasMembers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
9563 : }
9564 :
9565 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
9566 : {
9567 0 : const struct ndr_interface_call *call = NULL;
9568 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(py_obj);
9569 0 : struct ndr_pull *pull = NULL;
9570 0 : enum ndr_err_code err;
9571 :
9572 0 : if (ndr_table_winbind.num_calls < 14) {
9573 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupAliasMembers_ndr_unpack");
9574 0 : return NULL;
9575 : }
9576 0 : call = &ndr_table_winbind.calls[13];
9577 :
9578 0 : pull = ndr_pull_init_blob(blob, object);
9579 0 : if (pull == NULL) {
9580 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9581 0 : return NULL;
9582 : }
9583 :
9584 0 : pull->flags |= ndr_pull_flags;
9585 :
9586 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
9587 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9588 0 : TALLOC_FREE(pull);
9589 0 : PyErr_SetNdrError(err);
9590 0 : return NULL;
9591 : }
9592 0 : if (!allow_remaining) {
9593 0 : uint32_t highest_ofs;
9594 :
9595 0 : if (pull->offset > pull->relative_highest_offset) {
9596 0 : highest_ofs = pull->offset;
9597 : } else {
9598 0 : highest_ofs = pull->relative_highest_offset;
9599 : }
9600 0 : if (highest_ofs < pull->data_size) {
9601 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
9602 : "not all bytes consumed ofs[%u] size[%u]",
9603 : highest_ofs, pull->data_size);
9604 0 : TALLOC_FREE(pull);
9605 0 : PyErr_SetNdrError(err);
9606 0 : return NULL;
9607 : }
9608 : }
9609 :
9610 0 : TALLOC_FREE(pull);
9611 0 : Py_RETURN_NONE;
9612 : }
9613 :
9614 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9615 : {
9616 0 : DATA_BLOB blob;
9617 0 : Py_ssize_t blob_length = 0;
9618 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9619 0 : PyObject *bigendian_obj = NULL;
9620 0 : PyObject *ndr64_obj = NULL;
9621 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9622 0 : PyObject *allow_remaining_obj = NULL;
9623 0 : bool allow_remaining = false;
9624 :
9625 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
9626 : discard_const_p(char *, kwnames),
9627 : &blob.data, &blob_length,
9628 : &bigendian_obj,
9629 : &ndr64_obj,
9630 : &allow_remaining_obj)) {
9631 0 : return NULL;
9632 : }
9633 0 : blob.length = blob_length;
9634 :
9635 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9636 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9637 : }
9638 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9639 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9640 : }
9641 :
9642 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9643 0 : allow_remaining = true;
9644 : }
9645 :
9646 0 : return py_wbint_LookupAliasMembers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
9647 : }
9648 :
9649 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9650 : {
9651 0 : DATA_BLOB blob;
9652 0 : Py_ssize_t blob_length = 0;
9653 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
9654 0 : PyObject *bigendian_obj = NULL;
9655 0 : PyObject *ndr64_obj = NULL;
9656 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
9657 0 : PyObject *allow_remaining_obj = NULL;
9658 0 : bool allow_remaining = false;
9659 :
9660 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
9661 : discard_const_p(char *, kwnames),
9662 : &blob.data, &blob_length,
9663 : &bigendian_obj,
9664 : &ndr64_obj,
9665 : &allow_remaining_obj)) {
9666 0 : return NULL;
9667 : }
9668 0 : blob.length = blob_length;
9669 :
9670 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9671 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
9672 : }
9673 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9674 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
9675 : }
9676 :
9677 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9678 0 : allow_remaining = true;
9679 : }
9680 :
9681 0 : return py_wbint_LookupAliasMembers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
9682 : }
9683 :
9684 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
9685 : {
9686 0 : const struct ndr_interface_call *call = NULL;
9687 0 : struct wbint_LookupAliasMembers *object = pytalloc_get_ptr(py_obj);
9688 0 : PyObject *ret;
9689 0 : char *retstr;
9690 :
9691 0 : if (ndr_table_winbind.num_calls < 14) {
9692 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupAliasMembers_ndr_print");
9693 0 : return NULL;
9694 : }
9695 0 : call = &ndr_table_winbind.calls[13];
9696 :
9697 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
9698 0 : ret = PyUnicode_FromString(retstr);
9699 0 : TALLOC_FREE(retstr);
9700 :
9701 0 : return ret;
9702 : }
9703 :
9704 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9705 : {
9706 0 : return py_wbint_LookupAliasMembers_ndr_print(py_obj, "wbint_LookupAliasMembers_in", NDR_IN);
9707 : }
9708 :
9709 0 : static PyObject *py_wbint_LookupAliasMembers_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9710 : {
9711 0 : return py_wbint_LookupAliasMembers_ndr_print(py_obj, "wbint_LookupAliasMembers_out", NDR_OUT);
9712 : }
9713 :
9714 : static PyMethodDef py_wbint_LookupAliasMembers_methods[] = {
9715 : { "opnum", (PyCFunction)py_wbint_LookupAliasMembers_ndr_opnum, METH_NOARGS|METH_CLASS,
9716 : "winbind.wbint_LookupAliasMembers.opnum() -> 13 (0x0d) " },
9717 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupAliasMembers_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
9718 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
9719 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupAliasMembers_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
9720 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
9721 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupAliasMembers_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
9722 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
9723 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupAliasMembers_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
9724 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
9725 : { "__ndr_print_in__", (PyCFunction)py_wbint_LookupAliasMembers_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
9726 : { "__ndr_print_out__", (PyCFunction)py_wbint_LookupAliasMembers_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
9727 : { NULL, NULL, 0, NULL }
9728 : };
9729 :
9730 :
9731 : static PyTypeObject wbint_LookupAliasMembers_Type = {
9732 : PyVarObject_HEAD_INIT(NULL, 0)
9733 : .tp_name = "winbind.wbint_LookupAliasMembers",
9734 : .tp_getset = py_wbint_LookupAliasMembers_getsetters,
9735 : .tp_methods = py_wbint_LookupAliasMembers_methods,
9736 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9737 : .tp_new = py_wbint_LookupAliasMembers_new,
9738 : };
9739 :
9740 0 : static bool pack_py_wbint_LookupAliasMembers_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupAliasMembers *r)
9741 : {
9742 0 : PyObject *py_sid;
9743 0 : PyObject *py_type;
9744 0 : const char *kwnames[] = {
9745 : "sid", "type", NULL
9746 : };
9747 :
9748 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_LookupAliasMembers", discard_const_p(char *, kwnames), &py_sid, &py_type)) {
9749 0 : return false;
9750 : }
9751 :
9752 0 : if (py_sid == NULL) {
9753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
9754 0 : return false;
9755 : }
9756 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
9757 0 : if (r->in.sid == NULL) {
9758 0 : PyErr_NoMemory();
9759 0 : return false;
9760 : }
9761 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
9762 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
9763 0 : PyErr_NoMemory();
9764 0 : return false;
9765 : }
9766 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
9767 0 : if (py_type == NULL) {
9768 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.type");
9769 0 : return false;
9770 : }
9771 : {
9772 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
9773 0 : if (PyLong_Check(py_type)) {
9774 0 : unsigned long long test_var;
9775 0 : test_var = PyLong_AsUnsignedLongLong(py_type);
9776 0 : if (PyErr_Occurred() != NULL) {
9777 0 : return false;
9778 : }
9779 0 : if (test_var > uint_max) {
9780 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9781 : PyLong_Type.tp_name, uint_max, test_var);
9782 0 : return false;
9783 : }
9784 0 : r->in.type = test_var;
9785 : } else {
9786 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9787 : PyLong_Type.tp_name);
9788 0 : return false;
9789 : }
9790 : }
9791 0 : return true;
9792 : }
9793 :
9794 0 : static PyObject *unpack_py_wbint_LookupAliasMembers_args_out(struct wbint_LookupAliasMembers *r)
9795 : {
9796 0 : PyObject *result;
9797 0 : PyObject *py_sids;
9798 0 : py_sids = pytalloc_reference_ex(&wbint_SidArray_Type, r->out.sids, r->out.sids);
9799 0 : result = py_sids;
9800 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
9801 0 : PyErr_SetNTSTATUS(r->out.result);
9802 0 : return NULL;
9803 : }
9804 :
9805 0 : return result;
9806 : }
9807 :
9808 :
9809 0 : static PyObject *py_wbint_QueryGroupList_out_get_groups(PyObject *obj, void *closure)
9810 : {
9811 0 : struct wbint_QueryGroupList *object = pytalloc_get_ptr(obj);
9812 0 : PyObject *py_groups;
9813 0 : if (object->out.groups == NULL) {
9814 0 : Py_RETURN_NONE;
9815 : }
9816 0 : py_groups = pytalloc_reference_ex(&wbint_Principals_Type, object->out.groups, object->out.groups);
9817 0 : return py_groups;
9818 : }
9819 :
9820 0 : static int py_wbint_QueryGroupList_out_set_groups(PyObject *py_obj, PyObject *value, void *closure)
9821 : {
9822 0 : struct wbint_QueryGroupList *object = pytalloc_get_ptr(py_obj);
9823 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.groups));
9824 0 : if (value == NULL) {
9825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.groups");
9826 0 : return -1;
9827 : }
9828 0 : object->out.groups = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.groups);
9829 0 : if (object->out.groups == NULL) {
9830 0 : PyErr_NoMemory();
9831 0 : return -1;
9832 : }
9833 0 : PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;);
9834 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9835 0 : PyErr_NoMemory();
9836 0 : return -1;
9837 : }
9838 0 : object->out.groups = (struct wbint_Principals *)pytalloc_get_ptr(value);
9839 0 : return 0;
9840 : }
9841 :
9842 0 : static PyObject *py_wbint_QueryGroupList_get_result(PyObject *obj, void *closure)
9843 : {
9844 0 : struct wbint_QueryGroupList *object = pytalloc_get_ptr(obj);
9845 0 : PyObject *py_result;
9846 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
9847 0 : return py_result;
9848 : }
9849 :
9850 0 : static int py_wbint_QueryGroupList_set_result(PyObject *py_obj, PyObject *value, void *closure)
9851 : {
9852 0 : struct wbint_QueryGroupList *object = pytalloc_get_ptr(py_obj);
9853 0 : if (value == NULL) {
9854 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
9855 0 : return -1;
9856 : }
9857 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
9858 0 : return 0;
9859 : }
9860 :
9861 : static PyGetSetDef py_wbint_QueryGroupList_getsetters[] = {
9862 : {
9863 : .name = discard_const_p(char, "out_groups"),
9864 : .get = py_wbint_QueryGroupList_out_get_groups,
9865 : .set = py_wbint_QueryGroupList_out_set_groups,
9866 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals")
9867 : },
9868 : {
9869 : .name = discard_const_p(char, "result"),
9870 : .get = py_wbint_QueryGroupList_get_result,
9871 : .set = py_wbint_QueryGroupList_set_result,
9872 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
9873 : },
9874 : { .name = NULL }
9875 : };
9876 :
9877 0 : static PyObject *py_wbint_QueryGroupList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9878 : {
9879 0 : PyObject *self = pytalloc_new(struct wbint_QueryGroupList, type);
9880 0 : struct wbint_QueryGroupList *_self = (struct wbint_QueryGroupList *)pytalloc_get_ptr(self);
9881 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
9882 0 : _self->out.groups = talloc_zero(mem_ctx, struct wbint_Principals);
9883 0 : return self;
9884 : }
9885 :
9886 0 : static PyObject *py_wbint_QueryGroupList_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
9887 : {
9888 :
9889 :
9890 0 : return PyLong_FromLong(14);
9891 : }
9892 :
9893 0 : static PyObject *py_wbint_QueryGroupList_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
9894 : {
9895 0 : const struct ndr_interface_call *call = NULL;
9896 0 : struct wbint_QueryGroupList *object = pytalloc_get_ptr(py_obj);
9897 0 : PyObject *ret = NULL;
9898 0 : struct ndr_push *push = NULL;
9899 0 : DATA_BLOB blob;
9900 0 : enum ndr_err_code err;
9901 :
9902 0 : if (ndr_table_winbind.num_calls < 15) {
9903 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_pack");
9904 0 : return NULL;
9905 : }
9906 0 : call = &ndr_table_winbind.calls[14];
9907 :
9908 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
9909 0 : if (push == NULL) {
9910 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9911 0 : return NULL;
9912 : }
9913 :
9914 0 : push->flags |= ndr_push_flags;
9915 :
9916 0 : err = call->ndr_push(push, ndr_inout_flags, object);
9917 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9918 0 : TALLOC_FREE(push);
9919 0 : PyErr_SetNdrError(err);
9920 0 : return NULL;
9921 : }
9922 0 : blob = ndr_push_blob(push);
9923 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9924 0 : TALLOC_FREE(push);
9925 0 : return ret;
9926 : }
9927 :
9928 0 : static PyObject *py_wbint_QueryGroupList_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9929 : {
9930 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9931 0 : PyObject *bigendian_obj = NULL;
9932 0 : PyObject *ndr64_obj = NULL;
9933 0 : libndr_flags ndr_push_flags = 0;
9934 :
9935 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
9936 : discard_const_p(char *, kwnames),
9937 : &bigendian_obj,
9938 : &ndr64_obj)) {
9939 0 : return NULL;
9940 : }
9941 :
9942 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9943 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9944 : }
9945 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9946 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9947 : }
9948 :
9949 0 : return py_wbint_QueryGroupList_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
9950 : }
9951 :
9952 0 : static PyObject *py_wbint_QueryGroupList_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9953 : {
9954 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
9955 0 : PyObject *bigendian_obj = NULL;
9956 0 : PyObject *ndr64_obj = NULL;
9957 0 : libndr_flags ndr_push_flags = 0;
9958 :
9959 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
9960 : discard_const_p(char *, kwnames),
9961 : &bigendian_obj,
9962 : &ndr64_obj)) {
9963 0 : return NULL;
9964 : }
9965 :
9966 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
9967 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
9968 : }
9969 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
9970 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
9971 : }
9972 :
9973 0 : return py_wbint_QueryGroupList_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
9974 : }
9975 :
9976 0 : static PyObject *py_wbint_QueryGroupList_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
9977 : {
9978 0 : const struct ndr_interface_call *call = NULL;
9979 0 : struct wbint_QueryGroupList *object = pytalloc_get_ptr(py_obj);
9980 0 : struct ndr_pull *pull = NULL;
9981 0 : enum ndr_err_code err;
9982 :
9983 0 : if (ndr_table_winbind.num_calls < 15) {
9984 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_unpack");
9985 0 : return NULL;
9986 : }
9987 0 : call = &ndr_table_winbind.calls[14];
9988 :
9989 0 : pull = ndr_pull_init_blob(blob, object);
9990 0 : if (pull == NULL) {
9991 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9992 0 : return NULL;
9993 : }
9994 :
9995 0 : pull->flags |= ndr_pull_flags;
9996 :
9997 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
9998 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9999 0 : TALLOC_FREE(pull);
10000 0 : PyErr_SetNdrError(err);
10001 0 : return NULL;
10002 : }
10003 0 : if (!allow_remaining) {
10004 0 : uint32_t highest_ofs;
10005 :
10006 0 : if (pull->offset > pull->relative_highest_offset) {
10007 0 : highest_ofs = pull->offset;
10008 : } else {
10009 0 : highest_ofs = pull->relative_highest_offset;
10010 : }
10011 0 : if (highest_ofs < pull->data_size) {
10012 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
10013 : "not all bytes consumed ofs[%u] size[%u]",
10014 : highest_ofs, pull->data_size);
10015 0 : TALLOC_FREE(pull);
10016 0 : PyErr_SetNdrError(err);
10017 0 : return NULL;
10018 : }
10019 : }
10020 :
10021 0 : TALLOC_FREE(pull);
10022 0 : Py_RETURN_NONE;
10023 : }
10024 :
10025 0 : static PyObject *py_wbint_QueryGroupList_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10026 : {
10027 0 : DATA_BLOB blob;
10028 0 : Py_ssize_t blob_length = 0;
10029 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10030 0 : PyObject *bigendian_obj = NULL;
10031 0 : PyObject *ndr64_obj = NULL;
10032 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10033 0 : PyObject *allow_remaining_obj = NULL;
10034 0 : bool allow_remaining = false;
10035 :
10036 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
10037 : discard_const_p(char *, kwnames),
10038 : &blob.data, &blob_length,
10039 : &bigendian_obj,
10040 : &ndr64_obj,
10041 : &allow_remaining_obj)) {
10042 0 : return NULL;
10043 : }
10044 0 : blob.length = blob_length;
10045 :
10046 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10047 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10048 : }
10049 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10050 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10051 : }
10052 :
10053 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10054 0 : allow_remaining = true;
10055 : }
10056 :
10057 0 : return py_wbint_QueryGroupList_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
10058 : }
10059 :
10060 0 : static PyObject *py_wbint_QueryGroupList_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10061 : {
10062 0 : DATA_BLOB blob;
10063 0 : Py_ssize_t blob_length = 0;
10064 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10065 0 : PyObject *bigendian_obj = NULL;
10066 0 : PyObject *ndr64_obj = NULL;
10067 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10068 0 : PyObject *allow_remaining_obj = NULL;
10069 0 : bool allow_remaining = false;
10070 :
10071 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
10072 : discard_const_p(char *, kwnames),
10073 : &blob.data, &blob_length,
10074 : &bigendian_obj,
10075 : &ndr64_obj,
10076 : &allow_remaining_obj)) {
10077 0 : return NULL;
10078 : }
10079 0 : blob.length = blob_length;
10080 :
10081 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10082 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10083 : }
10084 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10085 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10086 : }
10087 :
10088 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10089 0 : allow_remaining = true;
10090 : }
10091 :
10092 0 : return py_wbint_QueryGroupList_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
10093 : }
10094 :
10095 0 : static PyObject *py_wbint_QueryGroupList_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
10096 : {
10097 0 : const struct ndr_interface_call *call = NULL;
10098 0 : struct wbint_QueryGroupList *object = pytalloc_get_ptr(py_obj);
10099 0 : PyObject *ret;
10100 0 : char *retstr;
10101 :
10102 0 : if (ndr_table_winbind.num_calls < 15) {
10103 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryGroupList_ndr_print");
10104 0 : return NULL;
10105 : }
10106 0 : call = &ndr_table_winbind.calls[14];
10107 :
10108 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
10109 0 : ret = PyUnicode_FromString(retstr);
10110 0 : TALLOC_FREE(retstr);
10111 :
10112 0 : return ret;
10113 : }
10114 :
10115 0 : static PyObject *py_wbint_QueryGroupList_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10116 : {
10117 0 : return py_wbint_QueryGroupList_ndr_print(py_obj, "wbint_QueryGroupList_in", NDR_IN);
10118 : }
10119 :
10120 0 : static PyObject *py_wbint_QueryGroupList_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10121 : {
10122 0 : return py_wbint_QueryGroupList_ndr_print(py_obj, "wbint_QueryGroupList_out", NDR_OUT);
10123 : }
10124 :
10125 : static PyMethodDef py_wbint_QueryGroupList_methods[] = {
10126 : { "opnum", (PyCFunction)py_wbint_QueryGroupList_ndr_opnum, METH_NOARGS|METH_CLASS,
10127 : "winbind.wbint_QueryGroupList.opnum() -> 14 (0x0e) " },
10128 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
10129 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
10130 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
10131 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
10132 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
10133 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
10134 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryGroupList_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
10135 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
10136 : { "__ndr_print_in__", (PyCFunction)py_wbint_QueryGroupList_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
10137 : { "__ndr_print_out__", (PyCFunction)py_wbint_QueryGroupList_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
10138 : { NULL, NULL, 0, NULL }
10139 : };
10140 :
10141 :
10142 : static PyTypeObject wbint_QueryGroupList_Type = {
10143 : PyVarObject_HEAD_INIT(NULL, 0)
10144 : .tp_name = "winbind.wbint_QueryGroupList",
10145 : .tp_getset = py_wbint_QueryGroupList_getsetters,
10146 : .tp_methods = py_wbint_QueryGroupList_methods,
10147 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10148 : .tp_new = py_wbint_QueryGroupList_new,
10149 : };
10150 :
10151 0 : static bool pack_py_wbint_QueryGroupList_args_in(PyObject *args, PyObject *kwargs, struct wbint_QueryGroupList *r)
10152 : {
10153 0 : const char *kwnames[] = {
10154 : NULL
10155 : };
10156 :
10157 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QueryGroupList", discard_const_p(char *, kwnames))) {
10158 0 : return false;
10159 : }
10160 :
10161 0 : return true;
10162 : }
10163 :
10164 0 : static PyObject *unpack_py_wbint_QueryGroupList_args_out(struct wbint_QueryGroupList *r)
10165 : {
10166 0 : PyObject *result;
10167 0 : PyObject *py_groups;
10168 0 : py_groups = pytalloc_reference_ex(&wbint_Principals_Type, r->out.groups, r->out.groups);
10169 0 : result = py_groups;
10170 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
10171 0 : PyErr_SetNTSTATUS(r->out.result);
10172 0 : return NULL;
10173 : }
10174 :
10175 0 : return result;
10176 : }
10177 :
10178 :
10179 0 : static PyObject *py_wbint_QueryUserRidList_out_get_rids(PyObject *obj, void *closure)
10180 : {
10181 0 : struct wbint_QueryUserRidList *object = pytalloc_get_ptr(obj);
10182 0 : PyObject *py_rids;
10183 0 : if (object->out.rids == NULL) {
10184 0 : Py_RETURN_NONE;
10185 : }
10186 0 : py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->out.rids, object->out.rids);
10187 0 : return py_rids;
10188 : }
10189 :
10190 0 : static int py_wbint_QueryUserRidList_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
10191 : {
10192 0 : struct wbint_QueryUserRidList *object = pytalloc_get_ptr(py_obj);
10193 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
10194 0 : if (value == NULL) {
10195 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.rids");
10196 0 : return -1;
10197 : }
10198 0 : object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
10199 0 : if (object->out.rids == NULL) {
10200 0 : PyErr_NoMemory();
10201 0 : return -1;
10202 : }
10203 0 : PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;);
10204 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10205 0 : PyErr_NoMemory();
10206 0 : return -1;
10207 : }
10208 0 : object->out.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value);
10209 0 : return 0;
10210 : }
10211 :
10212 0 : static PyObject *py_wbint_QueryUserRidList_get_result(PyObject *obj, void *closure)
10213 : {
10214 0 : struct wbint_QueryUserRidList *object = pytalloc_get_ptr(obj);
10215 0 : PyObject *py_result;
10216 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
10217 0 : return py_result;
10218 : }
10219 :
10220 0 : static int py_wbint_QueryUserRidList_set_result(PyObject *py_obj, PyObject *value, void *closure)
10221 : {
10222 0 : struct wbint_QueryUserRidList *object = pytalloc_get_ptr(py_obj);
10223 0 : if (value == NULL) {
10224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
10225 0 : return -1;
10226 : }
10227 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
10228 0 : return 0;
10229 : }
10230 :
10231 : static PyGetSetDef py_wbint_QueryUserRidList_getsetters[] = {
10232 : {
10233 : .name = discard_const_p(char, "out_rids"),
10234 : .get = py_wbint_QueryUserRidList_out_get_rids,
10235 : .set = py_wbint_QueryUserRidList_out_set_rids,
10236 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray")
10237 : },
10238 : {
10239 : .name = discard_const_p(char, "result"),
10240 : .get = py_wbint_QueryUserRidList_get_result,
10241 : .set = py_wbint_QueryUserRidList_set_result,
10242 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
10243 : },
10244 : { .name = NULL }
10245 : };
10246 :
10247 0 : static PyObject *py_wbint_QueryUserRidList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10248 : {
10249 0 : PyObject *self = pytalloc_new(struct wbint_QueryUserRidList, type);
10250 0 : struct wbint_QueryUserRidList *_self = (struct wbint_QueryUserRidList *)pytalloc_get_ptr(self);
10251 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
10252 0 : _self->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
10253 0 : return self;
10254 : }
10255 :
10256 0 : static PyObject *py_wbint_QueryUserRidList_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
10257 : {
10258 :
10259 :
10260 0 : return PyLong_FromLong(15);
10261 : }
10262 :
10263 0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
10264 : {
10265 0 : const struct ndr_interface_call *call = NULL;
10266 0 : struct wbint_QueryUserRidList *object = pytalloc_get_ptr(py_obj);
10267 0 : PyObject *ret = NULL;
10268 0 : struct ndr_push *push = NULL;
10269 0 : DATA_BLOB blob;
10270 0 : enum ndr_err_code err;
10271 :
10272 0 : if (ndr_table_winbind.num_calls < 16) {
10273 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_pack");
10274 0 : return NULL;
10275 : }
10276 0 : call = &ndr_table_winbind.calls[15];
10277 :
10278 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
10279 0 : if (push == NULL) {
10280 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10281 0 : return NULL;
10282 : }
10283 :
10284 0 : push->flags |= ndr_push_flags;
10285 :
10286 0 : err = call->ndr_push(push, ndr_inout_flags, object);
10287 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10288 0 : TALLOC_FREE(push);
10289 0 : PyErr_SetNdrError(err);
10290 0 : return NULL;
10291 : }
10292 0 : blob = ndr_push_blob(push);
10293 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10294 0 : TALLOC_FREE(push);
10295 0 : return ret;
10296 : }
10297 :
10298 0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10299 : {
10300 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10301 0 : PyObject *bigendian_obj = NULL;
10302 0 : PyObject *ndr64_obj = NULL;
10303 0 : libndr_flags ndr_push_flags = 0;
10304 :
10305 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
10306 : discard_const_p(char *, kwnames),
10307 : &bigendian_obj,
10308 : &ndr64_obj)) {
10309 0 : return NULL;
10310 : }
10311 :
10312 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10313 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10314 : }
10315 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10316 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10317 : }
10318 :
10319 0 : return py_wbint_QueryUserRidList_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
10320 : }
10321 :
10322 0 : static PyObject *py_wbint_QueryUserRidList_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10323 : {
10324 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10325 0 : PyObject *bigendian_obj = NULL;
10326 0 : PyObject *ndr64_obj = NULL;
10327 0 : libndr_flags ndr_push_flags = 0;
10328 :
10329 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
10330 : discard_const_p(char *, kwnames),
10331 : &bigendian_obj,
10332 : &ndr64_obj)) {
10333 0 : return NULL;
10334 : }
10335 :
10336 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10337 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10338 : }
10339 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10340 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10341 : }
10342 :
10343 0 : return py_wbint_QueryUserRidList_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
10344 : }
10345 :
10346 0 : static PyObject *py_wbint_QueryUserRidList_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
10347 : {
10348 0 : const struct ndr_interface_call *call = NULL;
10349 0 : struct wbint_QueryUserRidList *object = pytalloc_get_ptr(py_obj);
10350 0 : struct ndr_pull *pull = NULL;
10351 0 : enum ndr_err_code err;
10352 :
10353 0 : if (ndr_table_winbind.num_calls < 16) {
10354 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_unpack");
10355 0 : return NULL;
10356 : }
10357 0 : call = &ndr_table_winbind.calls[15];
10358 :
10359 0 : pull = ndr_pull_init_blob(blob, object);
10360 0 : if (pull == NULL) {
10361 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10362 0 : return NULL;
10363 : }
10364 :
10365 0 : pull->flags |= ndr_pull_flags;
10366 :
10367 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
10368 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10369 0 : TALLOC_FREE(pull);
10370 0 : PyErr_SetNdrError(err);
10371 0 : return NULL;
10372 : }
10373 0 : if (!allow_remaining) {
10374 0 : uint32_t highest_ofs;
10375 :
10376 0 : if (pull->offset > pull->relative_highest_offset) {
10377 0 : highest_ofs = pull->offset;
10378 : } else {
10379 0 : highest_ofs = pull->relative_highest_offset;
10380 : }
10381 0 : if (highest_ofs < pull->data_size) {
10382 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
10383 : "not all bytes consumed ofs[%u] size[%u]",
10384 : highest_ofs, pull->data_size);
10385 0 : TALLOC_FREE(pull);
10386 0 : PyErr_SetNdrError(err);
10387 0 : return NULL;
10388 : }
10389 : }
10390 :
10391 0 : TALLOC_FREE(pull);
10392 0 : Py_RETURN_NONE;
10393 : }
10394 :
10395 0 : static PyObject *py_wbint_QueryUserRidList_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10396 : {
10397 0 : DATA_BLOB blob;
10398 0 : Py_ssize_t blob_length = 0;
10399 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10400 0 : PyObject *bigendian_obj = NULL;
10401 0 : PyObject *ndr64_obj = NULL;
10402 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10403 0 : PyObject *allow_remaining_obj = NULL;
10404 0 : bool allow_remaining = false;
10405 :
10406 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
10407 : discard_const_p(char *, kwnames),
10408 : &blob.data, &blob_length,
10409 : &bigendian_obj,
10410 : &ndr64_obj,
10411 : &allow_remaining_obj)) {
10412 0 : return NULL;
10413 : }
10414 0 : blob.length = blob_length;
10415 :
10416 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10417 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10418 : }
10419 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10420 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10421 : }
10422 :
10423 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10424 0 : allow_remaining = true;
10425 : }
10426 :
10427 0 : return py_wbint_QueryUserRidList_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
10428 : }
10429 :
10430 0 : static PyObject *py_wbint_QueryUserRidList_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10431 : {
10432 0 : DATA_BLOB blob;
10433 0 : Py_ssize_t blob_length = 0;
10434 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
10435 0 : PyObject *bigendian_obj = NULL;
10436 0 : PyObject *ndr64_obj = NULL;
10437 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
10438 0 : PyObject *allow_remaining_obj = NULL;
10439 0 : bool allow_remaining = false;
10440 :
10441 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
10442 : discard_const_p(char *, kwnames),
10443 : &blob.data, &blob_length,
10444 : &bigendian_obj,
10445 : &ndr64_obj,
10446 : &allow_remaining_obj)) {
10447 0 : return NULL;
10448 : }
10449 0 : blob.length = blob_length;
10450 :
10451 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10452 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
10453 : }
10454 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10455 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
10456 : }
10457 :
10458 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10459 0 : allow_remaining = true;
10460 : }
10461 :
10462 0 : return py_wbint_QueryUserRidList_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
10463 : }
10464 :
10465 0 : static PyObject *py_wbint_QueryUserRidList_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
10466 : {
10467 0 : const struct ndr_interface_call *call = NULL;
10468 0 : struct wbint_QueryUserRidList *object = pytalloc_get_ptr(py_obj);
10469 0 : PyObject *ret;
10470 0 : char *retstr;
10471 :
10472 0 : if (ndr_table_winbind.num_calls < 16) {
10473 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_QueryUserRidList_ndr_print");
10474 0 : return NULL;
10475 : }
10476 0 : call = &ndr_table_winbind.calls[15];
10477 :
10478 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
10479 0 : ret = PyUnicode_FromString(retstr);
10480 0 : TALLOC_FREE(retstr);
10481 :
10482 0 : return ret;
10483 : }
10484 :
10485 0 : static PyObject *py_wbint_QueryUserRidList_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10486 : {
10487 0 : return py_wbint_QueryUserRidList_ndr_print(py_obj, "wbint_QueryUserRidList_in", NDR_IN);
10488 : }
10489 :
10490 0 : static PyObject *py_wbint_QueryUserRidList_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10491 : {
10492 0 : return py_wbint_QueryUserRidList_ndr_print(py_obj, "wbint_QueryUserRidList_out", NDR_OUT);
10493 : }
10494 :
10495 : static PyMethodDef py_wbint_QueryUserRidList_methods[] = {
10496 : { "opnum", (PyCFunction)py_wbint_QueryUserRidList_ndr_opnum, METH_NOARGS|METH_CLASS,
10497 : "winbind.wbint_QueryUserRidList.opnum() -> 15 (0x0f) " },
10498 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
10499 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
10500 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
10501 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
10502 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
10503 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
10504 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_QueryUserRidList_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
10505 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
10506 : { "__ndr_print_in__", (PyCFunction)py_wbint_QueryUserRidList_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
10507 : { "__ndr_print_out__", (PyCFunction)py_wbint_QueryUserRidList_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
10508 : { NULL, NULL, 0, NULL }
10509 : };
10510 :
10511 :
10512 : static PyTypeObject wbint_QueryUserRidList_Type = {
10513 : PyVarObject_HEAD_INIT(NULL, 0)
10514 : .tp_name = "winbind.wbint_QueryUserRidList",
10515 : .tp_getset = py_wbint_QueryUserRidList_getsetters,
10516 : .tp_methods = py_wbint_QueryUserRidList_methods,
10517 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10518 : .tp_new = py_wbint_QueryUserRidList_new,
10519 : };
10520 :
10521 0 : static bool pack_py_wbint_QueryUserRidList_args_in(PyObject *args, PyObject *kwargs, struct wbint_QueryUserRidList *r)
10522 : {
10523 0 : const char *kwnames[] = {
10524 : NULL
10525 : };
10526 :
10527 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_QueryUserRidList", discard_const_p(char *, kwnames))) {
10528 0 : return false;
10529 : }
10530 :
10531 0 : return true;
10532 : }
10533 :
10534 0 : static PyObject *unpack_py_wbint_QueryUserRidList_args_out(struct wbint_QueryUserRidList *r)
10535 : {
10536 0 : PyObject *result;
10537 0 : PyObject *py_rids;
10538 0 : py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, r->out.rids, r->out.rids);
10539 0 : result = py_rids;
10540 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
10541 0 : PyErr_SetNTSTATUS(r->out.result);
10542 0 : return NULL;
10543 : }
10544 :
10545 0 : return result;
10546 : }
10547 :
10548 :
10549 0 : static PyObject *py_wbint_DsGetDcName_in_get_domain_name(PyObject *obj, void *closure)
10550 : {
10551 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(obj);
10552 0 : PyObject *py_domain_name;
10553 0 : if (object->in.domain_name == NULL) {
10554 0 : Py_RETURN_NONE;
10555 : }
10556 0 : if (object->in.domain_name == NULL) {
10557 0 : py_domain_name = Py_None;
10558 0 : Py_INCREF(py_domain_name);
10559 : } else {
10560 0 : py_domain_name = PyUnicode_Decode(object->in.domain_name, strlen(object->in.domain_name), "utf-8", "ignore");
10561 : }
10562 0 : return py_domain_name;
10563 : }
10564 :
10565 0 : static int py_wbint_DsGetDcName_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
10566 : {
10567 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
10568 0 : if (value == NULL) {
10569 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain_name");
10570 0 : return -1;
10571 : }
10572 0 : object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name);
10573 0 : if (object->in.domain_name == NULL) {
10574 0 : PyErr_NoMemory();
10575 0 : return -1;
10576 : }
10577 : {
10578 0 : const char *test_str;
10579 0 : const char *talloc_str;
10580 0 : PyObject *unicode = NULL;
10581 0 : if (PyUnicode_Check(value)) {
10582 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10583 0 : if (unicode == NULL) {
10584 0 : return -1;
10585 : }
10586 0 : test_str = PyBytes_AS_STRING(unicode);
10587 0 : } else if (PyBytes_Check(value)) {
10588 0 : test_str = PyBytes_AS_STRING(value);
10589 : } else {
10590 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10591 0 : return -1;
10592 : }
10593 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10594 0 : if (unicode != NULL) {
10595 0 : Py_DECREF(unicode);
10596 : }
10597 0 : if (talloc_str == NULL) {
10598 0 : PyErr_NoMemory();
10599 0 : return -1;
10600 : }
10601 0 : object->in.domain_name = talloc_str;
10602 : }
10603 0 : return 0;
10604 : }
10605 :
10606 0 : static PyObject *py_wbint_DsGetDcName_in_get_domain_guid(PyObject *obj, void *closure)
10607 : {
10608 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(obj);
10609 0 : PyObject *py_domain_guid;
10610 0 : if (object->in.domain_guid == NULL) {
10611 0 : Py_RETURN_NONE;
10612 : }
10613 0 : if (object->in.domain_guid == NULL) {
10614 0 : py_domain_guid = Py_None;
10615 0 : Py_INCREF(py_domain_guid);
10616 : } else {
10617 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, object->in.domain_guid, object->in.domain_guid);
10618 : }
10619 0 : return py_domain_guid;
10620 : }
10621 :
10622 0 : static int py_wbint_DsGetDcName_in_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
10623 : {
10624 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
10625 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_guid));
10626 0 : if (value == NULL) {
10627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain_guid");
10628 0 : return -1;
10629 : }
10630 0 : if (value == Py_None) {
10631 0 : object->in.domain_guid = NULL;
10632 : } else {
10633 0 : object->in.domain_guid = NULL;
10634 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
10635 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10636 0 : PyErr_NoMemory();
10637 0 : return -1;
10638 : }
10639 0 : object->in.domain_guid = (struct GUID *)pytalloc_get_ptr(value);
10640 : }
10641 0 : return 0;
10642 : }
10643 :
10644 0 : static PyObject *py_wbint_DsGetDcName_in_get_site_name(PyObject *obj, void *closure)
10645 : {
10646 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(obj);
10647 0 : PyObject *py_site_name;
10648 0 : if (object->in.site_name == NULL) {
10649 0 : Py_RETURN_NONE;
10650 : }
10651 0 : if (object->in.site_name == NULL) {
10652 0 : py_site_name = Py_None;
10653 0 : Py_INCREF(py_site_name);
10654 : } else {
10655 0 : if (object->in.site_name == NULL) {
10656 0 : py_site_name = Py_None;
10657 0 : Py_INCREF(py_site_name);
10658 : } else {
10659 0 : py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
10660 : }
10661 : }
10662 0 : return py_site_name;
10663 : }
10664 :
10665 0 : static int py_wbint_DsGetDcName_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
10666 : {
10667 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
10668 0 : if (value == NULL) {
10669 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.site_name");
10670 0 : return -1;
10671 : }
10672 0 : if (value == Py_None) {
10673 0 : object->in.site_name = NULL;
10674 : } else {
10675 0 : object->in.site_name = NULL;
10676 : {
10677 0 : const char *test_str;
10678 0 : const char *talloc_str;
10679 0 : PyObject *unicode = NULL;
10680 0 : if (PyUnicode_Check(value)) {
10681 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
10682 0 : if (unicode == NULL) {
10683 0 : return -1;
10684 : }
10685 0 : test_str = PyBytes_AS_STRING(unicode);
10686 0 : } else if (PyBytes_Check(value)) {
10687 0 : test_str = PyBytes_AS_STRING(value);
10688 : } else {
10689 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
10690 0 : return -1;
10691 : }
10692 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
10693 0 : if (unicode != NULL) {
10694 0 : Py_DECREF(unicode);
10695 : }
10696 0 : if (talloc_str == NULL) {
10697 0 : PyErr_NoMemory();
10698 0 : return -1;
10699 : }
10700 0 : object->in.site_name = talloc_str;
10701 : }
10702 : }
10703 0 : return 0;
10704 : }
10705 :
10706 0 : static PyObject *py_wbint_DsGetDcName_in_get_flags(PyObject *obj, void *closure)
10707 : {
10708 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(obj);
10709 0 : PyObject *py_flags;
10710 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
10711 0 : return py_flags;
10712 : }
10713 :
10714 0 : static int py_wbint_DsGetDcName_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
10715 : {
10716 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
10717 0 : if (value == NULL) {
10718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
10719 0 : return -1;
10720 : }
10721 : {
10722 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
10723 0 : if (PyLong_Check(value)) {
10724 0 : unsigned long long test_var;
10725 0 : test_var = PyLong_AsUnsignedLongLong(value);
10726 0 : if (PyErr_Occurred() != NULL) {
10727 0 : return -1;
10728 : }
10729 0 : if (test_var > uint_max) {
10730 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10731 : PyLong_Type.tp_name, uint_max, test_var);
10732 0 : return -1;
10733 : }
10734 0 : object->in.flags = test_var;
10735 : } else {
10736 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10737 : PyLong_Type.tp_name);
10738 0 : return -1;
10739 : }
10740 : }
10741 0 : return 0;
10742 : }
10743 :
10744 0 : static PyObject *py_wbint_DsGetDcName_out_get_dc_info(PyObject *obj, void *closure)
10745 : {
10746 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(obj);
10747 0 : PyObject *py_dc_info;
10748 0 : if (object->out.dc_info == NULL) {
10749 0 : Py_RETURN_NONE;
10750 : }
10751 0 : if (*object->out.dc_info == NULL) {
10752 0 : py_dc_info = Py_None;
10753 0 : Py_INCREF(py_dc_info);
10754 : } else {
10755 0 : py_dc_info = pytalloc_reference_ex(netr_DsRGetDCNameInfo_Type, *object->out.dc_info, *object->out.dc_info);
10756 : }
10757 0 : return py_dc_info;
10758 : }
10759 :
10760 0 : static int py_wbint_DsGetDcName_out_set_dc_info(PyObject *py_obj, PyObject *value, void *closure)
10761 : {
10762 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
10763 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dc_info));
10764 0 : if (value == NULL) {
10765 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.dc_info");
10766 0 : return -1;
10767 : }
10768 0 : object->out.dc_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dc_info);
10769 0 : if (object->out.dc_info == NULL) {
10770 0 : PyErr_NoMemory();
10771 0 : return -1;
10772 : }
10773 0 : if (value == Py_None) {
10774 0 : *object->out.dc_info = NULL;
10775 : } else {
10776 0 : *object->out.dc_info = NULL;
10777 0 : PY_CHECK_TYPE(netr_DsRGetDCNameInfo_Type, value, return -1;);
10778 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10779 0 : PyErr_NoMemory();
10780 0 : return -1;
10781 : }
10782 0 : *object->out.dc_info = (struct netr_DsRGetDCNameInfo *)pytalloc_get_ptr(value);
10783 : }
10784 0 : return 0;
10785 : }
10786 :
10787 0 : static PyObject *py_wbint_DsGetDcName_get_result(PyObject *obj, void *closure)
10788 : {
10789 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(obj);
10790 0 : PyObject *py_result;
10791 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
10792 0 : return py_result;
10793 : }
10794 :
10795 0 : static int py_wbint_DsGetDcName_set_result(PyObject *py_obj, PyObject *value, void *closure)
10796 : {
10797 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
10798 0 : if (value == NULL) {
10799 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
10800 0 : return -1;
10801 : }
10802 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
10803 0 : return 0;
10804 : }
10805 :
10806 : static PyGetSetDef py_wbint_DsGetDcName_getsetters[] = {
10807 : {
10808 : .name = discard_const_p(char, "in_domain_name"),
10809 : .get = py_wbint_DsGetDcName_in_get_domain_name,
10810 : .set = py_wbint_DsGetDcName_in_set_domain_name,
10811 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10812 : },
10813 : {
10814 : .name = discard_const_p(char, "in_domain_guid"),
10815 : .get = py_wbint_DsGetDcName_in_get_domain_guid,
10816 : .set = py_wbint_DsGetDcName_in_set_domain_guid,
10817 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
10818 : },
10819 : {
10820 : .name = discard_const_p(char, "in_site_name"),
10821 : .get = py_wbint_DsGetDcName_in_get_site_name,
10822 : .set = py_wbint_DsGetDcName_in_set_site_name,
10823 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10824 : },
10825 : {
10826 : .name = discard_const_p(char, "in_flags"),
10827 : .get = py_wbint_DsGetDcName_in_get_flags,
10828 : .set = py_wbint_DsGetDcName_in_set_flags,
10829 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10830 : },
10831 : {
10832 : .name = discard_const_p(char, "out_dc_info"),
10833 : .get = py_wbint_DsGetDcName_out_get_dc_info,
10834 : .set = py_wbint_DsGetDcName_out_set_dc_info,
10835 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DsRGetDCNameInfo")
10836 : },
10837 : {
10838 : .name = discard_const_p(char, "result"),
10839 : .get = py_wbint_DsGetDcName_get_result,
10840 : .set = py_wbint_DsGetDcName_set_result,
10841 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
10842 : },
10843 : { .name = NULL }
10844 : };
10845 :
10846 0 : static PyObject *py_wbint_DsGetDcName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10847 : {
10848 0 : PyObject *self = pytalloc_new(struct wbint_DsGetDcName, type);
10849 0 : struct wbint_DsGetDcName *_self = (struct wbint_DsGetDcName *)pytalloc_get_ptr(self);
10850 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
10851 : /* a pointer to a NULL pointer */
10852 0 : _self->out.dc_info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
10853 0 : return self;
10854 : }
10855 :
10856 0 : static PyObject *py_wbint_DsGetDcName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
10857 : {
10858 :
10859 :
10860 0 : return PyLong_FromLong(16);
10861 : }
10862 :
10863 0 : static PyObject *py_wbint_DsGetDcName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
10864 : {
10865 0 : const struct ndr_interface_call *call = NULL;
10866 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
10867 0 : PyObject *ret = NULL;
10868 0 : struct ndr_push *push = NULL;
10869 0 : DATA_BLOB blob;
10870 0 : enum ndr_err_code err;
10871 :
10872 0 : if (ndr_table_winbind.num_calls < 17) {
10873 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_pack");
10874 0 : return NULL;
10875 : }
10876 0 : call = &ndr_table_winbind.calls[16];
10877 :
10878 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
10879 0 : if (push == NULL) {
10880 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10881 0 : return NULL;
10882 : }
10883 :
10884 0 : push->flags |= ndr_push_flags;
10885 :
10886 0 : err = call->ndr_push(push, ndr_inout_flags, object);
10887 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10888 0 : TALLOC_FREE(push);
10889 0 : PyErr_SetNdrError(err);
10890 0 : return NULL;
10891 : }
10892 0 : blob = ndr_push_blob(push);
10893 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10894 0 : TALLOC_FREE(push);
10895 0 : return ret;
10896 : }
10897 :
10898 0 : static PyObject *py_wbint_DsGetDcName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10899 : {
10900 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10901 0 : PyObject *bigendian_obj = NULL;
10902 0 : PyObject *ndr64_obj = NULL;
10903 0 : libndr_flags ndr_push_flags = 0;
10904 :
10905 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
10906 : discard_const_p(char *, kwnames),
10907 : &bigendian_obj,
10908 : &ndr64_obj)) {
10909 0 : return NULL;
10910 : }
10911 :
10912 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10913 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10914 : }
10915 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10916 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10917 : }
10918 :
10919 0 : return py_wbint_DsGetDcName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
10920 : }
10921 :
10922 0 : static PyObject *py_wbint_DsGetDcName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10923 : {
10924 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
10925 0 : PyObject *bigendian_obj = NULL;
10926 0 : PyObject *ndr64_obj = NULL;
10927 0 : libndr_flags ndr_push_flags = 0;
10928 :
10929 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
10930 : discard_const_p(char *, kwnames),
10931 : &bigendian_obj,
10932 : &ndr64_obj)) {
10933 0 : return NULL;
10934 : }
10935 :
10936 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
10937 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
10938 : }
10939 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
10940 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
10941 : }
10942 :
10943 0 : return py_wbint_DsGetDcName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
10944 : }
10945 :
10946 0 : static PyObject *py_wbint_DsGetDcName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
10947 : {
10948 0 : const struct ndr_interface_call *call = NULL;
10949 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
10950 0 : struct ndr_pull *pull = NULL;
10951 0 : enum ndr_err_code err;
10952 :
10953 0 : if (ndr_table_winbind.num_calls < 17) {
10954 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_unpack");
10955 0 : return NULL;
10956 : }
10957 0 : call = &ndr_table_winbind.calls[16];
10958 :
10959 0 : pull = ndr_pull_init_blob(blob, object);
10960 0 : if (pull == NULL) {
10961 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10962 0 : return NULL;
10963 : }
10964 :
10965 0 : pull->flags |= ndr_pull_flags;
10966 :
10967 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
10968 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10969 0 : TALLOC_FREE(pull);
10970 0 : PyErr_SetNdrError(err);
10971 0 : return NULL;
10972 : }
10973 0 : if (!allow_remaining) {
10974 0 : uint32_t highest_ofs;
10975 :
10976 0 : if (pull->offset > pull->relative_highest_offset) {
10977 0 : highest_ofs = pull->offset;
10978 : } else {
10979 0 : highest_ofs = pull->relative_highest_offset;
10980 : }
10981 0 : if (highest_ofs < pull->data_size) {
10982 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
10983 : "not all bytes consumed ofs[%u] size[%u]",
10984 : highest_ofs, pull->data_size);
10985 0 : TALLOC_FREE(pull);
10986 0 : PyErr_SetNdrError(err);
10987 0 : return NULL;
10988 : }
10989 : }
10990 :
10991 0 : TALLOC_FREE(pull);
10992 0 : Py_RETURN_NONE;
10993 : }
10994 :
10995 0 : static PyObject *py_wbint_DsGetDcName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10996 : {
10997 0 : DATA_BLOB blob;
10998 0 : Py_ssize_t blob_length = 0;
10999 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
11000 0 : PyObject *bigendian_obj = NULL;
11001 0 : PyObject *ndr64_obj = NULL;
11002 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
11003 0 : PyObject *allow_remaining_obj = NULL;
11004 0 : bool allow_remaining = false;
11005 :
11006 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
11007 : discard_const_p(char *, kwnames),
11008 : &blob.data, &blob_length,
11009 : &bigendian_obj,
11010 : &ndr64_obj,
11011 : &allow_remaining_obj)) {
11012 0 : return NULL;
11013 : }
11014 0 : blob.length = blob_length;
11015 :
11016 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11017 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
11018 : }
11019 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11020 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
11021 : }
11022 :
11023 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11024 0 : allow_remaining = true;
11025 : }
11026 :
11027 0 : return py_wbint_DsGetDcName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
11028 : }
11029 :
11030 0 : static PyObject *py_wbint_DsGetDcName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11031 : {
11032 0 : DATA_BLOB blob;
11033 0 : Py_ssize_t blob_length = 0;
11034 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
11035 0 : PyObject *bigendian_obj = NULL;
11036 0 : PyObject *ndr64_obj = NULL;
11037 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
11038 0 : PyObject *allow_remaining_obj = NULL;
11039 0 : bool allow_remaining = false;
11040 :
11041 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
11042 : discard_const_p(char *, kwnames),
11043 : &blob.data, &blob_length,
11044 : &bigendian_obj,
11045 : &ndr64_obj,
11046 : &allow_remaining_obj)) {
11047 0 : return NULL;
11048 : }
11049 0 : blob.length = blob_length;
11050 :
11051 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11052 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
11053 : }
11054 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11055 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
11056 : }
11057 :
11058 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11059 0 : allow_remaining = true;
11060 : }
11061 :
11062 0 : return py_wbint_DsGetDcName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
11063 : }
11064 :
11065 0 : static PyObject *py_wbint_DsGetDcName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
11066 : {
11067 0 : const struct ndr_interface_call *call = NULL;
11068 0 : struct wbint_DsGetDcName *object = pytalloc_get_ptr(py_obj);
11069 0 : PyObject *ret;
11070 0 : char *retstr;
11071 :
11072 0 : if (ndr_table_winbind.num_calls < 17) {
11073 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_DsGetDcName_ndr_print");
11074 0 : return NULL;
11075 : }
11076 0 : call = &ndr_table_winbind.calls[16];
11077 :
11078 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
11079 0 : ret = PyUnicode_FromString(retstr);
11080 0 : TALLOC_FREE(retstr);
11081 :
11082 0 : return ret;
11083 : }
11084 :
11085 0 : static PyObject *py_wbint_DsGetDcName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11086 : {
11087 0 : return py_wbint_DsGetDcName_ndr_print(py_obj, "wbint_DsGetDcName_in", NDR_IN);
11088 : }
11089 :
11090 0 : static PyObject *py_wbint_DsGetDcName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11091 : {
11092 0 : return py_wbint_DsGetDcName_ndr_print(py_obj, "wbint_DsGetDcName_out", NDR_OUT);
11093 : }
11094 :
11095 : static PyMethodDef py_wbint_DsGetDcName_methods[] = {
11096 : { "opnum", (PyCFunction)py_wbint_DsGetDcName_ndr_opnum, METH_NOARGS|METH_CLASS,
11097 : "winbind.wbint_DsGetDcName.opnum() -> 16 (0x10) " },
11098 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
11099 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
11100 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
11101 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
11102 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
11103 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
11104 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_DsGetDcName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
11105 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
11106 : { "__ndr_print_in__", (PyCFunction)py_wbint_DsGetDcName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
11107 : { "__ndr_print_out__", (PyCFunction)py_wbint_DsGetDcName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
11108 : { NULL, NULL, 0, NULL }
11109 : };
11110 :
11111 :
11112 : static PyTypeObject wbint_DsGetDcName_Type = {
11113 : PyVarObject_HEAD_INIT(NULL, 0)
11114 : .tp_name = "winbind.wbint_DsGetDcName",
11115 : .tp_getset = py_wbint_DsGetDcName_getsetters,
11116 : .tp_methods = py_wbint_DsGetDcName_methods,
11117 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11118 : .tp_new = py_wbint_DsGetDcName_new,
11119 : };
11120 :
11121 0 : static bool pack_py_wbint_DsGetDcName_args_in(PyObject *args, PyObject *kwargs, struct wbint_DsGetDcName *r)
11122 : {
11123 0 : PyObject *py_domain_name;
11124 0 : PyObject *py_domain_guid;
11125 0 : PyObject *py_site_name;
11126 0 : PyObject *py_flags;
11127 0 : const char *kwnames[] = {
11128 : "domain_name", "domain_guid", "site_name", "flags", NULL
11129 : };
11130 :
11131 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:wbint_DsGetDcName", discard_const_p(char *, kwnames), &py_domain_name, &py_domain_guid, &py_site_name, &py_flags)) {
11132 0 : return false;
11133 : }
11134 :
11135 0 : if (py_domain_name == NULL) {
11136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain_name");
11137 0 : return false;
11138 : }
11139 0 : r->in.domain_name = talloc_ptrtype(r, r->in.domain_name);
11140 0 : if (r->in.domain_name == NULL) {
11141 0 : PyErr_NoMemory();
11142 0 : return false;
11143 : }
11144 : {
11145 0 : const char *test_str;
11146 0 : const char *talloc_str;
11147 0 : PyObject *unicode = NULL;
11148 0 : if (PyUnicode_Check(py_domain_name)) {
11149 0 : unicode = PyUnicode_AsEncodedString(py_domain_name, "utf-8", "ignore");
11150 0 : if (unicode == NULL) {
11151 0 : return false;
11152 : }
11153 0 : test_str = PyBytes_AS_STRING(unicode);
11154 0 : } else if (PyBytes_Check(py_domain_name)) {
11155 0 : test_str = PyBytes_AS_STRING(py_domain_name);
11156 : } else {
11157 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain_name)->tp_name);
11158 0 : return false;
11159 : }
11160 0 : talloc_str = talloc_strdup(r, test_str);
11161 0 : if (unicode != NULL) {
11162 0 : Py_DECREF(unicode);
11163 : }
11164 0 : if (talloc_str == NULL) {
11165 0 : PyErr_NoMemory();
11166 0 : return false;
11167 : }
11168 0 : r->in.domain_name = talloc_str;
11169 : }
11170 0 : if (py_domain_guid == NULL) {
11171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain_guid");
11172 0 : return false;
11173 : }
11174 0 : if (py_domain_guid == Py_None) {
11175 0 : r->in.domain_guid = NULL;
11176 : } else {
11177 0 : r->in.domain_guid = NULL;
11178 0 : PY_CHECK_TYPE(GUID_Type, py_domain_guid, return false;);
11179 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_guid)) == NULL) {
11180 0 : PyErr_NoMemory();
11181 0 : return false;
11182 : }
11183 0 : r->in.domain_guid = (struct GUID *)pytalloc_get_ptr(py_domain_guid);
11184 : }
11185 0 : if (py_site_name == NULL) {
11186 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.site_name");
11187 0 : return false;
11188 : }
11189 0 : if (py_site_name == Py_None) {
11190 0 : r->in.site_name = NULL;
11191 : } else {
11192 0 : r->in.site_name = NULL;
11193 : {
11194 0 : const char *test_str;
11195 0 : const char *talloc_str;
11196 0 : PyObject *unicode = NULL;
11197 0 : if (PyUnicode_Check(py_site_name)) {
11198 0 : unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore");
11199 0 : if (unicode == NULL) {
11200 0 : return false;
11201 : }
11202 0 : test_str = PyBytes_AS_STRING(unicode);
11203 0 : } else if (PyBytes_Check(py_site_name)) {
11204 0 : test_str = PyBytes_AS_STRING(py_site_name);
11205 : } else {
11206 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name);
11207 0 : return false;
11208 : }
11209 0 : talloc_str = talloc_strdup(r, test_str);
11210 0 : if (unicode != NULL) {
11211 0 : Py_DECREF(unicode);
11212 : }
11213 0 : if (talloc_str == NULL) {
11214 0 : PyErr_NoMemory();
11215 0 : return false;
11216 : }
11217 0 : r->in.site_name = talloc_str;
11218 : }
11219 : }
11220 0 : if (py_flags == NULL) {
11221 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
11222 0 : return false;
11223 : }
11224 : {
11225 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
11226 0 : if (PyLong_Check(py_flags)) {
11227 0 : unsigned long long test_var;
11228 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
11229 0 : if (PyErr_Occurred() != NULL) {
11230 0 : return false;
11231 : }
11232 0 : if (test_var > uint_max) {
11233 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11234 : PyLong_Type.tp_name, uint_max, test_var);
11235 0 : return false;
11236 : }
11237 0 : r->in.flags = test_var;
11238 : } else {
11239 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11240 : PyLong_Type.tp_name);
11241 0 : return false;
11242 : }
11243 : }
11244 0 : return true;
11245 : }
11246 :
11247 0 : static PyObject *unpack_py_wbint_DsGetDcName_args_out(struct wbint_DsGetDcName *r)
11248 : {
11249 0 : PyObject *result;
11250 0 : PyObject *py_dc_info;
11251 0 : if (*r->out.dc_info == NULL) {
11252 0 : py_dc_info = Py_None;
11253 0 : Py_INCREF(py_dc_info);
11254 : } else {
11255 0 : py_dc_info = pytalloc_reference_ex(netr_DsRGetDCNameInfo_Type, *r->out.dc_info, *r->out.dc_info);
11256 : }
11257 0 : result = py_dc_info;
11258 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
11259 0 : PyErr_SetNTSTATUS(r->out.result);
11260 0 : return NULL;
11261 : }
11262 :
11263 0 : return result;
11264 : }
11265 :
11266 :
11267 0 : static PyObject *py_wbint_LookupRids_in_get_domain_sid(PyObject *obj, void *closure)
11268 : {
11269 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(obj);
11270 0 : PyObject *py_domain_sid;
11271 0 : if (object->in.domain_sid == NULL) {
11272 0 : Py_RETURN_NONE;
11273 : }
11274 0 : py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->in.domain_sid, object->in.domain_sid);
11275 0 : return py_domain_sid;
11276 : }
11277 :
11278 0 : static int py_wbint_LookupRids_in_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
11279 : {
11280 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(py_obj);
11281 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_sid));
11282 0 : if (value == NULL) {
11283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain_sid");
11284 0 : return -1;
11285 : }
11286 0 : object->in.domain_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_sid);
11287 0 : if (object->in.domain_sid == NULL) {
11288 0 : PyErr_NoMemory();
11289 0 : return -1;
11290 : }
11291 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
11292 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11293 0 : PyErr_NoMemory();
11294 0 : return -1;
11295 : }
11296 0 : object->in.domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
11297 0 : return 0;
11298 : }
11299 :
11300 0 : static PyObject *py_wbint_LookupRids_in_get_rids(PyObject *obj, void *closure)
11301 : {
11302 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(obj);
11303 0 : PyObject *py_rids;
11304 0 : if (object->in.rids == NULL) {
11305 0 : Py_RETURN_NONE;
11306 : }
11307 0 : py_rids = pytalloc_reference_ex(&wbint_RidArray_Type, object->in.rids, object->in.rids);
11308 0 : return py_rids;
11309 : }
11310 :
11311 0 : static int py_wbint_LookupRids_in_set_rids(PyObject *py_obj, PyObject *value, void *closure)
11312 : {
11313 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(py_obj);
11314 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rids));
11315 0 : if (value == NULL) {
11316 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.rids");
11317 0 : return -1;
11318 : }
11319 0 : object->in.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rids);
11320 0 : if (object->in.rids == NULL) {
11321 0 : PyErr_NoMemory();
11322 0 : return -1;
11323 : }
11324 0 : PY_CHECK_TYPE(&wbint_RidArray_Type, value, return -1;);
11325 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11326 0 : PyErr_NoMemory();
11327 0 : return -1;
11328 : }
11329 0 : object->in.rids = (struct wbint_RidArray *)pytalloc_get_ptr(value);
11330 0 : return 0;
11331 : }
11332 :
11333 0 : static PyObject *py_wbint_LookupRids_out_get_domain_name(PyObject *obj, void *closure)
11334 : {
11335 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(obj);
11336 0 : PyObject *py_domain_name;
11337 0 : if (object->out.domain_name == NULL) {
11338 0 : Py_RETURN_NONE;
11339 : }
11340 0 : if (*object->out.domain_name == NULL) {
11341 0 : py_domain_name = Py_None;
11342 0 : Py_INCREF(py_domain_name);
11343 : } else {
11344 0 : if (*object->out.domain_name == NULL) {
11345 0 : py_domain_name = Py_None;
11346 0 : Py_INCREF(py_domain_name);
11347 : } else {
11348 0 : py_domain_name = PyUnicode_Decode(*object->out.domain_name, strlen(*object->out.domain_name), "utf-8", "ignore");
11349 : }
11350 : }
11351 0 : return py_domain_name;
11352 : }
11353 :
11354 0 : static int py_wbint_LookupRids_out_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
11355 : {
11356 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(py_obj);
11357 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain_name));
11358 0 : if (value == NULL) {
11359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domain_name");
11360 0 : return -1;
11361 : }
11362 0 : object->out.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain_name);
11363 0 : if (object->out.domain_name == NULL) {
11364 0 : PyErr_NoMemory();
11365 0 : return -1;
11366 : }
11367 0 : if (value == Py_None) {
11368 0 : *object->out.domain_name = NULL;
11369 : } else {
11370 0 : *object->out.domain_name = NULL;
11371 : {
11372 0 : const char *test_str;
11373 0 : const char *talloc_str;
11374 0 : PyObject *unicode = NULL;
11375 0 : if (PyUnicode_Check(value)) {
11376 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
11377 0 : if (unicode == NULL) {
11378 0 : return -1;
11379 : }
11380 0 : test_str = PyBytes_AS_STRING(unicode);
11381 0 : } else if (PyBytes_Check(value)) {
11382 0 : test_str = PyBytes_AS_STRING(value);
11383 : } else {
11384 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
11385 0 : return -1;
11386 : }
11387 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
11388 0 : if (unicode != NULL) {
11389 0 : Py_DECREF(unicode);
11390 : }
11391 0 : if (talloc_str == NULL) {
11392 0 : PyErr_NoMemory();
11393 0 : return -1;
11394 : }
11395 0 : *object->out.domain_name = talloc_str;
11396 : }
11397 : }
11398 0 : return 0;
11399 : }
11400 :
11401 0 : static PyObject *py_wbint_LookupRids_out_get_names(PyObject *obj, void *closure)
11402 : {
11403 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(obj);
11404 0 : PyObject *py_names;
11405 0 : if (object->out.names == NULL) {
11406 0 : Py_RETURN_NONE;
11407 : }
11408 0 : py_names = pytalloc_reference_ex(&wbint_Principals_Type, object->out.names, object->out.names);
11409 0 : return py_names;
11410 : }
11411 :
11412 0 : static int py_wbint_LookupRids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
11413 : {
11414 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(py_obj);
11415 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
11416 0 : if (value == NULL) {
11417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.names");
11418 0 : return -1;
11419 : }
11420 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
11421 0 : if (object->out.names == NULL) {
11422 0 : PyErr_NoMemory();
11423 0 : return -1;
11424 : }
11425 0 : PY_CHECK_TYPE(&wbint_Principals_Type, value, return -1;);
11426 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11427 0 : PyErr_NoMemory();
11428 0 : return -1;
11429 : }
11430 0 : object->out.names = (struct wbint_Principals *)pytalloc_get_ptr(value);
11431 0 : return 0;
11432 : }
11433 :
11434 0 : static PyObject *py_wbint_LookupRids_get_result(PyObject *obj, void *closure)
11435 : {
11436 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(obj);
11437 0 : PyObject *py_result;
11438 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
11439 0 : return py_result;
11440 : }
11441 :
11442 0 : static int py_wbint_LookupRids_set_result(PyObject *py_obj, PyObject *value, void *closure)
11443 : {
11444 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(py_obj);
11445 0 : if (value == NULL) {
11446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
11447 0 : return -1;
11448 : }
11449 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
11450 0 : return 0;
11451 : }
11452 :
11453 : static PyGetSetDef py_wbint_LookupRids_getsetters[] = {
11454 : {
11455 : .name = discard_const_p(char, "in_domain_sid"),
11456 : .get = py_wbint_LookupRids_in_get_domain_sid,
11457 : .set = py_wbint_LookupRids_in_set_domain_sid,
11458 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
11459 : },
11460 : {
11461 : .name = discard_const_p(char, "in_rids"),
11462 : .get = py_wbint_LookupRids_in_get_rids,
11463 : .set = py_wbint_LookupRids_in_set_rids,
11464 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_RidArray")
11465 : },
11466 : {
11467 : .name = discard_const_p(char, "out_domain_name"),
11468 : .get = py_wbint_LookupRids_out_get_domain_name,
11469 : .set = py_wbint_LookupRids_out_set_domain_name,
11470 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11471 : },
11472 : {
11473 : .name = discard_const_p(char, "out_names"),
11474 : .get = py_wbint_LookupRids_out_get_names,
11475 : .set = py_wbint_LookupRids_out_set_names,
11476 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Principals")
11477 : },
11478 : {
11479 : .name = discard_const_p(char, "result"),
11480 : .get = py_wbint_LookupRids_get_result,
11481 : .set = py_wbint_LookupRids_set_result,
11482 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
11483 : },
11484 : { .name = NULL }
11485 : };
11486 :
11487 0 : static PyObject *py_wbint_LookupRids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11488 : {
11489 0 : PyObject *self = pytalloc_new(struct wbint_LookupRids, type);
11490 0 : struct wbint_LookupRids *_self = (struct wbint_LookupRids *)pytalloc_get_ptr(self);
11491 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
11492 0 : _self->in.domain_sid = talloc_zero(mem_ctx, struct dom_sid);
11493 0 : _self->in.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
11494 0 : _self->out.names = talloc_zero(mem_ctx, struct wbint_Principals);
11495 0 : return self;
11496 : }
11497 :
11498 0 : static PyObject *py_wbint_LookupRids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
11499 : {
11500 :
11501 :
11502 0 : return PyLong_FromLong(17);
11503 : }
11504 :
11505 0 : static PyObject *py_wbint_LookupRids_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
11506 : {
11507 0 : const struct ndr_interface_call *call = NULL;
11508 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(py_obj);
11509 0 : PyObject *ret = NULL;
11510 0 : struct ndr_push *push = NULL;
11511 0 : DATA_BLOB blob;
11512 0 : enum ndr_err_code err;
11513 :
11514 0 : if (ndr_table_winbind.num_calls < 18) {
11515 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_pack");
11516 0 : return NULL;
11517 : }
11518 0 : call = &ndr_table_winbind.calls[17];
11519 :
11520 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
11521 0 : if (push == NULL) {
11522 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11523 0 : return NULL;
11524 : }
11525 :
11526 0 : push->flags |= ndr_push_flags;
11527 :
11528 0 : err = call->ndr_push(push, ndr_inout_flags, object);
11529 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11530 0 : TALLOC_FREE(push);
11531 0 : PyErr_SetNdrError(err);
11532 0 : return NULL;
11533 : }
11534 0 : blob = ndr_push_blob(push);
11535 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11536 0 : TALLOC_FREE(push);
11537 0 : return ret;
11538 : }
11539 :
11540 0 : static PyObject *py_wbint_LookupRids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11541 : {
11542 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
11543 0 : PyObject *bigendian_obj = NULL;
11544 0 : PyObject *ndr64_obj = NULL;
11545 0 : libndr_flags ndr_push_flags = 0;
11546 :
11547 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
11548 : discard_const_p(char *, kwnames),
11549 : &bigendian_obj,
11550 : &ndr64_obj)) {
11551 0 : return NULL;
11552 : }
11553 :
11554 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11555 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
11556 : }
11557 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11558 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
11559 : }
11560 :
11561 0 : return py_wbint_LookupRids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
11562 : }
11563 :
11564 0 : static PyObject *py_wbint_LookupRids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11565 : {
11566 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
11567 0 : PyObject *bigendian_obj = NULL;
11568 0 : PyObject *ndr64_obj = NULL;
11569 0 : libndr_flags ndr_push_flags = 0;
11570 :
11571 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
11572 : discard_const_p(char *, kwnames),
11573 : &bigendian_obj,
11574 : &ndr64_obj)) {
11575 0 : return NULL;
11576 : }
11577 :
11578 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11579 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
11580 : }
11581 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11582 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
11583 : }
11584 :
11585 0 : return py_wbint_LookupRids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
11586 : }
11587 :
11588 0 : static PyObject *py_wbint_LookupRids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
11589 : {
11590 0 : const struct ndr_interface_call *call = NULL;
11591 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(py_obj);
11592 0 : struct ndr_pull *pull = NULL;
11593 0 : enum ndr_err_code err;
11594 :
11595 0 : if (ndr_table_winbind.num_calls < 18) {
11596 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_unpack");
11597 0 : return NULL;
11598 : }
11599 0 : call = &ndr_table_winbind.calls[17];
11600 :
11601 0 : pull = ndr_pull_init_blob(blob, object);
11602 0 : if (pull == NULL) {
11603 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11604 0 : return NULL;
11605 : }
11606 :
11607 0 : pull->flags |= ndr_pull_flags;
11608 :
11609 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
11610 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11611 0 : TALLOC_FREE(pull);
11612 0 : PyErr_SetNdrError(err);
11613 0 : return NULL;
11614 : }
11615 0 : if (!allow_remaining) {
11616 0 : uint32_t highest_ofs;
11617 :
11618 0 : if (pull->offset > pull->relative_highest_offset) {
11619 0 : highest_ofs = pull->offset;
11620 : } else {
11621 0 : highest_ofs = pull->relative_highest_offset;
11622 : }
11623 0 : if (highest_ofs < pull->data_size) {
11624 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
11625 : "not all bytes consumed ofs[%u] size[%u]",
11626 : highest_ofs, pull->data_size);
11627 0 : TALLOC_FREE(pull);
11628 0 : PyErr_SetNdrError(err);
11629 0 : return NULL;
11630 : }
11631 : }
11632 :
11633 0 : TALLOC_FREE(pull);
11634 0 : Py_RETURN_NONE;
11635 : }
11636 :
11637 0 : static PyObject *py_wbint_LookupRids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11638 : {
11639 0 : DATA_BLOB blob;
11640 0 : Py_ssize_t blob_length = 0;
11641 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
11642 0 : PyObject *bigendian_obj = NULL;
11643 0 : PyObject *ndr64_obj = NULL;
11644 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
11645 0 : PyObject *allow_remaining_obj = NULL;
11646 0 : bool allow_remaining = false;
11647 :
11648 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
11649 : discard_const_p(char *, kwnames),
11650 : &blob.data, &blob_length,
11651 : &bigendian_obj,
11652 : &ndr64_obj,
11653 : &allow_remaining_obj)) {
11654 0 : return NULL;
11655 : }
11656 0 : blob.length = blob_length;
11657 :
11658 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11659 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
11660 : }
11661 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11662 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
11663 : }
11664 :
11665 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11666 0 : allow_remaining = true;
11667 : }
11668 :
11669 0 : return py_wbint_LookupRids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
11670 : }
11671 :
11672 0 : static PyObject *py_wbint_LookupRids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11673 : {
11674 0 : DATA_BLOB blob;
11675 0 : Py_ssize_t blob_length = 0;
11676 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
11677 0 : PyObject *bigendian_obj = NULL;
11678 0 : PyObject *ndr64_obj = NULL;
11679 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
11680 0 : PyObject *allow_remaining_obj = NULL;
11681 0 : bool allow_remaining = false;
11682 :
11683 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
11684 : discard_const_p(char *, kwnames),
11685 : &blob.data, &blob_length,
11686 : &bigendian_obj,
11687 : &ndr64_obj,
11688 : &allow_remaining_obj)) {
11689 0 : return NULL;
11690 : }
11691 0 : blob.length = blob_length;
11692 :
11693 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11694 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
11695 : }
11696 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11697 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
11698 : }
11699 :
11700 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11701 0 : allow_remaining = true;
11702 : }
11703 :
11704 0 : return py_wbint_LookupRids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
11705 : }
11706 :
11707 0 : static PyObject *py_wbint_LookupRids_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
11708 : {
11709 0 : const struct ndr_interface_call *call = NULL;
11710 0 : struct wbint_LookupRids *object = pytalloc_get_ptr(py_obj);
11711 0 : PyObject *ret;
11712 0 : char *retstr;
11713 :
11714 0 : if (ndr_table_winbind.num_calls < 18) {
11715 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_LookupRids_ndr_print");
11716 0 : return NULL;
11717 : }
11718 0 : call = &ndr_table_winbind.calls[17];
11719 :
11720 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
11721 0 : ret = PyUnicode_FromString(retstr);
11722 0 : TALLOC_FREE(retstr);
11723 :
11724 0 : return ret;
11725 : }
11726 :
11727 0 : static PyObject *py_wbint_LookupRids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11728 : {
11729 0 : return py_wbint_LookupRids_ndr_print(py_obj, "wbint_LookupRids_in", NDR_IN);
11730 : }
11731 :
11732 0 : static PyObject *py_wbint_LookupRids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11733 : {
11734 0 : return py_wbint_LookupRids_ndr_print(py_obj, "wbint_LookupRids_out", NDR_OUT);
11735 : }
11736 :
11737 : static PyMethodDef py_wbint_LookupRids_methods[] = {
11738 : { "opnum", (PyCFunction)py_wbint_LookupRids_ndr_opnum, METH_NOARGS|METH_CLASS,
11739 : "winbind.wbint_LookupRids.opnum() -> 17 (0x11) " },
11740 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
11741 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
11742 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
11743 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
11744 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
11745 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
11746 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_LookupRids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
11747 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
11748 : { "__ndr_print_in__", (PyCFunction)py_wbint_LookupRids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
11749 : { "__ndr_print_out__", (PyCFunction)py_wbint_LookupRids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
11750 : { NULL, NULL, 0, NULL }
11751 : };
11752 :
11753 :
11754 : static PyTypeObject wbint_LookupRids_Type = {
11755 : PyVarObject_HEAD_INIT(NULL, 0)
11756 : .tp_name = "winbind.wbint_LookupRids",
11757 : .tp_getset = py_wbint_LookupRids_getsetters,
11758 : .tp_methods = py_wbint_LookupRids_methods,
11759 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11760 : .tp_new = py_wbint_LookupRids_new,
11761 : };
11762 :
11763 0 : static bool pack_py_wbint_LookupRids_args_in(PyObject *args, PyObject *kwargs, struct wbint_LookupRids *r)
11764 : {
11765 0 : PyObject *py_domain_sid;
11766 0 : PyObject *py_rids;
11767 0 : const char *kwnames[] = {
11768 : "domain_sid", "rids", NULL
11769 : };
11770 :
11771 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_LookupRids", discard_const_p(char *, kwnames), &py_domain_sid, &py_rids)) {
11772 0 : return false;
11773 : }
11774 :
11775 0 : if (py_domain_sid == NULL) {
11776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain_sid");
11777 0 : return false;
11778 : }
11779 0 : r->in.domain_sid = talloc_ptrtype(r, r->in.domain_sid);
11780 0 : if (r->in.domain_sid == NULL) {
11781 0 : PyErr_NoMemory();
11782 0 : return false;
11783 : }
11784 0 : PY_CHECK_TYPE(dom_sid_Type, py_domain_sid, return false;);
11785 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_sid)) == NULL) {
11786 0 : PyErr_NoMemory();
11787 0 : return false;
11788 : }
11789 0 : r->in.domain_sid = (struct dom_sid *)pytalloc_get_ptr(py_domain_sid);
11790 0 : if (py_rids == NULL) {
11791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.rids");
11792 0 : return false;
11793 : }
11794 0 : r->in.rids = talloc_ptrtype(r, r->in.rids);
11795 0 : if (r->in.rids == NULL) {
11796 0 : PyErr_NoMemory();
11797 0 : return false;
11798 : }
11799 0 : PY_CHECK_TYPE(&wbint_RidArray_Type, py_rids, return false;);
11800 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_rids)) == NULL) {
11801 0 : PyErr_NoMemory();
11802 0 : return false;
11803 : }
11804 0 : r->in.rids = (struct wbint_RidArray *)pytalloc_get_ptr(py_rids);
11805 0 : return true;
11806 : }
11807 :
11808 0 : static PyObject *unpack_py_wbint_LookupRids_args_out(struct wbint_LookupRids *r)
11809 : {
11810 0 : PyObject *result;
11811 0 : PyObject *py_domain_name;
11812 0 : PyObject *py_names;
11813 0 : result = PyTuple_New(2);
11814 0 : if (*r->out.domain_name == NULL) {
11815 0 : py_domain_name = Py_None;
11816 0 : Py_INCREF(py_domain_name);
11817 : } else {
11818 0 : if (*r->out.domain_name == NULL) {
11819 0 : py_domain_name = Py_None;
11820 0 : Py_INCREF(py_domain_name);
11821 : } else {
11822 0 : py_domain_name = PyUnicode_Decode(*r->out.domain_name, strlen(*r->out.domain_name), "utf-8", "ignore");
11823 : }
11824 : }
11825 0 : PyTuple_SetItem(result, 0, py_domain_name);
11826 0 : py_names = pytalloc_reference_ex(&wbint_Principals_Type, r->out.names, r->out.names);
11827 0 : PyTuple_SetItem(result, 1, py_names);
11828 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
11829 0 : PyErr_SetNTSTATUS(r->out.result);
11830 0 : return NULL;
11831 : }
11832 :
11833 0 : return result;
11834 : }
11835 :
11836 :
11837 0 : static PyObject *py_wbint_CheckMachineAccount_get_result(PyObject *obj, void *closure)
11838 : {
11839 0 : struct wbint_CheckMachineAccount *object = pytalloc_get_ptr(obj);
11840 0 : PyObject *py_result;
11841 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
11842 0 : return py_result;
11843 : }
11844 :
11845 0 : static int py_wbint_CheckMachineAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
11846 : {
11847 0 : struct wbint_CheckMachineAccount *object = pytalloc_get_ptr(py_obj);
11848 0 : if (value == NULL) {
11849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
11850 0 : return -1;
11851 : }
11852 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
11853 0 : return 0;
11854 : }
11855 :
11856 : static PyGetSetDef py_wbint_CheckMachineAccount_getsetters[] = {
11857 : {
11858 : .name = discard_const_p(char, "result"),
11859 : .get = py_wbint_CheckMachineAccount_get_result,
11860 : .set = py_wbint_CheckMachineAccount_set_result,
11861 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
11862 : },
11863 : { .name = NULL }
11864 : };
11865 :
11866 0 : static PyObject *py_wbint_CheckMachineAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11867 : {
11868 0 : PyObject *self = pytalloc_new(struct wbint_CheckMachineAccount, type);
11869 0 : return self;
11870 : }
11871 :
11872 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
11873 : {
11874 :
11875 :
11876 0 : return PyLong_FromLong(18);
11877 : }
11878 :
11879 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
11880 : {
11881 0 : const struct ndr_interface_call *call = NULL;
11882 0 : struct wbint_CheckMachineAccount *object = pytalloc_get_ptr(py_obj);
11883 0 : PyObject *ret = NULL;
11884 0 : struct ndr_push *push = NULL;
11885 0 : DATA_BLOB blob;
11886 0 : enum ndr_err_code err;
11887 :
11888 0 : if (ndr_table_winbind.num_calls < 19) {
11889 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_pack");
11890 0 : return NULL;
11891 : }
11892 0 : call = &ndr_table_winbind.calls[18];
11893 :
11894 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
11895 0 : if (push == NULL) {
11896 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11897 0 : return NULL;
11898 : }
11899 :
11900 0 : push->flags |= ndr_push_flags;
11901 :
11902 0 : err = call->ndr_push(push, ndr_inout_flags, object);
11903 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11904 0 : TALLOC_FREE(push);
11905 0 : PyErr_SetNdrError(err);
11906 0 : return NULL;
11907 : }
11908 0 : blob = ndr_push_blob(push);
11909 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11910 0 : TALLOC_FREE(push);
11911 0 : return ret;
11912 : }
11913 :
11914 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11915 : {
11916 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
11917 0 : PyObject *bigendian_obj = NULL;
11918 0 : PyObject *ndr64_obj = NULL;
11919 0 : libndr_flags ndr_push_flags = 0;
11920 :
11921 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
11922 : discard_const_p(char *, kwnames),
11923 : &bigendian_obj,
11924 : &ndr64_obj)) {
11925 0 : return NULL;
11926 : }
11927 :
11928 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11929 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
11930 : }
11931 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11932 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
11933 : }
11934 :
11935 0 : return py_wbint_CheckMachineAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
11936 : }
11937 :
11938 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11939 : {
11940 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
11941 0 : PyObject *bigendian_obj = NULL;
11942 0 : PyObject *ndr64_obj = NULL;
11943 0 : libndr_flags ndr_push_flags = 0;
11944 :
11945 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
11946 : discard_const_p(char *, kwnames),
11947 : &bigendian_obj,
11948 : &ndr64_obj)) {
11949 0 : return NULL;
11950 : }
11951 :
11952 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
11953 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
11954 : }
11955 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
11956 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
11957 : }
11958 :
11959 0 : return py_wbint_CheckMachineAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
11960 : }
11961 :
11962 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
11963 : {
11964 0 : const struct ndr_interface_call *call = NULL;
11965 0 : struct wbint_CheckMachineAccount *object = pytalloc_get_ptr(py_obj);
11966 0 : struct ndr_pull *pull = NULL;
11967 0 : enum ndr_err_code err;
11968 :
11969 0 : if (ndr_table_winbind.num_calls < 19) {
11970 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_unpack");
11971 0 : return NULL;
11972 : }
11973 0 : call = &ndr_table_winbind.calls[18];
11974 :
11975 0 : pull = ndr_pull_init_blob(blob, object);
11976 0 : if (pull == NULL) {
11977 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11978 0 : return NULL;
11979 : }
11980 :
11981 0 : pull->flags |= ndr_pull_flags;
11982 :
11983 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
11984 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11985 0 : TALLOC_FREE(pull);
11986 0 : PyErr_SetNdrError(err);
11987 0 : return NULL;
11988 : }
11989 0 : if (!allow_remaining) {
11990 0 : uint32_t highest_ofs;
11991 :
11992 0 : if (pull->offset > pull->relative_highest_offset) {
11993 0 : highest_ofs = pull->offset;
11994 : } else {
11995 0 : highest_ofs = pull->relative_highest_offset;
11996 : }
11997 0 : if (highest_ofs < pull->data_size) {
11998 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
11999 : "not all bytes consumed ofs[%u] size[%u]",
12000 : highest_ofs, pull->data_size);
12001 0 : TALLOC_FREE(pull);
12002 0 : PyErr_SetNdrError(err);
12003 0 : return NULL;
12004 : }
12005 : }
12006 :
12007 0 : TALLOC_FREE(pull);
12008 0 : Py_RETURN_NONE;
12009 : }
12010 :
12011 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12012 : {
12013 0 : DATA_BLOB blob;
12014 0 : Py_ssize_t blob_length = 0;
12015 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12016 0 : PyObject *bigendian_obj = NULL;
12017 0 : PyObject *ndr64_obj = NULL;
12018 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12019 0 : PyObject *allow_remaining_obj = NULL;
12020 0 : bool allow_remaining = false;
12021 :
12022 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
12023 : discard_const_p(char *, kwnames),
12024 : &blob.data, &blob_length,
12025 : &bigendian_obj,
12026 : &ndr64_obj,
12027 : &allow_remaining_obj)) {
12028 0 : return NULL;
12029 : }
12030 0 : blob.length = blob_length;
12031 :
12032 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12033 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12034 : }
12035 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12036 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12037 : }
12038 :
12039 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12040 0 : allow_remaining = true;
12041 : }
12042 :
12043 0 : return py_wbint_CheckMachineAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
12044 : }
12045 :
12046 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12047 : {
12048 0 : DATA_BLOB blob;
12049 0 : Py_ssize_t blob_length = 0;
12050 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12051 0 : PyObject *bigendian_obj = NULL;
12052 0 : PyObject *ndr64_obj = NULL;
12053 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12054 0 : PyObject *allow_remaining_obj = NULL;
12055 0 : bool allow_remaining = false;
12056 :
12057 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
12058 : discard_const_p(char *, kwnames),
12059 : &blob.data, &blob_length,
12060 : &bigendian_obj,
12061 : &ndr64_obj,
12062 : &allow_remaining_obj)) {
12063 0 : return NULL;
12064 : }
12065 0 : blob.length = blob_length;
12066 :
12067 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12068 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12069 : }
12070 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12071 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12072 : }
12073 :
12074 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12075 0 : allow_remaining = true;
12076 : }
12077 :
12078 0 : return py_wbint_CheckMachineAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12079 : }
12080 :
12081 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
12082 : {
12083 0 : const struct ndr_interface_call *call = NULL;
12084 0 : struct wbint_CheckMachineAccount *object = pytalloc_get_ptr(py_obj);
12085 0 : PyObject *ret;
12086 0 : char *retstr;
12087 :
12088 0 : if (ndr_table_winbind.num_calls < 19) {
12089 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_CheckMachineAccount_ndr_print");
12090 0 : return NULL;
12091 : }
12092 0 : call = &ndr_table_winbind.calls[18];
12093 :
12094 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12095 0 : ret = PyUnicode_FromString(retstr);
12096 0 : TALLOC_FREE(retstr);
12097 :
12098 0 : return ret;
12099 : }
12100 :
12101 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12102 : {
12103 0 : return py_wbint_CheckMachineAccount_ndr_print(py_obj, "wbint_CheckMachineAccount_in", NDR_IN);
12104 : }
12105 :
12106 0 : static PyObject *py_wbint_CheckMachineAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12107 : {
12108 0 : return py_wbint_CheckMachineAccount_ndr_print(py_obj, "wbint_CheckMachineAccount_out", NDR_OUT);
12109 : }
12110 :
12111 : static PyMethodDef py_wbint_CheckMachineAccount_methods[] = {
12112 : { "opnum", (PyCFunction)py_wbint_CheckMachineAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
12113 : "winbind.wbint_CheckMachineAccount.opnum() -> 18 (0x12) " },
12114 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12115 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12116 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12117 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12118 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12119 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12120 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_CheckMachineAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12121 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12122 : { "__ndr_print_in__", (PyCFunction)py_wbint_CheckMachineAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12123 : { "__ndr_print_out__", (PyCFunction)py_wbint_CheckMachineAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12124 : { NULL, NULL, 0, NULL }
12125 : };
12126 :
12127 :
12128 : static PyTypeObject wbint_CheckMachineAccount_Type = {
12129 : PyVarObject_HEAD_INIT(NULL, 0)
12130 : .tp_name = "winbind.wbint_CheckMachineAccount",
12131 : .tp_getset = py_wbint_CheckMachineAccount_getsetters,
12132 : .tp_methods = py_wbint_CheckMachineAccount_methods,
12133 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12134 : .tp_new = py_wbint_CheckMachineAccount_new,
12135 : };
12136 :
12137 0 : static bool pack_py_wbint_CheckMachineAccount_args_in(PyObject *args, PyObject *kwargs, struct wbint_CheckMachineAccount *r)
12138 : {
12139 0 : const char *kwnames[] = {
12140 : NULL
12141 : };
12142 :
12143 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_CheckMachineAccount", discard_const_p(char *, kwnames))) {
12144 0 : return false;
12145 : }
12146 :
12147 0 : return true;
12148 : }
12149 :
12150 0 : static PyObject *unpack_py_wbint_CheckMachineAccount_args_out(struct wbint_CheckMachineAccount *r)
12151 : {
12152 0 : PyObject *result;
12153 0 : result = Py_None;
12154 0 : Py_INCREF(result);
12155 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
12156 0 : PyErr_SetNTSTATUS(r->out.result);
12157 0 : return NULL;
12158 : }
12159 :
12160 0 : return result;
12161 : }
12162 :
12163 :
12164 0 : static PyObject *py_wbint_ChangeMachineAccount_in_get_dcname(PyObject *obj, void *closure)
12165 : {
12166 0 : struct wbint_ChangeMachineAccount *object = pytalloc_get_ptr(obj);
12167 0 : PyObject *py_dcname;
12168 0 : if (object->in.dcname == NULL) {
12169 0 : Py_RETURN_NONE;
12170 : }
12171 0 : if (object->in.dcname == NULL) {
12172 0 : py_dcname = Py_None;
12173 0 : Py_INCREF(py_dcname);
12174 : } else {
12175 0 : if (object->in.dcname == NULL) {
12176 0 : py_dcname = Py_None;
12177 0 : Py_INCREF(py_dcname);
12178 : } else {
12179 0 : py_dcname = PyUnicode_Decode(object->in.dcname, strlen(object->in.dcname), "utf-8", "ignore");
12180 : }
12181 : }
12182 0 : return py_dcname;
12183 : }
12184 :
12185 0 : static int py_wbint_ChangeMachineAccount_in_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
12186 : {
12187 0 : struct wbint_ChangeMachineAccount *object = pytalloc_get_ptr(py_obj);
12188 0 : if (value == NULL) {
12189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dcname");
12190 0 : return -1;
12191 : }
12192 0 : if (value == Py_None) {
12193 0 : object->in.dcname = NULL;
12194 : } else {
12195 0 : object->in.dcname = NULL;
12196 : {
12197 0 : const char *test_str;
12198 0 : const char *talloc_str;
12199 0 : PyObject *unicode = NULL;
12200 0 : if (PyUnicode_Check(value)) {
12201 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12202 0 : if (unicode == NULL) {
12203 0 : return -1;
12204 : }
12205 0 : test_str = PyBytes_AS_STRING(unicode);
12206 0 : } else if (PyBytes_Check(value)) {
12207 0 : test_str = PyBytes_AS_STRING(value);
12208 : } else {
12209 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12210 0 : return -1;
12211 : }
12212 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12213 0 : if (unicode != NULL) {
12214 0 : Py_DECREF(unicode);
12215 : }
12216 0 : if (talloc_str == NULL) {
12217 0 : PyErr_NoMemory();
12218 0 : return -1;
12219 : }
12220 0 : object->in.dcname = talloc_str;
12221 : }
12222 : }
12223 0 : return 0;
12224 : }
12225 :
12226 0 : static PyObject *py_wbint_ChangeMachineAccount_get_result(PyObject *obj, void *closure)
12227 : {
12228 0 : struct wbint_ChangeMachineAccount *object = pytalloc_get_ptr(obj);
12229 0 : PyObject *py_result;
12230 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
12231 0 : return py_result;
12232 : }
12233 :
12234 0 : static int py_wbint_ChangeMachineAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
12235 : {
12236 0 : struct wbint_ChangeMachineAccount *object = pytalloc_get_ptr(py_obj);
12237 0 : if (value == NULL) {
12238 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
12239 0 : return -1;
12240 : }
12241 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
12242 0 : return 0;
12243 : }
12244 :
12245 : static PyGetSetDef py_wbint_ChangeMachineAccount_getsetters[] = {
12246 : {
12247 : .name = discard_const_p(char, "in_dcname"),
12248 : .get = py_wbint_ChangeMachineAccount_in_get_dcname,
12249 : .set = py_wbint_ChangeMachineAccount_in_set_dcname,
12250 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12251 : },
12252 : {
12253 : .name = discard_const_p(char, "result"),
12254 : .get = py_wbint_ChangeMachineAccount_get_result,
12255 : .set = py_wbint_ChangeMachineAccount_set_result,
12256 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
12257 : },
12258 : { .name = NULL }
12259 : };
12260 :
12261 0 : static PyObject *py_wbint_ChangeMachineAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12262 : {
12263 0 : PyObject *self = pytalloc_new(struct wbint_ChangeMachineAccount, type);
12264 0 : return self;
12265 : }
12266 :
12267 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12268 : {
12269 :
12270 :
12271 0 : return PyLong_FromLong(19);
12272 : }
12273 :
12274 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
12275 : {
12276 0 : const struct ndr_interface_call *call = NULL;
12277 0 : struct wbint_ChangeMachineAccount *object = pytalloc_get_ptr(py_obj);
12278 0 : PyObject *ret = NULL;
12279 0 : struct ndr_push *push = NULL;
12280 0 : DATA_BLOB blob;
12281 0 : enum ndr_err_code err;
12282 :
12283 0 : if (ndr_table_winbind.num_calls < 20) {
12284 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_pack");
12285 0 : return NULL;
12286 : }
12287 0 : call = &ndr_table_winbind.calls[19];
12288 :
12289 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12290 0 : if (push == NULL) {
12291 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12292 0 : return NULL;
12293 : }
12294 :
12295 0 : push->flags |= ndr_push_flags;
12296 :
12297 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12298 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12299 0 : TALLOC_FREE(push);
12300 0 : PyErr_SetNdrError(err);
12301 0 : return NULL;
12302 : }
12303 0 : blob = ndr_push_blob(push);
12304 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12305 0 : TALLOC_FREE(push);
12306 0 : return ret;
12307 : }
12308 :
12309 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12310 : {
12311 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12312 0 : PyObject *bigendian_obj = NULL;
12313 0 : PyObject *ndr64_obj = NULL;
12314 0 : libndr_flags ndr_push_flags = 0;
12315 :
12316 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
12317 : discard_const_p(char *, kwnames),
12318 : &bigendian_obj,
12319 : &ndr64_obj)) {
12320 0 : return NULL;
12321 : }
12322 :
12323 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12324 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12325 : }
12326 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12327 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12328 : }
12329 :
12330 0 : return py_wbint_ChangeMachineAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
12331 : }
12332 :
12333 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12334 : {
12335 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12336 0 : PyObject *bigendian_obj = NULL;
12337 0 : PyObject *ndr64_obj = NULL;
12338 0 : libndr_flags ndr_push_flags = 0;
12339 :
12340 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
12341 : discard_const_p(char *, kwnames),
12342 : &bigendian_obj,
12343 : &ndr64_obj)) {
12344 0 : return NULL;
12345 : }
12346 :
12347 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12348 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12349 : }
12350 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12351 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12352 : }
12353 :
12354 0 : return py_wbint_ChangeMachineAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
12355 : }
12356 :
12357 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
12358 : {
12359 0 : const struct ndr_interface_call *call = NULL;
12360 0 : struct wbint_ChangeMachineAccount *object = pytalloc_get_ptr(py_obj);
12361 0 : struct ndr_pull *pull = NULL;
12362 0 : enum ndr_err_code err;
12363 :
12364 0 : if (ndr_table_winbind.num_calls < 20) {
12365 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_unpack");
12366 0 : return NULL;
12367 : }
12368 0 : call = &ndr_table_winbind.calls[19];
12369 :
12370 0 : pull = ndr_pull_init_blob(blob, object);
12371 0 : if (pull == NULL) {
12372 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12373 0 : return NULL;
12374 : }
12375 :
12376 0 : pull->flags |= ndr_pull_flags;
12377 :
12378 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
12379 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12380 0 : TALLOC_FREE(pull);
12381 0 : PyErr_SetNdrError(err);
12382 0 : return NULL;
12383 : }
12384 0 : if (!allow_remaining) {
12385 0 : uint32_t highest_ofs;
12386 :
12387 0 : if (pull->offset > pull->relative_highest_offset) {
12388 0 : highest_ofs = pull->offset;
12389 : } else {
12390 0 : highest_ofs = pull->relative_highest_offset;
12391 : }
12392 0 : if (highest_ofs < pull->data_size) {
12393 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
12394 : "not all bytes consumed ofs[%u] size[%u]",
12395 : highest_ofs, pull->data_size);
12396 0 : TALLOC_FREE(pull);
12397 0 : PyErr_SetNdrError(err);
12398 0 : return NULL;
12399 : }
12400 : }
12401 :
12402 0 : TALLOC_FREE(pull);
12403 0 : Py_RETURN_NONE;
12404 : }
12405 :
12406 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12407 : {
12408 0 : DATA_BLOB blob;
12409 0 : Py_ssize_t blob_length = 0;
12410 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12411 0 : PyObject *bigendian_obj = NULL;
12412 0 : PyObject *ndr64_obj = NULL;
12413 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12414 0 : PyObject *allow_remaining_obj = NULL;
12415 0 : bool allow_remaining = false;
12416 :
12417 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
12418 : discard_const_p(char *, kwnames),
12419 : &blob.data, &blob_length,
12420 : &bigendian_obj,
12421 : &ndr64_obj,
12422 : &allow_remaining_obj)) {
12423 0 : return NULL;
12424 : }
12425 0 : blob.length = blob_length;
12426 :
12427 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12428 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12429 : }
12430 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12431 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12432 : }
12433 :
12434 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12435 0 : allow_remaining = true;
12436 : }
12437 :
12438 0 : return py_wbint_ChangeMachineAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
12439 : }
12440 :
12441 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12442 : {
12443 0 : DATA_BLOB blob;
12444 0 : Py_ssize_t blob_length = 0;
12445 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12446 0 : PyObject *bigendian_obj = NULL;
12447 0 : PyObject *ndr64_obj = NULL;
12448 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12449 0 : PyObject *allow_remaining_obj = NULL;
12450 0 : bool allow_remaining = false;
12451 :
12452 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
12453 : discard_const_p(char *, kwnames),
12454 : &blob.data, &blob_length,
12455 : &bigendian_obj,
12456 : &ndr64_obj,
12457 : &allow_remaining_obj)) {
12458 0 : return NULL;
12459 : }
12460 0 : blob.length = blob_length;
12461 :
12462 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12463 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12464 : }
12465 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12466 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12467 : }
12468 :
12469 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12470 0 : allow_remaining = true;
12471 : }
12472 :
12473 0 : return py_wbint_ChangeMachineAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12474 : }
12475 :
12476 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
12477 : {
12478 0 : const struct ndr_interface_call *call = NULL;
12479 0 : struct wbint_ChangeMachineAccount *object = pytalloc_get_ptr(py_obj);
12480 0 : PyObject *ret;
12481 0 : char *retstr;
12482 :
12483 0 : if (ndr_table_winbind.num_calls < 20) {
12484 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ChangeMachineAccount_ndr_print");
12485 0 : return NULL;
12486 : }
12487 0 : call = &ndr_table_winbind.calls[19];
12488 :
12489 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12490 0 : ret = PyUnicode_FromString(retstr);
12491 0 : TALLOC_FREE(retstr);
12492 :
12493 0 : return ret;
12494 : }
12495 :
12496 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12497 : {
12498 0 : return py_wbint_ChangeMachineAccount_ndr_print(py_obj, "wbint_ChangeMachineAccount_in", NDR_IN);
12499 : }
12500 :
12501 0 : static PyObject *py_wbint_ChangeMachineAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12502 : {
12503 0 : return py_wbint_ChangeMachineAccount_ndr_print(py_obj, "wbint_ChangeMachineAccount_out", NDR_OUT);
12504 : }
12505 :
12506 : static PyMethodDef py_wbint_ChangeMachineAccount_methods[] = {
12507 : { "opnum", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
12508 : "winbind.wbint_ChangeMachineAccount.opnum() -> 19 (0x13) " },
12509 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12510 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12511 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12512 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12513 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12514 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12515 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ChangeMachineAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12516 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12517 : { "__ndr_print_in__", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12518 : { "__ndr_print_out__", (PyCFunction)py_wbint_ChangeMachineAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12519 : { NULL, NULL, 0, NULL }
12520 : };
12521 :
12522 :
12523 : static PyTypeObject wbint_ChangeMachineAccount_Type = {
12524 : PyVarObject_HEAD_INIT(NULL, 0)
12525 : .tp_name = "winbind.wbint_ChangeMachineAccount",
12526 : .tp_getset = py_wbint_ChangeMachineAccount_getsetters,
12527 : .tp_methods = py_wbint_ChangeMachineAccount_methods,
12528 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12529 : .tp_new = py_wbint_ChangeMachineAccount_new,
12530 : };
12531 :
12532 0 : static bool pack_py_wbint_ChangeMachineAccount_args_in(PyObject *args, PyObject *kwargs, struct wbint_ChangeMachineAccount *r)
12533 : {
12534 0 : PyObject *py_dcname;
12535 0 : const char *kwnames[] = {
12536 : "dcname", NULL
12537 : };
12538 :
12539 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_ChangeMachineAccount", discard_const_p(char *, kwnames), &py_dcname)) {
12540 0 : return false;
12541 : }
12542 :
12543 0 : if (py_dcname == NULL) {
12544 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dcname");
12545 0 : return false;
12546 : }
12547 0 : if (py_dcname == Py_None) {
12548 0 : r->in.dcname = NULL;
12549 : } else {
12550 0 : r->in.dcname = NULL;
12551 : {
12552 0 : const char *test_str;
12553 0 : const char *talloc_str;
12554 0 : PyObject *unicode = NULL;
12555 0 : if (PyUnicode_Check(py_dcname)) {
12556 0 : unicode = PyUnicode_AsEncodedString(py_dcname, "utf-8", "ignore");
12557 0 : if (unicode == NULL) {
12558 0 : return false;
12559 : }
12560 0 : test_str = PyBytes_AS_STRING(unicode);
12561 0 : } else if (PyBytes_Check(py_dcname)) {
12562 0 : test_str = PyBytes_AS_STRING(py_dcname);
12563 : } else {
12564 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dcname)->tp_name);
12565 0 : return false;
12566 : }
12567 0 : talloc_str = talloc_strdup(r, test_str);
12568 0 : if (unicode != NULL) {
12569 0 : Py_DECREF(unicode);
12570 : }
12571 0 : if (talloc_str == NULL) {
12572 0 : PyErr_NoMemory();
12573 0 : return false;
12574 : }
12575 0 : r->in.dcname = talloc_str;
12576 : }
12577 : }
12578 0 : return true;
12579 : }
12580 :
12581 0 : static PyObject *unpack_py_wbint_ChangeMachineAccount_args_out(struct wbint_ChangeMachineAccount *r)
12582 : {
12583 0 : PyObject *result;
12584 0 : result = Py_None;
12585 0 : Py_INCREF(result);
12586 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
12587 0 : PyErr_SetNTSTATUS(r->out.result);
12588 0 : return NULL;
12589 : }
12590 :
12591 0 : return result;
12592 : }
12593 :
12594 :
12595 0 : static PyObject *py_wbint_PingDc_out_get_dcname(PyObject *obj, void *closure)
12596 : {
12597 0 : struct wbint_PingDc *object = pytalloc_get_ptr(obj);
12598 0 : PyObject *py_dcname;
12599 0 : if (object->out.dcname == NULL) {
12600 0 : Py_RETURN_NONE;
12601 : }
12602 0 : if (*object->out.dcname == NULL) {
12603 0 : py_dcname = Py_None;
12604 0 : Py_INCREF(py_dcname);
12605 : } else {
12606 0 : if (*object->out.dcname == NULL) {
12607 0 : py_dcname = Py_None;
12608 0 : Py_INCREF(py_dcname);
12609 : } else {
12610 0 : py_dcname = PyUnicode_Decode(*object->out.dcname, strlen(*object->out.dcname), "utf-8", "ignore");
12611 : }
12612 : }
12613 0 : return py_dcname;
12614 : }
12615 :
12616 0 : static int py_wbint_PingDc_out_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
12617 : {
12618 0 : struct wbint_PingDc *object = pytalloc_get_ptr(py_obj);
12619 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dcname));
12620 0 : if (value == NULL) {
12621 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.dcname");
12622 0 : return -1;
12623 : }
12624 0 : object->out.dcname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dcname);
12625 0 : if (object->out.dcname == NULL) {
12626 0 : PyErr_NoMemory();
12627 0 : return -1;
12628 : }
12629 0 : if (value == Py_None) {
12630 0 : *object->out.dcname = NULL;
12631 : } else {
12632 0 : *object->out.dcname = NULL;
12633 : {
12634 0 : const char *test_str;
12635 0 : const char *talloc_str;
12636 0 : PyObject *unicode = NULL;
12637 0 : if (PyUnicode_Check(value)) {
12638 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
12639 0 : if (unicode == NULL) {
12640 0 : return -1;
12641 : }
12642 0 : test_str = PyBytes_AS_STRING(unicode);
12643 0 : } else if (PyBytes_Check(value)) {
12644 0 : test_str = PyBytes_AS_STRING(value);
12645 : } else {
12646 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
12647 0 : return -1;
12648 : }
12649 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
12650 0 : if (unicode != NULL) {
12651 0 : Py_DECREF(unicode);
12652 : }
12653 0 : if (talloc_str == NULL) {
12654 0 : PyErr_NoMemory();
12655 0 : return -1;
12656 : }
12657 0 : *object->out.dcname = talloc_str;
12658 : }
12659 : }
12660 0 : return 0;
12661 : }
12662 :
12663 0 : static PyObject *py_wbint_PingDc_get_result(PyObject *obj, void *closure)
12664 : {
12665 0 : struct wbint_PingDc *object = pytalloc_get_ptr(obj);
12666 0 : PyObject *py_result;
12667 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
12668 0 : return py_result;
12669 : }
12670 :
12671 0 : static int py_wbint_PingDc_set_result(PyObject *py_obj, PyObject *value, void *closure)
12672 : {
12673 0 : struct wbint_PingDc *object = pytalloc_get_ptr(py_obj);
12674 0 : if (value == NULL) {
12675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
12676 0 : return -1;
12677 : }
12678 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
12679 0 : return 0;
12680 : }
12681 :
12682 : static PyGetSetDef py_wbint_PingDc_getsetters[] = {
12683 : {
12684 : .name = discard_const_p(char, "out_dcname"),
12685 : .get = py_wbint_PingDc_out_get_dcname,
12686 : .set = py_wbint_PingDc_out_set_dcname,
12687 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12688 : },
12689 : {
12690 : .name = discard_const_p(char, "result"),
12691 : .get = py_wbint_PingDc_get_result,
12692 : .set = py_wbint_PingDc_set_result,
12693 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
12694 : },
12695 : { .name = NULL }
12696 : };
12697 :
12698 0 : static PyObject *py_wbint_PingDc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12699 : {
12700 0 : PyObject *self = pytalloc_new(struct wbint_PingDc, type);
12701 0 : return self;
12702 : }
12703 :
12704 0 : static PyObject *py_wbint_PingDc_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12705 : {
12706 :
12707 :
12708 0 : return PyLong_FromLong(20);
12709 : }
12710 :
12711 0 : static PyObject *py_wbint_PingDc_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
12712 : {
12713 0 : const struct ndr_interface_call *call = NULL;
12714 0 : struct wbint_PingDc *object = pytalloc_get_ptr(py_obj);
12715 0 : PyObject *ret = NULL;
12716 0 : struct ndr_push *push = NULL;
12717 0 : DATA_BLOB blob;
12718 0 : enum ndr_err_code err;
12719 :
12720 0 : if (ndr_table_winbind.num_calls < 21) {
12721 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_pack");
12722 0 : return NULL;
12723 : }
12724 0 : call = &ndr_table_winbind.calls[20];
12725 :
12726 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12727 0 : if (push == NULL) {
12728 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12729 0 : return NULL;
12730 : }
12731 :
12732 0 : push->flags |= ndr_push_flags;
12733 :
12734 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12735 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12736 0 : TALLOC_FREE(push);
12737 0 : PyErr_SetNdrError(err);
12738 0 : return NULL;
12739 : }
12740 0 : blob = ndr_push_blob(push);
12741 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12742 0 : TALLOC_FREE(push);
12743 0 : return ret;
12744 : }
12745 :
12746 0 : static PyObject *py_wbint_PingDc_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12747 : {
12748 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12749 0 : PyObject *bigendian_obj = NULL;
12750 0 : PyObject *ndr64_obj = NULL;
12751 0 : libndr_flags ndr_push_flags = 0;
12752 :
12753 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
12754 : discard_const_p(char *, kwnames),
12755 : &bigendian_obj,
12756 : &ndr64_obj)) {
12757 0 : return NULL;
12758 : }
12759 :
12760 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12761 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12762 : }
12763 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12764 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12765 : }
12766 :
12767 0 : return py_wbint_PingDc_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
12768 : }
12769 :
12770 0 : static PyObject *py_wbint_PingDc_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12771 : {
12772 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12773 0 : PyObject *bigendian_obj = NULL;
12774 0 : PyObject *ndr64_obj = NULL;
12775 0 : libndr_flags ndr_push_flags = 0;
12776 :
12777 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
12778 : discard_const_p(char *, kwnames),
12779 : &bigendian_obj,
12780 : &ndr64_obj)) {
12781 0 : return NULL;
12782 : }
12783 :
12784 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12785 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12786 : }
12787 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12788 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12789 : }
12790 :
12791 0 : return py_wbint_PingDc_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
12792 : }
12793 :
12794 0 : static PyObject *py_wbint_PingDc_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
12795 : {
12796 0 : const struct ndr_interface_call *call = NULL;
12797 0 : struct wbint_PingDc *object = pytalloc_get_ptr(py_obj);
12798 0 : struct ndr_pull *pull = NULL;
12799 0 : enum ndr_err_code err;
12800 :
12801 0 : if (ndr_table_winbind.num_calls < 21) {
12802 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_unpack");
12803 0 : return NULL;
12804 : }
12805 0 : call = &ndr_table_winbind.calls[20];
12806 :
12807 0 : pull = ndr_pull_init_blob(blob, object);
12808 0 : if (pull == NULL) {
12809 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12810 0 : return NULL;
12811 : }
12812 :
12813 0 : pull->flags |= ndr_pull_flags;
12814 :
12815 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
12816 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12817 0 : TALLOC_FREE(pull);
12818 0 : PyErr_SetNdrError(err);
12819 0 : return NULL;
12820 : }
12821 0 : if (!allow_remaining) {
12822 0 : uint32_t highest_ofs;
12823 :
12824 0 : if (pull->offset > pull->relative_highest_offset) {
12825 0 : highest_ofs = pull->offset;
12826 : } else {
12827 0 : highest_ofs = pull->relative_highest_offset;
12828 : }
12829 0 : if (highest_ofs < pull->data_size) {
12830 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
12831 : "not all bytes consumed ofs[%u] size[%u]",
12832 : highest_ofs, pull->data_size);
12833 0 : TALLOC_FREE(pull);
12834 0 : PyErr_SetNdrError(err);
12835 0 : return NULL;
12836 : }
12837 : }
12838 :
12839 0 : TALLOC_FREE(pull);
12840 0 : Py_RETURN_NONE;
12841 : }
12842 :
12843 0 : static PyObject *py_wbint_PingDc_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12844 : {
12845 0 : DATA_BLOB blob;
12846 0 : Py_ssize_t blob_length = 0;
12847 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12848 0 : PyObject *bigendian_obj = NULL;
12849 0 : PyObject *ndr64_obj = NULL;
12850 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12851 0 : PyObject *allow_remaining_obj = NULL;
12852 0 : bool allow_remaining = false;
12853 :
12854 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
12855 : discard_const_p(char *, kwnames),
12856 : &blob.data, &blob_length,
12857 : &bigendian_obj,
12858 : &ndr64_obj,
12859 : &allow_remaining_obj)) {
12860 0 : return NULL;
12861 : }
12862 0 : blob.length = blob_length;
12863 :
12864 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12865 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12866 : }
12867 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12868 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12869 : }
12870 :
12871 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12872 0 : allow_remaining = true;
12873 : }
12874 :
12875 0 : return py_wbint_PingDc_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
12876 : }
12877 :
12878 0 : static PyObject *py_wbint_PingDc_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12879 : {
12880 0 : DATA_BLOB blob;
12881 0 : Py_ssize_t blob_length = 0;
12882 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12883 0 : PyObject *bigendian_obj = NULL;
12884 0 : PyObject *ndr64_obj = NULL;
12885 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12886 0 : PyObject *allow_remaining_obj = NULL;
12887 0 : bool allow_remaining = false;
12888 :
12889 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
12890 : discard_const_p(char *, kwnames),
12891 : &blob.data, &blob_length,
12892 : &bigendian_obj,
12893 : &ndr64_obj,
12894 : &allow_remaining_obj)) {
12895 0 : return NULL;
12896 : }
12897 0 : blob.length = blob_length;
12898 :
12899 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12900 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12901 : }
12902 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12903 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12904 : }
12905 :
12906 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12907 0 : allow_remaining = true;
12908 : }
12909 :
12910 0 : return py_wbint_PingDc_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12911 : }
12912 :
12913 0 : static PyObject *py_wbint_PingDc_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
12914 : {
12915 0 : const struct ndr_interface_call *call = NULL;
12916 0 : struct wbint_PingDc *object = pytalloc_get_ptr(py_obj);
12917 0 : PyObject *ret;
12918 0 : char *retstr;
12919 :
12920 0 : if (ndr_table_winbind.num_calls < 21) {
12921 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PingDc_ndr_print");
12922 0 : return NULL;
12923 : }
12924 0 : call = &ndr_table_winbind.calls[20];
12925 :
12926 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12927 0 : ret = PyUnicode_FromString(retstr);
12928 0 : TALLOC_FREE(retstr);
12929 :
12930 0 : return ret;
12931 : }
12932 :
12933 0 : static PyObject *py_wbint_PingDc_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12934 : {
12935 0 : return py_wbint_PingDc_ndr_print(py_obj, "wbint_PingDc_in", NDR_IN);
12936 : }
12937 :
12938 0 : static PyObject *py_wbint_PingDc_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12939 : {
12940 0 : return py_wbint_PingDc_ndr_print(py_obj, "wbint_PingDc_out", NDR_OUT);
12941 : }
12942 :
12943 : static PyMethodDef py_wbint_PingDc_methods[] = {
12944 : { "opnum", (PyCFunction)py_wbint_PingDc_ndr_opnum, METH_NOARGS|METH_CLASS,
12945 : "winbind.wbint_PingDc.opnum() -> 20 (0x14) " },
12946 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12947 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12948 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12949 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12950 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12951 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12952 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PingDc_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12953 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12954 : { "__ndr_print_in__", (PyCFunction)py_wbint_PingDc_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12955 : { "__ndr_print_out__", (PyCFunction)py_wbint_PingDc_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12956 : { NULL, NULL, 0, NULL }
12957 : };
12958 :
12959 :
12960 : static PyTypeObject wbint_PingDc_Type = {
12961 : PyVarObject_HEAD_INIT(NULL, 0)
12962 : .tp_name = "winbind.wbint_PingDc",
12963 : .tp_getset = py_wbint_PingDc_getsetters,
12964 : .tp_methods = py_wbint_PingDc_methods,
12965 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12966 : .tp_new = py_wbint_PingDc_new,
12967 : };
12968 :
12969 0 : static bool pack_py_wbint_PingDc_args_in(PyObject *args, PyObject *kwargs, struct wbint_PingDc *r)
12970 : {
12971 0 : const char *kwnames[] = {
12972 : NULL
12973 : };
12974 :
12975 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":wbint_PingDc", discard_const_p(char *, kwnames))) {
12976 0 : return false;
12977 : }
12978 :
12979 0 : return true;
12980 : }
12981 :
12982 0 : static PyObject *unpack_py_wbint_PingDc_args_out(struct wbint_PingDc *r)
12983 : {
12984 0 : PyObject *result;
12985 0 : PyObject *py_dcname;
12986 0 : if (*r->out.dcname == NULL) {
12987 0 : py_dcname = Py_None;
12988 0 : Py_INCREF(py_dcname);
12989 : } else {
12990 0 : if (*r->out.dcname == NULL) {
12991 0 : py_dcname = Py_None;
12992 0 : Py_INCREF(py_dcname);
12993 : } else {
12994 0 : py_dcname = PyUnicode_Decode(*r->out.dcname, strlen(*r->out.dcname), "utf-8", "ignore");
12995 : }
12996 : }
12997 0 : result = py_dcname;
12998 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
12999 0 : PyErr_SetNTSTATUS(r->out.result);
13000 0 : return NULL;
13001 : }
13002 :
13003 0 : return result;
13004 : }
13005 :
13006 :
13007 0 : static PyObject *py_wbint_ListTrustedDomains_in_get_client_name(PyObject *obj, void *closure)
13008 : {
13009 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(obj);
13010 0 : PyObject *py_client_name;
13011 0 : if (object->in.client_name == NULL) {
13012 0 : Py_RETURN_NONE;
13013 : }
13014 0 : if (object->in.client_name == NULL) {
13015 0 : py_client_name = Py_None;
13016 0 : Py_INCREF(py_client_name);
13017 : } else {
13018 0 : py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
13019 : }
13020 0 : return py_client_name;
13021 : }
13022 :
13023 0 : static int py_wbint_ListTrustedDomains_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
13024 : {
13025 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(py_obj);
13026 0 : if (value == NULL) {
13027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_name");
13028 0 : return -1;
13029 : }
13030 0 : object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
13031 0 : if (object->in.client_name == NULL) {
13032 0 : PyErr_NoMemory();
13033 0 : return -1;
13034 : }
13035 : {
13036 0 : const char *test_str;
13037 0 : const char *talloc_str;
13038 0 : PyObject *unicode = NULL;
13039 0 : if (PyUnicode_Check(value)) {
13040 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13041 0 : if (unicode == NULL) {
13042 0 : return -1;
13043 : }
13044 0 : test_str = PyBytes_AS_STRING(unicode);
13045 0 : } else if (PyBytes_Check(value)) {
13046 0 : test_str = PyBytes_AS_STRING(value);
13047 : } else {
13048 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13049 0 : return -1;
13050 : }
13051 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13052 0 : if (unicode != NULL) {
13053 0 : Py_DECREF(unicode);
13054 : }
13055 0 : if (talloc_str == NULL) {
13056 0 : PyErr_NoMemory();
13057 0 : return -1;
13058 : }
13059 0 : object->in.client_name = talloc_str;
13060 : }
13061 0 : return 0;
13062 : }
13063 :
13064 0 : static PyObject *py_wbint_ListTrustedDomains_in_get_client_pid(PyObject *obj, void *closure)
13065 : {
13066 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(obj);
13067 0 : PyObject *py_client_pid;
13068 0 : py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
13069 0 : return py_client_pid;
13070 : }
13071 :
13072 0 : static int py_wbint_ListTrustedDomains_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
13073 : {
13074 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(py_obj);
13075 0 : if (value == NULL) {
13076 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_pid");
13077 0 : return -1;
13078 : }
13079 : {
13080 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
13081 0 : if (PyLong_Check(value)) {
13082 0 : unsigned long long test_var;
13083 0 : test_var = PyLong_AsUnsignedLongLong(value);
13084 0 : if (PyErr_Occurred() != NULL) {
13085 0 : return -1;
13086 : }
13087 0 : if (test_var > uint_max) {
13088 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13089 : PyLong_Type.tp_name, uint_max, test_var);
13090 0 : return -1;
13091 : }
13092 0 : object->in.client_pid = test_var;
13093 : } else {
13094 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13095 : PyLong_Type.tp_name);
13096 0 : return -1;
13097 : }
13098 : }
13099 0 : return 0;
13100 : }
13101 :
13102 0 : static PyObject *py_wbint_ListTrustedDomains_out_get_domains(PyObject *obj, void *closure)
13103 : {
13104 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(obj);
13105 0 : PyObject *py_domains;
13106 0 : if (object->out.domains == NULL) {
13107 0 : Py_RETURN_NONE;
13108 : }
13109 0 : py_domains = pytalloc_reference_ex(netr_DomainTrustList_Type, object->out.domains, object->out.domains);
13110 0 : return py_domains;
13111 : }
13112 :
13113 0 : static int py_wbint_ListTrustedDomains_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
13114 : {
13115 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(py_obj);
13116 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
13117 0 : if (value == NULL) {
13118 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
13119 0 : return -1;
13120 : }
13121 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
13122 0 : if (object->out.domains == NULL) {
13123 0 : PyErr_NoMemory();
13124 0 : return -1;
13125 : }
13126 0 : PY_CHECK_TYPE(netr_DomainTrustList_Type, value, return -1;);
13127 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13128 0 : PyErr_NoMemory();
13129 0 : return -1;
13130 : }
13131 0 : object->out.domains = (struct netr_DomainTrustList *)pytalloc_get_ptr(value);
13132 0 : return 0;
13133 : }
13134 :
13135 0 : static PyObject *py_wbint_ListTrustedDomains_get_result(PyObject *obj, void *closure)
13136 : {
13137 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(obj);
13138 0 : PyObject *py_result;
13139 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13140 0 : return py_result;
13141 : }
13142 :
13143 0 : static int py_wbint_ListTrustedDomains_set_result(PyObject *py_obj, PyObject *value, void *closure)
13144 : {
13145 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(py_obj);
13146 0 : if (value == NULL) {
13147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
13148 0 : return -1;
13149 : }
13150 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13151 0 : return 0;
13152 : }
13153 :
13154 : static PyGetSetDef py_wbint_ListTrustedDomains_getsetters[] = {
13155 : {
13156 : .name = discard_const_p(char, "in_client_name"),
13157 : .get = py_wbint_ListTrustedDomains_in_get_client_name,
13158 : .set = py_wbint_ListTrustedDomains_in_set_client_name,
13159 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13160 : },
13161 : {
13162 : .name = discard_const_p(char, "in_client_pid"),
13163 : .get = py_wbint_ListTrustedDomains_in_get_client_pid,
13164 : .set = py_wbint_ListTrustedDomains_in_set_client_pid,
13165 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
13166 : },
13167 : {
13168 : .name = discard_const_p(char, "out_domains"),
13169 : .get = py_wbint_ListTrustedDomains_out_get_domains,
13170 : .set = py_wbint_ListTrustedDomains_out_set_domains,
13171 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_DomainTrustList")
13172 : },
13173 : {
13174 : .name = discard_const_p(char, "result"),
13175 : .get = py_wbint_ListTrustedDomains_get_result,
13176 : .set = py_wbint_ListTrustedDomains_set_result,
13177 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13178 : },
13179 : { .name = NULL }
13180 : };
13181 :
13182 0 : static PyObject *py_wbint_ListTrustedDomains_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13183 : {
13184 0 : PyObject *self = pytalloc_new(struct wbint_ListTrustedDomains, type);
13185 0 : struct wbint_ListTrustedDomains *_self = (struct wbint_ListTrustedDomains *)pytalloc_get_ptr(self);
13186 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13187 0 : _self->out.domains = talloc_zero(mem_ctx, struct netr_DomainTrustList);
13188 0 : return self;
13189 : }
13190 :
13191 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13192 : {
13193 :
13194 :
13195 0 : return PyLong_FromLong(21);
13196 : }
13197 :
13198 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
13199 : {
13200 0 : const struct ndr_interface_call *call = NULL;
13201 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(py_obj);
13202 0 : PyObject *ret = NULL;
13203 0 : struct ndr_push *push = NULL;
13204 0 : DATA_BLOB blob;
13205 0 : enum ndr_err_code err;
13206 :
13207 0 : if (ndr_table_winbind.num_calls < 22) {
13208 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ListTrustedDomains_ndr_pack");
13209 0 : return NULL;
13210 : }
13211 0 : call = &ndr_table_winbind.calls[21];
13212 :
13213 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13214 0 : if (push == NULL) {
13215 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13216 0 : return NULL;
13217 : }
13218 :
13219 0 : push->flags |= ndr_push_flags;
13220 :
13221 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13222 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13223 0 : TALLOC_FREE(push);
13224 0 : PyErr_SetNdrError(err);
13225 0 : return NULL;
13226 : }
13227 0 : blob = ndr_push_blob(push);
13228 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13229 0 : TALLOC_FREE(push);
13230 0 : return ret;
13231 : }
13232 :
13233 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13234 : {
13235 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13236 0 : PyObject *bigendian_obj = NULL;
13237 0 : PyObject *ndr64_obj = NULL;
13238 0 : libndr_flags ndr_push_flags = 0;
13239 :
13240 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13241 : discard_const_p(char *, kwnames),
13242 : &bigendian_obj,
13243 : &ndr64_obj)) {
13244 0 : return NULL;
13245 : }
13246 :
13247 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13248 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13249 : }
13250 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13251 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13252 : }
13253 :
13254 0 : return py_wbint_ListTrustedDomains_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13255 : }
13256 :
13257 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13258 : {
13259 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13260 0 : PyObject *bigendian_obj = NULL;
13261 0 : PyObject *ndr64_obj = NULL;
13262 0 : libndr_flags ndr_push_flags = 0;
13263 :
13264 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13265 : discard_const_p(char *, kwnames),
13266 : &bigendian_obj,
13267 : &ndr64_obj)) {
13268 0 : return NULL;
13269 : }
13270 :
13271 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13272 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13273 : }
13274 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13275 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13276 : }
13277 :
13278 0 : return py_wbint_ListTrustedDomains_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13279 : }
13280 :
13281 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
13282 : {
13283 0 : const struct ndr_interface_call *call = NULL;
13284 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(py_obj);
13285 0 : struct ndr_pull *pull = NULL;
13286 0 : enum ndr_err_code err;
13287 :
13288 0 : if (ndr_table_winbind.num_calls < 22) {
13289 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ListTrustedDomains_ndr_unpack");
13290 0 : return NULL;
13291 : }
13292 0 : call = &ndr_table_winbind.calls[21];
13293 :
13294 0 : pull = ndr_pull_init_blob(blob, object);
13295 0 : if (pull == NULL) {
13296 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13297 0 : return NULL;
13298 : }
13299 :
13300 0 : pull->flags |= ndr_pull_flags;
13301 :
13302 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13303 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13304 0 : TALLOC_FREE(pull);
13305 0 : PyErr_SetNdrError(err);
13306 0 : return NULL;
13307 : }
13308 0 : if (!allow_remaining) {
13309 0 : uint32_t highest_ofs;
13310 :
13311 0 : if (pull->offset > pull->relative_highest_offset) {
13312 0 : highest_ofs = pull->offset;
13313 : } else {
13314 0 : highest_ofs = pull->relative_highest_offset;
13315 : }
13316 0 : if (highest_ofs < pull->data_size) {
13317 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13318 : "not all bytes consumed ofs[%u] size[%u]",
13319 : highest_ofs, pull->data_size);
13320 0 : TALLOC_FREE(pull);
13321 0 : PyErr_SetNdrError(err);
13322 0 : return NULL;
13323 : }
13324 : }
13325 :
13326 0 : TALLOC_FREE(pull);
13327 0 : Py_RETURN_NONE;
13328 : }
13329 :
13330 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13331 : {
13332 0 : DATA_BLOB blob;
13333 0 : Py_ssize_t blob_length = 0;
13334 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13335 0 : PyObject *bigendian_obj = NULL;
13336 0 : PyObject *ndr64_obj = NULL;
13337 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13338 0 : PyObject *allow_remaining_obj = NULL;
13339 0 : bool allow_remaining = false;
13340 :
13341 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13342 : discard_const_p(char *, kwnames),
13343 : &blob.data, &blob_length,
13344 : &bigendian_obj,
13345 : &ndr64_obj,
13346 : &allow_remaining_obj)) {
13347 0 : return NULL;
13348 : }
13349 0 : blob.length = blob_length;
13350 :
13351 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13352 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13353 : }
13354 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13355 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13356 : }
13357 :
13358 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13359 0 : allow_remaining = true;
13360 : }
13361 :
13362 0 : return py_wbint_ListTrustedDomains_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13363 : }
13364 :
13365 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13366 : {
13367 0 : DATA_BLOB blob;
13368 0 : Py_ssize_t blob_length = 0;
13369 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13370 0 : PyObject *bigendian_obj = NULL;
13371 0 : PyObject *ndr64_obj = NULL;
13372 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13373 0 : PyObject *allow_remaining_obj = NULL;
13374 0 : bool allow_remaining = false;
13375 :
13376 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13377 : discard_const_p(char *, kwnames),
13378 : &blob.data, &blob_length,
13379 : &bigendian_obj,
13380 : &ndr64_obj,
13381 : &allow_remaining_obj)) {
13382 0 : return NULL;
13383 : }
13384 0 : blob.length = blob_length;
13385 :
13386 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13387 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13388 : }
13389 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13390 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13391 : }
13392 :
13393 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13394 0 : allow_remaining = true;
13395 : }
13396 :
13397 0 : return py_wbint_ListTrustedDomains_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13398 : }
13399 :
13400 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
13401 : {
13402 0 : const struct ndr_interface_call *call = NULL;
13403 0 : struct wbint_ListTrustedDomains *object = pytalloc_get_ptr(py_obj);
13404 0 : PyObject *ret;
13405 0 : char *retstr;
13406 :
13407 0 : if (ndr_table_winbind.num_calls < 22) {
13408 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_ListTrustedDomains_ndr_print");
13409 0 : return NULL;
13410 : }
13411 0 : call = &ndr_table_winbind.calls[21];
13412 :
13413 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13414 0 : ret = PyUnicode_FromString(retstr);
13415 0 : TALLOC_FREE(retstr);
13416 :
13417 0 : return ret;
13418 : }
13419 :
13420 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13421 : {
13422 0 : return py_wbint_ListTrustedDomains_ndr_print(py_obj, "wbint_ListTrustedDomains_in", NDR_IN);
13423 : }
13424 :
13425 0 : static PyObject *py_wbint_ListTrustedDomains_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13426 : {
13427 0 : return py_wbint_ListTrustedDomains_ndr_print(py_obj, "wbint_ListTrustedDomains_out", NDR_OUT);
13428 : }
13429 :
13430 : static PyMethodDef py_wbint_ListTrustedDomains_methods[] = {
13431 : { "opnum", (PyCFunction)py_wbint_ListTrustedDomains_ndr_opnum, METH_NOARGS|METH_CLASS,
13432 : "winbind.wbint_ListTrustedDomains.opnum() -> 21 (0x15) " },
13433 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ListTrustedDomains_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13434 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13435 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ListTrustedDomains_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13436 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13437 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ListTrustedDomains_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13438 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13439 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_ListTrustedDomains_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13440 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13441 : { "__ndr_print_in__", (PyCFunction)py_wbint_ListTrustedDomains_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13442 : { "__ndr_print_out__", (PyCFunction)py_wbint_ListTrustedDomains_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13443 : { NULL, NULL, 0, NULL }
13444 : };
13445 :
13446 :
13447 : static PyTypeObject wbint_ListTrustedDomains_Type = {
13448 : PyVarObject_HEAD_INIT(NULL, 0)
13449 : .tp_name = "winbind.wbint_ListTrustedDomains",
13450 : .tp_getset = py_wbint_ListTrustedDomains_getsetters,
13451 : .tp_methods = py_wbint_ListTrustedDomains_methods,
13452 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13453 : .tp_new = py_wbint_ListTrustedDomains_new,
13454 : };
13455 :
13456 0 : static bool pack_py_wbint_ListTrustedDomains_args_in(PyObject *args, PyObject *kwargs, struct wbint_ListTrustedDomains *r)
13457 : {
13458 0 : PyObject *py_client_name;
13459 0 : PyObject *py_client_pid;
13460 0 : const char *kwnames[] = {
13461 : "client_name", "client_pid", NULL
13462 : };
13463 :
13464 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:wbint_ListTrustedDomains", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid)) {
13465 0 : return false;
13466 : }
13467 :
13468 0 : if (py_client_name == NULL) {
13469 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_name");
13470 0 : return false;
13471 : }
13472 0 : r->in.client_name = talloc_ptrtype(r, r->in.client_name);
13473 0 : if (r->in.client_name == NULL) {
13474 0 : PyErr_NoMemory();
13475 0 : return false;
13476 : }
13477 : {
13478 0 : const char *test_str;
13479 0 : const char *talloc_str;
13480 0 : PyObject *unicode = NULL;
13481 0 : if (PyUnicode_Check(py_client_name)) {
13482 0 : unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
13483 0 : if (unicode == NULL) {
13484 0 : return false;
13485 : }
13486 0 : test_str = PyBytes_AS_STRING(unicode);
13487 0 : } else if (PyBytes_Check(py_client_name)) {
13488 0 : test_str = PyBytes_AS_STRING(py_client_name);
13489 : } else {
13490 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
13491 0 : return false;
13492 : }
13493 0 : talloc_str = talloc_strdup(r, test_str);
13494 0 : if (unicode != NULL) {
13495 0 : Py_DECREF(unicode);
13496 : }
13497 0 : if (talloc_str == NULL) {
13498 0 : PyErr_NoMemory();
13499 0 : return false;
13500 : }
13501 0 : r->in.client_name = talloc_str;
13502 : }
13503 0 : if (py_client_pid == NULL) {
13504 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_pid");
13505 0 : return false;
13506 : }
13507 : {
13508 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
13509 0 : if (PyLong_Check(py_client_pid)) {
13510 0 : unsigned long long test_var;
13511 0 : test_var = PyLong_AsUnsignedLongLong(py_client_pid);
13512 0 : if (PyErr_Occurred() != NULL) {
13513 0 : return false;
13514 : }
13515 0 : if (test_var > uint_max) {
13516 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13517 : PyLong_Type.tp_name, uint_max, test_var);
13518 0 : return false;
13519 : }
13520 0 : r->in.client_pid = test_var;
13521 : } else {
13522 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13523 : PyLong_Type.tp_name);
13524 0 : return false;
13525 : }
13526 : }
13527 0 : return true;
13528 : }
13529 :
13530 0 : static PyObject *unpack_py_wbint_ListTrustedDomains_args_out(struct wbint_ListTrustedDomains *r)
13531 : {
13532 0 : PyObject *result;
13533 0 : PyObject *py_domains;
13534 0 : py_domains = pytalloc_reference_ex(netr_DomainTrustList_Type, r->out.domains, r->out.domains);
13535 0 : result = py_domains;
13536 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
13537 0 : PyErr_SetNTSTATUS(r->out.result);
13538 0 : return NULL;
13539 : }
13540 :
13541 0 : return result;
13542 : }
13543 :
13544 :
13545 0 : static PyObject *py_wbint_PamAuth_in_get_client_name(PyObject *obj, void *closure)
13546 : {
13547 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(obj);
13548 0 : PyObject *py_client_name;
13549 0 : if (object->in.client_name == NULL) {
13550 0 : Py_RETURN_NONE;
13551 : }
13552 0 : if (object->in.client_name == NULL) {
13553 0 : py_client_name = Py_None;
13554 0 : Py_INCREF(py_client_name);
13555 : } else {
13556 0 : py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
13557 : }
13558 0 : return py_client_name;
13559 : }
13560 :
13561 0 : static int py_wbint_PamAuth_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
13562 : {
13563 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13564 0 : if (value == NULL) {
13565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_name");
13566 0 : return -1;
13567 : }
13568 0 : object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
13569 0 : if (object->in.client_name == NULL) {
13570 0 : PyErr_NoMemory();
13571 0 : return -1;
13572 : }
13573 : {
13574 0 : const char *test_str;
13575 0 : const char *talloc_str;
13576 0 : PyObject *unicode = NULL;
13577 0 : if (PyUnicode_Check(value)) {
13578 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
13579 0 : if (unicode == NULL) {
13580 0 : return -1;
13581 : }
13582 0 : test_str = PyBytes_AS_STRING(unicode);
13583 0 : } else if (PyBytes_Check(value)) {
13584 0 : test_str = PyBytes_AS_STRING(value);
13585 : } else {
13586 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
13587 0 : return -1;
13588 : }
13589 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
13590 0 : if (unicode != NULL) {
13591 0 : Py_DECREF(unicode);
13592 : }
13593 0 : if (talloc_str == NULL) {
13594 0 : PyErr_NoMemory();
13595 0 : return -1;
13596 : }
13597 0 : object->in.client_name = talloc_str;
13598 : }
13599 0 : return 0;
13600 : }
13601 :
13602 0 : static PyObject *py_wbint_PamAuth_in_get_client_pid(PyObject *obj, void *closure)
13603 : {
13604 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(obj);
13605 0 : PyObject *py_client_pid;
13606 0 : py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
13607 0 : return py_client_pid;
13608 : }
13609 :
13610 0 : static int py_wbint_PamAuth_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
13611 : {
13612 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13613 0 : if (value == NULL) {
13614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_pid");
13615 0 : return -1;
13616 : }
13617 : {
13618 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
13619 0 : if (PyLong_Check(value)) {
13620 0 : unsigned long long test_var;
13621 0 : test_var = PyLong_AsUnsignedLongLong(value);
13622 0 : if (PyErr_Occurred() != NULL) {
13623 0 : return -1;
13624 : }
13625 0 : if (test_var > uint_max) {
13626 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13627 : PyLong_Type.tp_name, uint_max, test_var);
13628 0 : return -1;
13629 : }
13630 0 : object->in.client_pid = test_var;
13631 : } else {
13632 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13633 : PyLong_Type.tp_name);
13634 0 : return -1;
13635 : }
13636 : }
13637 0 : return 0;
13638 : }
13639 :
13640 0 : static PyObject *py_wbint_PamAuth_in_get_flags(PyObject *obj, void *closure)
13641 : {
13642 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(obj);
13643 0 : PyObject *py_flags;
13644 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
13645 0 : return py_flags;
13646 : }
13647 :
13648 0 : static int py_wbint_PamAuth_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
13649 : {
13650 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13651 0 : if (value == NULL) {
13652 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
13653 0 : return -1;
13654 : }
13655 : {
13656 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
13657 0 : if (PyLong_Check(value)) {
13658 0 : unsigned long long test_var;
13659 0 : test_var = PyLong_AsUnsignedLongLong(value);
13660 0 : if (PyErr_Occurred() != NULL) {
13661 0 : return -1;
13662 : }
13663 0 : if (test_var > uint_max) {
13664 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13665 : PyLong_Type.tp_name, uint_max, test_var);
13666 0 : return -1;
13667 : }
13668 0 : object->in.flags = test_var;
13669 : } else {
13670 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13671 : PyLong_Type.tp_name);
13672 0 : return -1;
13673 : }
13674 : }
13675 0 : return 0;
13676 : }
13677 :
13678 0 : static PyObject *py_wbint_PamAuth_in_get_info(PyObject *obj, void *closure)
13679 : {
13680 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(obj);
13681 0 : PyObject *py_info;
13682 0 : if (object->in.info == NULL) {
13683 0 : Py_RETURN_NONE;
13684 : }
13685 0 : py_info = pytalloc_reference_ex(&wbint_AuthUserInfo_Type, object->in.info, object->in.info);
13686 0 : return py_info;
13687 : }
13688 :
13689 0 : static int py_wbint_PamAuth_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
13690 : {
13691 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13692 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
13693 0 : if (value == NULL) {
13694 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
13695 0 : return -1;
13696 : }
13697 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
13698 0 : if (object->in.info == NULL) {
13699 0 : PyErr_NoMemory();
13700 0 : return -1;
13701 : }
13702 0 : PY_CHECK_TYPE(&wbint_AuthUserInfo_Type, value, return -1;);
13703 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13704 0 : PyErr_NoMemory();
13705 0 : return -1;
13706 : }
13707 0 : object->in.info = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(value);
13708 0 : return 0;
13709 : }
13710 :
13711 0 : static PyObject *py_wbint_PamAuth_in_get_require_membership_of_sid(PyObject *obj, void *closure)
13712 : {
13713 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(obj);
13714 0 : PyObject *py_require_membership_of_sid;
13715 0 : if (object->in.require_membership_of_sid == NULL) {
13716 0 : Py_RETURN_NONE;
13717 : }
13718 0 : py_require_membership_of_sid = pytalloc_reference_ex(&wbint_SidArray_Type, object->in.require_membership_of_sid, object->in.require_membership_of_sid);
13719 0 : return py_require_membership_of_sid;
13720 : }
13721 :
13722 0 : static int py_wbint_PamAuth_in_set_require_membership_of_sid(PyObject *py_obj, PyObject *value, void *closure)
13723 : {
13724 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13725 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.require_membership_of_sid));
13726 0 : if (value == NULL) {
13727 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.require_membership_of_sid");
13728 0 : return -1;
13729 : }
13730 0 : object->in.require_membership_of_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.require_membership_of_sid);
13731 0 : if (object->in.require_membership_of_sid == NULL) {
13732 0 : PyErr_NoMemory();
13733 0 : return -1;
13734 : }
13735 0 : PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
13736 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13737 0 : PyErr_NoMemory();
13738 0 : return -1;
13739 : }
13740 0 : object->in.require_membership_of_sid = (struct wbint_SidArray *)pytalloc_get_ptr(value);
13741 0 : return 0;
13742 : }
13743 :
13744 0 : static PyObject *py_wbint_PamAuth_out_get_validation(PyObject *obj, void *closure)
13745 : {
13746 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(obj);
13747 0 : PyObject *py_validation;
13748 0 : if (object->out.validation == NULL) {
13749 0 : Py_RETURN_NONE;
13750 : }
13751 0 : py_validation = pytalloc_reference_ex(&wbint_Validation_Type, object->out.validation, object->out.validation);
13752 0 : return py_validation;
13753 : }
13754 :
13755 0 : static int py_wbint_PamAuth_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
13756 : {
13757 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13758 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation));
13759 0 : if (value == NULL) {
13760 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.validation");
13761 0 : return -1;
13762 : }
13763 0 : object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation);
13764 0 : if (object->out.validation == NULL) {
13765 0 : PyErr_NoMemory();
13766 0 : return -1;
13767 : }
13768 0 : PY_CHECK_TYPE(&wbint_Validation_Type, value, return -1;);
13769 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13770 0 : PyErr_NoMemory();
13771 0 : return -1;
13772 : }
13773 0 : object->out.validation = (struct wbint_Validation *)pytalloc_get_ptr(value);
13774 0 : return 0;
13775 : }
13776 :
13777 0 : static PyObject *py_wbint_PamAuth_get_result(PyObject *obj, void *closure)
13778 : {
13779 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(obj);
13780 0 : PyObject *py_result;
13781 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13782 0 : return py_result;
13783 : }
13784 :
13785 0 : static int py_wbint_PamAuth_set_result(PyObject *py_obj, PyObject *value, void *closure)
13786 : {
13787 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13788 0 : if (value == NULL) {
13789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
13790 0 : return -1;
13791 : }
13792 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13793 0 : return 0;
13794 : }
13795 :
13796 : static PyGetSetDef py_wbint_PamAuth_getsetters[] = {
13797 : {
13798 : .name = discard_const_p(char, "in_client_name"),
13799 : .get = py_wbint_PamAuth_in_get_client_name,
13800 : .set = py_wbint_PamAuth_in_set_client_name,
13801 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13802 : },
13803 : {
13804 : .name = discard_const_p(char, "in_client_pid"),
13805 : .get = py_wbint_PamAuth_in_get_client_pid,
13806 : .set = py_wbint_PamAuth_in_set_client_pid,
13807 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
13808 : },
13809 : {
13810 : .name = discard_const_p(char, "in_flags"),
13811 : .get = py_wbint_PamAuth_in_get_flags,
13812 : .set = py_wbint_PamAuth_in_set_flags,
13813 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13814 : },
13815 : {
13816 : .name = discard_const_p(char, "in_info"),
13817 : .get = py_wbint_PamAuth_in_get_info,
13818 : .set = py_wbint_PamAuth_in_set_info,
13819 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_AuthUserInfo")
13820 : },
13821 : {
13822 : .name = discard_const_p(char, "in_require_membership_of_sid"),
13823 : .get = py_wbint_PamAuth_in_get_require_membership_of_sid,
13824 : .set = py_wbint_PamAuth_in_set_require_membership_of_sid,
13825 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
13826 : },
13827 : {
13828 : .name = discard_const_p(char, "out_validation"),
13829 : .get = py_wbint_PamAuth_out_get_validation,
13830 : .set = py_wbint_PamAuth_out_set_validation,
13831 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_Validation")
13832 : },
13833 : {
13834 : .name = discard_const_p(char, "result"),
13835 : .get = py_wbint_PamAuth_get_result,
13836 : .set = py_wbint_PamAuth_set_result,
13837 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13838 : },
13839 : { .name = NULL }
13840 : };
13841 :
13842 0 : static PyObject *py_wbint_PamAuth_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13843 : {
13844 0 : PyObject *self = pytalloc_new(struct wbint_PamAuth, type);
13845 0 : struct wbint_PamAuth *_self = (struct wbint_PamAuth *)pytalloc_get_ptr(self);
13846 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13847 0 : _self->in.info = talloc_zero(mem_ctx, struct wbint_AuthUserInfo);
13848 0 : _self->in.require_membership_of_sid = talloc_zero(mem_ctx, struct wbint_SidArray);
13849 0 : _self->out.validation = talloc_zero(mem_ctx, struct wbint_Validation);
13850 0 : return self;
13851 : }
13852 :
13853 0 : static PyObject *py_wbint_PamAuth_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13854 : {
13855 :
13856 :
13857 0 : return PyLong_FromLong(22);
13858 : }
13859 :
13860 0 : static PyObject *py_wbint_PamAuth_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
13861 : {
13862 0 : const struct ndr_interface_call *call = NULL;
13863 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13864 0 : PyObject *ret = NULL;
13865 0 : struct ndr_push *push = NULL;
13866 0 : DATA_BLOB blob;
13867 0 : enum ndr_err_code err;
13868 :
13869 0 : if (ndr_table_winbind.num_calls < 23) {
13870 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuth_ndr_pack");
13871 0 : return NULL;
13872 : }
13873 0 : call = &ndr_table_winbind.calls[22];
13874 :
13875 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13876 0 : if (push == NULL) {
13877 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13878 0 : return NULL;
13879 : }
13880 :
13881 0 : push->flags |= ndr_push_flags;
13882 :
13883 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13884 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13885 0 : TALLOC_FREE(push);
13886 0 : PyErr_SetNdrError(err);
13887 0 : return NULL;
13888 : }
13889 0 : blob = ndr_push_blob(push);
13890 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13891 0 : TALLOC_FREE(push);
13892 0 : return ret;
13893 : }
13894 :
13895 0 : static PyObject *py_wbint_PamAuth_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13896 : {
13897 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13898 0 : PyObject *bigendian_obj = NULL;
13899 0 : PyObject *ndr64_obj = NULL;
13900 0 : libndr_flags ndr_push_flags = 0;
13901 :
13902 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13903 : discard_const_p(char *, kwnames),
13904 : &bigendian_obj,
13905 : &ndr64_obj)) {
13906 0 : return NULL;
13907 : }
13908 :
13909 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13910 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13911 : }
13912 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13913 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13914 : }
13915 :
13916 0 : return py_wbint_PamAuth_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13917 : }
13918 :
13919 0 : static PyObject *py_wbint_PamAuth_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13920 : {
13921 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13922 0 : PyObject *bigendian_obj = NULL;
13923 0 : PyObject *ndr64_obj = NULL;
13924 0 : libndr_flags ndr_push_flags = 0;
13925 :
13926 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13927 : discard_const_p(char *, kwnames),
13928 : &bigendian_obj,
13929 : &ndr64_obj)) {
13930 0 : return NULL;
13931 : }
13932 :
13933 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13934 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13935 : }
13936 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13937 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13938 : }
13939 :
13940 0 : return py_wbint_PamAuth_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13941 : }
13942 :
13943 0 : static PyObject *py_wbint_PamAuth_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
13944 : {
13945 0 : const struct ndr_interface_call *call = NULL;
13946 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
13947 0 : struct ndr_pull *pull = NULL;
13948 0 : enum ndr_err_code err;
13949 :
13950 0 : if (ndr_table_winbind.num_calls < 23) {
13951 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuth_ndr_unpack");
13952 0 : return NULL;
13953 : }
13954 0 : call = &ndr_table_winbind.calls[22];
13955 :
13956 0 : pull = ndr_pull_init_blob(blob, object);
13957 0 : if (pull == NULL) {
13958 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13959 0 : return NULL;
13960 : }
13961 :
13962 0 : pull->flags |= ndr_pull_flags;
13963 :
13964 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13965 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13966 0 : TALLOC_FREE(pull);
13967 0 : PyErr_SetNdrError(err);
13968 0 : return NULL;
13969 : }
13970 0 : if (!allow_remaining) {
13971 0 : uint32_t highest_ofs;
13972 :
13973 0 : if (pull->offset > pull->relative_highest_offset) {
13974 0 : highest_ofs = pull->offset;
13975 : } else {
13976 0 : highest_ofs = pull->relative_highest_offset;
13977 : }
13978 0 : if (highest_ofs < pull->data_size) {
13979 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13980 : "not all bytes consumed ofs[%u] size[%u]",
13981 : highest_ofs, pull->data_size);
13982 0 : TALLOC_FREE(pull);
13983 0 : PyErr_SetNdrError(err);
13984 0 : return NULL;
13985 : }
13986 : }
13987 :
13988 0 : TALLOC_FREE(pull);
13989 0 : Py_RETURN_NONE;
13990 : }
13991 :
13992 0 : static PyObject *py_wbint_PamAuth_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13993 : {
13994 0 : DATA_BLOB blob;
13995 0 : Py_ssize_t blob_length = 0;
13996 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13997 0 : PyObject *bigendian_obj = NULL;
13998 0 : PyObject *ndr64_obj = NULL;
13999 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14000 0 : PyObject *allow_remaining_obj = NULL;
14001 0 : bool allow_remaining = false;
14002 :
14003 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14004 : discard_const_p(char *, kwnames),
14005 : &blob.data, &blob_length,
14006 : &bigendian_obj,
14007 : &ndr64_obj,
14008 : &allow_remaining_obj)) {
14009 0 : return NULL;
14010 : }
14011 0 : blob.length = blob_length;
14012 :
14013 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14014 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14015 : }
14016 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14017 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14018 : }
14019 :
14020 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14021 0 : allow_remaining = true;
14022 : }
14023 :
14024 0 : return py_wbint_PamAuth_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14025 : }
14026 :
14027 0 : static PyObject *py_wbint_PamAuth_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14028 : {
14029 0 : DATA_BLOB blob;
14030 0 : Py_ssize_t blob_length = 0;
14031 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14032 0 : PyObject *bigendian_obj = NULL;
14033 0 : PyObject *ndr64_obj = NULL;
14034 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14035 0 : PyObject *allow_remaining_obj = NULL;
14036 0 : bool allow_remaining = false;
14037 :
14038 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14039 : discard_const_p(char *, kwnames),
14040 : &blob.data, &blob_length,
14041 : &bigendian_obj,
14042 : &ndr64_obj,
14043 : &allow_remaining_obj)) {
14044 0 : return NULL;
14045 : }
14046 0 : blob.length = blob_length;
14047 :
14048 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14049 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14050 : }
14051 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14052 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14053 : }
14054 :
14055 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14056 0 : allow_remaining = true;
14057 : }
14058 :
14059 0 : return py_wbint_PamAuth_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14060 : }
14061 :
14062 0 : static PyObject *py_wbint_PamAuth_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
14063 : {
14064 0 : const struct ndr_interface_call *call = NULL;
14065 0 : struct wbint_PamAuth *object = pytalloc_get_ptr(py_obj);
14066 0 : PyObject *ret;
14067 0 : char *retstr;
14068 :
14069 0 : if (ndr_table_winbind.num_calls < 23) {
14070 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuth_ndr_print");
14071 0 : return NULL;
14072 : }
14073 0 : call = &ndr_table_winbind.calls[22];
14074 :
14075 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14076 0 : ret = PyUnicode_FromString(retstr);
14077 0 : TALLOC_FREE(retstr);
14078 :
14079 0 : return ret;
14080 : }
14081 :
14082 0 : static PyObject *py_wbint_PamAuth_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14083 : {
14084 0 : return py_wbint_PamAuth_ndr_print(py_obj, "wbint_PamAuth_in", NDR_IN);
14085 : }
14086 :
14087 0 : static PyObject *py_wbint_PamAuth_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14088 : {
14089 0 : return py_wbint_PamAuth_ndr_print(py_obj, "wbint_PamAuth_out", NDR_OUT);
14090 : }
14091 :
14092 : static PyMethodDef py_wbint_PamAuth_methods[] = {
14093 : { "opnum", (PyCFunction)py_wbint_PamAuth_ndr_opnum, METH_NOARGS|METH_CLASS,
14094 : "winbind.wbint_PamAuth.opnum() -> 22 (0x16) " },
14095 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuth_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14096 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14097 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuth_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14098 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14099 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuth_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14100 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14101 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuth_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14102 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14103 : { "__ndr_print_in__", (PyCFunction)py_wbint_PamAuth_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14104 : { "__ndr_print_out__", (PyCFunction)py_wbint_PamAuth_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14105 : { NULL, NULL, 0, NULL }
14106 : };
14107 :
14108 :
14109 : static PyTypeObject wbint_PamAuth_Type = {
14110 : PyVarObject_HEAD_INIT(NULL, 0)
14111 : .tp_name = "winbind.wbint_PamAuth",
14112 : .tp_getset = py_wbint_PamAuth_getsetters,
14113 : .tp_methods = py_wbint_PamAuth_methods,
14114 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14115 : .tp_new = py_wbint_PamAuth_new,
14116 : };
14117 :
14118 0 : static bool pack_py_wbint_PamAuth_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamAuth *r)
14119 : {
14120 0 : PyObject *py_client_name;
14121 0 : PyObject *py_client_pid;
14122 0 : PyObject *py_flags;
14123 0 : PyObject *py_info;
14124 0 : PyObject *py_require_membership_of_sid;
14125 0 : const char *kwnames[] = {
14126 : "client_name", "client_pid", "flags", "info", "require_membership_of_sid", NULL
14127 : };
14128 :
14129 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:wbint_PamAuth", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_flags, &py_info, &py_require_membership_of_sid)) {
14130 0 : return false;
14131 : }
14132 :
14133 0 : if (py_client_name == NULL) {
14134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_name");
14135 0 : return false;
14136 : }
14137 0 : r->in.client_name = talloc_ptrtype(r, r->in.client_name);
14138 0 : if (r->in.client_name == NULL) {
14139 0 : PyErr_NoMemory();
14140 0 : return false;
14141 : }
14142 : {
14143 0 : const char *test_str;
14144 0 : const char *talloc_str;
14145 0 : PyObject *unicode = NULL;
14146 0 : if (PyUnicode_Check(py_client_name)) {
14147 0 : unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
14148 0 : if (unicode == NULL) {
14149 0 : return false;
14150 : }
14151 0 : test_str = PyBytes_AS_STRING(unicode);
14152 0 : } else if (PyBytes_Check(py_client_name)) {
14153 0 : test_str = PyBytes_AS_STRING(py_client_name);
14154 : } else {
14155 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
14156 0 : return false;
14157 : }
14158 0 : talloc_str = talloc_strdup(r, test_str);
14159 0 : if (unicode != NULL) {
14160 0 : Py_DECREF(unicode);
14161 : }
14162 0 : if (talloc_str == NULL) {
14163 0 : PyErr_NoMemory();
14164 0 : return false;
14165 : }
14166 0 : r->in.client_name = talloc_str;
14167 : }
14168 0 : if (py_client_pid == NULL) {
14169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_pid");
14170 0 : return false;
14171 : }
14172 : {
14173 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
14174 0 : if (PyLong_Check(py_client_pid)) {
14175 0 : unsigned long long test_var;
14176 0 : test_var = PyLong_AsUnsignedLongLong(py_client_pid);
14177 0 : if (PyErr_Occurred() != NULL) {
14178 0 : return false;
14179 : }
14180 0 : if (test_var > uint_max) {
14181 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14182 : PyLong_Type.tp_name, uint_max, test_var);
14183 0 : return false;
14184 : }
14185 0 : r->in.client_pid = test_var;
14186 : } else {
14187 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14188 : PyLong_Type.tp_name);
14189 0 : return false;
14190 : }
14191 : }
14192 0 : if (py_flags == NULL) {
14193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
14194 0 : return false;
14195 : }
14196 : {
14197 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
14198 0 : if (PyLong_Check(py_flags)) {
14199 0 : unsigned long long test_var;
14200 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
14201 0 : if (PyErr_Occurred() != NULL) {
14202 0 : return false;
14203 : }
14204 0 : if (test_var > uint_max) {
14205 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14206 : PyLong_Type.tp_name, uint_max, test_var);
14207 0 : return false;
14208 : }
14209 0 : r->in.flags = test_var;
14210 : } else {
14211 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14212 : PyLong_Type.tp_name);
14213 0 : return false;
14214 : }
14215 : }
14216 0 : if (py_info == NULL) {
14217 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
14218 0 : return false;
14219 : }
14220 0 : r->in.info = talloc_ptrtype(r, r->in.info);
14221 0 : if (r->in.info == NULL) {
14222 0 : PyErr_NoMemory();
14223 0 : return false;
14224 : }
14225 0 : PY_CHECK_TYPE(&wbint_AuthUserInfo_Type, py_info, return false;);
14226 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
14227 0 : PyErr_NoMemory();
14228 0 : return false;
14229 : }
14230 0 : r->in.info = (struct wbint_AuthUserInfo *)pytalloc_get_ptr(py_info);
14231 0 : if (py_require_membership_of_sid == NULL) {
14232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.require_membership_of_sid");
14233 0 : return false;
14234 : }
14235 0 : r->in.require_membership_of_sid = talloc_ptrtype(r, r->in.require_membership_of_sid);
14236 0 : if (r->in.require_membership_of_sid == NULL) {
14237 0 : PyErr_NoMemory();
14238 0 : return false;
14239 : }
14240 0 : PY_CHECK_TYPE(&wbint_SidArray_Type, py_require_membership_of_sid, return false;);
14241 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_require_membership_of_sid)) == NULL) {
14242 0 : PyErr_NoMemory();
14243 0 : return false;
14244 : }
14245 0 : r->in.require_membership_of_sid = (struct wbint_SidArray *)pytalloc_get_ptr(py_require_membership_of_sid);
14246 0 : return true;
14247 : }
14248 :
14249 0 : static PyObject *unpack_py_wbint_PamAuth_args_out(struct wbint_PamAuth *r)
14250 : {
14251 0 : PyObject *result;
14252 0 : PyObject *py_validation;
14253 0 : py_validation = pytalloc_reference_ex(&wbint_Validation_Type, r->out.validation, r->out.validation);
14254 0 : result = py_validation;
14255 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
14256 0 : PyErr_SetNTSTATUS(r->out.result);
14257 0 : return NULL;
14258 : }
14259 :
14260 0 : return result;
14261 : }
14262 :
14263 :
14264 0 : static PyObject *py_wbint_PamAuthCrap_in_get_client_name(PyObject *obj, void *closure)
14265 : {
14266 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14267 0 : PyObject *py_client_name;
14268 0 : if (object->in.client_name == NULL) {
14269 0 : Py_RETURN_NONE;
14270 : }
14271 0 : if (object->in.client_name == NULL) {
14272 0 : py_client_name = Py_None;
14273 0 : Py_INCREF(py_client_name);
14274 : } else {
14275 0 : py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
14276 : }
14277 0 : return py_client_name;
14278 : }
14279 :
14280 0 : static int py_wbint_PamAuthCrap_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
14281 : {
14282 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14283 0 : if (value == NULL) {
14284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_name");
14285 0 : return -1;
14286 : }
14287 0 : object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
14288 0 : if (object->in.client_name == NULL) {
14289 0 : PyErr_NoMemory();
14290 0 : return -1;
14291 : }
14292 : {
14293 0 : const char *test_str;
14294 0 : const char *talloc_str;
14295 0 : PyObject *unicode = NULL;
14296 0 : if (PyUnicode_Check(value)) {
14297 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
14298 0 : if (unicode == NULL) {
14299 0 : return -1;
14300 : }
14301 0 : test_str = PyBytes_AS_STRING(unicode);
14302 0 : } else if (PyBytes_Check(value)) {
14303 0 : test_str = PyBytes_AS_STRING(value);
14304 : } else {
14305 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
14306 0 : return -1;
14307 : }
14308 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
14309 0 : if (unicode != NULL) {
14310 0 : Py_DECREF(unicode);
14311 : }
14312 0 : if (talloc_str == NULL) {
14313 0 : PyErr_NoMemory();
14314 0 : return -1;
14315 : }
14316 0 : object->in.client_name = talloc_str;
14317 : }
14318 0 : return 0;
14319 : }
14320 :
14321 0 : static PyObject *py_wbint_PamAuthCrap_in_get_client_pid(PyObject *obj, void *closure)
14322 : {
14323 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14324 0 : PyObject *py_client_pid;
14325 0 : py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
14326 0 : return py_client_pid;
14327 : }
14328 :
14329 0 : static int py_wbint_PamAuthCrap_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
14330 : {
14331 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14332 0 : if (value == NULL) {
14333 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_pid");
14334 0 : return -1;
14335 : }
14336 : {
14337 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
14338 0 : if (PyLong_Check(value)) {
14339 0 : unsigned long long test_var;
14340 0 : test_var = PyLong_AsUnsignedLongLong(value);
14341 0 : if (PyErr_Occurred() != NULL) {
14342 0 : return -1;
14343 : }
14344 0 : if (test_var > uint_max) {
14345 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14346 : PyLong_Type.tp_name, uint_max, test_var);
14347 0 : return -1;
14348 : }
14349 0 : object->in.client_pid = test_var;
14350 : } else {
14351 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14352 : PyLong_Type.tp_name);
14353 0 : return -1;
14354 : }
14355 : }
14356 0 : return 0;
14357 : }
14358 :
14359 0 : static PyObject *py_wbint_PamAuthCrap_in_get_flags(PyObject *obj, void *closure)
14360 : {
14361 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14362 0 : PyObject *py_flags;
14363 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
14364 0 : return py_flags;
14365 : }
14366 :
14367 0 : static int py_wbint_PamAuthCrap_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
14368 : {
14369 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14370 0 : if (value == NULL) {
14371 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
14372 0 : return -1;
14373 : }
14374 : {
14375 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
14376 0 : if (PyLong_Check(value)) {
14377 0 : unsigned long long test_var;
14378 0 : test_var = PyLong_AsUnsignedLongLong(value);
14379 0 : if (PyErr_Occurred() != NULL) {
14380 0 : return -1;
14381 : }
14382 0 : if (test_var > uint_max) {
14383 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14384 : PyLong_Type.tp_name, uint_max, test_var);
14385 0 : return -1;
14386 : }
14387 0 : object->in.flags = test_var;
14388 : } else {
14389 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14390 : PyLong_Type.tp_name);
14391 0 : return -1;
14392 : }
14393 : }
14394 0 : return 0;
14395 : }
14396 :
14397 0 : static PyObject *py_wbint_PamAuthCrap_in_get_user(PyObject *obj, void *closure)
14398 : {
14399 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14400 0 : PyObject *py_user;
14401 0 : if (object->in.user == NULL) {
14402 0 : Py_RETURN_NONE;
14403 : }
14404 0 : if (object->in.user == NULL) {
14405 0 : py_user = Py_None;
14406 0 : Py_INCREF(py_user);
14407 : } else {
14408 0 : py_user = PyUnicode_Decode(object->in.user, strlen(object->in.user), "utf-8", "ignore");
14409 : }
14410 0 : return py_user;
14411 : }
14412 :
14413 0 : static int py_wbint_PamAuthCrap_in_set_user(PyObject *py_obj, PyObject *value, void *closure)
14414 : {
14415 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14416 0 : if (value == NULL) {
14417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.user");
14418 0 : return -1;
14419 : }
14420 0 : object->in.user = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user);
14421 0 : if (object->in.user == NULL) {
14422 0 : PyErr_NoMemory();
14423 0 : return -1;
14424 : }
14425 : {
14426 0 : const char *test_str;
14427 0 : const char *talloc_str;
14428 0 : PyObject *unicode = NULL;
14429 0 : if (PyUnicode_Check(value)) {
14430 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
14431 0 : if (unicode == NULL) {
14432 0 : return -1;
14433 : }
14434 0 : test_str = PyBytes_AS_STRING(unicode);
14435 0 : } else if (PyBytes_Check(value)) {
14436 0 : test_str = PyBytes_AS_STRING(value);
14437 : } else {
14438 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
14439 0 : return -1;
14440 : }
14441 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
14442 0 : if (unicode != NULL) {
14443 0 : Py_DECREF(unicode);
14444 : }
14445 0 : if (talloc_str == NULL) {
14446 0 : PyErr_NoMemory();
14447 0 : return -1;
14448 : }
14449 0 : object->in.user = talloc_str;
14450 : }
14451 0 : return 0;
14452 : }
14453 :
14454 0 : static PyObject *py_wbint_PamAuthCrap_in_get_domain(PyObject *obj, void *closure)
14455 : {
14456 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14457 0 : PyObject *py_domain;
14458 0 : if (object->in.domain == NULL) {
14459 0 : Py_RETURN_NONE;
14460 : }
14461 0 : if (object->in.domain == NULL) {
14462 0 : py_domain = Py_None;
14463 0 : Py_INCREF(py_domain);
14464 : } else {
14465 0 : py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore");
14466 : }
14467 0 : return py_domain;
14468 : }
14469 :
14470 0 : static int py_wbint_PamAuthCrap_in_set_domain(PyObject *py_obj, PyObject *value, void *closure)
14471 : {
14472 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14473 0 : if (value == NULL) {
14474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain");
14475 0 : return -1;
14476 : }
14477 0 : object->in.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain);
14478 0 : if (object->in.domain == NULL) {
14479 0 : PyErr_NoMemory();
14480 0 : return -1;
14481 : }
14482 : {
14483 0 : const char *test_str;
14484 0 : const char *talloc_str;
14485 0 : PyObject *unicode = NULL;
14486 0 : if (PyUnicode_Check(value)) {
14487 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
14488 0 : if (unicode == NULL) {
14489 0 : return -1;
14490 : }
14491 0 : test_str = PyBytes_AS_STRING(unicode);
14492 0 : } else if (PyBytes_Check(value)) {
14493 0 : test_str = PyBytes_AS_STRING(value);
14494 : } else {
14495 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
14496 0 : return -1;
14497 : }
14498 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
14499 0 : if (unicode != NULL) {
14500 0 : Py_DECREF(unicode);
14501 : }
14502 0 : if (talloc_str == NULL) {
14503 0 : PyErr_NoMemory();
14504 0 : return -1;
14505 : }
14506 0 : object->in.domain = talloc_str;
14507 : }
14508 0 : return 0;
14509 : }
14510 :
14511 0 : static PyObject *py_wbint_PamAuthCrap_in_get_workstation(PyObject *obj, void *closure)
14512 : {
14513 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14514 0 : PyObject *py_workstation;
14515 0 : if (object->in.workstation == NULL) {
14516 0 : Py_RETURN_NONE;
14517 : }
14518 0 : if (object->in.workstation == NULL) {
14519 0 : py_workstation = Py_None;
14520 0 : Py_INCREF(py_workstation);
14521 : } else {
14522 0 : py_workstation = PyUnicode_Decode(object->in.workstation, strlen(object->in.workstation), "utf-8", "ignore");
14523 : }
14524 0 : return py_workstation;
14525 : }
14526 :
14527 0 : static int py_wbint_PamAuthCrap_in_set_workstation(PyObject *py_obj, PyObject *value, void *closure)
14528 : {
14529 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14530 0 : if (value == NULL) {
14531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.workstation");
14532 0 : return -1;
14533 : }
14534 0 : object->in.workstation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.workstation);
14535 0 : if (object->in.workstation == NULL) {
14536 0 : PyErr_NoMemory();
14537 0 : return -1;
14538 : }
14539 : {
14540 0 : const char *test_str;
14541 0 : const char *talloc_str;
14542 0 : PyObject *unicode = NULL;
14543 0 : if (PyUnicode_Check(value)) {
14544 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
14545 0 : if (unicode == NULL) {
14546 0 : return -1;
14547 : }
14548 0 : test_str = PyBytes_AS_STRING(unicode);
14549 0 : } else if (PyBytes_Check(value)) {
14550 0 : test_str = PyBytes_AS_STRING(value);
14551 : } else {
14552 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
14553 0 : return -1;
14554 : }
14555 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
14556 0 : if (unicode != NULL) {
14557 0 : Py_DECREF(unicode);
14558 : }
14559 0 : if (talloc_str == NULL) {
14560 0 : PyErr_NoMemory();
14561 0 : return -1;
14562 : }
14563 0 : object->in.workstation = talloc_str;
14564 : }
14565 0 : return 0;
14566 : }
14567 :
14568 0 : static PyObject *py_wbint_PamAuthCrap_in_get_lm_resp(PyObject *obj, void *closure)
14569 : {
14570 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14571 0 : PyObject *py_lm_resp;
14572 0 : py_lm_resp = PyBytes_FromStringAndSize((char *)(object->in.lm_resp).data, (object->in.lm_resp).length);
14573 0 : return py_lm_resp;
14574 : }
14575 :
14576 0 : static int py_wbint_PamAuthCrap_in_set_lm_resp(PyObject *py_obj, PyObject *value, void *closure)
14577 : {
14578 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14579 0 : if (value == NULL) {
14580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.lm_resp");
14581 0 : return -1;
14582 : }
14583 0 : object->in.lm_resp = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
14584 0 : return 0;
14585 : }
14586 :
14587 0 : static PyObject *py_wbint_PamAuthCrap_in_get_nt_resp(PyObject *obj, void *closure)
14588 : {
14589 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14590 0 : PyObject *py_nt_resp;
14591 0 : py_nt_resp = PyBytes_FromStringAndSize((char *)(object->in.nt_resp).data, (object->in.nt_resp).length);
14592 0 : return py_nt_resp;
14593 : }
14594 :
14595 0 : static int py_wbint_PamAuthCrap_in_set_nt_resp(PyObject *py_obj, PyObject *value, void *closure)
14596 : {
14597 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14598 0 : if (value == NULL) {
14599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.nt_resp");
14600 0 : return -1;
14601 : }
14602 0 : object->in.nt_resp = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
14603 0 : return 0;
14604 : }
14605 :
14606 0 : static PyObject *py_wbint_PamAuthCrap_in_get_chal(PyObject *obj, void *closure)
14607 : {
14608 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14609 0 : PyObject *py_chal;
14610 0 : py_chal = PyBytes_FromStringAndSize((char *)(object->in.chal).data, (object->in.chal).length);
14611 0 : return py_chal;
14612 : }
14613 :
14614 0 : static int py_wbint_PamAuthCrap_in_set_chal(PyObject *py_obj, PyObject *value, void *closure)
14615 : {
14616 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14617 0 : if (value == NULL) {
14618 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.chal");
14619 0 : return -1;
14620 : }
14621 0 : object->in.chal = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
14622 0 : return 0;
14623 : }
14624 :
14625 0 : static PyObject *py_wbint_PamAuthCrap_in_get_logon_parameters(PyObject *obj, void *closure)
14626 : {
14627 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14628 0 : PyObject *py_logon_parameters;
14629 0 : py_logon_parameters = PyLong_FromUnsignedLongLong((uint32_t)(object->in.logon_parameters));
14630 0 : return py_logon_parameters;
14631 : }
14632 :
14633 0 : static int py_wbint_PamAuthCrap_in_set_logon_parameters(PyObject *py_obj, PyObject *value, void *closure)
14634 : {
14635 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14636 0 : if (value == NULL) {
14637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.logon_parameters");
14638 0 : return -1;
14639 : }
14640 : {
14641 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_parameters));
14642 0 : if (PyLong_Check(value)) {
14643 0 : unsigned long long test_var;
14644 0 : test_var = PyLong_AsUnsignedLongLong(value);
14645 0 : if (PyErr_Occurred() != NULL) {
14646 0 : return -1;
14647 : }
14648 0 : if (test_var > uint_max) {
14649 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14650 : PyLong_Type.tp_name, uint_max, test_var);
14651 0 : return -1;
14652 : }
14653 0 : object->in.logon_parameters = test_var;
14654 : } else {
14655 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14656 : PyLong_Type.tp_name);
14657 0 : return -1;
14658 : }
14659 : }
14660 0 : return 0;
14661 : }
14662 :
14663 0 : static PyObject *py_wbint_PamAuthCrap_in_get_require_membership_of_sid(PyObject *obj, void *closure)
14664 : {
14665 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14666 0 : PyObject *py_require_membership_of_sid;
14667 0 : if (object->in.require_membership_of_sid == NULL) {
14668 0 : Py_RETURN_NONE;
14669 : }
14670 0 : py_require_membership_of_sid = pytalloc_reference_ex(&wbint_SidArray_Type, object->in.require_membership_of_sid, object->in.require_membership_of_sid);
14671 0 : return py_require_membership_of_sid;
14672 : }
14673 :
14674 0 : static int py_wbint_PamAuthCrap_in_set_require_membership_of_sid(PyObject *py_obj, PyObject *value, void *closure)
14675 : {
14676 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14677 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.require_membership_of_sid));
14678 0 : if (value == NULL) {
14679 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.require_membership_of_sid");
14680 0 : return -1;
14681 : }
14682 0 : object->in.require_membership_of_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.require_membership_of_sid);
14683 0 : if (object->in.require_membership_of_sid == NULL) {
14684 0 : PyErr_NoMemory();
14685 0 : return -1;
14686 : }
14687 0 : PY_CHECK_TYPE(&wbint_SidArray_Type, value, return -1;);
14688 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14689 0 : PyErr_NoMemory();
14690 0 : return -1;
14691 : }
14692 0 : object->in.require_membership_of_sid = (struct wbint_SidArray *)pytalloc_get_ptr(value);
14693 0 : return 0;
14694 : }
14695 :
14696 0 : static PyObject *py_wbint_PamAuthCrap_out_get_authoritative(PyObject *obj, void *closure)
14697 : {
14698 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14699 0 : PyObject *py_authoritative;
14700 0 : if (object->out.authoritative == NULL) {
14701 0 : Py_RETURN_NONE;
14702 : }
14703 0 : py_authoritative = PyLong_FromLong((uint16_t)(*object->out.authoritative));
14704 0 : return py_authoritative;
14705 : }
14706 :
14707 0 : static int py_wbint_PamAuthCrap_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure)
14708 : {
14709 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14710 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authoritative));
14711 0 : if (value == NULL) {
14712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.authoritative");
14713 0 : return -1;
14714 : }
14715 0 : object->out.authoritative = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authoritative);
14716 0 : if (object->out.authoritative == NULL) {
14717 0 : PyErr_NoMemory();
14718 0 : return -1;
14719 : }
14720 : {
14721 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.authoritative));
14722 0 : if (PyLong_Check(value)) {
14723 0 : unsigned long long test_var;
14724 0 : test_var = PyLong_AsUnsignedLongLong(value);
14725 0 : if (PyErr_Occurred() != NULL) {
14726 0 : return -1;
14727 : }
14728 0 : if (test_var > uint_max) {
14729 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14730 : PyLong_Type.tp_name, uint_max, test_var);
14731 0 : return -1;
14732 : }
14733 0 : *object->out.authoritative = test_var;
14734 : } else {
14735 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14736 : PyLong_Type.tp_name);
14737 0 : return -1;
14738 : }
14739 : }
14740 0 : return 0;
14741 : }
14742 :
14743 0 : static PyObject *py_wbint_PamAuthCrap_out_get_validation(PyObject *obj, void *closure)
14744 : {
14745 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14746 0 : PyObject *py_validation;
14747 0 : if (object->out.validation == NULL) {
14748 0 : Py_RETURN_NONE;
14749 : }
14750 0 : py_validation = pytalloc_reference_ex(&wbint_PamAuthCrapValidation_Type, object->out.validation, object->out.validation);
14751 0 : return py_validation;
14752 : }
14753 :
14754 0 : static int py_wbint_PamAuthCrap_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
14755 : {
14756 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14757 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.validation));
14758 0 : if (value == NULL) {
14759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.validation");
14760 0 : return -1;
14761 : }
14762 0 : object->out.validation = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.validation);
14763 0 : if (object->out.validation == NULL) {
14764 0 : PyErr_NoMemory();
14765 0 : return -1;
14766 : }
14767 0 : PY_CHECK_TYPE(&wbint_PamAuthCrapValidation_Type, value, return -1;);
14768 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14769 0 : PyErr_NoMemory();
14770 0 : return -1;
14771 : }
14772 0 : object->out.validation = (struct wbint_PamAuthCrapValidation *)pytalloc_get_ptr(value);
14773 0 : return 0;
14774 : }
14775 :
14776 0 : static PyObject *py_wbint_PamAuthCrap_get_result(PyObject *obj, void *closure)
14777 : {
14778 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(obj);
14779 0 : PyObject *py_result;
14780 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
14781 0 : return py_result;
14782 : }
14783 :
14784 0 : static int py_wbint_PamAuthCrap_set_result(PyObject *py_obj, PyObject *value, void *closure)
14785 : {
14786 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14787 0 : if (value == NULL) {
14788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
14789 0 : return -1;
14790 : }
14791 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
14792 0 : return 0;
14793 : }
14794 :
14795 : static PyGetSetDef py_wbint_PamAuthCrap_getsetters[] = {
14796 : {
14797 : .name = discard_const_p(char, "in_client_name"),
14798 : .get = py_wbint_PamAuthCrap_in_get_client_name,
14799 : .set = py_wbint_PamAuthCrap_in_set_client_name,
14800 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14801 : },
14802 : {
14803 : .name = discard_const_p(char, "in_client_pid"),
14804 : .get = py_wbint_PamAuthCrap_in_get_client_pid,
14805 : .set = py_wbint_PamAuthCrap_in_set_client_pid,
14806 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
14807 : },
14808 : {
14809 : .name = discard_const_p(char, "in_flags"),
14810 : .get = py_wbint_PamAuthCrap_in_get_flags,
14811 : .set = py_wbint_PamAuthCrap_in_set_flags,
14812 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14813 : },
14814 : {
14815 : .name = discard_const_p(char, "in_user"),
14816 : .get = py_wbint_PamAuthCrap_in_get_user,
14817 : .set = py_wbint_PamAuthCrap_in_set_user,
14818 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14819 : },
14820 : {
14821 : .name = discard_const_p(char, "in_domain"),
14822 : .get = py_wbint_PamAuthCrap_in_get_domain,
14823 : .set = py_wbint_PamAuthCrap_in_set_domain,
14824 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14825 : },
14826 : {
14827 : .name = discard_const_p(char, "in_workstation"),
14828 : .get = py_wbint_PamAuthCrap_in_get_workstation,
14829 : .set = py_wbint_PamAuthCrap_in_set_workstation,
14830 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14831 : },
14832 : {
14833 : .name = discard_const_p(char, "in_lm_resp"),
14834 : .get = py_wbint_PamAuthCrap_in_get_lm_resp,
14835 : .set = py_wbint_PamAuthCrap_in_set_lm_resp,
14836 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
14837 : },
14838 : {
14839 : .name = discard_const_p(char, "in_nt_resp"),
14840 : .get = py_wbint_PamAuthCrap_in_get_nt_resp,
14841 : .set = py_wbint_PamAuthCrap_in_set_nt_resp,
14842 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
14843 : },
14844 : {
14845 : .name = discard_const_p(char, "in_chal"),
14846 : .get = py_wbint_PamAuthCrap_in_get_chal,
14847 : .set = py_wbint_PamAuthCrap_in_set_chal,
14848 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
14849 : },
14850 : {
14851 : .name = discard_const_p(char, "in_logon_parameters"),
14852 : .get = py_wbint_PamAuthCrap_in_get_logon_parameters,
14853 : .set = py_wbint_PamAuthCrap_in_set_logon_parameters,
14854 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14855 : },
14856 : {
14857 : .name = discard_const_p(char, "in_require_membership_of_sid"),
14858 : .get = py_wbint_PamAuthCrap_in_get_require_membership_of_sid,
14859 : .set = py_wbint_PamAuthCrap_in_set_require_membership_of_sid,
14860 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_SidArray")
14861 : },
14862 : {
14863 : .name = discard_const_p(char, "out_authoritative"),
14864 : .get = py_wbint_PamAuthCrap_out_get_authoritative,
14865 : .set = py_wbint_PamAuthCrap_out_set_authoritative,
14866 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
14867 : },
14868 : {
14869 : .name = discard_const_p(char, "out_validation"),
14870 : .get = py_wbint_PamAuthCrap_out_get_validation,
14871 : .set = py_wbint_PamAuthCrap_out_set_validation,
14872 : .doc = discard_const_p(char, "PIDL-generated element of base type wbint_PamAuthCrapValidation")
14873 : },
14874 : {
14875 : .name = discard_const_p(char, "result"),
14876 : .get = py_wbint_PamAuthCrap_get_result,
14877 : .set = py_wbint_PamAuthCrap_set_result,
14878 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
14879 : },
14880 : { .name = NULL }
14881 : };
14882 :
14883 0 : static PyObject *py_wbint_PamAuthCrap_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14884 : {
14885 0 : PyObject *self = pytalloc_new(struct wbint_PamAuthCrap, type);
14886 0 : struct wbint_PamAuthCrap *_self = (struct wbint_PamAuthCrap *)pytalloc_get_ptr(self);
14887 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14888 0 : _self->in.require_membership_of_sid = talloc_zero(mem_ctx, struct wbint_SidArray);
14889 0 : _self->out.authoritative = talloc_zero(mem_ctx, uint8_t);
14890 0 : _self->out.validation = talloc_zero(mem_ctx, struct wbint_PamAuthCrapValidation);
14891 0 : return self;
14892 : }
14893 :
14894 0 : static PyObject *py_wbint_PamAuthCrap_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14895 : {
14896 :
14897 :
14898 0 : return PyLong_FromLong(23);
14899 : }
14900 :
14901 0 : static PyObject *py_wbint_PamAuthCrap_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
14902 : {
14903 0 : const struct ndr_interface_call *call = NULL;
14904 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14905 0 : PyObject *ret = NULL;
14906 0 : struct ndr_push *push = NULL;
14907 0 : DATA_BLOB blob;
14908 0 : enum ndr_err_code err;
14909 :
14910 0 : if (ndr_table_winbind.num_calls < 24) {
14911 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrap_ndr_pack");
14912 0 : return NULL;
14913 : }
14914 0 : call = &ndr_table_winbind.calls[23];
14915 :
14916 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14917 0 : if (push == NULL) {
14918 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14919 0 : return NULL;
14920 : }
14921 :
14922 0 : push->flags |= ndr_push_flags;
14923 :
14924 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14925 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14926 0 : TALLOC_FREE(push);
14927 0 : PyErr_SetNdrError(err);
14928 0 : return NULL;
14929 : }
14930 0 : blob = ndr_push_blob(push);
14931 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14932 0 : TALLOC_FREE(push);
14933 0 : return ret;
14934 : }
14935 :
14936 0 : static PyObject *py_wbint_PamAuthCrap_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14937 : {
14938 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14939 0 : PyObject *bigendian_obj = NULL;
14940 0 : PyObject *ndr64_obj = NULL;
14941 0 : libndr_flags ndr_push_flags = 0;
14942 :
14943 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14944 : discard_const_p(char *, kwnames),
14945 : &bigendian_obj,
14946 : &ndr64_obj)) {
14947 0 : return NULL;
14948 : }
14949 :
14950 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14951 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14952 : }
14953 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14954 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14955 : }
14956 :
14957 0 : return py_wbint_PamAuthCrap_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14958 : }
14959 :
14960 0 : static PyObject *py_wbint_PamAuthCrap_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14961 : {
14962 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14963 0 : PyObject *bigendian_obj = NULL;
14964 0 : PyObject *ndr64_obj = NULL;
14965 0 : libndr_flags ndr_push_flags = 0;
14966 :
14967 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14968 : discard_const_p(char *, kwnames),
14969 : &bigendian_obj,
14970 : &ndr64_obj)) {
14971 0 : return NULL;
14972 : }
14973 :
14974 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14975 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14976 : }
14977 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14978 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14979 : }
14980 :
14981 0 : return py_wbint_PamAuthCrap_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14982 : }
14983 :
14984 0 : static PyObject *py_wbint_PamAuthCrap_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
14985 : {
14986 0 : const struct ndr_interface_call *call = NULL;
14987 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
14988 0 : struct ndr_pull *pull = NULL;
14989 0 : enum ndr_err_code err;
14990 :
14991 0 : if (ndr_table_winbind.num_calls < 24) {
14992 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrap_ndr_unpack");
14993 0 : return NULL;
14994 : }
14995 0 : call = &ndr_table_winbind.calls[23];
14996 :
14997 0 : pull = ndr_pull_init_blob(blob, object);
14998 0 : if (pull == NULL) {
14999 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15000 0 : return NULL;
15001 : }
15002 :
15003 0 : pull->flags |= ndr_pull_flags;
15004 :
15005 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15006 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15007 0 : TALLOC_FREE(pull);
15008 0 : PyErr_SetNdrError(err);
15009 0 : return NULL;
15010 : }
15011 0 : if (!allow_remaining) {
15012 0 : uint32_t highest_ofs;
15013 :
15014 0 : if (pull->offset > pull->relative_highest_offset) {
15015 0 : highest_ofs = pull->offset;
15016 : } else {
15017 0 : highest_ofs = pull->relative_highest_offset;
15018 : }
15019 0 : if (highest_ofs < pull->data_size) {
15020 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15021 : "not all bytes consumed ofs[%u] size[%u]",
15022 : highest_ofs, pull->data_size);
15023 0 : TALLOC_FREE(pull);
15024 0 : PyErr_SetNdrError(err);
15025 0 : return NULL;
15026 : }
15027 : }
15028 :
15029 0 : TALLOC_FREE(pull);
15030 0 : Py_RETURN_NONE;
15031 : }
15032 :
15033 0 : static PyObject *py_wbint_PamAuthCrap_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15034 : {
15035 0 : DATA_BLOB blob;
15036 0 : Py_ssize_t blob_length = 0;
15037 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15038 0 : PyObject *bigendian_obj = NULL;
15039 0 : PyObject *ndr64_obj = NULL;
15040 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15041 0 : PyObject *allow_remaining_obj = NULL;
15042 0 : bool allow_remaining = false;
15043 :
15044 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15045 : discard_const_p(char *, kwnames),
15046 : &blob.data, &blob_length,
15047 : &bigendian_obj,
15048 : &ndr64_obj,
15049 : &allow_remaining_obj)) {
15050 0 : return NULL;
15051 : }
15052 0 : blob.length = blob_length;
15053 :
15054 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15055 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15056 : }
15057 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15058 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15059 : }
15060 :
15061 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15062 0 : allow_remaining = true;
15063 : }
15064 :
15065 0 : return py_wbint_PamAuthCrap_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15066 : }
15067 :
15068 0 : static PyObject *py_wbint_PamAuthCrap_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15069 : {
15070 0 : DATA_BLOB blob;
15071 0 : Py_ssize_t blob_length = 0;
15072 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15073 0 : PyObject *bigendian_obj = NULL;
15074 0 : PyObject *ndr64_obj = NULL;
15075 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15076 0 : PyObject *allow_remaining_obj = NULL;
15077 0 : bool allow_remaining = false;
15078 :
15079 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15080 : discard_const_p(char *, kwnames),
15081 : &blob.data, &blob_length,
15082 : &bigendian_obj,
15083 : &ndr64_obj,
15084 : &allow_remaining_obj)) {
15085 0 : return NULL;
15086 : }
15087 0 : blob.length = blob_length;
15088 :
15089 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15090 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15091 : }
15092 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15093 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15094 : }
15095 :
15096 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15097 0 : allow_remaining = true;
15098 : }
15099 :
15100 0 : return py_wbint_PamAuthCrap_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15101 : }
15102 :
15103 0 : static PyObject *py_wbint_PamAuthCrap_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
15104 : {
15105 0 : const struct ndr_interface_call *call = NULL;
15106 0 : struct wbint_PamAuthCrap *object = pytalloc_get_ptr(py_obj);
15107 0 : PyObject *ret;
15108 0 : char *retstr;
15109 :
15110 0 : if (ndr_table_winbind.num_calls < 24) {
15111 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrap_ndr_print");
15112 0 : return NULL;
15113 : }
15114 0 : call = &ndr_table_winbind.calls[23];
15115 :
15116 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15117 0 : ret = PyUnicode_FromString(retstr);
15118 0 : TALLOC_FREE(retstr);
15119 :
15120 0 : return ret;
15121 : }
15122 :
15123 0 : static PyObject *py_wbint_PamAuthCrap_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15124 : {
15125 0 : return py_wbint_PamAuthCrap_ndr_print(py_obj, "wbint_PamAuthCrap_in", NDR_IN);
15126 : }
15127 :
15128 0 : static PyObject *py_wbint_PamAuthCrap_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15129 : {
15130 0 : return py_wbint_PamAuthCrap_ndr_print(py_obj, "wbint_PamAuthCrap_out", NDR_OUT);
15131 : }
15132 :
15133 : static PyMethodDef py_wbint_PamAuthCrap_methods[] = {
15134 : { "opnum", (PyCFunction)py_wbint_PamAuthCrap_ndr_opnum, METH_NOARGS|METH_CLASS,
15135 : "winbind.wbint_PamAuthCrap.opnum() -> 23 (0x17) " },
15136 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrap_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15137 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15138 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrap_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15139 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15140 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrap_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15141 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15142 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrap_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15143 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15144 : { "__ndr_print_in__", (PyCFunction)py_wbint_PamAuthCrap_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15145 : { "__ndr_print_out__", (PyCFunction)py_wbint_PamAuthCrap_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15146 : { NULL, NULL, 0, NULL }
15147 : };
15148 :
15149 :
15150 : static PyTypeObject wbint_PamAuthCrap_Type = {
15151 : PyVarObject_HEAD_INIT(NULL, 0)
15152 : .tp_name = "winbind.wbint_PamAuthCrap",
15153 : .tp_getset = py_wbint_PamAuthCrap_getsetters,
15154 : .tp_methods = py_wbint_PamAuthCrap_methods,
15155 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15156 : .tp_new = py_wbint_PamAuthCrap_new,
15157 : };
15158 :
15159 0 : static bool pack_py_wbint_PamAuthCrap_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamAuthCrap *r)
15160 : {
15161 0 : PyObject *py_client_name;
15162 0 : PyObject *py_client_pid;
15163 0 : PyObject *py_flags;
15164 0 : PyObject *py_user;
15165 0 : PyObject *py_domain;
15166 0 : PyObject *py_workstation;
15167 0 : PyObject *py_lm_resp;
15168 0 : PyObject *py_nt_resp;
15169 0 : PyObject *py_chal;
15170 0 : PyObject *py_logon_parameters;
15171 0 : PyObject *py_require_membership_of_sid;
15172 0 : const char *kwnames[] = {
15173 : "client_name", "client_pid", "flags", "user", "domain", "workstation", "lm_resp", "nt_resp", "chal", "logon_parameters", "require_membership_of_sid", NULL
15174 : };
15175 :
15176 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOO:wbint_PamAuthCrap", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_flags, &py_user, &py_domain, &py_workstation, &py_lm_resp, &py_nt_resp, &py_chal, &py_logon_parameters, &py_require_membership_of_sid)) {
15177 0 : return false;
15178 : }
15179 :
15180 0 : if (py_client_name == NULL) {
15181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_name");
15182 0 : return false;
15183 : }
15184 0 : r->in.client_name = talloc_ptrtype(r, r->in.client_name);
15185 0 : if (r->in.client_name == NULL) {
15186 0 : PyErr_NoMemory();
15187 0 : return false;
15188 : }
15189 : {
15190 0 : const char *test_str;
15191 0 : const char *talloc_str;
15192 0 : PyObject *unicode = NULL;
15193 0 : if (PyUnicode_Check(py_client_name)) {
15194 0 : unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
15195 0 : if (unicode == NULL) {
15196 0 : return false;
15197 : }
15198 0 : test_str = PyBytes_AS_STRING(unicode);
15199 0 : } else if (PyBytes_Check(py_client_name)) {
15200 0 : test_str = PyBytes_AS_STRING(py_client_name);
15201 : } else {
15202 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
15203 0 : return false;
15204 : }
15205 0 : talloc_str = talloc_strdup(r, test_str);
15206 0 : if (unicode != NULL) {
15207 0 : Py_DECREF(unicode);
15208 : }
15209 0 : if (talloc_str == NULL) {
15210 0 : PyErr_NoMemory();
15211 0 : return false;
15212 : }
15213 0 : r->in.client_name = talloc_str;
15214 : }
15215 0 : if (py_client_pid == NULL) {
15216 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_pid");
15217 0 : return false;
15218 : }
15219 : {
15220 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
15221 0 : if (PyLong_Check(py_client_pid)) {
15222 0 : unsigned long long test_var;
15223 0 : test_var = PyLong_AsUnsignedLongLong(py_client_pid);
15224 0 : if (PyErr_Occurred() != NULL) {
15225 0 : return false;
15226 : }
15227 0 : if (test_var > uint_max) {
15228 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15229 : PyLong_Type.tp_name, uint_max, test_var);
15230 0 : return false;
15231 : }
15232 0 : r->in.client_pid = test_var;
15233 : } else {
15234 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15235 : PyLong_Type.tp_name);
15236 0 : return false;
15237 : }
15238 : }
15239 0 : if (py_flags == NULL) {
15240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
15241 0 : return false;
15242 : }
15243 : {
15244 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
15245 0 : if (PyLong_Check(py_flags)) {
15246 0 : unsigned long long test_var;
15247 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
15248 0 : if (PyErr_Occurred() != NULL) {
15249 0 : return false;
15250 : }
15251 0 : if (test_var > uint_max) {
15252 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15253 : PyLong_Type.tp_name, uint_max, test_var);
15254 0 : return false;
15255 : }
15256 0 : r->in.flags = test_var;
15257 : } else {
15258 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15259 : PyLong_Type.tp_name);
15260 0 : return false;
15261 : }
15262 : }
15263 0 : if (py_user == NULL) {
15264 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.user");
15265 0 : return false;
15266 : }
15267 0 : r->in.user = talloc_ptrtype(r, r->in.user);
15268 0 : if (r->in.user == NULL) {
15269 0 : PyErr_NoMemory();
15270 0 : return false;
15271 : }
15272 : {
15273 0 : const char *test_str;
15274 0 : const char *talloc_str;
15275 0 : PyObject *unicode = NULL;
15276 0 : if (PyUnicode_Check(py_user)) {
15277 0 : unicode = PyUnicode_AsEncodedString(py_user, "utf-8", "ignore");
15278 0 : if (unicode == NULL) {
15279 0 : return false;
15280 : }
15281 0 : test_str = PyBytes_AS_STRING(unicode);
15282 0 : } else if (PyBytes_Check(py_user)) {
15283 0 : test_str = PyBytes_AS_STRING(py_user);
15284 : } else {
15285 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name);
15286 0 : return false;
15287 : }
15288 0 : talloc_str = talloc_strdup(r, test_str);
15289 0 : if (unicode != NULL) {
15290 0 : Py_DECREF(unicode);
15291 : }
15292 0 : if (talloc_str == NULL) {
15293 0 : PyErr_NoMemory();
15294 0 : return false;
15295 : }
15296 0 : r->in.user = talloc_str;
15297 : }
15298 0 : if (py_domain == NULL) {
15299 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain");
15300 0 : return false;
15301 : }
15302 0 : r->in.domain = talloc_ptrtype(r, r->in.domain);
15303 0 : if (r->in.domain == NULL) {
15304 0 : PyErr_NoMemory();
15305 0 : return false;
15306 : }
15307 : {
15308 0 : const char *test_str;
15309 0 : const char *talloc_str;
15310 0 : PyObject *unicode = NULL;
15311 0 : if (PyUnicode_Check(py_domain)) {
15312 0 : unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore");
15313 0 : if (unicode == NULL) {
15314 0 : return false;
15315 : }
15316 0 : test_str = PyBytes_AS_STRING(unicode);
15317 0 : } else if (PyBytes_Check(py_domain)) {
15318 0 : test_str = PyBytes_AS_STRING(py_domain);
15319 : } else {
15320 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name);
15321 0 : return false;
15322 : }
15323 0 : talloc_str = talloc_strdup(r, test_str);
15324 0 : if (unicode != NULL) {
15325 0 : Py_DECREF(unicode);
15326 : }
15327 0 : if (talloc_str == NULL) {
15328 0 : PyErr_NoMemory();
15329 0 : return false;
15330 : }
15331 0 : r->in.domain = talloc_str;
15332 : }
15333 0 : if (py_workstation == NULL) {
15334 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.workstation");
15335 0 : return false;
15336 : }
15337 0 : r->in.workstation = talloc_ptrtype(r, r->in.workstation);
15338 0 : if (r->in.workstation == NULL) {
15339 0 : PyErr_NoMemory();
15340 0 : return false;
15341 : }
15342 : {
15343 0 : const char *test_str;
15344 0 : const char *talloc_str;
15345 0 : PyObject *unicode = NULL;
15346 0 : if (PyUnicode_Check(py_workstation)) {
15347 0 : unicode = PyUnicode_AsEncodedString(py_workstation, "utf-8", "ignore");
15348 0 : if (unicode == NULL) {
15349 0 : return false;
15350 : }
15351 0 : test_str = PyBytes_AS_STRING(unicode);
15352 0 : } else if (PyBytes_Check(py_workstation)) {
15353 0 : test_str = PyBytes_AS_STRING(py_workstation);
15354 : } else {
15355 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_workstation)->tp_name);
15356 0 : return false;
15357 : }
15358 0 : talloc_str = talloc_strdup(r, test_str);
15359 0 : if (unicode != NULL) {
15360 0 : Py_DECREF(unicode);
15361 : }
15362 0 : if (talloc_str == NULL) {
15363 0 : PyErr_NoMemory();
15364 0 : return false;
15365 : }
15366 0 : r->in.workstation = talloc_str;
15367 : }
15368 0 : if (py_lm_resp == NULL) {
15369 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.lm_resp");
15370 0 : return false;
15371 : }
15372 0 : r->in.lm_resp = data_blob_talloc(r, PyBytes_AS_STRING(py_lm_resp), PyBytes_GET_SIZE(py_lm_resp));
15373 0 : if (py_nt_resp == NULL) {
15374 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.nt_resp");
15375 0 : return false;
15376 : }
15377 0 : r->in.nt_resp = data_blob_talloc(r, PyBytes_AS_STRING(py_nt_resp), PyBytes_GET_SIZE(py_nt_resp));
15378 0 : if (py_chal == NULL) {
15379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.chal");
15380 0 : return false;
15381 : }
15382 0 : r->in.chal = data_blob_talloc(r, PyBytes_AS_STRING(py_chal), PyBytes_GET_SIZE(py_chal));
15383 0 : if (py_logon_parameters == NULL) {
15384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.logon_parameters");
15385 0 : return false;
15386 : }
15387 : {
15388 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_parameters));
15389 0 : if (PyLong_Check(py_logon_parameters)) {
15390 0 : unsigned long long test_var;
15391 0 : test_var = PyLong_AsUnsignedLongLong(py_logon_parameters);
15392 0 : if (PyErr_Occurred() != NULL) {
15393 0 : return false;
15394 : }
15395 0 : if (test_var > uint_max) {
15396 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15397 : PyLong_Type.tp_name, uint_max, test_var);
15398 0 : return false;
15399 : }
15400 0 : r->in.logon_parameters = test_var;
15401 : } else {
15402 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15403 : PyLong_Type.tp_name);
15404 0 : return false;
15405 : }
15406 : }
15407 0 : if (py_require_membership_of_sid == NULL) {
15408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.require_membership_of_sid");
15409 0 : return false;
15410 : }
15411 0 : r->in.require_membership_of_sid = talloc_ptrtype(r, r->in.require_membership_of_sid);
15412 0 : if (r->in.require_membership_of_sid == NULL) {
15413 0 : PyErr_NoMemory();
15414 0 : return false;
15415 : }
15416 0 : PY_CHECK_TYPE(&wbint_SidArray_Type, py_require_membership_of_sid, return false;);
15417 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_require_membership_of_sid)) == NULL) {
15418 0 : PyErr_NoMemory();
15419 0 : return false;
15420 : }
15421 0 : r->in.require_membership_of_sid = (struct wbint_SidArray *)pytalloc_get_ptr(py_require_membership_of_sid);
15422 0 : return true;
15423 : }
15424 :
15425 0 : static PyObject *unpack_py_wbint_PamAuthCrap_args_out(struct wbint_PamAuthCrap *r)
15426 : {
15427 0 : PyObject *result;
15428 0 : PyObject *py_authoritative;
15429 0 : PyObject *py_validation;
15430 0 : result = PyTuple_New(2);
15431 0 : py_authoritative = PyLong_FromLong((uint16_t)(*r->out.authoritative));
15432 0 : PyTuple_SetItem(result, 0, py_authoritative);
15433 0 : py_validation = pytalloc_reference_ex(&wbint_PamAuthCrapValidation_Type, r->out.validation, r->out.validation);
15434 0 : PyTuple_SetItem(result, 1, py_validation);
15435 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
15436 0 : PyErr_SetNTSTATUS(r->out.result);
15437 0 : return NULL;
15438 : }
15439 :
15440 0 : return result;
15441 : }
15442 :
15443 :
15444 0 : static PyObject *py_wbint_PamLogOff_in_get_client_name(PyObject *obj, void *closure)
15445 : {
15446 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(obj);
15447 0 : PyObject *py_client_name;
15448 0 : if (object->in.client_name == NULL) {
15449 0 : Py_RETURN_NONE;
15450 : }
15451 0 : if (object->in.client_name == NULL) {
15452 0 : py_client_name = Py_None;
15453 0 : Py_INCREF(py_client_name);
15454 : } else {
15455 0 : py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
15456 : }
15457 0 : return py_client_name;
15458 : }
15459 :
15460 0 : static int py_wbint_PamLogOff_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
15461 : {
15462 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15463 0 : if (value == NULL) {
15464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_name");
15465 0 : return -1;
15466 : }
15467 0 : object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
15468 0 : if (object->in.client_name == NULL) {
15469 0 : PyErr_NoMemory();
15470 0 : return -1;
15471 : }
15472 : {
15473 0 : const char *test_str;
15474 0 : const char *talloc_str;
15475 0 : PyObject *unicode = NULL;
15476 0 : if (PyUnicode_Check(value)) {
15477 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
15478 0 : if (unicode == NULL) {
15479 0 : return -1;
15480 : }
15481 0 : test_str = PyBytes_AS_STRING(unicode);
15482 0 : } else if (PyBytes_Check(value)) {
15483 0 : test_str = PyBytes_AS_STRING(value);
15484 : } else {
15485 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
15486 0 : return -1;
15487 : }
15488 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
15489 0 : if (unicode != NULL) {
15490 0 : Py_DECREF(unicode);
15491 : }
15492 0 : if (talloc_str == NULL) {
15493 0 : PyErr_NoMemory();
15494 0 : return -1;
15495 : }
15496 0 : object->in.client_name = talloc_str;
15497 : }
15498 0 : return 0;
15499 : }
15500 :
15501 0 : static PyObject *py_wbint_PamLogOff_in_get_client_pid(PyObject *obj, void *closure)
15502 : {
15503 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(obj);
15504 0 : PyObject *py_client_pid;
15505 0 : py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
15506 0 : return py_client_pid;
15507 : }
15508 :
15509 0 : static int py_wbint_PamLogOff_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
15510 : {
15511 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15512 0 : if (value == NULL) {
15513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_pid");
15514 0 : return -1;
15515 : }
15516 : {
15517 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
15518 0 : if (PyLong_Check(value)) {
15519 0 : unsigned long long test_var;
15520 0 : test_var = PyLong_AsUnsignedLongLong(value);
15521 0 : if (PyErr_Occurred() != NULL) {
15522 0 : return -1;
15523 : }
15524 0 : if (test_var > uint_max) {
15525 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15526 : PyLong_Type.tp_name, uint_max, test_var);
15527 0 : return -1;
15528 : }
15529 0 : object->in.client_pid = test_var;
15530 : } else {
15531 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15532 : PyLong_Type.tp_name);
15533 0 : return -1;
15534 : }
15535 : }
15536 0 : return 0;
15537 : }
15538 :
15539 0 : static PyObject *py_wbint_PamLogOff_in_get_flags(PyObject *obj, void *closure)
15540 : {
15541 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(obj);
15542 0 : PyObject *py_flags;
15543 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
15544 0 : return py_flags;
15545 : }
15546 :
15547 0 : static int py_wbint_PamLogOff_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
15548 : {
15549 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15550 0 : if (value == NULL) {
15551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
15552 0 : return -1;
15553 : }
15554 : {
15555 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
15556 0 : if (PyLong_Check(value)) {
15557 0 : unsigned long long test_var;
15558 0 : test_var = PyLong_AsUnsignedLongLong(value);
15559 0 : if (PyErr_Occurred() != NULL) {
15560 0 : return -1;
15561 : }
15562 0 : if (test_var > uint_max) {
15563 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15564 : PyLong_Type.tp_name, uint_max, test_var);
15565 0 : return -1;
15566 : }
15567 0 : object->in.flags = test_var;
15568 : } else {
15569 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15570 : PyLong_Type.tp_name);
15571 0 : return -1;
15572 : }
15573 : }
15574 0 : return 0;
15575 : }
15576 :
15577 0 : static PyObject *py_wbint_PamLogOff_in_get_user(PyObject *obj, void *closure)
15578 : {
15579 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(obj);
15580 0 : PyObject *py_user;
15581 0 : if (object->in.user == NULL) {
15582 0 : Py_RETURN_NONE;
15583 : }
15584 0 : if (object->in.user == NULL) {
15585 0 : py_user = Py_None;
15586 0 : Py_INCREF(py_user);
15587 : } else {
15588 0 : py_user = PyUnicode_Decode(object->in.user, strlen(object->in.user), "utf-8", "ignore");
15589 : }
15590 0 : return py_user;
15591 : }
15592 :
15593 0 : static int py_wbint_PamLogOff_in_set_user(PyObject *py_obj, PyObject *value, void *closure)
15594 : {
15595 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15596 0 : if (value == NULL) {
15597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.user");
15598 0 : return -1;
15599 : }
15600 0 : object->in.user = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user);
15601 0 : if (object->in.user == NULL) {
15602 0 : PyErr_NoMemory();
15603 0 : return -1;
15604 : }
15605 : {
15606 0 : const char *test_str;
15607 0 : const char *talloc_str;
15608 0 : PyObject *unicode = NULL;
15609 0 : if (PyUnicode_Check(value)) {
15610 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
15611 0 : if (unicode == NULL) {
15612 0 : return -1;
15613 : }
15614 0 : test_str = PyBytes_AS_STRING(unicode);
15615 0 : } else if (PyBytes_Check(value)) {
15616 0 : test_str = PyBytes_AS_STRING(value);
15617 : } else {
15618 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
15619 0 : return -1;
15620 : }
15621 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
15622 0 : if (unicode != NULL) {
15623 0 : Py_DECREF(unicode);
15624 : }
15625 0 : if (talloc_str == NULL) {
15626 0 : PyErr_NoMemory();
15627 0 : return -1;
15628 : }
15629 0 : object->in.user = talloc_str;
15630 : }
15631 0 : return 0;
15632 : }
15633 :
15634 0 : static PyObject *py_wbint_PamLogOff_in_get_krb5ccname(PyObject *obj, void *closure)
15635 : {
15636 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(obj);
15637 0 : PyObject *py_krb5ccname;
15638 0 : if (object->in.krb5ccname == NULL) {
15639 0 : Py_RETURN_NONE;
15640 : }
15641 0 : if (object->in.krb5ccname == NULL) {
15642 0 : py_krb5ccname = Py_None;
15643 0 : Py_INCREF(py_krb5ccname);
15644 : } else {
15645 0 : py_krb5ccname = PyUnicode_Decode(object->in.krb5ccname, strlen(object->in.krb5ccname), "utf-8", "ignore");
15646 : }
15647 0 : return py_krb5ccname;
15648 : }
15649 :
15650 0 : static int py_wbint_PamLogOff_in_set_krb5ccname(PyObject *py_obj, PyObject *value, void *closure)
15651 : {
15652 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15653 0 : if (value == NULL) {
15654 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.krb5ccname");
15655 0 : return -1;
15656 : }
15657 0 : object->in.krb5ccname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.krb5ccname);
15658 0 : if (object->in.krb5ccname == NULL) {
15659 0 : PyErr_NoMemory();
15660 0 : return -1;
15661 : }
15662 : {
15663 0 : const char *test_str;
15664 0 : const char *talloc_str;
15665 0 : PyObject *unicode = NULL;
15666 0 : if (PyUnicode_Check(value)) {
15667 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
15668 0 : if (unicode == NULL) {
15669 0 : return -1;
15670 : }
15671 0 : test_str = PyBytes_AS_STRING(unicode);
15672 0 : } else if (PyBytes_Check(value)) {
15673 0 : test_str = PyBytes_AS_STRING(value);
15674 : } else {
15675 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
15676 0 : return -1;
15677 : }
15678 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
15679 0 : if (unicode != NULL) {
15680 0 : Py_DECREF(unicode);
15681 : }
15682 0 : if (talloc_str == NULL) {
15683 0 : PyErr_NoMemory();
15684 0 : return -1;
15685 : }
15686 0 : object->in.krb5ccname = talloc_str;
15687 : }
15688 0 : return 0;
15689 : }
15690 :
15691 0 : static PyObject *py_wbint_PamLogOff_in_get_uid(PyObject *obj, void *closure)
15692 : {
15693 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(obj);
15694 0 : PyObject *py_uid;
15695 0 : py_uid = PyLong_FromUnsignedLongLong(object->in.uid);
15696 0 : return py_uid;
15697 : }
15698 :
15699 0 : static int py_wbint_PamLogOff_in_set_uid(PyObject *py_obj, PyObject *value, void *closure)
15700 : {
15701 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15702 0 : if (value == NULL) {
15703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.uid");
15704 0 : return -1;
15705 : }
15706 : {
15707 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.uid));
15708 0 : if (PyLong_Check(value)) {
15709 0 : unsigned long long test_var;
15710 0 : test_var = PyLong_AsUnsignedLongLong(value);
15711 0 : if (PyErr_Occurred() != NULL) {
15712 0 : return -1;
15713 : }
15714 0 : if (test_var > uint_max) {
15715 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15716 : PyLong_Type.tp_name, uint_max, test_var);
15717 0 : return -1;
15718 : }
15719 0 : object->in.uid = test_var;
15720 : } else {
15721 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15722 : PyLong_Type.tp_name);
15723 0 : return -1;
15724 : }
15725 : }
15726 0 : return 0;
15727 : }
15728 :
15729 0 : static PyObject *py_wbint_PamLogOff_get_result(PyObject *obj, void *closure)
15730 : {
15731 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(obj);
15732 0 : PyObject *py_result;
15733 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15734 0 : return py_result;
15735 : }
15736 :
15737 0 : static int py_wbint_PamLogOff_set_result(PyObject *py_obj, PyObject *value, void *closure)
15738 : {
15739 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15740 0 : if (value == NULL) {
15741 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
15742 0 : return -1;
15743 : }
15744 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15745 0 : return 0;
15746 : }
15747 :
15748 : static PyGetSetDef py_wbint_PamLogOff_getsetters[] = {
15749 : {
15750 : .name = discard_const_p(char, "in_client_name"),
15751 : .get = py_wbint_PamLogOff_in_get_client_name,
15752 : .set = py_wbint_PamLogOff_in_set_client_name,
15753 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
15754 : },
15755 : {
15756 : .name = discard_const_p(char, "in_client_pid"),
15757 : .get = py_wbint_PamLogOff_in_get_client_pid,
15758 : .set = py_wbint_PamLogOff_in_set_client_pid,
15759 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
15760 : },
15761 : {
15762 : .name = discard_const_p(char, "in_flags"),
15763 : .get = py_wbint_PamLogOff_in_get_flags,
15764 : .set = py_wbint_PamLogOff_in_set_flags,
15765 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
15766 : },
15767 : {
15768 : .name = discard_const_p(char, "in_user"),
15769 : .get = py_wbint_PamLogOff_in_get_user,
15770 : .set = py_wbint_PamLogOff_in_set_user,
15771 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
15772 : },
15773 : {
15774 : .name = discard_const_p(char, "in_krb5ccname"),
15775 : .get = py_wbint_PamLogOff_in_get_krb5ccname,
15776 : .set = py_wbint_PamLogOff_in_set_krb5ccname,
15777 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
15778 : },
15779 : {
15780 : .name = discard_const_p(char, "in_uid"),
15781 : .get = py_wbint_PamLogOff_in_get_uid,
15782 : .set = py_wbint_PamLogOff_in_set_uid,
15783 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
15784 : },
15785 : {
15786 : .name = discard_const_p(char, "result"),
15787 : .get = py_wbint_PamLogOff_get_result,
15788 : .set = py_wbint_PamLogOff_set_result,
15789 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15790 : },
15791 : { .name = NULL }
15792 : };
15793 :
15794 0 : static PyObject *py_wbint_PamLogOff_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15795 : {
15796 0 : PyObject *self = pytalloc_new(struct wbint_PamLogOff, type);
15797 0 : return self;
15798 : }
15799 :
15800 0 : static PyObject *py_wbint_PamLogOff_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15801 : {
15802 :
15803 :
15804 0 : return PyLong_FromLong(24);
15805 : }
15806 :
15807 0 : static PyObject *py_wbint_PamLogOff_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15808 : {
15809 0 : const struct ndr_interface_call *call = NULL;
15810 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15811 0 : PyObject *ret = NULL;
15812 0 : struct ndr_push *push = NULL;
15813 0 : DATA_BLOB blob;
15814 0 : enum ndr_err_code err;
15815 :
15816 0 : if (ndr_table_winbind.num_calls < 25) {
15817 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamLogOff_ndr_pack");
15818 0 : return NULL;
15819 : }
15820 0 : call = &ndr_table_winbind.calls[24];
15821 :
15822 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15823 0 : if (push == NULL) {
15824 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15825 0 : return NULL;
15826 : }
15827 :
15828 0 : push->flags |= ndr_push_flags;
15829 :
15830 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15831 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15832 0 : TALLOC_FREE(push);
15833 0 : PyErr_SetNdrError(err);
15834 0 : return NULL;
15835 : }
15836 0 : blob = ndr_push_blob(push);
15837 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15838 0 : TALLOC_FREE(push);
15839 0 : return ret;
15840 : }
15841 :
15842 0 : static PyObject *py_wbint_PamLogOff_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15843 : {
15844 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15845 0 : PyObject *bigendian_obj = NULL;
15846 0 : PyObject *ndr64_obj = NULL;
15847 0 : libndr_flags ndr_push_flags = 0;
15848 :
15849 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15850 : discard_const_p(char *, kwnames),
15851 : &bigendian_obj,
15852 : &ndr64_obj)) {
15853 0 : return NULL;
15854 : }
15855 :
15856 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15857 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15858 : }
15859 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15860 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15861 : }
15862 :
15863 0 : return py_wbint_PamLogOff_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15864 : }
15865 :
15866 0 : static PyObject *py_wbint_PamLogOff_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15867 : {
15868 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15869 0 : PyObject *bigendian_obj = NULL;
15870 0 : PyObject *ndr64_obj = NULL;
15871 0 : libndr_flags ndr_push_flags = 0;
15872 :
15873 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15874 : discard_const_p(char *, kwnames),
15875 : &bigendian_obj,
15876 : &ndr64_obj)) {
15877 0 : return NULL;
15878 : }
15879 :
15880 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15881 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15882 : }
15883 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15884 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15885 : }
15886 :
15887 0 : return py_wbint_PamLogOff_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15888 : }
15889 :
15890 0 : static PyObject *py_wbint_PamLogOff_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
15891 : {
15892 0 : const struct ndr_interface_call *call = NULL;
15893 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
15894 0 : struct ndr_pull *pull = NULL;
15895 0 : enum ndr_err_code err;
15896 :
15897 0 : if (ndr_table_winbind.num_calls < 25) {
15898 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamLogOff_ndr_unpack");
15899 0 : return NULL;
15900 : }
15901 0 : call = &ndr_table_winbind.calls[24];
15902 :
15903 0 : pull = ndr_pull_init_blob(blob, object);
15904 0 : if (pull == NULL) {
15905 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15906 0 : return NULL;
15907 : }
15908 :
15909 0 : pull->flags |= ndr_pull_flags;
15910 :
15911 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15912 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15913 0 : TALLOC_FREE(pull);
15914 0 : PyErr_SetNdrError(err);
15915 0 : return NULL;
15916 : }
15917 0 : if (!allow_remaining) {
15918 0 : uint32_t highest_ofs;
15919 :
15920 0 : if (pull->offset > pull->relative_highest_offset) {
15921 0 : highest_ofs = pull->offset;
15922 : } else {
15923 0 : highest_ofs = pull->relative_highest_offset;
15924 : }
15925 0 : if (highest_ofs < pull->data_size) {
15926 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15927 : "not all bytes consumed ofs[%u] size[%u]",
15928 : highest_ofs, pull->data_size);
15929 0 : TALLOC_FREE(pull);
15930 0 : PyErr_SetNdrError(err);
15931 0 : return NULL;
15932 : }
15933 : }
15934 :
15935 0 : TALLOC_FREE(pull);
15936 0 : Py_RETURN_NONE;
15937 : }
15938 :
15939 0 : static PyObject *py_wbint_PamLogOff_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15940 : {
15941 0 : DATA_BLOB blob;
15942 0 : Py_ssize_t blob_length = 0;
15943 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15944 0 : PyObject *bigendian_obj = NULL;
15945 0 : PyObject *ndr64_obj = NULL;
15946 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15947 0 : PyObject *allow_remaining_obj = NULL;
15948 0 : bool allow_remaining = false;
15949 :
15950 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15951 : discard_const_p(char *, kwnames),
15952 : &blob.data, &blob_length,
15953 : &bigendian_obj,
15954 : &ndr64_obj,
15955 : &allow_remaining_obj)) {
15956 0 : return NULL;
15957 : }
15958 0 : blob.length = blob_length;
15959 :
15960 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15961 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15962 : }
15963 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15964 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15965 : }
15966 :
15967 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15968 0 : allow_remaining = true;
15969 : }
15970 :
15971 0 : return py_wbint_PamLogOff_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15972 : }
15973 :
15974 0 : static PyObject *py_wbint_PamLogOff_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15975 : {
15976 0 : DATA_BLOB blob;
15977 0 : Py_ssize_t blob_length = 0;
15978 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15979 0 : PyObject *bigendian_obj = NULL;
15980 0 : PyObject *ndr64_obj = NULL;
15981 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15982 0 : PyObject *allow_remaining_obj = NULL;
15983 0 : bool allow_remaining = false;
15984 :
15985 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15986 : discard_const_p(char *, kwnames),
15987 : &blob.data, &blob_length,
15988 : &bigendian_obj,
15989 : &ndr64_obj,
15990 : &allow_remaining_obj)) {
15991 0 : return NULL;
15992 : }
15993 0 : blob.length = blob_length;
15994 :
15995 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15996 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15997 : }
15998 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15999 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16000 : }
16001 :
16002 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16003 0 : allow_remaining = true;
16004 : }
16005 :
16006 0 : return py_wbint_PamLogOff_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16007 : }
16008 :
16009 0 : static PyObject *py_wbint_PamLogOff_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16010 : {
16011 0 : const struct ndr_interface_call *call = NULL;
16012 0 : struct wbint_PamLogOff *object = pytalloc_get_ptr(py_obj);
16013 0 : PyObject *ret;
16014 0 : char *retstr;
16015 :
16016 0 : if (ndr_table_winbind.num_calls < 25) {
16017 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamLogOff_ndr_print");
16018 0 : return NULL;
16019 : }
16020 0 : call = &ndr_table_winbind.calls[24];
16021 :
16022 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16023 0 : ret = PyUnicode_FromString(retstr);
16024 0 : TALLOC_FREE(retstr);
16025 :
16026 0 : return ret;
16027 : }
16028 :
16029 0 : static PyObject *py_wbint_PamLogOff_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16030 : {
16031 0 : return py_wbint_PamLogOff_ndr_print(py_obj, "wbint_PamLogOff_in", NDR_IN);
16032 : }
16033 :
16034 0 : static PyObject *py_wbint_PamLogOff_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16035 : {
16036 0 : return py_wbint_PamLogOff_ndr_print(py_obj, "wbint_PamLogOff_out", NDR_OUT);
16037 : }
16038 :
16039 : static PyMethodDef py_wbint_PamLogOff_methods[] = {
16040 : { "opnum", (PyCFunction)py_wbint_PamLogOff_ndr_opnum, METH_NOARGS|METH_CLASS,
16041 : "winbind.wbint_PamLogOff.opnum() -> 24 (0x18) " },
16042 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamLogOff_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16043 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16044 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamLogOff_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16045 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16046 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamLogOff_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16047 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16048 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamLogOff_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16049 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16050 : { "__ndr_print_in__", (PyCFunction)py_wbint_PamLogOff_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16051 : { "__ndr_print_out__", (PyCFunction)py_wbint_PamLogOff_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16052 : { NULL, NULL, 0, NULL }
16053 : };
16054 :
16055 :
16056 : static PyTypeObject wbint_PamLogOff_Type = {
16057 : PyVarObject_HEAD_INIT(NULL, 0)
16058 : .tp_name = "winbind.wbint_PamLogOff",
16059 : .tp_getset = py_wbint_PamLogOff_getsetters,
16060 : .tp_methods = py_wbint_PamLogOff_methods,
16061 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16062 : .tp_new = py_wbint_PamLogOff_new,
16063 : };
16064 :
16065 0 : static bool pack_py_wbint_PamLogOff_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamLogOff *r)
16066 : {
16067 0 : PyObject *py_client_name;
16068 0 : PyObject *py_client_pid;
16069 0 : PyObject *py_flags;
16070 0 : PyObject *py_user;
16071 0 : PyObject *py_krb5ccname;
16072 0 : PyObject *py_uid;
16073 0 : const char *kwnames[] = {
16074 : "client_name", "client_pid", "flags", "user", "krb5ccname", "uid", NULL
16075 : };
16076 :
16077 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:wbint_PamLogOff", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_flags, &py_user, &py_krb5ccname, &py_uid)) {
16078 0 : return false;
16079 : }
16080 :
16081 0 : if (py_client_name == NULL) {
16082 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_name");
16083 0 : return false;
16084 : }
16085 0 : r->in.client_name = talloc_ptrtype(r, r->in.client_name);
16086 0 : if (r->in.client_name == NULL) {
16087 0 : PyErr_NoMemory();
16088 0 : return false;
16089 : }
16090 : {
16091 0 : const char *test_str;
16092 0 : const char *talloc_str;
16093 0 : PyObject *unicode = NULL;
16094 0 : if (PyUnicode_Check(py_client_name)) {
16095 0 : unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
16096 0 : if (unicode == NULL) {
16097 0 : return false;
16098 : }
16099 0 : test_str = PyBytes_AS_STRING(unicode);
16100 0 : } else if (PyBytes_Check(py_client_name)) {
16101 0 : test_str = PyBytes_AS_STRING(py_client_name);
16102 : } else {
16103 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
16104 0 : return false;
16105 : }
16106 0 : talloc_str = talloc_strdup(r, test_str);
16107 0 : if (unicode != NULL) {
16108 0 : Py_DECREF(unicode);
16109 : }
16110 0 : if (talloc_str == NULL) {
16111 0 : PyErr_NoMemory();
16112 0 : return false;
16113 : }
16114 0 : r->in.client_name = talloc_str;
16115 : }
16116 0 : if (py_client_pid == NULL) {
16117 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_pid");
16118 0 : return false;
16119 : }
16120 : {
16121 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
16122 0 : if (PyLong_Check(py_client_pid)) {
16123 0 : unsigned long long test_var;
16124 0 : test_var = PyLong_AsUnsignedLongLong(py_client_pid);
16125 0 : if (PyErr_Occurred() != NULL) {
16126 0 : return false;
16127 : }
16128 0 : if (test_var > uint_max) {
16129 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16130 : PyLong_Type.tp_name, uint_max, test_var);
16131 0 : return false;
16132 : }
16133 0 : r->in.client_pid = test_var;
16134 : } else {
16135 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16136 : PyLong_Type.tp_name);
16137 0 : return false;
16138 : }
16139 : }
16140 0 : if (py_flags == NULL) {
16141 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
16142 0 : return false;
16143 : }
16144 : {
16145 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
16146 0 : if (PyLong_Check(py_flags)) {
16147 0 : unsigned long long test_var;
16148 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
16149 0 : if (PyErr_Occurred() != NULL) {
16150 0 : return false;
16151 : }
16152 0 : if (test_var > uint_max) {
16153 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16154 : PyLong_Type.tp_name, uint_max, test_var);
16155 0 : return false;
16156 : }
16157 0 : r->in.flags = test_var;
16158 : } else {
16159 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16160 : PyLong_Type.tp_name);
16161 0 : return false;
16162 : }
16163 : }
16164 0 : if (py_user == NULL) {
16165 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.user");
16166 0 : return false;
16167 : }
16168 0 : r->in.user = talloc_ptrtype(r, r->in.user);
16169 0 : if (r->in.user == NULL) {
16170 0 : PyErr_NoMemory();
16171 0 : return false;
16172 : }
16173 : {
16174 0 : const char *test_str;
16175 0 : const char *talloc_str;
16176 0 : PyObject *unicode = NULL;
16177 0 : if (PyUnicode_Check(py_user)) {
16178 0 : unicode = PyUnicode_AsEncodedString(py_user, "utf-8", "ignore");
16179 0 : if (unicode == NULL) {
16180 0 : return false;
16181 : }
16182 0 : test_str = PyBytes_AS_STRING(unicode);
16183 0 : } else if (PyBytes_Check(py_user)) {
16184 0 : test_str = PyBytes_AS_STRING(py_user);
16185 : } else {
16186 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name);
16187 0 : return false;
16188 : }
16189 0 : talloc_str = talloc_strdup(r, test_str);
16190 0 : if (unicode != NULL) {
16191 0 : Py_DECREF(unicode);
16192 : }
16193 0 : if (talloc_str == NULL) {
16194 0 : PyErr_NoMemory();
16195 0 : return false;
16196 : }
16197 0 : r->in.user = talloc_str;
16198 : }
16199 0 : if (py_krb5ccname == NULL) {
16200 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.krb5ccname");
16201 0 : return false;
16202 : }
16203 0 : r->in.krb5ccname = talloc_ptrtype(r, r->in.krb5ccname);
16204 0 : if (r->in.krb5ccname == NULL) {
16205 0 : PyErr_NoMemory();
16206 0 : return false;
16207 : }
16208 : {
16209 0 : const char *test_str;
16210 0 : const char *talloc_str;
16211 0 : PyObject *unicode = NULL;
16212 0 : if (PyUnicode_Check(py_krb5ccname)) {
16213 0 : unicode = PyUnicode_AsEncodedString(py_krb5ccname, "utf-8", "ignore");
16214 0 : if (unicode == NULL) {
16215 0 : return false;
16216 : }
16217 0 : test_str = PyBytes_AS_STRING(unicode);
16218 0 : } else if (PyBytes_Check(py_krb5ccname)) {
16219 0 : test_str = PyBytes_AS_STRING(py_krb5ccname);
16220 : } else {
16221 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_krb5ccname)->tp_name);
16222 0 : return false;
16223 : }
16224 0 : talloc_str = talloc_strdup(r, test_str);
16225 0 : if (unicode != NULL) {
16226 0 : Py_DECREF(unicode);
16227 : }
16228 0 : if (talloc_str == NULL) {
16229 0 : PyErr_NoMemory();
16230 0 : return false;
16231 : }
16232 0 : r->in.krb5ccname = talloc_str;
16233 : }
16234 0 : if (py_uid == NULL) {
16235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.uid");
16236 0 : return false;
16237 : }
16238 : {
16239 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.uid));
16240 0 : if (PyLong_Check(py_uid)) {
16241 0 : unsigned long long test_var;
16242 0 : test_var = PyLong_AsUnsignedLongLong(py_uid);
16243 0 : if (PyErr_Occurred() != NULL) {
16244 0 : return false;
16245 : }
16246 0 : if (test_var > uint_max) {
16247 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16248 : PyLong_Type.tp_name, uint_max, test_var);
16249 0 : return false;
16250 : }
16251 0 : r->in.uid = test_var;
16252 : } else {
16253 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16254 : PyLong_Type.tp_name);
16255 0 : return false;
16256 : }
16257 : }
16258 0 : return true;
16259 : }
16260 :
16261 0 : static PyObject *unpack_py_wbint_PamLogOff_args_out(struct wbint_PamLogOff *r)
16262 : {
16263 0 : PyObject *result;
16264 0 : result = Py_None;
16265 0 : Py_INCREF(result);
16266 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
16267 0 : PyErr_SetNTSTATUS(r->out.result);
16268 0 : return NULL;
16269 : }
16270 :
16271 0 : return result;
16272 : }
16273 :
16274 :
16275 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_client_name(PyObject *obj, void *closure)
16276 : {
16277 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16278 0 : PyObject *py_client_name;
16279 0 : if (object->in.client_name == NULL) {
16280 0 : Py_RETURN_NONE;
16281 : }
16282 0 : if (object->in.client_name == NULL) {
16283 0 : py_client_name = Py_None;
16284 0 : Py_INCREF(py_client_name);
16285 : } else {
16286 0 : py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
16287 : }
16288 0 : return py_client_name;
16289 : }
16290 :
16291 0 : static int py_wbint_PamAuthCrapChangePassword_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
16292 : {
16293 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16294 0 : if (value == NULL) {
16295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_name");
16296 0 : return -1;
16297 : }
16298 0 : object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
16299 0 : if (object->in.client_name == NULL) {
16300 0 : PyErr_NoMemory();
16301 0 : return -1;
16302 : }
16303 : {
16304 0 : const char *test_str;
16305 0 : const char *talloc_str;
16306 0 : PyObject *unicode = NULL;
16307 0 : if (PyUnicode_Check(value)) {
16308 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
16309 0 : if (unicode == NULL) {
16310 0 : return -1;
16311 : }
16312 0 : test_str = PyBytes_AS_STRING(unicode);
16313 0 : } else if (PyBytes_Check(value)) {
16314 0 : test_str = PyBytes_AS_STRING(value);
16315 : } else {
16316 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
16317 0 : return -1;
16318 : }
16319 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
16320 0 : if (unicode != NULL) {
16321 0 : Py_DECREF(unicode);
16322 : }
16323 0 : if (talloc_str == NULL) {
16324 0 : PyErr_NoMemory();
16325 0 : return -1;
16326 : }
16327 0 : object->in.client_name = talloc_str;
16328 : }
16329 0 : return 0;
16330 : }
16331 :
16332 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_client_pid(PyObject *obj, void *closure)
16333 : {
16334 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16335 0 : PyObject *py_client_pid;
16336 0 : py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
16337 0 : return py_client_pid;
16338 : }
16339 :
16340 0 : static int py_wbint_PamAuthCrapChangePassword_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
16341 : {
16342 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16343 0 : if (value == NULL) {
16344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_pid");
16345 0 : return -1;
16346 : }
16347 : {
16348 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
16349 0 : if (PyLong_Check(value)) {
16350 0 : unsigned long long test_var;
16351 0 : test_var = PyLong_AsUnsignedLongLong(value);
16352 0 : if (PyErr_Occurred() != NULL) {
16353 0 : return -1;
16354 : }
16355 0 : if (test_var > uint_max) {
16356 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16357 : PyLong_Type.tp_name, uint_max, test_var);
16358 0 : return -1;
16359 : }
16360 0 : object->in.client_pid = test_var;
16361 : } else {
16362 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16363 : PyLong_Type.tp_name);
16364 0 : return -1;
16365 : }
16366 : }
16367 0 : return 0;
16368 : }
16369 :
16370 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_user(PyObject *obj, void *closure)
16371 : {
16372 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16373 0 : PyObject *py_user;
16374 0 : if (object->in.user == NULL) {
16375 0 : Py_RETURN_NONE;
16376 : }
16377 0 : if (object->in.user == NULL) {
16378 0 : py_user = Py_None;
16379 0 : Py_INCREF(py_user);
16380 : } else {
16381 0 : py_user = PyUnicode_Decode(object->in.user, strlen(object->in.user), "utf-8", "ignore");
16382 : }
16383 0 : return py_user;
16384 : }
16385 :
16386 0 : static int py_wbint_PamAuthCrapChangePassword_in_set_user(PyObject *py_obj, PyObject *value, void *closure)
16387 : {
16388 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16389 0 : if (value == NULL) {
16390 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.user");
16391 0 : return -1;
16392 : }
16393 0 : object->in.user = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user);
16394 0 : if (object->in.user == NULL) {
16395 0 : PyErr_NoMemory();
16396 0 : return -1;
16397 : }
16398 : {
16399 0 : const char *test_str;
16400 0 : const char *talloc_str;
16401 0 : PyObject *unicode = NULL;
16402 0 : if (PyUnicode_Check(value)) {
16403 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
16404 0 : if (unicode == NULL) {
16405 0 : return -1;
16406 : }
16407 0 : test_str = PyBytes_AS_STRING(unicode);
16408 0 : } else if (PyBytes_Check(value)) {
16409 0 : test_str = PyBytes_AS_STRING(value);
16410 : } else {
16411 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
16412 0 : return -1;
16413 : }
16414 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
16415 0 : if (unicode != NULL) {
16416 0 : Py_DECREF(unicode);
16417 : }
16418 0 : if (talloc_str == NULL) {
16419 0 : PyErr_NoMemory();
16420 0 : return -1;
16421 : }
16422 0 : object->in.user = talloc_str;
16423 : }
16424 0 : return 0;
16425 : }
16426 :
16427 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_domain(PyObject *obj, void *closure)
16428 : {
16429 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16430 0 : PyObject *py_domain;
16431 0 : if (object->in.domain == NULL) {
16432 0 : Py_RETURN_NONE;
16433 : }
16434 0 : if (object->in.domain == NULL) {
16435 0 : py_domain = Py_None;
16436 0 : Py_INCREF(py_domain);
16437 : } else {
16438 0 : py_domain = PyUnicode_Decode(object->in.domain, strlen(object->in.domain), "utf-8", "ignore");
16439 : }
16440 0 : return py_domain;
16441 : }
16442 :
16443 0 : static int py_wbint_PamAuthCrapChangePassword_in_set_domain(PyObject *py_obj, PyObject *value, void *closure)
16444 : {
16445 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16446 0 : if (value == NULL) {
16447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain");
16448 0 : return -1;
16449 : }
16450 0 : object->in.domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain);
16451 0 : if (object->in.domain == NULL) {
16452 0 : PyErr_NoMemory();
16453 0 : return -1;
16454 : }
16455 : {
16456 0 : const char *test_str;
16457 0 : const char *talloc_str;
16458 0 : PyObject *unicode = NULL;
16459 0 : if (PyUnicode_Check(value)) {
16460 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
16461 0 : if (unicode == NULL) {
16462 0 : return -1;
16463 : }
16464 0 : test_str = PyBytes_AS_STRING(unicode);
16465 0 : } else if (PyBytes_Check(value)) {
16466 0 : test_str = PyBytes_AS_STRING(value);
16467 : } else {
16468 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
16469 0 : return -1;
16470 : }
16471 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
16472 0 : if (unicode != NULL) {
16473 0 : Py_DECREF(unicode);
16474 : }
16475 0 : if (talloc_str == NULL) {
16476 0 : PyErr_NoMemory();
16477 0 : return -1;
16478 : }
16479 0 : object->in.domain = talloc_str;
16480 : }
16481 0 : return 0;
16482 : }
16483 :
16484 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_new_nt_pswd(PyObject *obj, void *closure)
16485 : {
16486 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16487 0 : PyObject *py_new_nt_pswd;
16488 0 : py_new_nt_pswd = PyBytes_FromStringAndSize((char *)(object->in.new_nt_pswd).data, (object->in.new_nt_pswd).length);
16489 0 : return py_new_nt_pswd;
16490 : }
16491 :
16492 0 : static int py_wbint_PamAuthCrapChangePassword_in_set_new_nt_pswd(PyObject *py_obj, PyObject *value, void *closure)
16493 : {
16494 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16495 0 : if (value == NULL) {
16496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.new_nt_pswd");
16497 0 : return -1;
16498 : }
16499 0 : object->in.new_nt_pswd = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
16500 0 : return 0;
16501 : }
16502 :
16503 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_old_nt_hash_enc(PyObject *obj, void *closure)
16504 : {
16505 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16506 0 : PyObject *py_old_nt_hash_enc;
16507 0 : py_old_nt_hash_enc = PyBytes_FromStringAndSize((char *)(object->in.old_nt_hash_enc).data, (object->in.old_nt_hash_enc).length);
16508 0 : return py_old_nt_hash_enc;
16509 : }
16510 :
16511 0 : static int py_wbint_PamAuthCrapChangePassword_in_set_old_nt_hash_enc(PyObject *py_obj, PyObject *value, void *closure)
16512 : {
16513 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16514 0 : if (value == NULL) {
16515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.old_nt_hash_enc");
16516 0 : return -1;
16517 : }
16518 0 : object->in.old_nt_hash_enc = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
16519 0 : return 0;
16520 : }
16521 :
16522 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_new_lm_pswd(PyObject *obj, void *closure)
16523 : {
16524 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16525 0 : PyObject *py_new_lm_pswd;
16526 0 : py_new_lm_pswd = PyBytes_FromStringAndSize((char *)(object->in.new_lm_pswd).data, (object->in.new_lm_pswd).length);
16527 0 : return py_new_lm_pswd;
16528 : }
16529 :
16530 0 : static int py_wbint_PamAuthCrapChangePassword_in_set_new_lm_pswd(PyObject *py_obj, PyObject *value, void *closure)
16531 : {
16532 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16533 0 : if (value == NULL) {
16534 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.new_lm_pswd");
16535 0 : return -1;
16536 : }
16537 0 : object->in.new_lm_pswd = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
16538 0 : return 0;
16539 : }
16540 :
16541 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_in_get_old_lm_hash_enc(PyObject *obj, void *closure)
16542 : {
16543 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16544 0 : PyObject *py_old_lm_hash_enc;
16545 0 : py_old_lm_hash_enc = PyBytes_FromStringAndSize((char *)(object->in.old_lm_hash_enc).data, (object->in.old_lm_hash_enc).length);
16546 0 : return py_old_lm_hash_enc;
16547 : }
16548 :
16549 0 : static int py_wbint_PamAuthCrapChangePassword_in_set_old_lm_hash_enc(PyObject *py_obj, PyObject *value, void *closure)
16550 : {
16551 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16552 0 : if (value == NULL) {
16553 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.old_lm_hash_enc");
16554 0 : return -1;
16555 : }
16556 0 : object->in.old_lm_hash_enc = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
16557 0 : return 0;
16558 : }
16559 :
16560 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_get_result(PyObject *obj, void *closure)
16561 : {
16562 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(obj);
16563 0 : PyObject *py_result;
16564 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
16565 0 : return py_result;
16566 : }
16567 :
16568 0 : static int py_wbint_PamAuthCrapChangePassword_set_result(PyObject *py_obj, PyObject *value, void *closure)
16569 : {
16570 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16571 0 : if (value == NULL) {
16572 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
16573 0 : return -1;
16574 : }
16575 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
16576 0 : return 0;
16577 : }
16578 :
16579 : static PyGetSetDef py_wbint_PamAuthCrapChangePassword_getsetters[] = {
16580 : {
16581 : .name = discard_const_p(char, "in_client_name"),
16582 : .get = py_wbint_PamAuthCrapChangePassword_in_get_client_name,
16583 : .set = py_wbint_PamAuthCrapChangePassword_in_set_client_name,
16584 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
16585 : },
16586 : {
16587 : .name = discard_const_p(char, "in_client_pid"),
16588 : .get = py_wbint_PamAuthCrapChangePassword_in_get_client_pid,
16589 : .set = py_wbint_PamAuthCrapChangePassword_in_set_client_pid,
16590 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
16591 : },
16592 : {
16593 : .name = discard_const_p(char, "in_user"),
16594 : .get = py_wbint_PamAuthCrapChangePassword_in_get_user,
16595 : .set = py_wbint_PamAuthCrapChangePassword_in_set_user,
16596 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
16597 : },
16598 : {
16599 : .name = discard_const_p(char, "in_domain"),
16600 : .get = py_wbint_PamAuthCrapChangePassword_in_get_domain,
16601 : .set = py_wbint_PamAuthCrapChangePassword_in_set_domain,
16602 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
16603 : },
16604 : {
16605 : .name = discard_const_p(char, "in_new_nt_pswd"),
16606 : .get = py_wbint_PamAuthCrapChangePassword_in_get_new_nt_pswd,
16607 : .set = py_wbint_PamAuthCrapChangePassword_in_set_new_nt_pswd,
16608 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
16609 : },
16610 : {
16611 : .name = discard_const_p(char, "in_old_nt_hash_enc"),
16612 : .get = py_wbint_PamAuthCrapChangePassword_in_get_old_nt_hash_enc,
16613 : .set = py_wbint_PamAuthCrapChangePassword_in_set_old_nt_hash_enc,
16614 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
16615 : },
16616 : {
16617 : .name = discard_const_p(char, "in_new_lm_pswd"),
16618 : .get = py_wbint_PamAuthCrapChangePassword_in_get_new_lm_pswd,
16619 : .set = py_wbint_PamAuthCrapChangePassword_in_set_new_lm_pswd,
16620 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
16621 : },
16622 : {
16623 : .name = discard_const_p(char, "in_old_lm_hash_enc"),
16624 : .get = py_wbint_PamAuthCrapChangePassword_in_get_old_lm_hash_enc,
16625 : .set = py_wbint_PamAuthCrapChangePassword_in_set_old_lm_hash_enc,
16626 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
16627 : },
16628 : {
16629 : .name = discard_const_p(char, "result"),
16630 : .get = py_wbint_PamAuthCrapChangePassword_get_result,
16631 : .set = py_wbint_PamAuthCrapChangePassword_set_result,
16632 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
16633 : },
16634 : { .name = NULL }
16635 : };
16636 :
16637 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16638 : {
16639 0 : PyObject *self = pytalloc_new(struct wbint_PamAuthCrapChangePassword, type);
16640 0 : return self;
16641 : }
16642 :
16643 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16644 : {
16645 :
16646 :
16647 0 : return PyLong_FromLong(25);
16648 : }
16649 :
16650 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
16651 : {
16652 0 : const struct ndr_interface_call *call = NULL;
16653 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16654 0 : PyObject *ret = NULL;
16655 0 : struct ndr_push *push = NULL;
16656 0 : DATA_BLOB blob;
16657 0 : enum ndr_err_code err;
16658 :
16659 0 : if (ndr_table_winbind.num_calls < 26) {
16660 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrapChangePassword_ndr_pack");
16661 0 : return NULL;
16662 : }
16663 0 : call = &ndr_table_winbind.calls[25];
16664 :
16665 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16666 0 : if (push == NULL) {
16667 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16668 0 : return NULL;
16669 : }
16670 :
16671 0 : push->flags |= ndr_push_flags;
16672 :
16673 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16674 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16675 0 : TALLOC_FREE(push);
16676 0 : PyErr_SetNdrError(err);
16677 0 : return NULL;
16678 : }
16679 0 : blob = ndr_push_blob(push);
16680 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16681 0 : TALLOC_FREE(push);
16682 0 : return ret;
16683 : }
16684 :
16685 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16686 : {
16687 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16688 0 : PyObject *bigendian_obj = NULL;
16689 0 : PyObject *ndr64_obj = NULL;
16690 0 : libndr_flags ndr_push_flags = 0;
16691 :
16692 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16693 : discard_const_p(char *, kwnames),
16694 : &bigendian_obj,
16695 : &ndr64_obj)) {
16696 0 : return NULL;
16697 : }
16698 :
16699 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16700 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16701 : }
16702 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16703 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16704 : }
16705 :
16706 0 : return py_wbint_PamAuthCrapChangePassword_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16707 : }
16708 :
16709 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16710 : {
16711 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16712 0 : PyObject *bigendian_obj = NULL;
16713 0 : PyObject *ndr64_obj = NULL;
16714 0 : libndr_flags ndr_push_flags = 0;
16715 :
16716 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16717 : discard_const_p(char *, kwnames),
16718 : &bigendian_obj,
16719 : &ndr64_obj)) {
16720 0 : return NULL;
16721 : }
16722 :
16723 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16724 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16725 : }
16726 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16727 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16728 : }
16729 :
16730 0 : return py_wbint_PamAuthCrapChangePassword_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16731 : }
16732 :
16733 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
16734 : {
16735 0 : const struct ndr_interface_call *call = NULL;
16736 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16737 0 : struct ndr_pull *pull = NULL;
16738 0 : enum ndr_err_code err;
16739 :
16740 0 : if (ndr_table_winbind.num_calls < 26) {
16741 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrapChangePassword_ndr_unpack");
16742 0 : return NULL;
16743 : }
16744 0 : call = &ndr_table_winbind.calls[25];
16745 :
16746 0 : pull = ndr_pull_init_blob(blob, object);
16747 0 : if (pull == NULL) {
16748 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16749 0 : return NULL;
16750 : }
16751 :
16752 0 : pull->flags |= ndr_pull_flags;
16753 :
16754 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16755 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16756 0 : TALLOC_FREE(pull);
16757 0 : PyErr_SetNdrError(err);
16758 0 : return NULL;
16759 : }
16760 0 : if (!allow_remaining) {
16761 0 : uint32_t highest_ofs;
16762 :
16763 0 : if (pull->offset > pull->relative_highest_offset) {
16764 0 : highest_ofs = pull->offset;
16765 : } else {
16766 0 : highest_ofs = pull->relative_highest_offset;
16767 : }
16768 0 : if (highest_ofs < pull->data_size) {
16769 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16770 : "not all bytes consumed ofs[%u] size[%u]",
16771 : highest_ofs, pull->data_size);
16772 0 : TALLOC_FREE(pull);
16773 0 : PyErr_SetNdrError(err);
16774 0 : return NULL;
16775 : }
16776 : }
16777 :
16778 0 : TALLOC_FREE(pull);
16779 0 : Py_RETURN_NONE;
16780 : }
16781 :
16782 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16783 : {
16784 0 : DATA_BLOB blob;
16785 0 : Py_ssize_t blob_length = 0;
16786 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16787 0 : PyObject *bigendian_obj = NULL;
16788 0 : PyObject *ndr64_obj = NULL;
16789 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16790 0 : PyObject *allow_remaining_obj = NULL;
16791 0 : bool allow_remaining = false;
16792 :
16793 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16794 : discard_const_p(char *, kwnames),
16795 : &blob.data, &blob_length,
16796 : &bigendian_obj,
16797 : &ndr64_obj,
16798 : &allow_remaining_obj)) {
16799 0 : return NULL;
16800 : }
16801 0 : blob.length = blob_length;
16802 :
16803 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16804 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16805 : }
16806 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16807 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16808 : }
16809 :
16810 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16811 0 : allow_remaining = true;
16812 : }
16813 :
16814 0 : return py_wbint_PamAuthCrapChangePassword_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16815 : }
16816 :
16817 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16818 : {
16819 0 : DATA_BLOB blob;
16820 0 : Py_ssize_t blob_length = 0;
16821 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16822 0 : PyObject *bigendian_obj = NULL;
16823 0 : PyObject *ndr64_obj = NULL;
16824 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16825 0 : PyObject *allow_remaining_obj = NULL;
16826 0 : bool allow_remaining = false;
16827 :
16828 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16829 : discard_const_p(char *, kwnames),
16830 : &blob.data, &blob_length,
16831 : &bigendian_obj,
16832 : &ndr64_obj,
16833 : &allow_remaining_obj)) {
16834 0 : return NULL;
16835 : }
16836 0 : blob.length = blob_length;
16837 :
16838 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16839 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16840 : }
16841 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16842 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16843 : }
16844 :
16845 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16846 0 : allow_remaining = true;
16847 : }
16848 :
16849 0 : return py_wbint_PamAuthCrapChangePassword_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16850 : }
16851 :
16852 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16853 : {
16854 0 : const struct ndr_interface_call *call = NULL;
16855 0 : struct wbint_PamAuthCrapChangePassword *object = pytalloc_get_ptr(py_obj);
16856 0 : PyObject *ret;
16857 0 : char *retstr;
16858 :
16859 0 : if (ndr_table_winbind.num_calls < 26) {
16860 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthCrapChangePassword_ndr_print");
16861 0 : return NULL;
16862 : }
16863 0 : call = &ndr_table_winbind.calls[25];
16864 :
16865 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16866 0 : ret = PyUnicode_FromString(retstr);
16867 0 : TALLOC_FREE(retstr);
16868 :
16869 0 : return ret;
16870 : }
16871 :
16872 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16873 : {
16874 0 : return py_wbint_PamAuthCrapChangePassword_ndr_print(py_obj, "wbint_PamAuthCrapChangePassword_in", NDR_IN);
16875 : }
16876 :
16877 0 : static PyObject *py_wbint_PamAuthCrapChangePassword_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16878 : {
16879 0 : return py_wbint_PamAuthCrapChangePassword_ndr_print(py_obj, "wbint_PamAuthCrapChangePassword_out", NDR_OUT);
16880 : }
16881 :
16882 : static PyMethodDef py_wbint_PamAuthCrapChangePassword_methods[] = {
16883 : { "opnum", (PyCFunction)py_wbint_PamAuthCrapChangePassword_ndr_opnum, METH_NOARGS|METH_CLASS,
16884 : "winbind.wbint_PamAuthCrapChangePassword.opnum() -> 25 (0x19) " },
16885 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapChangePassword_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16886 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16887 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapChangePassword_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16888 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16889 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapChangePassword_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16890 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16891 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthCrapChangePassword_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16892 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16893 : { "__ndr_print_in__", (PyCFunction)py_wbint_PamAuthCrapChangePassword_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16894 : { "__ndr_print_out__", (PyCFunction)py_wbint_PamAuthCrapChangePassword_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16895 : { NULL, NULL, 0, NULL }
16896 : };
16897 :
16898 :
16899 : static PyTypeObject wbint_PamAuthCrapChangePassword_Type = {
16900 : PyVarObject_HEAD_INIT(NULL, 0)
16901 : .tp_name = "winbind.wbint_PamAuthCrapChangePassword",
16902 : .tp_getset = py_wbint_PamAuthCrapChangePassword_getsetters,
16903 : .tp_methods = py_wbint_PamAuthCrapChangePassword_methods,
16904 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16905 : .tp_new = py_wbint_PamAuthCrapChangePassword_new,
16906 : };
16907 :
16908 0 : static bool pack_py_wbint_PamAuthCrapChangePassword_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamAuthCrapChangePassword *r)
16909 : {
16910 0 : PyObject *py_client_name;
16911 0 : PyObject *py_client_pid;
16912 0 : PyObject *py_user;
16913 0 : PyObject *py_domain;
16914 0 : PyObject *py_new_nt_pswd;
16915 0 : PyObject *py_old_nt_hash_enc;
16916 0 : PyObject *py_new_lm_pswd;
16917 0 : PyObject *py_old_lm_hash_enc;
16918 0 : const char *kwnames[] = {
16919 : "client_name", "client_pid", "user", "domain", "new_nt_pswd", "old_nt_hash_enc", "new_lm_pswd", "old_lm_hash_enc", NULL
16920 : };
16921 :
16922 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:wbint_PamAuthCrapChangePassword", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_user, &py_domain, &py_new_nt_pswd, &py_old_nt_hash_enc, &py_new_lm_pswd, &py_old_lm_hash_enc)) {
16923 0 : return false;
16924 : }
16925 :
16926 0 : if (py_client_name == NULL) {
16927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_name");
16928 0 : return false;
16929 : }
16930 0 : r->in.client_name = talloc_ptrtype(r, r->in.client_name);
16931 0 : if (r->in.client_name == NULL) {
16932 0 : PyErr_NoMemory();
16933 0 : return false;
16934 : }
16935 : {
16936 0 : const char *test_str;
16937 0 : const char *talloc_str;
16938 0 : PyObject *unicode = NULL;
16939 0 : if (PyUnicode_Check(py_client_name)) {
16940 0 : unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
16941 0 : if (unicode == NULL) {
16942 0 : return false;
16943 : }
16944 0 : test_str = PyBytes_AS_STRING(unicode);
16945 0 : } else if (PyBytes_Check(py_client_name)) {
16946 0 : test_str = PyBytes_AS_STRING(py_client_name);
16947 : } else {
16948 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
16949 0 : return false;
16950 : }
16951 0 : talloc_str = talloc_strdup(r, test_str);
16952 0 : if (unicode != NULL) {
16953 0 : Py_DECREF(unicode);
16954 : }
16955 0 : if (talloc_str == NULL) {
16956 0 : PyErr_NoMemory();
16957 0 : return false;
16958 : }
16959 0 : r->in.client_name = talloc_str;
16960 : }
16961 0 : if (py_client_pid == NULL) {
16962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_pid");
16963 0 : return false;
16964 : }
16965 : {
16966 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
16967 0 : if (PyLong_Check(py_client_pid)) {
16968 0 : unsigned long long test_var;
16969 0 : test_var = PyLong_AsUnsignedLongLong(py_client_pid);
16970 0 : if (PyErr_Occurred() != NULL) {
16971 0 : return false;
16972 : }
16973 0 : if (test_var > uint_max) {
16974 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16975 : PyLong_Type.tp_name, uint_max, test_var);
16976 0 : return false;
16977 : }
16978 0 : r->in.client_pid = test_var;
16979 : } else {
16980 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16981 : PyLong_Type.tp_name);
16982 0 : return false;
16983 : }
16984 : }
16985 0 : if (py_user == NULL) {
16986 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.user");
16987 0 : return false;
16988 : }
16989 0 : r->in.user = talloc_ptrtype(r, r->in.user);
16990 0 : if (r->in.user == NULL) {
16991 0 : PyErr_NoMemory();
16992 0 : return false;
16993 : }
16994 : {
16995 0 : const char *test_str;
16996 0 : const char *talloc_str;
16997 0 : PyObject *unicode = NULL;
16998 0 : if (PyUnicode_Check(py_user)) {
16999 0 : unicode = PyUnicode_AsEncodedString(py_user, "utf-8", "ignore");
17000 0 : if (unicode == NULL) {
17001 0 : return false;
17002 : }
17003 0 : test_str = PyBytes_AS_STRING(unicode);
17004 0 : } else if (PyBytes_Check(py_user)) {
17005 0 : test_str = PyBytes_AS_STRING(py_user);
17006 : } else {
17007 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name);
17008 0 : return false;
17009 : }
17010 0 : talloc_str = talloc_strdup(r, test_str);
17011 0 : if (unicode != NULL) {
17012 0 : Py_DECREF(unicode);
17013 : }
17014 0 : if (talloc_str == NULL) {
17015 0 : PyErr_NoMemory();
17016 0 : return false;
17017 : }
17018 0 : r->in.user = talloc_str;
17019 : }
17020 0 : if (py_domain == NULL) {
17021 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain");
17022 0 : return false;
17023 : }
17024 0 : r->in.domain = talloc_ptrtype(r, r->in.domain);
17025 0 : if (r->in.domain == NULL) {
17026 0 : PyErr_NoMemory();
17027 0 : return false;
17028 : }
17029 : {
17030 0 : const char *test_str;
17031 0 : const char *talloc_str;
17032 0 : PyObject *unicode = NULL;
17033 0 : if (PyUnicode_Check(py_domain)) {
17034 0 : unicode = PyUnicode_AsEncodedString(py_domain, "utf-8", "ignore");
17035 0 : if (unicode == NULL) {
17036 0 : return false;
17037 : }
17038 0 : test_str = PyBytes_AS_STRING(unicode);
17039 0 : } else if (PyBytes_Check(py_domain)) {
17040 0 : test_str = PyBytes_AS_STRING(py_domain);
17041 : } else {
17042 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domain)->tp_name);
17043 0 : return false;
17044 : }
17045 0 : talloc_str = talloc_strdup(r, test_str);
17046 0 : if (unicode != NULL) {
17047 0 : Py_DECREF(unicode);
17048 : }
17049 0 : if (talloc_str == NULL) {
17050 0 : PyErr_NoMemory();
17051 0 : return false;
17052 : }
17053 0 : r->in.domain = talloc_str;
17054 : }
17055 0 : if (py_new_nt_pswd == NULL) {
17056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.new_nt_pswd");
17057 0 : return false;
17058 : }
17059 0 : r->in.new_nt_pswd = data_blob_talloc(r, PyBytes_AS_STRING(py_new_nt_pswd), PyBytes_GET_SIZE(py_new_nt_pswd));
17060 0 : if (py_old_nt_hash_enc == NULL) {
17061 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.old_nt_hash_enc");
17062 0 : return false;
17063 : }
17064 0 : r->in.old_nt_hash_enc = data_blob_talloc(r, PyBytes_AS_STRING(py_old_nt_hash_enc), PyBytes_GET_SIZE(py_old_nt_hash_enc));
17065 0 : if (py_new_lm_pswd == NULL) {
17066 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.new_lm_pswd");
17067 0 : return false;
17068 : }
17069 0 : r->in.new_lm_pswd = data_blob_talloc(r, PyBytes_AS_STRING(py_new_lm_pswd), PyBytes_GET_SIZE(py_new_lm_pswd));
17070 0 : if (py_old_lm_hash_enc == NULL) {
17071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.old_lm_hash_enc");
17072 0 : return false;
17073 : }
17074 0 : r->in.old_lm_hash_enc = data_blob_talloc(r, PyBytes_AS_STRING(py_old_lm_hash_enc), PyBytes_GET_SIZE(py_old_lm_hash_enc));
17075 0 : return true;
17076 : }
17077 :
17078 0 : static PyObject *unpack_py_wbint_PamAuthCrapChangePassword_args_out(struct wbint_PamAuthCrapChangePassword *r)
17079 : {
17080 0 : PyObject *result;
17081 0 : result = Py_None;
17082 0 : Py_INCREF(result);
17083 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
17084 0 : PyErr_SetNTSTATUS(r->out.result);
17085 0 : return NULL;
17086 : }
17087 :
17088 0 : return result;
17089 : }
17090 :
17091 :
17092 0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_client_name(PyObject *obj, void *closure)
17093 : {
17094 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17095 0 : PyObject *py_client_name;
17096 0 : if (object->in.client_name == NULL) {
17097 0 : Py_RETURN_NONE;
17098 : }
17099 0 : if (object->in.client_name == NULL) {
17100 0 : py_client_name = Py_None;
17101 0 : Py_INCREF(py_client_name);
17102 : } else {
17103 0 : py_client_name = PyUnicode_Decode(object->in.client_name, strlen(object->in.client_name), "utf-8", "ignore");
17104 : }
17105 0 : return py_client_name;
17106 : }
17107 :
17108 0 : static int py_wbint_PamAuthChangePassword_in_set_client_name(PyObject *py_obj, PyObject *value, void *closure)
17109 : {
17110 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17111 0 : if (value == NULL) {
17112 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_name");
17113 0 : return -1;
17114 : }
17115 0 : object->in.client_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.client_name);
17116 0 : if (object->in.client_name == NULL) {
17117 0 : PyErr_NoMemory();
17118 0 : return -1;
17119 : }
17120 : {
17121 0 : const char *test_str;
17122 0 : const char *talloc_str;
17123 0 : PyObject *unicode = NULL;
17124 0 : if (PyUnicode_Check(value)) {
17125 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17126 0 : if (unicode == NULL) {
17127 0 : return -1;
17128 : }
17129 0 : test_str = PyBytes_AS_STRING(unicode);
17130 0 : } else if (PyBytes_Check(value)) {
17131 0 : test_str = PyBytes_AS_STRING(value);
17132 : } else {
17133 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17134 0 : return -1;
17135 : }
17136 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17137 0 : if (unicode != NULL) {
17138 0 : Py_DECREF(unicode);
17139 : }
17140 0 : if (talloc_str == NULL) {
17141 0 : PyErr_NoMemory();
17142 0 : return -1;
17143 : }
17144 0 : object->in.client_name = talloc_str;
17145 : }
17146 0 : return 0;
17147 : }
17148 :
17149 0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_client_pid(PyObject *obj, void *closure)
17150 : {
17151 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17152 0 : PyObject *py_client_pid;
17153 0 : py_client_pid = PyLong_FromUnsignedLongLong(object->in.client_pid);
17154 0 : return py_client_pid;
17155 : }
17156 :
17157 0 : static int py_wbint_PamAuthChangePassword_in_set_client_pid(PyObject *py_obj, PyObject *value, void *closure)
17158 : {
17159 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17160 0 : if (value == NULL) {
17161 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_pid");
17162 0 : return -1;
17163 : }
17164 : {
17165 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_pid));
17166 0 : if (PyLong_Check(value)) {
17167 0 : unsigned long long test_var;
17168 0 : test_var = PyLong_AsUnsignedLongLong(value);
17169 0 : if (PyErr_Occurred() != NULL) {
17170 0 : return -1;
17171 : }
17172 0 : if (test_var > uint_max) {
17173 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17174 : PyLong_Type.tp_name, uint_max, test_var);
17175 0 : return -1;
17176 : }
17177 0 : object->in.client_pid = test_var;
17178 : } else {
17179 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17180 : PyLong_Type.tp_name);
17181 0 : return -1;
17182 : }
17183 : }
17184 0 : return 0;
17185 : }
17186 :
17187 0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_flags(PyObject *obj, void *closure)
17188 : {
17189 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17190 0 : PyObject *py_flags;
17191 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
17192 0 : return py_flags;
17193 : }
17194 :
17195 0 : static int py_wbint_PamAuthChangePassword_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
17196 : {
17197 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17198 0 : if (value == NULL) {
17199 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
17200 0 : return -1;
17201 : }
17202 : {
17203 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
17204 0 : if (PyLong_Check(value)) {
17205 0 : unsigned long long test_var;
17206 0 : test_var = PyLong_AsUnsignedLongLong(value);
17207 0 : if (PyErr_Occurred() != NULL) {
17208 0 : return -1;
17209 : }
17210 0 : if (test_var > uint_max) {
17211 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17212 : PyLong_Type.tp_name, uint_max, test_var);
17213 0 : return -1;
17214 : }
17215 0 : object->in.flags = test_var;
17216 : } else {
17217 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17218 : PyLong_Type.tp_name);
17219 0 : return -1;
17220 : }
17221 : }
17222 0 : return 0;
17223 : }
17224 :
17225 0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_user(PyObject *obj, void *closure)
17226 : {
17227 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17228 0 : PyObject *py_user;
17229 0 : if (object->in.user == NULL) {
17230 0 : Py_RETURN_NONE;
17231 : }
17232 0 : if (object->in.user == NULL) {
17233 0 : py_user = Py_None;
17234 0 : Py_INCREF(py_user);
17235 : } else {
17236 0 : py_user = PyUnicode_Decode(object->in.user, strlen(object->in.user), "utf-8", "ignore");
17237 : }
17238 0 : return py_user;
17239 : }
17240 :
17241 0 : static int py_wbint_PamAuthChangePassword_in_set_user(PyObject *py_obj, PyObject *value, void *closure)
17242 : {
17243 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17244 0 : if (value == NULL) {
17245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.user");
17246 0 : return -1;
17247 : }
17248 0 : object->in.user = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user);
17249 0 : if (object->in.user == NULL) {
17250 0 : PyErr_NoMemory();
17251 0 : return -1;
17252 : }
17253 : {
17254 0 : const char *test_str;
17255 0 : const char *talloc_str;
17256 0 : PyObject *unicode = NULL;
17257 0 : if (PyUnicode_Check(value)) {
17258 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17259 0 : if (unicode == NULL) {
17260 0 : return -1;
17261 : }
17262 0 : test_str = PyBytes_AS_STRING(unicode);
17263 0 : } else if (PyBytes_Check(value)) {
17264 0 : test_str = PyBytes_AS_STRING(value);
17265 : } else {
17266 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17267 0 : return -1;
17268 : }
17269 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17270 0 : if (unicode != NULL) {
17271 0 : Py_DECREF(unicode);
17272 : }
17273 0 : if (talloc_str == NULL) {
17274 0 : PyErr_NoMemory();
17275 0 : return -1;
17276 : }
17277 0 : object->in.user = talloc_str;
17278 : }
17279 0 : return 0;
17280 : }
17281 :
17282 0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_old_password(PyObject *obj, void *closure)
17283 : {
17284 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17285 0 : PyObject *py_old_password;
17286 0 : if (object->in.old_password == NULL) {
17287 0 : Py_RETURN_NONE;
17288 : }
17289 0 : if (object->in.old_password == NULL) {
17290 0 : py_old_password = Py_None;
17291 0 : Py_INCREF(py_old_password);
17292 : } else {
17293 0 : py_old_password = PyUnicode_Decode(object->in.old_password, strlen(object->in.old_password), "utf-8", "ignore");
17294 : }
17295 0 : return py_old_password;
17296 : }
17297 :
17298 0 : static int py_wbint_PamAuthChangePassword_in_set_old_password(PyObject *py_obj, PyObject *value, void *closure)
17299 : {
17300 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17301 0 : if (value == NULL) {
17302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.old_password");
17303 0 : return -1;
17304 : }
17305 0 : object->in.old_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.old_password);
17306 0 : if (object->in.old_password == NULL) {
17307 0 : PyErr_NoMemory();
17308 0 : return -1;
17309 : }
17310 : {
17311 0 : const char *test_str;
17312 0 : const char *talloc_str;
17313 0 : PyObject *unicode = NULL;
17314 0 : if (PyUnicode_Check(value)) {
17315 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17316 0 : if (unicode == NULL) {
17317 0 : return -1;
17318 : }
17319 0 : test_str = PyBytes_AS_STRING(unicode);
17320 0 : } else if (PyBytes_Check(value)) {
17321 0 : test_str = PyBytes_AS_STRING(value);
17322 : } else {
17323 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17324 0 : return -1;
17325 : }
17326 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17327 0 : if (unicode != NULL) {
17328 0 : Py_DECREF(unicode);
17329 : }
17330 0 : if (talloc_str == NULL) {
17331 0 : PyErr_NoMemory();
17332 0 : return -1;
17333 : }
17334 0 : object->in.old_password = talloc_str;
17335 : }
17336 0 : return 0;
17337 : }
17338 :
17339 0 : static PyObject *py_wbint_PamAuthChangePassword_in_get_new_password(PyObject *obj, void *closure)
17340 : {
17341 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17342 0 : PyObject *py_new_password;
17343 0 : if (object->in.new_password == NULL) {
17344 0 : Py_RETURN_NONE;
17345 : }
17346 0 : if (object->in.new_password == NULL) {
17347 0 : py_new_password = Py_None;
17348 0 : Py_INCREF(py_new_password);
17349 : } else {
17350 0 : py_new_password = PyUnicode_Decode(object->in.new_password, strlen(object->in.new_password), "utf-8", "ignore");
17351 : }
17352 0 : return py_new_password;
17353 : }
17354 :
17355 0 : static int py_wbint_PamAuthChangePassword_in_set_new_password(PyObject *py_obj, PyObject *value, void *closure)
17356 : {
17357 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17358 0 : if (value == NULL) {
17359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.new_password");
17360 0 : return -1;
17361 : }
17362 0 : object->in.new_password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_password);
17363 0 : if (object->in.new_password == NULL) {
17364 0 : PyErr_NoMemory();
17365 0 : return -1;
17366 : }
17367 : {
17368 0 : const char *test_str;
17369 0 : const char *talloc_str;
17370 0 : PyObject *unicode = NULL;
17371 0 : if (PyUnicode_Check(value)) {
17372 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
17373 0 : if (unicode == NULL) {
17374 0 : return -1;
17375 : }
17376 0 : test_str = PyBytes_AS_STRING(unicode);
17377 0 : } else if (PyBytes_Check(value)) {
17378 0 : test_str = PyBytes_AS_STRING(value);
17379 : } else {
17380 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
17381 0 : return -1;
17382 : }
17383 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
17384 0 : if (unicode != NULL) {
17385 0 : Py_DECREF(unicode);
17386 : }
17387 0 : if (talloc_str == NULL) {
17388 0 : PyErr_NoMemory();
17389 0 : return -1;
17390 : }
17391 0 : object->in.new_password = talloc_str;
17392 : }
17393 0 : return 0;
17394 : }
17395 :
17396 0 : static PyObject *py_wbint_PamAuthChangePassword_out_get_dominfo(PyObject *obj, void *closure)
17397 : {
17398 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17399 0 : PyObject *py_dominfo;
17400 0 : if (object->out.dominfo == NULL) {
17401 0 : Py_RETURN_NONE;
17402 : }
17403 0 : if (*object->out.dominfo == NULL) {
17404 0 : py_dominfo = Py_None;
17405 0 : Py_INCREF(py_dominfo);
17406 : } else {
17407 0 : py_dominfo = pytalloc_reference_ex(samr_DomInfo1_Type, *object->out.dominfo, *object->out.dominfo);
17408 : }
17409 0 : return py_dominfo;
17410 : }
17411 :
17412 0 : static int py_wbint_PamAuthChangePassword_out_set_dominfo(PyObject *py_obj, PyObject *value, void *closure)
17413 : {
17414 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17415 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dominfo));
17416 0 : if (value == NULL) {
17417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.dominfo");
17418 0 : return -1;
17419 : }
17420 0 : object->out.dominfo = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dominfo);
17421 0 : if (object->out.dominfo == NULL) {
17422 0 : PyErr_NoMemory();
17423 0 : return -1;
17424 : }
17425 0 : if (value == Py_None) {
17426 0 : *object->out.dominfo = NULL;
17427 : } else {
17428 0 : *object->out.dominfo = NULL;
17429 0 : PY_CHECK_TYPE(samr_DomInfo1_Type, value, return -1;);
17430 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17431 0 : PyErr_NoMemory();
17432 0 : return -1;
17433 : }
17434 0 : *object->out.dominfo = (struct samr_DomInfo1 *)pytalloc_get_ptr(value);
17435 : }
17436 0 : return 0;
17437 : }
17438 :
17439 0 : static PyObject *py_wbint_PamAuthChangePassword_out_get_reject_reason(PyObject *obj, void *closure)
17440 : {
17441 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17442 0 : PyObject *py_reject_reason;
17443 0 : if (object->out.reject_reason == NULL) {
17444 0 : Py_RETURN_NONE;
17445 : }
17446 0 : py_reject_reason = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.reject_reason));
17447 0 : return py_reject_reason;
17448 : }
17449 :
17450 0 : static int py_wbint_PamAuthChangePassword_out_set_reject_reason(PyObject *py_obj, PyObject *value, void *closure)
17451 : {
17452 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17453 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.reject_reason));
17454 0 : if (value == NULL) {
17455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.reject_reason");
17456 0 : return -1;
17457 : }
17458 0 : object->out.reject_reason = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.reject_reason);
17459 0 : if (object->out.reject_reason == NULL) {
17460 0 : PyErr_NoMemory();
17461 0 : return -1;
17462 : }
17463 : {
17464 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.reject_reason));
17465 0 : if (PyLong_Check(value)) {
17466 0 : unsigned long long test_var;
17467 0 : test_var = PyLong_AsUnsignedLongLong(value);
17468 0 : if (PyErr_Occurred() != NULL) {
17469 0 : return -1;
17470 : }
17471 0 : if (test_var > uint_max) {
17472 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17473 : PyLong_Type.tp_name, uint_max, test_var);
17474 0 : return -1;
17475 : }
17476 0 : *object->out.reject_reason = test_var;
17477 : } else {
17478 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17479 : PyLong_Type.tp_name);
17480 0 : return -1;
17481 : }
17482 : }
17483 0 : return 0;
17484 : }
17485 :
17486 0 : static PyObject *py_wbint_PamAuthChangePassword_get_result(PyObject *obj, void *closure)
17487 : {
17488 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(obj);
17489 0 : PyObject *py_result;
17490 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17491 0 : return py_result;
17492 : }
17493 :
17494 0 : static int py_wbint_PamAuthChangePassword_set_result(PyObject *py_obj, PyObject *value, void *closure)
17495 : {
17496 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17497 0 : if (value == NULL) {
17498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
17499 0 : return -1;
17500 : }
17501 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
17502 0 : return 0;
17503 : }
17504 :
17505 : static PyGetSetDef py_wbint_PamAuthChangePassword_getsetters[] = {
17506 : {
17507 : .name = discard_const_p(char, "in_client_name"),
17508 : .get = py_wbint_PamAuthChangePassword_in_get_client_name,
17509 : .set = py_wbint_PamAuthChangePassword_in_set_client_name,
17510 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
17511 : },
17512 : {
17513 : .name = discard_const_p(char, "in_client_pid"),
17514 : .get = py_wbint_PamAuthChangePassword_in_get_client_pid,
17515 : .set = py_wbint_PamAuthChangePassword_in_set_client_pid,
17516 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
17517 : },
17518 : {
17519 : .name = discard_const_p(char, "in_flags"),
17520 : .get = py_wbint_PamAuthChangePassword_in_get_flags,
17521 : .set = py_wbint_PamAuthChangePassword_in_set_flags,
17522 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17523 : },
17524 : {
17525 : .name = discard_const_p(char, "in_user"),
17526 : .get = py_wbint_PamAuthChangePassword_in_get_user,
17527 : .set = py_wbint_PamAuthChangePassword_in_set_user,
17528 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
17529 : },
17530 : {
17531 : .name = discard_const_p(char, "in_old_password"),
17532 : .get = py_wbint_PamAuthChangePassword_in_get_old_password,
17533 : .set = py_wbint_PamAuthChangePassword_in_set_old_password,
17534 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
17535 : },
17536 : {
17537 : .name = discard_const_p(char, "in_new_password"),
17538 : .get = py_wbint_PamAuthChangePassword_in_get_new_password,
17539 : .set = py_wbint_PamAuthChangePassword_in_set_new_password,
17540 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
17541 : },
17542 : {
17543 : .name = discard_const_p(char, "out_dominfo"),
17544 : .get = py_wbint_PamAuthChangePassword_out_get_dominfo,
17545 : .set = py_wbint_PamAuthChangePassword_out_set_dominfo,
17546 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomInfo1")
17547 : },
17548 : {
17549 : .name = discard_const_p(char, "out_reject_reason"),
17550 : .get = py_wbint_PamAuthChangePassword_out_get_reject_reason,
17551 : .set = py_wbint_PamAuthChangePassword_out_set_reject_reason,
17552 : .doc = discard_const_p(char, "PIDL-generated element of base type samPwdChangeReason")
17553 : },
17554 : {
17555 : .name = discard_const_p(char, "result"),
17556 : .get = py_wbint_PamAuthChangePassword_get_result,
17557 : .set = py_wbint_PamAuthChangePassword_set_result,
17558 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
17559 : },
17560 : { .name = NULL }
17561 : };
17562 :
17563 0 : static PyObject *py_wbint_PamAuthChangePassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17564 : {
17565 0 : PyObject *self = pytalloc_new(struct wbint_PamAuthChangePassword, type);
17566 0 : struct wbint_PamAuthChangePassword *_self = (struct wbint_PamAuthChangePassword *)pytalloc_get_ptr(self);
17567 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17568 : /* a pointer to a NULL pointer */
17569 0 : _self->out.dominfo = talloc_zero(mem_ctx, struct samr_DomInfo1 *);
17570 0 : _self->out.reject_reason = talloc_zero(mem_ctx, enum samPwdChangeReason);
17571 0 : return self;
17572 : }
17573 :
17574 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17575 : {
17576 :
17577 :
17578 0 : return PyLong_FromLong(26);
17579 : }
17580 :
17581 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
17582 : {
17583 0 : const struct ndr_interface_call *call = NULL;
17584 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17585 0 : PyObject *ret = NULL;
17586 0 : struct ndr_push *push = NULL;
17587 0 : DATA_BLOB blob;
17588 0 : enum ndr_err_code err;
17589 :
17590 0 : if (ndr_table_winbind.num_calls < 27) {
17591 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthChangePassword_ndr_pack");
17592 0 : return NULL;
17593 : }
17594 0 : call = &ndr_table_winbind.calls[26];
17595 :
17596 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17597 0 : if (push == NULL) {
17598 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17599 0 : return NULL;
17600 : }
17601 :
17602 0 : push->flags |= ndr_push_flags;
17603 :
17604 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17605 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17606 0 : TALLOC_FREE(push);
17607 0 : PyErr_SetNdrError(err);
17608 0 : return NULL;
17609 : }
17610 0 : blob = ndr_push_blob(push);
17611 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17612 0 : TALLOC_FREE(push);
17613 0 : return ret;
17614 : }
17615 :
17616 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17617 : {
17618 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17619 0 : PyObject *bigendian_obj = NULL;
17620 0 : PyObject *ndr64_obj = NULL;
17621 0 : libndr_flags ndr_push_flags = 0;
17622 :
17623 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17624 : discard_const_p(char *, kwnames),
17625 : &bigendian_obj,
17626 : &ndr64_obj)) {
17627 0 : return NULL;
17628 : }
17629 :
17630 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17631 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17632 : }
17633 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17634 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17635 : }
17636 :
17637 0 : return py_wbint_PamAuthChangePassword_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17638 : }
17639 :
17640 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17641 : {
17642 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17643 0 : PyObject *bigendian_obj = NULL;
17644 0 : PyObject *ndr64_obj = NULL;
17645 0 : libndr_flags ndr_push_flags = 0;
17646 :
17647 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17648 : discard_const_p(char *, kwnames),
17649 : &bigendian_obj,
17650 : &ndr64_obj)) {
17651 0 : return NULL;
17652 : }
17653 :
17654 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17655 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17656 : }
17657 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17658 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17659 : }
17660 :
17661 0 : return py_wbint_PamAuthChangePassword_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17662 : }
17663 :
17664 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
17665 : {
17666 0 : const struct ndr_interface_call *call = NULL;
17667 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17668 0 : struct ndr_pull *pull = NULL;
17669 0 : enum ndr_err_code err;
17670 :
17671 0 : if (ndr_table_winbind.num_calls < 27) {
17672 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthChangePassword_ndr_unpack");
17673 0 : return NULL;
17674 : }
17675 0 : call = &ndr_table_winbind.calls[26];
17676 :
17677 0 : pull = ndr_pull_init_blob(blob, object);
17678 0 : if (pull == NULL) {
17679 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17680 0 : return NULL;
17681 : }
17682 :
17683 0 : pull->flags |= ndr_pull_flags;
17684 :
17685 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17686 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17687 0 : TALLOC_FREE(pull);
17688 0 : PyErr_SetNdrError(err);
17689 0 : return NULL;
17690 : }
17691 0 : if (!allow_remaining) {
17692 0 : uint32_t highest_ofs;
17693 :
17694 0 : if (pull->offset > pull->relative_highest_offset) {
17695 0 : highest_ofs = pull->offset;
17696 : } else {
17697 0 : highest_ofs = pull->relative_highest_offset;
17698 : }
17699 0 : if (highest_ofs < pull->data_size) {
17700 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17701 : "not all bytes consumed ofs[%u] size[%u]",
17702 : highest_ofs, pull->data_size);
17703 0 : TALLOC_FREE(pull);
17704 0 : PyErr_SetNdrError(err);
17705 0 : return NULL;
17706 : }
17707 : }
17708 :
17709 0 : TALLOC_FREE(pull);
17710 0 : Py_RETURN_NONE;
17711 : }
17712 :
17713 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17714 : {
17715 0 : DATA_BLOB blob;
17716 0 : Py_ssize_t blob_length = 0;
17717 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17718 0 : PyObject *bigendian_obj = NULL;
17719 0 : PyObject *ndr64_obj = NULL;
17720 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17721 0 : PyObject *allow_remaining_obj = NULL;
17722 0 : bool allow_remaining = false;
17723 :
17724 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17725 : discard_const_p(char *, kwnames),
17726 : &blob.data, &blob_length,
17727 : &bigendian_obj,
17728 : &ndr64_obj,
17729 : &allow_remaining_obj)) {
17730 0 : return NULL;
17731 : }
17732 0 : blob.length = blob_length;
17733 :
17734 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17735 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17736 : }
17737 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17738 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17739 : }
17740 :
17741 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17742 0 : allow_remaining = true;
17743 : }
17744 :
17745 0 : return py_wbint_PamAuthChangePassword_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17746 : }
17747 :
17748 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17749 : {
17750 0 : DATA_BLOB blob;
17751 0 : Py_ssize_t blob_length = 0;
17752 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17753 0 : PyObject *bigendian_obj = NULL;
17754 0 : PyObject *ndr64_obj = NULL;
17755 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17756 0 : PyObject *allow_remaining_obj = NULL;
17757 0 : bool allow_remaining = false;
17758 :
17759 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17760 : discard_const_p(char *, kwnames),
17761 : &blob.data, &blob_length,
17762 : &bigendian_obj,
17763 : &ndr64_obj,
17764 : &allow_remaining_obj)) {
17765 0 : return NULL;
17766 : }
17767 0 : blob.length = blob_length;
17768 :
17769 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17770 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17771 : }
17772 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17773 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17774 : }
17775 :
17776 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17777 0 : allow_remaining = true;
17778 : }
17779 :
17780 0 : return py_wbint_PamAuthChangePassword_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17781 : }
17782 :
17783 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
17784 : {
17785 0 : const struct ndr_interface_call *call = NULL;
17786 0 : struct wbint_PamAuthChangePassword *object = pytalloc_get_ptr(py_obj);
17787 0 : PyObject *ret;
17788 0 : char *retstr;
17789 :
17790 0 : if (ndr_table_winbind.num_calls < 27) {
17791 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_PamAuthChangePassword_ndr_print");
17792 0 : return NULL;
17793 : }
17794 0 : call = &ndr_table_winbind.calls[26];
17795 :
17796 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17797 0 : ret = PyUnicode_FromString(retstr);
17798 0 : TALLOC_FREE(retstr);
17799 :
17800 0 : return ret;
17801 : }
17802 :
17803 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17804 : {
17805 0 : return py_wbint_PamAuthChangePassword_ndr_print(py_obj, "wbint_PamAuthChangePassword_in", NDR_IN);
17806 : }
17807 :
17808 0 : static PyObject *py_wbint_PamAuthChangePassword_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17809 : {
17810 0 : return py_wbint_PamAuthChangePassword_ndr_print(py_obj, "wbint_PamAuthChangePassword_out", NDR_OUT);
17811 : }
17812 :
17813 : static PyMethodDef py_wbint_PamAuthChangePassword_methods[] = {
17814 : { "opnum", (PyCFunction)py_wbint_PamAuthChangePassword_ndr_opnum, METH_NOARGS|METH_CLASS,
17815 : "winbind.wbint_PamAuthChangePassword.opnum() -> 26 (0x1a) " },
17816 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthChangePassword_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17817 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17818 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthChangePassword_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17819 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17820 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthChangePassword_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17821 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17822 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_PamAuthChangePassword_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17823 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17824 : { "__ndr_print_in__", (PyCFunction)py_wbint_PamAuthChangePassword_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17825 : { "__ndr_print_out__", (PyCFunction)py_wbint_PamAuthChangePassword_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17826 : { NULL, NULL, 0, NULL }
17827 : };
17828 :
17829 :
17830 : static PyTypeObject wbint_PamAuthChangePassword_Type = {
17831 : PyVarObject_HEAD_INIT(NULL, 0)
17832 : .tp_name = "winbind.wbint_PamAuthChangePassword",
17833 : .tp_getset = py_wbint_PamAuthChangePassword_getsetters,
17834 : .tp_methods = py_wbint_PamAuthChangePassword_methods,
17835 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17836 : .tp_new = py_wbint_PamAuthChangePassword_new,
17837 : };
17838 :
17839 0 : static bool pack_py_wbint_PamAuthChangePassword_args_in(PyObject *args, PyObject *kwargs, struct wbint_PamAuthChangePassword *r)
17840 : {
17841 0 : PyObject *py_client_name;
17842 0 : PyObject *py_client_pid;
17843 0 : PyObject *py_flags;
17844 0 : PyObject *py_user;
17845 0 : PyObject *py_old_password;
17846 0 : PyObject *py_new_password;
17847 0 : const char *kwnames[] = {
17848 : "client_name", "client_pid", "flags", "user", "old_password", "new_password", NULL
17849 : };
17850 :
17851 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:wbint_PamAuthChangePassword", discard_const_p(char *, kwnames), &py_client_name, &py_client_pid, &py_flags, &py_user, &py_old_password, &py_new_password)) {
17852 0 : return false;
17853 : }
17854 :
17855 0 : if (py_client_name == NULL) {
17856 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_name");
17857 0 : return false;
17858 : }
17859 0 : r->in.client_name = talloc_ptrtype(r, r->in.client_name);
17860 0 : if (r->in.client_name == NULL) {
17861 0 : PyErr_NoMemory();
17862 0 : return false;
17863 : }
17864 : {
17865 0 : const char *test_str;
17866 0 : const char *talloc_str;
17867 0 : PyObject *unicode = NULL;
17868 0 : if (PyUnicode_Check(py_client_name)) {
17869 0 : unicode = PyUnicode_AsEncodedString(py_client_name, "utf-8", "ignore");
17870 0 : if (unicode == NULL) {
17871 0 : return false;
17872 : }
17873 0 : test_str = PyBytes_AS_STRING(unicode);
17874 0 : } else if (PyBytes_Check(py_client_name)) {
17875 0 : test_str = PyBytes_AS_STRING(py_client_name);
17876 : } else {
17877 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_name)->tp_name);
17878 0 : return false;
17879 : }
17880 0 : talloc_str = talloc_strdup(r, test_str);
17881 0 : if (unicode != NULL) {
17882 0 : Py_DECREF(unicode);
17883 : }
17884 0 : if (talloc_str == NULL) {
17885 0 : PyErr_NoMemory();
17886 0 : return false;
17887 : }
17888 0 : r->in.client_name = talloc_str;
17889 : }
17890 0 : if (py_client_pid == NULL) {
17891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_pid");
17892 0 : return false;
17893 : }
17894 : {
17895 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_pid));
17896 0 : if (PyLong_Check(py_client_pid)) {
17897 0 : unsigned long long test_var;
17898 0 : test_var = PyLong_AsUnsignedLongLong(py_client_pid);
17899 0 : if (PyErr_Occurred() != NULL) {
17900 0 : return false;
17901 : }
17902 0 : if (test_var > uint_max) {
17903 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17904 : PyLong_Type.tp_name, uint_max, test_var);
17905 0 : return false;
17906 : }
17907 0 : r->in.client_pid = test_var;
17908 : } else {
17909 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17910 : PyLong_Type.tp_name);
17911 0 : return false;
17912 : }
17913 : }
17914 0 : if (py_flags == NULL) {
17915 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
17916 0 : return false;
17917 : }
17918 : {
17919 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
17920 0 : if (PyLong_Check(py_flags)) {
17921 0 : unsigned long long test_var;
17922 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
17923 0 : if (PyErr_Occurred() != NULL) {
17924 0 : return false;
17925 : }
17926 0 : if (test_var > uint_max) {
17927 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17928 : PyLong_Type.tp_name, uint_max, test_var);
17929 0 : return false;
17930 : }
17931 0 : r->in.flags = test_var;
17932 : } else {
17933 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17934 : PyLong_Type.tp_name);
17935 0 : return false;
17936 : }
17937 : }
17938 0 : if (py_user == NULL) {
17939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.user");
17940 0 : return false;
17941 : }
17942 0 : r->in.user = talloc_ptrtype(r, r->in.user);
17943 0 : if (r->in.user == NULL) {
17944 0 : PyErr_NoMemory();
17945 0 : return false;
17946 : }
17947 : {
17948 0 : const char *test_str;
17949 0 : const char *talloc_str;
17950 0 : PyObject *unicode = NULL;
17951 0 : if (PyUnicode_Check(py_user)) {
17952 0 : unicode = PyUnicode_AsEncodedString(py_user, "utf-8", "ignore");
17953 0 : if (unicode == NULL) {
17954 0 : return false;
17955 : }
17956 0 : test_str = PyBytes_AS_STRING(unicode);
17957 0 : } else if (PyBytes_Check(py_user)) {
17958 0 : test_str = PyBytes_AS_STRING(py_user);
17959 : } else {
17960 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user)->tp_name);
17961 0 : return false;
17962 : }
17963 0 : talloc_str = talloc_strdup(r, test_str);
17964 0 : if (unicode != NULL) {
17965 0 : Py_DECREF(unicode);
17966 : }
17967 0 : if (talloc_str == NULL) {
17968 0 : PyErr_NoMemory();
17969 0 : return false;
17970 : }
17971 0 : r->in.user = talloc_str;
17972 : }
17973 0 : if (py_old_password == NULL) {
17974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.old_password");
17975 0 : return false;
17976 : }
17977 0 : r->in.old_password = talloc_ptrtype(r, r->in.old_password);
17978 0 : if (r->in.old_password == NULL) {
17979 0 : PyErr_NoMemory();
17980 0 : return false;
17981 : }
17982 : {
17983 0 : const char *test_str;
17984 0 : const char *talloc_str;
17985 0 : PyObject *unicode = NULL;
17986 0 : if (PyUnicode_Check(py_old_password)) {
17987 0 : unicode = PyUnicode_AsEncodedString(py_old_password, "utf-8", "ignore");
17988 0 : if (unicode == NULL) {
17989 0 : return false;
17990 : }
17991 0 : test_str = PyBytes_AS_STRING(unicode);
17992 0 : } else if (PyBytes_Check(py_old_password)) {
17993 0 : test_str = PyBytes_AS_STRING(py_old_password);
17994 : } else {
17995 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_old_password)->tp_name);
17996 0 : return false;
17997 : }
17998 0 : talloc_str = talloc_strdup(r, test_str);
17999 0 : if (unicode != NULL) {
18000 0 : Py_DECREF(unicode);
18001 : }
18002 0 : if (talloc_str == NULL) {
18003 0 : PyErr_NoMemory();
18004 0 : return false;
18005 : }
18006 0 : r->in.old_password = talloc_str;
18007 : }
18008 0 : if (py_new_password == NULL) {
18009 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.new_password");
18010 0 : return false;
18011 : }
18012 0 : r->in.new_password = talloc_ptrtype(r, r->in.new_password);
18013 0 : if (r->in.new_password == NULL) {
18014 0 : PyErr_NoMemory();
18015 0 : return false;
18016 : }
18017 : {
18018 0 : const char *test_str;
18019 0 : const char *talloc_str;
18020 0 : PyObject *unicode = NULL;
18021 0 : if (PyUnicode_Check(py_new_password)) {
18022 0 : unicode = PyUnicode_AsEncodedString(py_new_password, "utf-8", "ignore");
18023 0 : if (unicode == NULL) {
18024 0 : return false;
18025 : }
18026 0 : test_str = PyBytes_AS_STRING(unicode);
18027 0 : } else if (PyBytes_Check(py_new_password)) {
18028 0 : test_str = PyBytes_AS_STRING(py_new_password);
18029 : } else {
18030 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_new_password)->tp_name);
18031 0 : return false;
18032 : }
18033 0 : talloc_str = talloc_strdup(r, test_str);
18034 0 : if (unicode != NULL) {
18035 0 : Py_DECREF(unicode);
18036 : }
18037 0 : if (talloc_str == NULL) {
18038 0 : PyErr_NoMemory();
18039 0 : return false;
18040 : }
18041 0 : r->in.new_password = talloc_str;
18042 : }
18043 0 : return true;
18044 : }
18045 :
18046 0 : static PyObject *unpack_py_wbint_PamAuthChangePassword_args_out(struct wbint_PamAuthChangePassword *r)
18047 : {
18048 0 : PyObject *result;
18049 0 : PyObject *py_dominfo;
18050 0 : PyObject *py_reject_reason;
18051 0 : result = PyTuple_New(2);
18052 0 : if (*r->out.dominfo == NULL) {
18053 0 : py_dominfo = Py_None;
18054 0 : Py_INCREF(py_dominfo);
18055 : } else {
18056 0 : py_dominfo = pytalloc_reference_ex(samr_DomInfo1_Type, *r->out.dominfo, *r->out.dominfo);
18057 : }
18058 0 : PyTuple_SetItem(result, 0, py_dominfo);
18059 0 : py_reject_reason = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.reject_reason));
18060 0 : PyTuple_SetItem(result, 1, py_reject_reason);
18061 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
18062 0 : PyErr_SetNTSTATUS(r->out.result);
18063 0 : return NULL;
18064 : }
18065 :
18066 0 : return result;
18067 : }
18068 :
18069 :
18070 0 : static PyObject *py_wbint_InitConnection_in_get_dcname(PyObject *obj, void *closure)
18071 : {
18072 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(obj);
18073 0 : PyObject *py_dcname;
18074 0 : if (object->in.dcname == NULL) {
18075 0 : Py_RETURN_NONE;
18076 : }
18077 0 : if (object->in.dcname == NULL) {
18078 0 : py_dcname = Py_None;
18079 0 : Py_INCREF(py_dcname);
18080 : } else {
18081 0 : py_dcname = PyUnicode_Decode(object->in.dcname, strlen(object->in.dcname), "utf-8", "ignore");
18082 : }
18083 0 : return py_dcname;
18084 : }
18085 :
18086 0 : static int py_wbint_InitConnection_in_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
18087 : {
18088 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18089 0 : if (value == NULL) {
18090 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dcname");
18091 0 : return -1;
18092 : }
18093 0 : object->in.dcname = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dcname);
18094 0 : if (object->in.dcname == NULL) {
18095 0 : PyErr_NoMemory();
18096 0 : return -1;
18097 : }
18098 : {
18099 0 : const char *test_str;
18100 0 : const char *talloc_str;
18101 0 : PyObject *unicode = NULL;
18102 0 : if (PyUnicode_Check(value)) {
18103 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18104 0 : if (unicode == NULL) {
18105 0 : return -1;
18106 : }
18107 0 : test_str = PyBytes_AS_STRING(unicode);
18108 0 : } else if (PyBytes_Check(value)) {
18109 0 : test_str = PyBytes_AS_STRING(value);
18110 : } else {
18111 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18112 0 : return -1;
18113 : }
18114 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18115 0 : if (unicode != NULL) {
18116 0 : Py_DECREF(unicode);
18117 : }
18118 0 : if (talloc_str == NULL) {
18119 0 : PyErr_NoMemory();
18120 0 : return -1;
18121 : }
18122 0 : object->in.dcname = talloc_str;
18123 : }
18124 0 : return 0;
18125 : }
18126 :
18127 0 : static PyObject *py_wbint_InitConnection_out_get_name(PyObject *obj, void *closure)
18128 : {
18129 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(obj);
18130 0 : PyObject *py_name;
18131 0 : if (object->out.name == NULL) {
18132 0 : Py_RETURN_NONE;
18133 : }
18134 0 : if (*object->out.name == NULL) {
18135 0 : py_name = Py_None;
18136 0 : Py_INCREF(py_name);
18137 : } else {
18138 0 : if (*object->out.name == NULL) {
18139 0 : py_name = Py_None;
18140 0 : Py_INCREF(py_name);
18141 : } else {
18142 0 : py_name = PyUnicode_Decode(*object->out.name, strlen(*object->out.name), "utf-8", "ignore");
18143 : }
18144 : }
18145 0 : return py_name;
18146 : }
18147 :
18148 0 : static int py_wbint_InitConnection_out_set_name(PyObject *py_obj, PyObject *value, void *closure)
18149 : {
18150 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18151 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name));
18152 0 : if (value == NULL) {
18153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.name");
18154 0 : return -1;
18155 : }
18156 0 : object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name);
18157 0 : if (object->out.name == NULL) {
18158 0 : PyErr_NoMemory();
18159 0 : return -1;
18160 : }
18161 0 : if (value == Py_None) {
18162 0 : *object->out.name = NULL;
18163 : } else {
18164 0 : *object->out.name = NULL;
18165 : {
18166 0 : const char *test_str;
18167 0 : const char *talloc_str;
18168 0 : PyObject *unicode = NULL;
18169 0 : if (PyUnicode_Check(value)) {
18170 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18171 0 : if (unicode == NULL) {
18172 0 : return -1;
18173 : }
18174 0 : test_str = PyBytes_AS_STRING(unicode);
18175 0 : } else if (PyBytes_Check(value)) {
18176 0 : test_str = PyBytes_AS_STRING(value);
18177 : } else {
18178 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18179 0 : return -1;
18180 : }
18181 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18182 0 : if (unicode != NULL) {
18183 0 : Py_DECREF(unicode);
18184 : }
18185 0 : if (talloc_str == NULL) {
18186 0 : PyErr_NoMemory();
18187 0 : return -1;
18188 : }
18189 0 : *object->out.name = talloc_str;
18190 : }
18191 : }
18192 0 : return 0;
18193 : }
18194 :
18195 0 : static PyObject *py_wbint_InitConnection_out_get_alt_name(PyObject *obj, void *closure)
18196 : {
18197 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(obj);
18198 0 : PyObject *py_alt_name;
18199 0 : if (object->out.alt_name == NULL) {
18200 0 : Py_RETURN_NONE;
18201 : }
18202 0 : if (*object->out.alt_name == NULL) {
18203 0 : py_alt_name = Py_None;
18204 0 : Py_INCREF(py_alt_name);
18205 : } else {
18206 0 : if (*object->out.alt_name == NULL) {
18207 0 : py_alt_name = Py_None;
18208 0 : Py_INCREF(py_alt_name);
18209 : } else {
18210 0 : py_alt_name = PyUnicode_Decode(*object->out.alt_name, strlen(*object->out.alt_name), "utf-8", "ignore");
18211 : }
18212 : }
18213 0 : return py_alt_name;
18214 : }
18215 :
18216 0 : static int py_wbint_InitConnection_out_set_alt_name(PyObject *py_obj, PyObject *value, void *closure)
18217 : {
18218 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18219 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.alt_name));
18220 0 : if (value == NULL) {
18221 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.alt_name");
18222 0 : return -1;
18223 : }
18224 0 : object->out.alt_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.alt_name);
18225 0 : if (object->out.alt_name == NULL) {
18226 0 : PyErr_NoMemory();
18227 0 : return -1;
18228 : }
18229 0 : if (value == Py_None) {
18230 0 : *object->out.alt_name = NULL;
18231 : } else {
18232 0 : *object->out.alt_name = NULL;
18233 : {
18234 0 : const char *test_str;
18235 0 : const char *talloc_str;
18236 0 : PyObject *unicode = NULL;
18237 0 : if (PyUnicode_Check(value)) {
18238 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
18239 0 : if (unicode == NULL) {
18240 0 : return -1;
18241 : }
18242 0 : test_str = PyBytes_AS_STRING(unicode);
18243 0 : } else if (PyBytes_Check(value)) {
18244 0 : test_str = PyBytes_AS_STRING(value);
18245 : } else {
18246 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
18247 0 : return -1;
18248 : }
18249 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
18250 0 : if (unicode != NULL) {
18251 0 : Py_DECREF(unicode);
18252 : }
18253 0 : if (talloc_str == NULL) {
18254 0 : PyErr_NoMemory();
18255 0 : return -1;
18256 : }
18257 0 : *object->out.alt_name = talloc_str;
18258 : }
18259 : }
18260 0 : return 0;
18261 : }
18262 :
18263 0 : static PyObject *py_wbint_InitConnection_out_get_sid(PyObject *obj, void *closure)
18264 : {
18265 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(obj);
18266 0 : PyObject *py_sid;
18267 0 : if (object->out.sid == NULL) {
18268 0 : Py_RETURN_NONE;
18269 : }
18270 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->out.sid, object->out.sid);
18271 0 : return py_sid;
18272 : }
18273 :
18274 0 : static int py_wbint_InitConnection_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
18275 : {
18276 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18277 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
18278 0 : if (value == NULL) {
18279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sid");
18280 0 : return -1;
18281 : }
18282 0 : object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
18283 0 : if (object->out.sid == NULL) {
18284 0 : PyErr_NoMemory();
18285 0 : return -1;
18286 : }
18287 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
18288 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18289 0 : PyErr_NoMemory();
18290 0 : return -1;
18291 : }
18292 0 : object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
18293 0 : return 0;
18294 : }
18295 :
18296 0 : static PyObject *py_wbint_InitConnection_out_get_flags(PyObject *obj, void *closure)
18297 : {
18298 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(obj);
18299 0 : PyObject *py_flags;
18300 0 : if (object->out.flags == NULL) {
18301 0 : Py_RETURN_NONE;
18302 : }
18303 0 : py_flags = PyLong_FromLong((uint16_t)(*object->out.flags));
18304 0 : return py_flags;
18305 : }
18306 :
18307 0 : static int py_wbint_InitConnection_out_set_flags(PyObject *py_obj, PyObject *value, void *closure)
18308 : {
18309 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18310 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.flags));
18311 0 : if (value == NULL) {
18312 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.flags");
18313 0 : return -1;
18314 : }
18315 0 : object->out.flags = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.flags);
18316 0 : if (object->out.flags == NULL) {
18317 0 : PyErr_NoMemory();
18318 0 : return -1;
18319 : }
18320 : {
18321 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.flags));
18322 0 : if (PyLong_Check(value)) {
18323 0 : unsigned long long test_var;
18324 0 : test_var = PyLong_AsUnsignedLongLong(value);
18325 0 : if (PyErr_Occurred() != NULL) {
18326 0 : return -1;
18327 : }
18328 0 : if (test_var > uint_max) {
18329 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18330 : PyLong_Type.tp_name, uint_max, test_var);
18331 0 : return -1;
18332 : }
18333 0 : *object->out.flags = test_var;
18334 : } else {
18335 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18336 : PyLong_Type.tp_name);
18337 0 : return -1;
18338 : }
18339 : }
18340 0 : return 0;
18341 : }
18342 :
18343 0 : static PyObject *py_wbint_InitConnection_get_result(PyObject *obj, void *closure)
18344 : {
18345 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(obj);
18346 0 : PyObject *py_result;
18347 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
18348 0 : return py_result;
18349 : }
18350 :
18351 0 : static int py_wbint_InitConnection_set_result(PyObject *py_obj, PyObject *value, void *closure)
18352 : {
18353 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18354 0 : if (value == NULL) {
18355 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
18356 0 : return -1;
18357 : }
18358 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
18359 0 : return 0;
18360 : }
18361 :
18362 : static PyGetSetDef py_wbint_InitConnection_getsetters[] = {
18363 : {
18364 : .name = discard_const_p(char, "in_dcname"),
18365 : .get = py_wbint_InitConnection_in_get_dcname,
18366 : .set = py_wbint_InitConnection_in_set_dcname,
18367 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
18368 : },
18369 : {
18370 : .name = discard_const_p(char, "out_name"),
18371 : .get = py_wbint_InitConnection_out_get_name,
18372 : .set = py_wbint_InitConnection_out_set_name,
18373 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
18374 : },
18375 : {
18376 : .name = discard_const_p(char, "out_alt_name"),
18377 : .get = py_wbint_InitConnection_out_get_alt_name,
18378 : .set = py_wbint_InitConnection_out_set_alt_name,
18379 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
18380 : },
18381 : {
18382 : .name = discard_const_p(char, "out_sid"),
18383 : .get = py_wbint_InitConnection_out_get_sid,
18384 : .set = py_wbint_InitConnection_out_set_sid,
18385 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
18386 : },
18387 : {
18388 : .name = discard_const_p(char, "out_flags"),
18389 : .get = py_wbint_InitConnection_out_get_flags,
18390 : .set = py_wbint_InitConnection_out_set_flags,
18391 : .doc = discard_const_p(char, "PIDL-generated element of base type DomainInfoFlags")
18392 : },
18393 : {
18394 : .name = discard_const_p(char, "result"),
18395 : .get = py_wbint_InitConnection_get_result,
18396 : .set = py_wbint_InitConnection_set_result,
18397 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
18398 : },
18399 : { .name = NULL }
18400 : };
18401 :
18402 0 : static PyObject *py_wbint_InitConnection_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18403 : {
18404 0 : PyObject *self = pytalloc_new(struct wbint_InitConnection, type);
18405 0 : struct wbint_InitConnection *_self = (struct wbint_InitConnection *)pytalloc_get_ptr(self);
18406 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
18407 0 : _self->out.sid = talloc_zero(mem_ctx, struct dom_sid);
18408 0 : _self->out.flags = talloc_zero(mem_ctx, enum DomainInfoFlags);
18409 0 : return self;
18410 : }
18411 :
18412 0 : static PyObject *py_wbint_InitConnection_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
18413 : {
18414 :
18415 :
18416 0 : return PyLong_FromLong(27);
18417 : }
18418 :
18419 0 : static PyObject *py_wbint_InitConnection_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
18420 : {
18421 0 : const struct ndr_interface_call *call = NULL;
18422 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18423 0 : PyObject *ret = NULL;
18424 0 : struct ndr_push *push = NULL;
18425 0 : DATA_BLOB blob;
18426 0 : enum ndr_err_code err;
18427 :
18428 0 : if (ndr_table_winbind.num_calls < 28) {
18429 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_InitConnection_ndr_pack");
18430 0 : return NULL;
18431 : }
18432 0 : call = &ndr_table_winbind.calls[27];
18433 :
18434 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18435 0 : if (push == NULL) {
18436 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18437 0 : return NULL;
18438 : }
18439 :
18440 0 : push->flags |= ndr_push_flags;
18441 :
18442 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18443 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18444 0 : TALLOC_FREE(push);
18445 0 : PyErr_SetNdrError(err);
18446 0 : return NULL;
18447 : }
18448 0 : blob = ndr_push_blob(push);
18449 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18450 0 : TALLOC_FREE(push);
18451 0 : return ret;
18452 : }
18453 :
18454 0 : static PyObject *py_wbint_InitConnection_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18455 : {
18456 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18457 0 : PyObject *bigendian_obj = NULL;
18458 0 : PyObject *ndr64_obj = NULL;
18459 0 : libndr_flags ndr_push_flags = 0;
18460 :
18461 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18462 : discard_const_p(char *, kwnames),
18463 : &bigendian_obj,
18464 : &ndr64_obj)) {
18465 0 : return NULL;
18466 : }
18467 :
18468 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18469 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18470 : }
18471 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18472 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18473 : }
18474 :
18475 0 : return py_wbint_InitConnection_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18476 : }
18477 :
18478 0 : static PyObject *py_wbint_InitConnection_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18479 : {
18480 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18481 0 : PyObject *bigendian_obj = NULL;
18482 0 : PyObject *ndr64_obj = NULL;
18483 0 : libndr_flags ndr_push_flags = 0;
18484 :
18485 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18486 : discard_const_p(char *, kwnames),
18487 : &bigendian_obj,
18488 : &ndr64_obj)) {
18489 0 : return NULL;
18490 : }
18491 :
18492 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18493 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18494 : }
18495 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18496 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18497 : }
18498 :
18499 0 : return py_wbint_InitConnection_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18500 : }
18501 :
18502 0 : static PyObject *py_wbint_InitConnection_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
18503 : {
18504 0 : const struct ndr_interface_call *call = NULL;
18505 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18506 0 : struct ndr_pull *pull = NULL;
18507 0 : enum ndr_err_code err;
18508 :
18509 0 : if (ndr_table_winbind.num_calls < 28) {
18510 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_InitConnection_ndr_unpack");
18511 0 : return NULL;
18512 : }
18513 0 : call = &ndr_table_winbind.calls[27];
18514 :
18515 0 : pull = ndr_pull_init_blob(blob, object);
18516 0 : if (pull == NULL) {
18517 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18518 0 : return NULL;
18519 : }
18520 :
18521 0 : pull->flags |= ndr_pull_flags;
18522 :
18523 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18524 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18525 0 : TALLOC_FREE(pull);
18526 0 : PyErr_SetNdrError(err);
18527 0 : return NULL;
18528 : }
18529 0 : if (!allow_remaining) {
18530 0 : uint32_t highest_ofs;
18531 :
18532 0 : if (pull->offset > pull->relative_highest_offset) {
18533 0 : highest_ofs = pull->offset;
18534 : } else {
18535 0 : highest_ofs = pull->relative_highest_offset;
18536 : }
18537 0 : if (highest_ofs < pull->data_size) {
18538 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18539 : "not all bytes consumed ofs[%u] size[%u]",
18540 : highest_ofs, pull->data_size);
18541 0 : TALLOC_FREE(pull);
18542 0 : PyErr_SetNdrError(err);
18543 0 : return NULL;
18544 : }
18545 : }
18546 :
18547 0 : TALLOC_FREE(pull);
18548 0 : Py_RETURN_NONE;
18549 : }
18550 :
18551 0 : static PyObject *py_wbint_InitConnection_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18552 : {
18553 0 : DATA_BLOB blob;
18554 0 : Py_ssize_t blob_length = 0;
18555 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18556 0 : PyObject *bigendian_obj = NULL;
18557 0 : PyObject *ndr64_obj = NULL;
18558 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18559 0 : PyObject *allow_remaining_obj = NULL;
18560 0 : bool allow_remaining = false;
18561 :
18562 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18563 : discard_const_p(char *, kwnames),
18564 : &blob.data, &blob_length,
18565 : &bigendian_obj,
18566 : &ndr64_obj,
18567 : &allow_remaining_obj)) {
18568 0 : return NULL;
18569 : }
18570 0 : blob.length = blob_length;
18571 :
18572 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18573 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18574 : }
18575 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18576 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18577 : }
18578 :
18579 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18580 0 : allow_remaining = true;
18581 : }
18582 :
18583 0 : return py_wbint_InitConnection_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18584 : }
18585 :
18586 0 : static PyObject *py_wbint_InitConnection_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18587 : {
18588 0 : DATA_BLOB blob;
18589 0 : Py_ssize_t blob_length = 0;
18590 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18591 0 : PyObject *bigendian_obj = NULL;
18592 0 : PyObject *ndr64_obj = NULL;
18593 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18594 0 : PyObject *allow_remaining_obj = NULL;
18595 0 : bool allow_remaining = false;
18596 :
18597 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
18598 : discard_const_p(char *, kwnames),
18599 : &blob.data, &blob_length,
18600 : &bigendian_obj,
18601 : &ndr64_obj,
18602 : &allow_remaining_obj)) {
18603 0 : return NULL;
18604 : }
18605 0 : blob.length = blob_length;
18606 :
18607 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18608 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18609 : }
18610 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18611 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18612 : }
18613 :
18614 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18615 0 : allow_remaining = true;
18616 : }
18617 :
18618 0 : return py_wbint_InitConnection_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
18619 : }
18620 :
18621 0 : static PyObject *py_wbint_InitConnection_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
18622 : {
18623 0 : const struct ndr_interface_call *call = NULL;
18624 0 : struct wbint_InitConnection *object = pytalloc_get_ptr(py_obj);
18625 0 : PyObject *ret;
18626 0 : char *retstr;
18627 :
18628 0 : if (ndr_table_winbind.num_calls < 28) {
18629 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_wbint_InitConnection_ndr_print");
18630 0 : return NULL;
18631 : }
18632 0 : call = &ndr_table_winbind.calls[27];
18633 :
18634 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
18635 0 : ret = PyUnicode_FromString(retstr);
18636 0 : TALLOC_FREE(retstr);
18637 :
18638 0 : return ret;
18639 : }
18640 :
18641 0 : static PyObject *py_wbint_InitConnection_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18642 : {
18643 0 : return py_wbint_InitConnection_ndr_print(py_obj, "wbint_InitConnection_in", NDR_IN);
18644 : }
18645 :
18646 0 : static PyObject *py_wbint_InitConnection_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18647 : {
18648 0 : return py_wbint_InitConnection_ndr_print(py_obj, "wbint_InitConnection_out", NDR_OUT);
18649 : }
18650 :
18651 : static PyMethodDef py_wbint_InitConnection_methods[] = {
18652 : { "opnum", (PyCFunction)py_wbint_InitConnection_ndr_opnum, METH_NOARGS|METH_CLASS,
18653 : "winbind.wbint_InitConnection.opnum() -> 27 (0x1b) " },
18654 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_InitConnection_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
18655 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
18656 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_InitConnection_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
18657 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
18658 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_InitConnection_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
18659 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
18660 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_wbint_InitConnection_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
18661 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
18662 : { "__ndr_print_in__", (PyCFunction)py_wbint_InitConnection_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
18663 : { "__ndr_print_out__", (PyCFunction)py_wbint_InitConnection_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
18664 : { NULL, NULL, 0, NULL }
18665 : };
18666 :
18667 :
18668 : static PyTypeObject wbint_InitConnection_Type = {
18669 : PyVarObject_HEAD_INIT(NULL, 0)
18670 : .tp_name = "winbind.wbint_InitConnection",
18671 : .tp_getset = py_wbint_InitConnection_getsetters,
18672 : .tp_methods = py_wbint_InitConnection_methods,
18673 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18674 : .tp_new = py_wbint_InitConnection_new,
18675 : };
18676 :
18677 0 : static bool pack_py_wbint_InitConnection_args_in(PyObject *args, PyObject *kwargs, struct wbint_InitConnection *r)
18678 : {
18679 0 : PyObject *py_dcname;
18680 0 : const char *kwnames[] = {
18681 : "dcname", NULL
18682 : };
18683 :
18684 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:wbint_InitConnection", discard_const_p(char *, kwnames), &py_dcname)) {
18685 0 : return false;
18686 : }
18687 :
18688 0 : if (py_dcname == NULL) {
18689 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dcname");
18690 0 : return false;
18691 : }
18692 0 : r->in.dcname = talloc_ptrtype(r, r->in.dcname);
18693 0 : if (r->in.dcname == NULL) {
18694 0 : PyErr_NoMemory();
18695 0 : return false;
18696 : }
18697 : {
18698 0 : const char *test_str;
18699 0 : const char *talloc_str;
18700 0 : PyObject *unicode = NULL;
18701 0 : if (PyUnicode_Check(py_dcname)) {
18702 0 : unicode = PyUnicode_AsEncodedString(py_dcname, "utf-8", "ignore");
18703 0 : if (unicode == NULL) {
18704 0 : return false;
18705 : }
18706 0 : test_str = PyBytes_AS_STRING(unicode);
18707 0 : } else if (PyBytes_Check(py_dcname)) {
18708 0 : test_str = PyBytes_AS_STRING(py_dcname);
18709 : } else {
18710 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_dcname)->tp_name);
18711 0 : return false;
18712 : }
18713 0 : talloc_str = talloc_strdup(r, test_str);
18714 0 : if (unicode != NULL) {
18715 0 : Py_DECREF(unicode);
18716 : }
18717 0 : if (talloc_str == NULL) {
18718 0 : PyErr_NoMemory();
18719 0 : return false;
18720 : }
18721 0 : r->in.dcname = talloc_str;
18722 : }
18723 0 : return true;
18724 : }
18725 :
18726 0 : static PyObject *unpack_py_wbint_InitConnection_args_out(struct wbint_InitConnection *r)
18727 : {
18728 0 : PyObject *result;
18729 0 : PyObject *py_name;
18730 0 : PyObject *py_alt_name;
18731 0 : PyObject *py_sid;
18732 0 : PyObject *py_flags;
18733 0 : result = PyTuple_New(4);
18734 0 : if (*r->out.name == NULL) {
18735 0 : py_name = Py_None;
18736 0 : Py_INCREF(py_name);
18737 : } else {
18738 0 : if (*r->out.name == NULL) {
18739 0 : py_name = Py_None;
18740 0 : Py_INCREF(py_name);
18741 : } else {
18742 0 : py_name = PyUnicode_Decode(*r->out.name, strlen(*r->out.name), "utf-8", "ignore");
18743 : }
18744 : }
18745 0 : PyTuple_SetItem(result, 0, py_name);
18746 0 : if (*r->out.alt_name == NULL) {
18747 0 : py_alt_name = Py_None;
18748 0 : Py_INCREF(py_alt_name);
18749 : } else {
18750 0 : if (*r->out.alt_name == NULL) {
18751 0 : py_alt_name = Py_None;
18752 0 : Py_INCREF(py_alt_name);
18753 : } else {
18754 0 : py_alt_name = PyUnicode_Decode(*r->out.alt_name, strlen(*r->out.alt_name), "utf-8", "ignore");
18755 : }
18756 : }
18757 0 : PyTuple_SetItem(result, 1, py_alt_name);
18758 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, r->out.sid, r->out.sid);
18759 0 : PyTuple_SetItem(result, 2, py_sid);
18760 0 : py_flags = PyLong_FromLong((uint16_t)(*r->out.flags));
18761 0 : PyTuple_SetItem(result, 3, py_flags);
18762 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
18763 0 : PyErr_SetNTSTATUS(r->out.result);
18764 0 : return NULL;
18765 : }
18766 :
18767 0 : return result;
18768 : }
18769 :
18770 :
18771 0 : static PyObject *py_winbind_SamLogon_in_get_logon_level(PyObject *obj, void *closure)
18772 : {
18773 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(obj);
18774 0 : PyObject *py_logon_level;
18775 0 : py_logon_level = PyLong_FromLong((uint16_t)(object->in.logon_level));
18776 0 : return py_logon_level;
18777 : }
18778 :
18779 0 : static int py_winbind_SamLogon_in_set_logon_level(PyObject *py_obj, PyObject *value, void *closure)
18780 : {
18781 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
18782 0 : if (value == NULL) {
18783 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.logon_level");
18784 0 : return -1;
18785 : }
18786 : {
18787 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.logon_level));
18788 0 : if (PyLong_Check(value)) {
18789 0 : unsigned long long test_var;
18790 0 : test_var = PyLong_AsUnsignedLongLong(value);
18791 0 : if (PyErr_Occurred() != NULL) {
18792 0 : return -1;
18793 : }
18794 0 : if (test_var > uint_max) {
18795 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18796 : PyLong_Type.tp_name, uint_max, test_var);
18797 0 : return -1;
18798 : }
18799 0 : object->in.logon_level = test_var;
18800 : } else {
18801 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18802 : PyLong_Type.tp_name);
18803 0 : return -1;
18804 : }
18805 : }
18806 0 : return 0;
18807 : }
18808 :
18809 0 : static PyObject *py_winbind_SamLogon_in_get_logon(PyObject *obj, void *closure)
18810 : {
18811 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(obj);
18812 0 : PyObject *py_logon;
18813 0 : py_logon = pyrpc_import_union(netr_LogonLevel_Type, pytalloc_get_mem_ctx(obj), object->in.logon_level, &object->in.logon, "union netr_LogonLevel");
18814 0 : if (py_logon == NULL) {
18815 0 : return NULL;
18816 : }
18817 0 : return py_logon;
18818 : }
18819 :
18820 0 : static int py_winbind_SamLogon_in_set_logon(PyObject *py_obj, PyObject *value, void *closure)
18821 : {
18822 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
18823 0 : if (value == NULL) {
18824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.logon");
18825 0 : return -1;
18826 : }
18827 : {
18828 0 : union netr_LogonLevel *logon_switch_0;
18829 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");
18830 0 : if (logon_switch_0 == NULL) {
18831 0 : return -1;
18832 : }
18833 0 : object->in.logon = *logon_switch_0;
18834 : }
18835 0 : return 0;
18836 : }
18837 :
18838 0 : static PyObject *py_winbind_SamLogon_in_get_validation_level(PyObject *obj, void *closure)
18839 : {
18840 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(obj);
18841 0 : PyObject *py_validation_level;
18842 0 : py_validation_level = PyLong_FromLong((uint16_t)(object->in.validation_level));
18843 0 : return py_validation_level;
18844 : }
18845 :
18846 0 : static int py_winbind_SamLogon_in_set_validation_level(PyObject *py_obj, PyObject *value, void *closure)
18847 : {
18848 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
18849 0 : if (value == NULL) {
18850 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.validation_level");
18851 0 : return -1;
18852 : }
18853 : {
18854 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.validation_level));
18855 0 : if (PyLong_Check(value)) {
18856 0 : unsigned long long test_var;
18857 0 : test_var = PyLong_AsUnsignedLongLong(value);
18858 0 : if (PyErr_Occurred() != NULL) {
18859 0 : return -1;
18860 : }
18861 0 : if (test_var > uint_max) {
18862 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18863 : PyLong_Type.tp_name, uint_max, test_var);
18864 0 : return -1;
18865 : }
18866 0 : object->in.validation_level = test_var;
18867 : } else {
18868 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18869 : PyLong_Type.tp_name);
18870 0 : return -1;
18871 : }
18872 : }
18873 0 : return 0;
18874 : }
18875 :
18876 0 : static PyObject *py_winbind_SamLogon_out_get_validation(PyObject *obj, void *closure)
18877 : {
18878 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(obj);
18879 0 : PyObject *py_validation;
18880 0 : py_validation = pyrpc_import_union(netr_Validation_Type, pytalloc_get_mem_ctx(obj), object->in.validation_level, &object->out.validation, "union netr_Validation");
18881 0 : if (py_validation == NULL) {
18882 0 : return NULL;
18883 : }
18884 0 : return py_validation;
18885 : }
18886 :
18887 0 : static int py_winbind_SamLogon_out_set_validation(PyObject *py_obj, PyObject *value, void *closure)
18888 : {
18889 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
18890 0 : if (value == NULL) {
18891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.validation");
18892 0 : return -1;
18893 : }
18894 : {
18895 0 : union netr_Validation *validation_switch_0;
18896 0 : validation_switch_0 = (union netr_Validation *)pyrpc_export_union(netr_Validation_Type, pytalloc_get_mem_ctx(py_obj), object->in.validation_level, value, "union netr_Validation");
18897 0 : if (validation_switch_0 == NULL) {
18898 0 : return -1;
18899 : }
18900 0 : object->out.validation = *validation_switch_0;
18901 : }
18902 0 : return 0;
18903 : }
18904 :
18905 0 : static PyObject *py_winbind_SamLogon_out_get_authoritative(PyObject *obj, void *closure)
18906 : {
18907 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(obj);
18908 0 : PyObject *py_authoritative;
18909 0 : py_authoritative = PyLong_FromLong((uint16_t)(object->out.authoritative));
18910 0 : return py_authoritative;
18911 : }
18912 :
18913 0 : static int py_winbind_SamLogon_out_set_authoritative(PyObject *py_obj, PyObject *value, void *closure)
18914 : {
18915 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
18916 0 : if (value == NULL) {
18917 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.authoritative");
18918 0 : return -1;
18919 : }
18920 : {
18921 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.authoritative));
18922 0 : if (PyLong_Check(value)) {
18923 0 : unsigned long long test_var;
18924 0 : test_var = PyLong_AsUnsignedLongLong(value);
18925 0 : if (PyErr_Occurred() != NULL) {
18926 0 : return -1;
18927 : }
18928 0 : if (test_var > uint_max) {
18929 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18930 : PyLong_Type.tp_name, uint_max, test_var);
18931 0 : return -1;
18932 : }
18933 0 : object->out.authoritative = test_var;
18934 : } else {
18935 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18936 : PyLong_Type.tp_name);
18937 0 : return -1;
18938 : }
18939 : }
18940 0 : return 0;
18941 : }
18942 :
18943 0 : static PyObject *py_winbind_SamLogon_get_result(PyObject *obj, void *closure)
18944 : {
18945 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(obj);
18946 0 : PyObject *py_result;
18947 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
18948 0 : return py_result;
18949 : }
18950 :
18951 0 : static int py_winbind_SamLogon_set_result(PyObject *py_obj, PyObject *value, void *closure)
18952 : {
18953 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
18954 0 : if (value == NULL) {
18955 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
18956 0 : return -1;
18957 : }
18958 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
18959 0 : return 0;
18960 : }
18961 :
18962 : static PyGetSetDef py_winbind_SamLogon_getsetters[] = {
18963 : {
18964 : .name = discard_const_p(char, "in_logon_level"),
18965 : .get = py_winbind_SamLogon_in_get_logon_level,
18966 : .set = py_winbind_SamLogon_in_set_logon_level,
18967 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
18968 : },
18969 : {
18970 : .name = discard_const_p(char, "in_logon"),
18971 : .get = py_winbind_SamLogon_in_get_logon,
18972 : .set = py_winbind_SamLogon_in_set_logon,
18973 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonLevel")
18974 : },
18975 : {
18976 : .name = discard_const_p(char, "in_validation_level"),
18977 : .get = py_winbind_SamLogon_in_get_validation_level,
18978 : .set = py_winbind_SamLogon_in_set_validation_level,
18979 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
18980 : },
18981 : {
18982 : .name = discard_const_p(char, "out_validation"),
18983 : .get = py_winbind_SamLogon_out_get_validation,
18984 : .set = py_winbind_SamLogon_out_set_validation,
18985 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_Validation")
18986 : },
18987 : {
18988 : .name = discard_const_p(char, "out_authoritative"),
18989 : .get = py_winbind_SamLogon_out_get_authoritative,
18990 : .set = py_winbind_SamLogon_out_set_authoritative,
18991 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
18992 : },
18993 : {
18994 : .name = discard_const_p(char, "result"),
18995 : .get = py_winbind_SamLogon_get_result,
18996 : .set = py_winbind_SamLogon_set_result,
18997 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
18998 : },
18999 : { .name = NULL }
19000 : };
19001 :
19002 0 : static PyObject *py_winbind_SamLogon_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19003 : {
19004 0 : PyObject *self = pytalloc_new(struct winbind_SamLogon, type);
19005 0 : return self;
19006 : }
19007 :
19008 0 : static PyObject *py_winbind_SamLogon_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19009 : {
19010 :
19011 :
19012 0 : return PyLong_FromLong(28);
19013 : }
19014 :
19015 0 : static PyObject *py_winbind_SamLogon_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
19016 : {
19017 0 : const struct ndr_interface_call *call = NULL;
19018 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
19019 0 : PyObject *ret = NULL;
19020 0 : struct ndr_push *push = NULL;
19021 0 : DATA_BLOB blob;
19022 0 : enum ndr_err_code err;
19023 :
19024 0 : if (ndr_table_winbind.num_calls < 29) {
19025 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_pack");
19026 0 : return NULL;
19027 : }
19028 0 : call = &ndr_table_winbind.calls[28];
19029 :
19030 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19031 0 : if (push == NULL) {
19032 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19033 0 : return NULL;
19034 : }
19035 :
19036 0 : push->flags |= ndr_push_flags;
19037 :
19038 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19039 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19040 0 : TALLOC_FREE(push);
19041 0 : PyErr_SetNdrError(err);
19042 0 : return NULL;
19043 : }
19044 0 : blob = ndr_push_blob(push);
19045 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19046 0 : TALLOC_FREE(push);
19047 0 : return ret;
19048 : }
19049 :
19050 0 : static PyObject *py_winbind_SamLogon_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19051 : {
19052 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19053 0 : PyObject *bigendian_obj = NULL;
19054 0 : PyObject *ndr64_obj = NULL;
19055 0 : libndr_flags ndr_push_flags = 0;
19056 :
19057 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19058 : discard_const_p(char *, kwnames),
19059 : &bigendian_obj,
19060 : &ndr64_obj)) {
19061 0 : return NULL;
19062 : }
19063 :
19064 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19065 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19066 : }
19067 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19068 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19069 : }
19070 :
19071 0 : return py_winbind_SamLogon_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19072 : }
19073 :
19074 0 : static PyObject *py_winbind_SamLogon_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19075 : {
19076 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19077 0 : PyObject *bigendian_obj = NULL;
19078 0 : PyObject *ndr64_obj = NULL;
19079 0 : libndr_flags ndr_push_flags = 0;
19080 :
19081 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19082 : discard_const_p(char *, kwnames),
19083 : &bigendian_obj,
19084 : &ndr64_obj)) {
19085 0 : return NULL;
19086 : }
19087 :
19088 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19089 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19090 : }
19091 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19092 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19093 : }
19094 :
19095 0 : return py_winbind_SamLogon_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19096 : }
19097 :
19098 0 : static PyObject *py_winbind_SamLogon_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
19099 : {
19100 0 : const struct ndr_interface_call *call = NULL;
19101 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
19102 0 : struct ndr_pull *pull = NULL;
19103 0 : enum ndr_err_code err;
19104 :
19105 0 : if (ndr_table_winbind.num_calls < 29) {
19106 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_unpack");
19107 0 : return NULL;
19108 : }
19109 0 : call = &ndr_table_winbind.calls[28];
19110 :
19111 0 : pull = ndr_pull_init_blob(blob, object);
19112 0 : if (pull == NULL) {
19113 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19114 0 : return NULL;
19115 : }
19116 :
19117 0 : pull->flags |= ndr_pull_flags;
19118 :
19119 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19120 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19121 0 : TALLOC_FREE(pull);
19122 0 : PyErr_SetNdrError(err);
19123 0 : return NULL;
19124 : }
19125 0 : if (!allow_remaining) {
19126 0 : uint32_t highest_ofs;
19127 :
19128 0 : if (pull->offset > pull->relative_highest_offset) {
19129 0 : highest_ofs = pull->offset;
19130 : } else {
19131 0 : highest_ofs = pull->relative_highest_offset;
19132 : }
19133 0 : if (highest_ofs < pull->data_size) {
19134 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19135 : "not all bytes consumed ofs[%u] size[%u]",
19136 : highest_ofs, pull->data_size);
19137 0 : TALLOC_FREE(pull);
19138 0 : PyErr_SetNdrError(err);
19139 0 : return NULL;
19140 : }
19141 : }
19142 :
19143 0 : TALLOC_FREE(pull);
19144 0 : Py_RETURN_NONE;
19145 : }
19146 :
19147 0 : static PyObject *py_winbind_SamLogon_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19148 : {
19149 0 : DATA_BLOB blob;
19150 0 : Py_ssize_t blob_length = 0;
19151 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19152 0 : PyObject *bigendian_obj = NULL;
19153 0 : PyObject *ndr64_obj = NULL;
19154 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19155 0 : PyObject *allow_remaining_obj = NULL;
19156 0 : bool allow_remaining = false;
19157 :
19158 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19159 : discard_const_p(char *, kwnames),
19160 : &blob.data, &blob_length,
19161 : &bigendian_obj,
19162 : &ndr64_obj,
19163 : &allow_remaining_obj)) {
19164 0 : return NULL;
19165 : }
19166 0 : blob.length = blob_length;
19167 :
19168 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19169 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19170 : }
19171 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19172 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19173 : }
19174 :
19175 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19176 0 : allow_remaining = true;
19177 : }
19178 :
19179 0 : return py_winbind_SamLogon_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19180 : }
19181 :
19182 0 : static PyObject *py_winbind_SamLogon_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19183 : {
19184 0 : DATA_BLOB blob;
19185 0 : Py_ssize_t blob_length = 0;
19186 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19187 0 : PyObject *bigendian_obj = NULL;
19188 0 : PyObject *ndr64_obj = NULL;
19189 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19190 0 : PyObject *allow_remaining_obj = NULL;
19191 0 : bool allow_remaining = false;
19192 :
19193 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19194 : discard_const_p(char *, kwnames),
19195 : &blob.data, &blob_length,
19196 : &bigendian_obj,
19197 : &ndr64_obj,
19198 : &allow_remaining_obj)) {
19199 0 : return NULL;
19200 : }
19201 0 : blob.length = blob_length;
19202 :
19203 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19204 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19205 : }
19206 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19207 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19208 : }
19209 :
19210 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19211 0 : allow_remaining = true;
19212 : }
19213 :
19214 0 : return py_winbind_SamLogon_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19215 : }
19216 :
19217 0 : static PyObject *py_winbind_SamLogon_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19218 : {
19219 0 : const struct ndr_interface_call *call = NULL;
19220 0 : struct winbind_SamLogon *object = pytalloc_get_ptr(py_obj);
19221 0 : PyObject *ret;
19222 0 : char *retstr;
19223 :
19224 0 : if (ndr_table_winbind.num_calls < 29) {
19225 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SamLogon_ndr_print");
19226 0 : return NULL;
19227 : }
19228 0 : call = &ndr_table_winbind.calls[28];
19229 :
19230 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19231 0 : ret = PyUnicode_FromString(retstr);
19232 0 : TALLOC_FREE(retstr);
19233 :
19234 0 : return ret;
19235 : }
19236 :
19237 0 : static PyObject *py_winbind_SamLogon_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19238 : {
19239 0 : return py_winbind_SamLogon_ndr_print(py_obj, "winbind_SamLogon_in", NDR_IN);
19240 : }
19241 :
19242 0 : static PyObject *py_winbind_SamLogon_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19243 : {
19244 0 : return py_winbind_SamLogon_ndr_print(py_obj, "winbind_SamLogon_out", NDR_OUT);
19245 : }
19246 :
19247 : static PyMethodDef py_winbind_SamLogon_methods[] = {
19248 : { "opnum", (PyCFunction)py_winbind_SamLogon_ndr_opnum, METH_NOARGS|METH_CLASS,
19249 : "winbind.SamLogon.opnum() -> 28 (0x1c) " },
19250 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19251 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19252 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19253 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19254 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19255 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19256 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SamLogon_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19257 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19258 : { "__ndr_print_in__", (PyCFunction)py_winbind_SamLogon_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19259 : { "__ndr_print_out__", (PyCFunction)py_winbind_SamLogon_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19260 : { NULL, NULL, 0, NULL }
19261 : };
19262 :
19263 :
19264 : static PyTypeObject winbind_SamLogon_Type = {
19265 : PyVarObject_HEAD_INIT(NULL, 0)
19266 : .tp_name = "winbind.SamLogon",
19267 : .tp_getset = py_winbind_SamLogon_getsetters,
19268 : .tp_methods = py_winbind_SamLogon_methods,
19269 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19270 : .tp_new = py_winbind_SamLogon_new,
19271 : };
19272 :
19273 0 : static bool pack_py_winbind_SamLogon_args_in(PyObject *args, PyObject *kwargs, struct winbind_SamLogon *r)
19274 : {
19275 0 : PyObject *py_logon_level;
19276 0 : PyObject *py_logon;
19277 0 : PyObject *py_validation_level;
19278 0 : const char *kwnames[] = {
19279 : "logon_level", "logon", "validation_level", NULL
19280 : };
19281 :
19282 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_SamLogon", discard_const_p(char *, kwnames), &py_logon_level, &py_logon, &py_validation_level)) {
19283 0 : return false;
19284 : }
19285 :
19286 0 : if (py_logon_level == NULL) {
19287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.logon_level");
19288 0 : return false;
19289 : }
19290 : {
19291 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.logon_level));
19292 0 : if (PyLong_Check(py_logon_level)) {
19293 0 : unsigned long long test_var;
19294 0 : test_var = PyLong_AsUnsignedLongLong(py_logon_level);
19295 0 : if (PyErr_Occurred() != NULL) {
19296 0 : return false;
19297 : }
19298 0 : if (test_var > uint_max) {
19299 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19300 : PyLong_Type.tp_name, uint_max, test_var);
19301 0 : return false;
19302 : }
19303 0 : r->in.logon_level = test_var;
19304 : } else {
19305 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19306 : PyLong_Type.tp_name);
19307 0 : return false;
19308 : }
19309 : }
19310 0 : if (py_logon == NULL) {
19311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.logon");
19312 0 : return false;
19313 : }
19314 : {
19315 0 : union netr_LogonLevel *logon_switch_0;
19316 0 : logon_switch_0 = (union netr_LogonLevel *)pyrpc_export_union(netr_LogonLevel_Type, r, r->in.logon_level, py_logon, "union netr_LogonLevel");
19317 0 : if (logon_switch_0 == NULL) {
19318 0 : return false;
19319 : }
19320 0 : r->in.logon = *logon_switch_0;
19321 : }
19322 0 : if (py_validation_level == NULL) {
19323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.validation_level");
19324 0 : return false;
19325 : }
19326 : {
19327 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.validation_level));
19328 0 : if (PyLong_Check(py_validation_level)) {
19329 0 : unsigned long long test_var;
19330 0 : test_var = PyLong_AsUnsignedLongLong(py_validation_level);
19331 0 : if (PyErr_Occurred() != NULL) {
19332 0 : return false;
19333 : }
19334 0 : if (test_var > uint_max) {
19335 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19336 : PyLong_Type.tp_name, uint_max, test_var);
19337 0 : return false;
19338 : }
19339 0 : r->in.validation_level = test_var;
19340 : } else {
19341 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19342 : PyLong_Type.tp_name);
19343 0 : return false;
19344 : }
19345 : }
19346 0 : return true;
19347 : }
19348 :
19349 0 : static PyObject *unpack_py_winbind_SamLogon_args_out(struct winbind_SamLogon *r)
19350 : {
19351 0 : PyObject *result;
19352 0 : PyObject *py_validation;
19353 0 : PyObject *py_authoritative;
19354 0 : result = PyTuple_New(2);
19355 0 : py_validation = pyrpc_import_union(netr_Validation_Type, r, r->in.validation_level, &r->out.validation, "union netr_Validation");
19356 0 : if (py_validation == NULL) {
19357 0 : return NULL;
19358 : }
19359 0 : PyTuple_SetItem(result, 0, py_validation);
19360 0 : py_authoritative = PyLong_FromLong((uint16_t)(r->out.authoritative));
19361 0 : PyTuple_SetItem(result, 1, py_authoritative);
19362 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
19363 0 : PyErr_SetNTSTATUS(r->out.result);
19364 0 : return NULL;
19365 : }
19366 :
19367 0 : return result;
19368 : }
19369 :
19370 :
19371 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name(PyObject *obj, void *closure)
19372 : {
19373 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(obj);
19374 0 : PyObject *py_site_name;
19375 0 : if (object->in.site_name == NULL) {
19376 0 : Py_RETURN_NONE;
19377 : }
19378 0 : if (object->in.site_name == NULL) {
19379 0 : py_site_name = Py_None;
19380 0 : Py_INCREF(py_site_name);
19381 : } else {
19382 0 : if (object->in.site_name == NULL) {
19383 0 : py_site_name = Py_None;
19384 0 : Py_INCREF(py_site_name);
19385 : } else {
19386 0 : py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
19387 : }
19388 : }
19389 0 : return py_site_name;
19390 : }
19391 :
19392 0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
19393 : {
19394 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(py_obj);
19395 0 : if (value == NULL) {
19396 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.site_name");
19397 0 : return -1;
19398 : }
19399 0 : if (value == Py_None) {
19400 0 : object->in.site_name = NULL;
19401 : } else {
19402 0 : object->in.site_name = NULL;
19403 : {
19404 0 : const char *test_str;
19405 0 : const char *talloc_str;
19406 0 : PyObject *unicode = NULL;
19407 0 : if (PyUnicode_Check(value)) {
19408 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
19409 0 : if (unicode == NULL) {
19410 0 : return -1;
19411 : }
19412 0 : test_str = PyBytes_AS_STRING(unicode);
19413 0 : } else if (PyBytes_Check(value)) {
19414 0 : test_str = PyBytes_AS_STRING(value);
19415 : } else {
19416 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
19417 0 : return -1;
19418 : }
19419 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
19420 0 : if (unicode != NULL) {
19421 0 : Py_DECREF(unicode);
19422 : }
19423 0 : if (talloc_str == NULL) {
19424 0 : PyErr_NoMemory();
19425 0 : return -1;
19426 : }
19427 0 : object->in.site_name = talloc_str;
19428 : }
19429 : }
19430 0 : return 0;
19431 : }
19432 :
19433 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl(PyObject *obj, void *closure)
19434 : {
19435 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(obj);
19436 0 : PyObject *py_dns_ttl;
19437 0 : py_dns_ttl = PyLong_FromUnsignedLongLong((uint32_t)(object->in.dns_ttl));
19438 0 : return py_dns_ttl;
19439 : }
19440 :
19441 0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl(PyObject *py_obj, PyObject *value, void *closure)
19442 : {
19443 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(py_obj);
19444 0 : if (value == NULL) {
19445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dns_ttl");
19446 0 : return -1;
19447 : }
19448 : {
19449 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dns_ttl));
19450 0 : if (PyLong_Check(value)) {
19451 0 : unsigned long long test_var;
19452 0 : test_var = PyLong_AsUnsignedLongLong(value);
19453 0 : if (PyErr_Occurred() != NULL) {
19454 0 : return -1;
19455 : }
19456 0 : if (test_var > uint_max) {
19457 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19458 : PyLong_Type.tp_name, uint_max, test_var);
19459 0 : return -1;
19460 : }
19461 0 : object->in.dns_ttl = test_var;
19462 : } else {
19463 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19464 : PyLong_Type.tp_name);
19465 0 : return -1;
19466 : }
19467 : }
19468 0 : return 0;
19469 : }
19470 :
19471 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names(PyObject *obj, void *closure)
19472 : {
19473 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(obj);
19474 0 : PyObject *py_dns_names;
19475 0 : if (object->in.dns_names == NULL) {
19476 0 : Py_RETURN_NONE;
19477 : }
19478 0 : py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, object->in.dns_names, object->in.dns_names);
19479 0 : return py_dns_names;
19480 : }
19481 :
19482 0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names(PyObject *py_obj, PyObject *value, void *closure)
19483 : {
19484 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(py_obj);
19485 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dns_names));
19486 0 : if (value == NULL) {
19487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dns_names");
19488 0 : return -1;
19489 : }
19490 0 : object->in.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dns_names);
19491 0 : if (object->in.dns_names == NULL) {
19492 0 : PyErr_NoMemory();
19493 0 : return -1;
19494 : }
19495 0 : PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;);
19496 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19497 0 : PyErr_NoMemory();
19498 0 : return -1;
19499 : }
19500 0 : object->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value);
19501 0 : return 0;
19502 : }
19503 :
19504 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names(PyObject *obj, void *closure)
19505 : {
19506 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(obj);
19507 0 : PyObject *py_dns_names;
19508 0 : if (object->out.dns_names == NULL) {
19509 0 : Py_RETURN_NONE;
19510 : }
19511 0 : py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, object->out.dns_names, object->out.dns_names);
19512 0 : return py_dns_names;
19513 : }
19514 :
19515 0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names(PyObject *py_obj, PyObject *value, void *closure)
19516 : {
19517 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(py_obj);
19518 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dns_names));
19519 0 : if (value == NULL) {
19520 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.dns_names");
19521 0 : return -1;
19522 : }
19523 0 : object->out.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dns_names);
19524 0 : if (object->out.dns_names == NULL) {
19525 0 : PyErr_NoMemory();
19526 0 : return -1;
19527 : }
19528 0 : PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;);
19529 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19530 0 : PyErr_NoMemory();
19531 0 : return -1;
19532 : }
19533 0 : object->out.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value);
19534 0 : return 0;
19535 : }
19536 :
19537 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_get_result(PyObject *obj, void *closure)
19538 : {
19539 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(obj);
19540 0 : PyObject *py_result;
19541 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
19542 0 : return py_result;
19543 : }
19544 :
19545 0 : static int py_winbind_DsrUpdateReadOnlyServerDnsRecords_set_result(PyObject *py_obj, PyObject *value, void *closure)
19546 : {
19547 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(py_obj);
19548 0 : if (value == NULL) {
19549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
19550 0 : return -1;
19551 : }
19552 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
19553 0 : return 0;
19554 : }
19555 :
19556 : static PyGetSetDef py_winbind_DsrUpdateReadOnlyServerDnsRecords_getsetters[] = {
19557 : {
19558 : .name = discard_const_p(char, "in_site_name"),
19559 : .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_site_name,
19560 : .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_site_name,
19561 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
19562 : },
19563 : {
19564 : .name = discard_const_p(char, "in_dns_ttl"),
19565 : .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_ttl,
19566 : .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_ttl,
19567 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19568 : },
19569 : {
19570 : .name = discard_const_p(char, "in_dns_names"),
19571 : .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_get_dns_names,
19572 : .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_in_set_dns_names,
19573 : .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY")
19574 : },
19575 : {
19576 : .name = discard_const_p(char, "out_dns_names"),
19577 : .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_get_dns_names,
19578 : .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_out_set_dns_names,
19579 : .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY")
19580 : },
19581 : {
19582 : .name = discard_const_p(char, "result"),
19583 : .get = py_winbind_DsrUpdateReadOnlyServerDnsRecords_get_result,
19584 : .set = py_winbind_DsrUpdateReadOnlyServerDnsRecords_set_result,
19585 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
19586 : },
19587 : { .name = NULL }
19588 : };
19589 :
19590 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19591 : {
19592 0 : PyObject *self = pytalloc_new(struct winbind_DsrUpdateReadOnlyServerDnsRecords, type);
19593 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *_self = (struct winbind_DsrUpdateReadOnlyServerDnsRecords *)pytalloc_get_ptr(self);
19594 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
19595 0 : _self->in.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY);
19596 0 : _self->out.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY);
19597 0 : return self;
19598 : }
19599 :
19600 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19601 : {
19602 :
19603 :
19604 0 : return PyLong_FromLong(29);
19605 : }
19606 :
19607 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
19608 : {
19609 0 : const struct ndr_interface_call *call = NULL;
19610 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(py_obj);
19611 0 : PyObject *ret = NULL;
19612 0 : struct ndr_push *push = NULL;
19613 0 : DATA_BLOB blob;
19614 0 : enum ndr_err_code err;
19615 :
19616 0 : if (ndr_table_winbind.num_calls < 30) {
19617 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack");
19618 0 : return NULL;
19619 : }
19620 0 : call = &ndr_table_winbind.calls[29];
19621 :
19622 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19623 0 : if (push == NULL) {
19624 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19625 0 : return NULL;
19626 : }
19627 :
19628 0 : push->flags |= ndr_push_flags;
19629 :
19630 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19631 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19632 0 : TALLOC_FREE(push);
19633 0 : PyErr_SetNdrError(err);
19634 0 : return NULL;
19635 : }
19636 0 : blob = ndr_push_blob(push);
19637 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19638 0 : TALLOC_FREE(push);
19639 0 : return ret;
19640 : }
19641 :
19642 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19643 : {
19644 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19645 0 : PyObject *bigendian_obj = NULL;
19646 0 : PyObject *ndr64_obj = NULL;
19647 0 : libndr_flags ndr_push_flags = 0;
19648 :
19649 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19650 : discard_const_p(char *, kwnames),
19651 : &bigendian_obj,
19652 : &ndr64_obj)) {
19653 0 : return NULL;
19654 : }
19655 :
19656 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19657 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19658 : }
19659 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19660 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19661 : }
19662 :
19663 0 : return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19664 : }
19665 :
19666 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19667 : {
19668 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19669 0 : PyObject *bigendian_obj = NULL;
19670 0 : PyObject *ndr64_obj = NULL;
19671 0 : libndr_flags ndr_push_flags = 0;
19672 :
19673 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19674 : discard_const_p(char *, kwnames),
19675 : &bigendian_obj,
19676 : &ndr64_obj)) {
19677 0 : return NULL;
19678 : }
19679 :
19680 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19681 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19682 : }
19683 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19684 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19685 : }
19686 :
19687 0 : return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19688 : }
19689 :
19690 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
19691 : {
19692 0 : const struct ndr_interface_call *call = NULL;
19693 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(py_obj);
19694 0 : struct ndr_pull *pull = NULL;
19695 0 : enum ndr_err_code err;
19696 :
19697 0 : if (ndr_table_winbind.num_calls < 30) {
19698 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack");
19699 0 : return NULL;
19700 : }
19701 0 : call = &ndr_table_winbind.calls[29];
19702 :
19703 0 : pull = ndr_pull_init_blob(blob, object);
19704 0 : if (pull == NULL) {
19705 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19706 0 : return NULL;
19707 : }
19708 :
19709 0 : pull->flags |= ndr_pull_flags;
19710 :
19711 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19712 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19713 0 : TALLOC_FREE(pull);
19714 0 : PyErr_SetNdrError(err);
19715 0 : return NULL;
19716 : }
19717 0 : if (!allow_remaining) {
19718 0 : uint32_t highest_ofs;
19719 :
19720 0 : if (pull->offset > pull->relative_highest_offset) {
19721 0 : highest_ofs = pull->offset;
19722 : } else {
19723 0 : highest_ofs = pull->relative_highest_offset;
19724 : }
19725 0 : if (highest_ofs < pull->data_size) {
19726 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19727 : "not all bytes consumed ofs[%u] size[%u]",
19728 : highest_ofs, pull->data_size);
19729 0 : TALLOC_FREE(pull);
19730 0 : PyErr_SetNdrError(err);
19731 0 : return NULL;
19732 : }
19733 : }
19734 :
19735 0 : TALLOC_FREE(pull);
19736 0 : Py_RETURN_NONE;
19737 : }
19738 :
19739 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19740 : {
19741 0 : DATA_BLOB blob;
19742 0 : Py_ssize_t blob_length = 0;
19743 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19744 0 : PyObject *bigendian_obj = NULL;
19745 0 : PyObject *ndr64_obj = NULL;
19746 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19747 0 : PyObject *allow_remaining_obj = NULL;
19748 0 : bool allow_remaining = false;
19749 :
19750 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19751 : discard_const_p(char *, kwnames),
19752 : &blob.data, &blob_length,
19753 : &bigendian_obj,
19754 : &ndr64_obj,
19755 : &allow_remaining_obj)) {
19756 0 : return NULL;
19757 : }
19758 0 : blob.length = blob_length;
19759 :
19760 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19761 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19762 : }
19763 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19764 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19765 : }
19766 :
19767 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19768 0 : allow_remaining = true;
19769 : }
19770 :
19771 0 : return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19772 : }
19773 :
19774 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19775 : {
19776 0 : DATA_BLOB blob;
19777 0 : Py_ssize_t blob_length = 0;
19778 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19779 0 : PyObject *bigendian_obj = NULL;
19780 0 : PyObject *ndr64_obj = NULL;
19781 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19782 0 : PyObject *allow_remaining_obj = NULL;
19783 0 : bool allow_remaining = false;
19784 :
19785 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19786 : discard_const_p(char *, kwnames),
19787 : &blob.data, &blob_length,
19788 : &bigendian_obj,
19789 : &ndr64_obj,
19790 : &allow_remaining_obj)) {
19791 0 : return NULL;
19792 : }
19793 0 : blob.length = blob_length;
19794 :
19795 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19796 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19797 : }
19798 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19799 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19800 : }
19801 :
19802 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19803 0 : allow_remaining = true;
19804 : }
19805 :
19806 0 : return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19807 : }
19808 :
19809 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19810 : {
19811 0 : const struct ndr_interface_call *call = NULL;
19812 0 : struct winbind_DsrUpdateReadOnlyServerDnsRecords *object = pytalloc_get_ptr(py_obj);
19813 0 : PyObject *ret;
19814 0 : char *retstr;
19815 :
19816 0 : if (ndr_table_winbind.num_calls < 30) {
19817 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print");
19818 0 : return NULL;
19819 : }
19820 0 : call = &ndr_table_winbind.calls[29];
19821 :
19822 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19823 0 : ret = PyUnicode_FromString(retstr);
19824 0 : TALLOC_FREE(retstr);
19825 :
19826 0 : return ret;
19827 : }
19828 :
19829 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19830 : {
19831 0 : return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "winbind_DsrUpdateReadOnlyServerDnsRecords_in", NDR_IN);
19832 : }
19833 :
19834 0 : static PyObject *py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19835 : {
19836 0 : return py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print(py_obj, "winbind_DsrUpdateReadOnlyServerDnsRecords_out", NDR_OUT);
19837 : }
19838 :
19839 : static PyMethodDef py_winbind_DsrUpdateReadOnlyServerDnsRecords_methods[] = {
19840 : { "opnum", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_opnum, METH_NOARGS|METH_CLASS,
19841 : "winbind.DsrUpdateReadOnlyServerDnsRecords.opnum() -> 29 (0x1d) " },
19842 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19843 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19844 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19845 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19846 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19847 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19848 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19849 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19850 : { "__ndr_print_in__", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19851 : { "__ndr_print_out__", (PyCFunction)py_winbind_DsrUpdateReadOnlyServerDnsRecords_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19852 : { NULL, NULL, 0, NULL }
19853 : };
19854 :
19855 :
19856 : static PyTypeObject winbind_DsrUpdateReadOnlyServerDnsRecords_Type = {
19857 : PyVarObject_HEAD_INIT(NULL, 0)
19858 : .tp_name = "winbind.DsrUpdateReadOnlyServerDnsRecords",
19859 : .tp_getset = py_winbind_DsrUpdateReadOnlyServerDnsRecords_getsetters,
19860 : .tp_methods = py_winbind_DsrUpdateReadOnlyServerDnsRecords_methods,
19861 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19862 : .tp_new = py_winbind_DsrUpdateReadOnlyServerDnsRecords_new,
19863 : };
19864 :
19865 5 : static bool pack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_in(PyObject *args, PyObject *kwargs, struct winbind_DsrUpdateReadOnlyServerDnsRecords *r)
19866 : {
19867 0 : PyObject *py_site_name;
19868 0 : PyObject *py_dns_ttl;
19869 0 : PyObject *py_dns_names;
19870 5 : const char *kwnames[] = {
19871 : "site_name", "dns_ttl", "dns_names", NULL
19872 : };
19873 :
19874 5 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_DsrUpdateReadOnlyServerDnsRecords", discard_const_p(char *, kwnames), &py_site_name, &py_dns_ttl, &py_dns_names)) {
19875 0 : return false;
19876 : }
19877 :
19878 5 : if (py_site_name == NULL) {
19879 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.site_name");
19880 0 : return false;
19881 : }
19882 5 : if (py_site_name == Py_None) {
19883 0 : r->in.site_name = NULL;
19884 : } else {
19885 5 : r->in.site_name = NULL;
19886 : {
19887 0 : const char *test_str;
19888 0 : const char *talloc_str;
19889 5 : PyObject *unicode = NULL;
19890 5 : if (PyUnicode_Check(py_site_name)) {
19891 5 : unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore");
19892 5 : if (unicode == NULL) {
19893 0 : return false;
19894 : }
19895 5 : test_str = PyBytes_AS_STRING(unicode);
19896 0 : } else if (PyBytes_Check(py_site_name)) {
19897 0 : test_str = PyBytes_AS_STRING(py_site_name);
19898 : } else {
19899 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name);
19900 0 : return false;
19901 : }
19902 5 : talloc_str = talloc_strdup(r, test_str);
19903 5 : if (unicode != NULL) {
19904 5 : Py_DECREF(unicode);
19905 : }
19906 5 : if (talloc_str == NULL) {
19907 0 : PyErr_NoMemory();
19908 0 : return false;
19909 : }
19910 5 : r->in.site_name = talloc_str;
19911 : }
19912 : }
19913 5 : if (py_dns_ttl == NULL) {
19914 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dns_ttl");
19915 0 : return false;
19916 : }
19917 : {
19918 5 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dns_ttl));
19919 5 : if (PyLong_Check(py_dns_ttl)) {
19920 0 : unsigned long long test_var;
19921 5 : test_var = PyLong_AsUnsignedLongLong(py_dns_ttl);
19922 5 : if (PyErr_Occurred() != NULL) {
19923 0 : return false;
19924 : }
19925 5 : if (test_var > uint_max) {
19926 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19927 : PyLong_Type.tp_name, uint_max, test_var);
19928 0 : return false;
19929 : }
19930 5 : r->in.dns_ttl = test_var;
19931 : } else {
19932 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19933 : PyLong_Type.tp_name);
19934 0 : return false;
19935 : }
19936 : }
19937 5 : if (py_dns_names == NULL) {
19938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dns_names");
19939 0 : return false;
19940 : }
19941 5 : r->in.dns_names = talloc_ptrtype(r, r->in.dns_names);
19942 5 : if (r->in.dns_names == NULL) {
19943 0 : PyErr_NoMemory();
19944 0 : return false;
19945 : }
19946 5 : PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, py_dns_names, return false;);
19947 5 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dns_names)) == NULL) {
19948 0 : PyErr_NoMemory();
19949 0 : return false;
19950 : }
19951 5 : r->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_dns_names);
19952 5 : return true;
19953 : }
19954 :
19955 5 : static PyObject *unpack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_out(struct winbind_DsrUpdateReadOnlyServerDnsRecords *r)
19956 : {
19957 0 : PyObject *result;
19958 0 : PyObject *py_dns_names;
19959 5 : py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, r->out.dns_names, r->out.dns_names);
19960 5 : result = py_dns_names;
19961 5 : if (NT_STATUS_IS_ERR(r->out.result)) {
19962 0 : PyErr_SetNTSTATUS(r->out.result);
19963 0 : return NULL;
19964 : }
19965 :
19966 5 : return result;
19967 : }
19968 :
19969 :
19970 0 : static PyObject *py_winbind_LogonControl_in_get_function_code(PyObject *obj, void *closure)
19971 : {
19972 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(obj);
19973 0 : PyObject *py_function_code;
19974 0 : py_function_code = PyLong_FromUnsignedLongLong((uint32_t)(object->in.function_code));
19975 0 : return py_function_code;
19976 : }
19977 :
19978 0 : static int py_winbind_LogonControl_in_set_function_code(PyObject *py_obj, PyObject *value, void *closure)
19979 : {
19980 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(py_obj);
19981 0 : if (value == NULL) {
19982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.function_code");
19983 0 : return -1;
19984 : }
19985 : {
19986 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.function_code));
19987 0 : if (PyLong_Check(value)) {
19988 0 : unsigned long long test_var;
19989 0 : test_var = PyLong_AsUnsignedLongLong(value);
19990 0 : if (PyErr_Occurred() != NULL) {
19991 0 : return -1;
19992 : }
19993 0 : if (test_var > uint_max) {
19994 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19995 : PyLong_Type.tp_name, uint_max, test_var);
19996 0 : return -1;
19997 : }
19998 0 : object->in.function_code = test_var;
19999 : } else {
20000 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20001 : PyLong_Type.tp_name);
20002 0 : return -1;
20003 : }
20004 : }
20005 0 : return 0;
20006 : }
20007 :
20008 0 : static PyObject *py_winbind_LogonControl_in_get_level(PyObject *obj, void *closure)
20009 : {
20010 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(obj);
20011 0 : PyObject *py_level;
20012 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
20013 0 : return py_level;
20014 : }
20015 :
20016 0 : static int py_winbind_LogonControl_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
20017 : {
20018 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(py_obj);
20019 0 : if (value == NULL) {
20020 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
20021 0 : return -1;
20022 : }
20023 : {
20024 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
20025 0 : if (PyLong_Check(value)) {
20026 0 : unsigned long long test_var;
20027 0 : test_var = PyLong_AsUnsignedLongLong(value);
20028 0 : if (PyErr_Occurred() != NULL) {
20029 0 : return -1;
20030 : }
20031 0 : if (test_var > uint_max) {
20032 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20033 : PyLong_Type.tp_name, uint_max, test_var);
20034 0 : return -1;
20035 : }
20036 0 : object->in.level = test_var;
20037 : } else {
20038 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20039 : PyLong_Type.tp_name);
20040 0 : return -1;
20041 : }
20042 : }
20043 0 : return 0;
20044 : }
20045 :
20046 0 : static PyObject *py_winbind_LogonControl_in_get_data(PyObject *obj, void *closure)
20047 : {
20048 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(obj);
20049 0 : PyObject *py_data;
20050 0 : if (object->in.data == NULL) {
20051 0 : Py_RETURN_NONE;
20052 : }
20053 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");
20054 0 : if (py_data == NULL) {
20055 0 : return NULL;
20056 : }
20057 0 : return py_data;
20058 : }
20059 :
20060 0 : static int py_winbind_LogonControl_in_set_data(PyObject *py_obj, PyObject *value, void *closure)
20061 : {
20062 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(py_obj);
20063 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.data));
20064 0 : if (value == NULL) {
20065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.data");
20066 0 : return -1;
20067 : }
20068 0 : object->in.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data);
20069 0 : if (object->in.data == NULL) {
20070 0 : PyErr_NoMemory();
20071 0 : return -1;
20072 : }
20073 : {
20074 0 : union netr_CONTROL_DATA_INFORMATION *data_switch_1;
20075 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");
20076 0 : if (data_switch_1 == NULL) {
20077 0 : return -1;
20078 : }
20079 0 : object->in.data = data_switch_1;
20080 : }
20081 0 : return 0;
20082 : }
20083 :
20084 0 : static PyObject *py_winbind_LogonControl_out_get_query(PyObject *obj, void *closure)
20085 : {
20086 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(obj);
20087 0 : PyObject *py_query;
20088 0 : if (object->out.query == NULL) {
20089 0 : Py_RETURN_NONE;
20090 : }
20091 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");
20092 0 : if (py_query == NULL) {
20093 0 : return NULL;
20094 : }
20095 0 : return py_query;
20096 : }
20097 :
20098 0 : static int py_winbind_LogonControl_out_set_query(PyObject *py_obj, PyObject *value, void *closure)
20099 : {
20100 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(py_obj);
20101 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.query));
20102 0 : if (value == NULL) {
20103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.query");
20104 0 : return -1;
20105 : }
20106 0 : object->out.query = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.query);
20107 0 : if (object->out.query == NULL) {
20108 0 : PyErr_NoMemory();
20109 0 : return -1;
20110 : }
20111 : {
20112 0 : union netr_CONTROL_QUERY_INFORMATION *query_switch_1;
20113 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");
20114 0 : if (query_switch_1 == NULL) {
20115 0 : return -1;
20116 : }
20117 0 : object->out.query = query_switch_1;
20118 : }
20119 0 : return 0;
20120 : }
20121 :
20122 0 : static PyObject *py_winbind_LogonControl_get_result(PyObject *obj, void *closure)
20123 : {
20124 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(obj);
20125 0 : PyObject *py_result;
20126 0 : py_result = PyErr_FromWERROR(object->out.result);
20127 0 : return py_result;
20128 : }
20129 :
20130 0 : static int py_winbind_LogonControl_set_result(PyObject *py_obj, PyObject *value, void *closure)
20131 : {
20132 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(py_obj);
20133 0 : if (value == NULL) {
20134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
20135 0 : return -1;
20136 : }
20137 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
20138 0 : return 0;
20139 : }
20140 :
20141 : static PyGetSetDef py_winbind_LogonControl_getsetters[] = {
20142 : {
20143 : .name = discard_const_p(char, "in_function_code"),
20144 : .get = py_winbind_LogonControl_in_get_function_code,
20145 : .set = py_winbind_LogonControl_in_set_function_code,
20146 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_LogonControlCode")
20147 : },
20148 : {
20149 : .name = discard_const_p(char, "in_level"),
20150 : .get = py_winbind_LogonControl_in_get_level,
20151 : .set = py_winbind_LogonControl_in_set_level,
20152 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20153 : },
20154 : {
20155 : .name = discard_const_p(char, "in_data"),
20156 : .get = py_winbind_LogonControl_in_get_data,
20157 : .set = py_winbind_LogonControl_in_set_data,
20158 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_DATA_INFORMATION")
20159 : },
20160 : {
20161 : .name = discard_const_p(char, "out_query"),
20162 : .get = py_winbind_LogonControl_out_get_query,
20163 : .set = py_winbind_LogonControl_out_set_query,
20164 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_CONTROL_QUERY_INFORMATION")
20165 : },
20166 : {
20167 : .name = discard_const_p(char, "result"),
20168 : .get = py_winbind_LogonControl_get_result,
20169 : .set = py_winbind_LogonControl_set_result,
20170 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
20171 : },
20172 : { .name = NULL }
20173 : };
20174 :
20175 0 : static PyObject *py_winbind_LogonControl_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20176 : {
20177 0 : PyObject *self = pytalloc_new(struct winbind_LogonControl, type);
20178 0 : struct winbind_LogonControl *_self = (struct winbind_LogonControl *)pytalloc_get_ptr(self);
20179 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20180 0 : _self->in.data = talloc_zero(mem_ctx, union netr_CONTROL_DATA_INFORMATION);
20181 0 : _self->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
20182 0 : return self;
20183 : }
20184 :
20185 0 : static PyObject *py_winbind_LogonControl_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20186 : {
20187 :
20188 :
20189 0 : return PyLong_FromLong(30);
20190 : }
20191 :
20192 0 : static PyObject *py_winbind_LogonControl_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20193 : {
20194 0 : const struct ndr_interface_call *call = NULL;
20195 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(py_obj);
20196 0 : PyObject *ret = NULL;
20197 0 : struct ndr_push *push = NULL;
20198 0 : DATA_BLOB blob;
20199 0 : enum ndr_err_code err;
20200 :
20201 0 : if (ndr_table_winbind.num_calls < 31) {
20202 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_pack");
20203 0 : return NULL;
20204 : }
20205 0 : call = &ndr_table_winbind.calls[30];
20206 :
20207 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20208 0 : if (push == NULL) {
20209 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20210 0 : return NULL;
20211 : }
20212 :
20213 0 : push->flags |= ndr_push_flags;
20214 :
20215 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20216 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20217 0 : TALLOC_FREE(push);
20218 0 : PyErr_SetNdrError(err);
20219 0 : return NULL;
20220 : }
20221 0 : blob = ndr_push_blob(push);
20222 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20223 0 : TALLOC_FREE(push);
20224 0 : return ret;
20225 : }
20226 :
20227 0 : static PyObject *py_winbind_LogonControl_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20228 : {
20229 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20230 0 : PyObject *bigendian_obj = NULL;
20231 0 : PyObject *ndr64_obj = NULL;
20232 0 : libndr_flags ndr_push_flags = 0;
20233 :
20234 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20235 : discard_const_p(char *, kwnames),
20236 : &bigendian_obj,
20237 : &ndr64_obj)) {
20238 0 : return NULL;
20239 : }
20240 :
20241 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20242 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20243 : }
20244 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20245 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20246 : }
20247 :
20248 0 : return py_winbind_LogonControl_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20249 : }
20250 :
20251 0 : static PyObject *py_winbind_LogonControl_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20252 : {
20253 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20254 0 : PyObject *bigendian_obj = NULL;
20255 0 : PyObject *ndr64_obj = NULL;
20256 0 : libndr_flags ndr_push_flags = 0;
20257 :
20258 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20259 : discard_const_p(char *, kwnames),
20260 : &bigendian_obj,
20261 : &ndr64_obj)) {
20262 0 : return NULL;
20263 : }
20264 :
20265 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20266 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20267 : }
20268 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20269 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20270 : }
20271 :
20272 0 : return py_winbind_LogonControl_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20273 : }
20274 :
20275 0 : static PyObject *py_winbind_LogonControl_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
20276 : {
20277 0 : const struct ndr_interface_call *call = NULL;
20278 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(py_obj);
20279 0 : struct ndr_pull *pull = NULL;
20280 0 : enum ndr_err_code err;
20281 :
20282 0 : if (ndr_table_winbind.num_calls < 31) {
20283 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_unpack");
20284 0 : return NULL;
20285 : }
20286 0 : call = &ndr_table_winbind.calls[30];
20287 :
20288 0 : pull = ndr_pull_init_blob(blob, object);
20289 0 : if (pull == NULL) {
20290 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20291 0 : return NULL;
20292 : }
20293 :
20294 0 : pull->flags |= ndr_pull_flags;
20295 :
20296 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20297 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20298 0 : TALLOC_FREE(pull);
20299 0 : PyErr_SetNdrError(err);
20300 0 : return NULL;
20301 : }
20302 0 : if (!allow_remaining) {
20303 0 : uint32_t highest_ofs;
20304 :
20305 0 : if (pull->offset > pull->relative_highest_offset) {
20306 0 : highest_ofs = pull->offset;
20307 : } else {
20308 0 : highest_ofs = pull->relative_highest_offset;
20309 : }
20310 0 : if (highest_ofs < pull->data_size) {
20311 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20312 : "not all bytes consumed ofs[%u] size[%u]",
20313 : highest_ofs, pull->data_size);
20314 0 : TALLOC_FREE(pull);
20315 0 : PyErr_SetNdrError(err);
20316 0 : return NULL;
20317 : }
20318 : }
20319 :
20320 0 : TALLOC_FREE(pull);
20321 0 : Py_RETURN_NONE;
20322 : }
20323 :
20324 0 : static PyObject *py_winbind_LogonControl_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20325 : {
20326 0 : DATA_BLOB blob;
20327 0 : Py_ssize_t blob_length = 0;
20328 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20329 0 : PyObject *bigendian_obj = NULL;
20330 0 : PyObject *ndr64_obj = NULL;
20331 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20332 0 : PyObject *allow_remaining_obj = NULL;
20333 0 : bool allow_remaining = false;
20334 :
20335 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20336 : discard_const_p(char *, kwnames),
20337 : &blob.data, &blob_length,
20338 : &bigendian_obj,
20339 : &ndr64_obj,
20340 : &allow_remaining_obj)) {
20341 0 : return NULL;
20342 : }
20343 0 : blob.length = blob_length;
20344 :
20345 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20346 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20347 : }
20348 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20349 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20350 : }
20351 :
20352 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20353 0 : allow_remaining = true;
20354 : }
20355 :
20356 0 : return py_winbind_LogonControl_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20357 : }
20358 :
20359 0 : static PyObject *py_winbind_LogonControl_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20360 : {
20361 0 : DATA_BLOB blob;
20362 0 : Py_ssize_t blob_length = 0;
20363 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20364 0 : PyObject *bigendian_obj = NULL;
20365 0 : PyObject *ndr64_obj = NULL;
20366 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20367 0 : PyObject *allow_remaining_obj = NULL;
20368 0 : bool allow_remaining = false;
20369 :
20370 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20371 : discard_const_p(char *, kwnames),
20372 : &blob.data, &blob_length,
20373 : &bigendian_obj,
20374 : &ndr64_obj,
20375 : &allow_remaining_obj)) {
20376 0 : return NULL;
20377 : }
20378 0 : blob.length = blob_length;
20379 :
20380 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20381 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20382 : }
20383 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20384 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20385 : }
20386 :
20387 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20388 0 : allow_remaining = true;
20389 : }
20390 :
20391 0 : return py_winbind_LogonControl_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20392 : }
20393 :
20394 0 : static PyObject *py_winbind_LogonControl_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
20395 : {
20396 0 : const struct ndr_interface_call *call = NULL;
20397 0 : struct winbind_LogonControl *object = pytalloc_get_ptr(py_obj);
20398 0 : PyObject *ret;
20399 0 : char *retstr;
20400 :
20401 0 : if (ndr_table_winbind.num_calls < 31) {
20402 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_LogonControl_ndr_print");
20403 0 : return NULL;
20404 : }
20405 0 : call = &ndr_table_winbind.calls[30];
20406 :
20407 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
20408 0 : ret = PyUnicode_FromString(retstr);
20409 0 : TALLOC_FREE(retstr);
20410 :
20411 0 : return ret;
20412 : }
20413 :
20414 0 : static PyObject *py_winbind_LogonControl_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20415 : {
20416 0 : return py_winbind_LogonControl_ndr_print(py_obj, "winbind_LogonControl_in", NDR_IN);
20417 : }
20418 :
20419 0 : static PyObject *py_winbind_LogonControl_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20420 : {
20421 0 : return py_winbind_LogonControl_ndr_print(py_obj, "winbind_LogonControl_out", NDR_OUT);
20422 : }
20423 :
20424 : static PyMethodDef py_winbind_LogonControl_methods[] = {
20425 : { "opnum", (PyCFunction)py_winbind_LogonControl_ndr_opnum, METH_NOARGS|METH_CLASS,
20426 : "winbind.LogonControl.opnum() -> 30 (0x1e) " },
20427 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20428 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20429 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20430 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20431 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20432 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20433 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_LogonControl_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20434 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20435 : { "__ndr_print_in__", (PyCFunction)py_winbind_LogonControl_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
20436 : { "__ndr_print_out__", (PyCFunction)py_winbind_LogonControl_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
20437 : { NULL, NULL, 0, NULL }
20438 : };
20439 :
20440 :
20441 : static PyTypeObject winbind_LogonControl_Type = {
20442 : PyVarObject_HEAD_INIT(NULL, 0)
20443 : .tp_name = "winbind.LogonControl",
20444 : .tp_getset = py_winbind_LogonControl_getsetters,
20445 : .tp_methods = py_winbind_LogonControl_methods,
20446 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20447 : .tp_new = py_winbind_LogonControl_new,
20448 : };
20449 :
20450 0 : static bool pack_py_winbind_LogonControl_args_in(PyObject *args, PyObject *kwargs, struct winbind_LogonControl *r)
20451 : {
20452 0 : PyObject *py_function_code;
20453 0 : PyObject *py_level;
20454 0 : PyObject *py_data;
20455 0 : const char *kwnames[] = {
20456 : "function_code", "level", "data", NULL
20457 : };
20458 :
20459 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winbind_LogonControl", discard_const_p(char *, kwnames), &py_function_code, &py_level, &py_data)) {
20460 0 : return false;
20461 : }
20462 :
20463 0 : if (py_function_code == NULL) {
20464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.function_code");
20465 0 : return false;
20466 : }
20467 : {
20468 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.function_code));
20469 0 : if (PyLong_Check(py_function_code)) {
20470 0 : unsigned long long test_var;
20471 0 : test_var = PyLong_AsUnsignedLongLong(py_function_code);
20472 0 : if (PyErr_Occurred() != NULL) {
20473 0 : return false;
20474 : }
20475 0 : if (test_var > uint_max) {
20476 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20477 : PyLong_Type.tp_name, uint_max, test_var);
20478 0 : return false;
20479 : }
20480 0 : r->in.function_code = test_var;
20481 : } else {
20482 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20483 : PyLong_Type.tp_name);
20484 0 : return false;
20485 : }
20486 : }
20487 0 : if (py_level == NULL) {
20488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
20489 0 : return false;
20490 : }
20491 : {
20492 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
20493 0 : if (PyLong_Check(py_level)) {
20494 0 : unsigned long long test_var;
20495 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
20496 0 : if (PyErr_Occurred() != NULL) {
20497 0 : return false;
20498 : }
20499 0 : if (test_var > uint_max) {
20500 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20501 : PyLong_Type.tp_name, uint_max, test_var);
20502 0 : return false;
20503 : }
20504 0 : r->in.level = test_var;
20505 : } else {
20506 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20507 : PyLong_Type.tp_name);
20508 0 : return false;
20509 : }
20510 : }
20511 0 : if (py_data == NULL) {
20512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.data");
20513 0 : return false;
20514 : }
20515 0 : r->in.data = talloc_ptrtype(r, r->in.data);
20516 0 : if (r->in.data == NULL) {
20517 0 : PyErr_NoMemory();
20518 0 : return false;
20519 : }
20520 : {
20521 0 : union netr_CONTROL_DATA_INFORMATION *data_switch_1;
20522 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");
20523 0 : if (data_switch_1 == NULL) {
20524 0 : return false;
20525 : }
20526 0 : r->in.data = data_switch_1;
20527 : }
20528 0 : return true;
20529 : }
20530 :
20531 0 : static PyObject *unpack_py_winbind_LogonControl_args_out(struct winbind_LogonControl *r)
20532 : {
20533 0 : PyObject *result;
20534 0 : PyObject *py_query;
20535 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");
20536 0 : if (py_query == NULL) {
20537 0 : return NULL;
20538 : }
20539 0 : result = py_query;
20540 0 : if (!W_ERROR_IS_OK(r->out.result)) {
20541 0 : PyErr_SetWERROR(r->out.result);
20542 0 : return NULL;
20543 : }
20544 :
20545 0 : return result;
20546 : }
20547 :
20548 :
20549 0 : static PyObject *py_winbind_GetForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
20550 : {
20551 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(obj);
20552 0 : PyObject *py_trusted_domain_name;
20553 0 : if (object->in.trusted_domain_name == NULL) {
20554 0 : Py_RETURN_NONE;
20555 : }
20556 0 : if (object->in.trusted_domain_name == NULL) {
20557 0 : py_trusted_domain_name = Py_None;
20558 0 : Py_INCREF(py_trusted_domain_name);
20559 : } else {
20560 0 : if (object->in.trusted_domain_name == NULL) {
20561 0 : py_trusted_domain_name = Py_None;
20562 0 : Py_INCREF(py_trusted_domain_name);
20563 : } else {
20564 0 : py_trusted_domain_name = PyUnicode_Decode(object->in.trusted_domain_name, strlen(object->in.trusted_domain_name), "utf-8", "ignore");
20565 : }
20566 : }
20567 0 : return py_trusted_domain_name;
20568 : }
20569 :
20570 0 : static int py_winbind_GetForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
20571 : {
20572 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
20573 0 : if (value == NULL) {
20574 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trusted_domain_name");
20575 0 : return -1;
20576 : }
20577 0 : if (value == Py_None) {
20578 0 : object->in.trusted_domain_name = NULL;
20579 : } else {
20580 0 : object->in.trusted_domain_name = NULL;
20581 : {
20582 0 : const char *test_str;
20583 0 : const char *talloc_str;
20584 0 : PyObject *unicode = NULL;
20585 0 : if (PyUnicode_Check(value)) {
20586 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
20587 0 : if (unicode == NULL) {
20588 0 : return -1;
20589 : }
20590 0 : test_str = PyBytes_AS_STRING(unicode);
20591 0 : } else if (PyBytes_Check(value)) {
20592 0 : test_str = PyBytes_AS_STRING(value);
20593 : } else {
20594 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
20595 0 : return -1;
20596 : }
20597 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
20598 0 : if (unicode != NULL) {
20599 0 : Py_DECREF(unicode);
20600 : }
20601 0 : if (talloc_str == NULL) {
20602 0 : PyErr_NoMemory();
20603 0 : return -1;
20604 : }
20605 0 : object->in.trusted_domain_name = talloc_str;
20606 : }
20607 : }
20608 0 : return 0;
20609 : }
20610 :
20611 0 : static PyObject *py_winbind_GetForestTrustInformation_in_get_flags(PyObject *obj, void *closure)
20612 : {
20613 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(obj);
20614 0 : PyObject *py_flags;
20615 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
20616 0 : return py_flags;
20617 : }
20618 :
20619 0 : static int py_winbind_GetForestTrustInformation_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
20620 : {
20621 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
20622 0 : if (value == NULL) {
20623 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
20624 0 : return -1;
20625 : }
20626 : {
20627 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
20628 0 : if (PyLong_Check(value)) {
20629 0 : unsigned long long test_var;
20630 0 : test_var = PyLong_AsUnsignedLongLong(value);
20631 0 : if (PyErr_Occurred() != NULL) {
20632 0 : return -1;
20633 : }
20634 0 : if (test_var > uint_max) {
20635 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20636 : PyLong_Type.tp_name, uint_max, test_var);
20637 0 : return -1;
20638 : }
20639 0 : object->in.flags = test_var;
20640 : } else {
20641 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20642 : PyLong_Type.tp_name);
20643 0 : return -1;
20644 : }
20645 : }
20646 0 : return 0;
20647 : }
20648 :
20649 0 : static PyObject *py_winbind_GetForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure)
20650 : {
20651 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(obj);
20652 0 : PyObject *py_forest_trust_info;
20653 0 : if (object->out.forest_trust_info == NULL) {
20654 0 : Py_RETURN_NONE;
20655 : }
20656 0 : if (*object->out.forest_trust_info == NULL) {
20657 0 : py_forest_trust_info = Py_None;
20658 0 : Py_INCREF(py_forest_trust_info);
20659 : } else {
20660 0 : py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *object->out.forest_trust_info, *object->out.forest_trust_info);
20661 : }
20662 0 : return py_forest_trust_info;
20663 : }
20664 :
20665 0 : static int py_winbind_GetForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
20666 : {
20667 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
20668 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info));
20669 0 : if (value == NULL) {
20670 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.forest_trust_info");
20671 0 : return -1;
20672 : }
20673 0 : object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info);
20674 0 : if (object->out.forest_trust_info == NULL) {
20675 0 : PyErr_NoMemory();
20676 0 : return -1;
20677 : }
20678 0 : if (value == Py_None) {
20679 0 : *object->out.forest_trust_info = NULL;
20680 : } else {
20681 0 : *object->out.forest_trust_info = NULL;
20682 0 : PY_CHECK_TYPE(lsa_ForestTrustInformation_Type, value, return -1;);
20683 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20684 0 : PyErr_NoMemory();
20685 0 : return -1;
20686 : }
20687 0 : *object->out.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
20688 : }
20689 0 : return 0;
20690 : }
20691 :
20692 0 : static PyObject *py_winbind_GetForestTrustInformation_get_result(PyObject *obj, void *closure)
20693 : {
20694 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(obj);
20695 0 : PyObject *py_result;
20696 0 : py_result = PyErr_FromWERROR(object->out.result);
20697 0 : return py_result;
20698 : }
20699 :
20700 0 : static int py_winbind_GetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
20701 : {
20702 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
20703 0 : if (value == NULL) {
20704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
20705 0 : return -1;
20706 : }
20707 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
20708 0 : return 0;
20709 : }
20710 :
20711 : static PyGetSetDef py_winbind_GetForestTrustInformation_getsetters[] = {
20712 : {
20713 : .name = discard_const_p(char, "in_trusted_domain_name"),
20714 : .get = py_winbind_GetForestTrustInformation_in_get_trusted_domain_name,
20715 : .set = py_winbind_GetForestTrustInformation_in_set_trusted_domain_name,
20716 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
20717 : },
20718 : {
20719 : .name = discard_const_p(char, "in_flags"),
20720 : .get = py_winbind_GetForestTrustInformation_in_get_flags,
20721 : .set = py_winbind_GetForestTrustInformation_in_set_flags,
20722 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20723 : },
20724 : {
20725 : .name = discard_const_p(char, "out_forest_trust_info"),
20726 : .get = py_winbind_GetForestTrustInformation_out_get_forest_trust_info,
20727 : .set = py_winbind_GetForestTrustInformation_out_set_forest_trust_info,
20728 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
20729 : },
20730 : {
20731 : .name = discard_const_p(char, "result"),
20732 : .get = py_winbind_GetForestTrustInformation_get_result,
20733 : .set = py_winbind_GetForestTrustInformation_set_result,
20734 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
20735 : },
20736 : { .name = NULL }
20737 : };
20738 :
20739 0 : static PyObject *py_winbind_GetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20740 : {
20741 0 : PyObject *self = pytalloc_new(struct winbind_GetForestTrustInformation, type);
20742 0 : struct winbind_GetForestTrustInformation *_self = (struct winbind_GetForestTrustInformation *)pytalloc_get_ptr(self);
20743 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20744 : /* a pointer to a NULL pointer */
20745 0 : _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
20746 0 : return self;
20747 : }
20748 :
20749 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20750 : {
20751 :
20752 :
20753 0 : return PyLong_FromLong(31);
20754 : }
20755 :
20756 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20757 : {
20758 0 : const struct ndr_interface_call *call = NULL;
20759 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
20760 0 : PyObject *ret = NULL;
20761 0 : struct ndr_push *push = NULL;
20762 0 : DATA_BLOB blob;
20763 0 : enum ndr_err_code err;
20764 :
20765 0 : if (ndr_table_winbind.num_calls < 32) {
20766 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_pack");
20767 0 : return NULL;
20768 : }
20769 0 : call = &ndr_table_winbind.calls[31];
20770 :
20771 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20772 0 : if (push == NULL) {
20773 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20774 0 : return NULL;
20775 : }
20776 :
20777 0 : push->flags |= ndr_push_flags;
20778 :
20779 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20780 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20781 0 : TALLOC_FREE(push);
20782 0 : PyErr_SetNdrError(err);
20783 0 : return NULL;
20784 : }
20785 0 : blob = ndr_push_blob(push);
20786 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20787 0 : TALLOC_FREE(push);
20788 0 : return ret;
20789 : }
20790 :
20791 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20792 : {
20793 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20794 0 : PyObject *bigendian_obj = NULL;
20795 0 : PyObject *ndr64_obj = NULL;
20796 0 : libndr_flags ndr_push_flags = 0;
20797 :
20798 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20799 : discard_const_p(char *, kwnames),
20800 : &bigendian_obj,
20801 : &ndr64_obj)) {
20802 0 : return NULL;
20803 : }
20804 :
20805 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20806 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20807 : }
20808 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20809 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20810 : }
20811 :
20812 0 : return py_winbind_GetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20813 : }
20814 :
20815 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20816 : {
20817 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20818 0 : PyObject *bigendian_obj = NULL;
20819 0 : PyObject *ndr64_obj = NULL;
20820 0 : libndr_flags ndr_push_flags = 0;
20821 :
20822 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20823 : discard_const_p(char *, kwnames),
20824 : &bigendian_obj,
20825 : &ndr64_obj)) {
20826 0 : return NULL;
20827 : }
20828 :
20829 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20830 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20831 : }
20832 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20833 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20834 : }
20835 :
20836 0 : return py_winbind_GetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20837 : }
20838 :
20839 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
20840 : {
20841 0 : const struct ndr_interface_call *call = NULL;
20842 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
20843 0 : struct ndr_pull *pull = NULL;
20844 0 : enum ndr_err_code err;
20845 :
20846 0 : if (ndr_table_winbind.num_calls < 32) {
20847 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_unpack");
20848 0 : return NULL;
20849 : }
20850 0 : call = &ndr_table_winbind.calls[31];
20851 :
20852 0 : pull = ndr_pull_init_blob(blob, object);
20853 0 : if (pull == NULL) {
20854 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20855 0 : return NULL;
20856 : }
20857 :
20858 0 : pull->flags |= ndr_pull_flags;
20859 :
20860 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20861 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20862 0 : TALLOC_FREE(pull);
20863 0 : PyErr_SetNdrError(err);
20864 0 : return NULL;
20865 : }
20866 0 : if (!allow_remaining) {
20867 0 : uint32_t highest_ofs;
20868 :
20869 0 : if (pull->offset > pull->relative_highest_offset) {
20870 0 : highest_ofs = pull->offset;
20871 : } else {
20872 0 : highest_ofs = pull->relative_highest_offset;
20873 : }
20874 0 : if (highest_ofs < pull->data_size) {
20875 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20876 : "not all bytes consumed ofs[%u] size[%u]",
20877 : highest_ofs, pull->data_size);
20878 0 : TALLOC_FREE(pull);
20879 0 : PyErr_SetNdrError(err);
20880 0 : return NULL;
20881 : }
20882 : }
20883 :
20884 0 : TALLOC_FREE(pull);
20885 0 : Py_RETURN_NONE;
20886 : }
20887 :
20888 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20889 : {
20890 0 : DATA_BLOB blob;
20891 0 : Py_ssize_t blob_length = 0;
20892 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20893 0 : PyObject *bigendian_obj = NULL;
20894 0 : PyObject *ndr64_obj = NULL;
20895 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20896 0 : PyObject *allow_remaining_obj = NULL;
20897 0 : bool allow_remaining = false;
20898 :
20899 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20900 : discard_const_p(char *, kwnames),
20901 : &blob.data, &blob_length,
20902 : &bigendian_obj,
20903 : &ndr64_obj,
20904 : &allow_remaining_obj)) {
20905 0 : return NULL;
20906 : }
20907 0 : blob.length = blob_length;
20908 :
20909 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20910 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20911 : }
20912 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20913 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20914 : }
20915 :
20916 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20917 0 : allow_remaining = true;
20918 : }
20919 :
20920 0 : return py_winbind_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20921 : }
20922 :
20923 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20924 : {
20925 0 : DATA_BLOB blob;
20926 0 : Py_ssize_t blob_length = 0;
20927 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20928 0 : PyObject *bigendian_obj = NULL;
20929 0 : PyObject *ndr64_obj = NULL;
20930 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20931 0 : PyObject *allow_remaining_obj = NULL;
20932 0 : bool allow_remaining = false;
20933 :
20934 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20935 : discard_const_p(char *, kwnames),
20936 : &blob.data, &blob_length,
20937 : &bigendian_obj,
20938 : &ndr64_obj,
20939 : &allow_remaining_obj)) {
20940 0 : return NULL;
20941 : }
20942 0 : blob.length = blob_length;
20943 :
20944 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20945 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20946 : }
20947 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20948 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20949 : }
20950 :
20951 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20952 0 : allow_remaining = true;
20953 : }
20954 :
20955 0 : return py_winbind_GetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20956 : }
20957 :
20958 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
20959 : {
20960 0 : const struct ndr_interface_call *call = NULL;
20961 0 : struct winbind_GetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
20962 0 : PyObject *ret;
20963 0 : char *retstr;
20964 :
20965 0 : if (ndr_table_winbind.num_calls < 32) {
20966 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_GetForestTrustInformation_ndr_print");
20967 0 : return NULL;
20968 : }
20969 0 : call = &ndr_table_winbind.calls[31];
20970 :
20971 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
20972 0 : ret = PyUnicode_FromString(retstr);
20973 0 : TALLOC_FREE(retstr);
20974 :
20975 0 : return ret;
20976 : }
20977 :
20978 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20979 : {
20980 0 : return py_winbind_GetForestTrustInformation_ndr_print(py_obj, "winbind_GetForestTrustInformation_in", NDR_IN);
20981 : }
20982 :
20983 0 : static PyObject *py_winbind_GetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20984 : {
20985 0 : return py_winbind_GetForestTrustInformation_ndr_print(py_obj, "winbind_GetForestTrustInformation_out", NDR_OUT);
20986 : }
20987 :
20988 : static PyMethodDef py_winbind_GetForestTrustInformation_methods[] = {
20989 : { "opnum", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
20990 : "winbind.GetForestTrustInformation.opnum() -> 31 (0x1f) " },
20991 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20992 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20993 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20994 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20995 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20996 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20997 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_GetForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20998 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20999 : { "__ndr_print_in__", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21000 : { "__ndr_print_out__", (PyCFunction)py_winbind_GetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21001 : { NULL, NULL, 0, NULL }
21002 : };
21003 :
21004 :
21005 : static PyTypeObject winbind_GetForestTrustInformation_Type = {
21006 : PyVarObject_HEAD_INIT(NULL, 0)
21007 : .tp_name = "winbind.GetForestTrustInformation",
21008 : .tp_getset = py_winbind_GetForestTrustInformation_getsetters,
21009 : .tp_methods = py_winbind_GetForestTrustInformation_methods,
21010 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21011 : .tp_new = py_winbind_GetForestTrustInformation_new,
21012 : };
21013 :
21014 0 : static bool pack_py_winbind_GetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct winbind_GetForestTrustInformation *r)
21015 : {
21016 0 : PyObject *py_trusted_domain_name;
21017 0 : PyObject *py_flags;
21018 0 : const char *kwnames[] = {
21019 : "trusted_domain_name", "flags", NULL
21020 : };
21021 :
21022 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winbind_GetForestTrustInformation", discard_const_p(char *, kwnames), &py_trusted_domain_name, &py_flags)) {
21023 0 : return false;
21024 : }
21025 :
21026 0 : if (py_trusted_domain_name == NULL) {
21027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trusted_domain_name");
21028 0 : return false;
21029 : }
21030 0 : if (py_trusted_domain_name == Py_None) {
21031 0 : r->in.trusted_domain_name = NULL;
21032 : } else {
21033 0 : r->in.trusted_domain_name = NULL;
21034 : {
21035 0 : const char *test_str;
21036 0 : const char *talloc_str;
21037 0 : PyObject *unicode = NULL;
21038 0 : if (PyUnicode_Check(py_trusted_domain_name)) {
21039 0 : unicode = PyUnicode_AsEncodedString(py_trusted_domain_name, "utf-8", "ignore");
21040 0 : if (unicode == NULL) {
21041 0 : return false;
21042 : }
21043 0 : test_str = PyBytes_AS_STRING(unicode);
21044 0 : } else if (PyBytes_Check(py_trusted_domain_name)) {
21045 0 : test_str = PyBytes_AS_STRING(py_trusted_domain_name);
21046 : } else {
21047 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_trusted_domain_name)->tp_name);
21048 0 : return false;
21049 : }
21050 0 : talloc_str = talloc_strdup(r, test_str);
21051 0 : if (unicode != NULL) {
21052 0 : Py_DECREF(unicode);
21053 : }
21054 0 : if (talloc_str == NULL) {
21055 0 : PyErr_NoMemory();
21056 0 : return false;
21057 : }
21058 0 : r->in.trusted_domain_name = talloc_str;
21059 : }
21060 : }
21061 0 : if (py_flags == NULL) {
21062 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
21063 0 : return false;
21064 : }
21065 : {
21066 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
21067 0 : if (PyLong_Check(py_flags)) {
21068 0 : unsigned long long test_var;
21069 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
21070 0 : if (PyErr_Occurred() != NULL) {
21071 0 : return false;
21072 : }
21073 0 : if (test_var > uint_max) {
21074 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21075 : PyLong_Type.tp_name, uint_max, test_var);
21076 0 : return false;
21077 : }
21078 0 : r->in.flags = test_var;
21079 : } else {
21080 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21081 : PyLong_Type.tp_name);
21082 0 : return false;
21083 : }
21084 : }
21085 0 : return true;
21086 : }
21087 :
21088 0 : static PyObject *unpack_py_winbind_GetForestTrustInformation_args_out(struct winbind_GetForestTrustInformation *r)
21089 : {
21090 0 : PyObject *result;
21091 0 : PyObject *py_forest_trust_info;
21092 0 : if (*r->out.forest_trust_info == NULL) {
21093 0 : py_forest_trust_info = Py_None;
21094 0 : Py_INCREF(py_forest_trust_info);
21095 : } else {
21096 0 : py_forest_trust_info = pytalloc_reference_ex(lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
21097 : }
21098 0 : result = py_forest_trust_info;
21099 0 : if (!W_ERROR_IS_OK(r->out.result)) {
21100 0 : PyErr_SetWERROR(r->out.result);
21101 0 : return NULL;
21102 : }
21103 :
21104 0 : return result;
21105 : }
21106 :
21107 :
21108 0 : static PyObject *py_winbind_SendToSam_in_get_message(PyObject *obj, void *closure)
21109 : {
21110 0 : struct winbind_SendToSam *object = pytalloc_get_ptr(obj);
21111 0 : PyObject *py_message;
21112 0 : py_message = pytalloc_reference_ex(netr_SendToSamBase_Type, pytalloc_get_mem_ctx(obj), &object->in.message);
21113 0 : return py_message;
21114 : }
21115 :
21116 0 : static int py_winbind_SendToSam_in_set_message(PyObject *py_obj, PyObject *value, void *closure)
21117 : {
21118 0 : struct winbind_SendToSam *object = pytalloc_get_ptr(py_obj);
21119 0 : if (value == NULL) {
21120 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.message");
21121 0 : return -1;
21122 : }
21123 0 : PY_CHECK_TYPE(netr_SendToSamBase_Type, value, return -1;);
21124 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21125 0 : PyErr_NoMemory();
21126 0 : return -1;
21127 : }
21128 0 : object->in.message = *(struct netr_SendToSamBase *)pytalloc_get_ptr(value);
21129 0 : return 0;
21130 : }
21131 :
21132 0 : static PyObject *py_winbind_SendToSam_get_result(PyObject *obj, void *closure)
21133 : {
21134 0 : struct winbind_SendToSam *object = pytalloc_get_ptr(obj);
21135 0 : PyObject *py_result;
21136 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
21137 0 : return py_result;
21138 : }
21139 :
21140 0 : static int py_winbind_SendToSam_set_result(PyObject *py_obj, PyObject *value, void *closure)
21141 : {
21142 0 : struct winbind_SendToSam *object = pytalloc_get_ptr(py_obj);
21143 0 : if (value == NULL) {
21144 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
21145 0 : return -1;
21146 : }
21147 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
21148 0 : return 0;
21149 : }
21150 :
21151 : static PyGetSetDef py_winbind_SendToSam_getsetters[] = {
21152 : {
21153 : .name = discard_const_p(char, "in_message"),
21154 : .get = py_winbind_SendToSam_in_get_message,
21155 : .set = py_winbind_SendToSam_in_set_message,
21156 : .doc = discard_const_p(char, "PIDL-generated element of base type netr_SendToSamBase")
21157 : },
21158 : {
21159 : .name = discard_const_p(char, "result"),
21160 : .get = py_winbind_SendToSam_get_result,
21161 : .set = py_winbind_SendToSam_set_result,
21162 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
21163 : },
21164 : { .name = NULL }
21165 : };
21166 :
21167 0 : static PyObject *py_winbind_SendToSam_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21168 : {
21169 0 : PyObject *self = pytalloc_new(struct winbind_SendToSam, type);
21170 0 : return self;
21171 : }
21172 :
21173 0 : static PyObject *py_winbind_SendToSam_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21174 : {
21175 :
21176 :
21177 0 : return PyLong_FromLong(32);
21178 : }
21179 :
21180 0 : static PyObject *py_winbind_SendToSam_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
21181 : {
21182 0 : const struct ndr_interface_call *call = NULL;
21183 0 : struct winbind_SendToSam *object = pytalloc_get_ptr(py_obj);
21184 0 : PyObject *ret = NULL;
21185 0 : struct ndr_push *push = NULL;
21186 0 : DATA_BLOB blob;
21187 0 : enum ndr_err_code err;
21188 :
21189 0 : if (ndr_table_winbind.num_calls < 33) {
21190 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_pack");
21191 0 : return NULL;
21192 : }
21193 0 : call = &ndr_table_winbind.calls[32];
21194 :
21195 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21196 0 : if (push == NULL) {
21197 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21198 0 : return NULL;
21199 : }
21200 :
21201 0 : push->flags |= ndr_push_flags;
21202 :
21203 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21204 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21205 0 : TALLOC_FREE(push);
21206 0 : PyErr_SetNdrError(err);
21207 0 : return NULL;
21208 : }
21209 0 : blob = ndr_push_blob(push);
21210 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21211 0 : TALLOC_FREE(push);
21212 0 : return ret;
21213 : }
21214 :
21215 0 : static PyObject *py_winbind_SendToSam_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21216 : {
21217 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21218 0 : PyObject *bigendian_obj = NULL;
21219 0 : PyObject *ndr64_obj = NULL;
21220 0 : libndr_flags ndr_push_flags = 0;
21221 :
21222 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21223 : discard_const_p(char *, kwnames),
21224 : &bigendian_obj,
21225 : &ndr64_obj)) {
21226 0 : return NULL;
21227 : }
21228 :
21229 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21230 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21231 : }
21232 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21233 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21234 : }
21235 :
21236 0 : return py_winbind_SendToSam_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21237 : }
21238 :
21239 0 : static PyObject *py_winbind_SendToSam_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21240 : {
21241 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21242 0 : PyObject *bigendian_obj = NULL;
21243 0 : PyObject *ndr64_obj = NULL;
21244 0 : libndr_flags ndr_push_flags = 0;
21245 :
21246 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21247 : discard_const_p(char *, kwnames),
21248 : &bigendian_obj,
21249 : &ndr64_obj)) {
21250 0 : return NULL;
21251 : }
21252 :
21253 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21254 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21255 : }
21256 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21257 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21258 : }
21259 :
21260 0 : return py_winbind_SendToSam_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21261 : }
21262 :
21263 0 : static PyObject *py_winbind_SendToSam_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
21264 : {
21265 0 : const struct ndr_interface_call *call = NULL;
21266 0 : struct winbind_SendToSam *object = pytalloc_get_ptr(py_obj);
21267 0 : struct ndr_pull *pull = NULL;
21268 0 : enum ndr_err_code err;
21269 :
21270 0 : if (ndr_table_winbind.num_calls < 33) {
21271 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_unpack");
21272 0 : return NULL;
21273 : }
21274 0 : call = &ndr_table_winbind.calls[32];
21275 :
21276 0 : pull = ndr_pull_init_blob(blob, object);
21277 0 : if (pull == NULL) {
21278 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21279 0 : return NULL;
21280 : }
21281 :
21282 0 : pull->flags |= ndr_pull_flags;
21283 :
21284 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21285 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21286 0 : TALLOC_FREE(pull);
21287 0 : PyErr_SetNdrError(err);
21288 0 : return NULL;
21289 : }
21290 0 : if (!allow_remaining) {
21291 0 : uint32_t highest_ofs;
21292 :
21293 0 : if (pull->offset > pull->relative_highest_offset) {
21294 0 : highest_ofs = pull->offset;
21295 : } else {
21296 0 : highest_ofs = pull->relative_highest_offset;
21297 : }
21298 0 : if (highest_ofs < pull->data_size) {
21299 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21300 : "not all bytes consumed ofs[%u] size[%u]",
21301 : highest_ofs, pull->data_size);
21302 0 : TALLOC_FREE(pull);
21303 0 : PyErr_SetNdrError(err);
21304 0 : return NULL;
21305 : }
21306 : }
21307 :
21308 0 : TALLOC_FREE(pull);
21309 0 : Py_RETURN_NONE;
21310 : }
21311 :
21312 0 : static PyObject *py_winbind_SendToSam_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21313 : {
21314 0 : DATA_BLOB blob;
21315 0 : Py_ssize_t blob_length = 0;
21316 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21317 0 : PyObject *bigendian_obj = NULL;
21318 0 : PyObject *ndr64_obj = NULL;
21319 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21320 0 : PyObject *allow_remaining_obj = NULL;
21321 0 : bool allow_remaining = false;
21322 :
21323 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21324 : discard_const_p(char *, kwnames),
21325 : &blob.data, &blob_length,
21326 : &bigendian_obj,
21327 : &ndr64_obj,
21328 : &allow_remaining_obj)) {
21329 0 : return NULL;
21330 : }
21331 0 : blob.length = blob_length;
21332 :
21333 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21334 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21335 : }
21336 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21337 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21338 : }
21339 :
21340 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21341 0 : allow_remaining = true;
21342 : }
21343 :
21344 0 : return py_winbind_SendToSam_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21345 : }
21346 :
21347 0 : static PyObject *py_winbind_SendToSam_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21348 : {
21349 0 : DATA_BLOB blob;
21350 0 : Py_ssize_t blob_length = 0;
21351 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21352 0 : PyObject *bigendian_obj = NULL;
21353 0 : PyObject *ndr64_obj = NULL;
21354 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21355 0 : PyObject *allow_remaining_obj = NULL;
21356 0 : bool allow_remaining = false;
21357 :
21358 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21359 : discard_const_p(char *, kwnames),
21360 : &blob.data, &blob_length,
21361 : &bigendian_obj,
21362 : &ndr64_obj,
21363 : &allow_remaining_obj)) {
21364 0 : return NULL;
21365 : }
21366 0 : blob.length = blob_length;
21367 :
21368 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21369 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21370 : }
21371 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21372 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21373 : }
21374 :
21375 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21376 0 : allow_remaining = true;
21377 : }
21378 :
21379 0 : return py_winbind_SendToSam_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21380 : }
21381 :
21382 0 : static PyObject *py_winbind_SendToSam_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
21383 : {
21384 0 : const struct ndr_interface_call *call = NULL;
21385 0 : struct winbind_SendToSam *object = pytalloc_get_ptr(py_obj);
21386 0 : PyObject *ret;
21387 0 : char *retstr;
21388 :
21389 0 : if (ndr_table_winbind.num_calls < 33) {
21390 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_winbind_SendToSam_ndr_print");
21391 0 : return NULL;
21392 : }
21393 0 : call = &ndr_table_winbind.calls[32];
21394 :
21395 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21396 0 : ret = PyUnicode_FromString(retstr);
21397 0 : TALLOC_FREE(retstr);
21398 :
21399 0 : return ret;
21400 : }
21401 :
21402 0 : static PyObject *py_winbind_SendToSam_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21403 : {
21404 0 : return py_winbind_SendToSam_ndr_print(py_obj, "winbind_SendToSam_in", NDR_IN);
21405 : }
21406 :
21407 0 : static PyObject *py_winbind_SendToSam_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21408 : {
21409 0 : return py_winbind_SendToSam_ndr_print(py_obj, "winbind_SendToSam_out", NDR_OUT);
21410 : }
21411 :
21412 : static PyMethodDef py_winbind_SendToSam_methods[] = {
21413 : { "opnum", (PyCFunction)py_winbind_SendToSam_ndr_opnum, METH_NOARGS|METH_CLASS,
21414 : "winbind.SendToSam.opnum() -> 32 (0x20) " },
21415 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21416 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21417 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21418 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21419 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21420 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21421 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_winbind_SendToSam_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21422 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21423 : { "__ndr_print_in__", (PyCFunction)py_winbind_SendToSam_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21424 : { "__ndr_print_out__", (PyCFunction)py_winbind_SendToSam_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21425 : { NULL, NULL, 0, NULL }
21426 : };
21427 :
21428 :
21429 : static PyTypeObject winbind_SendToSam_Type = {
21430 : PyVarObject_HEAD_INIT(NULL, 0)
21431 : .tp_name = "winbind.SendToSam",
21432 : .tp_getset = py_winbind_SendToSam_getsetters,
21433 : .tp_methods = py_winbind_SendToSam_methods,
21434 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21435 : .tp_new = py_winbind_SendToSam_new,
21436 : };
21437 :
21438 0 : static bool pack_py_winbind_SendToSam_args_in(PyObject *args, PyObject *kwargs, struct winbind_SendToSam *r)
21439 : {
21440 0 : PyObject *py_message;
21441 0 : const char *kwnames[] = {
21442 : "message", NULL
21443 : };
21444 :
21445 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winbind_SendToSam", discard_const_p(char *, kwnames), &py_message)) {
21446 0 : return false;
21447 : }
21448 :
21449 0 : if (py_message == NULL) {
21450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.message");
21451 0 : return false;
21452 : }
21453 0 : PY_CHECK_TYPE(netr_SendToSamBase_Type, py_message, return false;);
21454 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_message)) == NULL) {
21455 0 : PyErr_NoMemory();
21456 0 : return false;
21457 : }
21458 0 : r->in.message = *(struct netr_SendToSamBase *)pytalloc_get_ptr(py_message);
21459 0 : return true;
21460 : }
21461 :
21462 0 : static PyObject *unpack_py_winbind_SendToSam_args_out(struct winbind_SendToSam *r)
21463 : {
21464 0 : PyObject *result;
21465 0 : result = Py_None;
21466 0 : Py_INCREF(result);
21467 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
21468 0 : PyErr_SetNTSTATUS(r->out.result);
21469 0 : return NULL;
21470 : }
21471 :
21472 0 : return result;
21473 : }
21474 :
21475 : const struct PyNdrRpcMethodDef py_ndr_winbind_methods[] = {
21476 : { "wbint_Ping", "S.wbint_Ping(in_data) -> out_data", (py_dcerpc_call_fn)dcerpc_wbint_Ping_r, (py_data_pack_fn)pack_py_wbint_Ping_args_in, (py_data_unpack_fn)unpack_py_wbint_Ping_args_out, 0, &ndr_table_winbind },
21477 : { "wbint_LookupSid", "S.wbint_LookupSid(sid) -> (type, domain, name)", (py_dcerpc_call_fn)dcerpc_wbint_LookupSid_r, (py_data_pack_fn)pack_py_wbint_LookupSid_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupSid_args_out, 1, &ndr_table_winbind },
21478 : { "wbint_LookupSids", "S.wbint_LookupSids(sids) -> (domains, names)", (py_dcerpc_call_fn)dcerpc_wbint_LookupSids_r, (py_data_pack_fn)pack_py_wbint_LookupSids_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupSids_args_out, 2, &ndr_table_winbind },
21479 : { "wbint_LookupName", "S.wbint_LookupName(domain, name, flags) -> (type, sid)", (py_dcerpc_call_fn)dcerpc_wbint_LookupName_r, (py_data_pack_fn)pack_py_wbint_LookupName_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupName_args_out, 3, &ndr_table_winbind },
21480 : { "wbint_Sids2UnixIDs", "S.wbint_Sids2UnixIDs(domains, ids) -> ids", (py_dcerpc_call_fn)dcerpc_wbint_Sids2UnixIDs_r, (py_data_pack_fn)pack_py_wbint_Sids2UnixIDs_args_in, (py_data_unpack_fn)unpack_py_wbint_Sids2UnixIDs_args_out, 4, &ndr_table_winbind },
21481 : { "wbint_UnixIDs2Sids", "S.wbint_UnixIDs2Sids(domain_name, domain_sid, num_ids, xids) -> (xids, sids)", (py_dcerpc_call_fn)dcerpc_wbint_UnixIDs2Sids_r, (py_data_pack_fn)pack_py_wbint_UnixIDs2Sids_args_in, (py_data_unpack_fn)unpack_py_wbint_UnixIDs2Sids_args_out, 5, &ndr_table_winbind },
21482 : { "wbint_AllocateUid", "S.wbint_AllocateUid() -> uid", (py_dcerpc_call_fn)dcerpc_wbint_AllocateUid_r, (py_data_pack_fn)pack_py_wbint_AllocateUid_args_in, (py_data_unpack_fn)unpack_py_wbint_AllocateUid_args_out, 6, &ndr_table_winbind },
21483 : { "wbint_AllocateGid", "S.wbint_AllocateGid() -> gid", (py_dcerpc_call_fn)dcerpc_wbint_AllocateGid_r, (py_data_pack_fn)pack_py_wbint_AllocateGid_args_in, (py_data_unpack_fn)unpack_py_wbint_AllocateGid_args_out, 7, &ndr_table_winbind },
21484 : { "wbint_GetNssInfo", "S.wbint_GetNssInfo(info) -> info", (py_dcerpc_call_fn)dcerpc_wbint_GetNssInfo_r, (py_data_pack_fn)pack_py_wbint_GetNssInfo_args_in, (py_data_unpack_fn)unpack_py_wbint_GetNssInfo_args_out, 8, &ndr_table_winbind },
21485 : { "wbint_LookupUserAliases", "S.wbint_LookupUserAliases(sids) -> rids", (py_dcerpc_call_fn)dcerpc_wbint_LookupUserAliases_r, (py_data_pack_fn)pack_py_wbint_LookupUserAliases_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupUserAliases_args_out, 9, &ndr_table_winbind },
21486 : { "wbint_LookupUserGroups", "S.wbint_LookupUserGroups(sid) -> sids", (py_dcerpc_call_fn)dcerpc_wbint_LookupUserGroups_r, (py_data_pack_fn)pack_py_wbint_LookupUserGroups_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupUserGroups_args_out, 10, &ndr_table_winbind },
21487 : { "wbint_QuerySequenceNumber", "S.wbint_QuerySequenceNumber() -> sequence", (py_dcerpc_call_fn)dcerpc_wbint_QuerySequenceNumber_r, (py_data_pack_fn)pack_py_wbint_QuerySequenceNumber_args_in, (py_data_unpack_fn)unpack_py_wbint_QuerySequenceNumber_args_out, 11, &ndr_table_winbind },
21488 : { "wbint_LookupGroupMembers", "S.wbint_LookupGroupMembers(sid, type) -> members", (py_dcerpc_call_fn)dcerpc_wbint_LookupGroupMembers_r, (py_data_pack_fn)pack_py_wbint_LookupGroupMembers_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupGroupMembers_args_out, 12, &ndr_table_winbind },
21489 : { "wbint_LookupAliasMembers", "S.wbint_LookupAliasMembers(sid, type) -> sids", (py_dcerpc_call_fn)dcerpc_wbint_LookupAliasMembers_r, (py_data_pack_fn)pack_py_wbint_LookupAliasMembers_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupAliasMembers_args_out, 13, &ndr_table_winbind },
21490 : { "wbint_QueryGroupList", "S.wbint_QueryGroupList() -> groups", (py_dcerpc_call_fn)dcerpc_wbint_QueryGroupList_r, (py_data_pack_fn)pack_py_wbint_QueryGroupList_args_in, (py_data_unpack_fn)unpack_py_wbint_QueryGroupList_args_out, 14, &ndr_table_winbind },
21491 : { "wbint_QueryUserRidList", "S.wbint_QueryUserRidList() -> rids", (py_dcerpc_call_fn)dcerpc_wbint_QueryUserRidList_r, (py_data_pack_fn)pack_py_wbint_QueryUserRidList_args_in, (py_data_unpack_fn)unpack_py_wbint_QueryUserRidList_args_out, 15, &ndr_table_winbind },
21492 : { "wbint_DsGetDcName", "S.wbint_DsGetDcName(domain_name, domain_guid, site_name, flags) -> dc_info", (py_dcerpc_call_fn)dcerpc_wbint_DsGetDcName_r, (py_data_pack_fn)pack_py_wbint_DsGetDcName_args_in, (py_data_unpack_fn)unpack_py_wbint_DsGetDcName_args_out, 16, &ndr_table_winbind },
21493 : { "wbint_LookupRids", "S.wbint_LookupRids(domain_sid, rids) -> (domain_name, names)", (py_dcerpc_call_fn)dcerpc_wbint_LookupRids_r, (py_data_pack_fn)pack_py_wbint_LookupRids_args_in, (py_data_unpack_fn)unpack_py_wbint_LookupRids_args_out, 17, &ndr_table_winbind },
21494 : { "wbint_CheckMachineAccount", "S.wbint_CheckMachineAccount() -> None", (py_dcerpc_call_fn)dcerpc_wbint_CheckMachineAccount_r, (py_data_pack_fn)pack_py_wbint_CheckMachineAccount_args_in, (py_data_unpack_fn)unpack_py_wbint_CheckMachineAccount_args_out, 18, &ndr_table_winbind },
21495 : { "wbint_ChangeMachineAccount", "S.wbint_ChangeMachineAccount(dcname) -> None", (py_dcerpc_call_fn)dcerpc_wbint_ChangeMachineAccount_r, (py_data_pack_fn)pack_py_wbint_ChangeMachineAccount_args_in, (py_data_unpack_fn)unpack_py_wbint_ChangeMachineAccount_args_out, 19, &ndr_table_winbind },
21496 : { "wbint_PingDc", "S.wbint_PingDc() -> dcname", (py_dcerpc_call_fn)dcerpc_wbint_PingDc_r, (py_data_pack_fn)pack_py_wbint_PingDc_args_in, (py_data_unpack_fn)unpack_py_wbint_PingDc_args_out, 20, &ndr_table_winbind },
21497 : { "wbint_ListTrustedDomains", "S.wbint_ListTrustedDomains(client_name, client_pid) -> domains", (py_dcerpc_call_fn)dcerpc_wbint_ListTrustedDomains_r, (py_data_pack_fn)pack_py_wbint_ListTrustedDomains_args_in, (py_data_unpack_fn)unpack_py_wbint_ListTrustedDomains_args_out, 21, &ndr_table_winbind },
21498 : { "wbint_PamAuth", "S.wbint_PamAuth(client_name, client_pid, flags, info, require_membership_of_sid) -> validation", (py_dcerpc_call_fn)dcerpc_wbint_PamAuth_r, (py_data_pack_fn)pack_py_wbint_PamAuth_args_in, (py_data_unpack_fn)unpack_py_wbint_PamAuth_args_out, 22, &ndr_table_winbind },
21499 : { "wbint_PamAuthCrap", "S.wbint_PamAuthCrap(client_name, client_pid, flags, user, domain, workstation, lm_resp, nt_resp, chal, logon_parameters, require_membership_of_sid) -> (authoritative, validation)", (py_dcerpc_call_fn)dcerpc_wbint_PamAuthCrap_r, (py_data_pack_fn)pack_py_wbint_PamAuthCrap_args_in, (py_data_unpack_fn)unpack_py_wbint_PamAuthCrap_args_out, 23, &ndr_table_winbind },
21500 : { "wbint_PamLogOff", "S.wbint_PamLogOff(client_name, client_pid, flags, user, krb5ccname, uid) -> None", (py_dcerpc_call_fn)dcerpc_wbint_PamLogOff_r, (py_data_pack_fn)pack_py_wbint_PamLogOff_args_in, (py_data_unpack_fn)unpack_py_wbint_PamLogOff_args_out, 24, &ndr_table_winbind },
21501 : { "wbint_PamAuthCrapChangePassword", "S.wbint_PamAuthCrapChangePassword(client_name, client_pid, user, domain, new_nt_pswd, old_nt_hash_enc, new_lm_pswd, old_lm_hash_enc) -> None", (py_dcerpc_call_fn)dcerpc_wbint_PamAuthCrapChangePassword_r, (py_data_pack_fn)pack_py_wbint_PamAuthCrapChangePassword_args_in, (py_data_unpack_fn)unpack_py_wbint_PamAuthCrapChangePassword_args_out, 25, &ndr_table_winbind },
21502 : { "wbint_PamAuthChangePassword", "S.wbint_PamAuthChangePassword(client_name, client_pid, flags, user, old_password, new_password) -> (dominfo, reject_reason)", (py_dcerpc_call_fn)dcerpc_wbint_PamAuthChangePassword_r, (py_data_pack_fn)pack_py_wbint_PamAuthChangePassword_args_in, (py_data_unpack_fn)unpack_py_wbint_PamAuthChangePassword_args_out, 26, &ndr_table_winbind },
21503 : { "wbint_InitConnection", "S.wbint_InitConnection(dcname) -> (name, alt_name, sid, flags)", (py_dcerpc_call_fn)dcerpc_wbint_InitConnection_r, (py_data_pack_fn)pack_py_wbint_InitConnection_args_in, (py_data_unpack_fn)unpack_py_wbint_InitConnection_args_out, 27, &ndr_table_winbind },
21504 : { "SamLogon", "S.SamLogon(logon_level, logon, validation_level) -> (validation, authoritative)", (py_dcerpc_call_fn)dcerpc_winbind_SamLogon_r, (py_data_pack_fn)pack_py_winbind_SamLogon_args_in, (py_data_unpack_fn)unpack_py_winbind_SamLogon_args_out, 28, &ndr_table_winbind },
21505 : { "DsrUpdateReadOnlyServerDnsRecords", "S.DsrUpdateReadOnlyServerDnsRecords(site_name, dns_ttl, dns_names) -> dns_names", (py_dcerpc_call_fn)dcerpc_winbind_DsrUpdateReadOnlyServerDnsRecords_r, (py_data_pack_fn)pack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_in, (py_data_unpack_fn)unpack_py_winbind_DsrUpdateReadOnlyServerDnsRecords_args_out, 29, &ndr_table_winbind },
21506 : { "LogonControl", "S.LogonControl(function_code, level, data) -> query", (py_dcerpc_call_fn)dcerpc_winbind_LogonControl_r, (py_data_pack_fn)pack_py_winbind_LogonControl_args_in, (py_data_unpack_fn)unpack_py_winbind_LogonControl_args_out, 30, &ndr_table_winbind },
21507 : { "GetForestTrustInformation", "S.GetForestTrustInformation(trusted_domain_name, flags) -> forest_trust_info", (py_dcerpc_call_fn)dcerpc_winbind_GetForestTrustInformation_r, (py_data_pack_fn)pack_py_winbind_GetForestTrustInformation_args_in, (py_data_unpack_fn)unpack_py_winbind_GetForestTrustInformation_args_out, 31, &ndr_table_winbind },
21508 : { "SendToSam", "S.SendToSam(message) -> None", (py_dcerpc_call_fn)dcerpc_winbind_SendToSam_r, (py_data_pack_fn)pack_py_winbind_SendToSam_args_in, (py_data_unpack_fn)unpack_py_winbind_SendToSam_args_out, 32, &ndr_table_winbind },
21509 : {0}
21510 : };
21511 :
21512 2 : static PyObject *interface_winbind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21513 : {
21514 2 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_winbind);
21515 : }
21516 :
21517 : #define PY_DOC_WINBIND "winbind parent-child protocol"
21518 : static PyTypeObject winbind_InterfaceType = {
21519 : PyVarObject_HEAD_INIT(NULL, 0)
21520 : .tp_name = "winbind.winbind",
21521 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
21522 : .tp_doc = "winbind(binding, lp_ctx=None, credentials=None) -> connection\n"
21523 : "\n"
21524 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
21525 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
21526 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_WINBIND,
21527 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21528 : .tp_new = interface_winbind_new,
21529 : };
21530 :
21531 0 : static PyObject *syntax_winbind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21532 : {
21533 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_winbind.syntax_id);
21534 : }
21535 :
21536 : #define PY_DOC_WINBIND_SYNTAX "winbind parent-child protocol"
21537 : static PyTypeObject winbind_SyntaxType = {
21538 : PyVarObject_HEAD_INIT(NULL, 0)
21539 : .tp_name = "winbind.winbind_abstract_syntax",
21540 : .tp_doc = "winbind_abstract_syntax()\n"PY_DOC_WINBIND_SYNTAX,
21541 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21542 : .tp_new = syntax_winbind_new,
21543 : };
21544 :
21545 : static PyMethodDef winbind_methods[] = {
21546 : { NULL, NULL, 0, NULL }
21547 : };
21548 :
21549 : static struct PyModuleDef moduledef = {
21550 : PyModuleDef_HEAD_INIT,
21551 : .m_name = "winbind",
21552 : .m_doc = "winbind DCE/RPC",
21553 : .m_size = -1,
21554 : .m_methods = winbind_methods,
21555 : };
21556 143 : MODULE_INIT_FUNC(winbind)
21557 : {
21558 143 : PyObject *m = NULL;
21559 143 : PyObject *dep_samba_dcerpc_lsa = NULL;
21560 143 : PyObject *dep_samba_dcerpc_netlogon = NULL;
21561 143 : PyObject *dep_samba_dcerpc_samr = NULL;
21562 143 : PyObject *dep_samba_dcerpc_misc = NULL;
21563 143 : PyObject *dep_samba_dcerpc_security = NULL;
21564 143 : PyObject *dep_samba_dcerpc_idmap = NULL;
21565 143 : PyObject *dep_talloc = NULL;
21566 143 : PyObject *dep_samba_dcerpc_base = NULL;
21567 :
21568 143 : dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
21569 143 : if (dep_samba_dcerpc_lsa == NULL)
21570 0 : goto out;
21571 :
21572 143 : dep_samba_dcerpc_netlogon = PyImport_ImportModule("samba.dcerpc.netlogon");
21573 143 : if (dep_samba_dcerpc_netlogon == NULL)
21574 0 : goto out;
21575 :
21576 143 : dep_samba_dcerpc_samr = PyImport_ImportModule("samba.dcerpc.samr");
21577 143 : if (dep_samba_dcerpc_samr == NULL)
21578 0 : goto out;
21579 :
21580 143 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
21581 143 : if (dep_samba_dcerpc_misc == NULL)
21582 0 : goto out;
21583 :
21584 143 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
21585 143 : if (dep_samba_dcerpc_security == NULL)
21586 0 : goto out;
21587 :
21588 143 : dep_samba_dcerpc_idmap = PyImport_ImportModule("samba.dcerpc.idmap");
21589 143 : if (dep_samba_dcerpc_idmap == NULL)
21590 0 : goto out;
21591 :
21592 143 : dep_talloc = PyImport_ImportModule("talloc");
21593 143 : if (dep_talloc == NULL)
21594 0 : goto out;
21595 :
21596 143 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
21597 143 : if (dep_samba_dcerpc_base == NULL)
21598 0 : goto out;
21599 :
21600 143 : unixid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_idmap, "unixid");
21601 143 : if (unixid_Type == NULL)
21602 0 : goto out;
21603 :
21604 143 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
21605 143 : if (BaseObject_Type == NULL)
21606 0 : goto out;
21607 :
21608 143 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
21609 143 : if (dom_sid_Type == NULL)
21610 0 : goto out;
21611 :
21612 143 : netr_Validation_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_Validation");
21613 143 : if (netr_Validation_Type == NULL)
21614 0 : goto out;
21615 :
21616 143 : lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray");
21617 143 : if (lsa_SidArray_Type == NULL)
21618 0 : goto out;
21619 :
21620 143 : lsa_RefDomainList_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "RefDomainList");
21621 143 : if (lsa_RefDomainList_Type == NULL)
21622 0 : goto out;
21623 :
21624 143 : lsa_TransNameArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "TransNameArray");
21625 143 : if (lsa_TransNameArray_Type == NULL)
21626 0 : goto out;
21627 :
21628 143 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
21629 143 : if (GUID_Type == NULL)
21630 0 : goto out;
21631 :
21632 143 : netr_DsRGetDCNameInfo_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_DsRGetDCNameInfo");
21633 143 : if (netr_DsRGetDCNameInfo_Type == NULL)
21634 0 : goto out;
21635 :
21636 143 : netr_DomainTrustList_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_DomainTrustList");
21637 143 : if (netr_DomainTrustList_Type == NULL)
21638 0 : goto out;
21639 :
21640 143 : samr_DomInfo1_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "DomInfo1");
21641 143 : if (samr_DomInfo1_Type == NULL)
21642 0 : goto out;
21643 :
21644 143 : netr_LogonLevel_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_LogonLevel");
21645 143 : if (netr_LogonLevel_Type == NULL)
21646 0 : goto out;
21647 :
21648 143 : NL_DNS_NAME_INFO_ARRAY_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "NL_DNS_NAME_INFO_ARRAY");
21649 143 : if (NL_DNS_NAME_INFO_ARRAY_Type == NULL)
21650 0 : goto out;
21651 :
21652 143 : netr_CONTROL_DATA_INFORMATION_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_CONTROL_DATA_INFORMATION");
21653 143 : if (netr_CONTROL_DATA_INFORMATION_Type == NULL)
21654 0 : goto out;
21655 :
21656 143 : netr_CONTROL_QUERY_INFORMATION_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_CONTROL_QUERY_INFORMATION");
21657 143 : if (netr_CONTROL_QUERY_INFORMATION_Type == NULL)
21658 0 : goto out;
21659 :
21660 143 : lsa_ForestTrustInformation_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "ForestTrustInformation");
21661 143 : if (lsa_ForestTrustInformation_Type == NULL)
21662 0 : goto out;
21663 :
21664 143 : netr_SendToSamBase_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_SendToSamBase");
21665 143 : if (netr_SendToSamBase_Type == NULL)
21666 0 : goto out;
21667 :
21668 143 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
21669 143 : if (ClientConnection_Type == NULL)
21670 0 : goto out;
21671 :
21672 143 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
21673 143 : if (ndr_syntax_id_Type == NULL)
21674 0 : goto out;
21675 :
21676 143 : wbint_TransID_Type.tp_base = BaseObject_Type;
21677 143 : wbint_TransID_Type.tp_basicsize = pytalloc_BaseObject_size();
21678 :
21679 143 : wbint_TransIDArray_Type.tp_base = BaseObject_Type;
21680 143 : wbint_TransIDArray_Type.tp_basicsize = pytalloc_BaseObject_size();
21681 :
21682 143 : wbint_userinfo_Type.tp_base = BaseObject_Type;
21683 143 : wbint_userinfo_Type.tp_basicsize = pytalloc_BaseObject_size();
21684 :
21685 143 : wbint_SidArray_Type.tp_base = BaseObject_Type;
21686 143 : wbint_SidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
21687 :
21688 143 : wbint_RidArray_Type.tp_base = BaseObject_Type;
21689 143 : wbint_RidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
21690 :
21691 143 : wbint_Principal_Type.tp_base = BaseObject_Type;
21692 143 : wbint_Principal_Type.tp_basicsize = pytalloc_BaseObject_size();
21693 :
21694 143 : wbint_Principals_Type.tp_base = BaseObject_Type;
21695 143 : wbint_Principals_Type.tp_basicsize = pytalloc_BaseObject_size();
21696 :
21697 143 : wbint_userinfos_Type.tp_base = BaseObject_Type;
21698 143 : wbint_userinfos_Type.tp_basicsize = pytalloc_BaseObject_size();
21699 :
21700 143 : wbint_Validation_Type.tp_base = BaseObject_Type;
21701 143 : wbint_Validation_Type.tp_basicsize = pytalloc_BaseObject_size();
21702 :
21703 143 : wbint_AuthUserInfo_Type.tp_base = BaseObject_Type;
21704 143 : wbint_AuthUserInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
21705 :
21706 143 : wbint_PamAuthCrapValidation_Type.tp_base = BaseObject_Type;
21707 143 : wbint_PamAuthCrapValidation_Type.tp_basicsize = pytalloc_BaseObject_size();
21708 :
21709 143 : wbint_Ping_Type.tp_base = BaseObject_Type;
21710 143 : wbint_Ping_Type.tp_basicsize = pytalloc_BaseObject_size();
21711 :
21712 143 : wbint_LookupSid_Type.tp_base = BaseObject_Type;
21713 143 : wbint_LookupSid_Type.tp_basicsize = pytalloc_BaseObject_size();
21714 :
21715 143 : wbint_LookupSids_Type.tp_base = BaseObject_Type;
21716 143 : wbint_LookupSids_Type.tp_basicsize = pytalloc_BaseObject_size();
21717 :
21718 143 : wbint_LookupName_Type.tp_base = BaseObject_Type;
21719 143 : wbint_LookupName_Type.tp_basicsize = pytalloc_BaseObject_size();
21720 :
21721 143 : wbint_Sids2UnixIDs_Type.tp_base = BaseObject_Type;
21722 143 : wbint_Sids2UnixIDs_Type.tp_basicsize = pytalloc_BaseObject_size();
21723 :
21724 143 : wbint_UnixIDs2Sids_Type.tp_base = BaseObject_Type;
21725 143 : wbint_UnixIDs2Sids_Type.tp_basicsize = pytalloc_BaseObject_size();
21726 :
21727 143 : wbint_AllocateUid_Type.tp_base = BaseObject_Type;
21728 143 : wbint_AllocateUid_Type.tp_basicsize = pytalloc_BaseObject_size();
21729 :
21730 143 : wbint_AllocateGid_Type.tp_base = BaseObject_Type;
21731 143 : wbint_AllocateGid_Type.tp_basicsize = pytalloc_BaseObject_size();
21732 :
21733 143 : wbint_GetNssInfo_Type.tp_base = BaseObject_Type;
21734 143 : wbint_GetNssInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
21735 :
21736 143 : wbint_LookupUserAliases_Type.tp_base = BaseObject_Type;
21737 143 : wbint_LookupUserAliases_Type.tp_basicsize = pytalloc_BaseObject_size();
21738 :
21739 143 : wbint_LookupUserGroups_Type.tp_base = BaseObject_Type;
21740 143 : wbint_LookupUserGroups_Type.tp_basicsize = pytalloc_BaseObject_size();
21741 :
21742 143 : wbint_QuerySequenceNumber_Type.tp_base = BaseObject_Type;
21743 143 : wbint_QuerySequenceNumber_Type.tp_basicsize = pytalloc_BaseObject_size();
21744 :
21745 143 : wbint_LookupGroupMembers_Type.tp_base = BaseObject_Type;
21746 143 : wbint_LookupGroupMembers_Type.tp_basicsize = pytalloc_BaseObject_size();
21747 :
21748 143 : wbint_LookupAliasMembers_Type.tp_base = BaseObject_Type;
21749 143 : wbint_LookupAliasMembers_Type.tp_basicsize = pytalloc_BaseObject_size();
21750 :
21751 143 : wbint_QueryGroupList_Type.tp_base = BaseObject_Type;
21752 143 : wbint_QueryGroupList_Type.tp_basicsize = pytalloc_BaseObject_size();
21753 :
21754 143 : wbint_QueryUserRidList_Type.tp_base = BaseObject_Type;
21755 143 : wbint_QueryUserRidList_Type.tp_basicsize = pytalloc_BaseObject_size();
21756 :
21757 143 : wbint_DsGetDcName_Type.tp_base = BaseObject_Type;
21758 143 : wbint_DsGetDcName_Type.tp_basicsize = pytalloc_BaseObject_size();
21759 :
21760 143 : wbint_LookupRids_Type.tp_base = BaseObject_Type;
21761 143 : wbint_LookupRids_Type.tp_basicsize = pytalloc_BaseObject_size();
21762 :
21763 143 : wbint_CheckMachineAccount_Type.tp_base = BaseObject_Type;
21764 143 : wbint_CheckMachineAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
21765 :
21766 143 : wbint_ChangeMachineAccount_Type.tp_base = BaseObject_Type;
21767 143 : wbint_ChangeMachineAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
21768 :
21769 143 : wbint_PingDc_Type.tp_base = BaseObject_Type;
21770 143 : wbint_PingDc_Type.tp_basicsize = pytalloc_BaseObject_size();
21771 :
21772 143 : wbint_ListTrustedDomains_Type.tp_base = BaseObject_Type;
21773 143 : wbint_ListTrustedDomains_Type.tp_basicsize = pytalloc_BaseObject_size();
21774 :
21775 143 : wbint_PamAuth_Type.tp_base = BaseObject_Type;
21776 143 : wbint_PamAuth_Type.tp_basicsize = pytalloc_BaseObject_size();
21777 :
21778 143 : wbint_PamAuthCrap_Type.tp_base = BaseObject_Type;
21779 143 : wbint_PamAuthCrap_Type.tp_basicsize = pytalloc_BaseObject_size();
21780 :
21781 143 : wbint_PamLogOff_Type.tp_base = BaseObject_Type;
21782 143 : wbint_PamLogOff_Type.tp_basicsize = pytalloc_BaseObject_size();
21783 :
21784 143 : wbint_PamAuthCrapChangePassword_Type.tp_base = BaseObject_Type;
21785 143 : wbint_PamAuthCrapChangePassword_Type.tp_basicsize = pytalloc_BaseObject_size();
21786 :
21787 143 : wbint_PamAuthChangePassword_Type.tp_base = BaseObject_Type;
21788 143 : wbint_PamAuthChangePassword_Type.tp_basicsize = pytalloc_BaseObject_size();
21789 :
21790 143 : wbint_InitConnection_Type.tp_base = BaseObject_Type;
21791 143 : wbint_InitConnection_Type.tp_basicsize = pytalloc_BaseObject_size();
21792 :
21793 143 : winbind_SamLogon_Type.tp_base = BaseObject_Type;
21794 143 : winbind_SamLogon_Type.tp_basicsize = pytalloc_BaseObject_size();
21795 :
21796 143 : winbind_DsrUpdateReadOnlyServerDnsRecords_Type.tp_base = BaseObject_Type;
21797 143 : winbind_DsrUpdateReadOnlyServerDnsRecords_Type.tp_basicsize = pytalloc_BaseObject_size();
21798 :
21799 143 : winbind_LogonControl_Type.tp_base = BaseObject_Type;
21800 143 : winbind_LogonControl_Type.tp_basicsize = pytalloc_BaseObject_size();
21801 :
21802 143 : winbind_GetForestTrustInformation_Type.tp_base = BaseObject_Type;
21803 143 : winbind_GetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
21804 :
21805 143 : winbind_SendToSam_Type.tp_base = BaseObject_Type;
21806 143 : winbind_SendToSam_Type.tp_basicsize = pytalloc_BaseObject_size();
21807 :
21808 143 : winbind_InterfaceType.tp_base = ClientConnection_Type;
21809 :
21810 143 : winbind_SyntaxType.tp_base = ndr_syntax_id_Type;
21811 143 : winbind_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
21812 :
21813 143 : if (PyType_Ready(&wbint_TransID_Type) < 0)
21814 0 : goto out;
21815 143 : if (PyType_Ready(&wbint_TransIDArray_Type) < 0)
21816 0 : goto out;
21817 143 : if (PyType_Ready(&wbint_userinfo_Type) < 0)
21818 0 : goto out;
21819 143 : if (PyType_Ready(&wbint_SidArray_Type) < 0)
21820 0 : goto out;
21821 143 : if (PyType_Ready(&wbint_RidArray_Type) < 0)
21822 0 : goto out;
21823 143 : if (PyType_Ready(&wbint_Principal_Type) < 0)
21824 0 : goto out;
21825 143 : if (PyType_Ready(&wbint_Principals_Type) < 0)
21826 0 : goto out;
21827 143 : if (PyType_Ready(&wbint_userinfos_Type) < 0)
21828 0 : goto out;
21829 143 : if (PyType_Ready(&wbint_Validation_Type) < 0)
21830 0 : goto out;
21831 143 : if (PyType_Ready(&wbint_AuthUserInfo_Type) < 0)
21832 0 : goto out;
21833 143 : if (PyType_Ready(&wbint_PamAuthCrapValidation_Type) < 0)
21834 0 : goto out;
21835 143 : if (PyType_Ready(&wbint_Ping_Type) < 0)
21836 0 : goto out;
21837 143 : if (PyType_Ready(&wbint_LookupSid_Type) < 0)
21838 0 : goto out;
21839 143 : if (PyType_Ready(&wbint_LookupSids_Type) < 0)
21840 0 : goto out;
21841 143 : if (PyType_Ready(&wbint_LookupName_Type) < 0)
21842 0 : goto out;
21843 143 : if (PyType_Ready(&wbint_Sids2UnixIDs_Type) < 0)
21844 0 : goto out;
21845 143 : if (PyType_Ready(&wbint_UnixIDs2Sids_Type) < 0)
21846 0 : goto out;
21847 143 : if (PyType_Ready(&wbint_AllocateUid_Type) < 0)
21848 0 : goto out;
21849 143 : if (PyType_Ready(&wbint_AllocateGid_Type) < 0)
21850 0 : goto out;
21851 143 : if (PyType_Ready(&wbint_GetNssInfo_Type) < 0)
21852 0 : goto out;
21853 143 : if (PyType_Ready(&wbint_LookupUserAliases_Type) < 0)
21854 0 : goto out;
21855 143 : if (PyType_Ready(&wbint_LookupUserGroups_Type) < 0)
21856 0 : goto out;
21857 143 : if (PyType_Ready(&wbint_QuerySequenceNumber_Type) < 0)
21858 0 : goto out;
21859 143 : if (PyType_Ready(&wbint_LookupGroupMembers_Type) < 0)
21860 0 : goto out;
21861 143 : if (PyType_Ready(&wbint_LookupAliasMembers_Type) < 0)
21862 0 : goto out;
21863 143 : if (PyType_Ready(&wbint_QueryGroupList_Type) < 0)
21864 0 : goto out;
21865 143 : if (PyType_Ready(&wbint_QueryUserRidList_Type) < 0)
21866 0 : goto out;
21867 143 : if (PyType_Ready(&wbint_DsGetDcName_Type) < 0)
21868 0 : goto out;
21869 143 : if (PyType_Ready(&wbint_LookupRids_Type) < 0)
21870 0 : goto out;
21871 143 : if (PyType_Ready(&wbint_CheckMachineAccount_Type) < 0)
21872 0 : goto out;
21873 143 : if (PyType_Ready(&wbint_ChangeMachineAccount_Type) < 0)
21874 0 : goto out;
21875 143 : if (PyType_Ready(&wbint_PingDc_Type) < 0)
21876 0 : goto out;
21877 143 : if (PyType_Ready(&wbint_ListTrustedDomains_Type) < 0)
21878 0 : goto out;
21879 143 : if (PyType_Ready(&wbint_PamAuth_Type) < 0)
21880 0 : goto out;
21881 143 : if (PyType_Ready(&wbint_PamAuthCrap_Type) < 0)
21882 0 : goto out;
21883 143 : if (PyType_Ready(&wbint_PamLogOff_Type) < 0)
21884 0 : goto out;
21885 143 : if (PyType_Ready(&wbint_PamAuthCrapChangePassword_Type) < 0)
21886 0 : goto out;
21887 143 : if (PyType_Ready(&wbint_PamAuthChangePassword_Type) < 0)
21888 0 : goto out;
21889 143 : if (PyType_Ready(&wbint_InitConnection_Type) < 0)
21890 0 : goto out;
21891 143 : if (PyType_Ready(&winbind_SamLogon_Type) < 0)
21892 0 : goto out;
21893 143 : if (PyType_Ready(&winbind_DsrUpdateReadOnlyServerDnsRecords_Type) < 0)
21894 0 : goto out;
21895 143 : if (PyType_Ready(&winbind_LogonControl_Type) < 0)
21896 0 : goto out;
21897 143 : if (PyType_Ready(&winbind_GetForestTrustInformation_Type) < 0)
21898 0 : goto out;
21899 143 : if (PyType_Ready(&winbind_SendToSam_Type) < 0)
21900 0 : goto out;
21901 143 : if (PyType_Ready(&winbind_InterfaceType) < 0)
21902 0 : goto out;
21903 143 : if (PyType_Ready(&winbind_SyntaxType) < 0)
21904 0 : goto out;
21905 143 : if (!PyInterface_AddNdrRpcMethods(&winbind_InterfaceType, py_ndr_winbind_methods))
21906 0 : return NULL;
21907 :
21908 : #ifdef PY_WBINT_TRANSID_PATCH
21909 : PY_WBINT_TRANSID_PATCH(&wbint_TransID_Type);
21910 : #endif
21911 : #ifdef PY_WBINT_TRANSIDARRAY_PATCH
21912 : PY_WBINT_TRANSIDARRAY_PATCH(&wbint_TransIDArray_Type);
21913 : #endif
21914 : #ifdef PY_WBINT_USERINFO_PATCH
21915 : PY_WBINT_USERINFO_PATCH(&wbint_userinfo_Type);
21916 : #endif
21917 : #ifdef PY_WBINT_SIDARRAY_PATCH
21918 : PY_WBINT_SIDARRAY_PATCH(&wbint_SidArray_Type);
21919 : #endif
21920 : #ifdef PY_WBINT_RIDARRAY_PATCH
21921 : PY_WBINT_RIDARRAY_PATCH(&wbint_RidArray_Type);
21922 : #endif
21923 : #ifdef PY_WBINT_PRINCIPAL_PATCH
21924 : PY_WBINT_PRINCIPAL_PATCH(&wbint_Principal_Type);
21925 : #endif
21926 : #ifdef PY_WBINT_PRINCIPALS_PATCH
21927 : PY_WBINT_PRINCIPALS_PATCH(&wbint_Principals_Type);
21928 : #endif
21929 : #ifdef PY_WBINT_USERINFOS_PATCH
21930 : PY_WBINT_USERINFOS_PATCH(&wbint_userinfos_Type);
21931 : #endif
21932 : #ifdef PY_WBINT_VALIDATION_PATCH
21933 : PY_WBINT_VALIDATION_PATCH(&wbint_Validation_Type);
21934 : #endif
21935 : #ifdef PY_WBINT_AUTHUSERINFO_PATCH
21936 : PY_WBINT_AUTHUSERINFO_PATCH(&wbint_AuthUserInfo_Type);
21937 : #endif
21938 : #ifdef PY_WBINT_PAMAUTHCRAPVALIDATION_PATCH
21939 : PY_WBINT_PAMAUTHCRAPVALIDATION_PATCH(&wbint_PamAuthCrapValidation_Type);
21940 : #endif
21941 : #ifdef PY_WBINT_PING_PATCH
21942 : PY_WBINT_PING_PATCH(&wbint_Ping_Type);
21943 : #endif
21944 : #ifdef PY_WBINT_LOOKUPSID_PATCH
21945 : PY_WBINT_LOOKUPSID_PATCH(&wbint_LookupSid_Type);
21946 : #endif
21947 : #ifdef PY_WBINT_LOOKUPSIDS_PATCH
21948 : PY_WBINT_LOOKUPSIDS_PATCH(&wbint_LookupSids_Type);
21949 : #endif
21950 : #ifdef PY_WBINT_LOOKUPNAME_PATCH
21951 : PY_WBINT_LOOKUPNAME_PATCH(&wbint_LookupName_Type);
21952 : #endif
21953 : #ifdef PY_WBINT_SIDS2UNIXIDS_PATCH
21954 : PY_WBINT_SIDS2UNIXIDS_PATCH(&wbint_Sids2UnixIDs_Type);
21955 : #endif
21956 : #ifdef PY_WBINT_UNIXIDS2SIDS_PATCH
21957 : PY_WBINT_UNIXIDS2SIDS_PATCH(&wbint_UnixIDs2Sids_Type);
21958 : #endif
21959 : #ifdef PY_WBINT_ALLOCATEUID_PATCH
21960 : PY_WBINT_ALLOCATEUID_PATCH(&wbint_AllocateUid_Type);
21961 : #endif
21962 : #ifdef PY_WBINT_ALLOCATEGID_PATCH
21963 : PY_WBINT_ALLOCATEGID_PATCH(&wbint_AllocateGid_Type);
21964 : #endif
21965 : #ifdef PY_WBINT_GETNSSINFO_PATCH
21966 : PY_WBINT_GETNSSINFO_PATCH(&wbint_GetNssInfo_Type);
21967 : #endif
21968 : #ifdef PY_WBINT_LOOKUPUSERALIASES_PATCH
21969 : PY_WBINT_LOOKUPUSERALIASES_PATCH(&wbint_LookupUserAliases_Type);
21970 : #endif
21971 : #ifdef PY_WBINT_LOOKUPUSERGROUPS_PATCH
21972 : PY_WBINT_LOOKUPUSERGROUPS_PATCH(&wbint_LookupUserGroups_Type);
21973 : #endif
21974 : #ifdef PY_WBINT_QUERYSEQUENCENUMBER_PATCH
21975 : PY_WBINT_QUERYSEQUENCENUMBER_PATCH(&wbint_QuerySequenceNumber_Type);
21976 : #endif
21977 : #ifdef PY_WBINT_LOOKUPGROUPMEMBERS_PATCH
21978 : PY_WBINT_LOOKUPGROUPMEMBERS_PATCH(&wbint_LookupGroupMembers_Type);
21979 : #endif
21980 : #ifdef PY_WBINT_LOOKUPALIASMEMBERS_PATCH
21981 : PY_WBINT_LOOKUPALIASMEMBERS_PATCH(&wbint_LookupAliasMembers_Type);
21982 : #endif
21983 : #ifdef PY_WBINT_QUERYGROUPLIST_PATCH
21984 : PY_WBINT_QUERYGROUPLIST_PATCH(&wbint_QueryGroupList_Type);
21985 : #endif
21986 : #ifdef PY_WBINT_QUERYUSERRIDLIST_PATCH
21987 : PY_WBINT_QUERYUSERRIDLIST_PATCH(&wbint_QueryUserRidList_Type);
21988 : #endif
21989 : #ifdef PY_WBINT_DSGETDCNAME_PATCH
21990 : PY_WBINT_DSGETDCNAME_PATCH(&wbint_DsGetDcName_Type);
21991 : #endif
21992 : #ifdef PY_WBINT_LOOKUPRIDS_PATCH
21993 : PY_WBINT_LOOKUPRIDS_PATCH(&wbint_LookupRids_Type);
21994 : #endif
21995 : #ifdef PY_WBINT_CHECKMACHINEACCOUNT_PATCH
21996 : PY_WBINT_CHECKMACHINEACCOUNT_PATCH(&wbint_CheckMachineAccount_Type);
21997 : #endif
21998 : #ifdef PY_WBINT_CHANGEMACHINEACCOUNT_PATCH
21999 : PY_WBINT_CHANGEMACHINEACCOUNT_PATCH(&wbint_ChangeMachineAccount_Type);
22000 : #endif
22001 : #ifdef PY_WBINT_PINGDC_PATCH
22002 : PY_WBINT_PINGDC_PATCH(&wbint_PingDc_Type);
22003 : #endif
22004 : #ifdef PY_WBINT_LISTTRUSTEDDOMAINS_PATCH
22005 : PY_WBINT_LISTTRUSTEDDOMAINS_PATCH(&wbint_ListTrustedDomains_Type);
22006 : #endif
22007 : #ifdef PY_WBINT_PAMAUTH_PATCH
22008 : PY_WBINT_PAMAUTH_PATCH(&wbint_PamAuth_Type);
22009 : #endif
22010 : #ifdef PY_WBINT_PAMAUTHCRAP_PATCH
22011 : PY_WBINT_PAMAUTHCRAP_PATCH(&wbint_PamAuthCrap_Type);
22012 : #endif
22013 : #ifdef PY_WBINT_PAMLOGOFF_PATCH
22014 : PY_WBINT_PAMLOGOFF_PATCH(&wbint_PamLogOff_Type);
22015 : #endif
22016 : #ifdef PY_WBINT_PAMAUTHCRAPCHANGEPASSWORD_PATCH
22017 : PY_WBINT_PAMAUTHCRAPCHANGEPASSWORD_PATCH(&wbint_PamAuthCrapChangePassword_Type);
22018 : #endif
22019 : #ifdef PY_WBINT_PAMAUTHCHANGEPASSWORD_PATCH
22020 : PY_WBINT_PAMAUTHCHANGEPASSWORD_PATCH(&wbint_PamAuthChangePassword_Type);
22021 : #endif
22022 : #ifdef PY_WBINT_INITCONNECTION_PATCH
22023 : PY_WBINT_INITCONNECTION_PATCH(&wbint_InitConnection_Type);
22024 : #endif
22025 : #ifdef PY_SAMLOGON_PATCH
22026 : PY_SAMLOGON_PATCH(&winbind_SamLogon_Type);
22027 : #endif
22028 : #ifdef PY_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH
22029 : PY_DSRUPDATEREADONLYSERVERDNSRECORDS_PATCH(&winbind_DsrUpdateReadOnlyServerDnsRecords_Type);
22030 : #endif
22031 : #ifdef PY_LOGONCONTROL_PATCH
22032 : PY_LOGONCONTROL_PATCH(&winbind_LogonControl_Type);
22033 : #endif
22034 : #ifdef PY_GETFORESTTRUSTINFORMATION_PATCH
22035 : PY_GETFORESTTRUSTINFORMATION_PATCH(&winbind_GetForestTrustInformation_Type);
22036 : #endif
22037 : #ifdef PY_SENDTOSAM_PATCH
22038 : PY_SENDTOSAM_PATCH(&winbind_SendToSam_Type);
22039 : #endif
22040 : #ifdef PY_WINBIND_PATCH
22041 : PY_WINBIND_PATCH(&winbind_InterfaceType);
22042 : #endif
22043 : #ifdef PY_WINBIND_ABSTRACT_SYNTAX_PATCH
22044 : PY_WINBIND_ABSTRACT_SYNTAX_PATCH(&winbind_SyntaxType);
22045 : #endif
22046 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
22047 : PY_ABSTRACT_SYNTAX_PATCH(&winbind_SyntaxType);
22048 : #endif
22049 :
22050 143 : m = PyModule_Create(&moduledef);
22051 143 : if (m == NULL)
22052 0 : goto out;
22053 :
22054 143 : PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_UNKNOWN", PyLong_FromLong((uint16_t)(WB_DOMINFO_DOMAIN_UNKNOWN)));
22055 143 : PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_NATIVE", PyLong_FromLong((uint16_t)(WB_DOMINFO_DOMAIN_NATIVE)));
22056 143 : PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_AD", PyLong_FromLong((uint16_t)(WB_DOMINFO_DOMAIN_AD)));
22057 143 : PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_PRIMARY", PyLong_FromLong((uint16_t)(WB_DOMINFO_DOMAIN_PRIMARY)));
22058 143 : PyModule_AddObject(m, "WB_DOMINFO_DOMAIN_OFFLINE", PyLong_FromLong((uint16_t)(WB_DOMINFO_DOMAIN_OFFLINE)));
22059 111 : Py_INCREF((PyObject *)(void *)&wbint_TransID_Type);
22060 143 : PyModule_AddObject(m, "wbint_TransID", (PyObject *)(void *)&wbint_TransID_Type);
22061 111 : Py_INCREF((PyObject *)(void *)&wbint_TransIDArray_Type);
22062 143 : PyModule_AddObject(m, "wbint_TransIDArray", (PyObject *)(void *)&wbint_TransIDArray_Type);
22063 111 : Py_INCREF((PyObject *)(void *)&wbint_userinfo_Type);
22064 143 : PyModule_AddObject(m, "wbint_userinfo", (PyObject *)(void *)&wbint_userinfo_Type);
22065 111 : Py_INCREF((PyObject *)(void *)&wbint_SidArray_Type);
22066 143 : PyModule_AddObject(m, "wbint_SidArray", (PyObject *)(void *)&wbint_SidArray_Type);
22067 111 : Py_INCREF((PyObject *)(void *)&wbint_RidArray_Type);
22068 143 : PyModule_AddObject(m, "wbint_RidArray", (PyObject *)(void *)&wbint_RidArray_Type);
22069 111 : Py_INCREF((PyObject *)(void *)&wbint_Principal_Type);
22070 143 : PyModule_AddObject(m, "wbint_Principal", (PyObject *)(void *)&wbint_Principal_Type);
22071 111 : Py_INCREF((PyObject *)(void *)&wbint_Principals_Type);
22072 143 : PyModule_AddObject(m, "wbint_Principals", (PyObject *)(void *)&wbint_Principals_Type);
22073 111 : Py_INCREF((PyObject *)(void *)&wbint_userinfos_Type);
22074 143 : PyModule_AddObject(m, "wbint_userinfos", (PyObject *)(void *)&wbint_userinfos_Type);
22075 111 : Py_INCREF((PyObject *)(void *)&wbint_Validation_Type);
22076 143 : PyModule_AddObject(m, "wbint_Validation", (PyObject *)(void *)&wbint_Validation_Type);
22077 111 : Py_INCREF((PyObject *)(void *)&wbint_AuthUserInfo_Type);
22078 143 : PyModule_AddObject(m, "wbint_AuthUserInfo", (PyObject *)(void *)&wbint_AuthUserInfo_Type);
22079 111 : Py_INCREF((PyObject *)(void *)&wbint_PamAuthCrapValidation_Type);
22080 143 : PyModule_AddObject(m, "wbint_PamAuthCrapValidation", (PyObject *)(void *)&wbint_PamAuthCrapValidation_Type);
22081 111 : Py_INCREF((PyObject *)(void *)&wbint_Ping_Type);
22082 143 : PyModule_AddObject(m, "wbint_Ping", (PyObject *)(void *)&wbint_Ping_Type);
22083 111 : Py_INCREF((PyObject *)(void *)&wbint_LookupSid_Type);
22084 143 : PyModule_AddObject(m, "wbint_LookupSid", (PyObject *)(void *)&wbint_LookupSid_Type);
22085 111 : Py_INCREF((PyObject *)(void *)&wbint_LookupSids_Type);
22086 143 : PyModule_AddObject(m, "wbint_LookupSids", (PyObject *)(void *)&wbint_LookupSids_Type);
22087 111 : Py_INCREF((PyObject *)(void *)&wbint_LookupName_Type);
22088 143 : PyModule_AddObject(m, "wbint_LookupName", (PyObject *)(void *)&wbint_LookupName_Type);
22089 111 : Py_INCREF((PyObject *)(void *)&wbint_Sids2UnixIDs_Type);
22090 143 : PyModule_AddObject(m, "wbint_Sids2UnixIDs", (PyObject *)(void *)&wbint_Sids2UnixIDs_Type);
22091 111 : Py_INCREF((PyObject *)(void *)&wbint_UnixIDs2Sids_Type);
22092 143 : PyModule_AddObject(m, "wbint_UnixIDs2Sids", (PyObject *)(void *)&wbint_UnixIDs2Sids_Type);
22093 111 : Py_INCREF((PyObject *)(void *)&wbint_AllocateUid_Type);
22094 143 : PyModule_AddObject(m, "wbint_AllocateUid", (PyObject *)(void *)&wbint_AllocateUid_Type);
22095 111 : Py_INCREF((PyObject *)(void *)&wbint_AllocateGid_Type);
22096 143 : PyModule_AddObject(m, "wbint_AllocateGid", (PyObject *)(void *)&wbint_AllocateGid_Type);
22097 111 : Py_INCREF((PyObject *)(void *)&wbint_GetNssInfo_Type);
22098 143 : PyModule_AddObject(m, "wbint_GetNssInfo", (PyObject *)(void *)&wbint_GetNssInfo_Type);
22099 111 : Py_INCREF((PyObject *)(void *)&wbint_LookupUserAliases_Type);
22100 143 : PyModule_AddObject(m, "wbint_LookupUserAliases", (PyObject *)(void *)&wbint_LookupUserAliases_Type);
22101 111 : Py_INCREF((PyObject *)(void *)&wbint_LookupUserGroups_Type);
22102 143 : PyModule_AddObject(m, "wbint_LookupUserGroups", (PyObject *)(void *)&wbint_LookupUserGroups_Type);
22103 111 : Py_INCREF((PyObject *)(void *)&wbint_QuerySequenceNumber_Type);
22104 143 : PyModule_AddObject(m, "wbint_QuerySequenceNumber", (PyObject *)(void *)&wbint_QuerySequenceNumber_Type);
22105 111 : Py_INCREF((PyObject *)(void *)&wbint_LookupGroupMembers_Type);
22106 143 : PyModule_AddObject(m, "wbint_LookupGroupMembers", (PyObject *)(void *)&wbint_LookupGroupMembers_Type);
22107 111 : Py_INCREF((PyObject *)(void *)&wbint_LookupAliasMembers_Type);
22108 143 : PyModule_AddObject(m, "wbint_LookupAliasMembers", (PyObject *)(void *)&wbint_LookupAliasMembers_Type);
22109 111 : Py_INCREF((PyObject *)(void *)&wbint_QueryGroupList_Type);
22110 143 : PyModule_AddObject(m, "wbint_QueryGroupList", (PyObject *)(void *)&wbint_QueryGroupList_Type);
22111 111 : Py_INCREF((PyObject *)(void *)&wbint_QueryUserRidList_Type);
22112 143 : PyModule_AddObject(m, "wbint_QueryUserRidList", (PyObject *)(void *)&wbint_QueryUserRidList_Type);
22113 111 : Py_INCREF((PyObject *)(void *)&wbint_DsGetDcName_Type);
22114 143 : PyModule_AddObject(m, "wbint_DsGetDcName", (PyObject *)(void *)&wbint_DsGetDcName_Type);
22115 111 : Py_INCREF((PyObject *)(void *)&wbint_LookupRids_Type);
22116 143 : PyModule_AddObject(m, "wbint_LookupRids", (PyObject *)(void *)&wbint_LookupRids_Type);
22117 111 : Py_INCREF((PyObject *)(void *)&wbint_CheckMachineAccount_Type);
22118 143 : PyModule_AddObject(m, "wbint_CheckMachineAccount", (PyObject *)(void *)&wbint_CheckMachineAccount_Type);
22119 111 : Py_INCREF((PyObject *)(void *)&wbint_ChangeMachineAccount_Type);
22120 143 : PyModule_AddObject(m, "wbint_ChangeMachineAccount", (PyObject *)(void *)&wbint_ChangeMachineAccount_Type);
22121 111 : Py_INCREF((PyObject *)(void *)&wbint_PingDc_Type);
22122 143 : PyModule_AddObject(m, "wbint_PingDc", (PyObject *)(void *)&wbint_PingDc_Type);
22123 111 : Py_INCREF((PyObject *)(void *)&wbint_ListTrustedDomains_Type);
22124 143 : PyModule_AddObject(m, "wbint_ListTrustedDomains", (PyObject *)(void *)&wbint_ListTrustedDomains_Type);
22125 111 : Py_INCREF((PyObject *)(void *)&wbint_PamAuth_Type);
22126 143 : PyModule_AddObject(m, "wbint_PamAuth", (PyObject *)(void *)&wbint_PamAuth_Type);
22127 111 : Py_INCREF((PyObject *)(void *)&wbint_PamAuthCrap_Type);
22128 143 : PyModule_AddObject(m, "wbint_PamAuthCrap", (PyObject *)(void *)&wbint_PamAuthCrap_Type);
22129 111 : Py_INCREF((PyObject *)(void *)&wbint_PamLogOff_Type);
22130 143 : PyModule_AddObject(m, "wbint_PamLogOff", (PyObject *)(void *)&wbint_PamLogOff_Type);
22131 111 : Py_INCREF((PyObject *)(void *)&wbint_PamAuthCrapChangePassword_Type);
22132 143 : PyModule_AddObject(m, "wbint_PamAuthCrapChangePassword", (PyObject *)(void *)&wbint_PamAuthCrapChangePassword_Type);
22133 111 : Py_INCREF((PyObject *)(void *)&wbint_PamAuthChangePassword_Type);
22134 143 : PyModule_AddObject(m, "wbint_PamAuthChangePassword", (PyObject *)(void *)&wbint_PamAuthChangePassword_Type);
22135 111 : Py_INCREF((PyObject *)(void *)&wbint_InitConnection_Type);
22136 143 : PyModule_AddObject(m, "wbint_InitConnection", (PyObject *)(void *)&wbint_InitConnection_Type);
22137 111 : Py_INCREF((PyObject *)(void *)&winbind_SamLogon_Type);
22138 143 : PyModule_AddObject(m, "SamLogon", (PyObject *)(void *)&winbind_SamLogon_Type);
22139 111 : Py_INCREF((PyObject *)(void *)&winbind_DsrUpdateReadOnlyServerDnsRecords_Type);
22140 143 : PyModule_AddObject(m, "DsrUpdateReadOnlyServerDnsRecords", (PyObject *)(void *)&winbind_DsrUpdateReadOnlyServerDnsRecords_Type);
22141 111 : Py_INCREF((PyObject *)(void *)&winbind_LogonControl_Type);
22142 143 : PyModule_AddObject(m, "LogonControl", (PyObject *)(void *)&winbind_LogonControl_Type);
22143 111 : Py_INCREF((PyObject *)(void *)&winbind_GetForestTrustInformation_Type);
22144 143 : PyModule_AddObject(m, "GetForestTrustInformation", (PyObject *)(void *)&winbind_GetForestTrustInformation_Type);
22145 111 : Py_INCREF((PyObject *)(void *)&winbind_SendToSam_Type);
22146 143 : PyModule_AddObject(m, "SendToSam", (PyObject *)(void *)&winbind_SendToSam_Type);
22147 111 : Py_INCREF((PyObject *)(void *)&winbind_InterfaceType);
22148 143 : PyModule_AddObject(m, "winbind", (PyObject *)(void *)&winbind_InterfaceType);
22149 111 : Py_INCREF((PyObject *)(void *)&winbind_SyntaxType);
22150 143 : PyModule_AddObject(m, "winbind_abstract_syntax", (PyObject *)(void *)&winbind_SyntaxType);
22151 111 : Py_INCREF((PyObject *)(void *)&winbind_SyntaxType);
22152 143 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&winbind_SyntaxType);
22153 : #ifdef PY_MOD_WINBIND_PATCH
22154 : PY_MOD_WINBIND_PATCH(m);
22155 : #endif
22156 143 : out:
22157 143 : Py_XDECREF(dep_samba_dcerpc_lsa);
22158 143 : Py_XDECREF(dep_samba_dcerpc_netlogon);
22159 143 : Py_XDECREF(dep_samba_dcerpc_samr);
22160 143 : Py_XDECREF(dep_samba_dcerpc_misc);
22161 143 : Py_XDECREF(dep_samba_dcerpc_security);
22162 143 : Py_XDECREF(dep_samba_dcerpc_idmap);
22163 143 : Py_XDECREF(dep_talloc);
22164 143 : Py_XDECREF(dep_samba_dcerpc_base);
22165 140 : return m;
22166 :
22167 : }
|