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/source4/librpc/gen_ndr/ndr_irpc.h"
12 : #include "bin/default/source4/librpc/gen_ndr/ndr_irpc_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 0 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 0 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 0 : case 4:
38 0 : 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/misc.h"
65 : #include "librpc/gen_ndr/security.h"
66 : #include "librpc/gen_ndr/nbt.h"
67 : #include "librpc/gen_ndr/netlogon.h"
68 : #include "librpc/gen_ndr/server_id.h"
69 : static PyTypeObject irpc_creds_Type;
70 : static PyTypeObject irpc_header_Type;
71 : static PyTypeObject irpc_name_record_Type;
72 : static PyTypeObject irpc_name_records_Type;
73 : static PyTypeObject nbtd_statistics_Type;
74 : static PyTypeObject nbtd_info_Type;
75 : static PyTypeObject nbtd_proxy_wins_addr_Type;
76 : static PyTypeObject smbsrv_session_info_Type;
77 : static PyTypeObject smbsrv_sessions_Type;
78 : static PyTypeObject smbsrv_tcon_info_Type;
79 : static PyTypeObject smbsrv_tcons_Type;
80 : static PyTypeObject smbsrv_info_Type;
81 : static PyTypeObject irpc_InterfaceType;
82 : static PyTypeObject irpc_uptime_Type;
83 : static PyTypeObject nbtd_information_Type;
84 : static PyTypeObject nbtd_getdcname_Type;
85 : static PyTypeObject nbtd_proxy_wins_challenge_Type;
86 : static PyTypeObject nbtd_proxy_wins_release_demand_Type;
87 : static PyTypeObject kdc_check_generic_kerberos_Type;
88 : static PyTypeObject smbsrv_information_Type;
89 : static PyTypeObject samba_terminate_Type;
90 : static PyTypeObject dreplsrv_refresh_Type;
91 : static PyTypeObject drepl_takeFSMORole_Type;
92 : static PyTypeObject drepl_trigger_repl_secret_Type;
93 : static PyTypeObject dnsupdate_RODC_Type;
94 : static PyTypeObject dnssrv_reload_dns_zones_Type;
95 :
96 : static PyTypeObject *security_token_Type;
97 : static PyTypeObject *BaseObject_Type;
98 : static PyTypeObject *GUID_Type;
99 : static PyTypeObject *server_id_Type;
100 : static PyTypeObject *dom_sid_Type;
101 : static PyTypeObject *nbt_name_Type;
102 : static PyTypeObject *NL_DNS_NAME_INFO_ARRAY_Type;
103 : static PyTypeObject *ClientConnection_Type;
104 : static PyTypeObject *ndr_syntax_id_Type;
105 :
106 0 : static PyObject *py_irpc_creds_get_token(PyObject *obj, void *closure)
107 : {
108 0 : struct irpc_creds *object = pytalloc_get_ptr(obj);
109 : PyObject *py_token;
110 0 : if (object->token == NULL) {
111 0 : Py_RETURN_NONE;
112 : }
113 0 : if (object->token == NULL) {
114 0 : py_token = Py_None;
115 0 : Py_INCREF(py_token);
116 : } else {
117 0 : py_token = pytalloc_reference_ex(security_token_Type, object->token, object->token);
118 : }
119 0 : return py_token;
120 : }
121 :
122 0 : static int py_irpc_creds_set_token(PyObject *py_obj, PyObject *value, void *closure)
123 : {
124 0 : struct irpc_creds *object = pytalloc_get_ptr(py_obj);
125 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->token));
126 0 : if (value == NULL) {
127 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->token");
128 0 : return -1;
129 : }
130 0 : if (value == Py_None) {
131 0 : object->token = NULL;
132 : } else {
133 0 : object->token = NULL;
134 0 : PY_CHECK_TYPE(security_token_Type, value, return -1;);
135 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
136 0 : PyErr_NoMemory();
137 0 : return -1;
138 : }
139 0 : object->token = (struct security_token *)pytalloc_get_ptr(value);
140 : }
141 0 : return 0;
142 : }
143 :
144 : static PyGetSetDef py_irpc_creds_getsetters[] = {
145 : {
146 : .name = discard_const_p(char, "token"),
147 : .get = py_irpc_creds_get_token,
148 : .set = py_irpc_creds_set_token,
149 : .doc = discard_const_p(char, "PIDL-generated element of base type security_token")
150 : },
151 : { .name = NULL }
152 : };
153 :
154 0 : static PyObject *py_irpc_creds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
155 : {
156 0 : return pytalloc_new(struct irpc_creds, type);
157 : }
158 :
159 :
160 : static PyTypeObject irpc_creds_Type = {
161 : PyVarObject_HEAD_INIT(NULL, 0)
162 : .tp_name = "irpc.creds",
163 : .tp_getset = py_irpc_creds_getsetters,
164 : .tp_methods = NULL,
165 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
166 : .tp_new = py_irpc_creds_new,
167 : };
168 :
169 :
170 0 : static PyObject *py_irpc_header_get_uuid(PyObject *obj, void *closure)
171 : {
172 0 : struct irpc_header *object = pytalloc_get_ptr(obj);
173 : PyObject *py_uuid;
174 0 : py_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->uuid);
175 0 : return py_uuid;
176 : }
177 :
178 0 : static int py_irpc_header_set_uuid(PyObject *py_obj, PyObject *value, void *closure)
179 : {
180 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
181 0 : if (value == NULL) {
182 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->uuid");
183 0 : return -1;
184 : }
185 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
186 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
187 0 : PyErr_NoMemory();
188 0 : return -1;
189 : }
190 0 : object->uuid = *(struct GUID *)pytalloc_get_ptr(value);
191 0 : return 0;
192 : }
193 :
194 0 : static PyObject *py_irpc_header_get_if_version(PyObject *obj, void *closure)
195 : {
196 0 : struct irpc_header *object = pytalloc_get_ptr(obj);
197 : PyObject *py_if_version;
198 0 : py_if_version = PyLong_FromUnsignedLongLong((uint32_t)(object->if_version));
199 0 : return py_if_version;
200 : }
201 :
202 0 : static int py_irpc_header_set_if_version(PyObject *py_obj, PyObject *value, void *closure)
203 : {
204 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
205 0 : if (value == NULL) {
206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->if_version");
207 0 : return -1;
208 : }
209 : {
210 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->if_version));
211 0 : if (PyLong_Check(value)) {
212 : unsigned long long test_var;
213 0 : test_var = PyLong_AsUnsignedLongLong(value);
214 0 : if (PyErr_Occurred() != NULL) {
215 0 : return -1;
216 : }
217 0 : if (test_var > uint_max) {
218 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
219 : PyLong_Type.tp_name, uint_max, test_var);
220 0 : return -1;
221 : }
222 0 : object->if_version = test_var;
223 : } else {
224 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
225 : PyLong_Type.tp_name);
226 0 : return -1;
227 : }
228 : }
229 0 : return 0;
230 : }
231 :
232 0 : static PyObject *py_irpc_header_get_callnum(PyObject *obj, void *closure)
233 : {
234 0 : struct irpc_header *object = pytalloc_get_ptr(obj);
235 : PyObject *py_callnum;
236 0 : py_callnum = PyLong_FromUnsignedLongLong((uint32_t)(object->callnum));
237 0 : return py_callnum;
238 : }
239 :
240 0 : static int py_irpc_header_set_callnum(PyObject *py_obj, PyObject *value, void *closure)
241 : {
242 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
243 0 : if (value == NULL) {
244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->callnum");
245 0 : return -1;
246 : }
247 : {
248 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->callnum));
249 0 : if (PyLong_Check(value)) {
250 : unsigned long long test_var;
251 0 : test_var = PyLong_AsUnsignedLongLong(value);
252 0 : if (PyErr_Occurred() != NULL) {
253 0 : return -1;
254 : }
255 0 : if (test_var > uint_max) {
256 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
257 : PyLong_Type.tp_name, uint_max, test_var);
258 0 : return -1;
259 : }
260 0 : object->callnum = test_var;
261 : } else {
262 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
263 : PyLong_Type.tp_name);
264 0 : return -1;
265 : }
266 : }
267 0 : return 0;
268 : }
269 :
270 0 : static PyObject *py_irpc_header_get_callid(PyObject *obj, void *closure)
271 : {
272 0 : struct irpc_header *object = pytalloc_get_ptr(obj);
273 : PyObject *py_callid;
274 0 : py_callid = PyLong_FromUnsignedLongLong((uint32_t)(object->callid));
275 0 : return py_callid;
276 : }
277 :
278 0 : static int py_irpc_header_set_callid(PyObject *py_obj, PyObject *value, void *closure)
279 : {
280 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
281 0 : if (value == NULL) {
282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->callid");
283 0 : return -1;
284 : }
285 : {
286 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->callid));
287 0 : if (PyLong_Check(value)) {
288 : unsigned long long test_var;
289 0 : test_var = PyLong_AsUnsignedLongLong(value);
290 0 : if (PyErr_Occurred() != NULL) {
291 0 : return -1;
292 : }
293 0 : if (test_var > uint_max) {
294 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
295 : PyLong_Type.tp_name, uint_max, test_var);
296 0 : return -1;
297 : }
298 0 : object->callid = test_var;
299 : } else {
300 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
301 : PyLong_Type.tp_name);
302 0 : return -1;
303 : }
304 : }
305 0 : return 0;
306 : }
307 :
308 0 : static PyObject *py_irpc_header_get_flags(PyObject *obj, void *closure)
309 : {
310 0 : struct irpc_header *object = pytalloc_get_ptr(obj);
311 : PyObject *py_flags;
312 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
313 0 : return py_flags;
314 : }
315 :
316 0 : static int py_irpc_header_set_flags(PyObject *py_obj, PyObject *value, void *closure)
317 : {
318 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
319 0 : if (value == NULL) {
320 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
321 0 : return -1;
322 : }
323 : {
324 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
325 0 : if (PyLong_Check(value)) {
326 : unsigned long long test_var;
327 0 : test_var = PyLong_AsUnsignedLongLong(value);
328 0 : if (PyErr_Occurred() != NULL) {
329 0 : return -1;
330 : }
331 0 : if (test_var > uint_max) {
332 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
333 : PyLong_Type.tp_name, uint_max, test_var);
334 0 : return -1;
335 : }
336 0 : object->flags = test_var;
337 : } else {
338 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
339 : PyLong_Type.tp_name);
340 0 : return -1;
341 : }
342 : }
343 0 : return 0;
344 : }
345 :
346 0 : static PyObject *py_irpc_header_get_status(PyObject *obj, void *closure)
347 : {
348 0 : struct irpc_header *object = pytalloc_get_ptr(obj);
349 : PyObject *py_status;
350 0 : py_status = PyErr_FromNTSTATUS(object->status);
351 0 : return py_status;
352 : }
353 :
354 0 : static int py_irpc_header_set_status(PyObject *py_obj, PyObject *value, void *closure)
355 : {
356 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
357 0 : if (value == NULL) {
358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
359 0 : return -1;
360 : }
361 0 : object->status = NT_STATUS(PyLong_AsLong(value));
362 0 : return 0;
363 : }
364 :
365 0 : static PyObject *py_irpc_header_get_creds(PyObject *obj, void *closure)
366 : {
367 0 : struct irpc_header *object = pytalloc_get_ptr(obj);
368 : PyObject *py_creds;
369 0 : py_creds = pytalloc_reference_ex(&irpc_creds_Type, pytalloc_get_mem_ctx(obj), &object->creds);
370 0 : return py_creds;
371 : }
372 :
373 0 : static int py_irpc_header_set_creds(PyObject *py_obj, PyObject *value, void *closure)
374 : {
375 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
376 0 : if (value == NULL) {
377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->creds");
378 0 : return -1;
379 : }
380 0 : PY_CHECK_TYPE(&irpc_creds_Type, value, return -1;);
381 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
382 0 : PyErr_NoMemory();
383 0 : return -1;
384 : }
385 0 : object->creds = *(struct irpc_creds *)pytalloc_get_ptr(value);
386 0 : return 0;
387 : }
388 :
389 0 : static PyObject *py_irpc_header_get__pad(PyObject *obj, void *closure)
390 : {
391 0 : struct irpc_header *object = pytalloc_get_ptr(obj);
392 : PyObject *py__pad;
393 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
394 0 : return py__pad;
395 : }
396 :
397 0 : static int py_irpc_header_set__pad(PyObject *py_obj, PyObject *value, void *closure)
398 : {
399 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
400 0 : if (value == NULL) {
401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad");
402 0 : return -1;
403 : }
404 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
405 0 : return 0;
406 : }
407 :
408 : static PyGetSetDef py_irpc_header_getsetters[] = {
409 : {
410 : .name = discard_const_p(char, "uuid"),
411 : .get = py_irpc_header_get_uuid,
412 : .set = py_irpc_header_set_uuid,
413 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
414 : },
415 : {
416 : .name = discard_const_p(char, "if_version"),
417 : .get = py_irpc_header_get_if_version,
418 : .set = py_irpc_header_set_if_version,
419 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
420 : },
421 : {
422 : .name = discard_const_p(char, "callnum"),
423 : .get = py_irpc_header_get_callnum,
424 : .set = py_irpc_header_set_callnum,
425 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
426 : },
427 : {
428 : .name = discard_const_p(char, "callid"),
429 : .get = py_irpc_header_get_callid,
430 : .set = py_irpc_header_set_callid,
431 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
432 : },
433 : {
434 : .name = discard_const_p(char, "flags"),
435 : .get = py_irpc_header_get_flags,
436 : .set = py_irpc_header_set_flags,
437 : .doc = discard_const_p(char, "PIDL-generated element of base type irpc_flags")
438 : },
439 : {
440 : .name = discard_const_p(char, "status"),
441 : .get = py_irpc_header_get_status,
442 : .set = py_irpc_header_set_status,
443 : .doc = discard_const_p(char, "PIDL-generated element of base type NTSTATUS")
444 : },
445 : {
446 : .name = discard_const_p(char, "creds"),
447 : .get = py_irpc_header_get_creds,
448 : .set = py_irpc_header_set_creds,
449 : .doc = discard_const_p(char, "PIDL-generated element of base type irpc_creds")
450 : },
451 : {
452 : .name = discard_const_p(char, "_pad"),
453 : .get = py_irpc_header_get__pad,
454 : .set = py_irpc_header_set__pad,
455 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
456 : },
457 : { .name = NULL }
458 : };
459 :
460 0 : static PyObject *py_irpc_header_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
461 : {
462 0 : return pytalloc_new(struct irpc_header, type);
463 : }
464 :
465 0 : static PyObject *py_irpc_header_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
466 : {
467 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
468 0 : PyObject *ret = NULL;
469 : DATA_BLOB blob;
470 : enum ndr_err_code err;
471 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
472 0 : if (tmp_ctx == NULL) {
473 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
474 0 : return NULL;
475 : }
476 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_irpc_header);
477 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
478 0 : TALLOC_FREE(tmp_ctx);
479 0 : PyErr_SetNdrError(err);
480 0 : return NULL;
481 : }
482 :
483 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
484 0 : TALLOC_FREE(tmp_ctx);
485 0 : return ret;
486 : }
487 :
488 0 : static PyObject *py_irpc_header_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
489 : {
490 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
491 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
492 0 : Py_ssize_t blob_length = 0;
493 : enum ndr_err_code err;
494 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
495 0 : PyObject *allow_remaining_obj = NULL;
496 0 : bool allow_remaining = false;
497 :
498 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
499 : discard_const_p(char *, kwnames),
500 : &blob.data, &blob_length,
501 : &allow_remaining_obj)) {
502 0 : return NULL;
503 : }
504 0 : blob.length = blob_length;
505 :
506 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
507 0 : allow_remaining = true;
508 : }
509 :
510 0 : if (allow_remaining) {
511 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_irpc_header);
512 : } else {
513 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_irpc_header);
514 : }
515 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
516 0 : PyErr_SetNdrError(err);
517 0 : return NULL;
518 : }
519 :
520 0 : Py_RETURN_NONE;
521 : }
522 :
523 0 : static PyObject *py_irpc_header_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
524 : {
525 0 : struct irpc_header *object = pytalloc_get_ptr(py_obj);
526 : PyObject *ret;
527 : char *retstr;
528 :
529 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_irpc_header, "irpc_header", object);
530 0 : ret = PyUnicode_FromString(retstr);
531 0 : talloc_free(retstr);
532 :
533 0 : return ret;
534 : }
535 :
536 : static PyMethodDef py_irpc_header_methods[] = {
537 : { "__ndr_pack__", (PyCFunction)py_irpc_header_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
538 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_irpc_header_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
539 : { "__ndr_print__", (PyCFunction)py_irpc_header_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
540 : { NULL, NULL, 0, NULL }
541 : };
542 :
543 :
544 : static PyTypeObject irpc_header_Type = {
545 : PyVarObject_HEAD_INIT(NULL, 0)
546 : .tp_name = "irpc.header",
547 : .tp_getset = py_irpc_header_getsetters,
548 : .tp_methods = py_irpc_header_methods,
549 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
550 : .tp_new = py_irpc_header_new,
551 : };
552 :
553 :
554 8474 : static PyObject *py_irpc_name_record_get_name(PyObject *obj, void *closure)
555 : {
556 8474 : struct irpc_name_record *object = pytalloc_get_ptr(obj);
557 : PyObject *py_name;
558 8474 : py_name = PyString_FromStringOrNULL(object->name);
559 8474 : return py_name;
560 : }
561 :
562 0 : static int py_irpc_name_record_set_name(PyObject *py_obj, PyObject *value, void *closure)
563 : {
564 0 : struct irpc_name_record *object = pytalloc_get_ptr(py_obj);
565 0 : if (value == NULL) {
566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
567 0 : return -1;
568 : }
569 : {
570 : const char *test_str;
571 : const char *talloc_str;
572 0 : PyObject *unicode = NULL;
573 0 : if (PyUnicode_Check(value)) {
574 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
575 0 : if (unicode == NULL) {
576 0 : return -1;
577 : }
578 0 : test_str = PyBytes_AS_STRING(unicode);
579 0 : } else if (PyBytes_Check(value)) {
580 0 : test_str = PyBytes_AS_STRING(value);
581 : } else {
582 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
583 0 : return -1;
584 : }
585 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
586 0 : if (unicode != NULL) {
587 0 : Py_DECREF(unicode);
588 : }
589 0 : if (talloc_str == NULL) {
590 0 : PyErr_NoMemory();
591 0 : return -1;
592 : }
593 0 : object->name = talloc_str;
594 : }
595 0 : return 0;
596 : }
597 :
598 0 : static PyObject *py_irpc_name_record_get_count(PyObject *obj, void *closure)
599 : {
600 0 : struct irpc_name_record *object = pytalloc_get_ptr(obj);
601 : PyObject *py_count;
602 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
603 0 : return py_count;
604 : }
605 :
606 0 : static int py_irpc_name_record_set_count(PyObject *py_obj, PyObject *value, void *closure)
607 : {
608 0 : struct irpc_name_record *object = pytalloc_get_ptr(py_obj);
609 0 : if (value == NULL) {
610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
611 0 : return -1;
612 : }
613 : {
614 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
615 0 : if (PyLong_Check(value)) {
616 : unsigned long long test_var;
617 0 : test_var = PyLong_AsUnsignedLongLong(value);
618 0 : if (PyErr_Occurred() != NULL) {
619 0 : return -1;
620 : }
621 0 : if (test_var > uint_max) {
622 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
623 : PyLong_Type.tp_name, uint_max, test_var);
624 0 : return -1;
625 : }
626 0 : object->count = test_var;
627 : } else {
628 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
629 : PyLong_Type.tp_name);
630 0 : return -1;
631 : }
632 : }
633 0 : return 0;
634 : }
635 :
636 6927 : static PyObject *py_irpc_name_record_get_ids(PyObject *obj, void *closure)
637 : {
638 6927 : struct irpc_name_record *object = pytalloc_get_ptr(obj);
639 : PyObject *py_ids;
640 6927 : py_ids = PyList_New(object->count);
641 6927 : if (py_ids == NULL) {
642 0 : return NULL;
643 : }
644 : {
645 : int ids_cntr_0;
646 15101 : for (ids_cntr_0 = 0; ids_cntr_0 < (object->count); ids_cntr_0++) {
647 : PyObject *py_ids_0;
648 8174 : py_ids_0 = pytalloc_reference_ex(server_id_Type, object->ids, &(object->ids)[ids_cntr_0]);
649 8174 : PyList_SetItem(py_ids, ids_cntr_0, py_ids_0);
650 : }
651 : }
652 6927 : return py_ids;
653 : }
654 :
655 0 : static int py_irpc_name_record_set_ids(PyObject *py_obj, PyObject *value, void *closure)
656 : {
657 0 : struct irpc_name_record *object = pytalloc_get_ptr(py_obj);
658 0 : if (value == NULL) {
659 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ids");
660 0 : return -1;
661 : }
662 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
663 : {
664 : int ids_cntr_0;
665 0 : object->ids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ids, PyList_GET_SIZE(value));
666 0 : if (!object->ids) { return -1; }
667 0 : talloc_set_name_const(object->ids, "ARRAY: object->ids");
668 0 : for (ids_cntr_0 = 0; ids_cntr_0 < PyList_GET_SIZE(value); ids_cntr_0++) {
669 0 : if (PyList_GET_ITEM(value, ids_cntr_0) == NULL) {
670 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->ids)[ids_cntr_0]");
671 0 : return -1;
672 : }
673 0 : PY_CHECK_TYPE(server_id_Type, PyList_GET_ITEM(value, ids_cntr_0), return -1;);
674 0 : if (talloc_reference(object->ids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ids_cntr_0))) == NULL) {
675 0 : PyErr_NoMemory();
676 0 : return -1;
677 : }
678 0 : (object->ids)[ids_cntr_0] = *(struct server_id *)pytalloc_get_ptr(PyList_GET_ITEM(value, ids_cntr_0));
679 : }
680 : }
681 0 : return 0;
682 : }
683 :
684 : static PyGetSetDef py_irpc_name_record_getsetters[] = {
685 : {
686 : .name = discard_const_p(char, "name"),
687 : .get = py_irpc_name_record_get_name,
688 : .set = py_irpc_name_record_set_name,
689 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
690 : },
691 : {
692 : .name = discard_const_p(char, "count"),
693 : .get = py_irpc_name_record_get_count,
694 : .set = py_irpc_name_record_set_count,
695 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
696 : },
697 : {
698 : .name = discard_const_p(char, "ids"),
699 : .get = py_irpc_name_record_get_ids,
700 : .set = py_irpc_name_record_set_ids,
701 : .doc = discard_const_p(char, "PIDL-generated element of base type server_id")
702 : },
703 : { .name = NULL }
704 : };
705 :
706 0 : static PyObject *py_irpc_name_record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
707 : {
708 0 : return pytalloc_new(struct irpc_name_record, type);
709 : }
710 :
711 0 : static PyObject *py_irpc_name_record_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
712 : {
713 0 : struct irpc_name_record *object = pytalloc_get_ptr(py_obj);
714 0 : PyObject *ret = NULL;
715 : DATA_BLOB blob;
716 : enum ndr_err_code err;
717 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
718 0 : if (tmp_ctx == NULL) {
719 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
720 0 : return NULL;
721 : }
722 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_irpc_name_record);
723 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
724 0 : TALLOC_FREE(tmp_ctx);
725 0 : PyErr_SetNdrError(err);
726 0 : return NULL;
727 : }
728 :
729 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
730 0 : TALLOC_FREE(tmp_ctx);
731 0 : return ret;
732 : }
733 :
734 0 : static PyObject *py_irpc_name_record_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
735 : {
736 0 : struct irpc_name_record *object = pytalloc_get_ptr(py_obj);
737 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
738 0 : Py_ssize_t blob_length = 0;
739 : enum ndr_err_code err;
740 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
741 0 : PyObject *allow_remaining_obj = NULL;
742 0 : bool allow_remaining = false;
743 :
744 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
745 : discard_const_p(char *, kwnames),
746 : &blob.data, &blob_length,
747 : &allow_remaining_obj)) {
748 0 : return NULL;
749 : }
750 0 : blob.length = blob_length;
751 :
752 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
753 0 : allow_remaining = true;
754 : }
755 :
756 0 : if (allow_remaining) {
757 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_irpc_name_record);
758 : } else {
759 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_irpc_name_record);
760 : }
761 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
762 0 : PyErr_SetNdrError(err);
763 0 : return NULL;
764 : }
765 :
766 0 : Py_RETURN_NONE;
767 : }
768 :
769 0 : static PyObject *py_irpc_name_record_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
770 : {
771 0 : struct irpc_name_record *object = pytalloc_get_ptr(py_obj);
772 : PyObject *ret;
773 : char *retstr;
774 :
775 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_irpc_name_record, "irpc_name_record", object);
776 0 : ret = PyUnicode_FromString(retstr);
777 0 : talloc_free(retstr);
778 :
779 0 : return ret;
780 : }
781 :
782 : static PyMethodDef py_irpc_name_record_methods[] = {
783 : { "__ndr_pack__", (PyCFunction)py_irpc_name_record_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
784 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_irpc_name_record_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
785 : { "__ndr_print__", (PyCFunction)py_irpc_name_record_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
786 : { NULL, NULL, 0, NULL }
787 : };
788 :
789 :
790 : static PyTypeObject irpc_name_record_Type = {
791 : PyVarObject_HEAD_INIT(NULL, 0)
792 : .tp_name = "irpc.name_record",
793 : .tp_getset = py_irpc_name_record_getsetters,
794 : .tp_methods = py_irpc_name_record_methods,
795 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
796 : .tp_new = py_irpc_name_record_new,
797 : };
798 :
799 :
800 0 : static PyObject *py_irpc_name_records_get_names(PyObject *obj, void *closure)
801 : {
802 0 : struct irpc_name_records *object = pytalloc_get_ptr(obj);
803 : PyObject *py_names;
804 0 : py_names = PyList_New(object->num_records);
805 0 : if (py_names == NULL) {
806 0 : return NULL;
807 : }
808 : {
809 : int names_cntr_0;
810 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->num_records); names_cntr_0++) {
811 : PyObject *py_names_0;
812 0 : if ((object->names)[names_cntr_0] == NULL) {
813 0 : py_names_0 = Py_None;
814 0 : Py_INCREF(py_names_0);
815 : } else {
816 0 : py_names_0 = pytalloc_reference_ex(&irpc_name_record_Type, (object->names)[names_cntr_0], (object->names)[names_cntr_0]);
817 : }
818 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
819 : }
820 : }
821 0 : return py_names;
822 : }
823 :
824 0 : static int py_irpc_name_records_set_names(PyObject *py_obj, PyObject *value, void *closure)
825 : {
826 0 : struct irpc_name_records *object = pytalloc_get_ptr(py_obj);
827 0 : if (value == NULL) {
828 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->names");
829 0 : return -1;
830 : }
831 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
832 : {
833 : int names_cntr_0;
834 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
835 0 : if (!object->names) { return -1; }
836 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
837 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
838 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
839 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->names)[names_cntr_0]");
840 0 : return -1;
841 : }
842 0 : if (PyList_GET_ITEM(value, names_cntr_0) == Py_None) {
843 0 : (object->names)[names_cntr_0] = NULL;
844 : } else {
845 0 : (object->names)[names_cntr_0] = NULL;
846 0 : PY_CHECK_TYPE(&irpc_name_record_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
847 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
848 0 : PyErr_NoMemory();
849 0 : return -1;
850 : }
851 0 : (object->names)[names_cntr_0] = (struct irpc_name_record *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
852 : }
853 : }
854 : }
855 0 : return 0;
856 : }
857 :
858 0 : static PyObject *py_irpc_name_records_get_num_records(PyObject *obj, void *closure)
859 : {
860 0 : struct irpc_name_records *object = pytalloc_get_ptr(obj);
861 : PyObject *py_num_records;
862 0 : py_num_records = PyLong_FromUnsignedLongLong((uint32_t)(object->num_records));
863 0 : return py_num_records;
864 : }
865 :
866 0 : static int py_irpc_name_records_set_num_records(PyObject *py_obj, PyObject *value, void *closure)
867 : {
868 0 : struct irpc_name_records *object = pytalloc_get_ptr(py_obj);
869 0 : if (value == NULL) {
870 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_records");
871 0 : return -1;
872 : }
873 : {
874 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_records));
875 0 : if (PyLong_Check(value)) {
876 : unsigned long long test_var;
877 0 : test_var = PyLong_AsUnsignedLongLong(value);
878 0 : if (PyErr_Occurred() != NULL) {
879 0 : return -1;
880 : }
881 0 : if (test_var > uint_max) {
882 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
883 : PyLong_Type.tp_name, uint_max, test_var);
884 0 : return -1;
885 : }
886 0 : object->num_records = test_var;
887 : } else {
888 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
889 : PyLong_Type.tp_name);
890 0 : return -1;
891 : }
892 : }
893 0 : return 0;
894 : }
895 :
896 : static PyGetSetDef py_irpc_name_records_getsetters[] = {
897 : {
898 : .name = discard_const_p(char, "names"),
899 : .get = py_irpc_name_records_get_names,
900 : .set = py_irpc_name_records_set_names,
901 : .doc = discard_const_p(char, "PIDL-generated element of base type irpc_name_record")
902 : },
903 : {
904 : .name = discard_const_p(char, "num_records"),
905 : .get = py_irpc_name_records_get_num_records,
906 : .set = py_irpc_name_records_set_num_records,
907 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
908 : },
909 : { .name = NULL }
910 : };
911 :
912 0 : static PyObject *py_irpc_name_records_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
913 : {
914 0 : return pytalloc_new(struct irpc_name_records, type);
915 : }
916 :
917 0 : static PyObject *py_irpc_name_records_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
918 : {
919 0 : struct irpc_name_records *object = pytalloc_get_ptr(py_obj);
920 0 : PyObject *ret = NULL;
921 : DATA_BLOB blob;
922 : enum ndr_err_code err;
923 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
924 0 : if (tmp_ctx == NULL) {
925 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
926 0 : return NULL;
927 : }
928 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_irpc_name_records);
929 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
930 0 : TALLOC_FREE(tmp_ctx);
931 0 : PyErr_SetNdrError(err);
932 0 : return NULL;
933 : }
934 :
935 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
936 0 : TALLOC_FREE(tmp_ctx);
937 0 : return ret;
938 : }
939 :
940 0 : static PyObject *py_irpc_name_records_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
941 : {
942 0 : struct irpc_name_records *object = pytalloc_get_ptr(py_obj);
943 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
944 0 : Py_ssize_t blob_length = 0;
945 : enum ndr_err_code err;
946 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
947 0 : PyObject *allow_remaining_obj = NULL;
948 0 : bool allow_remaining = false;
949 :
950 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
951 : discard_const_p(char *, kwnames),
952 : &blob.data, &blob_length,
953 : &allow_remaining_obj)) {
954 0 : return NULL;
955 : }
956 0 : blob.length = blob_length;
957 :
958 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
959 0 : allow_remaining = true;
960 : }
961 :
962 0 : if (allow_remaining) {
963 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_irpc_name_records);
964 : } else {
965 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_irpc_name_records);
966 : }
967 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
968 0 : PyErr_SetNdrError(err);
969 0 : return NULL;
970 : }
971 :
972 0 : Py_RETURN_NONE;
973 : }
974 :
975 0 : static PyObject *py_irpc_name_records_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
976 : {
977 0 : struct irpc_name_records *object = pytalloc_get_ptr(py_obj);
978 : PyObject *ret;
979 : char *retstr;
980 :
981 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_irpc_name_records, "irpc_name_records", object);
982 0 : ret = PyUnicode_FromString(retstr);
983 0 : talloc_free(retstr);
984 :
985 0 : return ret;
986 : }
987 :
988 : static PyMethodDef py_irpc_name_records_methods[] = {
989 : { "__ndr_pack__", (PyCFunction)py_irpc_name_records_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
990 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_irpc_name_records_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
991 : { "__ndr_print__", (PyCFunction)py_irpc_name_records_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
992 : { NULL, NULL, 0, NULL }
993 : };
994 :
995 :
996 : static PyTypeObject irpc_name_records_Type = {
997 : PyVarObject_HEAD_INIT(NULL, 0)
998 : .tp_name = "irpc.name_records",
999 : .tp_getset = py_irpc_name_records_getsetters,
1000 : .tp_methods = py_irpc_name_records_methods,
1001 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1002 : .tp_new = py_irpc_name_records_new,
1003 : };
1004 :
1005 :
1006 0 : static PyObject *py_nbtd_statistics_get_total_received(PyObject *obj, void *closure)
1007 : {
1008 0 : struct nbtd_statistics *object = pytalloc_get_ptr(obj);
1009 : PyObject *py_total_received;
1010 0 : py_total_received = PyLong_FromUnsignedLongLong(object->total_received);
1011 0 : return py_total_received;
1012 : }
1013 :
1014 0 : static int py_nbtd_statistics_set_total_received(PyObject *py_obj, PyObject *value, void *closure)
1015 : {
1016 0 : struct nbtd_statistics *object = pytalloc_get_ptr(py_obj);
1017 0 : if (value == NULL) {
1018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_received");
1019 0 : return -1;
1020 : }
1021 : {
1022 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_received));
1023 0 : if (PyLong_Check(value)) {
1024 : unsigned long long test_var;
1025 0 : test_var = PyLong_AsUnsignedLongLong(value);
1026 0 : if (PyErr_Occurred() != NULL) {
1027 0 : return -1;
1028 : }
1029 0 : if (test_var > uint_max) {
1030 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1031 : PyLong_Type.tp_name, uint_max, test_var);
1032 0 : return -1;
1033 : }
1034 0 : object->total_received = test_var;
1035 : } else {
1036 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1037 : PyLong_Type.tp_name);
1038 0 : return -1;
1039 : }
1040 : }
1041 0 : return 0;
1042 : }
1043 :
1044 0 : static PyObject *py_nbtd_statistics_get_total_sent(PyObject *obj, void *closure)
1045 : {
1046 0 : struct nbtd_statistics *object = pytalloc_get_ptr(obj);
1047 : PyObject *py_total_sent;
1048 0 : py_total_sent = PyLong_FromUnsignedLongLong(object->total_sent);
1049 0 : return py_total_sent;
1050 : }
1051 :
1052 0 : static int py_nbtd_statistics_set_total_sent(PyObject *py_obj, PyObject *value, void *closure)
1053 : {
1054 0 : struct nbtd_statistics *object = pytalloc_get_ptr(py_obj);
1055 0 : if (value == NULL) {
1056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_sent");
1057 0 : return -1;
1058 : }
1059 : {
1060 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_sent));
1061 0 : if (PyLong_Check(value)) {
1062 : unsigned long long test_var;
1063 0 : test_var = PyLong_AsUnsignedLongLong(value);
1064 0 : if (PyErr_Occurred() != NULL) {
1065 0 : return -1;
1066 : }
1067 0 : if (test_var > uint_max) {
1068 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1069 : PyLong_Type.tp_name, uint_max, test_var);
1070 0 : return -1;
1071 : }
1072 0 : object->total_sent = test_var;
1073 : } else {
1074 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1075 : PyLong_Type.tp_name);
1076 0 : return -1;
1077 : }
1078 : }
1079 0 : return 0;
1080 : }
1081 :
1082 0 : static PyObject *py_nbtd_statistics_get_query_count(PyObject *obj, void *closure)
1083 : {
1084 0 : struct nbtd_statistics *object = pytalloc_get_ptr(obj);
1085 : PyObject *py_query_count;
1086 0 : py_query_count = PyLong_FromUnsignedLongLong(object->query_count);
1087 0 : return py_query_count;
1088 : }
1089 :
1090 0 : static int py_nbtd_statistics_set_query_count(PyObject *py_obj, PyObject *value, void *closure)
1091 : {
1092 0 : struct nbtd_statistics *object = pytalloc_get_ptr(py_obj);
1093 0 : if (value == NULL) {
1094 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->query_count");
1095 0 : return -1;
1096 : }
1097 : {
1098 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->query_count));
1099 0 : if (PyLong_Check(value)) {
1100 : unsigned long long test_var;
1101 0 : test_var = PyLong_AsUnsignedLongLong(value);
1102 0 : if (PyErr_Occurred() != NULL) {
1103 0 : return -1;
1104 : }
1105 0 : if (test_var > uint_max) {
1106 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1107 : PyLong_Type.tp_name, uint_max, test_var);
1108 0 : return -1;
1109 : }
1110 0 : object->query_count = test_var;
1111 : } else {
1112 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1113 : PyLong_Type.tp_name);
1114 0 : return -1;
1115 : }
1116 : }
1117 0 : return 0;
1118 : }
1119 :
1120 0 : static PyObject *py_nbtd_statistics_get_register_count(PyObject *obj, void *closure)
1121 : {
1122 0 : struct nbtd_statistics *object = pytalloc_get_ptr(obj);
1123 : PyObject *py_register_count;
1124 0 : py_register_count = PyLong_FromUnsignedLongLong(object->register_count);
1125 0 : return py_register_count;
1126 : }
1127 :
1128 0 : static int py_nbtd_statistics_set_register_count(PyObject *py_obj, PyObject *value, void *closure)
1129 : {
1130 0 : struct nbtd_statistics *object = pytalloc_get_ptr(py_obj);
1131 0 : if (value == NULL) {
1132 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->register_count");
1133 0 : return -1;
1134 : }
1135 : {
1136 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->register_count));
1137 0 : if (PyLong_Check(value)) {
1138 : unsigned long long test_var;
1139 0 : test_var = PyLong_AsUnsignedLongLong(value);
1140 0 : if (PyErr_Occurred() != NULL) {
1141 0 : return -1;
1142 : }
1143 0 : if (test_var > uint_max) {
1144 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1145 : PyLong_Type.tp_name, uint_max, test_var);
1146 0 : return -1;
1147 : }
1148 0 : object->register_count = test_var;
1149 : } else {
1150 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1151 : PyLong_Type.tp_name);
1152 0 : return -1;
1153 : }
1154 : }
1155 0 : return 0;
1156 : }
1157 :
1158 0 : static PyObject *py_nbtd_statistics_get_release_count(PyObject *obj, void *closure)
1159 : {
1160 0 : struct nbtd_statistics *object = pytalloc_get_ptr(obj);
1161 : PyObject *py_release_count;
1162 0 : py_release_count = PyLong_FromUnsignedLongLong(object->release_count);
1163 0 : return py_release_count;
1164 : }
1165 :
1166 0 : static int py_nbtd_statistics_set_release_count(PyObject *py_obj, PyObject *value, void *closure)
1167 : {
1168 0 : struct nbtd_statistics *object = pytalloc_get_ptr(py_obj);
1169 0 : if (value == NULL) {
1170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->release_count");
1171 0 : return -1;
1172 : }
1173 : {
1174 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->release_count));
1175 0 : if (PyLong_Check(value)) {
1176 : unsigned long long test_var;
1177 0 : test_var = PyLong_AsUnsignedLongLong(value);
1178 0 : if (PyErr_Occurred() != NULL) {
1179 0 : return -1;
1180 : }
1181 0 : if (test_var > uint_max) {
1182 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1183 : PyLong_Type.tp_name, uint_max, test_var);
1184 0 : return -1;
1185 : }
1186 0 : object->release_count = test_var;
1187 : } else {
1188 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1189 : PyLong_Type.tp_name);
1190 0 : return -1;
1191 : }
1192 : }
1193 0 : return 0;
1194 : }
1195 :
1196 : static PyGetSetDef py_nbtd_statistics_getsetters[] = {
1197 : {
1198 : .name = discard_const_p(char, "total_received"),
1199 : .get = py_nbtd_statistics_get_total_received,
1200 : .set = py_nbtd_statistics_set_total_received,
1201 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1202 : },
1203 : {
1204 : .name = discard_const_p(char, "total_sent"),
1205 : .get = py_nbtd_statistics_get_total_sent,
1206 : .set = py_nbtd_statistics_set_total_sent,
1207 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1208 : },
1209 : {
1210 : .name = discard_const_p(char, "query_count"),
1211 : .get = py_nbtd_statistics_get_query_count,
1212 : .set = py_nbtd_statistics_set_query_count,
1213 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1214 : },
1215 : {
1216 : .name = discard_const_p(char, "register_count"),
1217 : .get = py_nbtd_statistics_get_register_count,
1218 : .set = py_nbtd_statistics_set_register_count,
1219 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1220 : },
1221 : {
1222 : .name = discard_const_p(char, "release_count"),
1223 : .get = py_nbtd_statistics_get_release_count,
1224 : .set = py_nbtd_statistics_set_release_count,
1225 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1226 : },
1227 : { .name = NULL }
1228 : };
1229 :
1230 0 : static PyObject *py_nbtd_statistics_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1231 : {
1232 0 : return pytalloc_new(struct nbtd_statistics, type);
1233 : }
1234 :
1235 :
1236 : static PyTypeObject nbtd_statistics_Type = {
1237 : PyVarObject_HEAD_INIT(NULL, 0)
1238 : .tp_name = "irpc.nbtd_statistics",
1239 : .tp_getset = py_nbtd_statistics_getsetters,
1240 : .tp_methods = NULL,
1241 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1242 : .tp_new = py_nbtd_statistics_new,
1243 : };
1244 :
1245 0 : static PyObject *py_import_nbtd_info(TALLOC_CTX *mem_ctx, int level, union nbtd_info *in)
1246 : {
1247 : PyObject *ret;
1248 :
1249 0 : switch (level) {
1250 0 : case NBTD_INFO_STATISTICS:
1251 0 : if (in->stats == NULL) {
1252 0 : ret = Py_None;
1253 0 : Py_INCREF(ret);
1254 : } else {
1255 0 : ret = pytalloc_reference_ex(&nbtd_statistics_Type, in->stats, in->stats);
1256 : }
1257 0 : return ret;
1258 :
1259 : }
1260 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1261 0 : return NULL;
1262 : }
1263 :
1264 0 : static union nbtd_info *py_export_nbtd_info(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1265 : {
1266 0 : union nbtd_info *ret = talloc_zero(mem_ctx, union nbtd_info);
1267 0 : switch (level) {
1268 0 : case NBTD_INFO_STATISTICS:
1269 0 : if (in == NULL) {
1270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->stats");
1271 0 : talloc_free(ret); return NULL;
1272 : }
1273 0 : if (in == Py_None) {
1274 0 : ret->stats = NULL;
1275 : } else {
1276 0 : ret->stats = NULL;
1277 0 : PY_CHECK_TYPE(&nbtd_statistics_Type, in, talloc_free(ret); return NULL;);
1278 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1279 0 : PyErr_NoMemory();
1280 0 : talloc_free(ret); return NULL;
1281 : }
1282 0 : ret->stats = (struct nbtd_statistics *)pytalloc_get_ptr(in);
1283 : }
1284 0 : break;
1285 :
1286 0 : default:
1287 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
1288 0 : talloc_free(ret);
1289 0 : ret = NULL;
1290 : }
1291 :
1292 0 : return ret;
1293 : }
1294 :
1295 0 : static PyObject *py_nbtd_info_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1296 : {
1297 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1298 0 : PyObject *mem_ctx_obj = NULL;
1299 0 : TALLOC_CTX *mem_ctx = NULL;
1300 0 : int level = 0;
1301 0 : PyObject *in_obj = NULL;
1302 0 : union nbtd_info *in = NULL;
1303 :
1304 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1305 : discard_const_p(char *, kwnames),
1306 : &mem_ctx_obj,
1307 : &level,
1308 : &in_obj)) {
1309 0 : return NULL;
1310 : }
1311 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1312 0 : if (mem_ctx == NULL) {
1313 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1314 0 : return NULL;
1315 : }
1316 0 : in = (union nbtd_info *)pytalloc_get_ptr(in_obj);
1317 0 : if (in == NULL) {
1318 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union nbtd_info!");
1319 0 : return NULL;
1320 : }
1321 :
1322 0 : return py_import_nbtd_info(mem_ctx, level, in);
1323 : }
1324 :
1325 0 : static PyObject *py_nbtd_info_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1326 : {
1327 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1328 0 : PyObject *mem_ctx_obj = NULL;
1329 0 : TALLOC_CTX *mem_ctx = NULL;
1330 0 : int level = 0;
1331 0 : PyObject *in = NULL;
1332 0 : union nbtd_info *out = NULL;
1333 :
1334 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1335 : discard_const_p(char *, kwnames),
1336 : &mem_ctx_obj,
1337 : &level,
1338 : &in)) {
1339 0 : return NULL;
1340 : }
1341 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1342 0 : if (mem_ctx == NULL) {
1343 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1344 0 : return NULL;
1345 : }
1346 :
1347 0 : out = py_export_nbtd_info(mem_ctx, level, in);
1348 0 : if (out == NULL) {
1349 0 : return NULL;
1350 : }
1351 :
1352 0 : return pytalloc_GenericObject_reference(out);
1353 : }
1354 :
1355 : static PyMethodDef py_nbtd_info_methods[] = {
1356 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_info_import),
1357 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1358 : "T.__import__(mem_ctx, level, in) => ret." },
1359 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_info_export),
1360 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1361 : "T.__export__(mem_ctx, level, in) => ret." },
1362 : { NULL, NULL, 0, NULL }
1363 : };
1364 :
1365 0 : static PyObject *py_nbtd_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1366 : {
1367 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1368 0 : return NULL;
1369 : }
1370 :
1371 :
1372 : static PyTypeObject nbtd_info_Type = {
1373 : PyVarObject_HEAD_INIT(NULL, 0)
1374 : .tp_name = "irpc.nbtd_info",
1375 : .tp_getset = NULL,
1376 : .tp_methods = py_nbtd_info_methods,
1377 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1378 : .tp_new = py_nbtd_info_new,
1379 : };
1380 :
1381 :
1382 0 : static PyObject *py_nbtd_proxy_wins_addr_get_addr(PyObject *obj, void *closure)
1383 : {
1384 0 : struct nbtd_proxy_wins_addr *object = pytalloc_get_ptr(obj);
1385 : PyObject *py_addr;
1386 0 : py_addr = PyString_FromStringOrNULL(object->addr);
1387 0 : return py_addr;
1388 : }
1389 :
1390 0 : static int py_nbtd_proxy_wins_addr_set_addr(PyObject *py_obj, PyObject *value, void *closure)
1391 : {
1392 0 : struct nbtd_proxy_wins_addr *object = pytalloc_get_ptr(py_obj);
1393 0 : if (value == NULL) {
1394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->addr");
1395 0 : return -1;
1396 : }
1397 : {
1398 : const char *test_str;
1399 : const char *talloc_str;
1400 0 : PyObject *unicode = NULL;
1401 0 : if (PyUnicode_Check(value)) {
1402 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1403 0 : if (unicode == NULL) {
1404 0 : return -1;
1405 : }
1406 0 : test_str = PyBytes_AS_STRING(unicode);
1407 0 : } else if (PyBytes_Check(value)) {
1408 0 : test_str = PyBytes_AS_STRING(value);
1409 : } else {
1410 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1411 0 : return -1;
1412 : }
1413 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1414 0 : if (unicode != NULL) {
1415 0 : Py_DECREF(unicode);
1416 : }
1417 0 : if (talloc_str == NULL) {
1418 0 : PyErr_NoMemory();
1419 0 : return -1;
1420 : }
1421 0 : object->addr = talloc_str;
1422 : }
1423 0 : return 0;
1424 : }
1425 :
1426 : static PyGetSetDef py_nbtd_proxy_wins_addr_getsetters[] = {
1427 : {
1428 : .name = discard_const_p(char, "addr"),
1429 : .get = py_nbtd_proxy_wins_addr_get_addr,
1430 : .set = py_nbtd_proxy_wins_addr_set_addr,
1431 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
1432 : },
1433 : { .name = NULL }
1434 : };
1435 :
1436 0 : static PyObject *py_nbtd_proxy_wins_addr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1437 : {
1438 0 : return pytalloc_new(struct nbtd_proxy_wins_addr, type);
1439 : }
1440 :
1441 :
1442 : static PyTypeObject nbtd_proxy_wins_addr_Type = {
1443 : PyVarObject_HEAD_INIT(NULL, 0)
1444 : .tp_name = "irpc.nbtd_proxy_wins_addr",
1445 : .tp_getset = py_nbtd_proxy_wins_addr_getsetters,
1446 : .tp_methods = NULL,
1447 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1448 : .tp_new = py_nbtd_proxy_wins_addr_new,
1449 : };
1450 :
1451 :
1452 0 : static PyObject *py_smbsrv_session_info_get_vuid(PyObject *obj, void *closure)
1453 : {
1454 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(obj);
1455 : PyObject *py_vuid;
1456 0 : py_vuid = PyLong_FromUnsignedLongLong(object->vuid);
1457 0 : return py_vuid;
1458 : }
1459 :
1460 0 : static int py_smbsrv_session_info_set_vuid(PyObject *py_obj, PyObject *value, void *closure)
1461 : {
1462 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(py_obj);
1463 0 : if (value == NULL) {
1464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->vuid");
1465 0 : return -1;
1466 : }
1467 : {
1468 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vuid));
1469 0 : if (PyLong_Check(value)) {
1470 : unsigned long long test_var;
1471 0 : test_var = PyLong_AsUnsignedLongLong(value);
1472 0 : if (PyErr_Occurred() != NULL) {
1473 0 : return -1;
1474 : }
1475 0 : if (test_var > uint_max) {
1476 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1477 : PyLong_Type.tp_name, uint_max, test_var);
1478 0 : return -1;
1479 : }
1480 0 : object->vuid = test_var;
1481 : } else {
1482 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1483 : PyLong_Type.tp_name);
1484 0 : return -1;
1485 : }
1486 : }
1487 0 : return 0;
1488 : }
1489 :
1490 0 : static PyObject *py_smbsrv_session_info_get_account_name(PyObject *obj, void *closure)
1491 : {
1492 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(obj);
1493 : PyObject *py_account_name;
1494 0 : py_account_name = PyString_FromStringOrNULL(object->account_name);
1495 0 : return py_account_name;
1496 : }
1497 :
1498 0 : static int py_smbsrv_session_info_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
1499 : {
1500 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(py_obj);
1501 0 : if (value == NULL) {
1502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->account_name");
1503 0 : return -1;
1504 : }
1505 : {
1506 : const char *test_str;
1507 : const char *talloc_str;
1508 0 : PyObject *unicode = NULL;
1509 0 : if (PyUnicode_Check(value)) {
1510 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1511 0 : if (unicode == NULL) {
1512 0 : return -1;
1513 : }
1514 0 : test_str = PyBytes_AS_STRING(unicode);
1515 0 : } else if (PyBytes_Check(value)) {
1516 0 : test_str = PyBytes_AS_STRING(value);
1517 : } else {
1518 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1519 0 : return -1;
1520 : }
1521 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1522 0 : if (unicode != NULL) {
1523 0 : Py_DECREF(unicode);
1524 : }
1525 0 : if (talloc_str == NULL) {
1526 0 : PyErr_NoMemory();
1527 0 : return -1;
1528 : }
1529 0 : object->account_name = talloc_str;
1530 : }
1531 0 : return 0;
1532 : }
1533 :
1534 0 : static PyObject *py_smbsrv_session_info_get_domain_name(PyObject *obj, void *closure)
1535 : {
1536 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(obj);
1537 : PyObject *py_domain_name;
1538 0 : py_domain_name = PyString_FromStringOrNULL(object->domain_name);
1539 0 : return py_domain_name;
1540 : }
1541 :
1542 0 : static int py_smbsrv_session_info_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
1543 : {
1544 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(py_obj);
1545 0 : if (value == NULL) {
1546 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_name");
1547 0 : return -1;
1548 : }
1549 : {
1550 : const char *test_str;
1551 : const char *talloc_str;
1552 0 : PyObject *unicode = NULL;
1553 0 : if (PyUnicode_Check(value)) {
1554 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1555 0 : if (unicode == NULL) {
1556 0 : return -1;
1557 : }
1558 0 : test_str = PyBytes_AS_STRING(unicode);
1559 0 : } else if (PyBytes_Check(value)) {
1560 0 : test_str = PyBytes_AS_STRING(value);
1561 : } else {
1562 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1563 0 : return -1;
1564 : }
1565 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1566 0 : if (unicode != NULL) {
1567 0 : Py_DECREF(unicode);
1568 : }
1569 0 : if (talloc_str == NULL) {
1570 0 : PyErr_NoMemory();
1571 0 : return -1;
1572 : }
1573 0 : object->domain_name = talloc_str;
1574 : }
1575 0 : return 0;
1576 : }
1577 :
1578 0 : static PyObject *py_smbsrv_session_info_get_client_ip(PyObject *obj, void *closure)
1579 : {
1580 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(obj);
1581 : PyObject *py_client_ip;
1582 0 : py_client_ip = PyString_FromStringOrNULL(object->client_ip);
1583 0 : return py_client_ip;
1584 : }
1585 :
1586 0 : static int py_smbsrv_session_info_set_client_ip(PyObject *py_obj, PyObject *value, void *closure)
1587 : {
1588 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(py_obj);
1589 0 : if (value == NULL) {
1590 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->client_ip");
1591 0 : return -1;
1592 : }
1593 : {
1594 : const char *test_str;
1595 : const char *talloc_str;
1596 0 : PyObject *unicode = NULL;
1597 0 : if (PyUnicode_Check(value)) {
1598 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1599 0 : if (unicode == NULL) {
1600 0 : return -1;
1601 : }
1602 0 : test_str = PyBytes_AS_STRING(unicode);
1603 0 : } else if (PyBytes_Check(value)) {
1604 0 : test_str = PyBytes_AS_STRING(value);
1605 : } else {
1606 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1607 0 : return -1;
1608 : }
1609 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1610 0 : if (unicode != NULL) {
1611 0 : Py_DECREF(unicode);
1612 : }
1613 0 : if (talloc_str == NULL) {
1614 0 : PyErr_NoMemory();
1615 0 : return -1;
1616 : }
1617 0 : object->client_ip = talloc_str;
1618 : }
1619 0 : return 0;
1620 : }
1621 :
1622 0 : static PyObject *py_smbsrv_session_info_get_connect_time(PyObject *obj, void *closure)
1623 : {
1624 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(obj);
1625 : PyObject *py_connect_time;
1626 0 : py_connect_time = PyLong_FromUnsignedLongLong(object->connect_time);
1627 0 : return py_connect_time;
1628 : }
1629 :
1630 0 : static int py_smbsrv_session_info_set_connect_time(PyObject *py_obj, PyObject *value, void *closure)
1631 : {
1632 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(py_obj);
1633 0 : if (value == NULL) {
1634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->connect_time");
1635 0 : return -1;
1636 : }
1637 : {
1638 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->connect_time));
1639 0 : if (PyLong_Check(value)) {
1640 : unsigned long long test_var;
1641 0 : test_var = PyLong_AsUnsignedLongLong(value);
1642 0 : if (PyErr_Occurred() != NULL) {
1643 0 : return -1;
1644 : }
1645 0 : if (test_var > uint_max) {
1646 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1647 : PyLong_Type.tp_name, uint_max, test_var);
1648 0 : return -1;
1649 : }
1650 0 : object->connect_time = test_var;
1651 : } else {
1652 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1653 : PyLong_Type.tp_name);
1654 0 : return -1;
1655 : }
1656 : }
1657 0 : return 0;
1658 : }
1659 :
1660 0 : static PyObject *py_smbsrv_session_info_get_auth_time(PyObject *obj, void *closure)
1661 : {
1662 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(obj);
1663 : PyObject *py_auth_time;
1664 0 : py_auth_time = PyLong_FromUnsignedLongLong(object->auth_time);
1665 0 : return py_auth_time;
1666 : }
1667 :
1668 0 : static int py_smbsrv_session_info_set_auth_time(PyObject *py_obj, PyObject *value, void *closure)
1669 : {
1670 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(py_obj);
1671 0 : if (value == NULL) {
1672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_time");
1673 0 : return -1;
1674 : }
1675 : {
1676 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_time));
1677 0 : if (PyLong_Check(value)) {
1678 : unsigned long long test_var;
1679 0 : test_var = PyLong_AsUnsignedLongLong(value);
1680 0 : if (PyErr_Occurred() != NULL) {
1681 0 : return -1;
1682 : }
1683 0 : if (test_var > uint_max) {
1684 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1685 : PyLong_Type.tp_name, uint_max, test_var);
1686 0 : return -1;
1687 : }
1688 0 : object->auth_time = test_var;
1689 : } else {
1690 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1691 : PyLong_Type.tp_name);
1692 0 : return -1;
1693 : }
1694 : }
1695 0 : return 0;
1696 : }
1697 :
1698 0 : static PyObject *py_smbsrv_session_info_get_last_use_time(PyObject *obj, void *closure)
1699 : {
1700 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(obj);
1701 : PyObject *py_last_use_time;
1702 0 : py_last_use_time = PyLong_FromUnsignedLongLong(object->last_use_time);
1703 0 : return py_last_use_time;
1704 : }
1705 :
1706 0 : static int py_smbsrv_session_info_set_last_use_time(PyObject *py_obj, PyObject *value, void *closure)
1707 : {
1708 0 : struct smbsrv_session_info *object = pytalloc_get_ptr(py_obj);
1709 0 : if (value == NULL) {
1710 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->last_use_time");
1711 0 : return -1;
1712 : }
1713 : {
1714 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_use_time));
1715 0 : if (PyLong_Check(value)) {
1716 : unsigned long long test_var;
1717 0 : test_var = PyLong_AsUnsignedLongLong(value);
1718 0 : if (PyErr_Occurred() != NULL) {
1719 0 : return -1;
1720 : }
1721 0 : if (test_var > uint_max) {
1722 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1723 : PyLong_Type.tp_name, uint_max, test_var);
1724 0 : return -1;
1725 : }
1726 0 : object->last_use_time = test_var;
1727 : } else {
1728 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1729 : PyLong_Type.tp_name);
1730 0 : return -1;
1731 : }
1732 : }
1733 0 : return 0;
1734 : }
1735 :
1736 : static PyGetSetDef py_smbsrv_session_info_getsetters[] = {
1737 : {
1738 : .name = discard_const_p(char, "vuid"),
1739 : .get = py_smbsrv_session_info_get_vuid,
1740 : .set = py_smbsrv_session_info_set_vuid,
1741 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1742 : },
1743 : {
1744 : .name = discard_const_p(char, "account_name"),
1745 : .get = py_smbsrv_session_info_get_account_name,
1746 : .set = py_smbsrv_session_info_set_account_name,
1747 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1748 : },
1749 : {
1750 : .name = discard_const_p(char, "domain_name"),
1751 : .get = py_smbsrv_session_info_get_domain_name,
1752 : .set = py_smbsrv_session_info_set_domain_name,
1753 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1754 : },
1755 : {
1756 : .name = discard_const_p(char, "client_ip"),
1757 : .get = py_smbsrv_session_info_get_client_ip,
1758 : .set = py_smbsrv_session_info_set_client_ip,
1759 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1760 : },
1761 : {
1762 : .name = discard_const_p(char, "connect_time"),
1763 : .get = py_smbsrv_session_info_get_connect_time,
1764 : .set = py_smbsrv_session_info_set_connect_time,
1765 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1766 : },
1767 : {
1768 : .name = discard_const_p(char, "auth_time"),
1769 : .get = py_smbsrv_session_info_get_auth_time,
1770 : .set = py_smbsrv_session_info_set_auth_time,
1771 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1772 : },
1773 : {
1774 : .name = discard_const_p(char, "last_use_time"),
1775 : .get = py_smbsrv_session_info_get_last_use_time,
1776 : .set = py_smbsrv_session_info_set_last_use_time,
1777 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1778 : },
1779 : { .name = NULL }
1780 : };
1781 :
1782 0 : static PyObject *py_smbsrv_session_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1783 : {
1784 0 : return pytalloc_new(struct smbsrv_session_info, type);
1785 : }
1786 :
1787 :
1788 : static PyTypeObject smbsrv_session_info_Type = {
1789 : PyVarObject_HEAD_INIT(NULL, 0)
1790 : .tp_name = "irpc.smbsrv_session_info",
1791 : .tp_getset = py_smbsrv_session_info_getsetters,
1792 : .tp_methods = NULL,
1793 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1794 : .tp_new = py_smbsrv_session_info_new,
1795 : };
1796 :
1797 :
1798 0 : static PyObject *py_smbsrv_sessions_get_num_sessions(PyObject *obj, void *closure)
1799 : {
1800 0 : struct smbsrv_sessions *object = pytalloc_get_ptr(obj);
1801 : PyObject *py_num_sessions;
1802 0 : py_num_sessions = PyLong_FromUnsignedLongLong((uint32_t)(object->num_sessions));
1803 0 : return py_num_sessions;
1804 : }
1805 :
1806 0 : static int py_smbsrv_sessions_set_num_sessions(PyObject *py_obj, PyObject *value, void *closure)
1807 : {
1808 0 : struct smbsrv_sessions *object = pytalloc_get_ptr(py_obj);
1809 0 : if (value == NULL) {
1810 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_sessions");
1811 0 : return -1;
1812 : }
1813 : {
1814 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sessions));
1815 0 : if (PyLong_Check(value)) {
1816 : unsigned long long test_var;
1817 0 : test_var = PyLong_AsUnsignedLongLong(value);
1818 0 : if (PyErr_Occurred() != NULL) {
1819 0 : return -1;
1820 : }
1821 0 : if (test_var > uint_max) {
1822 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1823 : PyLong_Type.tp_name, uint_max, test_var);
1824 0 : return -1;
1825 : }
1826 0 : object->num_sessions = test_var;
1827 : } else {
1828 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1829 : PyLong_Type.tp_name);
1830 0 : return -1;
1831 : }
1832 : }
1833 0 : return 0;
1834 : }
1835 :
1836 0 : static PyObject *py_smbsrv_sessions_get_sessions(PyObject *obj, void *closure)
1837 : {
1838 0 : struct smbsrv_sessions *object = pytalloc_get_ptr(obj);
1839 : PyObject *py_sessions;
1840 0 : if (object->sessions == NULL) {
1841 0 : Py_RETURN_NONE;
1842 : }
1843 0 : if (object->sessions == NULL) {
1844 0 : py_sessions = Py_None;
1845 0 : Py_INCREF(py_sessions);
1846 : } else {
1847 0 : py_sessions = PyList_New(object->num_sessions);
1848 0 : if (py_sessions == NULL) {
1849 0 : return NULL;
1850 : }
1851 : {
1852 : int sessions_cntr_1;
1853 0 : for (sessions_cntr_1 = 0; sessions_cntr_1 < (object->num_sessions); sessions_cntr_1++) {
1854 : PyObject *py_sessions_1;
1855 0 : py_sessions_1 = pytalloc_reference_ex(&smbsrv_session_info_Type, object->sessions, &(object->sessions)[sessions_cntr_1]);
1856 0 : PyList_SetItem(py_sessions, sessions_cntr_1, py_sessions_1);
1857 : }
1858 : }
1859 : }
1860 0 : return py_sessions;
1861 : }
1862 :
1863 0 : static int py_smbsrv_sessions_set_sessions(PyObject *py_obj, PyObject *value, void *closure)
1864 : {
1865 0 : struct smbsrv_sessions *object = pytalloc_get_ptr(py_obj);
1866 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sessions));
1867 0 : if (value == NULL) {
1868 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sessions");
1869 0 : return -1;
1870 : }
1871 0 : if (value == Py_None) {
1872 0 : object->sessions = NULL;
1873 : } else {
1874 0 : object->sessions = NULL;
1875 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1876 : {
1877 : int sessions_cntr_1;
1878 0 : object->sessions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sessions, PyList_GET_SIZE(value));
1879 0 : if (!object->sessions) { return -1; }
1880 0 : talloc_set_name_const(object->sessions, "ARRAY: object->sessions");
1881 0 : for (sessions_cntr_1 = 0; sessions_cntr_1 < PyList_GET_SIZE(value); sessions_cntr_1++) {
1882 0 : if (PyList_GET_ITEM(value, sessions_cntr_1) == NULL) {
1883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->sessions)[sessions_cntr_1]");
1884 0 : return -1;
1885 : }
1886 0 : PY_CHECK_TYPE(&smbsrv_session_info_Type, PyList_GET_ITEM(value, sessions_cntr_1), return -1;);
1887 0 : if (talloc_reference(object->sessions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sessions_cntr_1))) == NULL) {
1888 0 : PyErr_NoMemory();
1889 0 : return -1;
1890 : }
1891 0 : (object->sessions)[sessions_cntr_1] = *(struct smbsrv_session_info *)pytalloc_get_ptr(PyList_GET_ITEM(value, sessions_cntr_1));
1892 : }
1893 : }
1894 : }
1895 0 : return 0;
1896 : }
1897 :
1898 : static PyGetSetDef py_smbsrv_sessions_getsetters[] = {
1899 : {
1900 : .name = discard_const_p(char, "num_sessions"),
1901 : .get = py_smbsrv_sessions_get_num_sessions,
1902 : .set = py_smbsrv_sessions_set_num_sessions,
1903 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1904 : },
1905 : {
1906 : .name = discard_const_p(char, "sessions"),
1907 : .get = py_smbsrv_sessions_get_sessions,
1908 : .set = py_smbsrv_sessions_set_sessions,
1909 : .doc = discard_const_p(char, "PIDL-generated element of base type smbsrv_session_info")
1910 : },
1911 : { .name = NULL }
1912 : };
1913 :
1914 0 : static PyObject *py_smbsrv_sessions_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1915 : {
1916 0 : return pytalloc_new(struct smbsrv_sessions, type);
1917 : }
1918 :
1919 :
1920 : static PyTypeObject smbsrv_sessions_Type = {
1921 : PyVarObject_HEAD_INIT(NULL, 0)
1922 : .tp_name = "irpc.smbsrv_sessions",
1923 : .tp_getset = py_smbsrv_sessions_getsetters,
1924 : .tp_methods = NULL,
1925 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1926 : .tp_new = py_smbsrv_sessions_new,
1927 : };
1928 :
1929 :
1930 0 : static PyObject *py_smbsrv_tcon_info_get_tid(PyObject *obj, void *closure)
1931 : {
1932 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(obj);
1933 : PyObject *py_tid;
1934 0 : py_tid = PyLong_FromUnsignedLongLong((uint32_t)(object->tid));
1935 0 : return py_tid;
1936 : }
1937 :
1938 0 : static int py_smbsrv_tcon_info_set_tid(PyObject *py_obj, PyObject *value, void *closure)
1939 : {
1940 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(py_obj);
1941 0 : if (value == NULL) {
1942 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->tid");
1943 0 : return -1;
1944 : }
1945 : {
1946 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tid));
1947 0 : if (PyLong_Check(value)) {
1948 : unsigned long long test_var;
1949 0 : test_var = PyLong_AsUnsignedLongLong(value);
1950 0 : if (PyErr_Occurred() != NULL) {
1951 0 : return -1;
1952 : }
1953 0 : if (test_var > uint_max) {
1954 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1955 : PyLong_Type.tp_name, uint_max, test_var);
1956 0 : return -1;
1957 : }
1958 0 : object->tid = test_var;
1959 : } else {
1960 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1961 : PyLong_Type.tp_name);
1962 0 : return -1;
1963 : }
1964 : }
1965 0 : return 0;
1966 : }
1967 :
1968 0 : static PyObject *py_smbsrv_tcon_info_get_share_name(PyObject *obj, void *closure)
1969 : {
1970 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(obj);
1971 : PyObject *py_share_name;
1972 0 : py_share_name = PyString_FromStringOrNULL(object->share_name);
1973 0 : return py_share_name;
1974 : }
1975 :
1976 0 : static int py_smbsrv_tcon_info_set_share_name(PyObject *py_obj, PyObject *value, void *closure)
1977 : {
1978 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(py_obj);
1979 0 : if (value == NULL) {
1980 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->share_name");
1981 0 : return -1;
1982 : }
1983 : {
1984 : const char *test_str;
1985 : const char *talloc_str;
1986 0 : PyObject *unicode = NULL;
1987 0 : if (PyUnicode_Check(value)) {
1988 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1989 0 : if (unicode == NULL) {
1990 0 : return -1;
1991 : }
1992 0 : test_str = PyBytes_AS_STRING(unicode);
1993 0 : } else if (PyBytes_Check(value)) {
1994 0 : test_str = PyBytes_AS_STRING(value);
1995 : } else {
1996 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1997 0 : return -1;
1998 : }
1999 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2000 0 : if (unicode != NULL) {
2001 0 : Py_DECREF(unicode);
2002 : }
2003 0 : if (talloc_str == NULL) {
2004 0 : PyErr_NoMemory();
2005 0 : return -1;
2006 : }
2007 0 : object->share_name = talloc_str;
2008 : }
2009 0 : return 0;
2010 : }
2011 :
2012 0 : static PyObject *py_smbsrv_tcon_info_get_client_ip(PyObject *obj, void *closure)
2013 : {
2014 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(obj);
2015 : PyObject *py_client_ip;
2016 0 : py_client_ip = PyString_FromStringOrNULL(object->client_ip);
2017 0 : return py_client_ip;
2018 : }
2019 :
2020 0 : static int py_smbsrv_tcon_info_set_client_ip(PyObject *py_obj, PyObject *value, void *closure)
2021 : {
2022 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(py_obj);
2023 0 : if (value == NULL) {
2024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->client_ip");
2025 0 : return -1;
2026 : }
2027 : {
2028 : const char *test_str;
2029 : const char *talloc_str;
2030 0 : PyObject *unicode = NULL;
2031 0 : if (PyUnicode_Check(value)) {
2032 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2033 0 : if (unicode == NULL) {
2034 0 : return -1;
2035 : }
2036 0 : test_str = PyBytes_AS_STRING(unicode);
2037 0 : } else if (PyBytes_Check(value)) {
2038 0 : test_str = PyBytes_AS_STRING(value);
2039 : } else {
2040 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2041 0 : return -1;
2042 : }
2043 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2044 0 : if (unicode != NULL) {
2045 0 : Py_DECREF(unicode);
2046 : }
2047 0 : if (talloc_str == NULL) {
2048 0 : PyErr_NoMemory();
2049 0 : return -1;
2050 : }
2051 0 : object->client_ip = talloc_str;
2052 : }
2053 0 : return 0;
2054 : }
2055 :
2056 0 : static PyObject *py_smbsrv_tcon_info_get_connect_time(PyObject *obj, void *closure)
2057 : {
2058 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(obj);
2059 : PyObject *py_connect_time;
2060 0 : py_connect_time = PyLong_FromUnsignedLongLong(object->connect_time);
2061 0 : return py_connect_time;
2062 : }
2063 :
2064 0 : static int py_smbsrv_tcon_info_set_connect_time(PyObject *py_obj, PyObject *value, void *closure)
2065 : {
2066 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(py_obj);
2067 0 : if (value == NULL) {
2068 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->connect_time");
2069 0 : return -1;
2070 : }
2071 : {
2072 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->connect_time));
2073 0 : if (PyLong_Check(value)) {
2074 : unsigned long long test_var;
2075 0 : test_var = PyLong_AsUnsignedLongLong(value);
2076 0 : if (PyErr_Occurred() != NULL) {
2077 0 : return -1;
2078 : }
2079 0 : if (test_var > uint_max) {
2080 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2081 : PyLong_Type.tp_name, uint_max, test_var);
2082 0 : return -1;
2083 : }
2084 0 : object->connect_time = test_var;
2085 : } else {
2086 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2087 : PyLong_Type.tp_name);
2088 0 : return -1;
2089 : }
2090 : }
2091 0 : return 0;
2092 : }
2093 :
2094 0 : static PyObject *py_smbsrv_tcon_info_get_last_use_time(PyObject *obj, void *closure)
2095 : {
2096 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(obj);
2097 : PyObject *py_last_use_time;
2098 0 : py_last_use_time = PyLong_FromUnsignedLongLong(object->last_use_time);
2099 0 : return py_last_use_time;
2100 : }
2101 :
2102 0 : static int py_smbsrv_tcon_info_set_last_use_time(PyObject *py_obj, PyObject *value, void *closure)
2103 : {
2104 0 : struct smbsrv_tcon_info *object = pytalloc_get_ptr(py_obj);
2105 0 : if (value == NULL) {
2106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->last_use_time");
2107 0 : return -1;
2108 : }
2109 : {
2110 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_use_time));
2111 0 : if (PyLong_Check(value)) {
2112 : unsigned long long test_var;
2113 0 : test_var = PyLong_AsUnsignedLongLong(value);
2114 0 : if (PyErr_Occurred() != NULL) {
2115 0 : return -1;
2116 : }
2117 0 : if (test_var > uint_max) {
2118 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2119 : PyLong_Type.tp_name, uint_max, test_var);
2120 0 : return -1;
2121 : }
2122 0 : object->last_use_time = test_var;
2123 : } else {
2124 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2125 : PyLong_Type.tp_name);
2126 0 : return -1;
2127 : }
2128 : }
2129 0 : return 0;
2130 : }
2131 :
2132 : static PyGetSetDef py_smbsrv_tcon_info_getsetters[] = {
2133 : {
2134 : .name = discard_const_p(char, "tid"),
2135 : .get = py_smbsrv_tcon_info_get_tid,
2136 : .set = py_smbsrv_tcon_info_set_tid,
2137 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2138 : },
2139 : {
2140 : .name = discard_const_p(char, "share_name"),
2141 : .get = py_smbsrv_tcon_info_get_share_name,
2142 : .set = py_smbsrv_tcon_info_set_share_name,
2143 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2144 : },
2145 : {
2146 : .name = discard_const_p(char, "client_ip"),
2147 : .get = py_smbsrv_tcon_info_get_client_ip,
2148 : .set = py_smbsrv_tcon_info_set_client_ip,
2149 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
2150 : },
2151 : {
2152 : .name = discard_const_p(char, "connect_time"),
2153 : .get = py_smbsrv_tcon_info_get_connect_time,
2154 : .set = py_smbsrv_tcon_info_set_connect_time,
2155 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
2156 : },
2157 : {
2158 : .name = discard_const_p(char, "last_use_time"),
2159 : .get = py_smbsrv_tcon_info_get_last_use_time,
2160 : .set = py_smbsrv_tcon_info_set_last_use_time,
2161 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
2162 : },
2163 : { .name = NULL }
2164 : };
2165 :
2166 0 : static PyObject *py_smbsrv_tcon_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2167 : {
2168 0 : return pytalloc_new(struct smbsrv_tcon_info, type);
2169 : }
2170 :
2171 :
2172 : static PyTypeObject smbsrv_tcon_info_Type = {
2173 : PyVarObject_HEAD_INIT(NULL, 0)
2174 : .tp_name = "irpc.smbsrv_tcon_info",
2175 : .tp_getset = py_smbsrv_tcon_info_getsetters,
2176 : .tp_methods = NULL,
2177 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2178 : .tp_new = py_smbsrv_tcon_info_new,
2179 : };
2180 :
2181 :
2182 0 : static PyObject *py_smbsrv_tcons_get_num_tcons(PyObject *obj, void *closure)
2183 : {
2184 0 : struct smbsrv_tcons *object = pytalloc_get_ptr(obj);
2185 : PyObject *py_num_tcons;
2186 0 : py_num_tcons = PyLong_FromUnsignedLongLong((uint32_t)(object->num_tcons));
2187 0 : return py_num_tcons;
2188 : }
2189 :
2190 0 : static int py_smbsrv_tcons_set_num_tcons(PyObject *py_obj, PyObject *value, void *closure)
2191 : {
2192 0 : struct smbsrv_tcons *object = pytalloc_get_ptr(py_obj);
2193 0 : if (value == NULL) {
2194 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_tcons");
2195 0 : return -1;
2196 : }
2197 : {
2198 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_tcons));
2199 0 : if (PyLong_Check(value)) {
2200 : unsigned long long test_var;
2201 0 : test_var = PyLong_AsUnsignedLongLong(value);
2202 0 : if (PyErr_Occurred() != NULL) {
2203 0 : return -1;
2204 : }
2205 0 : if (test_var > uint_max) {
2206 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2207 : PyLong_Type.tp_name, uint_max, test_var);
2208 0 : return -1;
2209 : }
2210 0 : object->num_tcons = test_var;
2211 : } else {
2212 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2213 : PyLong_Type.tp_name);
2214 0 : return -1;
2215 : }
2216 : }
2217 0 : return 0;
2218 : }
2219 :
2220 0 : static PyObject *py_smbsrv_tcons_get_tcons(PyObject *obj, void *closure)
2221 : {
2222 0 : struct smbsrv_tcons *object = pytalloc_get_ptr(obj);
2223 : PyObject *py_tcons;
2224 0 : if (object->tcons == NULL) {
2225 0 : Py_RETURN_NONE;
2226 : }
2227 0 : if (object->tcons == NULL) {
2228 0 : py_tcons = Py_None;
2229 0 : Py_INCREF(py_tcons);
2230 : } else {
2231 0 : py_tcons = PyList_New(object->num_tcons);
2232 0 : if (py_tcons == NULL) {
2233 0 : return NULL;
2234 : }
2235 : {
2236 : int tcons_cntr_1;
2237 0 : for (tcons_cntr_1 = 0; tcons_cntr_1 < (object->num_tcons); tcons_cntr_1++) {
2238 : PyObject *py_tcons_1;
2239 0 : py_tcons_1 = pytalloc_reference_ex(&smbsrv_tcon_info_Type, object->tcons, &(object->tcons)[tcons_cntr_1]);
2240 0 : PyList_SetItem(py_tcons, tcons_cntr_1, py_tcons_1);
2241 : }
2242 : }
2243 : }
2244 0 : return py_tcons;
2245 : }
2246 :
2247 0 : static int py_smbsrv_tcons_set_tcons(PyObject *py_obj, PyObject *value, void *closure)
2248 : {
2249 0 : struct smbsrv_tcons *object = pytalloc_get_ptr(py_obj);
2250 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->tcons));
2251 0 : if (value == NULL) {
2252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->tcons");
2253 0 : return -1;
2254 : }
2255 0 : if (value == Py_None) {
2256 0 : object->tcons = NULL;
2257 : } else {
2258 0 : object->tcons = NULL;
2259 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2260 : {
2261 : int tcons_cntr_1;
2262 0 : object->tcons = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->tcons, PyList_GET_SIZE(value));
2263 0 : if (!object->tcons) { return -1; }
2264 0 : talloc_set_name_const(object->tcons, "ARRAY: object->tcons");
2265 0 : for (tcons_cntr_1 = 0; tcons_cntr_1 < PyList_GET_SIZE(value); tcons_cntr_1++) {
2266 0 : if (PyList_GET_ITEM(value, tcons_cntr_1) == NULL) {
2267 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->tcons)[tcons_cntr_1]");
2268 0 : return -1;
2269 : }
2270 0 : PY_CHECK_TYPE(&smbsrv_tcon_info_Type, PyList_GET_ITEM(value, tcons_cntr_1), return -1;);
2271 0 : if (talloc_reference(object->tcons, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, tcons_cntr_1))) == NULL) {
2272 0 : PyErr_NoMemory();
2273 0 : return -1;
2274 : }
2275 0 : (object->tcons)[tcons_cntr_1] = *(struct smbsrv_tcon_info *)pytalloc_get_ptr(PyList_GET_ITEM(value, tcons_cntr_1));
2276 : }
2277 : }
2278 : }
2279 0 : return 0;
2280 : }
2281 :
2282 : static PyGetSetDef py_smbsrv_tcons_getsetters[] = {
2283 : {
2284 : .name = discard_const_p(char, "num_tcons"),
2285 : .get = py_smbsrv_tcons_get_num_tcons,
2286 : .set = py_smbsrv_tcons_set_num_tcons,
2287 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2288 : },
2289 : {
2290 : .name = discard_const_p(char, "tcons"),
2291 : .get = py_smbsrv_tcons_get_tcons,
2292 : .set = py_smbsrv_tcons_set_tcons,
2293 : .doc = discard_const_p(char, "PIDL-generated element of base type smbsrv_tcon_info")
2294 : },
2295 : { .name = NULL }
2296 : };
2297 :
2298 0 : static PyObject *py_smbsrv_tcons_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2299 : {
2300 0 : return pytalloc_new(struct smbsrv_tcons, type);
2301 : }
2302 :
2303 :
2304 : static PyTypeObject smbsrv_tcons_Type = {
2305 : PyVarObject_HEAD_INIT(NULL, 0)
2306 : .tp_name = "irpc.smbsrv_tcons",
2307 : .tp_getset = py_smbsrv_tcons_getsetters,
2308 : .tp_methods = NULL,
2309 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2310 : .tp_new = py_smbsrv_tcons_new,
2311 : };
2312 :
2313 0 : static PyObject *py_import_smbsrv_info(TALLOC_CTX *mem_ctx, int level, union smbsrv_info *in)
2314 : {
2315 : PyObject *ret;
2316 :
2317 0 : switch (level) {
2318 0 : case SMBSRV_INFO_SESSIONS:
2319 0 : ret = pytalloc_reference_ex(&smbsrv_sessions_Type, mem_ctx, &in->sessions);
2320 0 : return ret;
2321 :
2322 0 : case SMBSRV_INFO_TCONS:
2323 0 : ret = pytalloc_reference_ex(&smbsrv_tcons_Type, mem_ctx, &in->tcons);
2324 0 : return ret;
2325 :
2326 : }
2327 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
2328 0 : return NULL;
2329 : }
2330 :
2331 0 : static union smbsrv_info *py_export_smbsrv_info(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2332 : {
2333 0 : union smbsrv_info *ret = talloc_zero(mem_ctx, union smbsrv_info);
2334 0 : switch (level) {
2335 0 : case SMBSRV_INFO_SESSIONS:
2336 0 : if (in == NULL) {
2337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->sessions");
2338 0 : talloc_free(ret); return NULL;
2339 : }
2340 0 : PY_CHECK_TYPE(&smbsrv_sessions_Type, in, talloc_free(ret); return NULL;);
2341 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2342 0 : PyErr_NoMemory();
2343 0 : talloc_free(ret); return NULL;
2344 : }
2345 0 : ret->sessions = *(struct smbsrv_sessions *)pytalloc_get_ptr(in);
2346 0 : break;
2347 :
2348 0 : case SMBSRV_INFO_TCONS:
2349 0 : if (in == NULL) {
2350 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->tcons");
2351 0 : talloc_free(ret); return NULL;
2352 : }
2353 0 : PY_CHECK_TYPE(&smbsrv_tcons_Type, in, talloc_free(ret); return NULL;);
2354 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2355 0 : PyErr_NoMemory();
2356 0 : talloc_free(ret); return NULL;
2357 : }
2358 0 : ret->tcons = *(struct smbsrv_tcons *)pytalloc_get_ptr(in);
2359 0 : break;
2360 :
2361 0 : default:
2362 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
2363 0 : talloc_free(ret);
2364 0 : ret = NULL;
2365 : }
2366 :
2367 0 : return ret;
2368 : }
2369 :
2370 0 : static PyObject *py_smbsrv_info_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2371 : {
2372 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2373 0 : PyObject *mem_ctx_obj = NULL;
2374 0 : TALLOC_CTX *mem_ctx = NULL;
2375 0 : int level = 0;
2376 0 : PyObject *in_obj = NULL;
2377 0 : union smbsrv_info *in = NULL;
2378 :
2379 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
2380 : discard_const_p(char *, kwnames),
2381 : &mem_ctx_obj,
2382 : &level,
2383 : &in_obj)) {
2384 0 : return NULL;
2385 : }
2386 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2387 0 : if (mem_ctx == NULL) {
2388 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2389 0 : return NULL;
2390 : }
2391 0 : in = (union smbsrv_info *)pytalloc_get_ptr(in_obj);
2392 0 : if (in == NULL) {
2393 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union smbsrv_info!");
2394 0 : return NULL;
2395 : }
2396 :
2397 0 : return py_import_smbsrv_info(mem_ctx, level, in);
2398 : }
2399 :
2400 0 : static PyObject *py_smbsrv_info_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2401 : {
2402 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2403 0 : PyObject *mem_ctx_obj = NULL;
2404 0 : TALLOC_CTX *mem_ctx = NULL;
2405 0 : int level = 0;
2406 0 : PyObject *in = NULL;
2407 0 : union smbsrv_info *out = NULL;
2408 :
2409 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
2410 : discard_const_p(char *, kwnames),
2411 : &mem_ctx_obj,
2412 : &level,
2413 : &in)) {
2414 0 : return NULL;
2415 : }
2416 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2417 0 : if (mem_ctx == NULL) {
2418 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2419 0 : return NULL;
2420 : }
2421 :
2422 0 : out = py_export_smbsrv_info(mem_ctx, level, in);
2423 0 : if (out == NULL) {
2424 0 : return NULL;
2425 : }
2426 :
2427 0 : return pytalloc_GenericObject_reference(out);
2428 : }
2429 :
2430 : static PyMethodDef py_smbsrv_info_methods[] = {
2431 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smbsrv_info_import),
2432 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2433 : "T.__import__(mem_ctx, level, in) => ret." },
2434 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smbsrv_info_export),
2435 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2436 : "T.__export__(mem_ctx, level, in) => ret." },
2437 : { NULL, NULL, 0, NULL }
2438 : };
2439 :
2440 0 : static PyObject *py_smbsrv_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2441 : {
2442 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
2443 0 : return NULL;
2444 : }
2445 :
2446 :
2447 : static PyTypeObject smbsrv_info_Type = {
2448 : PyVarObject_HEAD_INIT(NULL, 0)
2449 : .tp_name = "irpc.smbsrv_info",
2450 : .tp_getset = NULL,
2451 : .tp_methods = py_smbsrv_info_methods,
2452 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2453 : .tp_new = py_smbsrv_info_new,
2454 : };
2455 :
2456 :
2457 :
2458 0 : static PyObject *py_irpc_uptime_out_get_start_time(PyObject *obj, void *closure)
2459 : {
2460 0 : struct irpc_uptime *object = pytalloc_get_ptr(obj);
2461 : PyObject *py_start_time;
2462 0 : if (object->out.start_time == NULL) {
2463 0 : Py_RETURN_NONE;
2464 : }
2465 0 : py_start_time = PyLong_FromUnsignedLongLong(*object->out.start_time);
2466 0 : return py_start_time;
2467 : }
2468 :
2469 0 : static int py_irpc_uptime_out_set_start_time(PyObject *py_obj, PyObject *value, void *closure)
2470 : {
2471 0 : struct irpc_uptime *object = pytalloc_get_ptr(py_obj);
2472 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.start_time));
2473 0 : if (value == NULL) {
2474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.start_time");
2475 0 : return -1;
2476 : }
2477 0 : object->out.start_time = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.start_time);
2478 0 : if (object->out.start_time == NULL) {
2479 0 : PyErr_NoMemory();
2480 0 : return -1;
2481 : }
2482 : {
2483 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.start_time));
2484 0 : if (PyLong_Check(value)) {
2485 : unsigned long long test_var;
2486 0 : test_var = PyLong_AsUnsignedLongLong(value);
2487 0 : if (PyErr_Occurred() != NULL) {
2488 0 : return -1;
2489 : }
2490 0 : if (test_var > uint_max) {
2491 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2492 : PyLong_Type.tp_name, uint_max, test_var);
2493 0 : return -1;
2494 : }
2495 0 : *object->out.start_time = test_var;
2496 : } else {
2497 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2498 : PyLong_Type.tp_name);
2499 0 : return -1;
2500 : }
2501 : }
2502 0 : return 0;
2503 : }
2504 :
2505 : static PyGetSetDef py_irpc_uptime_getsetters[] = {
2506 : {
2507 : .name = discard_const_p(char, "out_start_time"),
2508 : .get = py_irpc_uptime_out_get_start_time,
2509 : .set = py_irpc_uptime_out_set_start_time,
2510 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
2511 : },
2512 : { .name = NULL }
2513 : };
2514 :
2515 0 : static PyObject *py_irpc_uptime_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2516 : {
2517 0 : PyObject *self = pytalloc_new(struct irpc_uptime, type);
2518 0 : struct irpc_uptime *_self = (struct irpc_uptime *)pytalloc_get_ptr(self);
2519 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
2520 0 : _self->out.start_time = talloc_zero(mem_ctx, NTTIME);
2521 0 : return self;
2522 : }
2523 :
2524 0 : static PyObject *py_irpc_uptime_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
2525 : {
2526 :
2527 :
2528 0 : return PyLong_FromLong(0);
2529 : }
2530 :
2531 0 : static PyObject *py_irpc_uptime_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
2532 : {
2533 0 : const struct ndr_interface_call *call = NULL;
2534 0 : struct irpc_uptime *object = pytalloc_get_ptr(py_obj);
2535 0 : PyObject *ret = NULL;
2536 0 : struct ndr_push *push = NULL;
2537 : DATA_BLOB blob;
2538 : enum ndr_err_code err;
2539 :
2540 0 : if (ndr_table_irpc.num_calls < 1) {
2541 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_irpc_uptime_ndr_pack");
2542 0 : return NULL;
2543 : }
2544 0 : call = &ndr_table_irpc.calls[0];
2545 :
2546 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
2547 0 : if (push == NULL) {
2548 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2549 0 : return NULL;
2550 : }
2551 :
2552 0 : push->flags |= ndr_push_flags;
2553 :
2554 0 : err = call->ndr_push(push, ndr_inout_flags, object);
2555 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2556 0 : TALLOC_FREE(push);
2557 0 : PyErr_SetNdrError(err);
2558 0 : return NULL;
2559 : }
2560 0 : blob = ndr_push_blob(push);
2561 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2562 0 : TALLOC_FREE(push);
2563 0 : return ret;
2564 : }
2565 :
2566 0 : static PyObject *py_irpc_uptime_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2567 : {
2568 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2569 0 : PyObject *bigendian_obj = NULL;
2570 0 : PyObject *ndr64_obj = NULL;
2571 0 : libndr_flags ndr_push_flags = 0;
2572 :
2573 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
2574 : discard_const_p(char *, kwnames),
2575 : &bigendian_obj,
2576 : &ndr64_obj)) {
2577 0 : return NULL;
2578 : }
2579 :
2580 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2581 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2582 : }
2583 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2584 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2585 : }
2586 :
2587 0 : return py_irpc_uptime_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
2588 : }
2589 :
2590 0 : static PyObject *py_irpc_uptime_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2591 : {
2592 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2593 0 : PyObject *bigendian_obj = NULL;
2594 0 : PyObject *ndr64_obj = NULL;
2595 0 : libndr_flags ndr_push_flags = 0;
2596 :
2597 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
2598 : discard_const_p(char *, kwnames),
2599 : &bigendian_obj,
2600 : &ndr64_obj)) {
2601 0 : return NULL;
2602 : }
2603 :
2604 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2605 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2606 : }
2607 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2608 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2609 : }
2610 :
2611 0 : return py_irpc_uptime_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
2612 : }
2613 :
2614 0 : static PyObject *py_irpc_uptime_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
2615 : {
2616 0 : const struct ndr_interface_call *call = NULL;
2617 0 : struct irpc_uptime *object = pytalloc_get_ptr(py_obj);
2618 0 : struct ndr_pull *pull = NULL;
2619 : enum ndr_err_code err;
2620 :
2621 0 : if (ndr_table_irpc.num_calls < 1) {
2622 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_irpc_uptime_ndr_unpack");
2623 0 : return NULL;
2624 : }
2625 0 : call = &ndr_table_irpc.calls[0];
2626 :
2627 0 : pull = ndr_pull_init_blob(blob, object);
2628 0 : if (pull == NULL) {
2629 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2630 0 : return NULL;
2631 : }
2632 :
2633 0 : pull->flags |= ndr_pull_flags;
2634 :
2635 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
2636 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2637 0 : TALLOC_FREE(pull);
2638 0 : PyErr_SetNdrError(err);
2639 0 : return NULL;
2640 : }
2641 0 : if (!allow_remaining) {
2642 : uint32_t highest_ofs;
2643 :
2644 0 : if (pull->offset > pull->relative_highest_offset) {
2645 0 : highest_ofs = pull->offset;
2646 : } else {
2647 0 : highest_ofs = pull->relative_highest_offset;
2648 : }
2649 0 : if (highest_ofs < pull->data_size) {
2650 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
2651 : "not all bytes consumed ofs[%u] size[%u]",
2652 : highest_ofs, pull->data_size);
2653 0 : TALLOC_FREE(pull);
2654 0 : PyErr_SetNdrError(err);
2655 0 : return NULL;
2656 : }
2657 : }
2658 :
2659 0 : TALLOC_FREE(pull);
2660 0 : Py_RETURN_NONE;
2661 : }
2662 :
2663 0 : static PyObject *py_irpc_uptime_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2664 : {
2665 : DATA_BLOB blob;
2666 0 : Py_ssize_t blob_length = 0;
2667 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
2668 0 : PyObject *bigendian_obj = NULL;
2669 0 : PyObject *ndr64_obj = NULL;
2670 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
2671 0 : PyObject *allow_remaining_obj = NULL;
2672 0 : bool allow_remaining = false;
2673 :
2674 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
2675 : discard_const_p(char *, kwnames),
2676 : &blob.data, &blob_length,
2677 : &bigendian_obj,
2678 : &ndr64_obj,
2679 : &allow_remaining_obj)) {
2680 0 : return NULL;
2681 : }
2682 0 : blob.length = blob_length;
2683 :
2684 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2685 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
2686 : }
2687 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2688 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
2689 : }
2690 :
2691 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2692 0 : allow_remaining = true;
2693 : }
2694 :
2695 0 : return py_irpc_uptime_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
2696 : }
2697 :
2698 0 : static PyObject *py_irpc_uptime_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2699 : {
2700 : DATA_BLOB blob;
2701 0 : Py_ssize_t blob_length = 0;
2702 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
2703 0 : PyObject *bigendian_obj = NULL;
2704 0 : PyObject *ndr64_obj = NULL;
2705 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
2706 0 : PyObject *allow_remaining_obj = NULL;
2707 0 : bool allow_remaining = false;
2708 :
2709 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
2710 : discard_const_p(char *, kwnames),
2711 : &blob.data, &blob_length,
2712 : &bigendian_obj,
2713 : &ndr64_obj,
2714 : &allow_remaining_obj)) {
2715 0 : return NULL;
2716 : }
2717 0 : blob.length = blob_length;
2718 :
2719 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2720 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
2721 : }
2722 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2723 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
2724 : }
2725 :
2726 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2727 0 : allow_remaining = true;
2728 : }
2729 :
2730 0 : return py_irpc_uptime_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
2731 : }
2732 :
2733 0 : static PyObject *py_irpc_uptime_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
2734 : {
2735 0 : const struct ndr_interface_call *call = NULL;
2736 0 : struct irpc_uptime *object = pytalloc_get_ptr(py_obj);
2737 : PyObject *ret;
2738 : char *retstr;
2739 :
2740 0 : if (ndr_table_irpc.num_calls < 1) {
2741 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_irpc_uptime_ndr_print");
2742 0 : return NULL;
2743 : }
2744 0 : call = &ndr_table_irpc.calls[0];
2745 :
2746 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
2747 0 : ret = PyUnicode_FromString(retstr);
2748 0 : TALLOC_FREE(retstr);
2749 :
2750 0 : return ret;
2751 : }
2752 :
2753 0 : static PyObject *py_irpc_uptime_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2754 : {
2755 0 : return py_irpc_uptime_ndr_print(py_obj, "irpc_uptime_in", NDR_IN);
2756 : }
2757 :
2758 0 : static PyObject *py_irpc_uptime_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2759 : {
2760 0 : return py_irpc_uptime_ndr_print(py_obj, "irpc_uptime_out", NDR_OUT);
2761 : }
2762 :
2763 : static PyMethodDef py_irpc_uptime_methods[] = {
2764 : { "opnum", (PyCFunction)py_irpc_uptime_ndr_opnum, METH_NOARGS|METH_CLASS,
2765 : "irpc.uptime.opnum() -> 0 (0x00) " },
2766 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_irpc_uptime_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
2767 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
2768 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_irpc_uptime_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
2769 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
2770 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_irpc_uptime_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
2771 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
2772 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_irpc_uptime_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
2773 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
2774 : { "__ndr_print_in__", (PyCFunction)py_irpc_uptime_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
2775 : { "__ndr_print_out__", (PyCFunction)py_irpc_uptime_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
2776 : { NULL, NULL, 0, NULL }
2777 : };
2778 :
2779 :
2780 : static PyTypeObject irpc_uptime_Type = {
2781 : PyVarObject_HEAD_INIT(NULL, 0)
2782 : .tp_name = "irpc.uptime",
2783 : .tp_getset = py_irpc_uptime_getsetters,
2784 : .tp_methods = py_irpc_uptime_methods,
2785 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2786 : .tp_new = py_irpc_uptime_new,
2787 : };
2788 :
2789 0 : static bool pack_py_irpc_uptime_args_in(PyObject *args, PyObject *kwargs, struct irpc_uptime *r)
2790 : {
2791 0 : const char *kwnames[] = {
2792 : NULL
2793 : };
2794 :
2795 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":irpc_uptime", discard_const_p(char *, kwnames))) {
2796 0 : return false;
2797 : }
2798 :
2799 0 : return true;
2800 : }
2801 :
2802 0 : static PyObject *unpack_py_irpc_uptime_args_out(struct irpc_uptime *r)
2803 : {
2804 : PyObject *result;
2805 : PyObject *py_start_time;
2806 0 : py_start_time = PyLong_FromUnsignedLongLong(*r->out.start_time);
2807 0 : result = py_start_time;
2808 0 : return result;
2809 : }
2810 :
2811 :
2812 0 : static PyObject *py_nbtd_information_in_get_level(PyObject *obj, void *closure)
2813 : {
2814 0 : struct nbtd_information *object = pytalloc_get_ptr(obj);
2815 : PyObject *py_level;
2816 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
2817 0 : return py_level;
2818 : }
2819 :
2820 0 : static int py_nbtd_information_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
2821 : {
2822 0 : struct nbtd_information *object = pytalloc_get_ptr(py_obj);
2823 0 : if (value == NULL) {
2824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
2825 0 : return -1;
2826 : }
2827 : {
2828 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
2829 0 : if (PyLong_Check(value)) {
2830 : unsigned long long test_var;
2831 0 : test_var = PyLong_AsUnsignedLongLong(value);
2832 0 : if (PyErr_Occurred() != NULL) {
2833 0 : return -1;
2834 : }
2835 0 : if (test_var > uint_max) {
2836 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2837 : PyLong_Type.tp_name, uint_max, test_var);
2838 0 : return -1;
2839 : }
2840 0 : object->in.level = test_var;
2841 : } else {
2842 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2843 : PyLong_Type.tp_name);
2844 0 : return -1;
2845 : }
2846 : }
2847 0 : return 0;
2848 : }
2849 :
2850 0 : static PyObject *py_nbtd_information_out_get_info(PyObject *obj, void *closure)
2851 : {
2852 0 : struct nbtd_information *object = pytalloc_get_ptr(obj);
2853 : PyObject *py_info;
2854 0 : py_info = pyrpc_import_union(&nbtd_info_Type, pytalloc_get_mem_ctx(obj), object->in.level, &object->out.info, "union nbtd_info");
2855 0 : if (py_info == NULL) {
2856 0 : return NULL;
2857 : }
2858 0 : return py_info;
2859 : }
2860 :
2861 0 : static int py_nbtd_information_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
2862 : {
2863 0 : struct nbtd_information *object = pytalloc_get_ptr(py_obj);
2864 0 : if (value == NULL) {
2865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
2866 0 : return -1;
2867 : }
2868 : {
2869 : union nbtd_info *info_switch_0;
2870 0 : info_switch_0 = (union nbtd_info *)pyrpc_export_union(&nbtd_info_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union nbtd_info");
2871 0 : if (info_switch_0 == NULL) {
2872 0 : return -1;
2873 : }
2874 0 : object->out.info = *info_switch_0;
2875 : }
2876 0 : return 0;
2877 : }
2878 :
2879 : static PyGetSetDef py_nbtd_information_getsetters[] = {
2880 : {
2881 : .name = discard_const_p(char, "in_level"),
2882 : .get = py_nbtd_information_in_get_level,
2883 : .set = py_nbtd_information_in_set_level,
2884 : .doc = discard_const_p(char, "PIDL-generated element of base type nbtd_info_level")
2885 : },
2886 : {
2887 : .name = discard_const_p(char, "out_info"),
2888 : .get = py_nbtd_information_out_get_info,
2889 : .set = py_nbtd_information_out_set_info,
2890 : .doc = discard_const_p(char, "PIDL-generated element of base type nbtd_info")
2891 : },
2892 : { .name = NULL }
2893 : };
2894 :
2895 0 : static PyObject *py_nbtd_information_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2896 : {
2897 0 : PyObject *self = pytalloc_new(struct nbtd_information, type);
2898 0 : return self;
2899 : }
2900 :
2901 0 : static PyObject *py_nbtd_information_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
2902 : {
2903 :
2904 :
2905 0 : return PyLong_FromLong(1);
2906 : }
2907 :
2908 0 : static PyObject *py_nbtd_information_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
2909 : {
2910 0 : const struct ndr_interface_call *call = NULL;
2911 0 : struct nbtd_information *object = pytalloc_get_ptr(py_obj);
2912 0 : PyObject *ret = NULL;
2913 0 : struct ndr_push *push = NULL;
2914 : DATA_BLOB blob;
2915 : enum ndr_err_code err;
2916 :
2917 0 : if (ndr_table_irpc.num_calls < 2) {
2918 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_information_ndr_pack");
2919 0 : return NULL;
2920 : }
2921 0 : call = &ndr_table_irpc.calls[1];
2922 :
2923 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
2924 0 : if (push == NULL) {
2925 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2926 0 : return NULL;
2927 : }
2928 :
2929 0 : push->flags |= ndr_push_flags;
2930 :
2931 0 : err = call->ndr_push(push, ndr_inout_flags, object);
2932 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2933 0 : TALLOC_FREE(push);
2934 0 : PyErr_SetNdrError(err);
2935 0 : return NULL;
2936 : }
2937 0 : blob = ndr_push_blob(push);
2938 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2939 0 : TALLOC_FREE(push);
2940 0 : return ret;
2941 : }
2942 :
2943 0 : static PyObject *py_nbtd_information_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2944 : {
2945 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2946 0 : PyObject *bigendian_obj = NULL;
2947 0 : PyObject *ndr64_obj = NULL;
2948 0 : libndr_flags ndr_push_flags = 0;
2949 :
2950 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
2951 : discard_const_p(char *, kwnames),
2952 : &bigendian_obj,
2953 : &ndr64_obj)) {
2954 0 : return NULL;
2955 : }
2956 :
2957 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2958 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2959 : }
2960 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2961 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2962 : }
2963 :
2964 0 : return py_nbtd_information_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
2965 : }
2966 :
2967 0 : static PyObject *py_nbtd_information_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2968 : {
2969 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2970 0 : PyObject *bigendian_obj = NULL;
2971 0 : PyObject *ndr64_obj = NULL;
2972 0 : libndr_flags ndr_push_flags = 0;
2973 :
2974 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
2975 : discard_const_p(char *, kwnames),
2976 : &bigendian_obj,
2977 : &ndr64_obj)) {
2978 0 : return NULL;
2979 : }
2980 :
2981 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2982 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2983 : }
2984 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2985 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2986 : }
2987 :
2988 0 : return py_nbtd_information_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
2989 : }
2990 :
2991 0 : static PyObject *py_nbtd_information_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
2992 : {
2993 0 : const struct ndr_interface_call *call = NULL;
2994 0 : struct nbtd_information *object = pytalloc_get_ptr(py_obj);
2995 0 : struct ndr_pull *pull = NULL;
2996 : enum ndr_err_code err;
2997 :
2998 0 : if (ndr_table_irpc.num_calls < 2) {
2999 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_information_ndr_unpack");
3000 0 : return NULL;
3001 : }
3002 0 : call = &ndr_table_irpc.calls[1];
3003 :
3004 0 : pull = ndr_pull_init_blob(blob, object);
3005 0 : if (pull == NULL) {
3006 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3007 0 : return NULL;
3008 : }
3009 :
3010 0 : pull->flags |= ndr_pull_flags;
3011 :
3012 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
3013 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3014 0 : TALLOC_FREE(pull);
3015 0 : PyErr_SetNdrError(err);
3016 0 : return NULL;
3017 : }
3018 0 : if (!allow_remaining) {
3019 : uint32_t highest_ofs;
3020 :
3021 0 : if (pull->offset > pull->relative_highest_offset) {
3022 0 : highest_ofs = pull->offset;
3023 : } else {
3024 0 : highest_ofs = pull->relative_highest_offset;
3025 : }
3026 0 : if (highest_ofs < pull->data_size) {
3027 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
3028 : "not all bytes consumed ofs[%u] size[%u]",
3029 : highest_ofs, pull->data_size);
3030 0 : TALLOC_FREE(pull);
3031 0 : PyErr_SetNdrError(err);
3032 0 : return NULL;
3033 : }
3034 : }
3035 :
3036 0 : TALLOC_FREE(pull);
3037 0 : Py_RETURN_NONE;
3038 : }
3039 :
3040 0 : static PyObject *py_nbtd_information_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3041 : {
3042 : DATA_BLOB blob;
3043 0 : Py_ssize_t blob_length = 0;
3044 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3045 0 : PyObject *bigendian_obj = NULL;
3046 0 : PyObject *ndr64_obj = NULL;
3047 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3048 0 : PyObject *allow_remaining_obj = NULL;
3049 0 : bool allow_remaining = false;
3050 :
3051 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
3052 : discard_const_p(char *, kwnames),
3053 : &blob.data, &blob_length,
3054 : &bigendian_obj,
3055 : &ndr64_obj,
3056 : &allow_remaining_obj)) {
3057 0 : return NULL;
3058 : }
3059 0 : blob.length = blob_length;
3060 :
3061 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3062 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3063 : }
3064 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3065 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3066 : }
3067 :
3068 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3069 0 : allow_remaining = true;
3070 : }
3071 :
3072 0 : return py_nbtd_information_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
3073 : }
3074 :
3075 0 : static PyObject *py_nbtd_information_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3076 : {
3077 : DATA_BLOB blob;
3078 0 : Py_ssize_t blob_length = 0;
3079 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3080 0 : PyObject *bigendian_obj = NULL;
3081 0 : PyObject *ndr64_obj = NULL;
3082 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3083 0 : PyObject *allow_remaining_obj = NULL;
3084 0 : bool allow_remaining = false;
3085 :
3086 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3087 : discard_const_p(char *, kwnames),
3088 : &blob.data, &blob_length,
3089 : &bigendian_obj,
3090 : &ndr64_obj,
3091 : &allow_remaining_obj)) {
3092 0 : return NULL;
3093 : }
3094 0 : blob.length = blob_length;
3095 :
3096 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3097 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3098 : }
3099 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3100 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3101 : }
3102 :
3103 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3104 0 : allow_remaining = true;
3105 : }
3106 :
3107 0 : return py_nbtd_information_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3108 : }
3109 :
3110 0 : static PyObject *py_nbtd_information_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
3111 : {
3112 0 : const struct ndr_interface_call *call = NULL;
3113 0 : struct nbtd_information *object = pytalloc_get_ptr(py_obj);
3114 : PyObject *ret;
3115 : char *retstr;
3116 :
3117 0 : if (ndr_table_irpc.num_calls < 2) {
3118 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_information_ndr_print");
3119 0 : return NULL;
3120 : }
3121 0 : call = &ndr_table_irpc.calls[1];
3122 :
3123 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3124 0 : ret = PyUnicode_FromString(retstr);
3125 0 : TALLOC_FREE(retstr);
3126 :
3127 0 : return ret;
3128 : }
3129 :
3130 0 : static PyObject *py_nbtd_information_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3131 : {
3132 0 : return py_nbtd_information_ndr_print(py_obj, "nbtd_information_in", NDR_IN);
3133 : }
3134 :
3135 0 : static PyObject *py_nbtd_information_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3136 : {
3137 0 : return py_nbtd_information_ndr_print(py_obj, "nbtd_information_out", NDR_OUT);
3138 : }
3139 :
3140 : static PyMethodDef py_nbtd_information_methods[] = {
3141 : { "opnum", (PyCFunction)py_nbtd_information_ndr_opnum, METH_NOARGS|METH_CLASS,
3142 : "irpc.nbtd_information.opnum() -> 1 (0x01) " },
3143 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_information_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3144 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3145 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_information_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3146 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3147 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_information_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3148 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3149 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_information_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3150 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3151 : { "__ndr_print_in__", (PyCFunction)py_nbtd_information_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3152 : { "__ndr_print_out__", (PyCFunction)py_nbtd_information_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3153 : { NULL, NULL, 0, NULL }
3154 : };
3155 :
3156 :
3157 : static PyTypeObject nbtd_information_Type = {
3158 : PyVarObject_HEAD_INIT(NULL, 0)
3159 : .tp_name = "irpc.nbtd_information",
3160 : .tp_getset = py_nbtd_information_getsetters,
3161 : .tp_methods = py_nbtd_information_methods,
3162 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3163 : .tp_new = py_nbtd_information_new,
3164 : };
3165 :
3166 0 : static bool pack_py_nbtd_information_args_in(PyObject *args, PyObject *kwargs, struct nbtd_information *r)
3167 : {
3168 : PyObject *py_level;
3169 0 : const char *kwnames[] = {
3170 : "level", NULL
3171 : };
3172 :
3173 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:nbtd_information", discard_const_p(char *, kwnames), &py_level)) {
3174 0 : return false;
3175 : }
3176 :
3177 0 : if (py_level == NULL) {
3178 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
3179 0 : return false;
3180 : }
3181 : {
3182 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
3183 0 : if (PyLong_Check(py_level)) {
3184 : unsigned long long test_var;
3185 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
3186 0 : if (PyErr_Occurred() != NULL) {
3187 0 : return false;
3188 : }
3189 0 : if (test_var > uint_max) {
3190 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3191 : PyLong_Type.tp_name, uint_max, test_var);
3192 0 : return false;
3193 : }
3194 0 : r->in.level = test_var;
3195 : } else {
3196 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3197 : PyLong_Type.tp_name);
3198 0 : return false;
3199 : }
3200 : }
3201 0 : return true;
3202 : }
3203 :
3204 0 : static PyObject *unpack_py_nbtd_information_args_out(struct nbtd_information *r)
3205 : {
3206 : PyObject *result;
3207 : PyObject *py_info;
3208 0 : py_info = pyrpc_import_union(&nbtd_info_Type, r, r->in.level, &r->out.info, "union nbtd_info");
3209 0 : if (py_info == NULL) {
3210 0 : return NULL;
3211 : }
3212 0 : result = py_info;
3213 0 : return result;
3214 : }
3215 :
3216 :
3217 0 : static PyObject *py_nbtd_getdcname_in_get_domainname(PyObject *obj, void *closure)
3218 : {
3219 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(obj);
3220 : PyObject *py_domainname;
3221 0 : py_domainname = PyString_FromStringOrNULL(object->in.domainname);
3222 0 : return py_domainname;
3223 : }
3224 :
3225 0 : static int py_nbtd_getdcname_in_set_domainname(PyObject *py_obj, PyObject *value, void *closure)
3226 : {
3227 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3228 0 : if (value == NULL) {
3229 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domainname");
3230 0 : return -1;
3231 : }
3232 : {
3233 : const char *test_str;
3234 : const char *talloc_str;
3235 0 : PyObject *unicode = NULL;
3236 0 : if (PyUnicode_Check(value)) {
3237 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3238 0 : if (unicode == NULL) {
3239 0 : return -1;
3240 : }
3241 0 : test_str = PyBytes_AS_STRING(unicode);
3242 0 : } else if (PyBytes_Check(value)) {
3243 0 : test_str = PyBytes_AS_STRING(value);
3244 : } else {
3245 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3246 0 : return -1;
3247 : }
3248 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3249 0 : if (unicode != NULL) {
3250 0 : Py_DECREF(unicode);
3251 : }
3252 0 : if (talloc_str == NULL) {
3253 0 : PyErr_NoMemory();
3254 0 : return -1;
3255 : }
3256 0 : object->in.domainname = talloc_str;
3257 : }
3258 0 : return 0;
3259 : }
3260 :
3261 0 : static PyObject *py_nbtd_getdcname_in_get_ip_address(PyObject *obj, void *closure)
3262 : {
3263 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(obj);
3264 : PyObject *py_ip_address;
3265 0 : py_ip_address = PyString_FromStringOrNULL(object->in.ip_address);
3266 0 : return py_ip_address;
3267 : }
3268 :
3269 0 : static int py_nbtd_getdcname_in_set_ip_address(PyObject *py_obj, PyObject *value, void *closure)
3270 : {
3271 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3272 0 : if (value == NULL) {
3273 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.ip_address");
3274 0 : return -1;
3275 : }
3276 : {
3277 : const char *test_str;
3278 : const char *talloc_str;
3279 0 : PyObject *unicode = NULL;
3280 0 : if (PyUnicode_Check(value)) {
3281 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3282 0 : if (unicode == NULL) {
3283 0 : return -1;
3284 : }
3285 0 : test_str = PyBytes_AS_STRING(unicode);
3286 0 : } else if (PyBytes_Check(value)) {
3287 0 : test_str = PyBytes_AS_STRING(value);
3288 : } else {
3289 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3290 0 : return -1;
3291 : }
3292 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3293 0 : if (unicode != NULL) {
3294 0 : Py_DECREF(unicode);
3295 : }
3296 0 : if (talloc_str == NULL) {
3297 0 : PyErr_NoMemory();
3298 0 : return -1;
3299 : }
3300 0 : object->in.ip_address = talloc_str;
3301 : }
3302 0 : return 0;
3303 : }
3304 :
3305 0 : static PyObject *py_nbtd_getdcname_in_get_my_computername(PyObject *obj, void *closure)
3306 : {
3307 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(obj);
3308 : PyObject *py_my_computername;
3309 0 : py_my_computername = PyString_FromStringOrNULL(object->in.my_computername);
3310 0 : return py_my_computername;
3311 : }
3312 :
3313 0 : static int py_nbtd_getdcname_in_set_my_computername(PyObject *py_obj, PyObject *value, void *closure)
3314 : {
3315 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3316 0 : if (value == NULL) {
3317 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.my_computername");
3318 0 : return -1;
3319 : }
3320 : {
3321 : const char *test_str;
3322 : const char *talloc_str;
3323 0 : PyObject *unicode = NULL;
3324 0 : if (PyUnicode_Check(value)) {
3325 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3326 0 : if (unicode == NULL) {
3327 0 : return -1;
3328 : }
3329 0 : test_str = PyBytes_AS_STRING(unicode);
3330 0 : } else if (PyBytes_Check(value)) {
3331 0 : test_str = PyBytes_AS_STRING(value);
3332 : } else {
3333 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3334 0 : return -1;
3335 : }
3336 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3337 0 : if (unicode != NULL) {
3338 0 : Py_DECREF(unicode);
3339 : }
3340 0 : if (talloc_str == NULL) {
3341 0 : PyErr_NoMemory();
3342 0 : return -1;
3343 : }
3344 0 : object->in.my_computername = talloc_str;
3345 : }
3346 0 : return 0;
3347 : }
3348 :
3349 0 : static PyObject *py_nbtd_getdcname_in_get_my_accountname(PyObject *obj, void *closure)
3350 : {
3351 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(obj);
3352 : PyObject *py_my_accountname;
3353 0 : py_my_accountname = PyString_FromStringOrNULL(object->in.my_accountname);
3354 0 : return py_my_accountname;
3355 : }
3356 :
3357 0 : static int py_nbtd_getdcname_in_set_my_accountname(PyObject *py_obj, PyObject *value, void *closure)
3358 : {
3359 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3360 0 : if (value == NULL) {
3361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.my_accountname");
3362 0 : return -1;
3363 : }
3364 : {
3365 : const char *test_str;
3366 : const char *talloc_str;
3367 0 : PyObject *unicode = NULL;
3368 0 : if (PyUnicode_Check(value)) {
3369 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3370 0 : if (unicode == NULL) {
3371 0 : return -1;
3372 : }
3373 0 : test_str = PyBytes_AS_STRING(unicode);
3374 0 : } else if (PyBytes_Check(value)) {
3375 0 : test_str = PyBytes_AS_STRING(value);
3376 : } else {
3377 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3378 0 : return -1;
3379 : }
3380 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3381 0 : if (unicode != NULL) {
3382 0 : Py_DECREF(unicode);
3383 : }
3384 0 : if (talloc_str == NULL) {
3385 0 : PyErr_NoMemory();
3386 0 : return -1;
3387 : }
3388 0 : object->in.my_accountname = talloc_str;
3389 : }
3390 0 : return 0;
3391 : }
3392 :
3393 0 : static PyObject *py_nbtd_getdcname_in_get_account_control(PyObject *obj, void *closure)
3394 : {
3395 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(obj);
3396 : PyObject *py_account_control;
3397 0 : py_account_control = PyLong_FromUnsignedLongLong((uint32_t)(object->in.account_control));
3398 0 : return py_account_control;
3399 : }
3400 :
3401 0 : static int py_nbtd_getdcname_in_set_account_control(PyObject *py_obj, PyObject *value, void *closure)
3402 : {
3403 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3404 0 : if (value == NULL) {
3405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.account_control");
3406 0 : return -1;
3407 : }
3408 : {
3409 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.account_control));
3410 0 : if (PyLong_Check(value)) {
3411 : unsigned long long test_var;
3412 0 : test_var = PyLong_AsUnsignedLongLong(value);
3413 0 : if (PyErr_Occurred() != NULL) {
3414 0 : return -1;
3415 : }
3416 0 : if (test_var > uint_max) {
3417 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3418 : PyLong_Type.tp_name, uint_max, test_var);
3419 0 : return -1;
3420 : }
3421 0 : object->in.account_control = test_var;
3422 : } else {
3423 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3424 : PyLong_Type.tp_name);
3425 0 : return -1;
3426 : }
3427 : }
3428 0 : return 0;
3429 : }
3430 :
3431 0 : static PyObject *py_nbtd_getdcname_in_get_domain_sid(PyObject *obj, void *closure)
3432 : {
3433 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(obj);
3434 : PyObject *py_domain_sid;
3435 0 : if (object->in.domain_sid == NULL) {
3436 0 : Py_RETURN_NONE;
3437 : }
3438 0 : py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->in.domain_sid, object->in.domain_sid);
3439 0 : return py_domain_sid;
3440 : }
3441 :
3442 0 : static int py_nbtd_getdcname_in_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
3443 : {
3444 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3445 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_sid));
3446 0 : if (value == NULL) {
3447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.domain_sid");
3448 0 : return -1;
3449 : }
3450 0 : object->in.domain_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_sid);
3451 0 : if (object->in.domain_sid == NULL) {
3452 0 : PyErr_NoMemory();
3453 0 : return -1;
3454 : }
3455 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3456 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3457 0 : PyErr_NoMemory();
3458 0 : return -1;
3459 : }
3460 0 : object->in.domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
3461 0 : return 0;
3462 : }
3463 :
3464 0 : static PyObject *py_nbtd_getdcname_out_get_dcname(PyObject *obj, void *closure)
3465 : {
3466 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(obj);
3467 : PyObject *py_dcname;
3468 0 : if (object->out.dcname == NULL) {
3469 0 : Py_RETURN_NONE;
3470 : }
3471 0 : if (object->out.dcname == NULL) {
3472 0 : py_dcname = Py_None;
3473 0 : Py_INCREF(py_dcname);
3474 : } else {
3475 0 : py_dcname = PyString_FromStringOrNULL(object->out.dcname);
3476 : }
3477 0 : return py_dcname;
3478 : }
3479 :
3480 0 : static int py_nbtd_getdcname_out_set_dcname(PyObject *py_obj, PyObject *value, void *closure)
3481 : {
3482 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3483 0 : if (value == NULL) {
3484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.dcname");
3485 0 : return -1;
3486 : }
3487 0 : if (value == Py_None) {
3488 0 : object->out.dcname = NULL;
3489 : } else {
3490 0 : object->out.dcname = NULL;
3491 : {
3492 : const char *test_str;
3493 : const char *talloc_str;
3494 0 : PyObject *unicode = NULL;
3495 0 : if (PyUnicode_Check(value)) {
3496 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
3497 0 : if (unicode == NULL) {
3498 0 : return -1;
3499 : }
3500 0 : test_str = PyBytes_AS_STRING(unicode);
3501 0 : } else if (PyBytes_Check(value)) {
3502 0 : test_str = PyBytes_AS_STRING(value);
3503 : } else {
3504 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3505 0 : return -1;
3506 : }
3507 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
3508 0 : if (unicode != NULL) {
3509 0 : Py_DECREF(unicode);
3510 : }
3511 0 : if (talloc_str == NULL) {
3512 0 : PyErr_NoMemory();
3513 0 : return -1;
3514 : }
3515 0 : object->out.dcname = talloc_str;
3516 : }
3517 : }
3518 0 : return 0;
3519 : }
3520 :
3521 : static PyGetSetDef py_nbtd_getdcname_getsetters[] = {
3522 : {
3523 : .name = discard_const_p(char, "in_domainname"),
3524 : .get = py_nbtd_getdcname_in_get_domainname,
3525 : .set = py_nbtd_getdcname_in_set_domainname,
3526 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
3527 : },
3528 : {
3529 : .name = discard_const_p(char, "in_ip_address"),
3530 : .get = py_nbtd_getdcname_in_get_ip_address,
3531 : .set = py_nbtd_getdcname_in_set_ip_address,
3532 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
3533 : },
3534 : {
3535 : .name = discard_const_p(char, "in_my_computername"),
3536 : .get = py_nbtd_getdcname_in_get_my_computername,
3537 : .set = py_nbtd_getdcname_in_set_my_computername,
3538 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
3539 : },
3540 : {
3541 : .name = discard_const_p(char, "in_my_accountname"),
3542 : .get = py_nbtd_getdcname_in_get_my_accountname,
3543 : .set = py_nbtd_getdcname_in_set_my_accountname,
3544 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
3545 : },
3546 : {
3547 : .name = discard_const_p(char, "in_account_control"),
3548 : .get = py_nbtd_getdcname_in_get_account_control,
3549 : .set = py_nbtd_getdcname_in_set_account_control,
3550 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3551 : },
3552 : {
3553 : .name = discard_const_p(char, "in_domain_sid"),
3554 : .get = py_nbtd_getdcname_in_get_domain_sid,
3555 : .set = py_nbtd_getdcname_in_set_domain_sid,
3556 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
3557 : },
3558 : {
3559 : .name = discard_const_p(char, "out_dcname"),
3560 : .get = py_nbtd_getdcname_out_get_dcname,
3561 : .set = py_nbtd_getdcname_out_set_dcname,
3562 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
3563 : },
3564 : { .name = NULL }
3565 : };
3566 :
3567 0 : static PyObject *py_nbtd_getdcname_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3568 : {
3569 0 : PyObject *self = pytalloc_new(struct nbtd_getdcname, type);
3570 0 : struct nbtd_getdcname *_self = (struct nbtd_getdcname *)pytalloc_get_ptr(self);
3571 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
3572 0 : _self->in.domain_sid = talloc_zero(mem_ctx, struct dom_sid);
3573 0 : return self;
3574 : }
3575 :
3576 0 : static PyObject *py_nbtd_getdcname_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
3577 : {
3578 :
3579 :
3580 0 : return PyLong_FromLong(2);
3581 : }
3582 :
3583 0 : static PyObject *py_nbtd_getdcname_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
3584 : {
3585 0 : const struct ndr_interface_call *call = NULL;
3586 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3587 0 : PyObject *ret = NULL;
3588 0 : struct ndr_push *push = NULL;
3589 : DATA_BLOB blob;
3590 : enum ndr_err_code err;
3591 :
3592 0 : if (ndr_table_irpc.num_calls < 3) {
3593 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_getdcname_ndr_pack");
3594 0 : return NULL;
3595 : }
3596 0 : call = &ndr_table_irpc.calls[2];
3597 :
3598 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
3599 0 : if (push == NULL) {
3600 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3601 0 : return NULL;
3602 : }
3603 :
3604 0 : push->flags |= ndr_push_flags;
3605 :
3606 0 : err = call->ndr_push(push, ndr_inout_flags, object);
3607 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3608 0 : TALLOC_FREE(push);
3609 0 : PyErr_SetNdrError(err);
3610 0 : return NULL;
3611 : }
3612 0 : blob = ndr_push_blob(push);
3613 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3614 0 : TALLOC_FREE(push);
3615 0 : return ret;
3616 : }
3617 :
3618 0 : static PyObject *py_nbtd_getdcname_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3619 : {
3620 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3621 0 : PyObject *bigendian_obj = NULL;
3622 0 : PyObject *ndr64_obj = NULL;
3623 0 : libndr_flags ndr_push_flags = 0;
3624 :
3625 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
3626 : discard_const_p(char *, kwnames),
3627 : &bigendian_obj,
3628 : &ndr64_obj)) {
3629 0 : return NULL;
3630 : }
3631 :
3632 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3633 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3634 : }
3635 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3636 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3637 : }
3638 :
3639 0 : return py_nbtd_getdcname_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
3640 : }
3641 :
3642 0 : static PyObject *py_nbtd_getdcname_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3643 : {
3644 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3645 0 : PyObject *bigendian_obj = NULL;
3646 0 : PyObject *ndr64_obj = NULL;
3647 0 : libndr_flags ndr_push_flags = 0;
3648 :
3649 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
3650 : discard_const_p(char *, kwnames),
3651 : &bigendian_obj,
3652 : &ndr64_obj)) {
3653 0 : return NULL;
3654 : }
3655 :
3656 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3657 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3658 : }
3659 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3660 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3661 : }
3662 :
3663 0 : return py_nbtd_getdcname_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
3664 : }
3665 :
3666 0 : static PyObject *py_nbtd_getdcname_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
3667 : {
3668 0 : const struct ndr_interface_call *call = NULL;
3669 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3670 0 : struct ndr_pull *pull = NULL;
3671 : enum ndr_err_code err;
3672 :
3673 0 : if (ndr_table_irpc.num_calls < 3) {
3674 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_getdcname_ndr_unpack");
3675 0 : return NULL;
3676 : }
3677 0 : call = &ndr_table_irpc.calls[2];
3678 :
3679 0 : pull = ndr_pull_init_blob(blob, object);
3680 0 : if (pull == NULL) {
3681 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3682 0 : return NULL;
3683 : }
3684 :
3685 0 : pull->flags |= ndr_pull_flags;
3686 :
3687 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
3688 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3689 0 : TALLOC_FREE(pull);
3690 0 : PyErr_SetNdrError(err);
3691 0 : return NULL;
3692 : }
3693 0 : if (!allow_remaining) {
3694 : uint32_t highest_ofs;
3695 :
3696 0 : if (pull->offset > pull->relative_highest_offset) {
3697 0 : highest_ofs = pull->offset;
3698 : } else {
3699 0 : highest_ofs = pull->relative_highest_offset;
3700 : }
3701 0 : if (highest_ofs < pull->data_size) {
3702 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
3703 : "not all bytes consumed ofs[%u] size[%u]",
3704 : highest_ofs, pull->data_size);
3705 0 : TALLOC_FREE(pull);
3706 0 : PyErr_SetNdrError(err);
3707 0 : return NULL;
3708 : }
3709 : }
3710 :
3711 0 : TALLOC_FREE(pull);
3712 0 : Py_RETURN_NONE;
3713 : }
3714 :
3715 0 : static PyObject *py_nbtd_getdcname_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3716 : {
3717 : DATA_BLOB blob;
3718 0 : Py_ssize_t blob_length = 0;
3719 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3720 0 : PyObject *bigendian_obj = NULL;
3721 0 : PyObject *ndr64_obj = NULL;
3722 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3723 0 : PyObject *allow_remaining_obj = NULL;
3724 0 : bool allow_remaining = false;
3725 :
3726 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
3727 : discard_const_p(char *, kwnames),
3728 : &blob.data, &blob_length,
3729 : &bigendian_obj,
3730 : &ndr64_obj,
3731 : &allow_remaining_obj)) {
3732 0 : return NULL;
3733 : }
3734 0 : blob.length = blob_length;
3735 :
3736 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3737 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3738 : }
3739 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3740 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3741 : }
3742 :
3743 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3744 0 : allow_remaining = true;
3745 : }
3746 :
3747 0 : return py_nbtd_getdcname_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
3748 : }
3749 :
3750 0 : static PyObject *py_nbtd_getdcname_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3751 : {
3752 : DATA_BLOB blob;
3753 0 : Py_ssize_t blob_length = 0;
3754 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3755 0 : PyObject *bigendian_obj = NULL;
3756 0 : PyObject *ndr64_obj = NULL;
3757 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3758 0 : PyObject *allow_remaining_obj = NULL;
3759 0 : bool allow_remaining = false;
3760 :
3761 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3762 : discard_const_p(char *, kwnames),
3763 : &blob.data, &blob_length,
3764 : &bigendian_obj,
3765 : &ndr64_obj,
3766 : &allow_remaining_obj)) {
3767 0 : return NULL;
3768 : }
3769 0 : blob.length = blob_length;
3770 :
3771 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3772 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3773 : }
3774 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3775 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3776 : }
3777 :
3778 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3779 0 : allow_remaining = true;
3780 : }
3781 :
3782 0 : return py_nbtd_getdcname_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3783 : }
3784 :
3785 0 : static PyObject *py_nbtd_getdcname_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
3786 : {
3787 0 : const struct ndr_interface_call *call = NULL;
3788 0 : struct nbtd_getdcname *object = pytalloc_get_ptr(py_obj);
3789 : PyObject *ret;
3790 : char *retstr;
3791 :
3792 0 : if (ndr_table_irpc.num_calls < 3) {
3793 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_getdcname_ndr_print");
3794 0 : return NULL;
3795 : }
3796 0 : call = &ndr_table_irpc.calls[2];
3797 :
3798 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3799 0 : ret = PyUnicode_FromString(retstr);
3800 0 : TALLOC_FREE(retstr);
3801 :
3802 0 : return ret;
3803 : }
3804 :
3805 0 : static PyObject *py_nbtd_getdcname_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3806 : {
3807 0 : return py_nbtd_getdcname_ndr_print(py_obj, "nbtd_getdcname_in", NDR_IN);
3808 : }
3809 :
3810 0 : static PyObject *py_nbtd_getdcname_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3811 : {
3812 0 : return py_nbtd_getdcname_ndr_print(py_obj, "nbtd_getdcname_out", NDR_OUT);
3813 : }
3814 :
3815 : static PyMethodDef py_nbtd_getdcname_methods[] = {
3816 : { "opnum", (PyCFunction)py_nbtd_getdcname_ndr_opnum, METH_NOARGS|METH_CLASS,
3817 : "irpc.nbtd_getdcname.opnum() -> 2 (0x02) " },
3818 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_getdcname_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3819 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3820 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_getdcname_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3821 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3822 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_getdcname_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3823 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3824 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_getdcname_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3825 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3826 : { "__ndr_print_in__", (PyCFunction)py_nbtd_getdcname_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3827 : { "__ndr_print_out__", (PyCFunction)py_nbtd_getdcname_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3828 : { NULL, NULL, 0, NULL }
3829 : };
3830 :
3831 :
3832 : static PyTypeObject nbtd_getdcname_Type = {
3833 : PyVarObject_HEAD_INIT(NULL, 0)
3834 : .tp_name = "irpc.nbtd_getdcname",
3835 : .tp_getset = py_nbtd_getdcname_getsetters,
3836 : .tp_methods = py_nbtd_getdcname_methods,
3837 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3838 : .tp_new = py_nbtd_getdcname_new,
3839 : };
3840 :
3841 0 : static bool pack_py_nbtd_getdcname_args_in(PyObject *args, PyObject *kwargs, struct nbtd_getdcname *r)
3842 : {
3843 : PyObject *py_domainname;
3844 : PyObject *py_ip_address;
3845 : PyObject *py_my_computername;
3846 : PyObject *py_my_accountname;
3847 : PyObject *py_account_control;
3848 : PyObject *py_domain_sid;
3849 0 : const char *kwnames[] = {
3850 : "domainname", "ip_address", "my_computername", "my_accountname", "account_control", "domain_sid", NULL
3851 : };
3852 :
3853 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:nbtd_getdcname", discard_const_p(char *, kwnames), &py_domainname, &py_ip_address, &py_my_computername, &py_my_accountname, &py_account_control, &py_domain_sid)) {
3854 0 : return false;
3855 : }
3856 :
3857 0 : if (py_domainname == NULL) {
3858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domainname");
3859 0 : return false;
3860 : }
3861 : {
3862 : const char *test_str;
3863 : const char *talloc_str;
3864 0 : PyObject *unicode = NULL;
3865 0 : if (PyUnicode_Check(py_domainname)) {
3866 0 : unicode = PyUnicode_AsEncodedString(py_domainname, "utf-8", "ignore");
3867 0 : if (unicode == NULL) {
3868 0 : return false;
3869 : }
3870 0 : test_str = PyBytes_AS_STRING(unicode);
3871 0 : } else if (PyBytes_Check(py_domainname)) {
3872 0 : test_str = PyBytes_AS_STRING(py_domainname);
3873 : } else {
3874 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_domainname)->tp_name);
3875 0 : return false;
3876 : }
3877 0 : talloc_str = talloc_strdup(r, test_str);
3878 0 : if (unicode != NULL) {
3879 0 : Py_DECREF(unicode);
3880 : }
3881 0 : if (talloc_str == NULL) {
3882 0 : PyErr_NoMemory();
3883 0 : return false;
3884 : }
3885 0 : r->in.domainname = talloc_str;
3886 : }
3887 0 : if (py_ip_address == NULL) {
3888 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.ip_address");
3889 0 : return false;
3890 : }
3891 : {
3892 : const char *test_str;
3893 : const char *talloc_str;
3894 0 : PyObject *unicode = NULL;
3895 0 : if (PyUnicode_Check(py_ip_address)) {
3896 0 : unicode = PyUnicode_AsEncodedString(py_ip_address, "utf-8", "ignore");
3897 0 : if (unicode == NULL) {
3898 0 : return false;
3899 : }
3900 0 : test_str = PyBytes_AS_STRING(unicode);
3901 0 : } else if (PyBytes_Check(py_ip_address)) {
3902 0 : test_str = PyBytes_AS_STRING(py_ip_address);
3903 : } else {
3904 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ip_address)->tp_name);
3905 0 : return false;
3906 : }
3907 0 : talloc_str = talloc_strdup(r, test_str);
3908 0 : if (unicode != NULL) {
3909 0 : Py_DECREF(unicode);
3910 : }
3911 0 : if (talloc_str == NULL) {
3912 0 : PyErr_NoMemory();
3913 0 : return false;
3914 : }
3915 0 : r->in.ip_address = talloc_str;
3916 : }
3917 0 : if (py_my_computername == NULL) {
3918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.my_computername");
3919 0 : return false;
3920 : }
3921 : {
3922 : const char *test_str;
3923 : const char *talloc_str;
3924 0 : PyObject *unicode = NULL;
3925 0 : if (PyUnicode_Check(py_my_computername)) {
3926 0 : unicode = PyUnicode_AsEncodedString(py_my_computername, "utf-8", "ignore");
3927 0 : if (unicode == NULL) {
3928 0 : return false;
3929 : }
3930 0 : test_str = PyBytes_AS_STRING(unicode);
3931 0 : } else if (PyBytes_Check(py_my_computername)) {
3932 0 : test_str = PyBytes_AS_STRING(py_my_computername);
3933 : } else {
3934 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_my_computername)->tp_name);
3935 0 : return false;
3936 : }
3937 0 : talloc_str = talloc_strdup(r, test_str);
3938 0 : if (unicode != NULL) {
3939 0 : Py_DECREF(unicode);
3940 : }
3941 0 : if (talloc_str == NULL) {
3942 0 : PyErr_NoMemory();
3943 0 : return false;
3944 : }
3945 0 : r->in.my_computername = talloc_str;
3946 : }
3947 0 : if (py_my_accountname == NULL) {
3948 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.my_accountname");
3949 0 : return false;
3950 : }
3951 : {
3952 : const char *test_str;
3953 : const char *talloc_str;
3954 0 : PyObject *unicode = NULL;
3955 0 : if (PyUnicode_Check(py_my_accountname)) {
3956 0 : unicode = PyUnicode_AsEncodedString(py_my_accountname, "utf-8", "ignore");
3957 0 : if (unicode == NULL) {
3958 0 : return false;
3959 : }
3960 0 : test_str = PyBytes_AS_STRING(unicode);
3961 0 : } else if (PyBytes_Check(py_my_accountname)) {
3962 0 : test_str = PyBytes_AS_STRING(py_my_accountname);
3963 : } else {
3964 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_my_accountname)->tp_name);
3965 0 : return false;
3966 : }
3967 0 : talloc_str = talloc_strdup(r, test_str);
3968 0 : if (unicode != NULL) {
3969 0 : Py_DECREF(unicode);
3970 : }
3971 0 : if (talloc_str == NULL) {
3972 0 : PyErr_NoMemory();
3973 0 : return false;
3974 : }
3975 0 : r->in.my_accountname = talloc_str;
3976 : }
3977 0 : if (py_account_control == NULL) {
3978 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.account_control");
3979 0 : return false;
3980 : }
3981 : {
3982 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.account_control));
3983 0 : if (PyLong_Check(py_account_control)) {
3984 : unsigned long long test_var;
3985 0 : test_var = PyLong_AsUnsignedLongLong(py_account_control);
3986 0 : if (PyErr_Occurred() != NULL) {
3987 0 : return false;
3988 : }
3989 0 : if (test_var > uint_max) {
3990 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3991 : PyLong_Type.tp_name, uint_max, test_var);
3992 0 : return false;
3993 : }
3994 0 : r->in.account_control = test_var;
3995 : } else {
3996 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3997 : PyLong_Type.tp_name);
3998 0 : return false;
3999 : }
4000 : }
4001 0 : if (py_domain_sid == NULL) {
4002 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.domain_sid");
4003 0 : return false;
4004 : }
4005 0 : r->in.domain_sid = talloc_ptrtype(r, r->in.domain_sid);
4006 0 : if (r->in.domain_sid == NULL) {
4007 0 : PyErr_NoMemory();
4008 0 : return false;
4009 : }
4010 0 : PY_CHECK_TYPE(dom_sid_Type, py_domain_sid, return false;);
4011 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_sid)) == NULL) {
4012 0 : PyErr_NoMemory();
4013 0 : return false;
4014 : }
4015 0 : r->in.domain_sid = (struct dom_sid *)pytalloc_get_ptr(py_domain_sid);
4016 0 : return true;
4017 : }
4018 :
4019 0 : static PyObject *unpack_py_nbtd_getdcname_args_out(struct nbtd_getdcname *r)
4020 : {
4021 : PyObject *result;
4022 : PyObject *py_dcname;
4023 0 : if (r->out.dcname == NULL) {
4024 0 : py_dcname = Py_None;
4025 0 : Py_INCREF(py_dcname);
4026 : } else {
4027 0 : py_dcname = PyString_FromStringOrNULL(r->out.dcname);
4028 : }
4029 0 : result = py_dcname;
4030 0 : return result;
4031 : }
4032 :
4033 :
4034 0 : static PyObject *py_nbtd_proxy_wins_challenge_in_get_name(PyObject *obj, void *closure)
4035 : {
4036 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(obj);
4037 : PyObject *py_name;
4038 0 : py_name = pytalloc_reference_ex(nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
4039 0 : return py_name;
4040 : }
4041 :
4042 0 : static int py_nbtd_proxy_wins_challenge_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
4043 : {
4044 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(py_obj);
4045 0 : if (value == NULL) {
4046 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
4047 0 : return -1;
4048 : }
4049 0 : PY_CHECK_TYPE(nbt_name_Type, value, return -1;);
4050 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4051 0 : PyErr_NoMemory();
4052 0 : return -1;
4053 : }
4054 0 : object->in.name = *(struct nbt_name *)pytalloc_get_ptr(value);
4055 0 : return 0;
4056 : }
4057 :
4058 0 : static PyObject *py_nbtd_proxy_wins_challenge_in_get_num_addrs(PyObject *obj, void *closure)
4059 : {
4060 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(obj);
4061 : PyObject *py_num_addrs;
4062 0 : py_num_addrs = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_addrs));
4063 0 : return py_num_addrs;
4064 : }
4065 :
4066 0 : static int py_nbtd_proxy_wins_challenge_in_set_num_addrs(PyObject *py_obj, PyObject *value, void *closure)
4067 : {
4068 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(py_obj);
4069 0 : if (value == NULL) {
4070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_addrs");
4071 0 : return -1;
4072 : }
4073 : {
4074 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_addrs));
4075 0 : if (PyLong_Check(value)) {
4076 : unsigned long long test_var;
4077 0 : test_var = PyLong_AsUnsignedLongLong(value);
4078 0 : if (PyErr_Occurred() != NULL) {
4079 0 : return -1;
4080 : }
4081 0 : if (test_var > uint_max) {
4082 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4083 : PyLong_Type.tp_name, uint_max, test_var);
4084 0 : return -1;
4085 : }
4086 0 : object->in.num_addrs = test_var;
4087 : } else {
4088 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4089 : PyLong_Type.tp_name);
4090 0 : return -1;
4091 : }
4092 : }
4093 0 : return 0;
4094 : }
4095 :
4096 0 : static PyObject *py_nbtd_proxy_wins_challenge_out_get_num_addrs(PyObject *obj, void *closure)
4097 : {
4098 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(obj);
4099 : PyObject *py_num_addrs;
4100 0 : py_num_addrs = PyLong_FromUnsignedLongLong((uint32_t)(object->out.num_addrs));
4101 0 : return py_num_addrs;
4102 : }
4103 :
4104 0 : static int py_nbtd_proxy_wins_challenge_out_set_num_addrs(PyObject *py_obj, PyObject *value, void *closure)
4105 : {
4106 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(py_obj);
4107 0 : if (value == NULL) {
4108 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.num_addrs");
4109 0 : return -1;
4110 : }
4111 : {
4112 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.num_addrs));
4113 0 : if (PyLong_Check(value)) {
4114 : unsigned long long test_var;
4115 0 : test_var = PyLong_AsUnsignedLongLong(value);
4116 0 : if (PyErr_Occurred() != NULL) {
4117 0 : return -1;
4118 : }
4119 0 : if (test_var > uint_max) {
4120 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4121 : PyLong_Type.tp_name, uint_max, test_var);
4122 0 : return -1;
4123 : }
4124 0 : object->out.num_addrs = test_var;
4125 : } else {
4126 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4127 : PyLong_Type.tp_name);
4128 0 : return -1;
4129 : }
4130 : }
4131 0 : return 0;
4132 : }
4133 :
4134 0 : static PyObject *py_nbtd_proxy_wins_challenge_in_get_addrs(PyObject *obj, void *closure)
4135 : {
4136 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(obj);
4137 : PyObject *py_addrs;
4138 0 : py_addrs = PyList_New(object->in.num_addrs);
4139 0 : if (py_addrs == NULL) {
4140 0 : return NULL;
4141 : }
4142 : {
4143 : int addrs_cntr_0;
4144 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < (object->in.num_addrs); addrs_cntr_0++) {
4145 : PyObject *py_addrs_0;
4146 0 : py_addrs_0 = pytalloc_reference_ex(&nbtd_proxy_wins_addr_Type, object->in.addrs, &(object->in.addrs)[addrs_cntr_0]);
4147 0 : PyList_SetItem(py_addrs, addrs_cntr_0, py_addrs_0);
4148 : }
4149 : }
4150 0 : return py_addrs;
4151 : }
4152 :
4153 0 : static int py_nbtd_proxy_wins_challenge_in_set_addrs(PyObject *py_obj, PyObject *value, void *closure)
4154 : {
4155 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(py_obj);
4156 0 : if (value == NULL) {
4157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.addrs");
4158 0 : return -1;
4159 : }
4160 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4161 : {
4162 : int addrs_cntr_0;
4163 0 : object->in.addrs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addrs, PyList_GET_SIZE(value));
4164 0 : if (!object->in.addrs) { return -1; }
4165 0 : talloc_set_name_const(object->in.addrs, "ARRAY: object->in.addrs");
4166 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < PyList_GET_SIZE(value); addrs_cntr_0++) {
4167 0 : if (PyList_GET_ITEM(value, addrs_cntr_0) == NULL) {
4168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.addrs)[addrs_cntr_0]");
4169 0 : return -1;
4170 : }
4171 0 : PY_CHECK_TYPE(&nbtd_proxy_wins_addr_Type, PyList_GET_ITEM(value, addrs_cntr_0), return -1;);
4172 0 : if (talloc_reference(object->in.addrs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addrs_cntr_0))) == NULL) {
4173 0 : PyErr_NoMemory();
4174 0 : return -1;
4175 : }
4176 0 : (object->in.addrs)[addrs_cntr_0] = *(struct nbtd_proxy_wins_addr *)pytalloc_get_ptr(PyList_GET_ITEM(value, addrs_cntr_0));
4177 : }
4178 : }
4179 0 : return 0;
4180 : }
4181 :
4182 0 : static PyObject *py_nbtd_proxy_wins_challenge_out_get_addrs(PyObject *obj, void *closure)
4183 : {
4184 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(obj);
4185 : PyObject *py_addrs;
4186 0 : py_addrs = PyList_New(object->out.num_addrs);
4187 0 : if (py_addrs == NULL) {
4188 0 : return NULL;
4189 : }
4190 : {
4191 : int addrs_cntr_0;
4192 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < (object->out.num_addrs); addrs_cntr_0++) {
4193 : PyObject *py_addrs_0;
4194 0 : py_addrs_0 = pytalloc_reference_ex(&nbtd_proxy_wins_addr_Type, object->out.addrs, &(object->out.addrs)[addrs_cntr_0]);
4195 0 : PyList_SetItem(py_addrs, addrs_cntr_0, py_addrs_0);
4196 : }
4197 : }
4198 0 : return py_addrs;
4199 : }
4200 :
4201 0 : static int py_nbtd_proxy_wins_challenge_out_set_addrs(PyObject *py_obj, PyObject *value, void *closure)
4202 : {
4203 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(py_obj);
4204 0 : if (value == NULL) {
4205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.addrs");
4206 0 : return -1;
4207 : }
4208 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4209 : {
4210 : int addrs_cntr_0;
4211 0 : object->out.addrs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.addrs, PyList_GET_SIZE(value));
4212 0 : if (!object->out.addrs) { return -1; }
4213 0 : talloc_set_name_const(object->out.addrs, "ARRAY: object->out.addrs");
4214 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < PyList_GET_SIZE(value); addrs_cntr_0++) {
4215 0 : if (PyList_GET_ITEM(value, addrs_cntr_0) == NULL) {
4216 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.addrs)[addrs_cntr_0]");
4217 0 : return -1;
4218 : }
4219 0 : PY_CHECK_TYPE(&nbtd_proxy_wins_addr_Type, PyList_GET_ITEM(value, addrs_cntr_0), return -1;);
4220 0 : if (talloc_reference(object->out.addrs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addrs_cntr_0))) == NULL) {
4221 0 : PyErr_NoMemory();
4222 0 : return -1;
4223 : }
4224 0 : (object->out.addrs)[addrs_cntr_0] = *(struct nbtd_proxy_wins_addr *)pytalloc_get_ptr(PyList_GET_ITEM(value, addrs_cntr_0));
4225 : }
4226 : }
4227 0 : return 0;
4228 : }
4229 :
4230 : static PyGetSetDef py_nbtd_proxy_wins_challenge_getsetters[] = {
4231 : {
4232 : .name = discard_const_p(char, "in_name"),
4233 : .get = py_nbtd_proxy_wins_challenge_in_get_name,
4234 : .set = py_nbtd_proxy_wins_challenge_in_set_name,
4235 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
4236 : },
4237 : {
4238 : .name = discard_const_p(char, "in_num_addrs"),
4239 : .get = py_nbtd_proxy_wins_challenge_in_get_num_addrs,
4240 : .set = py_nbtd_proxy_wins_challenge_in_set_num_addrs,
4241 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4242 : },
4243 : {
4244 : .name = discard_const_p(char, "out_num_addrs"),
4245 : .get = py_nbtd_proxy_wins_challenge_out_get_num_addrs,
4246 : .set = py_nbtd_proxy_wins_challenge_out_set_num_addrs,
4247 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4248 : },
4249 : {
4250 : .name = discard_const_p(char, "in_addrs"),
4251 : .get = py_nbtd_proxy_wins_challenge_in_get_addrs,
4252 : .set = py_nbtd_proxy_wins_challenge_in_set_addrs,
4253 : .doc = discard_const_p(char, "PIDL-generated element of base type nbtd_proxy_wins_addr")
4254 : },
4255 : {
4256 : .name = discard_const_p(char, "out_addrs"),
4257 : .get = py_nbtd_proxy_wins_challenge_out_get_addrs,
4258 : .set = py_nbtd_proxy_wins_challenge_out_set_addrs,
4259 : .doc = discard_const_p(char, "PIDL-generated element of base type nbtd_proxy_wins_addr")
4260 : },
4261 : { .name = NULL }
4262 : };
4263 :
4264 0 : static PyObject *py_nbtd_proxy_wins_challenge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4265 : {
4266 0 : PyObject *self = pytalloc_new(struct nbtd_proxy_wins_challenge, type);
4267 0 : return self;
4268 : }
4269 :
4270 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
4271 : {
4272 :
4273 :
4274 0 : return PyLong_FromLong(3);
4275 : }
4276 :
4277 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
4278 : {
4279 0 : const struct ndr_interface_call *call = NULL;
4280 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(py_obj);
4281 0 : PyObject *ret = NULL;
4282 0 : struct ndr_push *push = NULL;
4283 : DATA_BLOB blob;
4284 : enum ndr_err_code err;
4285 :
4286 0 : if (ndr_table_irpc.num_calls < 4) {
4287 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_proxy_wins_challenge_ndr_pack");
4288 0 : return NULL;
4289 : }
4290 0 : call = &ndr_table_irpc.calls[3];
4291 :
4292 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
4293 0 : if (push == NULL) {
4294 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4295 0 : return NULL;
4296 : }
4297 :
4298 0 : push->flags |= ndr_push_flags;
4299 :
4300 0 : err = call->ndr_push(push, ndr_inout_flags, object);
4301 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4302 0 : TALLOC_FREE(push);
4303 0 : PyErr_SetNdrError(err);
4304 0 : return NULL;
4305 : }
4306 0 : blob = ndr_push_blob(push);
4307 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4308 0 : TALLOC_FREE(push);
4309 0 : return ret;
4310 : }
4311 :
4312 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4313 : {
4314 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4315 0 : PyObject *bigendian_obj = NULL;
4316 0 : PyObject *ndr64_obj = NULL;
4317 0 : libndr_flags ndr_push_flags = 0;
4318 :
4319 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
4320 : discard_const_p(char *, kwnames),
4321 : &bigendian_obj,
4322 : &ndr64_obj)) {
4323 0 : return NULL;
4324 : }
4325 :
4326 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4327 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4328 : }
4329 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4330 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4331 : }
4332 :
4333 0 : return py_nbtd_proxy_wins_challenge_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
4334 : }
4335 :
4336 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4337 : {
4338 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4339 0 : PyObject *bigendian_obj = NULL;
4340 0 : PyObject *ndr64_obj = NULL;
4341 0 : libndr_flags ndr_push_flags = 0;
4342 :
4343 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
4344 : discard_const_p(char *, kwnames),
4345 : &bigendian_obj,
4346 : &ndr64_obj)) {
4347 0 : return NULL;
4348 : }
4349 :
4350 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4351 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4352 : }
4353 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4354 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4355 : }
4356 :
4357 0 : return py_nbtd_proxy_wins_challenge_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
4358 : }
4359 :
4360 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
4361 : {
4362 0 : const struct ndr_interface_call *call = NULL;
4363 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(py_obj);
4364 0 : struct ndr_pull *pull = NULL;
4365 : enum ndr_err_code err;
4366 :
4367 0 : if (ndr_table_irpc.num_calls < 4) {
4368 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_proxy_wins_challenge_ndr_unpack");
4369 0 : return NULL;
4370 : }
4371 0 : call = &ndr_table_irpc.calls[3];
4372 :
4373 0 : pull = ndr_pull_init_blob(blob, object);
4374 0 : if (pull == NULL) {
4375 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4376 0 : return NULL;
4377 : }
4378 :
4379 0 : pull->flags |= ndr_pull_flags;
4380 :
4381 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
4382 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4383 0 : TALLOC_FREE(pull);
4384 0 : PyErr_SetNdrError(err);
4385 0 : return NULL;
4386 : }
4387 0 : if (!allow_remaining) {
4388 : uint32_t highest_ofs;
4389 :
4390 0 : if (pull->offset > pull->relative_highest_offset) {
4391 0 : highest_ofs = pull->offset;
4392 : } else {
4393 0 : highest_ofs = pull->relative_highest_offset;
4394 : }
4395 0 : if (highest_ofs < pull->data_size) {
4396 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
4397 : "not all bytes consumed ofs[%u] size[%u]",
4398 : highest_ofs, pull->data_size);
4399 0 : TALLOC_FREE(pull);
4400 0 : PyErr_SetNdrError(err);
4401 0 : return NULL;
4402 : }
4403 : }
4404 :
4405 0 : TALLOC_FREE(pull);
4406 0 : Py_RETURN_NONE;
4407 : }
4408 :
4409 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4410 : {
4411 : DATA_BLOB blob;
4412 0 : Py_ssize_t blob_length = 0;
4413 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4414 0 : PyObject *bigendian_obj = NULL;
4415 0 : PyObject *ndr64_obj = NULL;
4416 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4417 0 : PyObject *allow_remaining_obj = NULL;
4418 0 : bool allow_remaining = false;
4419 :
4420 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
4421 : discard_const_p(char *, kwnames),
4422 : &blob.data, &blob_length,
4423 : &bigendian_obj,
4424 : &ndr64_obj,
4425 : &allow_remaining_obj)) {
4426 0 : return NULL;
4427 : }
4428 0 : blob.length = blob_length;
4429 :
4430 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4431 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4432 : }
4433 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4434 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4435 : }
4436 :
4437 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4438 0 : allow_remaining = true;
4439 : }
4440 :
4441 0 : return py_nbtd_proxy_wins_challenge_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
4442 : }
4443 :
4444 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4445 : {
4446 : DATA_BLOB blob;
4447 0 : Py_ssize_t blob_length = 0;
4448 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4449 0 : PyObject *bigendian_obj = NULL;
4450 0 : PyObject *ndr64_obj = NULL;
4451 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4452 0 : PyObject *allow_remaining_obj = NULL;
4453 0 : bool allow_remaining = false;
4454 :
4455 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
4456 : discard_const_p(char *, kwnames),
4457 : &blob.data, &blob_length,
4458 : &bigendian_obj,
4459 : &ndr64_obj,
4460 : &allow_remaining_obj)) {
4461 0 : return NULL;
4462 : }
4463 0 : blob.length = blob_length;
4464 :
4465 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4466 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4467 : }
4468 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4469 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4470 : }
4471 :
4472 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4473 0 : allow_remaining = true;
4474 : }
4475 :
4476 0 : return py_nbtd_proxy_wins_challenge_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
4477 : }
4478 :
4479 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
4480 : {
4481 0 : const struct ndr_interface_call *call = NULL;
4482 0 : struct nbtd_proxy_wins_challenge *object = pytalloc_get_ptr(py_obj);
4483 : PyObject *ret;
4484 : char *retstr;
4485 :
4486 0 : if (ndr_table_irpc.num_calls < 4) {
4487 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_proxy_wins_challenge_ndr_print");
4488 0 : return NULL;
4489 : }
4490 0 : call = &ndr_table_irpc.calls[3];
4491 :
4492 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
4493 0 : ret = PyUnicode_FromString(retstr);
4494 0 : TALLOC_FREE(retstr);
4495 :
4496 0 : return ret;
4497 : }
4498 :
4499 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4500 : {
4501 0 : return py_nbtd_proxy_wins_challenge_ndr_print(py_obj, "nbtd_proxy_wins_challenge_in", NDR_IN);
4502 : }
4503 :
4504 0 : static PyObject *py_nbtd_proxy_wins_challenge_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4505 : {
4506 0 : return py_nbtd_proxy_wins_challenge_ndr_print(py_obj, "nbtd_proxy_wins_challenge_out", NDR_OUT);
4507 : }
4508 :
4509 : static PyMethodDef py_nbtd_proxy_wins_challenge_methods[] = {
4510 : { "opnum", (PyCFunction)py_nbtd_proxy_wins_challenge_ndr_opnum, METH_NOARGS|METH_CLASS,
4511 : "irpc.nbtd_proxy_wins_challenge.opnum() -> 3 (0x03) " },
4512 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_proxy_wins_challenge_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
4513 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
4514 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_proxy_wins_challenge_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
4515 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
4516 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_proxy_wins_challenge_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
4517 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
4518 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_proxy_wins_challenge_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
4519 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
4520 : { "__ndr_print_in__", (PyCFunction)py_nbtd_proxy_wins_challenge_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
4521 : { "__ndr_print_out__", (PyCFunction)py_nbtd_proxy_wins_challenge_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
4522 : { NULL, NULL, 0, NULL }
4523 : };
4524 :
4525 :
4526 : static PyTypeObject nbtd_proxy_wins_challenge_Type = {
4527 : PyVarObject_HEAD_INIT(NULL, 0)
4528 : .tp_name = "irpc.nbtd_proxy_wins_challenge",
4529 : .tp_getset = py_nbtd_proxy_wins_challenge_getsetters,
4530 : .tp_methods = py_nbtd_proxy_wins_challenge_methods,
4531 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4532 : .tp_new = py_nbtd_proxy_wins_challenge_new,
4533 : };
4534 :
4535 0 : static bool pack_py_nbtd_proxy_wins_challenge_args_in(PyObject *args, PyObject *kwargs, struct nbtd_proxy_wins_challenge *r)
4536 : {
4537 : PyObject *py_name;
4538 : PyObject *py_num_addrs;
4539 : PyObject *py_addrs;
4540 0 : const char *kwnames[] = {
4541 : "name", "num_addrs", "addrs", NULL
4542 : };
4543 :
4544 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:nbtd_proxy_wins_challenge", discard_const_p(char *, kwnames), &py_name, &py_num_addrs, &py_addrs)) {
4545 0 : return false;
4546 : }
4547 :
4548 0 : if (py_name == NULL) {
4549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
4550 0 : return false;
4551 : }
4552 0 : PY_CHECK_TYPE(nbt_name_Type, py_name, return false;);
4553 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
4554 0 : PyErr_NoMemory();
4555 0 : return false;
4556 : }
4557 0 : r->in.name = *(struct nbt_name *)pytalloc_get_ptr(py_name);
4558 0 : if (py_num_addrs == NULL) {
4559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.num_addrs");
4560 0 : return false;
4561 : }
4562 : {
4563 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_addrs));
4564 0 : if (PyLong_Check(py_num_addrs)) {
4565 : unsigned long long test_var;
4566 0 : test_var = PyLong_AsUnsignedLongLong(py_num_addrs);
4567 0 : if (PyErr_Occurred() != NULL) {
4568 0 : return false;
4569 : }
4570 0 : if (test_var > uint_max) {
4571 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4572 : PyLong_Type.tp_name, uint_max, test_var);
4573 0 : return false;
4574 : }
4575 0 : r->in.num_addrs = test_var;
4576 : } else {
4577 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4578 : PyLong_Type.tp_name);
4579 0 : return false;
4580 : }
4581 : }
4582 0 : if (py_addrs == NULL) {
4583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.addrs");
4584 0 : return false;
4585 : }
4586 0 : PY_CHECK_TYPE(&PyList_Type, py_addrs, return false;);
4587 : {
4588 : int addrs_cntr_0;
4589 0 : r->in.addrs = talloc_array_ptrtype(r, r->in.addrs, PyList_GET_SIZE(py_addrs));
4590 0 : if (!r->in.addrs) { return false; }
4591 0 : talloc_set_name_const(r->in.addrs, "ARRAY: r->in.addrs");
4592 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < PyList_GET_SIZE(py_addrs); addrs_cntr_0++) {
4593 0 : if (PyList_GET_ITEM(py_addrs, addrs_cntr_0) == NULL) {
4594 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.addrs)[addrs_cntr_0]");
4595 0 : return false;
4596 : }
4597 0 : PY_CHECK_TYPE(&nbtd_proxy_wins_addr_Type, PyList_GET_ITEM(py_addrs, addrs_cntr_0), return false;);
4598 0 : if (talloc_reference(r->in.addrs, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_addrs, addrs_cntr_0))) == NULL) {
4599 0 : PyErr_NoMemory();
4600 0 : return false;
4601 : }
4602 0 : (r->in.addrs)[addrs_cntr_0] = *(struct nbtd_proxy_wins_addr *)pytalloc_get_ptr(PyList_GET_ITEM(py_addrs, addrs_cntr_0));
4603 : }
4604 : }
4605 0 : return true;
4606 : }
4607 :
4608 0 : static PyObject *unpack_py_nbtd_proxy_wins_challenge_args_out(struct nbtd_proxy_wins_challenge *r)
4609 : {
4610 : PyObject *result;
4611 : PyObject *py_num_addrs;
4612 : PyObject *py_addrs;
4613 0 : result = PyTuple_New(2);
4614 0 : py_num_addrs = PyLong_FromUnsignedLongLong((uint32_t)(r->out.num_addrs));
4615 0 : PyTuple_SetItem(result, 0, py_num_addrs);
4616 0 : py_addrs = PyList_New(r->out.num_addrs);
4617 0 : if (py_addrs == NULL) {
4618 0 : return NULL;
4619 : }
4620 : {
4621 : int addrs_cntr_0;
4622 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < (r->out.num_addrs); addrs_cntr_0++) {
4623 : PyObject *py_addrs_0;
4624 0 : py_addrs_0 = pytalloc_reference_ex(&nbtd_proxy_wins_addr_Type, r->out.addrs, &(r->out.addrs)[addrs_cntr_0]);
4625 0 : PyList_SetItem(py_addrs, addrs_cntr_0, py_addrs_0);
4626 : }
4627 : }
4628 0 : PyTuple_SetItem(result, 1, py_addrs);
4629 0 : return result;
4630 : }
4631 :
4632 :
4633 0 : static PyObject *py_nbtd_proxy_wins_release_demand_in_get_name(PyObject *obj, void *closure)
4634 : {
4635 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(obj);
4636 : PyObject *py_name;
4637 0 : py_name = pytalloc_reference_ex(nbt_name_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
4638 0 : return py_name;
4639 : }
4640 :
4641 0 : static int py_nbtd_proxy_wins_release_demand_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
4642 : {
4643 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(py_obj);
4644 0 : if (value == NULL) {
4645 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
4646 0 : return -1;
4647 : }
4648 0 : PY_CHECK_TYPE(nbt_name_Type, value, return -1;);
4649 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4650 0 : PyErr_NoMemory();
4651 0 : return -1;
4652 : }
4653 0 : object->in.name = *(struct nbt_name *)pytalloc_get_ptr(value);
4654 0 : return 0;
4655 : }
4656 :
4657 0 : static PyObject *py_nbtd_proxy_wins_release_demand_in_get_num_addrs(PyObject *obj, void *closure)
4658 : {
4659 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(obj);
4660 : PyObject *py_num_addrs;
4661 0 : py_num_addrs = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_addrs));
4662 0 : return py_num_addrs;
4663 : }
4664 :
4665 0 : static int py_nbtd_proxy_wins_release_demand_in_set_num_addrs(PyObject *py_obj, PyObject *value, void *closure)
4666 : {
4667 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(py_obj);
4668 0 : if (value == NULL) {
4669 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_addrs");
4670 0 : return -1;
4671 : }
4672 : {
4673 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_addrs));
4674 0 : if (PyLong_Check(value)) {
4675 : unsigned long long test_var;
4676 0 : test_var = PyLong_AsUnsignedLongLong(value);
4677 0 : if (PyErr_Occurred() != NULL) {
4678 0 : return -1;
4679 : }
4680 0 : if (test_var > uint_max) {
4681 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4682 : PyLong_Type.tp_name, uint_max, test_var);
4683 0 : return -1;
4684 : }
4685 0 : object->in.num_addrs = test_var;
4686 : } else {
4687 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4688 : PyLong_Type.tp_name);
4689 0 : return -1;
4690 : }
4691 : }
4692 0 : return 0;
4693 : }
4694 :
4695 0 : static PyObject *py_nbtd_proxy_wins_release_demand_in_get_addrs(PyObject *obj, void *closure)
4696 : {
4697 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(obj);
4698 : PyObject *py_addrs;
4699 0 : py_addrs = PyList_New(object->in.num_addrs);
4700 0 : if (py_addrs == NULL) {
4701 0 : return NULL;
4702 : }
4703 : {
4704 : int addrs_cntr_0;
4705 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < (object->in.num_addrs); addrs_cntr_0++) {
4706 : PyObject *py_addrs_0;
4707 0 : py_addrs_0 = pytalloc_reference_ex(&nbtd_proxy_wins_addr_Type, object->in.addrs, &(object->in.addrs)[addrs_cntr_0]);
4708 0 : PyList_SetItem(py_addrs, addrs_cntr_0, py_addrs_0);
4709 : }
4710 : }
4711 0 : return py_addrs;
4712 : }
4713 :
4714 0 : static int py_nbtd_proxy_wins_release_demand_in_set_addrs(PyObject *py_obj, PyObject *value, void *closure)
4715 : {
4716 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(py_obj);
4717 0 : if (value == NULL) {
4718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.addrs");
4719 0 : return -1;
4720 : }
4721 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4722 : {
4723 : int addrs_cntr_0;
4724 0 : object->in.addrs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.addrs, PyList_GET_SIZE(value));
4725 0 : if (!object->in.addrs) { return -1; }
4726 0 : talloc_set_name_const(object->in.addrs, "ARRAY: object->in.addrs");
4727 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < PyList_GET_SIZE(value); addrs_cntr_0++) {
4728 0 : if (PyList_GET_ITEM(value, addrs_cntr_0) == NULL) {
4729 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.addrs)[addrs_cntr_0]");
4730 0 : return -1;
4731 : }
4732 0 : PY_CHECK_TYPE(&nbtd_proxy_wins_addr_Type, PyList_GET_ITEM(value, addrs_cntr_0), return -1;);
4733 0 : if (talloc_reference(object->in.addrs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addrs_cntr_0))) == NULL) {
4734 0 : PyErr_NoMemory();
4735 0 : return -1;
4736 : }
4737 0 : (object->in.addrs)[addrs_cntr_0] = *(struct nbtd_proxy_wins_addr *)pytalloc_get_ptr(PyList_GET_ITEM(value, addrs_cntr_0));
4738 : }
4739 : }
4740 0 : return 0;
4741 : }
4742 :
4743 : static PyGetSetDef py_nbtd_proxy_wins_release_demand_getsetters[] = {
4744 : {
4745 : .name = discard_const_p(char, "in_name"),
4746 : .get = py_nbtd_proxy_wins_release_demand_in_get_name,
4747 : .set = py_nbtd_proxy_wins_release_demand_in_set_name,
4748 : .doc = discard_const_p(char, "PIDL-generated element of base type nbt_name")
4749 : },
4750 : {
4751 : .name = discard_const_p(char, "in_num_addrs"),
4752 : .get = py_nbtd_proxy_wins_release_demand_in_get_num_addrs,
4753 : .set = py_nbtd_proxy_wins_release_demand_in_set_num_addrs,
4754 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4755 : },
4756 : {
4757 : .name = discard_const_p(char, "in_addrs"),
4758 : .get = py_nbtd_proxy_wins_release_demand_in_get_addrs,
4759 : .set = py_nbtd_proxy_wins_release_demand_in_set_addrs,
4760 : .doc = discard_const_p(char, "PIDL-generated element of base type nbtd_proxy_wins_addr")
4761 : },
4762 : { .name = NULL }
4763 : };
4764 :
4765 0 : static PyObject *py_nbtd_proxy_wins_release_demand_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4766 : {
4767 0 : PyObject *self = pytalloc_new(struct nbtd_proxy_wins_release_demand, type);
4768 0 : return self;
4769 : }
4770 :
4771 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
4772 : {
4773 :
4774 :
4775 0 : return PyLong_FromLong(4);
4776 : }
4777 :
4778 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
4779 : {
4780 0 : const struct ndr_interface_call *call = NULL;
4781 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(py_obj);
4782 0 : PyObject *ret = NULL;
4783 0 : struct ndr_push *push = NULL;
4784 : DATA_BLOB blob;
4785 : enum ndr_err_code err;
4786 :
4787 0 : if (ndr_table_irpc.num_calls < 5) {
4788 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_proxy_wins_release_demand_ndr_pack");
4789 0 : return NULL;
4790 : }
4791 0 : call = &ndr_table_irpc.calls[4];
4792 :
4793 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
4794 0 : if (push == NULL) {
4795 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4796 0 : return NULL;
4797 : }
4798 :
4799 0 : push->flags |= ndr_push_flags;
4800 :
4801 0 : err = call->ndr_push(push, ndr_inout_flags, object);
4802 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4803 0 : TALLOC_FREE(push);
4804 0 : PyErr_SetNdrError(err);
4805 0 : return NULL;
4806 : }
4807 0 : blob = ndr_push_blob(push);
4808 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4809 0 : TALLOC_FREE(push);
4810 0 : return ret;
4811 : }
4812 :
4813 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4814 : {
4815 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4816 0 : PyObject *bigendian_obj = NULL;
4817 0 : PyObject *ndr64_obj = NULL;
4818 0 : libndr_flags ndr_push_flags = 0;
4819 :
4820 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
4821 : discard_const_p(char *, kwnames),
4822 : &bigendian_obj,
4823 : &ndr64_obj)) {
4824 0 : return NULL;
4825 : }
4826 :
4827 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4828 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4829 : }
4830 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4831 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4832 : }
4833 :
4834 0 : return py_nbtd_proxy_wins_release_demand_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
4835 : }
4836 :
4837 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4838 : {
4839 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4840 0 : PyObject *bigendian_obj = NULL;
4841 0 : PyObject *ndr64_obj = NULL;
4842 0 : libndr_flags ndr_push_flags = 0;
4843 :
4844 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
4845 : discard_const_p(char *, kwnames),
4846 : &bigendian_obj,
4847 : &ndr64_obj)) {
4848 0 : return NULL;
4849 : }
4850 :
4851 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4852 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4853 : }
4854 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4855 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4856 : }
4857 :
4858 0 : return py_nbtd_proxy_wins_release_demand_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
4859 : }
4860 :
4861 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
4862 : {
4863 0 : const struct ndr_interface_call *call = NULL;
4864 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(py_obj);
4865 0 : struct ndr_pull *pull = NULL;
4866 : enum ndr_err_code err;
4867 :
4868 0 : if (ndr_table_irpc.num_calls < 5) {
4869 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_proxy_wins_release_demand_ndr_unpack");
4870 0 : return NULL;
4871 : }
4872 0 : call = &ndr_table_irpc.calls[4];
4873 :
4874 0 : pull = ndr_pull_init_blob(blob, object);
4875 0 : if (pull == NULL) {
4876 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4877 0 : return NULL;
4878 : }
4879 :
4880 0 : pull->flags |= ndr_pull_flags;
4881 :
4882 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
4883 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4884 0 : TALLOC_FREE(pull);
4885 0 : PyErr_SetNdrError(err);
4886 0 : return NULL;
4887 : }
4888 0 : if (!allow_remaining) {
4889 : uint32_t highest_ofs;
4890 :
4891 0 : if (pull->offset > pull->relative_highest_offset) {
4892 0 : highest_ofs = pull->offset;
4893 : } else {
4894 0 : highest_ofs = pull->relative_highest_offset;
4895 : }
4896 0 : if (highest_ofs < pull->data_size) {
4897 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
4898 : "not all bytes consumed ofs[%u] size[%u]",
4899 : highest_ofs, pull->data_size);
4900 0 : TALLOC_FREE(pull);
4901 0 : PyErr_SetNdrError(err);
4902 0 : return NULL;
4903 : }
4904 : }
4905 :
4906 0 : TALLOC_FREE(pull);
4907 0 : Py_RETURN_NONE;
4908 : }
4909 :
4910 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4911 : {
4912 : DATA_BLOB blob;
4913 0 : Py_ssize_t blob_length = 0;
4914 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4915 0 : PyObject *bigendian_obj = NULL;
4916 0 : PyObject *ndr64_obj = NULL;
4917 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4918 0 : PyObject *allow_remaining_obj = NULL;
4919 0 : bool allow_remaining = false;
4920 :
4921 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
4922 : discard_const_p(char *, kwnames),
4923 : &blob.data, &blob_length,
4924 : &bigendian_obj,
4925 : &ndr64_obj,
4926 : &allow_remaining_obj)) {
4927 0 : return NULL;
4928 : }
4929 0 : blob.length = blob_length;
4930 :
4931 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4932 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4933 : }
4934 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4935 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4936 : }
4937 :
4938 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4939 0 : allow_remaining = true;
4940 : }
4941 :
4942 0 : return py_nbtd_proxy_wins_release_demand_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
4943 : }
4944 :
4945 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4946 : {
4947 : DATA_BLOB blob;
4948 0 : Py_ssize_t blob_length = 0;
4949 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4950 0 : PyObject *bigendian_obj = NULL;
4951 0 : PyObject *ndr64_obj = NULL;
4952 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4953 0 : PyObject *allow_remaining_obj = NULL;
4954 0 : bool allow_remaining = false;
4955 :
4956 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
4957 : discard_const_p(char *, kwnames),
4958 : &blob.data, &blob_length,
4959 : &bigendian_obj,
4960 : &ndr64_obj,
4961 : &allow_remaining_obj)) {
4962 0 : return NULL;
4963 : }
4964 0 : blob.length = blob_length;
4965 :
4966 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4967 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4968 : }
4969 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4970 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4971 : }
4972 :
4973 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4974 0 : allow_remaining = true;
4975 : }
4976 :
4977 0 : return py_nbtd_proxy_wins_release_demand_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
4978 : }
4979 :
4980 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
4981 : {
4982 0 : const struct ndr_interface_call *call = NULL;
4983 0 : struct nbtd_proxy_wins_release_demand *object = pytalloc_get_ptr(py_obj);
4984 : PyObject *ret;
4985 : char *retstr;
4986 :
4987 0 : if (ndr_table_irpc.num_calls < 5) {
4988 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_nbtd_proxy_wins_release_demand_ndr_print");
4989 0 : return NULL;
4990 : }
4991 0 : call = &ndr_table_irpc.calls[4];
4992 :
4993 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
4994 0 : ret = PyUnicode_FromString(retstr);
4995 0 : TALLOC_FREE(retstr);
4996 :
4997 0 : return ret;
4998 : }
4999 :
5000 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5001 : {
5002 0 : return py_nbtd_proxy_wins_release_demand_ndr_print(py_obj, "nbtd_proxy_wins_release_demand_in", NDR_IN);
5003 : }
5004 :
5005 0 : static PyObject *py_nbtd_proxy_wins_release_demand_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5006 : {
5007 0 : return py_nbtd_proxy_wins_release_demand_ndr_print(py_obj, "nbtd_proxy_wins_release_demand_out", NDR_OUT);
5008 : }
5009 :
5010 : static PyMethodDef py_nbtd_proxy_wins_release_demand_methods[] = {
5011 : { "opnum", (PyCFunction)py_nbtd_proxy_wins_release_demand_ndr_opnum, METH_NOARGS|METH_CLASS,
5012 : "irpc.nbtd_proxy_wins_release_demand.opnum() -> 4 (0x04) " },
5013 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_proxy_wins_release_demand_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
5014 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
5015 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_proxy_wins_release_demand_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
5016 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
5017 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_proxy_wins_release_demand_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
5018 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
5019 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_nbtd_proxy_wins_release_demand_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
5020 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
5021 : { "__ndr_print_in__", (PyCFunction)py_nbtd_proxy_wins_release_demand_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
5022 : { "__ndr_print_out__", (PyCFunction)py_nbtd_proxy_wins_release_demand_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
5023 : { NULL, NULL, 0, NULL }
5024 : };
5025 :
5026 :
5027 : static PyTypeObject nbtd_proxy_wins_release_demand_Type = {
5028 : PyVarObject_HEAD_INIT(NULL, 0)
5029 : .tp_name = "irpc.nbtd_proxy_wins_release_demand",
5030 : .tp_getset = py_nbtd_proxy_wins_release_demand_getsetters,
5031 : .tp_methods = py_nbtd_proxy_wins_release_demand_methods,
5032 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5033 : .tp_new = py_nbtd_proxy_wins_release_demand_new,
5034 : };
5035 :
5036 0 : static bool pack_py_nbtd_proxy_wins_release_demand_args_in(PyObject *args, PyObject *kwargs, struct nbtd_proxy_wins_release_demand *r)
5037 : {
5038 : PyObject *py_name;
5039 : PyObject *py_num_addrs;
5040 : PyObject *py_addrs;
5041 0 : const char *kwnames[] = {
5042 : "name", "num_addrs", "addrs", NULL
5043 : };
5044 :
5045 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:nbtd_proxy_wins_release_demand", discard_const_p(char *, kwnames), &py_name, &py_num_addrs, &py_addrs)) {
5046 0 : return false;
5047 : }
5048 :
5049 0 : if (py_name == NULL) {
5050 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
5051 0 : return false;
5052 : }
5053 0 : PY_CHECK_TYPE(nbt_name_Type, py_name, return false;);
5054 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
5055 0 : PyErr_NoMemory();
5056 0 : return false;
5057 : }
5058 0 : r->in.name = *(struct nbt_name *)pytalloc_get_ptr(py_name);
5059 0 : if (py_num_addrs == NULL) {
5060 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.num_addrs");
5061 0 : return false;
5062 : }
5063 : {
5064 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_addrs));
5065 0 : if (PyLong_Check(py_num_addrs)) {
5066 : unsigned long long test_var;
5067 0 : test_var = PyLong_AsUnsignedLongLong(py_num_addrs);
5068 0 : if (PyErr_Occurred() != NULL) {
5069 0 : return false;
5070 : }
5071 0 : if (test_var > uint_max) {
5072 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5073 : PyLong_Type.tp_name, uint_max, test_var);
5074 0 : return false;
5075 : }
5076 0 : r->in.num_addrs = test_var;
5077 : } else {
5078 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5079 : PyLong_Type.tp_name);
5080 0 : return false;
5081 : }
5082 : }
5083 0 : if (py_addrs == NULL) {
5084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.addrs");
5085 0 : return false;
5086 : }
5087 0 : PY_CHECK_TYPE(&PyList_Type, py_addrs, return false;);
5088 : {
5089 : int addrs_cntr_0;
5090 0 : r->in.addrs = talloc_array_ptrtype(r, r->in.addrs, PyList_GET_SIZE(py_addrs));
5091 0 : if (!r->in.addrs) { return false; }
5092 0 : talloc_set_name_const(r->in.addrs, "ARRAY: r->in.addrs");
5093 0 : for (addrs_cntr_0 = 0; addrs_cntr_0 < PyList_GET_SIZE(py_addrs); addrs_cntr_0++) {
5094 0 : if (PyList_GET_ITEM(py_addrs, addrs_cntr_0) == NULL) {
5095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.addrs)[addrs_cntr_0]");
5096 0 : return false;
5097 : }
5098 0 : PY_CHECK_TYPE(&nbtd_proxy_wins_addr_Type, PyList_GET_ITEM(py_addrs, addrs_cntr_0), return false;);
5099 0 : if (talloc_reference(r->in.addrs, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_addrs, addrs_cntr_0))) == NULL) {
5100 0 : PyErr_NoMemory();
5101 0 : return false;
5102 : }
5103 0 : (r->in.addrs)[addrs_cntr_0] = *(struct nbtd_proxy_wins_addr *)pytalloc_get_ptr(PyList_GET_ITEM(py_addrs, addrs_cntr_0));
5104 : }
5105 : }
5106 0 : return true;
5107 : }
5108 :
5109 0 : static PyObject *unpack_py_nbtd_proxy_wins_release_demand_args_out(struct nbtd_proxy_wins_release_demand *r)
5110 : {
5111 : PyObject *result;
5112 0 : result = Py_None;
5113 0 : Py_INCREF(result);
5114 0 : return result;
5115 : }
5116 :
5117 :
5118 0 : static PyObject *py_kdc_check_generic_kerberos_in_get_generic_request(PyObject *obj, void *closure)
5119 : {
5120 0 : struct kdc_check_generic_kerberos *object = pytalloc_get_ptr(obj);
5121 : PyObject *py_generic_request;
5122 0 : py_generic_request = PyBytes_FromStringAndSize((char *)(object->in.generic_request).data, (object->in.generic_request).length);
5123 0 : return py_generic_request;
5124 : }
5125 :
5126 0 : static int py_kdc_check_generic_kerberos_in_set_generic_request(PyObject *py_obj, PyObject *value, void *closure)
5127 : {
5128 0 : struct kdc_check_generic_kerberos *object = pytalloc_get_ptr(py_obj);
5129 0 : if (value == NULL) {
5130 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.generic_request");
5131 0 : return -1;
5132 : }
5133 0 : object->in.generic_request = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
5134 0 : return 0;
5135 : }
5136 :
5137 0 : static PyObject *py_kdc_check_generic_kerberos_out_get_generic_reply(PyObject *obj, void *closure)
5138 : {
5139 0 : struct kdc_check_generic_kerberos *object = pytalloc_get_ptr(obj);
5140 : PyObject *py_generic_reply;
5141 0 : py_generic_reply = PyBytes_FromStringAndSize((char *)(object->out.generic_reply).data, (object->out.generic_reply).length);
5142 0 : return py_generic_reply;
5143 : }
5144 :
5145 0 : static int py_kdc_check_generic_kerberos_out_set_generic_reply(PyObject *py_obj, PyObject *value, void *closure)
5146 : {
5147 0 : struct kdc_check_generic_kerberos *object = pytalloc_get_ptr(py_obj);
5148 0 : if (value == NULL) {
5149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.generic_reply");
5150 0 : return -1;
5151 : }
5152 0 : object->out.generic_reply = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
5153 0 : return 0;
5154 : }
5155 :
5156 : static PyGetSetDef py_kdc_check_generic_kerberos_getsetters[] = {
5157 : {
5158 : .name = discard_const_p(char, "in_generic_request"),
5159 : .get = py_kdc_check_generic_kerberos_in_get_generic_request,
5160 : .set = py_kdc_check_generic_kerberos_in_set_generic_request,
5161 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
5162 : },
5163 : {
5164 : .name = discard_const_p(char, "out_generic_reply"),
5165 : .get = py_kdc_check_generic_kerberos_out_get_generic_reply,
5166 : .set = py_kdc_check_generic_kerberos_out_set_generic_reply,
5167 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
5168 : },
5169 : { .name = NULL }
5170 : };
5171 :
5172 0 : static PyObject *py_kdc_check_generic_kerberos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5173 : {
5174 0 : PyObject *self = pytalloc_new(struct kdc_check_generic_kerberos, type);
5175 0 : return self;
5176 : }
5177 :
5178 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5179 : {
5180 :
5181 :
5182 0 : return PyLong_FromLong(5);
5183 : }
5184 :
5185 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
5186 : {
5187 0 : const struct ndr_interface_call *call = NULL;
5188 0 : struct kdc_check_generic_kerberos *object = pytalloc_get_ptr(py_obj);
5189 0 : PyObject *ret = NULL;
5190 0 : struct ndr_push *push = NULL;
5191 : DATA_BLOB blob;
5192 : enum ndr_err_code err;
5193 :
5194 0 : if (ndr_table_irpc.num_calls < 6) {
5195 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_kdc_check_generic_kerberos_ndr_pack");
5196 0 : return NULL;
5197 : }
5198 0 : call = &ndr_table_irpc.calls[5];
5199 :
5200 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5201 0 : if (push == NULL) {
5202 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5203 0 : return NULL;
5204 : }
5205 :
5206 0 : push->flags |= ndr_push_flags;
5207 :
5208 0 : err = call->ndr_push(push, ndr_inout_flags, object);
5209 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5210 0 : TALLOC_FREE(push);
5211 0 : PyErr_SetNdrError(err);
5212 0 : return NULL;
5213 : }
5214 0 : blob = ndr_push_blob(push);
5215 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5216 0 : TALLOC_FREE(push);
5217 0 : return ret;
5218 : }
5219 :
5220 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5221 : {
5222 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5223 0 : PyObject *bigendian_obj = NULL;
5224 0 : PyObject *ndr64_obj = NULL;
5225 0 : libndr_flags ndr_push_flags = 0;
5226 :
5227 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5228 : discard_const_p(char *, kwnames),
5229 : &bigendian_obj,
5230 : &ndr64_obj)) {
5231 0 : return NULL;
5232 : }
5233 :
5234 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5235 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5236 : }
5237 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5238 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5239 : }
5240 :
5241 0 : return py_kdc_check_generic_kerberos_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
5242 : }
5243 :
5244 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5245 : {
5246 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5247 0 : PyObject *bigendian_obj = NULL;
5248 0 : PyObject *ndr64_obj = NULL;
5249 0 : libndr_flags ndr_push_flags = 0;
5250 :
5251 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
5252 : discard_const_p(char *, kwnames),
5253 : &bigendian_obj,
5254 : &ndr64_obj)) {
5255 0 : return NULL;
5256 : }
5257 :
5258 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5259 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5260 : }
5261 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5262 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5263 : }
5264 :
5265 0 : return py_kdc_check_generic_kerberos_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
5266 : }
5267 :
5268 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
5269 : {
5270 0 : const struct ndr_interface_call *call = NULL;
5271 0 : struct kdc_check_generic_kerberos *object = pytalloc_get_ptr(py_obj);
5272 0 : struct ndr_pull *pull = NULL;
5273 : enum ndr_err_code err;
5274 :
5275 0 : if (ndr_table_irpc.num_calls < 6) {
5276 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_kdc_check_generic_kerberos_ndr_unpack");
5277 0 : return NULL;
5278 : }
5279 0 : call = &ndr_table_irpc.calls[5];
5280 :
5281 0 : pull = ndr_pull_init_blob(blob, object);
5282 0 : if (pull == NULL) {
5283 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5284 0 : return NULL;
5285 : }
5286 :
5287 0 : pull->flags |= ndr_pull_flags;
5288 :
5289 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
5290 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5291 0 : TALLOC_FREE(pull);
5292 0 : PyErr_SetNdrError(err);
5293 0 : return NULL;
5294 : }
5295 0 : if (!allow_remaining) {
5296 : uint32_t highest_ofs;
5297 :
5298 0 : if (pull->offset > pull->relative_highest_offset) {
5299 0 : highest_ofs = pull->offset;
5300 : } else {
5301 0 : highest_ofs = pull->relative_highest_offset;
5302 : }
5303 0 : if (highest_ofs < pull->data_size) {
5304 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
5305 : "not all bytes consumed ofs[%u] size[%u]",
5306 : highest_ofs, pull->data_size);
5307 0 : TALLOC_FREE(pull);
5308 0 : PyErr_SetNdrError(err);
5309 0 : return NULL;
5310 : }
5311 : }
5312 :
5313 0 : TALLOC_FREE(pull);
5314 0 : Py_RETURN_NONE;
5315 : }
5316 :
5317 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5318 : {
5319 : DATA_BLOB blob;
5320 0 : Py_ssize_t blob_length = 0;
5321 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5322 0 : PyObject *bigendian_obj = NULL;
5323 0 : PyObject *ndr64_obj = NULL;
5324 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5325 0 : PyObject *allow_remaining_obj = NULL;
5326 0 : bool allow_remaining = false;
5327 :
5328 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
5329 : discard_const_p(char *, kwnames),
5330 : &blob.data, &blob_length,
5331 : &bigendian_obj,
5332 : &ndr64_obj,
5333 : &allow_remaining_obj)) {
5334 0 : return NULL;
5335 : }
5336 0 : blob.length = blob_length;
5337 :
5338 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5339 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5340 : }
5341 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5342 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5343 : }
5344 :
5345 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5346 0 : allow_remaining = true;
5347 : }
5348 :
5349 0 : return py_kdc_check_generic_kerberos_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
5350 : }
5351 :
5352 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5353 : {
5354 : DATA_BLOB blob;
5355 0 : Py_ssize_t blob_length = 0;
5356 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5357 0 : PyObject *bigendian_obj = NULL;
5358 0 : PyObject *ndr64_obj = NULL;
5359 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5360 0 : PyObject *allow_remaining_obj = NULL;
5361 0 : bool allow_remaining = false;
5362 :
5363 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
5364 : discard_const_p(char *, kwnames),
5365 : &blob.data, &blob_length,
5366 : &bigendian_obj,
5367 : &ndr64_obj,
5368 : &allow_remaining_obj)) {
5369 0 : return NULL;
5370 : }
5371 0 : blob.length = blob_length;
5372 :
5373 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5374 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5375 : }
5376 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5377 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5378 : }
5379 :
5380 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5381 0 : allow_remaining = true;
5382 : }
5383 :
5384 0 : return py_kdc_check_generic_kerberos_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
5385 : }
5386 :
5387 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
5388 : {
5389 0 : const struct ndr_interface_call *call = NULL;
5390 0 : struct kdc_check_generic_kerberos *object = pytalloc_get_ptr(py_obj);
5391 : PyObject *ret;
5392 : char *retstr;
5393 :
5394 0 : if (ndr_table_irpc.num_calls < 6) {
5395 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_kdc_check_generic_kerberos_ndr_print");
5396 0 : return NULL;
5397 : }
5398 0 : call = &ndr_table_irpc.calls[5];
5399 :
5400 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
5401 0 : ret = PyUnicode_FromString(retstr);
5402 0 : TALLOC_FREE(retstr);
5403 :
5404 0 : return ret;
5405 : }
5406 :
5407 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5408 : {
5409 0 : return py_kdc_check_generic_kerberos_ndr_print(py_obj, "kdc_check_generic_kerberos_in", NDR_IN);
5410 : }
5411 :
5412 0 : static PyObject *py_kdc_check_generic_kerberos_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5413 : {
5414 0 : return py_kdc_check_generic_kerberos_ndr_print(py_obj, "kdc_check_generic_kerberos_out", NDR_OUT);
5415 : }
5416 :
5417 : static PyMethodDef py_kdc_check_generic_kerberos_methods[] = {
5418 : { "opnum", (PyCFunction)py_kdc_check_generic_kerberos_ndr_opnum, METH_NOARGS|METH_CLASS,
5419 : "irpc.kdc_check_generic_kerberos.opnum() -> 5 (0x05) " },
5420 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_kdc_check_generic_kerberos_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
5421 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
5422 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_kdc_check_generic_kerberos_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
5423 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
5424 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_kdc_check_generic_kerberos_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
5425 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
5426 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_kdc_check_generic_kerberos_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
5427 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
5428 : { "__ndr_print_in__", (PyCFunction)py_kdc_check_generic_kerberos_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
5429 : { "__ndr_print_out__", (PyCFunction)py_kdc_check_generic_kerberos_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
5430 : { NULL, NULL, 0, NULL }
5431 : };
5432 :
5433 :
5434 : static PyTypeObject kdc_check_generic_kerberos_Type = {
5435 : PyVarObject_HEAD_INIT(NULL, 0)
5436 : .tp_name = "irpc.kdc_check_generic_kerberos",
5437 : .tp_getset = py_kdc_check_generic_kerberos_getsetters,
5438 : .tp_methods = py_kdc_check_generic_kerberos_methods,
5439 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5440 : .tp_new = py_kdc_check_generic_kerberos_new,
5441 : };
5442 :
5443 0 : static bool pack_py_kdc_check_generic_kerberos_args_in(PyObject *args, PyObject *kwargs, struct kdc_check_generic_kerberos *r)
5444 : {
5445 : PyObject *py_generic_request;
5446 0 : const char *kwnames[] = {
5447 : "generic_request", NULL
5448 : };
5449 :
5450 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:kdc_check_generic_kerberos", discard_const_p(char *, kwnames), &py_generic_request)) {
5451 0 : return false;
5452 : }
5453 :
5454 0 : if (py_generic_request == NULL) {
5455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.generic_request");
5456 0 : return false;
5457 : }
5458 0 : r->in.generic_request = data_blob_talloc(r, PyBytes_AS_STRING(py_generic_request), PyBytes_GET_SIZE(py_generic_request));
5459 0 : return true;
5460 : }
5461 :
5462 0 : static PyObject *unpack_py_kdc_check_generic_kerberos_args_out(struct kdc_check_generic_kerberos *r)
5463 : {
5464 : PyObject *result;
5465 : PyObject *py_generic_reply;
5466 0 : py_generic_reply = PyBytes_FromStringAndSize((char *)(r->out.generic_reply).data, (r->out.generic_reply).length);
5467 0 : result = py_generic_reply;
5468 0 : return result;
5469 : }
5470 :
5471 :
5472 0 : static PyObject *py_smbsrv_information_in_get_level(PyObject *obj, void *closure)
5473 : {
5474 0 : struct smbsrv_information *object = pytalloc_get_ptr(obj);
5475 : PyObject *py_level;
5476 0 : py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
5477 0 : return py_level;
5478 : }
5479 :
5480 0 : static int py_smbsrv_information_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
5481 : {
5482 0 : struct smbsrv_information *object = pytalloc_get_ptr(py_obj);
5483 0 : if (value == NULL) {
5484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
5485 0 : return -1;
5486 : }
5487 : {
5488 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
5489 0 : if (PyLong_Check(value)) {
5490 : unsigned long long test_var;
5491 0 : test_var = PyLong_AsUnsignedLongLong(value);
5492 0 : if (PyErr_Occurred() != NULL) {
5493 0 : return -1;
5494 : }
5495 0 : if (test_var > uint_max) {
5496 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5497 : PyLong_Type.tp_name, uint_max, test_var);
5498 0 : return -1;
5499 : }
5500 0 : object->in.level = test_var;
5501 : } else {
5502 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5503 : PyLong_Type.tp_name);
5504 0 : return -1;
5505 : }
5506 : }
5507 0 : return 0;
5508 : }
5509 :
5510 0 : static PyObject *py_smbsrv_information_out_get_info(PyObject *obj, void *closure)
5511 : {
5512 0 : struct smbsrv_information *object = pytalloc_get_ptr(obj);
5513 : PyObject *py_info;
5514 0 : py_info = pyrpc_import_union(&smbsrv_info_Type, pytalloc_get_mem_ctx(obj), object->in.level, &object->out.info, "union smbsrv_info");
5515 0 : if (py_info == NULL) {
5516 0 : return NULL;
5517 : }
5518 0 : return py_info;
5519 : }
5520 :
5521 0 : static int py_smbsrv_information_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
5522 : {
5523 0 : struct smbsrv_information *object = pytalloc_get_ptr(py_obj);
5524 0 : if (value == NULL) {
5525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
5526 0 : return -1;
5527 : }
5528 : {
5529 : union smbsrv_info *info_switch_0;
5530 0 : info_switch_0 = (union smbsrv_info *)pyrpc_export_union(&smbsrv_info_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union smbsrv_info");
5531 0 : if (info_switch_0 == NULL) {
5532 0 : return -1;
5533 : }
5534 0 : object->out.info = *info_switch_0;
5535 : }
5536 0 : return 0;
5537 : }
5538 :
5539 : static PyGetSetDef py_smbsrv_information_getsetters[] = {
5540 : {
5541 : .name = discard_const_p(char, "in_level"),
5542 : .get = py_smbsrv_information_in_get_level,
5543 : .set = py_smbsrv_information_in_set_level,
5544 : .doc = discard_const_p(char, "PIDL-generated element of base type smbsrv_info_level")
5545 : },
5546 : {
5547 : .name = discard_const_p(char, "out_info"),
5548 : .get = py_smbsrv_information_out_get_info,
5549 : .set = py_smbsrv_information_out_set_info,
5550 : .doc = discard_const_p(char, "PIDL-generated element of base type smbsrv_info")
5551 : },
5552 : { .name = NULL }
5553 : };
5554 :
5555 0 : static PyObject *py_smbsrv_information_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5556 : {
5557 0 : PyObject *self = pytalloc_new(struct smbsrv_information, type);
5558 0 : return self;
5559 : }
5560 :
5561 0 : static PyObject *py_smbsrv_information_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5562 : {
5563 :
5564 :
5565 0 : return PyLong_FromLong(6);
5566 : }
5567 :
5568 0 : static PyObject *py_smbsrv_information_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
5569 : {
5570 0 : const struct ndr_interface_call *call = NULL;
5571 0 : struct smbsrv_information *object = pytalloc_get_ptr(py_obj);
5572 0 : PyObject *ret = NULL;
5573 0 : struct ndr_push *push = NULL;
5574 : DATA_BLOB blob;
5575 : enum ndr_err_code err;
5576 :
5577 0 : if (ndr_table_irpc.num_calls < 7) {
5578 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_smbsrv_information_ndr_pack");
5579 0 : return NULL;
5580 : }
5581 0 : call = &ndr_table_irpc.calls[6];
5582 :
5583 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5584 0 : if (push == NULL) {
5585 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5586 0 : return NULL;
5587 : }
5588 :
5589 0 : push->flags |= ndr_push_flags;
5590 :
5591 0 : err = call->ndr_push(push, ndr_inout_flags, object);
5592 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5593 0 : TALLOC_FREE(push);
5594 0 : PyErr_SetNdrError(err);
5595 0 : return NULL;
5596 : }
5597 0 : blob = ndr_push_blob(push);
5598 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5599 0 : TALLOC_FREE(push);
5600 0 : return ret;
5601 : }
5602 :
5603 0 : static PyObject *py_smbsrv_information_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5604 : {
5605 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5606 0 : PyObject *bigendian_obj = NULL;
5607 0 : PyObject *ndr64_obj = NULL;
5608 0 : libndr_flags ndr_push_flags = 0;
5609 :
5610 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5611 : discard_const_p(char *, kwnames),
5612 : &bigendian_obj,
5613 : &ndr64_obj)) {
5614 0 : return NULL;
5615 : }
5616 :
5617 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5618 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5619 : }
5620 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5621 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5622 : }
5623 :
5624 0 : return py_smbsrv_information_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
5625 : }
5626 :
5627 0 : static PyObject *py_smbsrv_information_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5628 : {
5629 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5630 0 : PyObject *bigendian_obj = NULL;
5631 0 : PyObject *ndr64_obj = NULL;
5632 0 : libndr_flags ndr_push_flags = 0;
5633 :
5634 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
5635 : discard_const_p(char *, kwnames),
5636 : &bigendian_obj,
5637 : &ndr64_obj)) {
5638 0 : return NULL;
5639 : }
5640 :
5641 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5642 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5643 : }
5644 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5645 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5646 : }
5647 :
5648 0 : return py_smbsrv_information_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
5649 : }
5650 :
5651 0 : static PyObject *py_smbsrv_information_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
5652 : {
5653 0 : const struct ndr_interface_call *call = NULL;
5654 0 : struct smbsrv_information *object = pytalloc_get_ptr(py_obj);
5655 0 : struct ndr_pull *pull = NULL;
5656 : enum ndr_err_code err;
5657 :
5658 0 : if (ndr_table_irpc.num_calls < 7) {
5659 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_smbsrv_information_ndr_unpack");
5660 0 : return NULL;
5661 : }
5662 0 : call = &ndr_table_irpc.calls[6];
5663 :
5664 0 : pull = ndr_pull_init_blob(blob, object);
5665 0 : if (pull == NULL) {
5666 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5667 0 : return NULL;
5668 : }
5669 :
5670 0 : pull->flags |= ndr_pull_flags;
5671 :
5672 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
5673 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5674 0 : TALLOC_FREE(pull);
5675 0 : PyErr_SetNdrError(err);
5676 0 : return NULL;
5677 : }
5678 0 : if (!allow_remaining) {
5679 : uint32_t highest_ofs;
5680 :
5681 0 : if (pull->offset > pull->relative_highest_offset) {
5682 0 : highest_ofs = pull->offset;
5683 : } else {
5684 0 : highest_ofs = pull->relative_highest_offset;
5685 : }
5686 0 : if (highest_ofs < pull->data_size) {
5687 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
5688 : "not all bytes consumed ofs[%u] size[%u]",
5689 : highest_ofs, pull->data_size);
5690 0 : TALLOC_FREE(pull);
5691 0 : PyErr_SetNdrError(err);
5692 0 : return NULL;
5693 : }
5694 : }
5695 :
5696 0 : TALLOC_FREE(pull);
5697 0 : Py_RETURN_NONE;
5698 : }
5699 :
5700 0 : static PyObject *py_smbsrv_information_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5701 : {
5702 : DATA_BLOB blob;
5703 0 : Py_ssize_t blob_length = 0;
5704 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5705 0 : PyObject *bigendian_obj = NULL;
5706 0 : PyObject *ndr64_obj = NULL;
5707 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5708 0 : PyObject *allow_remaining_obj = NULL;
5709 0 : bool allow_remaining = false;
5710 :
5711 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
5712 : discard_const_p(char *, kwnames),
5713 : &blob.data, &blob_length,
5714 : &bigendian_obj,
5715 : &ndr64_obj,
5716 : &allow_remaining_obj)) {
5717 0 : return NULL;
5718 : }
5719 0 : blob.length = blob_length;
5720 :
5721 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5722 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5723 : }
5724 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5725 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5726 : }
5727 :
5728 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5729 0 : allow_remaining = true;
5730 : }
5731 :
5732 0 : return py_smbsrv_information_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
5733 : }
5734 :
5735 0 : static PyObject *py_smbsrv_information_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5736 : {
5737 : DATA_BLOB blob;
5738 0 : Py_ssize_t blob_length = 0;
5739 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5740 0 : PyObject *bigendian_obj = NULL;
5741 0 : PyObject *ndr64_obj = NULL;
5742 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5743 0 : PyObject *allow_remaining_obj = NULL;
5744 0 : bool allow_remaining = false;
5745 :
5746 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
5747 : discard_const_p(char *, kwnames),
5748 : &blob.data, &blob_length,
5749 : &bigendian_obj,
5750 : &ndr64_obj,
5751 : &allow_remaining_obj)) {
5752 0 : return NULL;
5753 : }
5754 0 : blob.length = blob_length;
5755 :
5756 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5757 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5758 : }
5759 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5760 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5761 : }
5762 :
5763 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5764 0 : allow_remaining = true;
5765 : }
5766 :
5767 0 : return py_smbsrv_information_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
5768 : }
5769 :
5770 0 : static PyObject *py_smbsrv_information_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
5771 : {
5772 0 : const struct ndr_interface_call *call = NULL;
5773 0 : struct smbsrv_information *object = pytalloc_get_ptr(py_obj);
5774 : PyObject *ret;
5775 : char *retstr;
5776 :
5777 0 : if (ndr_table_irpc.num_calls < 7) {
5778 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_smbsrv_information_ndr_print");
5779 0 : return NULL;
5780 : }
5781 0 : call = &ndr_table_irpc.calls[6];
5782 :
5783 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
5784 0 : ret = PyUnicode_FromString(retstr);
5785 0 : TALLOC_FREE(retstr);
5786 :
5787 0 : return ret;
5788 : }
5789 :
5790 0 : static PyObject *py_smbsrv_information_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5791 : {
5792 0 : return py_smbsrv_information_ndr_print(py_obj, "smbsrv_information_in", NDR_IN);
5793 : }
5794 :
5795 0 : static PyObject *py_smbsrv_information_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5796 : {
5797 0 : return py_smbsrv_information_ndr_print(py_obj, "smbsrv_information_out", NDR_OUT);
5798 : }
5799 :
5800 : static PyMethodDef py_smbsrv_information_methods[] = {
5801 : { "opnum", (PyCFunction)py_smbsrv_information_ndr_opnum, METH_NOARGS|METH_CLASS,
5802 : "irpc.smbsrv_information.opnum() -> 6 (0x06) " },
5803 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smbsrv_information_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
5804 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
5805 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smbsrv_information_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
5806 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
5807 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smbsrv_information_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
5808 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
5809 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_smbsrv_information_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
5810 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
5811 : { "__ndr_print_in__", (PyCFunction)py_smbsrv_information_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
5812 : { "__ndr_print_out__", (PyCFunction)py_smbsrv_information_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
5813 : { NULL, NULL, 0, NULL }
5814 : };
5815 :
5816 :
5817 : static PyTypeObject smbsrv_information_Type = {
5818 : PyVarObject_HEAD_INIT(NULL, 0)
5819 : .tp_name = "irpc.smbsrv_information",
5820 : .tp_getset = py_smbsrv_information_getsetters,
5821 : .tp_methods = py_smbsrv_information_methods,
5822 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5823 : .tp_new = py_smbsrv_information_new,
5824 : };
5825 :
5826 0 : static bool pack_py_smbsrv_information_args_in(PyObject *args, PyObject *kwargs, struct smbsrv_information *r)
5827 : {
5828 : PyObject *py_level;
5829 0 : const char *kwnames[] = {
5830 : "level", NULL
5831 : };
5832 :
5833 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:smbsrv_information", discard_const_p(char *, kwnames), &py_level)) {
5834 0 : return false;
5835 : }
5836 :
5837 0 : if (py_level == NULL) {
5838 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
5839 0 : return false;
5840 : }
5841 : {
5842 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
5843 0 : if (PyLong_Check(py_level)) {
5844 : unsigned long long test_var;
5845 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
5846 0 : if (PyErr_Occurred() != NULL) {
5847 0 : return false;
5848 : }
5849 0 : if (test_var > uint_max) {
5850 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5851 : PyLong_Type.tp_name, uint_max, test_var);
5852 0 : return false;
5853 : }
5854 0 : r->in.level = test_var;
5855 : } else {
5856 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5857 : PyLong_Type.tp_name);
5858 0 : return false;
5859 : }
5860 : }
5861 0 : return true;
5862 : }
5863 :
5864 0 : static PyObject *unpack_py_smbsrv_information_args_out(struct smbsrv_information *r)
5865 : {
5866 : PyObject *result;
5867 : PyObject *py_info;
5868 0 : py_info = pyrpc_import_union(&smbsrv_info_Type, r, r->in.level, &r->out.info, "union smbsrv_info");
5869 0 : if (py_info == NULL) {
5870 0 : return NULL;
5871 : }
5872 0 : result = py_info;
5873 0 : return result;
5874 : }
5875 :
5876 :
5877 0 : static PyObject *py_samba_terminate_in_get_reason(PyObject *obj, void *closure)
5878 : {
5879 0 : struct samba_terminate *object = pytalloc_get_ptr(obj);
5880 : PyObject *py_reason;
5881 0 : py_reason = PyString_FromStringOrNULL(object->in.reason);
5882 0 : return py_reason;
5883 : }
5884 :
5885 0 : static int py_samba_terminate_in_set_reason(PyObject *py_obj, PyObject *value, void *closure)
5886 : {
5887 0 : struct samba_terminate *object = pytalloc_get_ptr(py_obj);
5888 0 : if (value == NULL) {
5889 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.reason");
5890 0 : return -1;
5891 : }
5892 : {
5893 : const char *test_str;
5894 : const char *talloc_str;
5895 0 : PyObject *unicode = NULL;
5896 0 : if (PyUnicode_Check(value)) {
5897 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
5898 0 : if (unicode == NULL) {
5899 0 : return -1;
5900 : }
5901 0 : test_str = PyBytes_AS_STRING(unicode);
5902 0 : } else if (PyBytes_Check(value)) {
5903 0 : test_str = PyBytes_AS_STRING(value);
5904 : } else {
5905 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
5906 0 : return -1;
5907 : }
5908 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
5909 0 : if (unicode != NULL) {
5910 0 : Py_DECREF(unicode);
5911 : }
5912 0 : if (talloc_str == NULL) {
5913 0 : PyErr_NoMemory();
5914 0 : return -1;
5915 : }
5916 0 : object->in.reason = talloc_str;
5917 : }
5918 0 : return 0;
5919 : }
5920 :
5921 : static PyGetSetDef py_samba_terminate_getsetters[] = {
5922 : {
5923 : .name = discard_const_p(char, "in_reason"),
5924 : .get = py_samba_terminate_in_get_reason,
5925 : .set = py_samba_terminate_in_set_reason,
5926 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
5927 : },
5928 : { .name = NULL }
5929 : };
5930 :
5931 0 : static PyObject *py_samba_terminate_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5932 : {
5933 0 : PyObject *self = pytalloc_new(struct samba_terminate, type);
5934 0 : return self;
5935 : }
5936 :
5937 0 : static PyObject *py_samba_terminate_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5938 : {
5939 :
5940 :
5941 0 : return PyLong_FromLong(7);
5942 : }
5943 :
5944 0 : static PyObject *py_samba_terminate_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
5945 : {
5946 0 : const struct ndr_interface_call *call = NULL;
5947 0 : struct samba_terminate *object = pytalloc_get_ptr(py_obj);
5948 0 : PyObject *ret = NULL;
5949 0 : struct ndr_push *push = NULL;
5950 : DATA_BLOB blob;
5951 : enum ndr_err_code err;
5952 :
5953 0 : if (ndr_table_irpc.num_calls < 8) {
5954 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samba_terminate_ndr_pack");
5955 0 : return NULL;
5956 : }
5957 0 : call = &ndr_table_irpc.calls[7];
5958 :
5959 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5960 0 : if (push == NULL) {
5961 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5962 0 : return NULL;
5963 : }
5964 :
5965 0 : push->flags |= ndr_push_flags;
5966 :
5967 0 : err = call->ndr_push(push, ndr_inout_flags, object);
5968 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5969 0 : TALLOC_FREE(push);
5970 0 : PyErr_SetNdrError(err);
5971 0 : return NULL;
5972 : }
5973 0 : blob = ndr_push_blob(push);
5974 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5975 0 : TALLOC_FREE(push);
5976 0 : return ret;
5977 : }
5978 :
5979 0 : static PyObject *py_samba_terminate_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5980 : {
5981 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5982 0 : PyObject *bigendian_obj = NULL;
5983 0 : PyObject *ndr64_obj = NULL;
5984 0 : libndr_flags ndr_push_flags = 0;
5985 :
5986 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5987 : discard_const_p(char *, kwnames),
5988 : &bigendian_obj,
5989 : &ndr64_obj)) {
5990 0 : return NULL;
5991 : }
5992 :
5993 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5994 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5995 : }
5996 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5997 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5998 : }
5999 :
6000 0 : return py_samba_terminate_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6001 : }
6002 :
6003 0 : static PyObject *py_samba_terminate_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6004 : {
6005 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6006 0 : PyObject *bigendian_obj = NULL;
6007 0 : PyObject *ndr64_obj = NULL;
6008 0 : libndr_flags ndr_push_flags = 0;
6009 :
6010 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6011 : discard_const_p(char *, kwnames),
6012 : &bigendian_obj,
6013 : &ndr64_obj)) {
6014 0 : return NULL;
6015 : }
6016 :
6017 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6018 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6019 : }
6020 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6021 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6022 : }
6023 :
6024 0 : return py_samba_terminate_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6025 : }
6026 :
6027 0 : static PyObject *py_samba_terminate_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
6028 : {
6029 0 : const struct ndr_interface_call *call = NULL;
6030 0 : struct samba_terminate *object = pytalloc_get_ptr(py_obj);
6031 0 : struct ndr_pull *pull = NULL;
6032 : enum ndr_err_code err;
6033 :
6034 0 : if (ndr_table_irpc.num_calls < 8) {
6035 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samba_terminate_ndr_unpack");
6036 0 : return NULL;
6037 : }
6038 0 : call = &ndr_table_irpc.calls[7];
6039 :
6040 0 : pull = ndr_pull_init_blob(blob, object);
6041 0 : if (pull == NULL) {
6042 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6043 0 : return NULL;
6044 : }
6045 :
6046 0 : pull->flags |= ndr_pull_flags;
6047 :
6048 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6049 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6050 0 : TALLOC_FREE(pull);
6051 0 : PyErr_SetNdrError(err);
6052 0 : return NULL;
6053 : }
6054 0 : if (!allow_remaining) {
6055 : uint32_t highest_ofs;
6056 :
6057 0 : if (pull->offset > pull->relative_highest_offset) {
6058 0 : highest_ofs = pull->offset;
6059 : } else {
6060 0 : highest_ofs = pull->relative_highest_offset;
6061 : }
6062 0 : if (highest_ofs < pull->data_size) {
6063 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6064 : "not all bytes consumed ofs[%u] size[%u]",
6065 : highest_ofs, pull->data_size);
6066 0 : TALLOC_FREE(pull);
6067 0 : PyErr_SetNdrError(err);
6068 0 : return NULL;
6069 : }
6070 : }
6071 :
6072 0 : TALLOC_FREE(pull);
6073 0 : Py_RETURN_NONE;
6074 : }
6075 :
6076 0 : static PyObject *py_samba_terminate_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6077 : {
6078 : DATA_BLOB blob;
6079 0 : Py_ssize_t blob_length = 0;
6080 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6081 0 : PyObject *bigendian_obj = NULL;
6082 0 : PyObject *ndr64_obj = NULL;
6083 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6084 0 : PyObject *allow_remaining_obj = NULL;
6085 0 : bool allow_remaining = false;
6086 :
6087 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6088 : discard_const_p(char *, kwnames),
6089 : &blob.data, &blob_length,
6090 : &bigendian_obj,
6091 : &ndr64_obj,
6092 : &allow_remaining_obj)) {
6093 0 : return NULL;
6094 : }
6095 0 : blob.length = blob_length;
6096 :
6097 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6098 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6099 : }
6100 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6101 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6102 : }
6103 :
6104 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6105 0 : allow_remaining = true;
6106 : }
6107 :
6108 0 : return py_samba_terminate_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6109 : }
6110 :
6111 0 : static PyObject *py_samba_terminate_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6112 : {
6113 : DATA_BLOB blob;
6114 0 : Py_ssize_t blob_length = 0;
6115 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6116 0 : PyObject *bigendian_obj = NULL;
6117 0 : PyObject *ndr64_obj = NULL;
6118 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6119 0 : PyObject *allow_remaining_obj = NULL;
6120 0 : bool allow_remaining = false;
6121 :
6122 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6123 : discard_const_p(char *, kwnames),
6124 : &blob.data, &blob_length,
6125 : &bigendian_obj,
6126 : &ndr64_obj,
6127 : &allow_remaining_obj)) {
6128 0 : return NULL;
6129 : }
6130 0 : blob.length = blob_length;
6131 :
6132 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6133 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6134 : }
6135 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6136 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6137 : }
6138 :
6139 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6140 0 : allow_remaining = true;
6141 : }
6142 :
6143 0 : return py_samba_terminate_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6144 : }
6145 :
6146 0 : static PyObject *py_samba_terminate_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
6147 : {
6148 0 : const struct ndr_interface_call *call = NULL;
6149 0 : struct samba_terminate *object = pytalloc_get_ptr(py_obj);
6150 : PyObject *ret;
6151 : char *retstr;
6152 :
6153 0 : if (ndr_table_irpc.num_calls < 8) {
6154 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samba_terminate_ndr_print");
6155 0 : return NULL;
6156 : }
6157 0 : call = &ndr_table_irpc.calls[7];
6158 :
6159 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6160 0 : ret = PyUnicode_FromString(retstr);
6161 0 : TALLOC_FREE(retstr);
6162 :
6163 0 : return ret;
6164 : }
6165 :
6166 0 : static PyObject *py_samba_terminate_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6167 : {
6168 0 : return py_samba_terminate_ndr_print(py_obj, "samba_terminate_in", NDR_IN);
6169 : }
6170 :
6171 0 : static PyObject *py_samba_terminate_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6172 : {
6173 0 : return py_samba_terminate_ndr_print(py_obj, "samba_terminate_out", NDR_OUT);
6174 : }
6175 :
6176 : static PyMethodDef py_samba_terminate_methods[] = {
6177 : { "opnum", (PyCFunction)py_samba_terminate_ndr_opnum, METH_NOARGS|METH_CLASS,
6178 : "irpc.samba_terminate.opnum() -> 7 (0x07) " },
6179 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samba_terminate_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6180 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6181 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samba_terminate_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6182 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6183 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samba_terminate_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6184 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6185 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samba_terminate_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6186 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6187 : { "__ndr_print_in__", (PyCFunction)py_samba_terminate_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6188 : { "__ndr_print_out__", (PyCFunction)py_samba_terminate_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6189 : { NULL, NULL, 0, NULL }
6190 : };
6191 :
6192 :
6193 : static PyTypeObject samba_terminate_Type = {
6194 : PyVarObject_HEAD_INIT(NULL, 0)
6195 : .tp_name = "irpc.samba_terminate",
6196 : .tp_getset = py_samba_terminate_getsetters,
6197 : .tp_methods = py_samba_terminate_methods,
6198 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6199 : .tp_new = py_samba_terminate_new,
6200 : };
6201 :
6202 0 : static bool pack_py_samba_terminate_args_in(PyObject *args, PyObject *kwargs, struct samba_terminate *r)
6203 : {
6204 : PyObject *py_reason;
6205 0 : const char *kwnames[] = {
6206 : "reason", NULL
6207 : };
6208 :
6209 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samba_terminate", discard_const_p(char *, kwnames), &py_reason)) {
6210 0 : return false;
6211 : }
6212 :
6213 0 : if (py_reason == NULL) {
6214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.reason");
6215 0 : return false;
6216 : }
6217 : {
6218 : const char *test_str;
6219 : const char *talloc_str;
6220 0 : PyObject *unicode = NULL;
6221 0 : if (PyUnicode_Check(py_reason)) {
6222 0 : unicode = PyUnicode_AsEncodedString(py_reason, "utf-8", "ignore");
6223 0 : if (unicode == NULL) {
6224 0 : return false;
6225 : }
6226 0 : test_str = PyBytes_AS_STRING(unicode);
6227 0 : } else if (PyBytes_Check(py_reason)) {
6228 0 : test_str = PyBytes_AS_STRING(py_reason);
6229 : } else {
6230 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_reason)->tp_name);
6231 0 : return false;
6232 : }
6233 0 : talloc_str = talloc_strdup(r, test_str);
6234 0 : if (unicode != NULL) {
6235 0 : Py_DECREF(unicode);
6236 : }
6237 0 : if (talloc_str == NULL) {
6238 0 : PyErr_NoMemory();
6239 0 : return false;
6240 : }
6241 0 : r->in.reason = talloc_str;
6242 : }
6243 0 : return true;
6244 : }
6245 :
6246 0 : static PyObject *unpack_py_samba_terminate_args_out(struct samba_terminate *r)
6247 : {
6248 : PyObject *result;
6249 0 : result = Py_None;
6250 0 : Py_INCREF(result);
6251 0 : return result;
6252 : }
6253 :
6254 :
6255 0 : static PyObject *py_dreplsrv_refresh_get_result(PyObject *obj, void *closure)
6256 : {
6257 0 : struct dreplsrv_refresh *object = pytalloc_get_ptr(obj);
6258 : PyObject *py_result;
6259 0 : py_result = PyErr_FromWERROR(object->out.result);
6260 0 : return py_result;
6261 : }
6262 :
6263 0 : static int py_dreplsrv_refresh_set_result(PyObject *py_obj, PyObject *value, void *closure)
6264 : {
6265 0 : struct dreplsrv_refresh *object = pytalloc_get_ptr(py_obj);
6266 0 : if (value == NULL) {
6267 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
6268 0 : return -1;
6269 : }
6270 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
6271 0 : return 0;
6272 : }
6273 :
6274 : static PyGetSetDef py_dreplsrv_refresh_getsetters[] = {
6275 : {
6276 : .name = discard_const_p(char, "result"),
6277 : .get = py_dreplsrv_refresh_get_result,
6278 : .set = py_dreplsrv_refresh_set_result,
6279 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
6280 : },
6281 : { .name = NULL }
6282 : };
6283 :
6284 0 : static PyObject *py_dreplsrv_refresh_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6285 : {
6286 0 : PyObject *self = pytalloc_new(struct dreplsrv_refresh, type);
6287 0 : return self;
6288 : }
6289 :
6290 0 : static PyObject *py_dreplsrv_refresh_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
6291 : {
6292 :
6293 :
6294 0 : return PyLong_FromLong(8);
6295 : }
6296 :
6297 0 : static PyObject *py_dreplsrv_refresh_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
6298 : {
6299 0 : const struct ndr_interface_call *call = NULL;
6300 0 : struct dreplsrv_refresh *object = pytalloc_get_ptr(py_obj);
6301 0 : PyObject *ret = NULL;
6302 0 : struct ndr_push *push = NULL;
6303 : DATA_BLOB blob;
6304 : enum ndr_err_code err;
6305 :
6306 0 : if (ndr_table_irpc.num_calls < 9) {
6307 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dreplsrv_refresh_ndr_pack");
6308 0 : return NULL;
6309 : }
6310 0 : call = &ndr_table_irpc.calls[8];
6311 :
6312 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
6313 0 : if (push == NULL) {
6314 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6315 0 : return NULL;
6316 : }
6317 :
6318 0 : push->flags |= ndr_push_flags;
6319 :
6320 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6321 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6322 0 : TALLOC_FREE(push);
6323 0 : PyErr_SetNdrError(err);
6324 0 : return NULL;
6325 : }
6326 0 : blob = ndr_push_blob(push);
6327 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6328 0 : TALLOC_FREE(push);
6329 0 : return ret;
6330 : }
6331 :
6332 0 : static PyObject *py_dreplsrv_refresh_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6333 : {
6334 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6335 0 : PyObject *bigendian_obj = NULL;
6336 0 : PyObject *ndr64_obj = NULL;
6337 0 : libndr_flags ndr_push_flags = 0;
6338 :
6339 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6340 : discard_const_p(char *, kwnames),
6341 : &bigendian_obj,
6342 : &ndr64_obj)) {
6343 0 : return NULL;
6344 : }
6345 :
6346 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6347 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6348 : }
6349 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6350 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6351 : }
6352 :
6353 0 : return py_dreplsrv_refresh_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6354 : }
6355 :
6356 0 : static PyObject *py_dreplsrv_refresh_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6357 : {
6358 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6359 0 : PyObject *bigendian_obj = NULL;
6360 0 : PyObject *ndr64_obj = NULL;
6361 0 : libndr_flags ndr_push_flags = 0;
6362 :
6363 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6364 : discard_const_p(char *, kwnames),
6365 : &bigendian_obj,
6366 : &ndr64_obj)) {
6367 0 : return NULL;
6368 : }
6369 :
6370 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6371 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6372 : }
6373 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6374 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6375 : }
6376 :
6377 0 : return py_dreplsrv_refresh_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6378 : }
6379 :
6380 0 : static PyObject *py_dreplsrv_refresh_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
6381 : {
6382 0 : const struct ndr_interface_call *call = NULL;
6383 0 : struct dreplsrv_refresh *object = pytalloc_get_ptr(py_obj);
6384 0 : struct ndr_pull *pull = NULL;
6385 : enum ndr_err_code err;
6386 :
6387 0 : if (ndr_table_irpc.num_calls < 9) {
6388 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dreplsrv_refresh_ndr_unpack");
6389 0 : return NULL;
6390 : }
6391 0 : call = &ndr_table_irpc.calls[8];
6392 :
6393 0 : pull = ndr_pull_init_blob(blob, object);
6394 0 : if (pull == NULL) {
6395 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6396 0 : return NULL;
6397 : }
6398 :
6399 0 : pull->flags |= ndr_pull_flags;
6400 :
6401 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6402 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6403 0 : TALLOC_FREE(pull);
6404 0 : PyErr_SetNdrError(err);
6405 0 : return NULL;
6406 : }
6407 0 : if (!allow_remaining) {
6408 : uint32_t highest_ofs;
6409 :
6410 0 : if (pull->offset > pull->relative_highest_offset) {
6411 0 : highest_ofs = pull->offset;
6412 : } else {
6413 0 : highest_ofs = pull->relative_highest_offset;
6414 : }
6415 0 : if (highest_ofs < pull->data_size) {
6416 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6417 : "not all bytes consumed ofs[%u] size[%u]",
6418 : highest_ofs, pull->data_size);
6419 0 : TALLOC_FREE(pull);
6420 0 : PyErr_SetNdrError(err);
6421 0 : return NULL;
6422 : }
6423 : }
6424 :
6425 0 : TALLOC_FREE(pull);
6426 0 : Py_RETURN_NONE;
6427 : }
6428 :
6429 0 : static PyObject *py_dreplsrv_refresh_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6430 : {
6431 : DATA_BLOB blob;
6432 0 : Py_ssize_t blob_length = 0;
6433 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6434 0 : PyObject *bigendian_obj = NULL;
6435 0 : PyObject *ndr64_obj = NULL;
6436 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6437 0 : PyObject *allow_remaining_obj = NULL;
6438 0 : bool allow_remaining = false;
6439 :
6440 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6441 : discard_const_p(char *, kwnames),
6442 : &blob.data, &blob_length,
6443 : &bigendian_obj,
6444 : &ndr64_obj,
6445 : &allow_remaining_obj)) {
6446 0 : return NULL;
6447 : }
6448 0 : blob.length = blob_length;
6449 :
6450 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6451 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6452 : }
6453 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6454 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6455 : }
6456 :
6457 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6458 0 : allow_remaining = true;
6459 : }
6460 :
6461 0 : return py_dreplsrv_refresh_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6462 : }
6463 :
6464 0 : static PyObject *py_dreplsrv_refresh_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6465 : {
6466 : DATA_BLOB blob;
6467 0 : Py_ssize_t blob_length = 0;
6468 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6469 0 : PyObject *bigendian_obj = NULL;
6470 0 : PyObject *ndr64_obj = NULL;
6471 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6472 0 : PyObject *allow_remaining_obj = NULL;
6473 0 : bool allow_remaining = false;
6474 :
6475 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6476 : discard_const_p(char *, kwnames),
6477 : &blob.data, &blob_length,
6478 : &bigendian_obj,
6479 : &ndr64_obj,
6480 : &allow_remaining_obj)) {
6481 0 : return NULL;
6482 : }
6483 0 : blob.length = blob_length;
6484 :
6485 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6486 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6487 : }
6488 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6489 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6490 : }
6491 :
6492 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6493 0 : allow_remaining = true;
6494 : }
6495 :
6496 0 : return py_dreplsrv_refresh_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6497 : }
6498 :
6499 0 : static PyObject *py_dreplsrv_refresh_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
6500 : {
6501 0 : const struct ndr_interface_call *call = NULL;
6502 0 : struct dreplsrv_refresh *object = pytalloc_get_ptr(py_obj);
6503 : PyObject *ret;
6504 : char *retstr;
6505 :
6506 0 : if (ndr_table_irpc.num_calls < 9) {
6507 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dreplsrv_refresh_ndr_print");
6508 0 : return NULL;
6509 : }
6510 0 : call = &ndr_table_irpc.calls[8];
6511 :
6512 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6513 0 : ret = PyUnicode_FromString(retstr);
6514 0 : TALLOC_FREE(retstr);
6515 :
6516 0 : return ret;
6517 : }
6518 :
6519 0 : static PyObject *py_dreplsrv_refresh_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6520 : {
6521 0 : return py_dreplsrv_refresh_ndr_print(py_obj, "dreplsrv_refresh_in", NDR_IN);
6522 : }
6523 :
6524 0 : static PyObject *py_dreplsrv_refresh_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6525 : {
6526 0 : return py_dreplsrv_refresh_ndr_print(py_obj, "dreplsrv_refresh_out", NDR_OUT);
6527 : }
6528 :
6529 : static PyMethodDef py_dreplsrv_refresh_methods[] = {
6530 : { "opnum", (PyCFunction)py_dreplsrv_refresh_ndr_opnum, METH_NOARGS|METH_CLASS,
6531 : "irpc.dreplsrv_refresh.opnum() -> 8 (0x08) " },
6532 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dreplsrv_refresh_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6533 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6534 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dreplsrv_refresh_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6535 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6536 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dreplsrv_refresh_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6537 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6538 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dreplsrv_refresh_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6539 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6540 : { "__ndr_print_in__", (PyCFunction)py_dreplsrv_refresh_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6541 : { "__ndr_print_out__", (PyCFunction)py_dreplsrv_refresh_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6542 : { NULL, NULL, 0, NULL }
6543 : };
6544 :
6545 :
6546 : static PyTypeObject dreplsrv_refresh_Type = {
6547 : PyVarObject_HEAD_INIT(NULL, 0)
6548 : .tp_name = "irpc.dreplsrv_refresh",
6549 : .tp_getset = py_dreplsrv_refresh_getsetters,
6550 : .tp_methods = py_dreplsrv_refresh_methods,
6551 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6552 : .tp_new = py_dreplsrv_refresh_new,
6553 : };
6554 :
6555 0 : static bool pack_py_dreplsrv_refresh_args_in(PyObject *args, PyObject *kwargs, struct dreplsrv_refresh *r)
6556 : {
6557 0 : const char *kwnames[] = {
6558 : NULL
6559 : };
6560 :
6561 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":dreplsrv_refresh", discard_const_p(char *, kwnames))) {
6562 0 : return false;
6563 : }
6564 :
6565 0 : return true;
6566 : }
6567 :
6568 0 : static PyObject *unpack_py_dreplsrv_refresh_args_out(struct dreplsrv_refresh *r)
6569 : {
6570 : PyObject *result;
6571 0 : result = Py_None;
6572 0 : Py_INCREF(result);
6573 0 : if (!W_ERROR_IS_OK(r->out.result)) {
6574 0 : PyErr_SetWERROR(r->out.result);
6575 0 : return NULL;
6576 : }
6577 :
6578 0 : return result;
6579 : }
6580 :
6581 :
6582 0 : static PyObject *py_drepl_takeFSMORole_in_get_role(PyObject *obj, void *closure)
6583 : {
6584 0 : struct drepl_takeFSMORole *object = pytalloc_get_ptr(obj);
6585 : PyObject *py_role;
6586 0 : py_role = PyLong_FromUnsignedLongLong((uint32_t)(object->in.role));
6587 0 : return py_role;
6588 : }
6589 :
6590 0 : static int py_drepl_takeFSMORole_in_set_role(PyObject *py_obj, PyObject *value, void *closure)
6591 : {
6592 0 : struct drepl_takeFSMORole *object = pytalloc_get_ptr(py_obj);
6593 0 : if (value == NULL) {
6594 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.role");
6595 0 : return -1;
6596 : }
6597 : {
6598 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.role));
6599 0 : if (PyLong_Check(value)) {
6600 : unsigned long long test_var;
6601 0 : test_var = PyLong_AsUnsignedLongLong(value);
6602 0 : if (PyErr_Occurred() != NULL) {
6603 0 : return -1;
6604 : }
6605 0 : if (test_var > uint_max) {
6606 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6607 : PyLong_Type.tp_name, uint_max, test_var);
6608 0 : return -1;
6609 : }
6610 0 : object->in.role = test_var;
6611 : } else {
6612 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6613 : PyLong_Type.tp_name);
6614 0 : return -1;
6615 : }
6616 : }
6617 0 : return 0;
6618 : }
6619 :
6620 0 : static PyObject *py_drepl_takeFSMORole_get_result(PyObject *obj, void *closure)
6621 : {
6622 0 : struct drepl_takeFSMORole *object = pytalloc_get_ptr(obj);
6623 : PyObject *py_result;
6624 0 : py_result = PyErr_FromWERROR(object->out.result);
6625 0 : return py_result;
6626 : }
6627 :
6628 0 : static int py_drepl_takeFSMORole_set_result(PyObject *py_obj, PyObject *value, void *closure)
6629 : {
6630 0 : struct drepl_takeFSMORole *object = pytalloc_get_ptr(py_obj);
6631 0 : if (value == NULL) {
6632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
6633 0 : return -1;
6634 : }
6635 0 : object->out.result = W_ERROR(PyLong_AsLong(value));
6636 0 : return 0;
6637 : }
6638 :
6639 : static PyGetSetDef py_drepl_takeFSMORole_getsetters[] = {
6640 : {
6641 : .name = discard_const_p(char, "in_role"),
6642 : .get = py_drepl_takeFSMORole_in_get_role,
6643 : .set = py_drepl_takeFSMORole_in_set_role,
6644 : .doc = discard_const_p(char, "PIDL-generated element of base type drepl_role_master")
6645 : },
6646 : {
6647 : .name = discard_const_p(char, "result"),
6648 : .get = py_drepl_takeFSMORole_get_result,
6649 : .set = py_drepl_takeFSMORole_set_result,
6650 : .doc = discard_const_p(char, "PIDL-generated element of type WERROR")
6651 : },
6652 : { .name = NULL }
6653 : };
6654 :
6655 0 : static PyObject *py_drepl_takeFSMORole_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6656 : {
6657 0 : PyObject *self = pytalloc_new(struct drepl_takeFSMORole, type);
6658 0 : return self;
6659 : }
6660 :
6661 0 : static PyObject *py_drepl_takeFSMORole_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
6662 : {
6663 :
6664 :
6665 0 : return PyLong_FromLong(9);
6666 : }
6667 :
6668 0 : static PyObject *py_drepl_takeFSMORole_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
6669 : {
6670 0 : const struct ndr_interface_call *call = NULL;
6671 0 : struct drepl_takeFSMORole *object = pytalloc_get_ptr(py_obj);
6672 0 : PyObject *ret = NULL;
6673 0 : struct ndr_push *push = NULL;
6674 : DATA_BLOB blob;
6675 : enum ndr_err_code err;
6676 :
6677 0 : if (ndr_table_irpc.num_calls < 10) {
6678 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_drepl_takeFSMORole_ndr_pack");
6679 0 : return NULL;
6680 : }
6681 0 : call = &ndr_table_irpc.calls[9];
6682 :
6683 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
6684 0 : if (push == NULL) {
6685 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6686 0 : return NULL;
6687 : }
6688 :
6689 0 : push->flags |= ndr_push_flags;
6690 :
6691 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6692 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6693 0 : TALLOC_FREE(push);
6694 0 : PyErr_SetNdrError(err);
6695 0 : return NULL;
6696 : }
6697 0 : blob = ndr_push_blob(push);
6698 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6699 0 : TALLOC_FREE(push);
6700 0 : return ret;
6701 : }
6702 :
6703 0 : static PyObject *py_drepl_takeFSMORole_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6704 : {
6705 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6706 0 : PyObject *bigendian_obj = NULL;
6707 0 : PyObject *ndr64_obj = NULL;
6708 0 : libndr_flags ndr_push_flags = 0;
6709 :
6710 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6711 : discard_const_p(char *, kwnames),
6712 : &bigendian_obj,
6713 : &ndr64_obj)) {
6714 0 : return NULL;
6715 : }
6716 :
6717 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6718 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6719 : }
6720 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6721 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6722 : }
6723 :
6724 0 : return py_drepl_takeFSMORole_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6725 : }
6726 :
6727 0 : static PyObject *py_drepl_takeFSMORole_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6728 : {
6729 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6730 0 : PyObject *bigendian_obj = NULL;
6731 0 : PyObject *ndr64_obj = NULL;
6732 0 : libndr_flags ndr_push_flags = 0;
6733 :
6734 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6735 : discard_const_p(char *, kwnames),
6736 : &bigendian_obj,
6737 : &ndr64_obj)) {
6738 0 : return NULL;
6739 : }
6740 :
6741 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6742 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6743 : }
6744 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6745 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6746 : }
6747 :
6748 0 : return py_drepl_takeFSMORole_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6749 : }
6750 :
6751 0 : static PyObject *py_drepl_takeFSMORole_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
6752 : {
6753 0 : const struct ndr_interface_call *call = NULL;
6754 0 : struct drepl_takeFSMORole *object = pytalloc_get_ptr(py_obj);
6755 0 : struct ndr_pull *pull = NULL;
6756 : enum ndr_err_code err;
6757 :
6758 0 : if (ndr_table_irpc.num_calls < 10) {
6759 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_drepl_takeFSMORole_ndr_unpack");
6760 0 : return NULL;
6761 : }
6762 0 : call = &ndr_table_irpc.calls[9];
6763 :
6764 0 : pull = ndr_pull_init_blob(blob, object);
6765 0 : if (pull == NULL) {
6766 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6767 0 : return NULL;
6768 : }
6769 :
6770 0 : pull->flags |= ndr_pull_flags;
6771 :
6772 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6773 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6774 0 : TALLOC_FREE(pull);
6775 0 : PyErr_SetNdrError(err);
6776 0 : return NULL;
6777 : }
6778 0 : if (!allow_remaining) {
6779 : uint32_t highest_ofs;
6780 :
6781 0 : if (pull->offset > pull->relative_highest_offset) {
6782 0 : highest_ofs = pull->offset;
6783 : } else {
6784 0 : highest_ofs = pull->relative_highest_offset;
6785 : }
6786 0 : if (highest_ofs < pull->data_size) {
6787 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6788 : "not all bytes consumed ofs[%u] size[%u]",
6789 : highest_ofs, pull->data_size);
6790 0 : TALLOC_FREE(pull);
6791 0 : PyErr_SetNdrError(err);
6792 0 : return NULL;
6793 : }
6794 : }
6795 :
6796 0 : TALLOC_FREE(pull);
6797 0 : Py_RETURN_NONE;
6798 : }
6799 :
6800 0 : static PyObject *py_drepl_takeFSMORole_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6801 : {
6802 : DATA_BLOB blob;
6803 0 : Py_ssize_t blob_length = 0;
6804 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6805 0 : PyObject *bigendian_obj = NULL;
6806 0 : PyObject *ndr64_obj = NULL;
6807 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6808 0 : PyObject *allow_remaining_obj = NULL;
6809 0 : bool allow_remaining = false;
6810 :
6811 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6812 : discard_const_p(char *, kwnames),
6813 : &blob.data, &blob_length,
6814 : &bigendian_obj,
6815 : &ndr64_obj,
6816 : &allow_remaining_obj)) {
6817 0 : return NULL;
6818 : }
6819 0 : blob.length = blob_length;
6820 :
6821 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6822 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6823 : }
6824 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6825 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6826 : }
6827 :
6828 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6829 0 : allow_remaining = true;
6830 : }
6831 :
6832 0 : return py_drepl_takeFSMORole_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6833 : }
6834 :
6835 0 : static PyObject *py_drepl_takeFSMORole_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6836 : {
6837 : DATA_BLOB blob;
6838 0 : Py_ssize_t blob_length = 0;
6839 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6840 0 : PyObject *bigendian_obj = NULL;
6841 0 : PyObject *ndr64_obj = NULL;
6842 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6843 0 : PyObject *allow_remaining_obj = NULL;
6844 0 : bool allow_remaining = false;
6845 :
6846 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6847 : discard_const_p(char *, kwnames),
6848 : &blob.data, &blob_length,
6849 : &bigendian_obj,
6850 : &ndr64_obj,
6851 : &allow_remaining_obj)) {
6852 0 : return NULL;
6853 : }
6854 0 : blob.length = blob_length;
6855 :
6856 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6857 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6858 : }
6859 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6860 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6861 : }
6862 :
6863 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6864 0 : allow_remaining = true;
6865 : }
6866 :
6867 0 : return py_drepl_takeFSMORole_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6868 : }
6869 :
6870 0 : static PyObject *py_drepl_takeFSMORole_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
6871 : {
6872 0 : const struct ndr_interface_call *call = NULL;
6873 0 : struct drepl_takeFSMORole *object = pytalloc_get_ptr(py_obj);
6874 : PyObject *ret;
6875 : char *retstr;
6876 :
6877 0 : if (ndr_table_irpc.num_calls < 10) {
6878 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_drepl_takeFSMORole_ndr_print");
6879 0 : return NULL;
6880 : }
6881 0 : call = &ndr_table_irpc.calls[9];
6882 :
6883 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6884 0 : ret = PyUnicode_FromString(retstr);
6885 0 : TALLOC_FREE(retstr);
6886 :
6887 0 : return ret;
6888 : }
6889 :
6890 0 : static PyObject *py_drepl_takeFSMORole_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6891 : {
6892 0 : return py_drepl_takeFSMORole_ndr_print(py_obj, "drepl_takeFSMORole_in", NDR_IN);
6893 : }
6894 :
6895 0 : static PyObject *py_drepl_takeFSMORole_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6896 : {
6897 0 : return py_drepl_takeFSMORole_ndr_print(py_obj, "drepl_takeFSMORole_out", NDR_OUT);
6898 : }
6899 :
6900 : static PyMethodDef py_drepl_takeFSMORole_methods[] = {
6901 : { "opnum", (PyCFunction)py_drepl_takeFSMORole_ndr_opnum, METH_NOARGS|METH_CLASS,
6902 : "irpc.drepl_takeFSMORole.opnum() -> 9 (0x09) " },
6903 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drepl_takeFSMORole_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6904 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6905 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drepl_takeFSMORole_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6906 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6907 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drepl_takeFSMORole_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6908 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6909 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drepl_takeFSMORole_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6910 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6911 : { "__ndr_print_in__", (PyCFunction)py_drepl_takeFSMORole_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6912 : { "__ndr_print_out__", (PyCFunction)py_drepl_takeFSMORole_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6913 : { NULL, NULL, 0, NULL }
6914 : };
6915 :
6916 :
6917 : static PyTypeObject drepl_takeFSMORole_Type = {
6918 : PyVarObject_HEAD_INIT(NULL, 0)
6919 : .tp_name = "irpc.drepl_takeFSMORole",
6920 : .tp_getset = py_drepl_takeFSMORole_getsetters,
6921 : .tp_methods = py_drepl_takeFSMORole_methods,
6922 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6923 : .tp_new = py_drepl_takeFSMORole_new,
6924 : };
6925 :
6926 0 : static bool pack_py_drepl_takeFSMORole_args_in(PyObject *args, PyObject *kwargs, struct drepl_takeFSMORole *r)
6927 : {
6928 : PyObject *py_role;
6929 0 : const char *kwnames[] = {
6930 : "role", NULL
6931 : };
6932 :
6933 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:drepl_takeFSMORole", discard_const_p(char *, kwnames), &py_role)) {
6934 0 : return false;
6935 : }
6936 :
6937 0 : if (py_role == NULL) {
6938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.role");
6939 0 : return false;
6940 : }
6941 : {
6942 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.role));
6943 0 : if (PyLong_Check(py_role)) {
6944 : unsigned long long test_var;
6945 0 : test_var = PyLong_AsUnsignedLongLong(py_role);
6946 0 : if (PyErr_Occurred() != NULL) {
6947 0 : return false;
6948 : }
6949 0 : if (test_var > uint_max) {
6950 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6951 : PyLong_Type.tp_name, uint_max, test_var);
6952 0 : return false;
6953 : }
6954 0 : r->in.role = test_var;
6955 : } else {
6956 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6957 : PyLong_Type.tp_name);
6958 0 : return false;
6959 : }
6960 : }
6961 0 : return true;
6962 : }
6963 :
6964 0 : static PyObject *unpack_py_drepl_takeFSMORole_args_out(struct drepl_takeFSMORole *r)
6965 : {
6966 : PyObject *result;
6967 0 : result = Py_None;
6968 0 : Py_INCREF(result);
6969 0 : if (!W_ERROR_IS_OK(r->out.result)) {
6970 0 : PyErr_SetWERROR(r->out.result);
6971 0 : return NULL;
6972 : }
6973 :
6974 0 : return result;
6975 : }
6976 :
6977 :
6978 0 : static PyObject *py_drepl_trigger_repl_secret_in_get_user_dn(PyObject *obj, void *closure)
6979 : {
6980 0 : struct drepl_trigger_repl_secret *object = pytalloc_get_ptr(obj);
6981 : PyObject *py_user_dn;
6982 0 : py_user_dn = PyString_FromStringOrNULL(object->in.user_dn);
6983 0 : return py_user_dn;
6984 : }
6985 :
6986 0 : static int py_drepl_trigger_repl_secret_in_set_user_dn(PyObject *py_obj, PyObject *value, void *closure)
6987 : {
6988 0 : struct drepl_trigger_repl_secret *object = pytalloc_get_ptr(py_obj);
6989 0 : if (value == NULL) {
6990 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.user_dn");
6991 0 : return -1;
6992 : }
6993 : {
6994 : const char *test_str;
6995 : const char *talloc_str;
6996 0 : PyObject *unicode = NULL;
6997 0 : if (PyUnicode_Check(value)) {
6998 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
6999 0 : if (unicode == NULL) {
7000 0 : return -1;
7001 : }
7002 0 : test_str = PyBytes_AS_STRING(unicode);
7003 0 : } else if (PyBytes_Check(value)) {
7004 0 : test_str = PyBytes_AS_STRING(value);
7005 : } else {
7006 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7007 0 : return -1;
7008 : }
7009 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7010 0 : if (unicode != NULL) {
7011 0 : Py_DECREF(unicode);
7012 : }
7013 0 : if (talloc_str == NULL) {
7014 0 : PyErr_NoMemory();
7015 0 : return -1;
7016 : }
7017 0 : object->in.user_dn = talloc_str;
7018 : }
7019 0 : return 0;
7020 : }
7021 :
7022 : static PyGetSetDef py_drepl_trigger_repl_secret_getsetters[] = {
7023 : {
7024 : .name = discard_const_p(char, "in_user_dn"),
7025 : .get = py_drepl_trigger_repl_secret_in_get_user_dn,
7026 : .set = py_drepl_trigger_repl_secret_in_set_user_dn,
7027 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
7028 : },
7029 : { .name = NULL }
7030 : };
7031 :
7032 0 : static PyObject *py_drepl_trigger_repl_secret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7033 : {
7034 0 : PyObject *self = pytalloc_new(struct drepl_trigger_repl_secret, type);
7035 0 : return self;
7036 : }
7037 :
7038 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
7039 : {
7040 :
7041 :
7042 0 : return PyLong_FromLong(10);
7043 : }
7044 :
7045 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
7046 : {
7047 0 : const struct ndr_interface_call *call = NULL;
7048 0 : struct drepl_trigger_repl_secret *object = pytalloc_get_ptr(py_obj);
7049 0 : PyObject *ret = NULL;
7050 0 : struct ndr_push *push = NULL;
7051 : DATA_BLOB blob;
7052 : enum ndr_err_code err;
7053 :
7054 0 : if (ndr_table_irpc.num_calls < 11) {
7055 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_drepl_trigger_repl_secret_ndr_pack");
7056 0 : return NULL;
7057 : }
7058 0 : call = &ndr_table_irpc.calls[10];
7059 :
7060 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
7061 0 : if (push == NULL) {
7062 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7063 0 : return NULL;
7064 : }
7065 :
7066 0 : push->flags |= ndr_push_flags;
7067 :
7068 0 : err = call->ndr_push(push, ndr_inout_flags, object);
7069 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7070 0 : TALLOC_FREE(push);
7071 0 : PyErr_SetNdrError(err);
7072 0 : return NULL;
7073 : }
7074 0 : blob = ndr_push_blob(push);
7075 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7076 0 : TALLOC_FREE(push);
7077 0 : return ret;
7078 : }
7079 :
7080 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7081 : {
7082 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7083 0 : PyObject *bigendian_obj = NULL;
7084 0 : PyObject *ndr64_obj = NULL;
7085 0 : libndr_flags ndr_push_flags = 0;
7086 :
7087 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
7088 : discard_const_p(char *, kwnames),
7089 : &bigendian_obj,
7090 : &ndr64_obj)) {
7091 0 : return NULL;
7092 : }
7093 :
7094 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7095 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7096 : }
7097 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7098 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7099 : }
7100 :
7101 0 : return py_drepl_trigger_repl_secret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
7102 : }
7103 :
7104 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7105 : {
7106 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7107 0 : PyObject *bigendian_obj = NULL;
7108 0 : PyObject *ndr64_obj = NULL;
7109 0 : libndr_flags ndr_push_flags = 0;
7110 :
7111 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
7112 : discard_const_p(char *, kwnames),
7113 : &bigendian_obj,
7114 : &ndr64_obj)) {
7115 0 : return NULL;
7116 : }
7117 :
7118 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7119 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7120 : }
7121 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7122 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7123 : }
7124 :
7125 0 : return py_drepl_trigger_repl_secret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
7126 : }
7127 :
7128 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
7129 : {
7130 0 : const struct ndr_interface_call *call = NULL;
7131 0 : struct drepl_trigger_repl_secret *object = pytalloc_get_ptr(py_obj);
7132 0 : struct ndr_pull *pull = NULL;
7133 : enum ndr_err_code err;
7134 :
7135 0 : if (ndr_table_irpc.num_calls < 11) {
7136 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_drepl_trigger_repl_secret_ndr_unpack");
7137 0 : return NULL;
7138 : }
7139 0 : call = &ndr_table_irpc.calls[10];
7140 :
7141 0 : pull = ndr_pull_init_blob(blob, object);
7142 0 : if (pull == NULL) {
7143 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7144 0 : return NULL;
7145 : }
7146 :
7147 0 : pull->flags |= ndr_pull_flags;
7148 :
7149 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
7150 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7151 0 : TALLOC_FREE(pull);
7152 0 : PyErr_SetNdrError(err);
7153 0 : return NULL;
7154 : }
7155 0 : if (!allow_remaining) {
7156 : uint32_t highest_ofs;
7157 :
7158 0 : if (pull->offset > pull->relative_highest_offset) {
7159 0 : highest_ofs = pull->offset;
7160 : } else {
7161 0 : highest_ofs = pull->relative_highest_offset;
7162 : }
7163 0 : if (highest_ofs < pull->data_size) {
7164 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
7165 : "not all bytes consumed ofs[%u] size[%u]",
7166 : highest_ofs, pull->data_size);
7167 0 : TALLOC_FREE(pull);
7168 0 : PyErr_SetNdrError(err);
7169 0 : return NULL;
7170 : }
7171 : }
7172 :
7173 0 : TALLOC_FREE(pull);
7174 0 : Py_RETURN_NONE;
7175 : }
7176 :
7177 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7178 : {
7179 : DATA_BLOB blob;
7180 0 : Py_ssize_t blob_length = 0;
7181 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7182 0 : PyObject *bigendian_obj = NULL;
7183 0 : PyObject *ndr64_obj = NULL;
7184 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7185 0 : PyObject *allow_remaining_obj = NULL;
7186 0 : bool allow_remaining = false;
7187 :
7188 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
7189 : discard_const_p(char *, kwnames),
7190 : &blob.data, &blob_length,
7191 : &bigendian_obj,
7192 : &ndr64_obj,
7193 : &allow_remaining_obj)) {
7194 0 : return NULL;
7195 : }
7196 0 : blob.length = blob_length;
7197 :
7198 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7199 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7200 : }
7201 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7202 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7203 : }
7204 :
7205 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7206 0 : allow_remaining = true;
7207 : }
7208 :
7209 0 : return py_drepl_trigger_repl_secret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
7210 : }
7211 :
7212 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7213 : {
7214 : DATA_BLOB blob;
7215 0 : Py_ssize_t blob_length = 0;
7216 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7217 0 : PyObject *bigendian_obj = NULL;
7218 0 : PyObject *ndr64_obj = NULL;
7219 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7220 0 : PyObject *allow_remaining_obj = NULL;
7221 0 : bool allow_remaining = false;
7222 :
7223 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
7224 : discard_const_p(char *, kwnames),
7225 : &blob.data, &blob_length,
7226 : &bigendian_obj,
7227 : &ndr64_obj,
7228 : &allow_remaining_obj)) {
7229 0 : return NULL;
7230 : }
7231 0 : blob.length = blob_length;
7232 :
7233 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7234 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7235 : }
7236 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7237 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7238 : }
7239 :
7240 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7241 0 : allow_remaining = true;
7242 : }
7243 :
7244 0 : return py_drepl_trigger_repl_secret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
7245 : }
7246 :
7247 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
7248 : {
7249 0 : const struct ndr_interface_call *call = NULL;
7250 0 : struct drepl_trigger_repl_secret *object = pytalloc_get_ptr(py_obj);
7251 : PyObject *ret;
7252 : char *retstr;
7253 :
7254 0 : if (ndr_table_irpc.num_calls < 11) {
7255 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_drepl_trigger_repl_secret_ndr_print");
7256 0 : return NULL;
7257 : }
7258 0 : call = &ndr_table_irpc.calls[10];
7259 :
7260 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
7261 0 : ret = PyUnicode_FromString(retstr);
7262 0 : TALLOC_FREE(retstr);
7263 :
7264 0 : return ret;
7265 : }
7266 :
7267 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7268 : {
7269 0 : return py_drepl_trigger_repl_secret_ndr_print(py_obj, "drepl_trigger_repl_secret_in", NDR_IN);
7270 : }
7271 :
7272 0 : static PyObject *py_drepl_trigger_repl_secret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7273 : {
7274 0 : return py_drepl_trigger_repl_secret_ndr_print(py_obj, "drepl_trigger_repl_secret_out", NDR_OUT);
7275 : }
7276 :
7277 : static PyMethodDef py_drepl_trigger_repl_secret_methods[] = {
7278 : { "opnum", (PyCFunction)py_drepl_trigger_repl_secret_ndr_opnum, METH_NOARGS|METH_CLASS,
7279 : "irpc.drepl_trigger_repl_secret.opnum() -> 10 (0x0a) " },
7280 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drepl_trigger_repl_secret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
7281 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
7282 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drepl_trigger_repl_secret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
7283 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
7284 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drepl_trigger_repl_secret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
7285 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
7286 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_drepl_trigger_repl_secret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
7287 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
7288 : { "__ndr_print_in__", (PyCFunction)py_drepl_trigger_repl_secret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
7289 : { "__ndr_print_out__", (PyCFunction)py_drepl_trigger_repl_secret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
7290 : { NULL, NULL, 0, NULL }
7291 : };
7292 :
7293 :
7294 : static PyTypeObject drepl_trigger_repl_secret_Type = {
7295 : PyVarObject_HEAD_INIT(NULL, 0)
7296 : .tp_name = "irpc.drepl_trigger_repl_secret",
7297 : .tp_getset = py_drepl_trigger_repl_secret_getsetters,
7298 : .tp_methods = py_drepl_trigger_repl_secret_methods,
7299 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7300 : .tp_new = py_drepl_trigger_repl_secret_new,
7301 : };
7302 :
7303 0 : static bool pack_py_drepl_trigger_repl_secret_args_in(PyObject *args, PyObject *kwargs, struct drepl_trigger_repl_secret *r)
7304 : {
7305 : PyObject *py_user_dn;
7306 0 : const char *kwnames[] = {
7307 : "user_dn", NULL
7308 : };
7309 :
7310 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:drepl_trigger_repl_secret", discard_const_p(char *, kwnames), &py_user_dn)) {
7311 0 : return false;
7312 : }
7313 :
7314 0 : if (py_user_dn == NULL) {
7315 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.user_dn");
7316 0 : return false;
7317 : }
7318 : {
7319 : const char *test_str;
7320 : const char *talloc_str;
7321 0 : PyObject *unicode = NULL;
7322 0 : if (PyUnicode_Check(py_user_dn)) {
7323 0 : unicode = PyUnicode_AsEncodedString(py_user_dn, "utf-8", "ignore");
7324 0 : if (unicode == NULL) {
7325 0 : return false;
7326 : }
7327 0 : test_str = PyBytes_AS_STRING(unicode);
7328 0 : } else if (PyBytes_Check(py_user_dn)) {
7329 0 : test_str = PyBytes_AS_STRING(py_user_dn);
7330 : } else {
7331 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_user_dn)->tp_name);
7332 0 : return false;
7333 : }
7334 0 : talloc_str = talloc_strdup(r, test_str);
7335 0 : if (unicode != NULL) {
7336 0 : Py_DECREF(unicode);
7337 : }
7338 0 : if (talloc_str == NULL) {
7339 0 : PyErr_NoMemory();
7340 0 : return false;
7341 : }
7342 0 : r->in.user_dn = talloc_str;
7343 : }
7344 0 : return true;
7345 : }
7346 :
7347 0 : static PyObject *unpack_py_drepl_trigger_repl_secret_args_out(struct drepl_trigger_repl_secret *r)
7348 : {
7349 : PyObject *result;
7350 0 : result = Py_None;
7351 0 : Py_INCREF(result);
7352 0 : return result;
7353 : }
7354 :
7355 :
7356 0 : static PyObject *py_dnsupdate_RODC_in_get_dom_sid(PyObject *obj, void *closure)
7357 : {
7358 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(obj);
7359 : PyObject *py_dom_sid;
7360 0 : if (object->in.dom_sid == NULL) {
7361 0 : Py_RETURN_NONE;
7362 : }
7363 0 : if (object->in.dom_sid == NULL) {
7364 0 : py_dom_sid = Py_None;
7365 0 : Py_INCREF(py_dom_sid);
7366 : } else {
7367 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
7368 : }
7369 0 : return py_dom_sid;
7370 : }
7371 :
7372 0 : static int py_dnsupdate_RODC_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
7373 : {
7374 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7375 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
7376 0 : if (value == NULL) {
7377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dom_sid");
7378 0 : return -1;
7379 : }
7380 0 : if (value == Py_None) {
7381 0 : object->in.dom_sid = NULL;
7382 : } else {
7383 0 : object->in.dom_sid = NULL;
7384 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
7385 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7386 0 : PyErr_NoMemory();
7387 0 : return -1;
7388 : }
7389 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
7390 : }
7391 0 : return 0;
7392 : }
7393 :
7394 0 : static PyObject *py_dnsupdate_RODC_in_get_site_name(PyObject *obj, void *closure)
7395 : {
7396 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(obj);
7397 : PyObject *py_site_name;
7398 0 : if (object->in.site_name == NULL) {
7399 0 : Py_RETURN_NONE;
7400 : }
7401 0 : if (object->in.site_name == NULL) {
7402 0 : py_site_name = Py_None;
7403 0 : Py_INCREF(py_site_name);
7404 : } else {
7405 0 : if (object->in.site_name == NULL) {
7406 0 : py_site_name = Py_None;
7407 0 : Py_INCREF(py_site_name);
7408 : } else {
7409 0 : py_site_name = PyUnicode_Decode(object->in.site_name, strlen(object->in.site_name), "utf-8", "ignore");
7410 : }
7411 : }
7412 0 : return py_site_name;
7413 : }
7414 :
7415 0 : static int py_dnsupdate_RODC_in_set_site_name(PyObject *py_obj, PyObject *value, void *closure)
7416 : {
7417 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7418 0 : if (value == NULL) {
7419 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.site_name");
7420 0 : return -1;
7421 : }
7422 0 : if (value == Py_None) {
7423 0 : object->in.site_name = NULL;
7424 : } else {
7425 0 : object->in.site_name = NULL;
7426 : {
7427 : const char *test_str;
7428 : const char *talloc_str;
7429 0 : PyObject *unicode = NULL;
7430 0 : if (PyUnicode_Check(value)) {
7431 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
7432 0 : if (unicode == NULL) {
7433 0 : return -1;
7434 : }
7435 0 : test_str = PyBytes_AS_STRING(unicode);
7436 0 : } else if (PyBytes_Check(value)) {
7437 0 : test_str = PyBytes_AS_STRING(value);
7438 : } else {
7439 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
7440 0 : return -1;
7441 : }
7442 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
7443 0 : if (unicode != NULL) {
7444 0 : Py_DECREF(unicode);
7445 : }
7446 0 : if (talloc_str == NULL) {
7447 0 : PyErr_NoMemory();
7448 0 : return -1;
7449 : }
7450 0 : object->in.site_name = talloc_str;
7451 : }
7452 : }
7453 0 : return 0;
7454 : }
7455 :
7456 0 : static PyObject *py_dnsupdate_RODC_in_get_dns_ttl(PyObject *obj, void *closure)
7457 : {
7458 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(obj);
7459 : PyObject *py_dns_ttl;
7460 0 : py_dns_ttl = PyLong_FromUnsignedLongLong((uint32_t)(object->in.dns_ttl));
7461 0 : return py_dns_ttl;
7462 : }
7463 :
7464 0 : static int py_dnsupdate_RODC_in_set_dns_ttl(PyObject *py_obj, PyObject *value, void *closure)
7465 : {
7466 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7467 0 : if (value == NULL) {
7468 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dns_ttl");
7469 0 : return -1;
7470 : }
7471 : {
7472 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.dns_ttl));
7473 0 : if (PyLong_Check(value)) {
7474 : unsigned long long test_var;
7475 0 : test_var = PyLong_AsUnsignedLongLong(value);
7476 0 : if (PyErr_Occurred() != NULL) {
7477 0 : return -1;
7478 : }
7479 0 : if (test_var > uint_max) {
7480 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7481 : PyLong_Type.tp_name, uint_max, test_var);
7482 0 : return -1;
7483 : }
7484 0 : object->in.dns_ttl = test_var;
7485 : } else {
7486 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7487 : PyLong_Type.tp_name);
7488 0 : return -1;
7489 : }
7490 : }
7491 0 : return 0;
7492 : }
7493 :
7494 0 : static PyObject *py_dnsupdate_RODC_in_get_dns_names(PyObject *obj, void *closure)
7495 : {
7496 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(obj);
7497 : PyObject *py_dns_names;
7498 0 : if (object->in.dns_names == NULL) {
7499 0 : Py_RETURN_NONE;
7500 : }
7501 0 : py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, object->in.dns_names, object->in.dns_names);
7502 0 : return py_dns_names;
7503 : }
7504 :
7505 0 : static int py_dnsupdate_RODC_in_set_dns_names(PyObject *py_obj, PyObject *value, void *closure)
7506 : {
7507 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7508 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dns_names));
7509 0 : if (value == NULL) {
7510 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dns_names");
7511 0 : return -1;
7512 : }
7513 0 : object->in.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dns_names);
7514 0 : if (object->in.dns_names == NULL) {
7515 0 : PyErr_NoMemory();
7516 0 : return -1;
7517 : }
7518 0 : PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;);
7519 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7520 0 : PyErr_NoMemory();
7521 0 : return -1;
7522 : }
7523 0 : object->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value);
7524 0 : return 0;
7525 : }
7526 :
7527 0 : static PyObject *py_dnsupdate_RODC_out_get_dns_names(PyObject *obj, void *closure)
7528 : {
7529 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(obj);
7530 : PyObject *py_dns_names;
7531 0 : if (object->out.dns_names == NULL) {
7532 0 : Py_RETURN_NONE;
7533 : }
7534 0 : py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, object->out.dns_names, object->out.dns_names);
7535 0 : return py_dns_names;
7536 : }
7537 :
7538 0 : static int py_dnsupdate_RODC_out_set_dns_names(PyObject *py_obj, PyObject *value, void *closure)
7539 : {
7540 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7541 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dns_names));
7542 0 : if (value == NULL) {
7543 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.dns_names");
7544 0 : return -1;
7545 : }
7546 0 : object->out.dns_names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dns_names);
7547 0 : if (object->out.dns_names == NULL) {
7548 0 : PyErr_NoMemory();
7549 0 : return -1;
7550 : }
7551 0 : PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, value, return -1;);
7552 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7553 0 : PyErr_NoMemory();
7554 0 : return -1;
7555 : }
7556 0 : object->out.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(value);
7557 0 : return 0;
7558 : }
7559 :
7560 0 : static PyObject *py_dnsupdate_RODC_get_result(PyObject *obj, void *closure)
7561 : {
7562 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(obj);
7563 : PyObject *py_result;
7564 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
7565 0 : return py_result;
7566 : }
7567 :
7568 0 : static int py_dnsupdate_RODC_set_result(PyObject *py_obj, PyObject *value, void *closure)
7569 : {
7570 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7571 0 : if (value == NULL) {
7572 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
7573 0 : return -1;
7574 : }
7575 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
7576 0 : return 0;
7577 : }
7578 :
7579 : static PyGetSetDef py_dnsupdate_RODC_getsetters[] = {
7580 : {
7581 : .name = discard_const_p(char, "in_dom_sid"),
7582 : .get = py_dnsupdate_RODC_in_get_dom_sid,
7583 : .set = py_dnsupdate_RODC_in_set_dom_sid,
7584 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid")
7585 : },
7586 : {
7587 : .name = discard_const_p(char, "in_site_name"),
7588 : .get = py_dnsupdate_RODC_in_get_site_name,
7589 : .set = py_dnsupdate_RODC_in_set_site_name,
7590 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
7591 : },
7592 : {
7593 : .name = discard_const_p(char, "in_dns_ttl"),
7594 : .get = py_dnsupdate_RODC_in_get_dns_ttl,
7595 : .set = py_dnsupdate_RODC_in_set_dns_ttl,
7596 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7597 : },
7598 : {
7599 : .name = discard_const_p(char, "in_dns_names"),
7600 : .get = py_dnsupdate_RODC_in_get_dns_names,
7601 : .set = py_dnsupdate_RODC_in_set_dns_names,
7602 : .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY")
7603 : },
7604 : {
7605 : .name = discard_const_p(char, "out_dns_names"),
7606 : .get = py_dnsupdate_RODC_out_get_dns_names,
7607 : .set = py_dnsupdate_RODC_out_set_dns_names,
7608 : .doc = discard_const_p(char, "PIDL-generated element of base type NL_DNS_NAME_INFO_ARRAY")
7609 : },
7610 : {
7611 : .name = discard_const_p(char, "result"),
7612 : .get = py_dnsupdate_RODC_get_result,
7613 : .set = py_dnsupdate_RODC_set_result,
7614 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
7615 : },
7616 : { .name = NULL }
7617 : };
7618 :
7619 0 : static PyObject *py_dnsupdate_RODC_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7620 : {
7621 0 : PyObject *self = pytalloc_new(struct dnsupdate_RODC, type);
7622 0 : struct dnsupdate_RODC *_self = (struct dnsupdate_RODC *)pytalloc_get_ptr(self);
7623 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
7624 0 : _self->in.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY);
7625 0 : _self->out.dns_names = talloc_zero(mem_ctx, struct NL_DNS_NAME_INFO_ARRAY);
7626 0 : return self;
7627 : }
7628 :
7629 0 : static PyObject *py_dnsupdate_RODC_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
7630 : {
7631 :
7632 :
7633 0 : return PyLong_FromLong(11);
7634 : }
7635 :
7636 0 : static PyObject *py_dnsupdate_RODC_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
7637 : {
7638 0 : const struct ndr_interface_call *call = NULL;
7639 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7640 0 : PyObject *ret = NULL;
7641 0 : struct ndr_push *push = NULL;
7642 : DATA_BLOB blob;
7643 : enum ndr_err_code err;
7644 :
7645 0 : if (ndr_table_irpc.num_calls < 12) {
7646 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dnsupdate_RODC_ndr_pack");
7647 0 : return NULL;
7648 : }
7649 0 : call = &ndr_table_irpc.calls[11];
7650 :
7651 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
7652 0 : if (push == NULL) {
7653 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7654 0 : return NULL;
7655 : }
7656 :
7657 0 : push->flags |= ndr_push_flags;
7658 :
7659 0 : err = call->ndr_push(push, ndr_inout_flags, object);
7660 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7661 0 : TALLOC_FREE(push);
7662 0 : PyErr_SetNdrError(err);
7663 0 : return NULL;
7664 : }
7665 0 : blob = ndr_push_blob(push);
7666 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7667 0 : TALLOC_FREE(push);
7668 0 : return ret;
7669 : }
7670 :
7671 0 : static PyObject *py_dnsupdate_RODC_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7672 : {
7673 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7674 0 : PyObject *bigendian_obj = NULL;
7675 0 : PyObject *ndr64_obj = NULL;
7676 0 : libndr_flags ndr_push_flags = 0;
7677 :
7678 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
7679 : discard_const_p(char *, kwnames),
7680 : &bigendian_obj,
7681 : &ndr64_obj)) {
7682 0 : return NULL;
7683 : }
7684 :
7685 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7686 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7687 : }
7688 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7689 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7690 : }
7691 :
7692 0 : return py_dnsupdate_RODC_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
7693 : }
7694 :
7695 0 : static PyObject *py_dnsupdate_RODC_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7696 : {
7697 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
7698 0 : PyObject *bigendian_obj = NULL;
7699 0 : PyObject *ndr64_obj = NULL;
7700 0 : libndr_flags ndr_push_flags = 0;
7701 :
7702 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
7703 : discard_const_p(char *, kwnames),
7704 : &bigendian_obj,
7705 : &ndr64_obj)) {
7706 0 : return NULL;
7707 : }
7708 :
7709 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7710 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
7711 : }
7712 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7713 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
7714 : }
7715 :
7716 0 : return py_dnsupdate_RODC_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
7717 : }
7718 :
7719 0 : static PyObject *py_dnsupdate_RODC_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
7720 : {
7721 0 : const struct ndr_interface_call *call = NULL;
7722 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7723 0 : struct ndr_pull *pull = NULL;
7724 : enum ndr_err_code err;
7725 :
7726 0 : if (ndr_table_irpc.num_calls < 12) {
7727 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dnsupdate_RODC_ndr_unpack");
7728 0 : return NULL;
7729 : }
7730 0 : call = &ndr_table_irpc.calls[11];
7731 :
7732 0 : pull = ndr_pull_init_blob(blob, object);
7733 0 : if (pull == NULL) {
7734 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7735 0 : return NULL;
7736 : }
7737 :
7738 0 : pull->flags |= ndr_pull_flags;
7739 :
7740 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
7741 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7742 0 : TALLOC_FREE(pull);
7743 0 : PyErr_SetNdrError(err);
7744 0 : return NULL;
7745 : }
7746 0 : if (!allow_remaining) {
7747 : uint32_t highest_ofs;
7748 :
7749 0 : if (pull->offset > pull->relative_highest_offset) {
7750 0 : highest_ofs = pull->offset;
7751 : } else {
7752 0 : highest_ofs = pull->relative_highest_offset;
7753 : }
7754 0 : if (highest_ofs < pull->data_size) {
7755 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
7756 : "not all bytes consumed ofs[%u] size[%u]",
7757 : highest_ofs, pull->data_size);
7758 0 : TALLOC_FREE(pull);
7759 0 : PyErr_SetNdrError(err);
7760 0 : return NULL;
7761 : }
7762 : }
7763 :
7764 0 : TALLOC_FREE(pull);
7765 0 : Py_RETURN_NONE;
7766 : }
7767 :
7768 0 : static PyObject *py_dnsupdate_RODC_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7769 : {
7770 : DATA_BLOB blob;
7771 0 : Py_ssize_t blob_length = 0;
7772 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7773 0 : PyObject *bigendian_obj = NULL;
7774 0 : PyObject *ndr64_obj = NULL;
7775 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7776 0 : PyObject *allow_remaining_obj = NULL;
7777 0 : bool allow_remaining = false;
7778 :
7779 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
7780 : discard_const_p(char *, kwnames),
7781 : &blob.data, &blob_length,
7782 : &bigendian_obj,
7783 : &ndr64_obj,
7784 : &allow_remaining_obj)) {
7785 0 : return NULL;
7786 : }
7787 0 : blob.length = blob_length;
7788 :
7789 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7790 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7791 : }
7792 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7793 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7794 : }
7795 :
7796 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7797 0 : allow_remaining = true;
7798 : }
7799 :
7800 0 : return py_dnsupdate_RODC_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
7801 : }
7802 :
7803 0 : static PyObject *py_dnsupdate_RODC_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7804 : {
7805 : DATA_BLOB blob;
7806 0 : Py_ssize_t blob_length = 0;
7807 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
7808 0 : PyObject *bigendian_obj = NULL;
7809 0 : PyObject *ndr64_obj = NULL;
7810 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
7811 0 : PyObject *allow_remaining_obj = NULL;
7812 0 : bool allow_remaining = false;
7813 :
7814 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
7815 : discard_const_p(char *, kwnames),
7816 : &blob.data, &blob_length,
7817 : &bigendian_obj,
7818 : &ndr64_obj,
7819 : &allow_remaining_obj)) {
7820 0 : return NULL;
7821 : }
7822 0 : blob.length = blob_length;
7823 :
7824 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
7825 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
7826 : }
7827 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
7828 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
7829 : }
7830 :
7831 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7832 0 : allow_remaining = true;
7833 : }
7834 :
7835 0 : return py_dnsupdate_RODC_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
7836 : }
7837 :
7838 0 : static PyObject *py_dnsupdate_RODC_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
7839 : {
7840 0 : const struct ndr_interface_call *call = NULL;
7841 0 : struct dnsupdate_RODC *object = pytalloc_get_ptr(py_obj);
7842 : PyObject *ret;
7843 : char *retstr;
7844 :
7845 0 : if (ndr_table_irpc.num_calls < 12) {
7846 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dnsupdate_RODC_ndr_print");
7847 0 : return NULL;
7848 : }
7849 0 : call = &ndr_table_irpc.calls[11];
7850 :
7851 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
7852 0 : ret = PyUnicode_FromString(retstr);
7853 0 : TALLOC_FREE(retstr);
7854 :
7855 0 : return ret;
7856 : }
7857 :
7858 0 : static PyObject *py_dnsupdate_RODC_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7859 : {
7860 0 : return py_dnsupdate_RODC_ndr_print(py_obj, "dnsupdate_RODC_in", NDR_IN);
7861 : }
7862 :
7863 0 : static PyObject *py_dnsupdate_RODC_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7864 : {
7865 0 : return py_dnsupdate_RODC_ndr_print(py_obj, "dnsupdate_RODC_out", NDR_OUT);
7866 : }
7867 :
7868 : static PyMethodDef py_dnsupdate_RODC_methods[] = {
7869 : { "opnum", (PyCFunction)py_dnsupdate_RODC_ndr_opnum, METH_NOARGS|METH_CLASS,
7870 : "irpc.dnsupdate_RODC.opnum() -> 11 (0x0b) " },
7871 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsupdate_RODC_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
7872 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
7873 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsupdate_RODC_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
7874 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
7875 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsupdate_RODC_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
7876 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
7877 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnsupdate_RODC_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
7878 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
7879 : { "__ndr_print_in__", (PyCFunction)py_dnsupdate_RODC_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
7880 : { "__ndr_print_out__", (PyCFunction)py_dnsupdate_RODC_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
7881 : { NULL, NULL, 0, NULL }
7882 : };
7883 :
7884 :
7885 : static PyTypeObject dnsupdate_RODC_Type = {
7886 : PyVarObject_HEAD_INIT(NULL, 0)
7887 : .tp_name = "irpc.dnsupdate_RODC",
7888 : .tp_getset = py_dnsupdate_RODC_getsetters,
7889 : .tp_methods = py_dnsupdate_RODC_methods,
7890 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7891 : .tp_new = py_dnsupdate_RODC_new,
7892 : };
7893 :
7894 0 : static bool pack_py_dnsupdate_RODC_args_in(PyObject *args, PyObject *kwargs, struct dnsupdate_RODC *r)
7895 : {
7896 : PyObject *py_dom_sid;
7897 : PyObject *py_site_name;
7898 : PyObject *py_dns_ttl;
7899 : PyObject *py_dns_names;
7900 0 : const char *kwnames[] = {
7901 : "dom_sid", "site_name", "dns_ttl", "dns_names", NULL
7902 : };
7903 :
7904 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:dnsupdate_RODC", discard_const_p(char *, kwnames), &py_dom_sid, &py_site_name, &py_dns_ttl, &py_dns_names)) {
7905 0 : return false;
7906 : }
7907 :
7908 0 : if (py_dom_sid == NULL) {
7909 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dom_sid");
7910 0 : return false;
7911 : }
7912 0 : if (py_dom_sid == Py_None) {
7913 0 : r->in.dom_sid = NULL;
7914 : } else {
7915 0 : r->in.dom_sid = NULL;
7916 0 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
7917 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
7918 0 : PyErr_NoMemory();
7919 0 : return false;
7920 : }
7921 0 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
7922 : }
7923 0 : if (py_site_name == NULL) {
7924 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.site_name");
7925 0 : return false;
7926 : }
7927 0 : if (py_site_name == Py_None) {
7928 0 : r->in.site_name = NULL;
7929 : } else {
7930 0 : r->in.site_name = NULL;
7931 : {
7932 : const char *test_str;
7933 : const char *talloc_str;
7934 0 : PyObject *unicode = NULL;
7935 0 : if (PyUnicode_Check(py_site_name)) {
7936 0 : unicode = PyUnicode_AsEncodedString(py_site_name, "utf-8", "ignore");
7937 0 : if (unicode == NULL) {
7938 0 : return false;
7939 : }
7940 0 : test_str = PyBytes_AS_STRING(unicode);
7941 0 : } else if (PyBytes_Check(py_site_name)) {
7942 0 : test_str = PyBytes_AS_STRING(py_site_name);
7943 : } else {
7944 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_site_name)->tp_name);
7945 0 : return false;
7946 : }
7947 0 : talloc_str = talloc_strdup(r, test_str);
7948 0 : if (unicode != NULL) {
7949 0 : Py_DECREF(unicode);
7950 : }
7951 0 : if (talloc_str == NULL) {
7952 0 : PyErr_NoMemory();
7953 0 : return false;
7954 : }
7955 0 : r->in.site_name = talloc_str;
7956 : }
7957 : }
7958 0 : if (py_dns_ttl == NULL) {
7959 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dns_ttl");
7960 0 : return false;
7961 : }
7962 : {
7963 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.dns_ttl));
7964 0 : if (PyLong_Check(py_dns_ttl)) {
7965 : unsigned long long test_var;
7966 0 : test_var = PyLong_AsUnsignedLongLong(py_dns_ttl);
7967 0 : if (PyErr_Occurred() != NULL) {
7968 0 : return false;
7969 : }
7970 0 : if (test_var > uint_max) {
7971 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7972 : PyLong_Type.tp_name, uint_max, test_var);
7973 0 : return false;
7974 : }
7975 0 : r->in.dns_ttl = test_var;
7976 : } else {
7977 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7978 : PyLong_Type.tp_name);
7979 0 : return false;
7980 : }
7981 : }
7982 0 : if (py_dns_names == NULL) {
7983 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dns_names");
7984 0 : return false;
7985 : }
7986 0 : r->in.dns_names = talloc_ptrtype(r, r->in.dns_names);
7987 0 : if (r->in.dns_names == NULL) {
7988 0 : PyErr_NoMemory();
7989 0 : return false;
7990 : }
7991 0 : PY_CHECK_TYPE(NL_DNS_NAME_INFO_ARRAY_Type, py_dns_names, return false;);
7992 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dns_names)) == NULL) {
7993 0 : PyErr_NoMemory();
7994 0 : return false;
7995 : }
7996 0 : r->in.dns_names = (struct NL_DNS_NAME_INFO_ARRAY *)pytalloc_get_ptr(py_dns_names);
7997 0 : return true;
7998 : }
7999 :
8000 0 : static PyObject *unpack_py_dnsupdate_RODC_args_out(struct dnsupdate_RODC *r)
8001 : {
8002 : PyObject *result;
8003 : PyObject *py_dns_names;
8004 0 : py_dns_names = pytalloc_reference_ex(NL_DNS_NAME_INFO_ARRAY_Type, r->out.dns_names, r->out.dns_names);
8005 0 : result = py_dns_names;
8006 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
8007 0 : PyErr_SetNTSTATUS(r->out.result);
8008 0 : return NULL;
8009 : }
8010 :
8011 0 : return result;
8012 : }
8013 :
8014 :
8015 0 : static PyObject *py_dnssrv_reload_dns_zones_get_result(PyObject *obj, void *closure)
8016 : {
8017 0 : struct dnssrv_reload_dns_zones *object = pytalloc_get_ptr(obj);
8018 : PyObject *py_result;
8019 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
8020 0 : return py_result;
8021 : }
8022 :
8023 0 : static int py_dnssrv_reload_dns_zones_set_result(PyObject *py_obj, PyObject *value, void *closure)
8024 : {
8025 0 : struct dnssrv_reload_dns_zones *object = pytalloc_get_ptr(py_obj);
8026 0 : if (value == NULL) {
8027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
8028 0 : return -1;
8029 : }
8030 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
8031 0 : return 0;
8032 : }
8033 :
8034 : static PyGetSetDef py_dnssrv_reload_dns_zones_getsetters[] = {
8035 : {
8036 : .name = discard_const_p(char, "result"),
8037 : .get = py_dnssrv_reload_dns_zones_get_result,
8038 : .set = py_dnssrv_reload_dns_zones_set_result,
8039 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
8040 : },
8041 : { .name = NULL }
8042 : };
8043 :
8044 0 : static PyObject *py_dnssrv_reload_dns_zones_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8045 : {
8046 0 : PyObject *self = pytalloc_new(struct dnssrv_reload_dns_zones, type);
8047 0 : return self;
8048 : }
8049 :
8050 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
8051 : {
8052 :
8053 :
8054 0 : return PyLong_FromLong(12);
8055 : }
8056 :
8057 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
8058 : {
8059 0 : const struct ndr_interface_call *call = NULL;
8060 0 : struct dnssrv_reload_dns_zones *object = pytalloc_get_ptr(py_obj);
8061 0 : PyObject *ret = NULL;
8062 0 : struct ndr_push *push = NULL;
8063 : DATA_BLOB blob;
8064 : enum ndr_err_code err;
8065 :
8066 0 : if (ndr_table_irpc.num_calls < 13) {
8067 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dnssrv_reload_dns_zones_ndr_pack");
8068 0 : return NULL;
8069 : }
8070 0 : call = &ndr_table_irpc.calls[12];
8071 :
8072 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
8073 0 : if (push == NULL) {
8074 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8075 0 : return NULL;
8076 : }
8077 :
8078 0 : push->flags |= ndr_push_flags;
8079 :
8080 0 : err = call->ndr_push(push, ndr_inout_flags, object);
8081 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8082 0 : TALLOC_FREE(push);
8083 0 : PyErr_SetNdrError(err);
8084 0 : return NULL;
8085 : }
8086 0 : blob = ndr_push_blob(push);
8087 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8088 0 : TALLOC_FREE(push);
8089 0 : return ret;
8090 : }
8091 :
8092 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8093 : {
8094 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8095 0 : PyObject *bigendian_obj = NULL;
8096 0 : PyObject *ndr64_obj = NULL;
8097 0 : libndr_flags ndr_push_flags = 0;
8098 :
8099 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
8100 : discard_const_p(char *, kwnames),
8101 : &bigendian_obj,
8102 : &ndr64_obj)) {
8103 0 : return NULL;
8104 : }
8105 :
8106 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8107 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8108 : }
8109 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8110 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8111 : }
8112 :
8113 0 : return py_dnssrv_reload_dns_zones_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
8114 : }
8115 :
8116 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8117 : {
8118 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
8119 0 : PyObject *bigendian_obj = NULL;
8120 0 : PyObject *ndr64_obj = NULL;
8121 0 : libndr_flags ndr_push_flags = 0;
8122 :
8123 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
8124 : discard_const_p(char *, kwnames),
8125 : &bigendian_obj,
8126 : &ndr64_obj)) {
8127 0 : return NULL;
8128 : }
8129 :
8130 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8131 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
8132 : }
8133 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8134 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
8135 : }
8136 :
8137 0 : return py_dnssrv_reload_dns_zones_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
8138 : }
8139 :
8140 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
8141 : {
8142 0 : const struct ndr_interface_call *call = NULL;
8143 0 : struct dnssrv_reload_dns_zones *object = pytalloc_get_ptr(py_obj);
8144 0 : struct ndr_pull *pull = NULL;
8145 : enum ndr_err_code err;
8146 :
8147 0 : if (ndr_table_irpc.num_calls < 13) {
8148 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dnssrv_reload_dns_zones_ndr_unpack");
8149 0 : return NULL;
8150 : }
8151 0 : call = &ndr_table_irpc.calls[12];
8152 :
8153 0 : pull = ndr_pull_init_blob(blob, object);
8154 0 : if (pull == NULL) {
8155 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8156 0 : return NULL;
8157 : }
8158 :
8159 0 : pull->flags |= ndr_pull_flags;
8160 :
8161 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
8162 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8163 0 : TALLOC_FREE(pull);
8164 0 : PyErr_SetNdrError(err);
8165 0 : return NULL;
8166 : }
8167 0 : if (!allow_remaining) {
8168 : uint32_t highest_ofs;
8169 :
8170 0 : if (pull->offset > pull->relative_highest_offset) {
8171 0 : highest_ofs = pull->offset;
8172 : } else {
8173 0 : highest_ofs = pull->relative_highest_offset;
8174 : }
8175 0 : if (highest_ofs < pull->data_size) {
8176 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
8177 : "not all bytes consumed ofs[%u] size[%u]",
8178 : highest_ofs, pull->data_size);
8179 0 : TALLOC_FREE(pull);
8180 0 : PyErr_SetNdrError(err);
8181 0 : return NULL;
8182 : }
8183 : }
8184 :
8185 0 : TALLOC_FREE(pull);
8186 0 : Py_RETURN_NONE;
8187 : }
8188 :
8189 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8190 : {
8191 : DATA_BLOB blob;
8192 0 : Py_ssize_t blob_length = 0;
8193 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8194 0 : PyObject *bigendian_obj = NULL;
8195 0 : PyObject *ndr64_obj = NULL;
8196 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8197 0 : PyObject *allow_remaining_obj = NULL;
8198 0 : bool allow_remaining = false;
8199 :
8200 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
8201 : discard_const_p(char *, kwnames),
8202 : &blob.data, &blob_length,
8203 : &bigendian_obj,
8204 : &ndr64_obj,
8205 : &allow_remaining_obj)) {
8206 0 : return NULL;
8207 : }
8208 0 : blob.length = blob_length;
8209 :
8210 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8211 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8212 : }
8213 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8214 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8215 : }
8216 :
8217 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8218 0 : allow_remaining = true;
8219 : }
8220 :
8221 0 : return py_dnssrv_reload_dns_zones_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
8222 : }
8223 :
8224 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8225 : {
8226 : DATA_BLOB blob;
8227 0 : Py_ssize_t blob_length = 0;
8228 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
8229 0 : PyObject *bigendian_obj = NULL;
8230 0 : PyObject *ndr64_obj = NULL;
8231 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
8232 0 : PyObject *allow_remaining_obj = NULL;
8233 0 : bool allow_remaining = false;
8234 :
8235 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
8236 : discard_const_p(char *, kwnames),
8237 : &blob.data, &blob_length,
8238 : &bigendian_obj,
8239 : &ndr64_obj,
8240 : &allow_remaining_obj)) {
8241 0 : return NULL;
8242 : }
8243 0 : blob.length = blob_length;
8244 :
8245 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
8246 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
8247 : }
8248 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
8249 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
8250 : }
8251 :
8252 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8253 0 : allow_remaining = true;
8254 : }
8255 :
8256 0 : return py_dnssrv_reload_dns_zones_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
8257 : }
8258 :
8259 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
8260 : {
8261 0 : const struct ndr_interface_call *call = NULL;
8262 0 : struct dnssrv_reload_dns_zones *object = pytalloc_get_ptr(py_obj);
8263 : PyObject *ret;
8264 : char *retstr;
8265 :
8266 0 : if (ndr_table_irpc.num_calls < 13) {
8267 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_dnssrv_reload_dns_zones_ndr_print");
8268 0 : return NULL;
8269 : }
8270 0 : call = &ndr_table_irpc.calls[12];
8271 :
8272 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
8273 0 : ret = PyUnicode_FromString(retstr);
8274 0 : TALLOC_FREE(retstr);
8275 :
8276 0 : return ret;
8277 : }
8278 :
8279 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8280 : {
8281 0 : return py_dnssrv_reload_dns_zones_ndr_print(py_obj, "dnssrv_reload_dns_zones_in", NDR_IN);
8282 : }
8283 :
8284 0 : static PyObject *py_dnssrv_reload_dns_zones_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8285 : {
8286 0 : return py_dnssrv_reload_dns_zones_ndr_print(py_obj, "dnssrv_reload_dns_zones_out", NDR_OUT);
8287 : }
8288 :
8289 : static PyMethodDef py_dnssrv_reload_dns_zones_methods[] = {
8290 : { "opnum", (PyCFunction)py_dnssrv_reload_dns_zones_ndr_opnum, METH_NOARGS|METH_CLASS,
8291 : "irpc.dnssrv_reload_dns_zones.opnum() -> 12 (0x0c) " },
8292 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnssrv_reload_dns_zones_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
8293 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
8294 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnssrv_reload_dns_zones_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
8295 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
8296 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnssrv_reload_dns_zones_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
8297 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
8298 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dnssrv_reload_dns_zones_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
8299 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
8300 : { "__ndr_print_in__", (PyCFunction)py_dnssrv_reload_dns_zones_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
8301 : { "__ndr_print_out__", (PyCFunction)py_dnssrv_reload_dns_zones_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
8302 : { NULL, NULL, 0, NULL }
8303 : };
8304 :
8305 :
8306 : static PyTypeObject dnssrv_reload_dns_zones_Type = {
8307 : PyVarObject_HEAD_INIT(NULL, 0)
8308 : .tp_name = "irpc.dnssrv_reload_dns_zones",
8309 : .tp_getset = py_dnssrv_reload_dns_zones_getsetters,
8310 : .tp_methods = py_dnssrv_reload_dns_zones_methods,
8311 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8312 : .tp_new = py_dnssrv_reload_dns_zones_new,
8313 : };
8314 :
8315 0 : static bool pack_py_dnssrv_reload_dns_zones_args_in(PyObject *args, PyObject *kwargs, struct dnssrv_reload_dns_zones *r)
8316 : {
8317 0 : const char *kwnames[] = {
8318 : NULL
8319 : };
8320 :
8321 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":dnssrv_reload_dns_zones", discard_const_p(char *, kwnames))) {
8322 0 : return false;
8323 : }
8324 :
8325 0 : return true;
8326 : }
8327 :
8328 0 : static PyObject *unpack_py_dnssrv_reload_dns_zones_args_out(struct dnssrv_reload_dns_zones *r)
8329 : {
8330 : PyObject *result;
8331 0 : result = Py_None;
8332 0 : Py_INCREF(result);
8333 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
8334 0 : PyErr_SetNTSTATUS(r->out.result);
8335 0 : return NULL;
8336 : }
8337 :
8338 0 : return result;
8339 : }
8340 :
8341 : const struct PyNdrRpcMethodDef py_ndr_irpc_methods[] = {
8342 : { "uptime", "S.uptime() -> start_time", (py_dcerpc_call_fn)dcerpc_irpc_uptime_r, (py_data_pack_fn)pack_py_irpc_uptime_args_in, (py_data_unpack_fn)unpack_py_irpc_uptime_args_out, 0, &ndr_table_irpc },
8343 : { "nbtd_information", "S.nbtd_information(level) -> info", (py_dcerpc_call_fn)dcerpc_nbtd_information_r, (py_data_pack_fn)pack_py_nbtd_information_args_in, (py_data_unpack_fn)unpack_py_nbtd_information_args_out, 1, &ndr_table_irpc },
8344 : { "nbtd_getdcname", "S.nbtd_getdcname(domainname, ip_address, my_computername, my_accountname, account_control, domain_sid) -> dcname", (py_dcerpc_call_fn)dcerpc_nbtd_getdcname_r, (py_data_pack_fn)pack_py_nbtd_getdcname_args_in, (py_data_unpack_fn)unpack_py_nbtd_getdcname_args_out, 2, &ndr_table_irpc },
8345 : { "nbtd_proxy_wins_challenge", "S.nbtd_proxy_wins_challenge(name, num_addrs, addrs) -> (num_addrs, addrs)", (py_dcerpc_call_fn)dcerpc_nbtd_proxy_wins_challenge_r, (py_data_pack_fn)pack_py_nbtd_proxy_wins_challenge_args_in, (py_data_unpack_fn)unpack_py_nbtd_proxy_wins_challenge_args_out, 3, &ndr_table_irpc },
8346 : { "nbtd_proxy_wins_release_demand", "S.nbtd_proxy_wins_release_demand(name, num_addrs, addrs) -> None", (py_dcerpc_call_fn)dcerpc_nbtd_proxy_wins_release_demand_r, (py_data_pack_fn)pack_py_nbtd_proxy_wins_release_demand_args_in, (py_data_unpack_fn)unpack_py_nbtd_proxy_wins_release_demand_args_out, 4, &ndr_table_irpc },
8347 : { "kdc_check_generic_kerberos", "S.kdc_check_generic_kerberos(generic_request) -> generic_reply", (py_dcerpc_call_fn)dcerpc_kdc_check_generic_kerberos_r, (py_data_pack_fn)pack_py_kdc_check_generic_kerberos_args_in, (py_data_unpack_fn)unpack_py_kdc_check_generic_kerberos_args_out, 5, &ndr_table_irpc },
8348 : { "smbsrv_information", "S.smbsrv_information(level) -> info", (py_dcerpc_call_fn)dcerpc_smbsrv_information_r, (py_data_pack_fn)pack_py_smbsrv_information_args_in, (py_data_unpack_fn)unpack_py_smbsrv_information_args_out, 6, &ndr_table_irpc },
8349 : { "samba_terminate", "S.samba_terminate(reason) -> None", (py_dcerpc_call_fn)dcerpc_samba_terminate_r, (py_data_pack_fn)pack_py_samba_terminate_args_in, (py_data_unpack_fn)unpack_py_samba_terminate_args_out, 7, &ndr_table_irpc },
8350 : { "dreplsrv_refresh", "S.dreplsrv_refresh() -> None", (py_dcerpc_call_fn)dcerpc_dreplsrv_refresh_r, (py_data_pack_fn)pack_py_dreplsrv_refresh_args_in, (py_data_unpack_fn)unpack_py_dreplsrv_refresh_args_out, 8, &ndr_table_irpc },
8351 : { "drepl_takeFSMORole", "S.drepl_takeFSMORole(role) -> None", (py_dcerpc_call_fn)dcerpc_drepl_takeFSMORole_r, (py_data_pack_fn)pack_py_drepl_takeFSMORole_args_in, (py_data_unpack_fn)unpack_py_drepl_takeFSMORole_args_out, 9, &ndr_table_irpc },
8352 : { "drepl_trigger_repl_secret", "S.drepl_trigger_repl_secret(user_dn) -> None", (py_dcerpc_call_fn)dcerpc_drepl_trigger_repl_secret_r, (py_data_pack_fn)pack_py_drepl_trigger_repl_secret_args_in, (py_data_unpack_fn)unpack_py_drepl_trigger_repl_secret_args_out, 10, &ndr_table_irpc },
8353 : { "dnsupdate_RODC", "S.dnsupdate_RODC(dom_sid, site_name, dns_ttl, dns_names) -> dns_names", (py_dcerpc_call_fn)dcerpc_dnsupdate_RODC_r, (py_data_pack_fn)pack_py_dnsupdate_RODC_args_in, (py_data_unpack_fn)unpack_py_dnsupdate_RODC_args_out, 11, &ndr_table_irpc },
8354 : { "dnssrv_reload_dns_zones", "S.dnssrv_reload_dns_zones() -> None", (py_dcerpc_call_fn)dcerpc_dnssrv_reload_dns_zones_r, (py_data_pack_fn)pack_py_dnssrv_reload_dns_zones_args_in, (py_data_unpack_fn)unpack_py_dnssrv_reload_dns_zones_args_out, 12, &ndr_table_irpc },
8355 : {0}
8356 : };
8357 :
8358 0 : static PyObject *interface_irpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8359 : {
8360 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_irpc);
8361 : }
8362 :
8363 : static PyTypeObject irpc_InterfaceType = {
8364 : PyVarObject_HEAD_INIT(NULL, 0)
8365 : .tp_name = "irpc.irpc",
8366 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
8367 : .tp_doc = "irpc(binding, lp_ctx=None, credentials=None) -> connection\n"
8368 : "\n"
8369 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
8370 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
8371 : "credentials should be a credentials.Credentials object.\n\n",
8372 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8373 : .tp_new = interface_irpc_new,
8374 : };
8375 :
8376 0 : static PyObject *syntax_irpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8377 : {
8378 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_irpc.syntax_id);
8379 : }
8380 :
8381 : static PyTypeObject irpc_SyntaxType = {
8382 : PyVarObject_HEAD_INIT(NULL, 0)
8383 : .tp_name = "irpc.irpc_abstract_syntax",
8384 : .tp_doc = "irpc_abstract_syntax()\n",
8385 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8386 : .tp_new = syntax_irpc_new,
8387 : };
8388 :
8389 : static PyMethodDef irpc_methods[] = {
8390 : { NULL, NULL, 0, NULL }
8391 : };
8392 :
8393 : static struct PyModuleDef moduledef = {
8394 : PyModuleDef_HEAD_INIT,
8395 : .m_name = "irpc",
8396 : .m_doc = "irpc DCE/RPC",
8397 : .m_size = -1,
8398 : .m_methods = irpc_methods,
8399 : };
8400 12 : MODULE_INIT_FUNC(irpc)
8401 : {
8402 12 : PyObject *m = NULL;
8403 12 : PyObject *dep_samba_dcerpc_misc = NULL;
8404 12 : PyObject *dep_samba_dcerpc_security = NULL;
8405 12 : PyObject *dep_samba_dcerpc_nbt = NULL;
8406 12 : PyObject *dep_samba_dcerpc_netlogon = NULL;
8407 12 : PyObject *dep_samba_dcerpc_server_id = NULL;
8408 12 : PyObject *dep_talloc = NULL;
8409 12 : PyObject *dep_samba_dcerpc_base = NULL;
8410 :
8411 12 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
8412 12 : if (dep_samba_dcerpc_misc == NULL)
8413 0 : goto out;
8414 :
8415 12 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
8416 12 : if (dep_samba_dcerpc_security == NULL)
8417 0 : goto out;
8418 :
8419 12 : dep_samba_dcerpc_nbt = PyImport_ImportModule("samba.dcerpc.nbt");
8420 12 : if (dep_samba_dcerpc_nbt == NULL)
8421 0 : goto out;
8422 :
8423 12 : dep_samba_dcerpc_netlogon = PyImport_ImportModule("samba.dcerpc.netlogon");
8424 12 : if (dep_samba_dcerpc_netlogon == NULL)
8425 0 : goto out;
8426 :
8427 12 : dep_samba_dcerpc_server_id = PyImport_ImportModule("samba.dcerpc.server_id");
8428 12 : if (dep_samba_dcerpc_server_id == NULL)
8429 0 : goto out;
8430 :
8431 12 : dep_talloc = PyImport_ImportModule("talloc");
8432 12 : if (dep_talloc == NULL)
8433 0 : goto out;
8434 :
8435 12 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
8436 12 : if (dep_samba_dcerpc_base == NULL)
8437 0 : goto out;
8438 :
8439 12 : security_token_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "token");
8440 12 : if (security_token_Type == NULL)
8441 0 : goto out;
8442 :
8443 12 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
8444 12 : if (BaseObject_Type == NULL)
8445 0 : goto out;
8446 :
8447 12 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
8448 12 : if (GUID_Type == NULL)
8449 0 : goto out;
8450 :
8451 12 : server_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_server_id, "server_id");
8452 12 : if (server_id_Type == NULL)
8453 0 : goto out;
8454 :
8455 12 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
8456 12 : if (dom_sid_Type == NULL)
8457 0 : goto out;
8458 :
8459 12 : nbt_name_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_nbt, "name");
8460 12 : if (nbt_name_Type == NULL)
8461 0 : goto out;
8462 :
8463 12 : NL_DNS_NAME_INFO_ARRAY_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "NL_DNS_NAME_INFO_ARRAY");
8464 12 : if (NL_DNS_NAME_INFO_ARRAY_Type == NULL)
8465 0 : goto out;
8466 :
8467 12 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
8468 12 : if (ClientConnection_Type == NULL)
8469 0 : goto out;
8470 :
8471 12 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
8472 12 : if (ndr_syntax_id_Type == NULL)
8473 0 : goto out;
8474 :
8475 12 : irpc_creds_Type.tp_base = BaseObject_Type;
8476 12 : irpc_creds_Type.tp_basicsize = pytalloc_BaseObject_size();
8477 :
8478 12 : irpc_header_Type.tp_base = BaseObject_Type;
8479 12 : irpc_header_Type.tp_basicsize = pytalloc_BaseObject_size();
8480 :
8481 12 : irpc_name_record_Type.tp_base = BaseObject_Type;
8482 12 : irpc_name_record_Type.tp_basicsize = pytalloc_BaseObject_size();
8483 :
8484 12 : irpc_name_records_Type.tp_base = BaseObject_Type;
8485 12 : irpc_name_records_Type.tp_basicsize = pytalloc_BaseObject_size();
8486 :
8487 12 : nbtd_statistics_Type.tp_base = BaseObject_Type;
8488 12 : nbtd_statistics_Type.tp_basicsize = pytalloc_BaseObject_size();
8489 :
8490 12 : nbtd_info_Type.tp_base = BaseObject_Type;
8491 12 : nbtd_info_Type.tp_basicsize = pytalloc_BaseObject_size();
8492 :
8493 12 : nbtd_proxy_wins_addr_Type.tp_base = BaseObject_Type;
8494 12 : nbtd_proxy_wins_addr_Type.tp_basicsize = pytalloc_BaseObject_size();
8495 :
8496 12 : smbsrv_session_info_Type.tp_base = BaseObject_Type;
8497 12 : smbsrv_session_info_Type.tp_basicsize = pytalloc_BaseObject_size();
8498 :
8499 12 : smbsrv_sessions_Type.tp_base = BaseObject_Type;
8500 12 : smbsrv_sessions_Type.tp_basicsize = pytalloc_BaseObject_size();
8501 :
8502 12 : smbsrv_tcon_info_Type.tp_base = BaseObject_Type;
8503 12 : smbsrv_tcon_info_Type.tp_basicsize = pytalloc_BaseObject_size();
8504 :
8505 12 : smbsrv_tcons_Type.tp_base = BaseObject_Type;
8506 12 : smbsrv_tcons_Type.tp_basicsize = pytalloc_BaseObject_size();
8507 :
8508 12 : smbsrv_info_Type.tp_base = BaseObject_Type;
8509 12 : smbsrv_info_Type.tp_basicsize = pytalloc_BaseObject_size();
8510 :
8511 12 : irpc_uptime_Type.tp_base = BaseObject_Type;
8512 12 : irpc_uptime_Type.tp_basicsize = pytalloc_BaseObject_size();
8513 :
8514 12 : nbtd_information_Type.tp_base = BaseObject_Type;
8515 12 : nbtd_information_Type.tp_basicsize = pytalloc_BaseObject_size();
8516 :
8517 12 : nbtd_getdcname_Type.tp_base = BaseObject_Type;
8518 12 : nbtd_getdcname_Type.tp_basicsize = pytalloc_BaseObject_size();
8519 :
8520 12 : nbtd_proxy_wins_challenge_Type.tp_base = BaseObject_Type;
8521 12 : nbtd_proxy_wins_challenge_Type.tp_basicsize = pytalloc_BaseObject_size();
8522 :
8523 12 : nbtd_proxy_wins_release_demand_Type.tp_base = BaseObject_Type;
8524 12 : nbtd_proxy_wins_release_demand_Type.tp_basicsize = pytalloc_BaseObject_size();
8525 :
8526 12 : kdc_check_generic_kerberos_Type.tp_base = BaseObject_Type;
8527 12 : kdc_check_generic_kerberos_Type.tp_basicsize = pytalloc_BaseObject_size();
8528 :
8529 12 : smbsrv_information_Type.tp_base = BaseObject_Type;
8530 12 : smbsrv_information_Type.tp_basicsize = pytalloc_BaseObject_size();
8531 :
8532 12 : samba_terminate_Type.tp_base = BaseObject_Type;
8533 12 : samba_terminate_Type.tp_basicsize = pytalloc_BaseObject_size();
8534 :
8535 12 : dreplsrv_refresh_Type.tp_base = BaseObject_Type;
8536 12 : dreplsrv_refresh_Type.tp_basicsize = pytalloc_BaseObject_size();
8537 :
8538 12 : drepl_takeFSMORole_Type.tp_base = BaseObject_Type;
8539 12 : drepl_takeFSMORole_Type.tp_basicsize = pytalloc_BaseObject_size();
8540 :
8541 12 : drepl_trigger_repl_secret_Type.tp_base = BaseObject_Type;
8542 12 : drepl_trigger_repl_secret_Type.tp_basicsize = pytalloc_BaseObject_size();
8543 :
8544 12 : dnsupdate_RODC_Type.tp_base = BaseObject_Type;
8545 12 : dnsupdate_RODC_Type.tp_basicsize = pytalloc_BaseObject_size();
8546 :
8547 12 : dnssrv_reload_dns_zones_Type.tp_base = BaseObject_Type;
8548 12 : dnssrv_reload_dns_zones_Type.tp_basicsize = pytalloc_BaseObject_size();
8549 :
8550 12 : irpc_InterfaceType.tp_base = ClientConnection_Type;
8551 :
8552 12 : irpc_SyntaxType.tp_base = ndr_syntax_id_Type;
8553 12 : irpc_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
8554 :
8555 12 : if (PyType_Ready(&irpc_creds_Type) < 0)
8556 0 : goto out;
8557 12 : if (PyType_Ready(&irpc_header_Type) < 0)
8558 0 : goto out;
8559 12 : if (PyType_Ready(&irpc_name_record_Type) < 0)
8560 0 : goto out;
8561 12 : if (PyType_Ready(&irpc_name_records_Type) < 0)
8562 0 : goto out;
8563 12 : if (PyType_Ready(&nbtd_statistics_Type) < 0)
8564 0 : goto out;
8565 12 : if (PyType_Ready(&nbtd_info_Type) < 0)
8566 0 : goto out;
8567 12 : if (PyType_Ready(&nbtd_proxy_wins_addr_Type) < 0)
8568 0 : goto out;
8569 12 : if (PyType_Ready(&smbsrv_session_info_Type) < 0)
8570 0 : goto out;
8571 12 : if (PyType_Ready(&smbsrv_sessions_Type) < 0)
8572 0 : goto out;
8573 12 : if (PyType_Ready(&smbsrv_tcon_info_Type) < 0)
8574 0 : goto out;
8575 12 : if (PyType_Ready(&smbsrv_tcons_Type) < 0)
8576 0 : goto out;
8577 12 : if (PyType_Ready(&smbsrv_info_Type) < 0)
8578 0 : goto out;
8579 12 : if (PyType_Ready(&irpc_uptime_Type) < 0)
8580 0 : goto out;
8581 12 : if (PyType_Ready(&nbtd_information_Type) < 0)
8582 0 : goto out;
8583 12 : if (PyType_Ready(&nbtd_getdcname_Type) < 0)
8584 0 : goto out;
8585 12 : if (PyType_Ready(&nbtd_proxy_wins_challenge_Type) < 0)
8586 0 : goto out;
8587 12 : if (PyType_Ready(&nbtd_proxy_wins_release_demand_Type) < 0)
8588 0 : goto out;
8589 12 : if (PyType_Ready(&kdc_check_generic_kerberos_Type) < 0)
8590 0 : goto out;
8591 12 : if (PyType_Ready(&smbsrv_information_Type) < 0)
8592 0 : goto out;
8593 12 : if (PyType_Ready(&samba_terminate_Type) < 0)
8594 0 : goto out;
8595 12 : if (PyType_Ready(&dreplsrv_refresh_Type) < 0)
8596 0 : goto out;
8597 12 : if (PyType_Ready(&drepl_takeFSMORole_Type) < 0)
8598 0 : goto out;
8599 12 : if (PyType_Ready(&drepl_trigger_repl_secret_Type) < 0)
8600 0 : goto out;
8601 12 : if (PyType_Ready(&dnsupdate_RODC_Type) < 0)
8602 0 : goto out;
8603 12 : if (PyType_Ready(&dnssrv_reload_dns_zones_Type) < 0)
8604 0 : goto out;
8605 12 : if (PyType_Ready(&irpc_InterfaceType) < 0)
8606 0 : goto out;
8607 12 : if (PyType_Ready(&irpc_SyntaxType) < 0)
8608 0 : goto out;
8609 12 : if (!PyInterface_AddNdrRpcMethods(&irpc_InterfaceType, py_ndr_irpc_methods))
8610 0 : return NULL;
8611 :
8612 : #ifdef PY_CREDS_PATCH
8613 : PY_CREDS_PATCH(&irpc_creds_Type);
8614 : #endif
8615 : #ifdef PY_HEADER_PATCH
8616 : PY_HEADER_PATCH(&irpc_header_Type);
8617 : #endif
8618 : #ifdef PY_NAME_RECORD_PATCH
8619 : PY_NAME_RECORD_PATCH(&irpc_name_record_Type);
8620 : #endif
8621 : #ifdef PY_NAME_RECORDS_PATCH
8622 : PY_NAME_RECORDS_PATCH(&irpc_name_records_Type);
8623 : #endif
8624 : #ifdef PY_NBTD_STATISTICS_PATCH
8625 : PY_NBTD_STATISTICS_PATCH(&nbtd_statistics_Type);
8626 : #endif
8627 : #ifdef PY_NBTD_INFO_PATCH
8628 : PY_NBTD_INFO_PATCH(&nbtd_info_Type);
8629 : #endif
8630 : #ifdef PY_NBTD_PROXY_WINS_ADDR_PATCH
8631 : PY_NBTD_PROXY_WINS_ADDR_PATCH(&nbtd_proxy_wins_addr_Type);
8632 : #endif
8633 : #ifdef PY_SMBSRV_SESSION_INFO_PATCH
8634 : PY_SMBSRV_SESSION_INFO_PATCH(&smbsrv_session_info_Type);
8635 : #endif
8636 : #ifdef PY_SMBSRV_SESSIONS_PATCH
8637 : PY_SMBSRV_SESSIONS_PATCH(&smbsrv_sessions_Type);
8638 : #endif
8639 : #ifdef PY_SMBSRV_TCON_INFO_PATCH
8640 : PY_SMBSRV_TCON_INFO_PATCH(&smbsrv_tcon_info_Type);
8641 : #endif
8642 : #ifdef PY_SMBSRV_TCONS_PATCH
8643 : PY_SMBSRV_TCONS_PATCH(&smbsrv_tcons_Type);
8644 : #endif
8645 : #ifdef PY_SMBSRV_INFO_PATCH
8646 : PY_SMBSRV_INFO_PATCH(&smbsrv_info_Type);
8647 : #endif
8648 : #ifdef PY_UPTIME_PATCH
8649 : PY_UPTIME_PATCH(&irpc_uptime_Type);
8650 : #endif
8651 : #ifdef PY_NBTD_INFORMATION_PATCH
8652 : PY_NBTD_INFORMATION_PATCH(&nbtd_information_Type);
8653 : #endif
8654 : #ifdef PY_NBTD_GETDCNAME_PATCH
8655 : PY_NBTD_GETDCNAME_PATCH(&nbtd_getdcname_Type);
8656 : #endif
8657 : #ifdef PY_NBTD_PROXY_WINS_CHALLENGE_PATCH
8658 : PY_NBTD_PROXY_WINS_CHALLENGE_PATCH(&nbtd_proxy_wins_challenge_Type);
8659 : #endif
8660 : #ifdef PY_NBTD_PROXY_WINS_RELEASE_DEMAND_PATCH
8661 : PY_NBTD_PROXY_WINS_RELEASE_DEMAND_PATCH(&nbtd_proxy_wins_release_demand_Type);
8662 : #endif
8663 : #ifdef PY_KDC_CHECK_GENERIC_KERBEROS_PATCH
8664 : PY_KDC_CHECK_GENERIC_KERBEROS_PATCH(&kdc_check_generic_kerberos_Type);
8665 : #endif
8666 : #ifdef PY_SMBSRV_INFORMATION_PATCH
8667 : PY_SMBSRV_INFORMATION_PATCH(&smbsrv_information_Type);
8668 : #endif
8669 : #ifdef PY_SAMBA_TERMINATE_PATCH
8670 : PY_SAMBA_TERMINATE_PATCH(&samba_terminate_Type);
8671 : #endif
8672 : #ifdef PY_DREPLSRV_REFRESH_PATCH
8673 : PY_DREPLSRV_REFRESH_PATCH(&dreplsrv_refresh_Type);
8674 : #endif
8675 : #ifdef PY_DREPL_TAKEFSMOROLE_PATCH
8676 : PY_DREPL_TAKEFSMOROLE_PATCH(&drepl_takeFSMORole_Type);
8677 : #endif
8678 : #ifdef PY_DREPL_TRIGGER_REPL_SECRET_PATCH
8679 : PY_DREPL_TRIGGER_REPL_SECRET_PATCH(&drepl_trigger_repl_secret_Type);
8680 : #endif
8681 : #ifdef PY_DNSUPDATE_RODC_PATCH
8682 : PY_DNSUPDATE_RODC_PATCH(&dnsupdate_RODC_Type);
8683 : #endif
8684 : #ifdef PY_DNSSRV_RELOAD_DNS_ZONES_PATCH
8685 : PY_DNSSRV_RELOAD_DNS_ZONES_PATCH(&dnssrv_reload_dns_zones_Type);
8686 : #endif
8687 : #ifdef PY_IRPC_PATCH
8688 : PY_IRPC_PATCH(&irpc_InterfaceType);
8689 : #endif
8690 : #ifdef PY_IRPC_ABSTRACT_SYNTAX_PATCH
8691 : PY_IRPC_ABSTRACT_SYNTAX_PATCH(&irpc_SyntaxType);
8692 : #endif
8693 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
8694 : PY_ABSTRACT_SYNTAX_PATCH(&irpc_SyntaxType);
8695 : #endif
8696 :
8697 12 : m = PyModule_Create(&moduledef);
8698 12 : if (m == NULL)
8699 0 : goto out;
8700 :
8701 12 : PyModule_AddObject(m, "IRPC_FLAG_REPLY", PyLong_FromUnsignedLongLong((uint32_t)(IRPC_FLAG_REPLY)));
8702 12 : PyModule_AddObject(m, "NBTD_INFO_STATISTICS", PyLong_FromUnsignedLongLong((uint32_t)(NBTD_INFO_STATISTICS)));
8703 12 : PyModule_AddObject(m, "SMBSRV_INFO_SESSIONS", PyLong_FromUnsignedLongLong((uint32_t)(SMBSRV_INFO_SESSIONS)));
8704 12 : PyModule_AddObject(m, "SMBSRV_INFO_TCONS", PyLong_FromUnsignedLongLong((uint32_t)(SMBSRV_INFO_TCONS)));
8705 12 : PyModule_AddObject(m, "DREPL_SCHEMA_MASTER", PyLong_FromUnsignedLongLong((uint32_t)(DREPL_SCHEMA_MASTER)));
8706 12 : PyModule_AddObject(m, "DREPL_RID_MASTER", PyLong_FromUnsignedLongLong((uint32_t)(DREPL_RID_MASTER)));
8707 12 : PyModule_AddObject(m, "DREPL_INFRASTRUCTURE_MASTER", PyLong_FromUnsignedLongLong((uint32_t)(DREPL_INFRASTRUCTURE_MASTER)));
8708 12 : PyModule_AddObject(m, "DREPL_NAMING_MASTER", PyLong_FromUnsignedLongLong((uint32_t)(DREPL_NAMING_MASTER)));
8709 12 : PyModule_AddObject(m, "DREPL_PDC_MASTER", PyLong_FromUnsignedLongLong((uint32_t)(DREPL_PDC_MASTER)));
8710 9 : Py_INCREF((PyObject *)(void *)&irpc_creds_Type);
8711 12 : PyModule_AddObject(m, "creds", (PyObject *)(void *)&irpc_creds_Type);
8712 9 : Py_INCREF((PyObject *)(void *)&irpc_header_Type);
8713 12 : PyModule_AddObject(m, "header", (PyObject *)(void *)&irpc_header_Type);
8714 9 : Py_INCREF((PyObject *)(void *)&irpc_name_record_Type);
8715 12 : PyModule_AddObject(m, "name_record", (PyObject *)(void *)&irpc_name_record_Type);
8716 9 : Py_INCREF((PyObject *)(void *)&irpc_name_records_Type);
8717 12 : PyModule_AddObject(m, "name_records", (PyObject *)(void *)&irpc_name_records_Type);
8718 9 : Py_INCREF((PyObject *)(void *)&nbtd_statistics_Type);
8719 12 : PyModule_AddObject(m, "nbtd_statistics", (PyObject *)(void *)&nbtd_statistics_Type);
8720 9 : Py_INCREF((PyObject *)(void *)&nbtd_info_Type);
8721 12 : PyModule_AddObject(m, "nbtd_info", (PyObject *)(void *)&nbtd_info_Type);
8722 9 : Py_INCREF((PyObject *)(void *)&nbtd_proxy_wins_addr_Type);
8723 12 : PyModule_AddObject(m, "nbtd_proxy_wins_addr", (PyObject *)(void *)&nbtd_proxy_wins_addr_Type);
8724 9 : Py_INCREF((PyObject *)(void *)&smbsrv_session_info_Type);
8725 12 : PyModule_AddObject(m, "smbsrv_session_info", (PyObject *)(void *)&smbsrv_session_info_Type);
8726 9 : Py_INCREF((PyObject *)(void *)&smbsrv_sessions_Type);
8727 12 : PyModule_AddObject(m, "smbsrv_sessions", (PyObject *)(void *)&smbsrv_sessions_Type);
8728 9 : Py_INCREF((PyObject *)(void *)&smbsrv_tcon_info_Type);
8729 12 : PyModule_AddObject(m, "smbsrv_tcon_info", (PyObject *)(void *)&smbsrv_tcon_info_Type);
8730 9 : Py_INCREF((PyObject *)(void *)&smbsrv_tcons_Type);
8731 12 : PyModule_AddObject(m, "smbsrv_tcons", (PyObject *)(void *)&smbsrv_tcons_Type);
8732 9 : Py_INCREF((PyObject *)(void *)&smbsrv_info_Type);
8733 12 : PyModule_AddObject(m, "smbsrv_info", (PyObject *)(void *)&smbsrv_info_Type);
8734 9 : Py_INCREF((PyObject *)(void *)&irpc_uptime_Type);
8735 12 : PyModule_AddObject(m, "uptime", (PyObject *)(void *)&irpc_uptime_Type);
8736 9 : Py_INCREF((PyObject *)(void *)&nbtd_information_Type);
8737 12 : PyModule_AddObject(m, "nbtd_information", (PyObject *)(void *)&nbtd_information_Type);
8738 9 : Py_INCREF((PyObject *)(void *)&nbtd_getdcname_Type);
8739 12 : PyModule_AddObject(m, "nbtd_getdcname", (PyObject *)(void *)&nbtd_getdcname_Type);
8740 9 : Py_INCREF((PyObject *)(void *)&nbtd_proxy_wins_challenge_Type);
8741 12 : PyModule_AddObject(m, "nbtd_proxy_wins_challenge", (PyObject *)(void *)&nbtd_proxy_wins_challenge_Type);
8742 9 : Py_INCREF((PyObject *)(void *)&nbtd_proxy_wins_release_demand_Type);
8743 12 : PyModule_AddObject(m, "nbtd_proxy_wins_release_demand", (PyObject *)(void *)&nbtd_proxy_wins_release_demand_Type);
8744 9 : Py_INCREF((PyObject *)(void *)&kdc_check_generic_kerberos_Type);
8745 12 : PyModule_AddObject(m, "kdc_check_generic_kerberos", (PyObject *)(void *)&kdc_check_generic_kerberos_Type);
8746 9 : Py_INCREF((PyObject *)(void *)&smbsrv_information_Type);
8747 12 : PyModule_AddObject(m, "smbsrv_information", (PyObject *)(void *)&smbsrv_information_Type);
8748 9 : Py_INCREF((PyObject *)(void *)&samba_terminate_Type);
8749 12 : PyModule_AddObject(m, "samba_terminate", (PyObject *)(void *)&samba_terminate_Type);
8750 9 : Py_INCREF((PyObject *)(void *)&dreplsrv_refresh_Type);
8751 12 : PyModule_AddObject(m, "dreplsrv_refresh", (PyObject *)(void *)&dreplsrv_refresh_Type);
8752 9 : Py_INCREF((PyObject *)(void *)&drepl_takeFSMORole_Type);
8753 12 : PyModule_AddObject(m, "drepl_takeFSMORole", (PyObject *)(void *)&drepl_takeFSMORole_Type);
8754 9 : Py_INCREF((PyObject *)(void *)&drepl_trigger_repl_secret_Type);
8755 12 : PyModule_AddObject(m, "drepl_trigger_repl_secret", (PyObject *)(void *)&drepl_trigger_repl_secret_Type);
8756 9 : Py_INCREF((PyObject *)(void *)&dnsupdate_RODC_Type);
8757 12 : PyModule_AddObject(m, "dnsupdate_RODC", (PyObject *)(void *)&dnsupdate_RODC_Type);
8758 9 : Py_INCREF((PyObject *)(void *)&dnssrv_reload_dns_zones_Type);
8759 12 : PyModule_AddObject(m, "dnssrv_reload_dns_zones", (PyObject *)(void *)&dnssrv_reload_dns_zones_Type);
8760 9 : Py_INCREF((PyObject *)(void *)&irpc_InterfaceType);
8761 12 : PyModule_AddObject(m, "irpc", (PyObject *)(void *)&irpc_InterfaceType);
8762 9 : Py_INCREF((PyObject *)(void *)&irpc_SyntaxType);
8763 12 : PyModule_AddObject(m, "irpc_abstract_syntax", (PyObject *)(void *)&irpc_SyntaxType);
8764 9 : Py_INCREF((PyObject *)(void *)&irpc_SyntaxType);
8765 12 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&irpc_SyntaxType);
8766 : #ifdef PY_MOD_IRPC_PATCH
8767 : PY_MOD_IRPC_PATCH(m);
8768 : #endif
8769 12 : out:
8770 12 : Py_XDECREF(dep_samba_dcerpc_misc);
8771 12 : Py_XDECREF(dep_samba_dcerpc_security);
8772 12 : Py_XDECREF(dep_samba_dcerpc_nbt);
8773 12 : Py_XDECREF(dep_samba_dcerpc_netlogon);
8774 12 : Py_XDECREF(dep_samba_dcerpc_server_id);
8775 12 : Py_XDECREF(dep_talloc);
8776 12 : Py_XDECREF(dep_samba_dcerpc_base);
8777 12 : return m;
8778 :
8779 : }
|