Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include <Python.h>
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_epmapper.h"
12 : #include "bin/default/librpc/gen_ndr/ndr_epmapper_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 432 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 432 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 288 : case 4:
38 288 : return UINT32_MAX;
39 144 : case 2:
40 144 : 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 : static PyTypeObject epm_rhs_dnet_nsp_Type;
66 : static PyTypeObject epm_rhs_osi_tp4_Type;
67 : static PyTypeObject epm_rhs_osi_clns_Type;
68 : static PyTypeObject epm_rhs_udp_Type;
69 : static PyTypeObject epm_rhs_tcp_Type;
70 : static PyTypeObject epm_rhs_ip_Type;
71 : static PyTypeObject epm_rhs_ncadg_Type;
72 : static PyTypeObject epm_rhs_ncacn_Type;
73 : static PyTypeObject epm_rhs_uuid_Type;
74 : static PyTypeObject epm_rhs_ipx_Type;
75 : static PyTypeObject epm_rhs_smb_Type;
76 : static PyTypeObject epm_rhs_named_pipe_Type;
77 : static PyTypeObject epm_rhs_netbios_Type;
78 : static PyTypeObject epm_rhs_netbeui_Type;
79 : static PyTypeObject epm_rhs_spx_Type;
80 : static PyTypeObject epm_rhs_nb_ipx_Type;
81 : static PyTypeObject epm_rhs_http_Type;
82 : static PyTypeObject epm_rhs_unix_ds_Type;
83 : static PyTypeObject epm_rhs_null_Type;
84 : static PyTypeObject epm_rhs_ncalrpc_Type;
85 : static PyTypeObject epm_rhs_appletalk_Type;
86 : static PyTypeObject epm_rhs_atalk_stream_Type;
87 : static PyTypeObject epm_rhs_atalk_datagram_Type;
88 : static PyTypeObject epm_rhs_vines_spp_Type;
89 : static PyTypeObject epm_rhs_vines_ipc_Type;
90 : static PyTypeObject epm_rhs_streettalk_Type;
91 : static PyTypeObject epm_rhs_Type;
92 : static PyTypeObject epm_lhs_Type;
93 : static PyTypeObject epm_floor_Type;
94 : static PyTypeObject epm_tower_Type;
95 : static PyTypeObject epm_twr_t_Type;
96 : static PyTypeObject epm_entry_t_Type;
97 : static PyTypeObject rpc_if_id_t_Type;
98 : static PyTypeObject epm_twr_p_t_Type;
99 : static PyTypeObject epmapper_InterfaceType;
100 : static PyTypeObject epm_Insert_Type;
101 : static PyTypeObject epm_Delete_Type;
102 : static PyTypeObject epm_Lookup_Type;
103 : static PyTypeObject epm_Map_Type;
104 : static PyTypeObject epm_LookupHandleFree_Type;
105 : static PyTypeObject epm_InqObject_Type;
106 : static PyTypeObject epm_MgmtDelete_Type;
107 :
108 : static PyTypeObject *BaseObject_Type;
109 : static PyTypeObject *GUID_Type;
110 : static PyTypeObject *policy_handle_Type;
111 : static PyTypeObject *ClientConnection_Type;
112 : static PyTypeObject *ndr_syntax_id_Type;
113 :
114 0 : static PyObject *py_epm_rhs_dnet_nsp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
115 : {
116 0 : return pytalloc_new(struct epm_rhs_dnet_nsp, type);
117 : }
118 :
119 :
120 : static PyTypeObject epm_rhs_dnet_nsp_Type = {
121 : PyVarObject_HEAD_INIT(NULL, 0)
122 : .tp_name = "epmapper.epm_rhs_dnet_nsp",
123 : .tp_getset = NULL,
124 : .tp_methods = NULL,
125 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
126 : .tp_new = py_epm_rhs_dnet_nsp_new,
127 : };
128 :
129 :
130 0 : static PyObject *py_epm_rhs_osi_tp4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
131 : {
132 0 : return pytalloc_new(struct epm_rhs_osi_tp4, type);
133 : }
134 :
135 :
136 : static PyTypeObject epm_rhs_osi_tp4_Type = {
137 : PyVarObject_HEAD_INIT(NULL, 0)
138 : .tp_name = "epmapper.epm_rhs_osi_tp4",
139 : .tp_getset = NULL,
140 : .tp_methods = NULL,
141 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
142 : .tp_new = py_epm_rhs_osi_tp4_new,
143 : };
144 :
145 :
146 0 : static PyObject *py_epm_rhs_osi_clns_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
147 : {
148 0 : return pytalloc_new(struct epm_rhs_osi_clns, type);
149 : }
150 :
151 :
152 : static PyTypeObject epm_rhs_osi_clns_Type = {
153 : PyVarObject_HEAD_INIT(NULL, 0)
154 : .tp_name = "epmapper.epm_rhs_osi_clns",
155 : .tp_getset = NULL,
156 : .tp_methods = NULL,
157 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
158 : .tp_new = py_epm_rhs_osi_clns_new,
159 : };
160 :
161 :
162 0 : static PyObject *py_epm_rhs_udp_get_port(PyObject *obj, void *closure)
163 : {
164 0 : struct epm_rhs_udp *object = (struct epm_rhs_udp *)pytalloc_get_ptr(obj);
165 : PyObject *py_port;
166 0 : py_port = PyLong_FromLong((uint16_t)object->port);
167 0 : return py_port;
168 : }
169 :
170 0 : static int py_epm_rhs_udp_set_port(PyObject *py_obj, PyObject *value, void *closure)
171 : {
172 0 : struct epm_rhs_udp *object = (struct epm_rhs_udp *)pytalloc_get_ptr(py_obj);
173 0 : if (value == NULL) {
174 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->port");
175 0 : return -1;
176 : }
177 : {
178 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
179 0 : if (PyLong_Check(value)) {
180 : unsigned long long test_var;
181 0 : test_var = PyLong_AsUnsignedLongLong(value);
182 0 : if (PyErr_Occurred() != NULL) {
183 0 : return -1;
184 : }
185 0 : if (test_var > uint_max) {
186 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
187 : PyLong_Type.tp_name, uint_max, test_var);
188 0 : return -1;
189 : }
190 0 : object->port = test_var;
191 : } else {
192 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
193 : PyLong_Type.tp_name);
194 0 : return -1;
195 : }
196 : }
197 0 : return 0;
198 : }
199 :
200 : static PyGetSetDef py_epm_rhs_udp_getsetters[] = {
201 : {
202 : .name = discard_const_p(char, "port"),
203 : .get = py_epm_rhs_udp_get_port,
204 : .set = py_epm_rhs_udp_set_port,
205 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
206 : },
207 : { .name = NULL }
208 : };
209 :
210 0 : static PyObject *py_epm_rhs_udp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
211 : {
212 0 : return pytalloc_new(struct epm_rhs_udp, type);
213 : }
214 :
215 :
216 : static PyTypeObject epm_rhs_udp_Type = {
217 : PyVarObject_HEAD_INIT(NULL, 0)
218 : .tp_name = "epmapper.epm_rhs_udp",
219 : .tp_getset = py_epm_rhs_udp_getsetters,
220 : .tp_methods = NULL,
221 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
222 : .tp_new = py_epm_rhs_udp_new,
223 : };
224 :
225 :
226 16 : static PyObject *py_epm_rhs_tcp_get_port(PyObject *obj, void *closure)
227 : {
228 16 : struct epm_rhs_tcp *object = (struct epm_rhs_tcp *)pytalloc_get_ptr(obj);
229 : PyObject *py_port;
230 16 : py_port = PyLong_FromLong((uint16_t)object->port);
231 16 : return py_port;
232 : }
233 :
234 48 : static int py_epm_rhs_tcp_set_port(PyObject *py_obj, PyObject *value, void *closure)
235 : {
236 48 : struct epm_rhs_tcp *object = (struct epm_rhs_tcp *)pytalloc_get_ptr(py_obj);
237 48 : if (value == NULL) {
238 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->port");
239 0 : return -1;
240 : }
241 : {
242 48 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
243 48 : if (PyLong_Check(value)) {
244 : unsigned long long test_var;
245 48 : test_var = PyLong_AsUnsignedLongLong(value);
246 48 : if (PyErr_Occurred() != NULL) {
247 0 : return -1;
248 : }
249 48 : if (test_var > uint_max) {
250 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
251 : PyLong_Type.tp_name, uint_max, test_var);
252 0 : return -1;
253 : }
254 48 : object->port = test_var;
255 : } else {
256 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
257 : PyLong_Type.tp_name);
258 0 : return -1;
259 : }
260 : }
261 48 : return 0;
262 : }
263 :
264 : static PyGetSetDef py_epm_rhs_tcp_getsetters[] = {
265 : {
266 : .name = discard_const_p(char, "port"),
267 : .get = py_epm_rhs_tcp_get_port,
268 : .set = py_epm_rhs_tcp_set_port,
269 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
270 : },
271 : { .name = NULL }
272 : };
273 :
274 0 : static PyObject *py_epm_rhs_tcp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
275 : {
276 0 : return pytalloc_new(struct epm_rhs_tcp, type);
277 : }
278 :
279 :
280 : static PyTypeObject epm_rhs_tcp_Type = {
281 : PyVarObject_HEAD_INIT(NULL, 0)
282 : .tp_name = "epmapper.epm_rhs_tcp",
283 : .tp_getset = py_epm_rhs_tcp_getsetters,
284 : .tp_methods = NULL,
285 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
286 : .tp_new = py_epm_rhs_tcp_new,
287 : };
288 :
289 :
290 0 : static PyObject *py_epm_rhs_ip_get_ipaddr(PyObject *obj, void *closure)
291 : {
292 0 : struct epm_rhs_ip *object = (struct epm_rhs_ip *)pytalloc_get_ptr(obj);
293 : PyObject *py_ipaddr;
294 0 : py_ipaddr = PyString_FromStringOrNULL(object->ipaddr);
295 0 : return py_ipaddr;
296 : }
297 :
298 48 : static int py_epm_rhs_ip_set_ipaddr(PyObject *py_obj, PyObject *value, void *closure)
299 : {
300 48 : struct epm_rhs_ip *object = (struct epm_rhs_ip *)pytalloc_get_ptr(py_obj);
301 48 : if (value == NULL) {
302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ipaddr");
303 0 : return -1;
304 : }
305 : {
306 : const char *test_str;
307 : const char *talloc_str;
308 48 : PyObject *unicode = NULL;
309 48 : if (PyUnicode_Check(value)) {
310 48 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
311 48 : if (unicode == NULL) {
312 0 : PyErr_NoMemory();
313 0 : return -1;
314 : }
315 48 : test_str = PyBytes_AS_STRING(unicode);
316 0 : } else if (PyBytes_Check(value)) {
317 0 : test_str = PyBytes_AS_STRING(value);
318 : } else {
319 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
320 0 : return -1;
321 : }
322 48 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
323 48 : if (unicode != NULL) {
324 48 : Py_DECREF(unicode);
325 : }
326 48 : if (talloc_str == NULL) {
327 0 : PyErr_NoMemory();
328 0 : return -1;
329 : }
330 48 : object->ipaddr = talloc_str;
331 : }
332 48 : return 0;
333 : }
334 :
335 : static PyGetSetDef py_epm_rhs_ip_getsetters[] = {
336 : {
337 : .name = discard_const_p(char, "ipaddr"),
338 : .get = py_epm_rhs_ip_get_ipaddr,
339 : .set = py_epm_rhs_ip_set_ipaddr,
340 : .doc = discard_const_p(char, "PIDL-generated element of base type ipv4address")
341 : },
342 : { .name = NULL }
343 : };
344 :
345 0 : static PyObject *py_epm_rhs_ip_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
346 : {
347 0 : return pytalloc_new(struct epm_rhs_ip, type);
348 : }
349 :
350 :
351 : static PyTypeObject epm_rhs_ip_Type = {
352 : PyVarObject_HEAD_INIT(NULL, 0)
353 : .tp_name = "epmapper.epm_rhs_ip",
354 : .tp_getset = py_epm_rhs_ip_getsetters,
355 : .tp_methods = NULL,
356 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
357 : .tp_new = py_epm_rhs_ip_new,
358 : };
359 :
360 :
361 0 : static PyObject *py_epm_rhs_ncadg_get_minor_version(PyObject *obj, void *closure)
362 : {
363 0 : struct epm_rhs_ncadg *object = (struct epm_rhs_ncadg *)pytalloc_get_ptr(obj);
364 : PyObject *py_minor_version;
365 0 : py_minor_version = PyLong_FromLong((uint16_t)object->minor_version);
366 0 : return py_minor_version;
367 : }
368 :
369 0 : static int py_epm_rhs_ncadg_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
370 : {
371 0 : struct epm_rhs_ncadg *object = (struct epm_rhs_ncadg *)pytalloc_get_ptr(py_obj);
372 0 : if (value == NULL) {
373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->minor_version");
374 0 : return -1;
375 : }
376 : {
377 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor_version));
378 0 : if (PyLong_Check(value)) {
379 : unsigned long long test_var;
380 0 : test_var = PyLong_AsUnsignedLongLong(value);
381 0 : if (PyErr_Occurred() != NULL) {
382 0 : return -1;
383 : }
384 0 : if (test_var > uint_max) {
385 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
386 : PyLong_Type.tp_name, uint_max, test_var);
387 0 : return -1;
388 : }
389 0 : object->minor_version = test_var;
390 : } else {
391 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
392 : PyLong_Type.tp_name);
393 0 : return -1;
394 : }
395 : }
396 0 : return 0;
397 : }
398 :
399 : static PyGetSetDef py_epm_rhs_ncadg_getsetters[] = {
400 : {
401 : .name = discard_const_p(char, "minor_version"),
402 : .get = py_epm_rhs_ncadg_get_minor_version,
403 : .set = py_epm_rhs_ncadg_set_minor_version,
404 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
405 : },
406 : { .name = NULL }
407 : };
408 :
409 0 : static PyObject *py_epm_rhs_ncadg_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
410 : {
411 0 : return pytalloc_new(struct epm_rhs_ncadg, type);
412 : }
413 :
414 :
415 : static PyTypeObject epm_rhs_ncadg_Type = {
416 : PyVarObject_HEAD_INIT(NULL, 0)
417 : .tp_name = "epmapper.epm_rhs_ncadg",
418 : .tp_getset = py_epm_rhs_ncadg_getsetters,
419 : .tp_methods = NULL,
420 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
421 : .tp_new = py_epm_rhs_ncadg_new,
422 : };
423 :
424 :
425 0 : static PyObject *py_epm_rhs_ncacn_get_minor_version(PyObject *obj, void *closure)
426 : {
427 0 : struct epm_rhs_ncacn *object = (struct epm_rhs_ncacn *)pytalloc_get_ptr(obj);
428 : PyObject *py_minor_version;
429 0 : py_minor_version = PyLong_FromLong((uint16_t)object->minor_version);
430 0 : return py_minor_version;
431 : }
432 :
433 48 : static int py_epm_rhs_ncacn_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
434 : {
435 48 : struct epm_rhs_ncacn *object = (struct epm_rhs_ncacn *)pytalloc_get_ptr(py_obj);
436 48 : if (value == NULL) {
437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->minor_version");
438 0 : return -1;
439 : }
440 : {
441 48 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor_version));
442 48 : if (PyLong_Check(value)) {
443 : unsigned long long test_var;
444 48 : test_var = PyLong_AsUnsignedLongLong(value);
445 48 : if (PyErr_Occurred() != NULL) {
446 0 : return -1;
447 : }
448 48 : if (test_var > uint_max) {
449 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
450 : PyLong_Type.tp_name, uint_max, test_var);
451 0 : return -1;
452 : }
453 48 : object->minor_version = test_var;
454 : } else {
455 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
456 : PyLong_Type.tp_name);
457 0 : return -1;
458 : }
459 : }
460 48 : return 0;
461 : }
462 :
463 : static PyGetSetDef py_epm_rhs_ncacn_getsetters[] = {
464 : {
465 : .name = discard_const_p(char, "minor_version"),
466 : .get = py_epm_rhs_ncacn_get_minor_version,
467 : .set = py_epm_rhs_ncacn_set_minor_version,
468 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
469 : },
470 : { .name = NULL }
471 : };
472 :
473 0 : static PyObject *py_epm_rhs_ncacn_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
474 : {
475 0 : return pytalloc_new(struct epm_rhs_ncacn, type);
476 : }
477 :
478 :
479 : static PyTypeObject epm_rhs_ncacn_Type = {
480 : PyVarObject_HEAD_INIT(NULL, 0)
481 : .tp_name = "epmapper.epm_rhs_ncacn",
482 : .tp_getset = py_epm_rhs_ncacn_getsetters,
483 : .tp_methods = NULL,
484 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
485 : .tp_new = py_epm_rhs_ncacn_new,
486 : };
487 :
488 :
489 0 : static PyObject *py_epm_rhs_uuid_get_unknown(PyObject *obj, void *closure)
490 : {
491 0 : struct epm_rhs_uuid *object = (struct epm_rhs_uuid *)pytalloc_get_ptr(obj);
492 : PyObject *py_unknown;
493 0 : py_unknown = PyBytes_FromStringAndSize((char *)(object->unknown).data, (object->unknown).length);
494 0 : return py_unknown;
495 : }
496 :
497 96 : static int py_epm_rhs_uuid_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
498 : {
499 96 : struct epm_rhs_uuid *object = (struct epm_rhs_uuid *)pytalloc_get_ptr(py_obj);
500 96 : if (value == NULL) {
501 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
502 0 : return -1;
503 : }
504 96 : object->unknown = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
505 96 : return 0;
506 : }
507 :
508 : static PyGetSetDef py_epm_rhs_uuid_getsetters[] = {
509 : {
510 : .name = discard_const_p(char, "unknown"),
511 : .get = py_epm_rhs_uuid_get_unknown,
512 : .set = py_epm_rhs_uuid_set_unknown,
513 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
514 : },
515 : { .name = NULL }
516 : };
517 :
518 96 : static PyObject *py_epm_rhs_uuid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
519 : {
520 96 : return pytalloc_new(struct epm_rhs_uuid, type);
521 : }
522 :
523 :
524 : static PyTypeObject epm_rhs_uuid_Type = {
525 : PyVarObject_HEAD_INIT(NULL, 0)
526 : .tp_name = "epmapper.epm_rhs_uuid",
527 : .tp_getset = py_epm_rhs_uuid_getsetters,
528 : .tp_methods = NULL,
529 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
530 : .tp_new = py_epm_rhs_uuid_new,
531 : };
532 :
533 :
534 0 : static PyObject *py_epm_rhs_ipx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
535 : {
536 0 : return pytalloc_new(struct epm_rhs_ipx, type);
537 : }
538 :
539 :
540 : static PyTypeObject epm_rhs_ipx_Type = {
541 : PyVarObject_HEAD_INIT(NULL, 0)
542 : .tp_name = "epmapper.epm_rhs_ipx",
543 : .tp_getset = NULL,
544 : .tp_methods = NULL,
545 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
546 : .tp_new = py_epm_rhs_ipx_new,
547 : };
548 :
549 :
550 0 : static PyObject *py_epm_rhs_smb_get_unc(PyObject *obj, void *closure)
551 : {
552 0 : struct epm_rhs_smb *object = (struct epm_rhs_smb *)pytalloc_get_ptr(obj);
553 : PyObject *py_unc;
554 0 : py_unc = PyString_FromStringOrNULL(object->unc);
555 0 : return py_unc;
556 : }
557 :
558 0 : static int py_epm_rhs_smb_set_unc(PyObject *py_obj, PyObject *value, void *closure)
559 : {
560 0 : struct epm_rhs_smb *object = (struct epm_rhs_smb *)pytalloc_get_ptr(py_obj);
561 0 : if (value == NULL) {
562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unc");
563 0 : return -1;
564 : }
565 : {
566 : const char *test_str;
567 : const char *talloc_str;
568 0 : PyObject *unicode = NULL;
569 0 : if (PyUnicode_Check(value)) {
570 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
571 0 : if (unicode == NULL) {
572 0 : PyErr_NoMemory();
573 0 : return -1;
574 : }
575 0 : test_str = PyBytes_AS_STRING(unicode);
576 0 : } else if (PyBytes_Check(value)) {
577 0 : test_str = PyBytes_AS_STRING(value);
578 : } else {
579 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
580 0 : return -1;
581 : }
582 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
583 0 : if (unicode != NULL) {
584 0 : Py_DECREF(unicode);
585 : }
586 0 : if (talloc_str == NULL) {
587 0 : PyErr_NoMemory();
588 0 : return -1;
589 : }
590 0 : object->unc = talloc_str;
591 : }
592 0 : return 0;
593 : }
594 :
595 : static PyGetSetDef py_epm_rhs_smb_getsetters[] = {
596 : {
597 : .name = discard_const_p(char, "unc"),
598 : .get = py_epm_rhs_smb_get_unc,
599 : .set = py_epm_rhs_smb_set_unc,
600 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
601 : },
602 : { .name = NULL }
603 : };
604 :
605 0 : static PyObject *py_epm_rhs_smb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
606 : {
607 0 : return pytalloc_new(struct epm_rhs_smb, type);
608 : }
609 :
610 :
611 : static PyTypeObject epm_rhs_smb_Type = {
612 : PyVarObject_HEAD_INIT(NULL, 0)
613 : .tp_name = "epmapper.epm_rhs_smb",
614 : .tp_getset = py_epm_rhs_smb_getsetters,
615 : .tp_methods = NULL,
616 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
617 : .tp_new = py_epm_rhs_smb_new,
618 : };
619 :
620 :
621 0 : static PyObject *py_epm_rhs_named_pipe_get_path(PyObject *obj, void *closure)
622 : {
623 0 : struct epm_rhs_named_pipe *object = (struct epm_rhs_named_pipe *)pytalloc_get_ptr(obj);
624 : PyObject *py_path;
625 0 : py_path = PyString_FromStringOrNULL(object->path);
626 0 : return py_path;
627 : }
628 :
629 0 : static int py_epm_rhs_named_pipe_set_path(PyObject *py_obj, PyObject *value, void *closure)
630 : {
631 0 : struct epm_rhs_named_pipe *object = (struct epm_rhs_named_pipe *)pytalloc_get_ptr(py_obj);
632 0 : if (value == NULL) {
633 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->path");
634 0 : return -1;
635 : }
636 : {
637 : const char *test_str;
638 : const char *talloc_str;
639 0 : PyObject *unicode = NULL;
640 0 : if (PyUnicode_Check(value)) {
641 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
642 0 : if (unicode == NULL) {
643 0 : PyErr_NoMemory();
644 0 : return -1;
645 : }
646 0 : test_str = PyBytes_AS_STRING(unicode);
647 0 : } else if (PyBytes_Check(value)) {
648 0 : test_str = PyBytes_AS_STRING(value);
649 : } else {
650 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
651 0 : return -1;
652 : }
653 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
654 0 : if (unicode != NULL) {
655 0 : Py_DECREF(unicode);
656 : }
657 0 : if (talloc_str == NULL) {
658 0 : PyErr_NoMemory();
659 0 : return -1;
660 : }
661 0 : object->path = talloc_str;
662 : }
663 0 : return 0;
664 : }
665 :
666 : static PyGetSetDef py_epm_rhs_named_pipe_getsetters[] = {
667 : {
668 : .name = discard_const_p(char, "path"),
669 : .get = py_epm_rhs_named_pipe_get_path,
670 : .set = py_epm_rhs_named_pipe_set_path,
671 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
672 : },
673 : { .name = NULL }
674 : };
675 :
676 0 : static PyObject *py_epm_rhs_named_pipe_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
677 : {
678 0 : return pytalloc_new(struct epm_rhs_named_pipe, type);
679 : }
680 :
681 :
682 : static PyTypeObject epm_rhs_named_pipe_Type = {
683 : PyVarObject_HEAD_INIT(NULL, 0)
684 : .tp_name = "epmapper.epm_rhs_named_pipe",
685 : .tp_getset = py_epm_rhs_named_pipe_getsetters,
686 : .tp_methods = NULL,
687 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
688 : .tp_new = py_epm_rhs_named_pipe_new,
689 : };
690 :
691 :
692 0 : static PyObject *py_epm_rhs_netbios_get_name(PyObject *obj, void *closure)
693 : {
694 0 : struct epm_rhs_netbios *object = (struct epm_rhs_netbios *)pytalloc_get_ptr(obj);
695 : PyObject *py_name;
696 0 : py_name = PyString_FromStringOrNULL(object->name);
697 0 : return py_name;
698 : }
699 :
700 0 : static int py_epm_rhs_netbios_set_name(PyObject *py_obj, PyObject *value, void *closure)
701 : {
702 0 : struct epm_rhs_netbios *object = (struct epm_rhs_netbios *)pytalloc_get_ptr(py_obj);
703 0 : if (value == NULL) {
704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
705 0 : return -1;
706 : }
707 : {
708 : const char *test_str;
709 : const char *talloc_str;
710 0 : PyObject *unicode = NULL;
711 0 : if (PyUnicode_Check(value)) {
712 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
713 0 : if (unicode == NULL) {
714 0 : PyErr_NoMemory();
715 0 : return -1;
716 : }
717 0 : test_str = PyBytes_AS_STRING(unicode);
718 0 : } else if (PyBytes_Check(value)) {
719 0 : test_str = PyBytes_AS_STRING(value);
720 : } else {
721 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
722 0 : return -1;
723 : }
724 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
725 0 : if (unicode != NULL) {
726 0 : Py_DECREF(unicode);
727 : }
728 0 : if (talloc_str == NULL) {
729 0 : PyErr_NoMemory();
730 0 : return -1;
731 : }
732 0 : object->name = talloc_str;
733 : }
734 0 : return 0;
735 : }
736 :
737 : static PyGetSetDef py_epm_rhs_netbios_getsetters[] = {
738 : {
739 : .name = discard_const_p(char, "name"),
740 : .get = py_epm_rhs_netbios_get_name,
741 : .set = py_epm_rhs_netbios_set_name,
742 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
743 : },
744 : { .name = NULL }
745 : };
746 :
747 0 : static PyObject *py_epm_rhs_netbios_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
748 : {
749 0 : return pytalloc_new(struct epm_rhs_netbios, type);
750 : }
751 :
752 :
753 : static PyTypeObject epm_rhs_netbios_Type = {
754 : PyVarObject_HEAD_INIT(NULL, 0)
755 : .tp_name = "epmapper.epm_rhs_netbios",
756 : .tp_getset = py_epm_rhs_netbios_getsetters,
757 : .tp_methods = NULL,
758 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
759 : .tp_new = py_epm_rhs_netbios_new,
760 : };
761 :
762 :
763 0 : static PyObject *py_epm_rhs_netbeui_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
764 : {
765 0 : return pytalloc_new(struct epm_rhs_netbeui, type);
766 : }
767 :
768 :
769 : static PyTypeObject epm_rhs_netbeui_Type = {
770 : PyVarObject_HEAD_INIT(NULL, 0)
771 : .tp_name = "epmapper.epm_rhs_netbeui",
772 : .tp_getset = NULL,
773 : .tp_methods = NULL,
774 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
775 : .tp_new = py_epm_rhs_netbeui_new,
776 : };
777 :
778 :
779 0 : static PyObject *py_epm_rhs_spx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
780 : {
781 0 : return pytalloc_new(struct epm_rhs_spx, type);
782 : }
783 :
784 :
785 : static PyTypeObject epm_rhs_spx_Type = {
786 : PyVarObject_HEAD_INIT(NULL, 0)
787 : .tp_name = "epmapper.epm_rhs_spx",
788 : .tp_getset = NULL,
789 : .tp_methods = NULL,
790 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
791 : .tp_new = py_epm_rhs_spx_new,
792 : };
793 :
794 :
795 0 : static PyObject *py_epm_rhs_nb_ipx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
796 : {
797 0 : return pytalloc_new(struct epm_rhs_nb_ipx, type);
798 : }
799 :
800 :
801 : static PyTypeObject epm_rhs_nb_ipx_Type = {
802 : PyVarObject_HEAD_INIT(NULL, 0)
803 : .tp_name = "epmapper.epm_rhs_nb_ipx",
804 : .tp_getset = NULL,
805 : .tp_methods = NULL,
806 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
807 : .tp_new = py_epm_rhs_nb_ipx_new,
808 : };
809 :
810 :
811 0 : static PyObject *py_epm_rhs_http_get_port(PyObject *obj, void *closure)
812 : {
813 0 : struct epm_rhs_http *object = (struct epm_rhs_http *)pytalloc_get_ptr(obj);
814 : PyObject *py_port;
815 0 : py_port = PyLong_FromLong((uint16_t)object->port);
816 0 : return py_port;
817 : }
818 :
819 0 : static int py_epm_rhs_http_set_port(PyObject *py_obj, PyObject *value, void *closure)
820 : {
821 0 : struct epm_rhs_http *object = (struct epm_rhs_http *)pytalloc_get_ptr(py_obj);
822 0 : if (value == NULL) {
823 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->port");
824 0 : return -1;
825 : }
826 : {
827 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
828 0 : if (PyLong_Check(value)) {
829 : unsigned long long test_var;
830 0 : test_var = PyLong_AsUnsignedLongLong(value);
831 0 : if (PyErr_Occurred() != NULL) {
832 0 : return -1;
833 : }
834 0 : if (test_var > uint_max) {
835 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
836 : PyLong_Type.tp_name, uint_max, test_var);
837 0 : return -1;
838 : }
839 0 : object->port = test_var;
840 : } else {
841 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
842 : PyLong_Type.tp_name);
843 0 : return -1;
844 : }
845 : }
846 0 : return 0;
847 : }
848 :
849 : static PyGetSetDef py_epm_rhs_http_getsetters[] = {
850 : {
851 : .name = discard_const_p(char, "port"),
852 : .get = py_epm_rhs_http_get_port,
853 : .set = py_epm_rhs_http_set_port,
854 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
855 : },
856 : { .name = NULL }
857 : };
858 :
859 0 : static PyObject *py_epm_rhs_http_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
860 : {
861 0 : return pytalloc_new(struct epm_rhs_http, type);
862 : }
863 :
864 :
865 : static PyTypeObject epm_rhs_http_Type = {
866 : PyVarObject_HEAD_INIT(NULL, 0)
867 : .tp_name = "epmapper.epm_rhs_http",
868 : .tp_getset = py_epm_rhs_http_getsetters,
869 : .tp_methods = NULL,
870 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
871 : .tp_new = py_epm_rhs_http_new,
872 : };
873 :
874 :
875 0 : static PyObject *py_epm_rhs_unix_ds_get_path(PyObject *obj, void *closure)
876 : {
877 0 : struct epm_rhs_unix_ds *object = (struct epm_rhs_unix_ds *)pytalloc_get_ptr(obj);
878 : PyObject *py_path;
879 0 : py_path = PyString_FromStringOrNULL(object->path);
880 0 : return py_path;
881 : }
882 :
883 0 : static int py_epm_rhs_unix_ds_set_path(PyObject *py_obj, PyObject *value, void *closure)
884 : {
885 0 : struct epm_rhs_unix_ds *object = (struct epm_rhs_unix_ds *)pytalloc_get_ptr(py_obj);
886 0 : if (value == NULL) {
887 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->path");
888 0 : return -1;
889 : }
890 : {
891 : const char *test_str;
892 : const char *talloc_str;
893 0 : PyObject *unicode = NULL;
894 0 : if (PyUnicode_Check(value)) {
895 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
896 0 : if (unicode == NULL) {
897 0 : PyErr_NoMemory();
898 0 : return -1;
899 : }
900 0 : test_str = PyBytes_AS_STRING(unicode);
901 0 : } else if (PyBytes_Check(value)) {
902 0 : test_str = PyBytes_AS_STRING(value);
903 : } else {
904 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
905 0 : return -1;
906 : }
907 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
908 0 : if (unicode != NULL) {
909 0 : Py_DECREF(unicode);
910 : }
911 0 : if (talloc_str == NULL) {
912 0 : PyErr_NoMemory();
913 0 : return -1;
914 : }
915 0 : object->path = talloc_str;
916 : }
917 0 : return 0;
918 : }
919 :
920 : static PyGetSetDef py_epm_rhs_unix_ds_getsetters[] = {
921 : {
922 : .name = discard_const_p(char, "path"),
923 : .get = py_epm_rhs_unix_ds_get_path,
924 : .set = py_epm_rhs_unix_ds_set_path,
925 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
926 : },
927 : { .name = NULL }
928 : };
929 :
930 0 : static PyObject *py_epm_rhs_unix_ds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
931 : {
932 0 : return pytalloc_new(struct epm_rhs_unix_ds, type);
933 : }
934 :
935 :
936 : static PyTypeObject epm_rhs_unix_ds_Type = {
937 : PyVarObject_HEAD_INIT(NULL, 0)
938 : .tp_name = "epmapper.epm_rhs_unix_ds",
939 : .tp_getset = py_epm_rhs_unix_ds_getsetters,
940 : .tp_methods = NULL,
941 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
942 : .tp_new = py_epm_rhs_unix_ds_new,
943 : };
944 :
945 :
946 0 : static PyObject *py_epm_rhs_null_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
947 : {
948 0 : return pytalloc_new(struct epm_rhs_null, type);
949 : }
950 :
951 :
952 : static PyTypeObject epm_rhs_null_Type = {
953 : PyVarObject_HEAD_INIT(NULL, 0)
954 : .tp_name = "epmapper.epm_rhs_null",
955 : .tp_getset = NULL,
956 : .tp_methods = NULL,
957 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
958 : .tp_new = py_epm_rhs_null_new,
959 : };
960 :
961 :
962 0 : static PyObject *py_epm_rhs_ncalrpc_get_minor_version(PyObject *obj, void *closure)
963 : {
964 0 : struct epm_rhs_ncalrpc *object = (struct epm_rhs_ncalrpc *)pytalloc_get_ptr(obj);
965 : PyObject *py_minor_version;
966 0 : py_minor_version = PyLong_FromLong((uint16_t)object->minor_version);
967 0 : return py_minor_version;
968 : }
969 :
970 0 : static int py_epm_rhs_ncalrpc_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
971 : {
972 0 : struct epm_rhs_ncalrpc *object = (struct epm_rhs_ncalrpc *)pytalloc_get_ptr(py_obj);
973 0 : if (value == NULL) {
974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->minor_version");
975 0 : return -1;
976 : }
977 : {
978 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor_version));
979 0 : if (PyLong_Check(value)) {
980 : unsigned long long test_var;
981 0 : test_var = PyLong_AsUnsignedLongLong(value);
982 0 : if (PyErr_Occurred() != NULL) {
983 0 : return -1;
984 : }
985 0 : if (test_var > uint_max) {
986 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
987 : PyLong_Type.tp_name, uint_max, test_var);
988 0 : return -1;
989 : }
990 0 : object->minor_version = test_var;
991 : } else {
992 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
993 : PyLong_Type.tp_name);
994 0 : return -1;
995 : }
996 : }
997 0 : return 0;
998 : }
999 :
1000 : static PyGetSetDef py_epm_rhs_ncalrpc_getsetters[] = {
1001 : {
1002 : .name = discard_const_p(char, "minor_version"),
1003 : .get = py_epm_rhs_ncalrpc_get_minor_version,
1004 : .set = py_epm_rhs_ncalrpc_set_minor_version,
1005 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1006 : },
1007 : { .name = NULL }
1008 : };
1009 :
1010 0 : static PyObject *py_epm_rhs_ncalrpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1011 : {
1012 0 : return pytalloc_new(struct epm_rhs_ncalrpc, type);
1013 : }
1014 :
1015 :
1016 : static PyTypeObject epm_rhs_ncalrpc_Type = {
1017 : PyVarObject_HEAD_INIT(NULL, 0)
1018 : .tp_name = "epmapper.epm_rhs_ncalrpc",
1019 : .tp_getset = py_epm_rhs_ncalrpc_getsetters,
1020 : .tp_methods = NULL,
1021 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1022 : .tp_new = py_epm_rhs_ncalrpc_new,
1023 : };
1024 :
1025 :
1026 0 : static PyObject *py_epm_rhs_appletalk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1027 : {
1028 0 : return pytalloc_new(struct epm_rhs_appletalk, type);
1029 : }
1030 :
1031 :
1032 : static PyTypeObject epm_rhs_appletalk_Type = {
1033 : PyVarObject_HEAD_INIT(NULL, 0)
1034 : .tp_name = "epmapper.epm_rhs_appletalk",
1035 : .tp_getset = NULL,
1036 : .tp_methods = NULL,
1037 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1038 : .tp_new = py_epm_rhs_appletalk_new,
1039 : };
1040 :
1041 :
1042 0 : static PyObject *py_epm_rhs_atalk_stream_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1043 : {
1044 0 : return pytalloc_new(struct epm_rhs_atalk_stream, type);
1045 : }
1046 :
1047 :
1048 : static PyTypeObject epm_rhs_atalk_stream_Type = {
1049 : PyVarObject_HEAD_INIT(NULL, 0)
1050 : .tp_name = "epmapper.epm_rhs_atalk_stream",
1051 : .tp_getset = NULL,
1052 : .tp_methods = NULL,
1053 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1054 : .tp_new = py_epm_rhs_atalk_stream_new,
1055 : };
1056 :
1057 :
1058 0 : static PyObject *py_epm_rhs_atalk_datagram_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1059 : {
1060 0 : return pytalloc_new(struct epm_rhs_atalk_datagram, type);
1061 : }
1062 :
1063 :
1064 : static PyTypeObject epm_rhs_atalk_datagram_Type = {
1065 : PyVarObject_HEAD_INIT(NULL, 0)
1066 : .tp_name = "epmapper.epm_rhs_atalk_datagram",
1067 : .tp_getset = NULL,
1068 : .tp_methods = NULL,
1069 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1070 : .tp_new = py_epm_rhs_atalk_datagram_new,
1071 : };
1072 :
1073 :
1074 0 : static PyObject *py_epm_rhs_vines_spp_get_port(PyObject *obj, void *closure)
1075 : {
1076 0 : struct epm_rhs_vines_spp *object = (struct epm_rhs_vines_spp *)pytalloc_get_ptr(obj);
1077 : PyObject *py_port;
1078 0 : py_port = PyLong_FromLong((uint16_t)object->port);
1079 0 : return py_port;
1080 : }
1081 :
1082 0 : static int py_epm_rhs_vines_spp_set_port(PyObject *py_obj, PyObject *value, void *closure)
1083 : {
1084 0 : struct epm_rhs_vines_spp *object = (struct epm_rhs_vines_spp *)pytalloc_get_ptr(py_obj);
1085 0 : if (value == NULL) {
1086 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->port");
1087 0 : return -1;
1088 : }
1089 : {
1090 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
1091 0 : if (PyLong_Check(value)) {
1092 : unsigned long long test_var;
1093 0 : test_var = PyLong_AsUnsignedLongLong(value);
1094 0 : if (PyErr_Occurred() != NULL) {
1095 0 : return -1;
1096 : }
1097 0 : if (test_var > uint_max) {
1098 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1099 : PyLong_Type.tp_name, uint_max, test_var);
1100 0 : return -1;
1101 : }
1102 0 : object->port = test_var;
1103 : } else {
1104 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1105 : PyLong_Type.tp_name);
1106 0 : return -1;
1107 : }
1108 : }
1109 0 : return 0;
1110 : }
1111 :
1112 : static PyGetSetDef py_epm_rhs_vines_spp_getsetters[] = {
1113 : {
1114 : .name = discard_const_p(char, "port"),
1115 : .get = py_epm_rhs_vines_spp_get_port,
1116 : .set = py_epm_rhs_vines_spp_set_port,
1117 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1118 : },
1119 : { .name = NULL }
1120 : };
1121 :
1122 0 : static PyObject *py_epm_rhs_vines_spp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1123 : {
1124 0 : return pytalloc_new(struct epm_rhs_vines_spp, type);
1125 : }
1126 :
1127 :
1128 : static PyTypeObject epm_rhs_vines_spp_Type = {
1129 : PyVarObject_HEAD_INIT(NULL, 0)
1130 : .tp_name = "epmapper.epm_rhs_vines_spp",
1131 : .tp_getset = py_epm_rhs_vines_spp_getsetters,
1132 : .tp_methods = NULL,
1133 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1134 : .tp_new = py_epm_rhs_vines_spp_new,
1135 : };
1136 :
1137 :
1138 0 : static PyObject *py_epm_rhs_vines_ipc_get_port(PyObject *obj, void *closure)
1139 : {
1140 0 : struct epm_rhs_vines_ipc *object = (struct epm_rhs_vines_ipc *)pytalloc_get_ptr(obj);
1141 : PyObject *py_port;
1142 0 : py_port = PyLong_FromLong((uint16_t)object->port);
1143 0 : return py_port;
1144 : }
1145 :
1146 0 : static int py_epm_rhs_vines_ipc_set_port(PyObject *py_obj, PyObject *value, void *closure)
1147 : {
1148 0 : struct epm_rhs_vines_ipc *object = (struct epm_rhs_vines_ipc *)pytalloc_get_ptr(py_obj);
1149 0 : if (value == NULL) {
1150 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->port");
1151 0 : return -1;
1152 : }
1153 : {
1154 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port));
1155 0 : if (PyLong_Check(value)) {
1156 : unsigned long long test_var;
1157 0 : test_var = PyLong_AsUnsignedLongLong(value);
1158 0 : if (PyErr_Occurred() != NULL) {
1159 0 : return -1;
1160 : }
1161 0 : if (test_var > uint_max) {
1162 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1163 : PyLong_Type.tp_name, uint_max, test_var);
1164 0 : return -1;
1165 : }
1166 0 : object->port = test_var;
1167 : } else {
1168 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1169 : PyLong_Type.tp_name);
1170 0 : return -1;
1171 : }
1172 : }
1173 0 : return 0;
1174 : }
1175 :
1176 : static PyGetSetDef py_epm_rhs_vines_ipc_getsetters[] = {
1177 : {
1178 : .name = discard_const_p(char, "port"),
1179 : .get = py_epm_rhs_vines_ipc_get_port,
1180 : .set = py_epm_rhs_vines_ipc_set_port,
1181 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1182 : },
1183 : { .name = NULL }
1184 : };
1185 :
1186 0 : static PyObject *py_epm_rhs_vines_ipc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1187 : {
1188 0 : return pytalloc_new(struct epm_rhs_vines_ipc, type);
1189 : }
1190 :
1191 :
1192 : static PyTypeObject epm_rhs_vines_ipc_Type = {
1193 : PyVarObject_HEAD_INIT(NULL, 0)
1194 : .tp_name = "epmapper.epm_rhs_vines_ipc",
1195 : .tp_getset = py_epm_rhs_vines_ipc_getsetters,
1196 : .tp_methods = NULL,
1197 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1198 : .tp_new = py_epm_rhs_vines_ipc_new,
1199 : };
1200 :
1201 :
1202 0 : static PyObject *py_epm_rhs_streettalk_get_streettalk(PyObject *obj, void *closure)
1203 : {
1204 0 : struct epm_rhs_streettalk *object = (struct epm_rhs_streettalk *)pytalloc_get_ptr(obj);
1205 : PyObject *py_streettalk;
1206 0 : py_streettalk = PyString_FromStringOrNULL(object->streettalk);
1207 0 : return py_streettalk;
1208 : }
1209 :
1210 0 : static int py_epm_rhs_streettalk_set_streettalk(PyObject *py_obj, PyObject *value, void *closure)
1211 : {
1212 0 : struct epm_rhs_streettalk *object = (struct epm_rhs_streettalk *)pytalloc_get_ptr(py_obj);
1213 0 : if (value == NULL) {
1214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->streettalk");
1215 0 : return -1;
1216 : }
1217 : {
1218 : const char *test_str;
1219 : const char *talloc_str;
1220 0 : PyObject *unicode = NULL;
1221 0 : if (PyUnicode_Check(value)) {
1222 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1223 0 : if (unicode == NULL) {
1224 0 : PyErr_NoMemory();
1225 0 : return -1;
1226 : }
1227 0 : test_str = PyBytes_AS_STRING(unicode);
1228 0 : } else if (PyBytes_Check(value)) {
1229 0 : test_str = PyBytes_AS_STRING(value);
1230 : } else {
1231 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1232 0 : return -1;
1233 : }
1234 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1235 0 : if (unicode != NULL) {
1236 0 : Py_DECREF(unicode);
1237 : }
1238 0 : if (talloc_str == NULL) {
1239 0 : PyErr_NoMemory();
1240 0 : return -1;
1241 : }
1242 0 : object->streettalk = talloc_str;
1243 : }
1244 0 : return 0;
1245 : }
1246 :
1247 : static PyGetSetDef py_epm_rhs_streettalk_getsetters[] = {
1248 : {
1249 : .name = discard_const_p(char, "streettalk"),
1250 : .get = py_epm_rhs_streettalk_get_streettalk,
1251 : .set = py_epm_rhs_streettalk_set_streettalk,
1252 : .doc = discard_const_p(char, "PIDL-generated element of base type string")
1253 : },
1254 : { .name = NULL }
1255 : };
1256 :
1257 0 : static PyObject *py_epm_rhs_streettalk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1258 : {
1259 0 : return pytalloc_new(struct epm_rhs_streettalk, type);
1260 : }
1261 :
1262 :
1263 : static PyTypeObject epm_rhs_streettalk_Type = {
1264 : PyVarObject_HEAD_INIT(NULL, 0)
1265 : .tp_name = "epmapper.epm_rhs_streettalk",
1266 : .tp_getset = py_epm_rhs_streettalk_getsetters,
1267 : .tp_methods = NULL,
1268 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1269 : .tp_new = py_epm_rhs_streettalk_new,
1270 : };
1271 :
1272 160 : static PyObject *py_import_epm_rhs(TALLOC_CTX *mem_ctx, int level, union epm_rhs *in)
1273 : {
1274 : PyObject *ret;
1275 :
1276 160 : switch (level) {
1277 0 : case EPM_PROTOCOL_DNET_NSP:
1278 0 : ret = pytalloc_reference_ex(&epm_rhs_dnet_nsp_Type, mem_ctx, &in->dnet_nsp);
1279 0 : return ret;
1280 :
1281 0 : case EPM_PROTOCOL_OSI_TP4:
1282 0 : ret = pytalloc_reference_ex(&epm_rhs_osi_tp4_Type, mem_ctx, &in->osi_tp4);
1283 0 : return ret;
1284 :
1285 0 : case EPM_PROTOCOL_OSI_CLNS:
1286 0 : ret = pytalloc_reference_ex(&epm_rhs_osi_clns_Type, mem_ctx, &in->osi_clns);
1287 0 : return ret;
1288 :
1289 64 : case EPM_PROTOCOL_TCP:
1290 64 : ret = pytalloc_reference_ex(&epm_rhs_tcp_Type, mem_ctx, &in->tcp);
1291 64 : return ret;
1292 :
1293 0 : case EPM_PROTOCOL_UDP:
1294 0 : ret = pytalloc_reference_ex(&epm_rhs_udp_Type, mem_ctx, &in->udp);
1295 0 : return ret;
1296 :
1297 48 : case EPM_PROTOCOL_IP:
1298 48 : ret = pytalloc_reference_ex(&epm_rhs_ip_Type, mem_ctx, &in->ip);
1299 48 : return ret;
1300 :
1301 0 : case EPM_PROTOCOL_NCADG:
1302 0 : ret = pytalloc_reference_ex(&epm_rhs_ncadg_Type, mem_ctx, &in->ncadg);
1303 0 : return ret;
1304 :
1305 48 : case EPM_PROTOCOL_NCACN:
1306 48 : ret = pytalloc_reference_ex(&epm_rhs_ncacn_Type, mem_ctx, &in->ncacn);
1307 48 : return ret;
1308 :
1309 0 : case EPM_PROTOCOL_NCALRPC:
1310 0 : ret = pytalloc_reference_ex(&epm_rhs_ncalrpc_Type, mem_ctx, &in->ncalrpc);
1311 0 : return ret;
1312 :
1313 0 : case EPM_PROTOCOL_UUID:
1314 0 : ret = pytalloc_reference_ex(&epm_rhs_uuid_Type, mem_ctx, &in->uuid);
1315 0 : return ret;
1316 :
1317 0 : case EPM_PROTOCOL_IPX:
1318 0 : ret = pytalloc_reference_ex(&epm_rhs_ipx_Type, mem_ctx, &in->ipx);
1319 0 : return ret;
1320 :
1321 0 : case EPM_PROTOCOL_SMB:
1322 0 : ret = pytalloc_reference_ex(&epm_rhs_smb_Type, mem_ctx, &in->smb);
1323 0 : return ret;
1324 :
1325 0 : case EPM_PROTOCOL_NAMED_PIPE:
1326 0 : ret = pytalloc_reference_ex(&epm_rhs_named_pipe_Type, mem_ctx, &in->named_pipe);
1327 0 : return ret;
1328 :
1329 0 : case EPM_PROTOCOL_NETBIOS:
1330 0 : ret = pytalloc_reference_ex(&epm_rhs_netbios_Type, mem_ctx, &in->netbios);
1331 0 : return ret;
1332 :
1333 0 : case EPM_PROTOCOL_NETBEUI:
1334 0 : ret = pytalloc_reference_ex(&epm_rhs_netbeui_Type, mem_ctx, &in->netbeui);
1335 0 : return ret;
1336 :
1337 0 : case EPM_PROTOCOL_SPX:
1338 0 : ret = pytalloc_reference_ex(&epm_rhs_spx_Type, mem_ctx, &in->spx);
1339 0 : return ret;
1340 :
1341 0 : case EPM_PROTOCOL_NB_IPX:
1342 0 : ret = pytalloc_reference_ex(&epm_rhs_nb_ipx_Type, mem_ctx, &in->nb_ipx);
1343 0 : return ret;
1344 :
1345 0 : case EPM_PROTOCOL_DSP:
1346 0 : ret = pytalloc_reference_ex(&epm_rhs_atalk_stream_Type, mem_ctx, &in->atalk_stream);
1347 0 : return ret;
1348 :
1349 0 : case EPM_PROTOCOL_DDP:
1350 0 : ret = pytalloc_reference_ex(&epm_rhs_atalk_datagram_Type, mem_ctx, &in->atalk_datagram);
1351 0 : return ret;
1352 :
1353 0 : case EPM_PROTOCOL_APPLETALK:
1354 0 : ret = pytalloc_reference_ex(&epm_rhs_appletalk_Type, mem_ctx, &in->appletalk);
1355 0 : return ret;
1356 :
1357 0 : case EPM_PROTOCOL_VINES_SPP:
1358 0 : ret = pytalloc_reference_ex(&epm_rhs_vines_spp_Type, mem_ctx, &in->vines_spp);
1359 0 : return ret;
1360 :
1361 0 : case EPM_PROTOCOL_VINES_IPC:
1362 0 : ret = pytalloc_reference_ex(&epm_rhs_vines_ipc_Type, mem_ctx, &in->vines_ipc);
1363 0 : return ret;
1364 :
1365 0 : case EPM_PROTOCOL_STREETTALK:
1366 0 : ret = pytalloc_reference_ex(&epm_rhs_streettalk_Type, mem_ctx, &in->streettalk);
1367 0 : return ret;
1368 :
1369 0 : case EPM_PROTOCOL_HTTP:
1370 0 : ret = pytalloc_reference_ex(&epm_rhs_http_Type, mem_ctx, &in->http);
1371 0 : return ret;
1372 :
1373 0 : case EPM_PROTOCOL_UNIX_DS:
1374 0 : ret = pytalloc_reference_ex(&epm_rhs_unix_ds_Type, mem_ctx, &in->unix_ds);
1375 0 : return ret;
1376 :
1377 0 : case EPM_PROTOCOL_NULL:
1378 0 : ret = pytalloc_reference_ex(&epm_rhs_null_Type, mem_ctx, &in->null);
1379 0 : return ret;
1380 :
1381 0 : default:
1382 0 : ret = PyBytes_FromStringAndSize((char *)(in->unknown).data, (in->unknown).length);
1383 0 : return ret;
1384 :
1385 : }
1386 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1387 : return NULL;
1388 : }
1389 :
1390 96 : static union epm_rhs *py_export_epm_rhs(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1391 : {
1392 96 : union epm_rhs *ret = talloc_zero(mem_ctx, union epm_rhs);
1393 96 : switch (level) {
1394 0 : case EPM_PROTOCOL_DNET_NSP:
1395 0 : if (in == NULL) {
1396 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dnet_nsp");
1397 0 : talloc_free(ret); return NULL;
1398 : }
1399 0 : PY_CHECK_TYPE(&epm_rhs_dnet_nsp_Type, in, talloc_free(ret); return NULL;);
1400 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1401 0 : PyErr_NoMemory();
1402 0 : talloc_free(ret); return NULL;
1403 : }
1404 0 : ret->dnet_nsp = *(struct epm_rhs_dnet_nsp *)pytalloc_get_ptr(in);
1405 0 : break;
1406 :
1407 0 : case EPM_PROTOCOL_OSI_TP4:
1408 0 : if (in == NULL) {
1409 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->osi_tp4");
1410 0 : talloc_free(ret); return NULL;
1411 : }
1412 0 : PY_CHECK_TYPE(&epm_rhs_osi_tp4_Type, in, talloc_free(ret); return NULL;);
1413 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1414 0 : PyErr_NoMemory();
1415 0 : talloc_free(ret); return NULL;
1416 : }
1417 0 : ret->osi_tp4 = *(struct epm_rhs_osi_tp4 *)pytalloc_get_ptr(in);
1418 0 : break;
1419 :
1420 0 : case EPM_PROTOCOL_OSI_CLNS:
1421 0 : if (in == NULL) {
1422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->osi_clns");
1423 0 : talloc_free(ret); return NULL;
1424 : }
1425 0 : PY_CHECK_TYPE(&epm_rhs_osi_clns_Type, in, talloc_free(ret); return NULL;);
1426 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1427 0 : PyErr_NoMemory();
1428 0 : talloc_free(ret); return NULL;
1429 : }
1430 0 : ret->osi_clns = *(struct epm_rhs_osi_clns *)pytalloc_get_ptr(in);
1431 0 : break;
1432 :
1433 0 : case EPM_PROTOCOL_TCP:
1434 0 : if (in == NULL) {
1435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->tcp");
1436 0 : talloc_free(ret); return NULL;
1437 : }
1438 0 : PY_CHECK_TYPE(&epm_rhs_tcp_Type, in, talloc_free(ret); return NULL;);
1439 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1440 0 : PyErr_NoMemory();
1441 0 : talloc_free(ret); return NULL;
1442 : }
1443 0 : ret->tcp = *(struct epm_rhs_tcp *)pytalloc_get_ptr(in);
1444 0 : break;
1445 :
1446 0 : case EPM_PROTOCOL_UDP:
1447 0 : if (in == NULL) {
1448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->udp");
1449 0 : talloc_free(ret); return NULL;
1450 : }
1451 0 : PY_CHECK_TYPE(&epm_rhs_udp_Type, in, talloc_free(ret); return NULL;);
1452 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1453 0 : PyErr_NoMemory();
1454 0 : talloc_free(ret); return NULL;
1455 : }
1456 0 : ret->udp = *(struct epm_rhs_udp *)pytalloc_get_ptr(in);
1457 0 : break;
1458 :
1459 0 : case EPM_PROTOCOL_IP:
1460 0 : if (in == NULL) {
1461 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ip");
1462 0 : talloc_free(ret); return NULL;
1463 : }
1464 0 : PY_CHECK_TYPE(&epm_rhs_ip_Type, in, talloc_free(ret); return NULL;);
1465 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1466 0 : PyErr_NoMemory();
1467 0 : talloc_free(ret); return NULL;
1468 : }
1469 0 : ret->ip = *(struct epm_rhs_ip *)pytalloc_get_ptr(in);
1470 0 : break;
1471 :
1472 0 : case EPM_PROTOCOL_NCADG:
1473 0 : if (in == NULL) {
1474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ncadg");
1475 0 : talloc_free(ret); return NULL;
1476 : }
1477 0 : PY_CHECK_TYPE(&epm_rhs_ncadg_Type, in, talloc_free(ret); return NULL;);
1478 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1479 0 : PyErr_NoMemory();
1480 0 : talloc_free(ret); return NULL;
1481 : }
1482 0 : ret->ncadg = *(struct epm_rhs_ncadg *)pytalloc_get_ptr(in);
1483 0 : break;
1484 :
1485 0 : case EPM_PROTOCOL_NCACN:
1486 0 : if (in == NULL) {
1487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ncacn");
1488 0 : talloc_free(ret); return NULL;
1489 : }
1490 0 : PY_CHECK_TYPE(&epm_rhs_ncacn_Type, in, talloc_free(ret); return NULL;);
1491 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1492 0 : PyErr_NoMemory();
1493 0 : talloc_free(ret); return NULL;
1494 : }
1495 0 : ret->ncacn = *(struct epm_rhs_ncacn *)pytalloc_get_ptr(in);
1496 0 : break;
1497 :
1498 0 : case EPM_PROTOCOL_NCALRPC:
1499 0 : if (in == NULL) {
1500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ncalrpc");
1501 0 : talloc_free(ret); return NULL;
1502 : }
1503 0 : PY_CHECK_TYPE(&epm_rhs_ncalrpc_Type, in, talloc_free(ret); return NULL;);
1504 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1505 0 : PyErr_NoMemory();
1506 0 : talloc_free(ret); return NULL;
1507 : }
1508 0 : ret->ncalrpc = *(struct epm_rhs_ncalrpc *)pytalloc_get_ptr(in);
1509 0 : break;
1510 :
1511 96 : case EPM_PROTOCOL_UUID:
1512 96 : if (in == NULL) {
1513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->uuid");
1514 0 : talloc_free(ret); return NULL;
1515 : }
1516 96 : PY_CHECK_TYPE(&epm_rhs_uuid_Type, in, talloc_free(ret); return NULL;);
1517 96 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1518 0 : PyErr_NoMemory();
1519 0 : talloc_free(ret); return NULL;
1520 : }
1521 96 : ret->uuid = *(struct epm_rhs_uuid *)pytalloc_get_ptr(in);
1522 96 : break;
1523 :
1524 0 : case EPM_PROTOCOL_IPX:
1525 0 : if (in == NULL) {
1526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ipx");
1527 0 : talloc_free(ret); return NULL;
1528 : }
1529 0 : PY_CHECK_TYPE(&epm_rhs_ipx_Type, in, talloc_free(ret); return NULL;);
1530 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1531 0 : PyErr_NoMemory();
1532 0 : talloc_free(ret); return NULL;
1533 : }
1534 0 : ret->ipx = *(struct epm_rhs_ipx *)pytalloc_get_ptr(in);
1535 0 : break;
1536 :
1537 0 : case EPM_PROTOCOL_SMB:
1538 0 : if (in == NULL) {
1539 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->smb");
1540 0 : talloc_free(ret); return NULL;
1541 : }
1542 0 : PY_CHECK_TYPE(&epm_rhs_smb_Type, in, talloc_free(ret); return NULL;);
1543 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1544 0 : PyErr_NoMemory();
1545 0 : talloc_free(ret); return NULL;
1546 : }
1547 0 : ret->smb = *(struct epm_rhs_smb *)pytalloc_get_ptr(in);
1548 0 : break;
1549 :
1550 0 : case EPM_PROTOCOL_NAMED_PIPE:
1551 0 : if (in == NULL) {
1552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->named_pipe");
1553 0 : talloc_free(ret); return NULL;
1554 : }
1555 0 : PY_CHECK_TYPE(&epm_rhs_named_pipe_Type, in, talloc_free(ret); return NULL;);
1556 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1557 0 : PyErr_NoMemory();
1558 0 : talloc_free(ret); return NULL;
1559 : }
1560 0 : ret->named_pipe = *(struct epm_rhs_named_pipe *)pytalloc_get_ptr(in);
1561 0 : break;
1562 :
1563 0 : case EPM_PROTOCOL_NETBIOS:
1564 0 : if (in == NULL) {
1565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->netbios");
1566 0 : talloc_free(ret); return NULL;
1567 : }
1568 0 : PY_CHECK_TYPE(&epm_rhs_netbios_Type, in, talloc_free(ret); return NULL;);
1569 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1570 0 : PyErr_NoMemory();
1571 0 : talloc_free(ret); return NULL;
1572 : }
1573 0 : ret->netbios = *(struct epm_rhs_netbios *)pytalloc_get_ptr(in);
1574 0 : break;
1575 :
1576 0 : case EPM_PROTOCOL_NETBEUI:
1577 0 : if (in == NULL) {
1578 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->netbeui");
1579 0 : talloc_free(ret); return NULL;
1580 : }
1581 0 : PY_CHECK_TYPE(&epm_rhs_netbeui_Type, in, talloc_free(ret); return NULL;);
1582 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1583 0 : PyErr_NoMemory();
1584 0 : talloc_free(ret); return NULL;
1585 : }
1586 0 : ret->netbeui = *(struct epm_rhs_netbeui *)pytalloc_get_ptr(in);
1587 0 : break;
1588 :
1589 0 : case EPM_PROTOCOL_SPX:
1590 0 : if (in == NULL) {
1591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->spx");
1592 0 : talloc_free(ret); return NULL;
1593 : }
1594 0 : PY_CHECK_TYPE(&epm_rhs_spx_Type, in, talloc_free(ret); return NULL;);
1595 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1596 0 : PyErr_NoMemory();
1597 0 : talloc_free(ret); return NULL;
1598 : }
1599 0 : ret->spx = *(struct epm_rhs_spx *)pytalloc_get_ptr(in);
1600 0 : break;
1601 :
1602 0 : case EPM_PROTOCOL_NB_IPX:
1603 0 : if (in == NULL) {
1604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->nb_ipx");
1605 0 : talloc_free(ret); return NULL;
1606 : }
1607 0 : PY_CHECK_TYPE(&epm_rhs_nb_ipx_Type, in, talloc_free(ret); return NULL;);
1608 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1609 0 : PyErr_NoMemory();
1610 0 : talloc_free(ret); return NULL;
1611 : }
1612 0 : ret->nb_ipx = *(struct epm_rhs_nb_ipx *)pytalloc_get_ptr(in);
1613 0 : break;
1614 :
1615 0 : case EPM_PROTOCOL_DSP:
1616 0 : if (in == NULL) {
1617 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->atalk_stream");
1618 0 : talloc_free(ret); return NULL;
1619 : }
1620 0 : PY_CHECK_TYPE(&epm_rhs_atalk_stream_Type, in, talloc_free(ret); return NULL;);
1621 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1622 0 : PyErr_NoMemory();
1623 0 : talloc_free(ret); return NULL;
1624 : }
1625 0 : ret->atalk_stream = *(struct epm_rhs_atalk_stream *)pytalloc_get_ptr(in);
1626 0 : break;
1627 :
1628 0 : case EPM_PROTOCOL_DDP:
1629 0 : if (in == NULL) {
1630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->atalk_datagram");
1631 0 : talloc_free(ret); return NULL;
1632 : }
1633 0 : PY_CHECK_TYPE(&epm_rhs_atalk_datagram_Type, in, talloc_free(ret); return NULL;);
1634 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1635 0 : PyErr_NoMemory();
1636 0 : talloc_free(ret); return NULL;
1637 : }
1638 0 : ret->atalk_datagram = *(struct epm_rhs_atalk_datagram *)pytalloc_get_ptr(in);
1639 0 : break;
1640 :
1641 0 : case EPM_PROTOCOL_APPLETALK:
1642 0 : if (in == NULL) {
1643 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->appletalk");
1644 0 : talloc_free(ret); return NULL;
1645 : }
1646 0 : PY_CHECK_TYPE(&epm_rhs_appletalk_Type, in, talloc_free(ret); return NULL;);
1647 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1648 0 : PyErr_NoMemory();
1649 0 : talloc_free(ret); return NULL;
1650 : }
1651 0 : ret->appletalk = *(struct epm_rhs_appletalk *)pytalloc_get_ptr(in);
1652 0 : break;
1653 :
1654 0 : case EPM_PROTOCOL_VINES_SPP:
1655 0 : if (in == NULL) {
1656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->vines_spp");
1657 0 : talloc_free(ret); return NULL;
1658 : }
1659 0 : PY_CHECK_TYPE(&epm_rhs_vines_spp_Type, in, talloc_free(ret); return NULL;);
1660 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1661 0 : PyErr_NoMemory();
1662 0 : talloc_free(ret); return NULL;
1663 : }
1664 0 : ret->vines_spp = *(struct epm_rhs_vines_spp *)pytalloc_get_ptr(in);
1665 0 : break;
1666 :
1667 0 : case EPM_PROTOCOL_VINES_IPC:
1668 0 : if (in == NULL) {
1669 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->vines_ipc");
1670 0 : talloc_free(ret); return NULL;
1671 : }
1672 0 : PY_CHECK_TYPE(&epm_rhs_vines_ipc_Type, in, talloc_free(ret); return NULL;);
1673 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1674 0 : PyErr_NoMemory();
1675 0 : talloc_free(ret); return NULL;
1676 : }
1677 0 : ret->vines_ipc = *(struct epm_rhs_vines_ipc *)pytalloc_get_ptr(in);
1678 0 : break;
1679 :
1680 0 : case EPM_PROTOCOL_STREETTALK:
1681 0 : if (in == NULL) {
1682 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->streettalk");
1683 0 : talloc_free(ret); return NULL;
1684 : }
1685 0 : PY_CHECK_TYPE(&epm_rhs_streettalk_Type, in, talloc_free(ret); return NULL;);
1686 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1687 0 : PyErr_NoMemory();
1688 0 : talloc_free(ret); return NULL;
1689 : }
1690 0 : ret->streettalk = *(struct epm_rhs_streettalk *)pytalloc_get_ptr(in);
1691 0 : break;
1692 :
1693 0 : case EPM_PROTOCOL_HTTP:
1694 0 : if (in == NULL) {
1695 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->http");
1696 0 : talloc_free(ret); return NULL;
1697 : }
1698 0 : PY_CHECK_TYPE(&epm_rhs_http_Type, in, talloc_free(ret); return NULL;);
1699 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1700 0 : PyErr_NoMemory();
1701 0 : talloc_free(ret); return NULL;
1702 : }
1703 0 : ret->http = *(struct epm_rhs_http *)pytalloc_get_ptr(in);
1704 0 : break;
1705 :
1706 0 : case EPM_PROTOCOL_UNIX_DS:
1707 0 : if (in == NULL) {
1708 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->unix_ds");
1709 0 : talloc_free(ret); return NULL;
1710 : }
1711 0 : PY_CHECK_TYPE(&epm_rhs_unix_ds_Type, in, talloc_free(ret); return NULL;);
1712 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1713 0 : PyErr_NoMemory();
1714 0 : talloc_free(ret); return NULL;
1715 : }
1716 0 : ret->unix_ds = *(struct epm_rhs_unix_ds *)pytalloc_get_ptr(in);
1717 0 : break;
1718 :
1719 0 : case EPM_PROTOCOL_NULL:
1720 0 : if (in == NULL) {
1721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->null");
1722 0 : talloc_free(ret); return NULL;
1723 : }
1724 0 : PY_CHECK_TYPE(&epm_rhs_null_Type, in, talloc_free(ret); return NULL;);
1725 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1726 0 : PyErr_NoMemory();
1727 0 : talloc_free(ret); return NULL;
1728 : }
1729 0 : ret->null = *(struct epm_rhs_null *)pytalloc_get_ptr(in);
1730 0 : break;
1731 :
1732 0 : default:
1733 0 : if (in == NULL) {
1734 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->unknown");
1735 0 : talloc_free(ret); return NULL;
1736 : }
1737 0 : ret->unknown = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
1738 0 : break;
1739 :
1740 : }
1741 :
1742 96 : return ret;
1743 : }
1744 :
1745 160 : static PyObject *py_epm_rhs_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1746 : {
1747 160 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1748 160 : PyObject *mem_ctx_obj = NULL;
1749 160 : TALLOC_CTX *mem_ctx = NULL;
1750 160 : int level = 0;
1751 160 : PyObject *in_obj = NULL;
1752 160 : union epm_rhs *in = NULL;
1753 :
1754 160 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1755 : discard_const_p(char *, kwnames),
1756 : &mem_ctx_obj,
1757 : &level,
1758 : &in_obj)) {
1759 0 : return NULL;
1760 : }
1761 160 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1762 160 : if (mem_ctx == NULL) {
1763 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1764 0 : return NULL;
1765 : }
1766 160 : in = (union epm_rhs *)pytalloc_get_ptr(in_obj);
1767 160 : if (in == NULL) {
1768 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union epm_rhs!");
1769 0 : return NULL;
1770 : }
1771 :
1772 160 : return py_import_epm_rhs(mem_ctx, level, in);
1773 : }
1774 :
1775 96 : static PyObject *py_epm_rhs_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1776 : {
1777 96 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1778 96 : PyObject *mem_ctx_obj = NULL;
1779 96 : TALLOC_CTX *mem_ctx = NULL;
1780 96 : int level = 0;
1781 96 : PyObject *in = NULL;
1782 96 : union epm_rhs *out = NULL;
1783 :
1784 96 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1785 : discard_const_p(char *, kwnames),
1786 : &mem_ctx_obj,
1787 : &level,
1788 : &in)) {
1789 0 : return NULL;
1790 : }
1791 96 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1792 96 : if (mem_ctx == NULL) {
1793 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1794 0 : return NULL;
1795 : }
1796 :
1797 96 : out = py_export_epm_rhs(mem_ctx, level, in);
1798 96 : if (out == NULL) {
1799 0 : return NULL;
1800 : }
1801 :
1802 96 : return pytalloc_GenericObject_reference(out);
1803 : }
1804 :
1805 : static PyMethodDef py_epm_rhs_methods[] = {
1806 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_rhs_import),
1807 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1808 : "T.__import__(mem_ctx, level, in) => ret." },
1809 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_rhs_export),
1810 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1811 : "T.__export__(mem_ctx, level, in) => ret." },
1812 : { NULL, NULL, 0, NULL }
1813 : };
1814 :
1815 0 : static PyObject *py_epm_rhs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1816 : {
1817 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1818 0 : return NULL;
1819 : }
1820 :
1821 :
1822 : static PyTypeObject epm_rhs_Type = {
1823 : PyVarObject_HEAD_INIT(NULL, 0)
1824 : .tp_name = "epmapper.epm_rhs",
1825 : .tp_getset = NULL,
1826 : .tp_methods = py_epm_rhs_methods,
1827 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1828 : .tp_new = py_epm_rhs_new,
1829 : };
1830 :
1831 :
1832 32 : static PyObject *py_epm_lhs_get_protocol(PyObject *obj, void *closure)
1833 : {
1834 32 : struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(obj);
1835 : PyObject *py_protocol;
1836 32 : py_protocol = PyLong_FromLong((uint16_t)object->protocol);
1837 32 : return py_protocol;
1838 : }
1839 :
1840 240 : static int py_epm_lhs_set_protocol(PyObject *py_obj, PyObject *value, void *closure)
1841 : {
1842 240 : struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(py_obj);
1843 240 : if (value == NULL) {
1844 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->protocol");
1845 0 : return -1;
1846 : }
1847 : {
1848 240 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->protocol));
1849 240 : if (PyLong_Check(value)) {
1850 : unsigned long long test_var;
1851 240 : test_var = PyLong_AsUnsignedLongLong(value);
1852 240 : if (PyErr_Occurred() != NULL) {
1853 0 : return -1;
1854 : }
1855 240 : if (test_var > uint_max) {
1856 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1857 : PyLong_Type.tp_name, uint_max, test_var);
1858 0 : return -1;
1859 : }
1860 240 : object->protocol = test_var;
1861 : } else {
1862 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1863 : PyLong_Type.tp_name);
1864 0 : return -1;
1865 : }
1866 : }
1867 240 : return 0;
1868 : }
1869 :
1870 0 : static PyObject *py_epm_lhs_get_lhs_data(PyObject *obj, void *closure)
1871 : {
1872 0 : struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(obj);
1873 : PyObject *py_lhs_data;
1874 0 : py_lhs_data = PyBytes_FromStringAndSize((char *)(object->lhs_data).data, (object->lhs_data).length);
1875 0 : return py_lhs_data;
1876 : }
1877 :
1878 240 : static int py_epm_lhs_set_lhs_data(PyObject *py_obj, PyObject *value, void *closure)
1879 : {
1880 240 : struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(py_obj);
1881 240 : if (value == NULL) {
1882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lhs_data");
1883 0 : return -1;
1884 : }
1885 240 : object->lhs_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
1886 240 : return 0;
1887 : }
1888 :
1889 : static PyGetSetDef py_epm_lhs_getsetters[] = {
1890 : {
1891 : .name = discard_const_p(char, "protocol"),
1892 : .get = py_epm_lhs_get_protocol,
1893 : .set = py_epm_lhs_set_protocol,
1894 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_protocol")
1895 : },
1896 : {
1897 : .name = discard_const_p(char, "lhs_data"),
1898 : .get = py_epm_lhs_get_lhs_data,
1899 : .set = py_epm_lhs_set_lhs_data,
1900 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
1901 : },
1902 : { .name = NULL }
1903 : };
1904 :
1905 240 : static PyObject *py_epm_lhs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1906 : {
1907 240 : return pytalloc_new(struct epm_lhs, type);
1908 : }
1909 :
1910 :
1911 : static PyTypeObject epm_lhs_Type = {
1912 : PyVarObject_HEAD_INIT(NULL, 0)
1913 : .tp_name = "epmapper.epm_lhs",
1914 : .tp_getset = py_epm_lhs_getsetters,
1915 : .tp_methods = NULL,
1916 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1917 : .tp_new = py_epm_lhs_new,
1918 : };
1919 :
1920 :
1921 32 : static PyObject *py_epm_floor_get_lhs(PyObject *obj, void *closure)
1922 : {
1923 32 : struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(obj);
1924 : PyObject *py_lhs;
1925 32 : py_lhs = pytalloc_reference_ex(&epm_lhs_Type, pytalloc_get_mem_ctx(obj), &object->lhs);
1926 32 : return py_lhs;
1927 : }
1928 :
1929 240 : static int py_epm_floor_set_lhs(PyObject *py_obj, PyObject *value, void *closure)
1930 : {
1931 240 : struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(py_obj);
1932 240 : if (value == NULL) {
1933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lhs");
1934 0 : return -1;
1935 : }
1936 240 : PY_CHECK_TYPE(&epm_lhs_Type, value, return -1;);
1937 240 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1938 0 : PyErr_NoMemory();
1939 0 : return -1;
1940 : }
1941 240 : object->lhs = *(struct epm_lhs *)pytalloc_get_ptr(value);
1942 240 : return 0;
1943 : }
1944 :
1945 160 : static PyObject *py_epm_floor_get_rhs(PyObject *obj, void *closure)
1946 : {
1947 160 : struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(obj);
1948 : PyObject *py_rhs;
1949 160 : py_rhs = pyrpc_import_union(&epm_rhs_Type, pytalloc_get_mem_ctx(obj), object->lhs.protocol, &object->rhs, "union epm_rhs");
1950 160 : if (py_rhs == NULL) {
1951 0 : return NULL;
1952 : }
1953 160 : return py_rhs;
1954 : }
1955 :
1956 96 : static int py_epm_floor_set_rhs(PyObject *py_obj, PyObject *value, void *closure)
1957 : {
1958 96 : struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(py_obj);
1959 96 : if (value == NULL) {
1960 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rhs");
1961 0 : return -1;
1962 : }
1963 : {
1964 : union epm_rhs *rhs_switch_1;
1965 96 : rhs_switch_1 = (union epm_rhs *)pyrpc_export_union(&epm_rhs_Type, pytalloc_get_mem_ctx(py_obj), object->lhs.protocol, value, "union epm_rhs");
1966 96 : if (rhs_switch_1 == NULL) {
1967 0 : return -1;
1968 : }
1969 96 : object->rhs = *rhs_switch_1;
1970 : }
1971 96 : return 0;
1972 : }
1973 :
1974 : static PyGetSetDef py_epm_floor_getsetters[] = {
1975 : {
1976 : .name = discard_const_p(char, "lhs"),
1977 : .get = py_epm_floor_get_lhs,
1978 : .set = py_epm_floor_set_lhs,
1979 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_lhs")
1980 : },
1981 : {
1982 : .name = discard_const_p(char, "rhs"),
1983 : .get = py_epm_floor_get_rhs,
1984 : .set = py_epm_floor_set_rhs,
1985 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_rhs")
1986 : },
1987 : { .name = NULL }
1988 : };
1989 :
1990 240 : static PyObject *py_epm_floor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1991 : {
1992 240 : return pytalloc_new(struct epm_floor, type);
1993 : }
1994 :
1995 :
1996 : static PyTypeObject epm_floor_Type = {
1997 : PyVarObject_HEAD_INIT(NULL, 0)
1998 : .tp_name = "epmapper.epm_floor",
1999 : .tp_getset = py_epm_floor_getsetters,
2000 : .tp_methods = NULL,
2001 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2002 : .tp_new = py_epm_floor_new,
2003 : };
2004 :
2005 :
2006 16 : static PyObject *py_epm_tower_get_num_floors(PyObject *obj, void *closure)
2007 : {
2008 16 : struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(obj);
2009 : PyObject *py_num_floors;
2010 16 : py_num_floors = PyLong_FromLong((uint16_t)object->num_floors);
2011 16 : return py_num_floors;
2012 : }
2013 :
2014 48 : static int py_epm_tower_set_num_floors(PyObject *py_obj, PyObject *value, void *closure)
2015 : {
2016 48 : struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(py_obj);
2017 48 : if (value == NULL) {
2018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_floors");
2019 0 : return -1;
2020 : }
2021 : {
2022 48 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_floors));
2023 48 : if (PyLong_Check(value)) {
2024 : unsigned long long test_var;
2025 48 : test_var = PyLong_AsUnsignedLongLong(value);
2026 48 : if (PyErr_Occurred() != NULL) {
2027 0 : return -1;
2028 : }
2029 48 : if (test_var > uint_max) {
2030 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2031 : PyLong_Type.tp_name, uint_max, test_var);
2032 0 : return -1;
2033 : }
2034 48 : object->num_floors = test_var;
2035 : } else {
2036 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2037 : PyLong_Type.tp_name);
2038 0 : return -1;
2039 : }
2040 : }
2041 48 : return 0;
2042 : }
2043 :
2044 64 : static PyObject *py_epm_tower_get_floors(PyObject *obj, void *closure)
2045 : {
2046 64 : struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(obj);
2047 : PyObject *py_floors;
2048 64 : py_floors = PyList_New(object->num_floors);
2049 64 : if (py_floors == NULL) {
2050 0 : return NULL;
2051 : }
2052 : {
2053 : int floors_cntr_0;
2054 384 : for (floors_cntr_0 = 0; floors_cntr_0 < (object->num_floors); floors_cntr_0++) {
2055 : PyObject *py_floors_0;
2056 320 : py_floors_0 = pytalloc_reference_ex(&epm_floor_Type, object->floors, &object->floors[floors_cntr_0]);
2057 320 : PyList_SetItem(py_floors, floors_cntr_0, py_floors_0);
2058 : }
2059 : }
2060 64 : return py_floors;
2061 : }
2062 :
2063 48 : static int py_epm_tower_set_floors(PyObject *py_obj, PyObject *value, void *closure)
2064 : {
2065 48 : struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(py_obj);
2066 48 : if (value == NULL) {
2067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->floors");
2068 0 : return -1;
2069 : }
2070 48 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2071 : {
2072 : int floors_cntr_0;
2073 48 : object->floors = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->floors, PyList_GET_SIZE(value));
2074 48 : if (!object->floors) { return -1;; }
2075 48 : talloc_set_name_const(object->floors, "ARRAY: object->floors");
2076 288 : for (floors_cntr_0 = 0; floors_cntr_0 < PyList_GET_SIZE(value); floors_cntr_0++) {
2077 240 : if (PyList_GET_ITEM(value, floors_cntr_0) == NULL) {
2078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->floors[floors_cntr_0]");
2079 0 : return -1;
2080 : }
2081 240 : PY_CHECK_TYPE(&epm_floor_Type, PyList_GET_ITEM(value, floors_cntr_0), return -1;);
2082 240 : if (talloc_reference(object->floors, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, floors_cntr_0))) == NULL) {
2083 0 : PyErr_NoMemory();
2084 0 : return -1;
2085 : }
2086 240 : object->floors[floors_cntr_0] = *(struct epm_floor *)pytalloc_get_ptr(PyList_GET_ITEM(value, floors_cntr_0));
2087 : }
2088 : }
2089 48 : return 0;
2090 : }
2091 :
2092 : static PyGetSetDef py_epm_tower_getsetters[] = {
2093 : {
2094 : .name = discard_const_p(char, "num_floors"),
2095 : .get = py_epm_tower_get_num_floors,
2096 : .set = py_epm_tower_set_num_floors,
2097 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2098 : },
2099 : {
2100 : .name = discard_const_p(char, "floors"),
2101 : .get = py_epm_tower_get_floors,
2102 : .set = py_epm_tower_set_floors,
2103 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_floor")
2104 : },
2105 : { .name = NULL }
2106 : };
2107 :
2108 48 : static PyObject *py_epm_tower_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2109 : {
2110 48 : return pytalloc_new(struct epm_tower, type);
2111 : }
2112 :
2113 :
2114 : static PyTypeObject epm_tower_Type = {
2115 : PyVarObject_HEAD_INIT(NULL, 0)
2116 : .tp_name = "epmapper.epm_tower",
2117 : .tp_getset = py_epm_tower_getsetters,
2118 : .tp_methods = NULL,
2119 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2120 : .tp_new = py_epm_tower_new,
2121 : };
2122 :
2123 :
2124 16 : static PyObject *py_epm_twr_t_get_tower_length(PyObject *obj, void *closure)
2125 : {
2126 16 : struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(obj);
2127 : PyObject *py_tower_length;
2128 16 : py_tower_length = PyLong_FromUnsignedLongLong((uint32_t)object->tower_length);
2129 16 : return py_tower_length;
2130 : }
2131 :
2132 0 : static int py_epm_twr_t_set_tower_length(PyObject *py_obj, PyObject *value, void *closure)
2133 : {
2134 0 : struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(py_obj);
2135 0 : if (value == NULL) {
2136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tower_length");
2137 0 : return -1;
2138 : }
2139 : {
2140 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tower_length));
2141 0 : if (PyLong_Check(value)) {
2142 : unsigned long long test_var;
2143 0 : test_var = PyLong_AsUnsignedLongLong(value);
2144 0 : if (PyErr_Occurred() != NULL) {
2145 0 : return -1;
2146 : }
2147 0 : if (test_var > uint_max) {
2148 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2149 : PyLong_Type.tp_name, uint_max, test_var);
2150 0 : return -1;
2151 : }
2152 0 : object->tower_length = test_var;
2153 : } else {
2154 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2155 : PyLong_Type.tp_name);
2156 0 : return -1;
2157 : }
2158 : }
2159 0 : return 0;
2160 : }
2161 :
2162 80 : static PyObject *py_epm_twr_t_get_tower(PyObject *obj, void *closure)
2163 : {
2164 80 : struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(obj);
2165 : PyObject *py_tower;
2166 80 : py_tower = pytalloc_reference_ex(&epm_tower_Type, pytalloc_get_mem_ctx(obj), &object->tower);
2167 80 : return py_tower;
2168 : }
2169 :
2170 48 : static int py_epm_twr_t_set_tower(PyObject *py_obj, PyObject *value, void *closure)
2171 : {
2172 48 : struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(py_obj);
2173 48 : if (value == NULL) {
2174 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tower");
2175 0 : return -1;
2176 : }
2177 48 : PY_CHECK_TYPE(&epm_tower_Type, value, return -1;);
2178 48 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2179 0 : PyErr_NoMemory();
2180 0 : return -1;
2181 : }
2182 48 : object->tower = *(struct epm_tower *)pytalloc_get_ptr(value);
2183 48 : return 0;
2184 : }
2185 :
2186 : static PyGetSetDef py_epm_twr_t_getsetters[] = {
2187 : {
2188 : .name = discard_const_p(char, "tower_length"),
2189 : .get = py_epm_twr_t_get_tower_length,
2190 : .set = py_epm_twr_t_set_tower_length,
2191 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2192 : },
2193 : {
2194 : .name = discard_const_p(char, "tower"),
2195 : .get = py_epm_twr_t_get_tower,
2196 : .set = py_epm_twr_t_set_tower,
2197 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_tower")
2198 : },
2199 : { .name = NULL }
2200 : };
2201 :
2202 48 : static PyObject *py_epm_twr_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2203 : {
2204 48 : return pytalloc_new(struct epm_twr_t, type);
2205 : }
2206 :
2207 0 : static PyObject *py_epm_twr_t_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2208 : {
2209 0 : struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(py_obj);
2210 0 : PyObject *ret = NULL;
2211 : DATA_BLOB blob;
2212 : enum ndr_err_code err;
2213 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2214 0 : if (tmp_ctx == NULL) {
2215 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2216 0 : return NULL;
2217 : }
2218 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_epm_twr_t);
2219 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2220 0 : TALLOC_FREE(tmp_ctx);
2221 0 : PyErr_SetNdrError(err);
2222 0 : return NULL;
2223 : }
2224 :
2225 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2226 0 : TALLOC_FREE(tmp_ctx);
2227 0 : return ret;
2228 : }
2229 :
2230 0 : static PyObject *py_epm_twr_t_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2231 : {
2232 0 : struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(py_obj);
2233 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2234 0 : Py_ssize_t blob_length = 0;
2235 : enum ndr_err_code err;
2236 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2237 0 : PyObject *allow_remaining_obj = NULL;
2238 0 : bool allow_remaining = false;
2239 :
2240 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2241 : discard_const_p(char *, kwnames),
2242 : &blob.data, &blob_length,
2243 : &allow_remaining_obj)) {
2244 0 : return NULL;
2245 : }
2246 0 : blob.length = blob_length;
2247 :
2248 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2249 0 : allow_remaining = true;
2250 : }
2251 :
2252 0 : if (allow_remaining) {
2253 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_epm_twr_t);
2254 : } else {
2255 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_epm_twr_t);
2256 : }
2257 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2258 0 : PyErr_SetNdrError(err);
2259 0 : return NULL;
2260 : }
2261 :
2262 0 : Py_RETURN_NONE;
2263 : }
2264 :
2265 0 : static PyObject *py_epm_twr_t_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2266 : {
2267 0 : struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(py_obj);
2268 : PyObject *ret;
2269 : char *retstr;
2270 :
2271 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_epm_twr_t, "epm_twr_t", object);
2272 0 : ret = PyUnicode_FromString(retstr);
2273 0 : talloc_free(retstr);
2274 :
2275 0 : return ret;
2276 : }
2277 :
2278 : static PyMethodDef py_epm_twr_t_methods[] = {
2279 : { "__ndr_pack__", (PyCFunction)py_epm_twr_t_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2280 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_twr_t_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2281 : { "__ndr_print__", (PyCFunction)py_epm_twr_t_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2282 : { NULL, NULL, 0, NULL }
2283 : };
2284 :
2285 :
2286 : static PyTypeObject epm_twr_t_Type = {
2287 : PyVarObject_HEAD_INIT(NULL, 0)
2288 : .tp_name = "epmapper.epm_twr_t",
2289 : .tp_getset = py_epm_twr_t_getsetters,
2290 : .tp_methods = py_epm_twr_t_methods,
2291 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2292 : .tp_new = py_epm_twr_t_new,
2293 : };
2294 :
2295 :
2296 0 : static PyObject *py_epm_entry_t_get_object(PyObject *obj, void *closure)
2297 : {
2298 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
2299 : PyObject *py_object;
2300 0 : py_object = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->object);
2301 0 : return py_object;
2302 : }
2303 :
2304 0 : static int py_epm_entry_t_set_object(PyObject *py_obj, PyObject *value, void *closure)
2305 : {
2306 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
2307 0 : if (value == NULL) {
2308 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object");
2309 0 : return -1;
2310 : }
2311 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
2312 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2313 0 : PyErr_NoMemory();
2314 0 : return -1;
2315 : }
2316 0 : object->object = *(struct GUID *)pytalloc_get_ptr(value);
2317 0 : return 0;
2318 : }
2319 :
2320 0 : static PyObject *py_epm_entry_t_get_tower(PyObject *obj, void *closure)
2321 : {
2322 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
2323 : PyObject *py_tower;
2324 0 : if (object->tower == NULL) {
2325 0 : Py_RETURN_NONE;
2326 : }
2327 0 : if (object->tower == NULL) {
2328 0 : py_tower = Py_None;
2329 0 : Py_INCREF(py_tower);
2330 : } else {
2331 0 : py_tower = pytalloc_reference_ex(&epm_twr_t_Type, object->tower, object->tower);
2332 : }
2333 0 : return py_tower;
2334 : }
2335 :
2336 0 : static int py_epm_entry_t_set_tower(PyObject *py_obj, PyObject *value, void *closure)
2337 : {
2338 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
2339 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->tower));
2340 0 : if (value == NULL) {
2341 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->tower");
2342 0 : return -1;
2343 : }
2344 0 : if (value == Py_None) {
2345 0 : object->tower = NULL;
2346 : } else {
2347 0 : object->tower = NULL;
2348 0 : PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
2349 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2350 0 : PyErr_NoMemory();
2351 0 : return -1;
2352 : }
2353 0 : object->tower = (struct epm_twr_t *)pytalloc_get_ptr(value);
2354 : }
2355 0 : return 0;
2356 : }
2357 :
2358 0 : static PyObject *py_epm_entry_t_get___annotation_offset(PyObject *obj, void *closure)
2359 : {
2360 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
2361 : PyObject *py___annotation_offset;
2362 0 : py___annotation_offset = PyLong_FromUnsignedLongLong((uint32_t)object->__annotation_offset);
2363 0 : return py___annotation_offset;
2364 : }
2365 :
2366 0 : static int py_epm_entry_t_set___annotation_offset(PyObject *py_obj, PyObject *value, void *closure)
2367 : {
2368 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
2369 0 : if (value == NULL) {
2370 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->__annotation_offset");
2371 0 : return -1;
2372 : }
2373 : {
2374 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__annotation_offset));
2375 0 : if (PyLong_Check(value)) {
2376 : unsigned long long test_var;
2377 0 : test_var = PyLong_AsUnsignedLongLong(value);
2378 0 : if (PyErr_Occurred() != NULL) {
2379 0 : return -1;
2380 : }
2381 0 : if (test_var > uint_max) {
2382 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2383 : PyLong_Type.tp_name, uint_max, test_var);
2384 0 : return -1;
2385 : }
2386 0 : object->__annotation_offset = test_var;
2387 : } else {
2388 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2389 : PyLong_Type.tp_name);
2390 0 : return -1;
2391 : }
2392 : }
2393 0 : return 0;
2394 : }
2395 :
2396 0 : static PyObject *py_epm_entry_t_get___annotation_length(PyObject *obj, void *closure)
2397 : {
2398 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
2399 : PyObject *py___annotation_length;
2400 0 : py___annotation_length = PyLong_FromUnsignedLongLong((uint32_t)object->__annotation_length);
2401 0 : return py___annotation_length;
2402 : }
2403 :
2404 0 : static int py_epm_entry_t_set___annotation_length(PyObject *py_obj, PyObject *value, void *closure)
2405 : {
2406 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
2407 0 : if (value == NULL) {
2408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->__annotation_length");
2409 0 : return -1;
2410 : }
2411 : {
2412 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__annotation_length));
2413 0 : if (PyLong_Check(value)) {
2414 : unsigned long long test_var;
2415 0 : test_var = PyLong_AsUnsignedLongLong(value);
2416 0 : if (PyErr_Occurred() != NULL) {
2417 0 : return -1;
2418 : }
2419 0 : if (test_var > uint_max) {
2420 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2421 : PyLong_Type.tp_name, uint_max, test_var);
2422 0 : return -1;
2423 : }
2424 0 : object->__annotation_length = test_var;
2425 : } else {
2426 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2427 : PyLong_Type.tp_name);
2428 0 : return -1;
2429 : }
2430 : }
2431 0 : return 0;
2432 : }
2433 :
2434 0 : static PyObject *py_epm_entry_t_get_annotation(PyObject *obj, void *closure)
2435 : {
2436 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
2437 : PyObject *py_annotation;
2438 0 : if (object->annotation == NULL) {
2439 0 : py_annotation = Py_None;
2440 0 : Py_INCREF(py_annotation);
2441 : } else {
2442 0 : py_annotation = PyUnicode_Decode(object->annotation, strlen(object->annotation), "utf-8", "ignore");
2443 : }
2444 0 : return py_annotation;
2445 : }
2446 :
2447 0 : static int py_epm_entry_t_set_annotation(PyObject *py_obj, PyObject *value, void *closure)
2448 : {
2449 0 : struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
2450 0 : if (value == NULL) {
2451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->annotation");
2452 0 : return -1;
2453 : }
2454 : {
2455 : const char *test_str;
2456 : const char *talloc_str;
2457 0 : PyObject *unicode = NULL;
2458 0 : if (PyUnicode_Check(value)) {
2459 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2460 0 : if (unicode == NULL) {
2461 0 : PyErr_NoMemory();
2462 0 : return -1;
2463 : }
2464 0 : test_str = PyBytes_AS_STRING(unicode);
2465 0 : } else if (PyBytes_Check(value)) {
2466 0 : test_str = PyBytes_AS_STRING(value);
2467 : } else {
2468 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2469 0 : return -1;
2470 : }
2471 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2472 0 : if (unicode != NULL) {
2473 0 : Py_DECREF(unicode);
2474 : }
2475 0 : if (talloc_str == NULL) {
2476 0 : PyErr_NoMemory();
2477 0 : return -1;
2478 : }
2479 0 : object->annotation = talloc_str;
2480 : }
2481 0 : return 0;
2482 : }
2483 :
2484 : static PyGetSetDef py_epm_entry_t_getsetters[] = {
2485 : {
2486 : .name = discard_const_p(char, "object"),
2487 : .get = py_epm_entry_t_get_object,
2488 : .set = py_epm_entry_t_set_object,
2489 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
2490 : },
2491 : {
2492 : .name = discard_const_p(char, "tower"),
2493 : .get = py_epm_entry_t_get_tower,
2494 : .set = py_epm_entry_t_set_tower,
2495 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_t")
2496 : },
2497 : {
2498 : .name = discard_const_p(char, "__annotation_offset"),
2499 : .get = py_epm_entry_t_get___annotation_offset,
2500 : .set = py_epm_entry_t_set___annotation_offset,
2501 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2502 : },
2503 : {
2504 : .name = discard_const_p(char, "__annotation_length"),
2505 : .get = py_epm_entry_t_get___annotation_length,
2506 : .set = py_epm_entry_t_set___annotation_length,
2507 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2508 : },
2509 : {
2510 : .name = discard_const_p(char, "annotation"),
2511 : .get = py_epm_entry_t_get_annotation,
2512 : .set = py_epm_entry_t_set_annotation,
2513 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2514 : },
2515 : { .name = NULL }
2516 : };
2517 :
2518 0 : static PyObject *py_epm_entry_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2519 : {
2520 0 : return pytalloc_new(struct epm_entry_t, type);
2521 : }
2522 :
2523 :
2524 : static PyTypeObject epm_entry_t_Type = {
2525 : PyVarObject_HEAD_INIT(NULL, 0)
2526 : .tp_name = "epmapper.epm_entry_t",
2527 : .tp_getset = py_epm_entry_t_getsetters,
2528 : .tp_methods = NULL,
2529 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2530 : .tp_new = py_epm_entry_t_new,
2531 : };
2532 :
2533 :
2534 0 : static PyObject *py_rpc_if_id_t_get_uuid(PyObject *obj, void *closure)
2535 : {
2536 0 : struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(obj);
2537 : PyObject *py_uuid;
2538 0 : py_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->uuid);
2539 0 : return py_uuid;
2540 : }
2541 :
2542 0 : static int py_rpc_if_id_t_set_uuid(PyObject *py_obj, PyObject *value, void *closure)
2543 : {
2544 0 : struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(py_obj);
2545 0 : if (value == NULL) {
2546 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->uuid");
2547 0 : return -1;
2548 : }
2549 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
2550 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2551 0 : PyErr_NoMemory();
2552 0 : return -1;
2553 : }
2554 0 : object->uuid = *(struct GUID *)pytalloc_get_ptr(value);
2555 0 : return 0;
2556 : }
2557 :
2558 0 : static PyObject *py_rpc_if_id_t_get_vers_major(PyObject *obj, void *closure)
2559 : {
2560 0 : struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(obj);
2561 : PyObject *py_vers_major;
2562 0 : py_vers_major = PyLong_FromLong((uint16_t)object->vers_major);
2563 0 : return py_vers_major;
2564 : }
2565 :
2566 0 : static int py_rpc_if_id_t_set_vers_major(PyObject *py_obj, PyObject *value, void *closure)
2567 : {
2568 0 : struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(py_obj);
2569 0 : if (value == NULL) {
2570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->vers_major");
2571 0 : return -1;
2572 : }
2573 : {
2574 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vers_major));
2575 0 : if (PyLong_Check(value)) {
2576 : unsigned long long test_var;
2577 0 : test_var = PyLong_AsUnsignedLongLong(value);
2578 0 : if (PyErr_Occurred() != NULL) {
2579 0 : return -1;
2580 : }
2581 0 : if (test_var > uint_max) {
2582 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2583 : PyLong_Type.tp_name, uint_max, test_var);
2584 0 : return -1;
2585 : }
2586 0 : object->vers_major = test_var;
2587 : } else {
2588 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2589 : PyLong_Type.tp_name);
2590 0 : return -1;
2591 : }
2592 : }
2593 0 : return 0;
2594 : }
2595 :
2596 0 : static PyObject *py_rpc_if_id_t_get_vers_minor(PyObject *obj, void *closure)
2597 : {
2598 0 : struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(obj);
2599 : PyObject *py_vers_minor;
2600 0 : py_vers_minor = PyLong_FromLong((uint16_t)object->vers_minor);
2601 0 : return py_vers_minor;
2602 : }
2603 :
2604 0 : static int py_rpc_if_id_t_set_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
2605 : {
2606 0 : struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(py_obj);
2607 0 : if (value == NULL) {
2608 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->vers_minor");
2609 0 : return -1;
2610 : }
2611 : {
2612 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->vers_minor));
2613 0 : if (PyLong_Check(value)) {
2614 : unsigned long long test_var;
2615 0 : test_var = PyLong_AsUnsignedLongLong(value);
2616 0 : if (PyErr_Occurred() != NULL) {
2617 0 : return -1;
2618 : }
2619 0 : if (test_var > uint_max) {
2620 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2621 : PyLong_Type.tp_name, uint_max, test_var);
2622 0 : return -1;
2623 : }
2624 0 : object->vers_minor = test_var;
2625 : } else {
2626 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2627 : PyLong_Type.tp_name);
2628 0 : return -1;
2629 : }
2630 : }
2631 0 : return 0;
2632 : }
2633 :
2634 : static PyGetSetDef py_rpc_if_id_t_getsetters[] = {
2635 : {
2636 : .name = discard_const_p(char, "uuid"),
2637 : .get = py_rpc_if_id_t_get_uuid,
2638 : .set = py_rpc_if_id_t_set_uuid,
2639 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
2640 : },
2641 : {
2642 : .name = discard_const_p(char, "vers_major"),
2643 : .get = py_rpc_if_id_t_get_vers_major,
2644 : .set = py_rpc_if_id_t_set_vers_major,
2645 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2646 : },
2647 : {
2648 : .name = discard_const_p(char, "vers_minor"),
2649 : .get = py_rpc_if_id_t_get_vers_minor,
2650 : .set = py_rpc_if_id_t_set_vers_minor,
2651 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2652 : },
2653 : { .name = NULL }
2654 : };
2655 :
2656 0 : static PyObject *py_rpc_if_id_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2657 : {
2658 0 : return pytalloc_new(struct rpc_if_id_t, type);
2659 : }
2660 :
2661 :
2662 : static PyTypeObject rpc_if_id_t_Type = {
2663 : PyVarObject_HEAD_INIT(NULL, 0)
2664 : .tp_name = "epmapper.rpc_if_id_t",
2665 : .tp_getset = py_rpc_if_id_t_getsetters,
2666 : .tp_methods = NULL,
2667 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2668 : .tp_new = py_rpc_if_id_t_new,
2669 : };
2670 :
2671 :
2672 16 : static PyObject *py_epm_twr_p_t_get_twr(PyObject *obj, void *closure)
2673 : {
2674 16 : struct epm_twr_p_t *object = (struct epm_twr_p_t *)pytalloc_get_ptr(obj);
2675 : PyObject *py_twr;
2676 16 : if (object->twr == NULL) {
2677 0 : Py_RETURN_NONE;
2678 : }
2679 16 : if (object->twr == NULL) {
2680 0 : py_twr = Py_None;
2681 0 : Py_INCREF(py_twr);
2682 : } else {
2683 16 : py_twr = pytalloc_reference_ex(&epm_twr_t_Type, object->twr, object->twr);
2684 : }
2685 16 : return py_twr;
2686 : }
2687 :
2688 0 : static int py_epm_twr_p_t_set_twr(PyObject *py_obj, PyObject *value, void *closure)
2689 : {
2690 0 : struct epm_twr_p_t *object = (struct epm_twr_p_t *)pytalloc_get_ptr(py_obj);
2691 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->twr));
2692 0 : if (value == NULL) {
2693 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->twr");
2694 0 : return -1;
2695 : }
2696 0 : if (value == Py_None) {
2697 0 : object->twr = NULL;
2698 : } else {
2699 0 : object->twr = NULL;
2700 0 : PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
2701 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2702 0 : PyErr_NoMemory();
2703 0 : return -1;
2704 : }
2705 0 : object->twr = (struct epm_twr_t *)pytalloc_get_ptr(value);
2706 : }
2707 0 : return 0;
2708 : }
2709 :
2710 : static PyGetSetDef py_epm_twr_p_t_getsetters[] = {
2711 : {
2712 : .name = discard_const_p(char, "twr"),
2713 : .get = py_epm_twr_p_t_get_twr,
2714 : .set = py_epm_twr_p_t_set_twr,
2715 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_t")
2716 : },
2717 : { .name = NULL }
2718 : };
2719 :
2720 0 : static PyObject *py_epm_twr_p_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2721 : {
2722 0 : return pytalloc_new(struct epm_twr_p_t, type);
2723 : }
2724 :
2725 :
2726 : static PyTypeObject epm_twr_p_t_Type = {
2727 : PyVarObject_HEAD_INIT(NULL, 0)
2728 : .tp_name = "epmapper.epm_twr_p_t",
2729 : .tp_getset = py_epm_twr_p_t_getsetters,
2730 : .tp_methods = NULL,
2731 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2732 : .tp_new = py_epm_twr_p_t_new,
2733 : };
2734 :
2735 :
2736 :
2737 0 : static PyObject *py_epm_Insert_in_get_num_ents(PyObject *obj, void *closure)
2738 : {
2739 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(obj);
2740 : PyObject *py_num_ents;
2741 0 : py_num_ents = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_ents);
2742 0 : return py_num_ents;
2743 : }
2744 :
2745 0 : static int py_epm_Insert_in_set_num_ents(PyObject *py_obj, PyObject *value, void *closure)
2746 : {
2747 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(py_obj);
2748 0 : if (value == NULL) {
2749 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_ents");
2750 0 : return -1;
2751 : }
2752 : {
2753 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_ents));
2754 0 : if (PyLong_Check(value)) {
2755 : unsigned long long test_var;
2756 0 : test_var = PyLong_AsUnsignedLongLong(value);
2757 0 : if (PyErr_Occurred() != NULL) {
2758 0 : return -1;
2759 : }
2760 0 : if (test_var > uint_max) {
2761 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2762 : PyLong_Type.tp_name, uint_max, test_var);
2763 0 : return -1;
2764 : }
2765 0 : object->in.num_ents = test_var;
2766 : } else {
2767 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2768 : PyLong_Type.tp_name);
2769 0 : return -1;
2770 : }
2771 : }
2772 0 : return 0;
2773 : }
2774 :
2775 0 : static PyObject *py_epm_Insert_in_get_entries(PyObject *obj, void *closure)
2776 : {
2777 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(obj);
2778 : PyObject *py_entries;
2779 0 : py_entries = PyList_New(object->in.num_ents);
2780 0 : if (py_entries == NULL) {
2781 0 : return NULL;
2782 : }
2783 : {
2784 : int entries_cntr_0;
2785 0 : for (entries_cntr_0 = 0; entries_cntr_0 < (object->in.num_ents); entries_cntr_0++) {
2786 : PyObject *py_entries_0;
2787 0 : py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, object->in.entries, &object->in.entries[entries_cntr_0]);
2788 0 : PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
2789 : }
2790 : }
2791 0 : return py_entries;
2792 : }
2793 :
2794 0 : static int py_epm_Insert_in_set_entries(PyObject *py_obj, PyObject *value, void *closure)
2795 : {
2796 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(py_obj);
2797 0 : if (value == NULL) {
2798 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.entries");
2799 0 : return -1;
2800 : }
2801 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2802 : {
2803 : int entries_cntr_0;
2804 0 : object->in.entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entries, PyList_GET_SIZE(value));
2805 0 : if (!object->in.entries) { return -1;; }
2806 0 : talloc_set_name_const(object->in.entries, "ARRAY: object->in.entries");
2807 0 : for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(value); entries_cntr_0++) {
2808 0 : if (PyList_GET_ITEM(value, entries_cntr_0) == NULL) {
2809 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.entries[entries_cntr_0]");
2810 0 : return -1;
2811 : }
2812 0 : PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(value, entries_cntr_0), return -1;);
2813 0 : if (talloc_reference(object->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_0))) == NULL) {
2814 0 : PyErr_NoMemory();
2815 0 : return -1;
2816 : }
2817 0 : object->in.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_0));
2818 : }
2819 : }
2820 0 : return 0;
2821 : }
2822 :
2823 0 : static PyObject *py_epm_Insert_in_get_replace(PyObject *obj, void *closure)
2824 : {
2825 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(obj);
2826 : PyObject *py_replace;
2827 0 : py_replace = PyLong_FromUnsignedLongLong((uint32_t)object->in.replace);
2828 0 : return py_replace;
2829 : }
2830 :
2831 0 : static int py_epm_Insert_in_set_replace(PyObject *py_obj, PyObject *value, void *closure)
2832 : {
2833 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(py_obj);
2834 0 : if (value == NULL) {
2835 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.replace");
2836 0 : return -1;
2837 : }
2838 : {
2839 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.replace));
2840 0 : if (PyLong_Check(value)) {
2841 : unsigned long long test_var;
2842 0 : test_var = PyLong_AsUnsignedLongLong(value);
2843 0 : if (PyErr_Occurred() != NULL) {
2844 0 : return -1;
2845 : }
2846 0 : if (test_var > uint_max) {
2847 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2848 : PyLong_Type.tp_name, uint_max, test_var);
2849 0 : return -1;
2850 : }
2851 0 : object->in.replace = test_var;
2852 : } else {
2853 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2854 : PyLong_Type.tp_name);
2855 0 : return -1;
2856 : }
2857 : }
2858 0 : return 0;
2859 : }
2860 :
2861 0 : static PyObject *py_epm_Insert_get_result(PyObject *obj, void *closure)
2862 : {
2863 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(obj);
2864 : PyObject *py_result;
2865 0 : py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result);
2866 0 : return py_result;
2867 : }
2868 :
2869 0 : static int py_epm_Insert_set_result(PyObject *py_obj, PyObject *value, void *closure)
2870 : {
2871 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(py_obj);
2872 0 : if (value == NULL) {
2873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
2874 0 : return -1;
2875 : }
2876 : {
2877 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
2878 0 : if (PyLong_Check(value)) {
2879 : unsigned long long test_var;
2880 0 : test_var = PyLong_AsUnsignedLongLong(value);
2881 0 : if (PyErr_Occurred() != NULL) {
2882 0 : return -1;
2883 : }
2884 0 : if (test_var > uint_max) {
2885 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2886 : PyLong_Type.tp_name, uint_max, test_var);
2887 0 : return -1;
2888 : }
2889 0 : object->out.result = test_var;
2890 : } else {
2891 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2892 : PyLong_Type.tp_name);
2893 0 : return -1;
2894 : }
2895 : }
2896 0 : return 0;
2897 : }
2898 :
2899 : static PyGetSetDef py_epm_Insert_getsetters[] = {
2900 : {
2901 : .name = discard_const_p(char, "in_num_ents"),
2902 : .get = py_epm_Insert_in_get_num_ents,
2903 : .set = py_epm_Insert_in_set_num_ents,
2904 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2905 : },
2906 : {
2907 : .name = discard_const_p(char, "in_entries"),
2908 : .get = py_epm_Insert_in_get_entries,
2909 : .set = py_epm_Insert_in_set_entries,
2910 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_entry_t")
2911 : },
2912 : {
2913 : .name = discard_const_p(char, "in_replace"),
2914 : .get = py_epm_Insert_in_get_replace,
2915 : .set = py_epm_Insert_in_set_replace,
2916 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2917 : },
2918 : {
2919 : .name = discard_const_p(char, "result"),
2920 : .get = py_epm_Insert_get_result,
2921 : .set = py_epm_Insert_set_result,
2922 : .doc = discard_const_p(char, "PIDL-generated element of type uint32")
2923 : },
2924 : { .name = NULL }
2925 : };
2926 :
2927 0 : static PyObject *py_epm_Insert_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2928 : {
2929 0 : PyObject *self = pytalloc_new(struct epm_Insert, type);
2930 0 : return self;
2931 : }
2932 :
2933 0 : static PyObject *py_epm_Insert_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
2934 : {
2935 :
2936 :
2937 0 : return PyLong_FromLong(0);
2938 : }
2939 :
2940 0 : static PyObject *py_epm_Insert_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
2941 : {
2942 0 : const struct ndr_interface_call *call = NULL;
2943 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(py_obj);
2944 0 : PyObject *ret = NULL;
2945 0 : struct ndr_push *push = NULL;
2946 : DATA_BLOB blob;
2947 : enum ndr_err_code err;
2948 :
2949 0 : if (ndr_table_epmapper.num_calls < 1) {
2950 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Insert_ndr_pack");
2951 0 : return NULL;
2952 : }
2953 0 : call = &ndr_table_epmapper.calls[0];
2954 :
2955 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
2956 0 : if (push == NULL) {
2957 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2958 0 : return NULL;
2959 : }
2960 :
2961 0 : push->flags |= ndr_push_flags;
2962 :
2963 0 : err = call->ndr_push(push, ndr_inout_flags, object);
2964 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2965 0 : TALLOC_FREE(push);
2966 0 : PyErr_SetNdrError(err);
2967 0 : return NULL;
2968 : }
2969 0 : blob = ndr_push_blob(push);
2970 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2971 0 : TALLOC_FREE(push);
2972 0 : return ret;
2973 : }
2974 :
2975 0 : static PyObject *py_epm_Insert_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2976 : {
2977 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
2978 0 : PyObject *bigendian_obj = NULL;
2979 0 : PyObject *ndr64_obj = NULL;
2980 0 : uint32_t ndr_push_flags = 0;
2981 :
2982 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
2983 : discard_const_p(char *, kwnames),
2984 : &bigendian_obj,
2985 : &ndr64_obj)) {
2986 0 : return NULL;
2987 : }
2988 :
2989 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
2990 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
2991 : }
2992 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
2993 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
2994 : }
2995 :
2996 0 : return py_epm_Insert_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
2997 : }
2998 :
2999 0 : static PyObject *py_epm_Insert_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3000 : {
3001 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3002 0 : PyObject *bigendian_obj = NULL;
3003 0 : PyObject *ndr64_obj = NULL;
3004 0 : uint32_t ndr_push_flags = 0;
3005 :
3006 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
3007 : discard_const_p(char *, kwnames),
3008 : &bigendian_obj,
3009 : &ndr64_obj)) {
3010 0 : return NULL;
3011 : }
3012 :
3013 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3014 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3015 : }
3016 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3017 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3018 : }
3019 :
3020 0 : return py_epm_Insert_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
3021 : }
3022 :
3023 0 : static PyObject *py_epm_Insert_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
3024 : {
3025 0 : const struct ndr_interface_call *call = NULL;
3026 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(py_obj);
3027 0 : struct ndr_pull *pull = NULL;
3028 : enum ndr_err_code err;
3029 :
3030 0 : if (ndr_table_epmapper.num_calls < 1) {
3031 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Insert_ndr_unpack");
3032 0 : return NULL;
3033 : }
3034 0 : call = &ndr_table_epmapper.calls[0];
3035 :
3036 0 : pull = ndr_pull_init_blob(blob, object);
3037 0 : if (pull == NULL) {
3038 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3039 0 : return NULL;
3040 : }
3041 :
3042 0 : pull->flags |= ndr_pull_flags;
3043 :
3044 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
3045 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3046 0 : TALLOC_FREE(pull);
3047 0 : PyErr_SetNdrError(err);
3048 0 : return NULL;
3049 : }
3050 0 : if (!allow_remaining) {
3051 : uint32_t highest_ofs;
3052 :
3053 0 : if (pull->offset > pull->relative_highest_offset) {
3054 0 : highest_ofs = pull->offset;
3055 : } else {
3056 0 : highest_ofs = pull->relative_highest_offset;
3057 : }
3058 0 : if (highest_ofs < pull->data_size) {
3059 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
3060 : "not all bytes consumed ofs[%u] size[%u]",
3061 : highest_ofs, pull->data_size);
3062 0 : TALLOC_FREE(pull);
3063 0 : PyErr_SetNdrError(err);
3064 0 : return NULL;
3065 : }
3066 : }
3067 :
3068 0 : TALLOC_FREE(pull);
3069 0 : Py_RETURN_NONE;
3070 : }
3071 :
3072 0 : static PyObject *py_epm_Insert_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3073 : {
3074 : DATA_BLOB blob;
3075 0 : Py_ssize_t blob_length = 0;
3076 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3077 0 : PyObject *bigendian_obj = NULL;
3078 0 : PyObject *ndr64_obj = NULL;
3079 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3080 0 : PyObject *allow_remaining_obj = NULL;
3081 0 : bool allow_remaining = false;
3082 :
3083 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
3084 : discard_const_p(char *, kwnames),
3085 : &blob.data, &blob_length,
3086 : &bigendian_obj,
3087 : &ndr64_obj,
3088 : &allow_remaining_obj)) {
3089 0 : return NULL;
3090 : }
3091 0 : blob.length = blob_length;
3092 :
3093 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3094 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3095 : }
3096 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3097 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3098 : }
3099 :
3100 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3101 0 : allow_remaining = true;
3102 : }
3103 :
3104 0 : return py_epm_Insert_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
3105 : }
3106 :
3107 0 : static PyObject *py_epm_Insert_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3108 : {
3109 : DATA_BLOB blob;
3110 0 : Py_ssize_t blob_length = 0;
3111 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3112 0 : PyObject *bigendian_obj = NULL;
3113 0 : PyObject *ndr64_obj = NULL;
3114 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3115 0 : PyObject *allow_remaining_obj = NULL;
3116 0 : bool allow_remaining = false;
3117 :
3118 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3119 : discard_const_p(char *, kwnames),
3120 : &blob.data, &blob_length,
3121 : &bigendian_obj,
3122 : &ndr64_obj,
3123 : &allow_remaining_obj)) {
3124 0 : return NULL;
3125 : }
3126 0 : blob.length = blob_length;
3127 :
3128 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3129 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3130 : }
3131 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3132 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3133 : }
3134 :
3135 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3136 0 : allow_remaining = true;
3137 : }
3138 :
3139 0 : return py_epm_Insert_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3140 : }
3141 :
3142 0 : static PyObject *py_epm_Insert_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
3143 : {
3144 0 : const struct ndr_interface_call *call = NULL;
3145 0 : struct epm_Insert *object = (struct epm_Insert *)pytalloc_get_ptr(py_obj);
3146 : PyObject *ret;
3147 : char *retstr;
3148 :
3149 0 : if (ndr_table_epmapper.num_calls < 1) {
3150 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Insert_ndr_print");
3151 0 : return NULL;
3152 : }
3153 0 : call = &ndr_table_epmapper.calls[0];
3154 :
3155 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3156 0 : ret = PyUnicode_FromString(retstr);
3157 0 : TALLOC_FREE(retstr);
3158 :
3159 0 : return ret;
3160 : }
3161 :
3162 0 : static PyObject *py_epm_Insert_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3163 : {
3164 0 : return py_epm_Insert_ndr_print(py_obj, "epm_Insert_in", NDR_IN);
3165 : }
3166 :
3167 0 : static PyObject *py_epm_Insert_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3168 : {
3169 0 : return py_epm_Insert_ndr_print(py_obj, "epm_Insert_out", NDR_OUT);
3170 : }
3171 :
3172 : static PyMethodDef py_epm_Insert_methods[] = {
3173 : { "opnum", (PyCFunction)py_epm_Insert_ndr_opnum, METH_NOARGS|METH_CLASS,
3174 : "epmapper.epm_Insert.opnum() -> 0 (0x00) " },
3175 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Insert_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3176 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3177 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Insert_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3178 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3179 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Insert_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3180 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3181 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Insert_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3182 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3183 : { "__ndr_print_in__", (PyCFunction)py_epm_Insert_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3184 : { "__ndr_print_out__", (PyCFunction)py_epm_Insert_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3185 : { NULL, NULL, 0, NULL }
3186 : };
3187 :
3188 :
3189 : static PyTypeObject epm_Insert_Type = {
3190 : PyVarObject_HEAD_INIT(NULL, 0)
3191 : .tp_name = "epmapper.epm_Insert",
3192 : .tp_getset = py_epm_Insert_getsetters,
3193 : .tp_methods = py_epm_Insert_methods,
3194 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3195 : .tp_new = py_epm_Insert_new,
3196 : };
3197 :
3198 0 : static bool pack_py_epm_Insert_args_in(PyObject *args, PyObject *kwargs, struct epm_Insert *r)
3199 : {
3200 : PyObject *py_entries;
3201 : PyObject *py_replace;
3202 0 : const char *kwnames[] = {
3203 : "entries", "replace", NULL
3204 : };
3205 :
3206 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:epm_Insert", discard_const_p(char *, kwnames), &py_entries, &py_replace)) {
3207 0 : return false;
3208 : }
3209 :
3210 0 : PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
3211 0 : r->in.num_ents = PyList_GET_SIZE(py_entries);
3212 0 : if (py_entries == NULL) {
3213 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.entries");
3214 0 : return false;
3215 : }
3216 0 : PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
3217 : {
3218 : int entries_cntr_0;
3219 0 : r->in.entries = talloc_array_ptrtype(r, r->in.entries, PyList_GET_SIZE(py_entries));
3220 0 : if (!r->in.entries) { return false;; }
3221 0 : talloc_set_name_const(r->in.entries, "ARRAY: r->in.entries");
3222 0 : for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(py_entries); entries_cntr_0++) {
3223 0 : if (PyList_GET_ITEM(py_entries, entries_cntr_0) == NULL) {
3224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.entries[entries_cntr_0]");
3225 0 : return false;
3226 : }
3227 0 : PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(py_entries, entries_cntr_0), return false;);
3228 0 : if (talloc_reference(r->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_entries, entries_cntr_0))) == NULL) {
3229 0 : PyErr_NoMemory();
3230 0 : return false;
3231 : }
3232 0 : r->in.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(py_entries, entries_cntr_0));
3233 : }
3234 : }
3235 0 : if (py_replace == NULL) {
3236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.replace");
3237 0 : return false;
3238 : }
3239 : {
3240 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.replace));
3241 0 : if (PyLong_Check(py_replace)) {
3242 : unsigned long long test_var;
3243 0 : test_var = PyLong_AsUnsignedLongLong(py_replace);
3244 0 : if (PyErr_Occurred() != NULL) {
3245 0 : return false;
3246 : }
3247 0 : if (test_var > uint_max) {
3248 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3249 : PyLong_Type.tp_name, uint_max, test_var);
3250 0 : return false;
3251 : }
3252 0 : r->in.replace = test_var;
3253 : } else {
3254 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3255 : PyLong_Type.tp_name);
3256 0 : return false;
3257 : }
3258 : }
3259 0 : return true;
3260 : }
3261 :
3262 0 : static PyObject *unpack_py_epm_Insert_args_out(struct epm_Insert *r)
3263 : {
3264 : PyObject *result;
3265 0 : result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result);
3266 0 : return result;
3267 : }
3268 :
3269 :
3270 0 : static PyObject *py_epm_Delete_in_get_num_ents(PyObject *obj, void *closure)
3271 : {
3272 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(obj);
3273 : PyObject *py_num_ents;
3274 0 : py_num_ents = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_ents);
3275 0 : return py_num_ents;
3276 : }
3277 :
3278 0 : static int py_epm_Delete_in_set_num_ents(PyObject *py_obj, PyObject *value, void *closure)
3279 : {
3280 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(py_obj);
3281 0 : if (value == NULL) {
3282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_ents");
3283 0 : return -1;
3284 : }
3285 : {
3286 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_ents));
3287 0 : if (PyLong_Check(value)) {
3288 : unsigned long long test_var;
3289 0 : test_var = PyLong_AsUnsignedLongLong(value);
3290 0 : if (PyErr_Occurred() != NULL) {
3291 0 : return -1;
3292 : }
3293 0 : if (test_var > uint_max) {
3294 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3295 : PyLong_Type.tp_name, uint_max, test_var);
3296 0 : return -1;
3297 : }
3298 0 : object->in.num_ents = test_var;
3299 : } else {
3300 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3301 : PyLong_Type.tp_name);
3302 0 : return -1;
3303 : }
3304 : }
3305 0 : return 0;
3306 : }
3307 :
3308 0 : static PyObject *py_epm_Delete_in_get_entries(PyObject *obj, void *closure)
3309 : {
3310 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(obj);
3311 : PyObject *py_entries;
3312 0 : py_entries = PyList_New(object->in.num_ents);
3313 0 : if (py_entries == NULL) {
3314 0 : return NULL;
3315 : }
3316 : {
3317 : int entries_cntr_0;
3318 0 : for (entries_cntr_0 = 0; entries_cntr_0 < (object->in.num_ents); entries_cntr_0++) {
3319 : PyObject *py_entries_0;
3320 0 : py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, object->in.entries, &object->in.entries[entries_cntr_0]);
3321 0 : PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
3322 : }
3323 : }
3324 0 : return py_entries;
3325 : }
3326 :
3327 0 : static int py_epm_Delete_in_set_entries(PyObject *py_obj, PyObject *value, void *closure)
3328 : {
3329 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(py_obj);
3330 0 : if (value == NULL) {
3331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.entries");
3332 0 : return -1;
3333 : }
3334 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3335 : {
3336 : int entries_cntr_0;
3337 0 : object->in.entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entries, PyList_GET_SIZE(value));
3338 0 : if (!object->in.entries) { return -1;; }
3339 0 : talloc_set_name_const(object->in.entries, "ARRAY: object->in.entries");
3340 0 : for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(value); entries_cntr_0++) {
3341 0 : if (PyList_GET_ITEM(value, entries_cntr_0) == NULL) {
3342 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.entries[entries_cntr_0]");
3343 0 : return -1;
3344 : }
3345 0 : PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(value, entries_cntr_0), return -1;);
3346 0 : if (talloc_reference(object->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_0))) == NULL) {
3347 0 : PyErr_NoMemory();
3348 0 : return -1;
3349 : }
3350 0 : object->in.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_0));
3351 : }
3352 : }
3353 0 : return 0;
3354 : }
3355 :
3356 0 : static PyObject *py_epm_Delete_get_result(PyObject *obj, void *closure)
3357 : {
3358 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(obj);
3359 : PyObject *py_result;
3360 0 : py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result);
3361 0 : return py_result;
3362 : }
3363 :
3364 0 : static int py_epm_Delete_set_result(PyObject *py_obj, PyObject *value, void *closure)
3365 : {
3366 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(py_obj);
3367 0 : if (value == NULL) {
3368 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
3369 0 : return -1;
3370 : }
3371 : {
3372 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
3373 0 : if (PyLong_Check(value)) {
3374 : unsigned long long test_var;
3375 0 : test_var = PyLong_AsUnsignedLongLong(value);
3376 0 : if (PyErr_Occurred() != NULL) {
3377 0 : return -1;
3378 : }
3379 0 : if (test_var > uint_max) {
3380 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3381 : PyLong_Type.tp_name, uint_max, test_var);
3382 0 : return -1;
3383 : }
3384 0 : object->out.result = test_var;
3385 : } else {
3386 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3387 : PyLong_Type.tp_name);
3388 0 : return -1;
3389 : }
3390 : }
3391 0 : return 0;
3392 : }
3393 :
3394 : static PyGetSetDef py_epm_Delete_getsetters[] = {
3395 : {
3396 : .name = discard_const_p(char, "in_num_ents"),
3397 : .get = py_epm_Delete_in_get_num_ents,
3398 : .set = py_epm_Delete_in_set_num_ents,
3399 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3400 : },
3401 : {
3402 : .name = discard_const_p(char, "in_entries"),
3403 : .get = py_epm_Delete_in_get_entries,
3404 : .set = py_epm_Delete_in_set_entries,
3405 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_entry_t")
3406 : },
3407 : {
3408 : .name = discard_const_p(char, "result"),
3409 : .get = py_epm_Delete_get_result,
3410 : .set = py_epm_Delete_set_result,
3411 : .doc = discard_const_p(char, "PIDL-generated element of type uint32")
3412 : },
3413 : { .name = NULL }
3414 : };
3415 :
3416 0 : static PyObject *py_epm_Delete_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3417 : {
3418 0 : PyObject *self = pytalloc_new(struct epm_Delete, type);
3419 0 : return self;
3420 : }
3421 :
3422 0 : static PyObject *py_epm_Delete_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
3423 : {
3424 :
3425 :
3426 0 : return PyLong_FromLong(1);
3427 : }
3428 :
3429 0 : static PyObject *py_epm_Delete_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
3430 : {
3431 0 : const struct ndr_interface_call *call = NULL;
3432 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(py_obj);
3433 0 : PyObject *ret = NULL;
3434 0 : struct ndr_push *push = NULL;
3435 : DATA_BLOB blob;
3436 : enum ndr_err_code err;
3437 :
3438 0 : if (ndr_table_epmapper.num_calls < 2) {
3439 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Delete_ndr_pack");
3440 0 : return NULL;
3441 : }
3442 0 : call = &ndr_table_epmapper.calls[1];
3443 :
3444 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
3445 0 : if (push == NULL) {
3446 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3447 0 : return NULL;
3448 : }
3449 :
3450 0 : push->flags |= ndr_push_flags;
3451 :
3452 0 : err = call->ndr_push(push, ndr_inout_flags, object);
3453 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3454 0 : TALLOC_FREE(push);
3455 0 : PyErr_SetNdrError(err);
3456 0 : return NULL;
3457 : }
3458 0 : blob = ndr_push_blob(push);
3459 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3460 0 : TALLOC_FREE(push);
3461 0 : return ret;
3462 : }
3463 :
3464 0 : static PyObject *py_epm_Delete_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3465 : {
3466 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3467 0 : PyObject *bigendian_obj = NULL;
3468 0 : PyObject *ndr64_obj = NULL;
3469 0 : uint32_t ndr_push_flags = 0;
3470 :
3471 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
3472 : discard_const_p(char *, kwnames),
3473 : &bigendian_obj,
3474 : &ndr64_obj)) {
3475 0 : return NULL;
3476 : }
3477 :
3478 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3479 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3480 : }
3481 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3482 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3483 : }
3484 :
3485 0 : return py_epm_Delete_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
3486 : }
3487 :
3488 0 : static PyObject *py_epm_Delete_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3489 : {
3490 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
3491 0 : PyObject *bigendian_obj = NULL;
3492 0 : PyObject *ndr64_obj = NULL;
3493 0 : uint32_t ndr_push_flags = 0;
3494 :
3495 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
3496 : discard_const_p(char *, kwnames),
3497 : &bigendian_obj,
3498 : &ndr64_obj)) {
3499 0 : return NULL;
3500 : }
3501 :
3502 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3503 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
3504 : }
3505 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3506 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
3507 : }
3508 :
3509 0 : return py_epm_Delete_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
3510 : }
3511 :
3512 0 : static PyObject *py_epm_Delete_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
3513 : {
3514 0 : const struct ndr_interface_call *call = NULL;
3515 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(py_obj);
3516 0 : struct ndr_pull *pull = NULL;
3517 : enum ndr_err_code err;
3518 :
3519 0 : if (ndr_table_epmapper.num_calls < 2) {
3520 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Delete_ndr_unpack");
3521 0 : return NULL;
3522 : }
3523 0 : call = &ndr_table_epmapper.calls[1];
3524 :
3525 0 : pull = ndr_pull_init_blob(blob, object);
3526 0 : if (pull == NULL) {
3527 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3528 0 : return NULL;
3529 : }
3530 :
3531 0 : pull->flags |= ndr_pull_flags;
3532 :
3533 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
3534 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3535 0 : TALLOC_FREE(pull);
3536 0 : PyErr_SetNdrError(err);
3537 0 : return NULL;
3538 : }
3539 0 : if (!allow_remaining) {
3540 : uint32_t highest_ofs;
3541 :
3542 0 : if (pull->offset > pull->relative_highest_offset) {
3543 0 : highest_ofs = pull->offset;
3544 : } else {
3545 0 : highest_ofs = pull->relative_highest_offset;
3546 : }
3547 0 : if (highest_ofs < pull->data_size) {
3548 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
3549 : "not all bytes consumed ofs[%u] size[%u]",
3550 : highest_ofs, pull->data_size);
3551 0 : TALLOC_FREE(pull);
3552 0 : PyErr_SetNdrError(err);
3553 0 : return NULL;
3554 : }
3555 : }
3556 :
3557 0 : TALLOC_FREE(pull);
3558 0 : Py_RETURN_NONE;
3559 : }
3560 :
3561 0 : static PyObject *py_epm_Delete_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3562 : {
3563 : DATA_BLOB blob;
3564 0 : Py_ssize_t blob_length = 0;
3565 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3566 0 : PyObject *bigendian_obj = NULL;
3567 0 : PyObject *ndr64_obj = NULL;
3568 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3569 0 : PyObject *allow_remaining_obj = NULL;
3570 0 : bool allow_remaining = false;
3571 :
3572 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
3573 : discard_const_p(char *, kwnames),
3574 : &blob.data, &blob_length,
3575 : &bigendian_obj,
3576 : &ndr64_obj,
3577 : &allow_remaining_obj)) {
3578 0 : return NULL;
3579 : }
3580 0 : blob.length = blob_length;
3581 :
3582 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3583 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3584 : }
3585 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3586 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3587 : }
3588 :
3589 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3590 0 : allow_remaining = true;
3591 : }
3592 :
3593 0 : return py_epm_Delete_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
3594 : }
3595 :
3596 0 : static PyObject *py_epm_Delete_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3597 : {
3598 : DATA_BLOB blob;
3599 0 : Py_ssize_t blob_length = 0;
3600 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
3601 0 : PyObject *bigendian_obj = NULL;
3602 0 : PyObject *ndr64_obj = NULL;
3603 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
3604 0 : PyObject *allow_remaining_obj = NULL;
3605 0 : bool allow_remaining = false;
3606 :
3607 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
3608 : discard_const_p(char *, kwnames),
3609 : &blob.data, &blob_length,
3610 : &bigendian_obj,
3611 : &ndr64_obj,
3612 : &allow_remaining_obj)) {
3613 0 : return NULL;
3614 : }
3615 0 : blob.length = blob_length;
3616 :
3617 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
3618 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
3619 : }
3620 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
3621 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
3622 : }
3623 :
3624 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3625 0 : allow_remaining = true;
3626 : }
3627 :
3628 0 : return py_epm_Delete_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
3629 : }
3630 :
3631 0 : static PyObject *py_epm_Delete_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
3632 : {
3633 0 : const struct ndr_interface_call *call = NULL;
3634 0 : struct epm_Delete *object = (struct epm_Delete *)pytalloc_get_ptr(py_obj);
3635 : PyObject *ret;
3636 : char *retstr;
3637 :
3638 0 : if (ndr_table_epmapper.num_calls < 2) {
3639 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Delete_ndr_print");
3640 0 : return NULL;
3641 : }
3642 0 : call = &ndr_table_epmapper.calls[1];
3643 :
3644 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
3645 0 : ret = PyUnicode_FromString(retstr);
3646 0 : TALLOC_FREE(retstr);
3647 :
3648 0 : return ret;
3649 : }
3650 :
3651 0 : static PyObject *py_epm_Delete_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3652 : {
3653 0 : return py_epm_Delete_ndr_print(py_obj, "epm_Delete_in", NDR_IN);
3654 : }
3655 :
3656 0 : static PyObject *py_epm_Delete_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3657 : {
3658 0 : return py_epm_Delete_ndr_print(py_obj, "epm_Delete_out", NDR_OUT);
3659 : }
3660 :
3661 : static PyMethodDef py_epm_Delete_methods[] = {
3662 : { "opnum", (PyCFunction)py_epm_Delete_ndr_opnum, METH_NOARGS|METH_CLASS,
3663 : "epmapper.epm_Delete.opnum() -> 1 (0x01) " },
3664 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Delete_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
3665 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
3666 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Delete_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
3667 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
3668 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Delete_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
3669 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
3670 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Delete_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
3671 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
3672 : { "__ndr_print_in__", (PyCFunction)py_epm_Delete_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
3673 : { "__ndr_print_out__", (PyCFunction)py_epm_Delete_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
3674 : { NULL, NULL, 0, NULL }
3675 : };
3676 :
3677 :
3678 : static PyTypeObject epm_Delete_Type = {
3679 : PyVarObject_HEAD_INIT(NULL, 0)
3680 : .tp_name = "epmapper.epm_Delete",
3681 : .tp_getset = py_epm_Delete_getsetters,
3682 : .tp_methods = py_epm_Delete_methods,
3683 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3684 : .tp_new = py_epm_Delete_new,
3685 : };
3686 :
3687 0 : static bool pack_py_epm_Delete_args_in(PyObject *args, PyObject *kwargs, struct epm_Delete *r)
3688 : {
3689 : PyObject *py_entries;
3690 0 : const char *kwnames[] = {
3691 : "entries", NULL
3692 : };
3693 :
3694 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_Delete", discard_const_p(char *, kwnames), &py_entries)) {
3695 0 : return false;
3696 : }
3697 :
3698 0 : PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
3699 0 : r->in.num_ents = PyList_GET_SIZE(py_entries);
3700 0 : if (py_entries == NULL) {
3701 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.entries");
3702 0 : return false;
3703 : }
3704 0 : PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
3705 : {
3706 : int entries_cntr_0;
3707 0 : r->in.entries = talloc_array_ptrtype(r, r->in.entries, PyList_GET_SIZE(py_entries));
3708 0 : if (!r->in.entries) { return false;; }
3709 0 : talloc_set_name_const(r->in.entries, "ARRAY: r->in.entries");
3710 0 : for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(py_entries); entries_cntr_0++) {
3711 0 : if (PyList_GET_ITEM(py_entries, entries_cntr_0) == NULL) {
3712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.entries[entries_cntr_0]");
3713 0 : return false;
3714 : }
3715 0 : PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(py_entries, entries_cntr_0), return false;);
3716 0 : if (talloc_reference(r->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_entries, entries_cntr_0))) == NULL) {
3717 0 : PyErr_NoMemory();
3718 0 : return false;
3719 : }
3720 0 : r->in.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(py_entries, entries_cntr_0));
3721 : }
3722 : }
3723 0 : return true;
3724 : }
3725 :
3726 0 : static PyObject *unpack_py_epm_Delete_args_out(struct epm_Delete *r)
3727 : {
3728 : PyObject *result;
3729 0 : result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result);
3730 0 : return result;
3731 : }
3732 :
3733 :
3734 0 : static PyObject *py_epm_Lookup_in_get_inquiry_type(PyObject *obj, void *closure)
3735 : {
3736 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
3737 : PyObject *py_inquiry_type;
3738 0 : py_inquiry_type = PyLong_FromUnsignedLongLong((uint32_t)object->in.inquiry_type);
3739 0 : return py_inquiry_type;
3740 : }
3741 :
3742 0 : static int py_epm_Lookup_in_set_inquiry_type(PyObject *py_obj, PyObject *value, void *closure)
3743 : {
3744 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
3745 0 : if (value == NULL) {
3746 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.inquiry_type");
3747 0 : return -1;
3748 : }
3749 : {
3750 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.inquiry_type));
3751 0 : if (PyLong_Check(value)) {
3752 : unsigned long long test_var;
3753 0 : test_var = PyLong_AsUnsignedLongLong(value);
3754 0 : if (PyErr_Occurred() != NULL) {
3755 0 : return -1;
3756 : }
3757 0 : if (test_var > uint_max) {
3758 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3759 : PyLong_Type.tp_name, uint_max, test_var);
3760 0 : return -1;
3761 : }
3762 0 : object->in.inquiry_type = test_var;
3763 : } else {
3764 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3765 : PyLong_Type.tp_name);
3766 0 : return -1;
3767 : }
3768 : }
3769 0 : return 0;
3770 : }
3771 :
3772 0 : static PyObject *py_epm_Lookup_in_get_object(PyObject *obj, void *closure)
3773 : {
3774 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
3775 : PyObject *py_object;
3776 0 : if (object->in.object == NULL) {
3777 0 : Py_RETURN_NONE;
3778 : }
3779 0 : if (object->in.object == NULL) {
3780 0 : py_object = Py_None;
3781 0 : Py_INCREF(py_object);
3782 : } else {
3783 0 : py_object = pytalloc_reference_ex(GUID_Type, object->in.object, object->in.object);
3784 : }
3785 0 : return py_object;
3786 : }
3787 :
3788 0 : static int py_epm_Lookup_in_set_object(PyObject *py_obj, PyObject *value, void *closure)
3789 : {
3790 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
3791 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.object));
3792 0 : if (value == NULL) {
3793 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.object");
3794 0 : return -1;
3795 : }
3796 0 : if (value == Py_None) {
3797 0 : object->in.object = NULL;
3798 : } else {
3799 0 : object->in.object = NULL;
3800 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
3801 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3802 0 : PyErr_NoMemory();
3803 0 : return -1;
3804 : }
3805 0 : object->in.object = (struct GUID *)pytalloc_get_ptr(value);
3806 : }
3807 0 : return 0;
3808 : }
3809 :
3810 0 : static PyObject *py_epm_Lookup_in_get_interface_id(PyObject *obj, void *closure)
3811 : {
3812 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
3813 : PyObject *py_interface_id;
3814 0 : if (object->in.interface_id == NULL) {
3815 0 : Py_RETURN_NONE;
3816 : }
3817 0 : if (object->in.interface_id == NULL) {
3818 0 : py_interface_id = Py_None;
3819 0 : Py_INCREF(py_interface_id);
3820 : } else {
3821 0 : py_interface_id = pytalloc_reference_ex(&rpc_if_id_t_Type, object->in.interface_id, object->in.interface_id);
3822 : }
3823 0 : return py_interface_id;
3824 : }
3825 :
3826 0 : static int py_epm_Lookup_in_set_interface_id(PyObject *py_obj, PyObject *value, void *closure)
3827 : {
3828 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
3829 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.interface_id));
3830 0 : if (value == NULL) {
3831 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.interface_id");
3832 0 : return -1;
3833 : }
3834 0 : if (value == Py_None) {
3835 0 : object->in.interface_id = NULL;
3836 : } else {
3837 0 : object->in.interface_id = NULL;
3838 0 : PY_CHECK_TYPE(&rpc_if_id_t_Type, value, return -1;);
3839 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3840 0 : PyErr_NoMemory();
3841 0 : return -1;
3842 : }
3843 0 : object->in.interface_id = (struct rpc_if_id_t *)pytalloc_get_ptr(value);
3844 : }
3845 0 : return 0;
3846 : }
3847 :
3848 0 : static PyObject *py_epm_Lookup_in_get_vers_option(PyObject *obj, void *closure)
3849 : {
3850 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
3851 : PyObject *py_vers_option;
3852 0 : py_vers_option = PyLong_FromUnsignedLongLong((uint32_t)object->in.vers_option);
3853 0 : return py_vers_option;
3854 : }
3855 :
3856 0 : static int py_epm_Lookup_in_set_vers_option(PyObject *py_obj, PyObject *value, void *closure)
3857 : {
3858 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
3859 0 : if (value == NULL) {
3860 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.vers_option");
3861 0 : return -1;
3862 : }
3863 : {
3864 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.vers_option));
3865 0 : if (PyLong_Check(value)) {
3866 : unsigned long long test_var;
3867 0 : test_var = PyLong_AsUnsignedLongLong(value);
3868 0 : if (PyErr_Occurred() != NULL) {
3869 0 : return -1;
3870 : }
3871 0 : if (test_var > uint_max) {
3872 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3873 : PyLong_Type.tp_name, uint_max, test_var);
3874 0 : return -1;
3875 : }
3876 0 : object->in.vers_option = test_var;
3877 : } else {
3878 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3879 : PyLong_Type.tp_name);
3880 0 : return -1;
3881 : }
3882 : }
3883 0 : return 0;
3884 : }
3885 :
3886 0 : static PyObject *py_epm_Lookup_in_get_entry_handle(PyObject *obj, void *closure)
3887 : {
3888 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
3889 : PyObject *py_entry_handle;
3890 0 : if (object->in.entry_handle == NULL) {
3891 0 : Py_RETURN_NONE;
3892 : }
3893 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->in.entry_handle, object->in.entry_handle);
3894 0 : return py_entry_handle;
3895 : }
3896 :
3897 0 : static int py_epm_Lookup_in_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
3898 : {
3899 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
3900 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.entry_handle));
3901 0 : if (value == NULL) {
3902 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.entry_handle");
3903 0 : return -1;
3904 : }
3905 0 : object->in.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entry_handle);
3906 0 : if (object->in.entry_handle == NULL) {
3907 0 : PyErr_NoMemory();
3908 0 : return -1;
3909 : }
3910 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
3911 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3912 0 : PyErr_NoMemory();
3913 0 : return -1;
3914 : }
3915 0 : object->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
3916 0 : return 0;
3917 : }
3918 :
3919 0 : static PyObject *py_epm_Lookup_out_get_entry_handle(PyObject *obj, void *closure)
3920 : {
3921 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
3922 : PyObject *py_entry_handle;
3923 0 : if (object->out.entry_handle == NULL) {
3924 0 : Py_RETURN_NONE;
3925 : }
3926 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->out.entry_handle, object->out.entry_handle);
3927 0 : return py_entry_handle;
3928 : }
3929 :
3930 0 : static int py_epm_Lookup_out_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
3931 : {
3932 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
3933 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.entry_handle));
3934 0 : if (value == NULL) {
3935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.entry_handle");
3936 0 : return -1;
3937 : }
3938 0 : object->out.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.entry_handle);
3939 0 : if (object->out.entry_handle == NULL) {
3940 0 : PyErr_NoMemory();
3941 0 : return -1;
3942 : }
3943 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
3944 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3945 0 : PyErr_NoMemory();
3946 0 : return -1;
3947 : }
3948 0 : object->out.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
3949 0 : return 0;
3950 : }
3951 :
3952 0 : static PyObject *py_epm_Lookup_in_get_max_ents(PyObject *obj, void *closure)
3953 : {
3954 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
3955 : PyObject *py_max_ents;
3956 0 : py_max_ents = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_ents);
3957 0 : return py_max_ents;
3958 : }
3959 :
3960 0 : static int py_epm_Lookup_in_set_max_ents(PyObject *py_obj, PyObject *value, void *closure)
3961 : {
3962 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
3963 0 : if (value == NULL) {
3964 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_ents");
3965 0 : return -1;
3966 : }
3967 : {
3968 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_ents));
3969 0 : if (PyLong_Check(value)) {
3970 : unsigned long long test_var;
3971 0 : test_var = PyLong_AsUnsignedLongLong(value);
3972 0 : if (PyErr_Occurred() != NULL) {
3973 0 : return -1;
3974 : }
3975 0 : if (test_var > uint_max) {
3976 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3977 : PyLong_Type.tp_name, uint_max, test_var);
3978 0 : return -1;
3979 : }
3980 0 : object->in.max_ents = test_var;
3981 : } else {
3982 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3983 : PyLong_Type.tp_name);
3984 0 : return -1;
3985 : }
3986 : }
3987 0 : return 0;
3988 : }
3989 :
3990 0 : static PyObject *py_epm_Lookup_out_get_num_ents(PyObject *obj, void *closure)
3991 : {
3992 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
3993 : PyObject *py_num_ents;
3994 0 : if (object->out.num_ents == NULL) {
3995 0 : Py_RETURN_NONE;
3996 : }
3997 0 : py_num_ents = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_ents);
3998 0 : return py_num_ents;
3999 : }
4000 :
4001 0 : static int py_epm_Lookup_out_set_num_ents(PyObject *py_obj, PyObject *value, void *closure)
4002 : {
4003 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
4004 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_ents));
4005 0 : if (value == NULL) {
4006 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_ents");
4007 0 : return -1;
4008 : }
4009 0 : object->out.num_ents = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_ents);
4010 0 : if (object->out.num_ents == NULL) {
4011 0 : PyErr_NoMemory();
4012 0 : return -1;
4013 : }
4014 : {
4015 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_ents));
4016 0 : if (PyLong_Check(value)) {
4017 : unsigned long long test_var;
4018 0 : test_var = PyLong_AsUnsignedLongLong(value);
4019 0 : if (PyErr_Occurred() != NULL) {
4020 0 : return -1;
4021 : }
4022 0 : if (test_var > uint_max) {
4023 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4024 : PyLong_Type.tp_name, uint_max, test_var);
4025 0 : return -1;
4026 : }
4027 0 : *object->out.num_ents = test_var;
4028 : } else {
4029 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4030 : PyLong_Type.tp_name);
4031 0 : return -1;
4032 : }
4033 : }
4034 0 : return 0;
4035 : }
4036 :
4037 0 : static PyObject *py_epm_Lookup_out_get_entries(PyObject *obj, void *closure)
4038 : {
4039 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
4040 : PyObject *py_entries;
4041 0 : py_entries = PyList_New(*object->out.num_ents);
4042 0 : if (py_entries == NULL) {
4043 0 : return NULL;
4044 : }
4045 : {
4046 : int entries_cntr_0;
4047 0 : for (entries_cntr_0 = 0; entries_cntr_0 < (*object->out.num_ents); entries_cntr_0++) {
4048 : PyObject *py_entries_0;
4049 0 : py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, object->out.entries, &object->out.entries[entries_cntr_0]);
4050 0 : PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
4051 : }
4052 : }
4053 0 : return py_entries;
4054 : }
4055 :
4056 0 : static int py_epm_Lookup_out_set_entries(PyObject *py_obj, PyObject *value, void *closure)
4057 : {
4058 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
4059 0 : if (value == NULL) {
4060 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.entries");
4061 0 : return -1;
4062 : }
4063 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4064 : {
4065 : int entries_cntr_0;
4066 0 : object->out.entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.entries, PyList_GET_SIZE(value));
4067 0 : if (!object->out.entries) { return -1;; }
4068 0 : talloc_set_name_const(object->out.entries, "ARRAY: object->out.entries");
4069 0 : for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(value); entries_cntr_0++) {
4070 0 : if (PyList_GET_ITEM(value, entries_cntr_0) == NULL) {
4071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.entries[entries_cntr_0]");
4072 0 : return -1;
4073 : }
4074 0 : PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(value, entries_cntr_0), return -1;);
4075 0 : if (talloc_reference(object->out.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_0))) == NULL) {
4076 0 : PyErr_NoMemory();
4077 0 : return -1;
4078 : }
4079 0 : object->out.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_0));
4080 : }
4081 : }
4082 0 : return 0;
4083 : }
4084 :
4085 0 : static PyObject *py_epm_Lookup_get_result(PyObject *obj, void *closure)
4086 : {
4087 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(obj);
4088 : PyObject *py_result;
4089 0 : py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result);
4090 0 : return py_result;
4091 : }
4092 :
4093 0 : static int py_epm_Lookup_set_result(PyObject *py_obj, PyObject *value, void *closure)
4094 : {
4095 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
4096 0 : if (value == NULL) {
4097 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
4098 0 : return -1;
4099 : }
4100 : {
4101 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
4102 0 : if (PyLong_Check(value)) {
4103 : unsigned long long test_var;
4104 0 : test_var = PyLong_AsUnsignedLongLong(value);
4105 0 : if (PyErr_Occurred() != NULL) {
4106 0 : return -1;
4107 : }
4108 0 : if (test_var > uint_max) {
4109 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4110 : PyLong_Type.tp_name, uint_max, test_var);
4111 0 : return -1;
4112 : }
4113 0 : object->out.result = test_var;
4114 : } else {
4115 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4116 : PyLong_Type.tp_name);
4117 0 : return -1;
4118 : }
4119 : }
4120 0 : return 0;
4121 : }
4122 :
4123 : static PyGetSetDef py_epm_Lookup_getsetters[] = {
4124 : {
4125 : .name = discard_const_p(char, "in_inquiry_type"),
4126 : .get = py_epm_Lookup_in_get_inquiry_type,
4127 : .set = py_epm_Lookup_in_set_inquiry_type,
4128 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_InquiryType")
4129 : },
4130 : {
4131 : .name = discard_const_p(char, "in_object"),
4132 : .get = py_epm_Lookup_in_get_object,
4133 : .set = py_epm_Lookup_in_set_object,
4134 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
4135 : },
4136 : {
4137 : .name = discard_const_p(char, "in_interface_id"),
4138 : .get = py_epm_Lookup_in_get_interface_id,
4139 : .set = py_epm_Lookup_in_set_interface_id,
4140 : .doc = discard_const_p(char, "PIDL-generated element of base type rpc_if_id_t")
4141 : },
4142 : {
4143 : .name = discard_const_p(char, "in_vers_option"),
4144 : .get = py_epm_Lookup_in_get_vers_option,
4145 : .set = py_epm_Lookup_in_set_vers_option,
4146 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_VersionOption")
4147 : },
4148 : {
4149 : .name = discard_const_p(char, "in_entry_handle"),
4150 : .get = py_epm_Lookup_in_get_entry_handle,
4151 : .set = py_epm_Lookup_in_set_entry_handle,
4152 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
4153 : },
4154 : {
4155 : .name = discard_const_p(char, "out_entry_handle"),
4156 : .get = py_epm_Lookup_out_get_entry_handle,
4157 : .set = py_epm_Lookup_out_set_entry_handle,
4158 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
4159 : },
4160 : {
4161 : .name = discard_const_p(char, "in_max_ents"),
4162 : .get = py_epm_Lookup_in_get_max_ents,
4163 : .set = py_epm_Lookup_in_set_max_ents,
4164 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4165 : },
4166 : {
4167 : .name = discard_const_p(char, "out_num_ents"),
4168 : .get = py_epm_Lookup_out_get_num_ents,
4169 : .set = py_epm_Lookup_out_set_num_ents,
4170 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4171 : },
4172 : {
4173 : .name = discard_const_p(char, "out_entries"),
4174 : .get = py_epm_Lookup_out_get_entries,
4175 : .set = py_epm_Lookup_out_set_entries,
4176 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_entry_t")
4177 : },
4178 : {
4179 : .name = discard_const_p(char, "result"),
4180 : .get = py_epm_Lookup_get_result,
4181 : .set = py_epm_Lookup_set_result,
4182 : .doc = discard_const_p(char, "PIDL-generated element of type uint32")
4183 : },
4184 : { .name = NULL }
4185 : };
4186 :
4187 0 : static PyObject *py_epm_Lookup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4188 : {
4189 0 : PyObject *self = pytalloc_new(struct epm_Lookup, type);
4190 0 : struct epm_Lookup *_self = (struct epm_Lookup *)pytalloc_get_ptr(self);
4191 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
4192 0 : _self->in.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
4193 0 : _self->out.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
4194 0 : _self->out.num_ents = talloc_zero(mem_ctx, uint32_t);
4195 0 : return self;
4196 : }
4197 :
4198 0 : static PyObject *py_epm_Lookup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
4199 : {
4200 :
4201 :
4202 0 : return PyLong_FromLong(2);
4203 : }
4204 :
4205 0 : static PyObject *py_epm_Lookup_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
4206 : {
4207 0 : const struct ndr_interface_call *call = NULL;
4208 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
4209 0 : PyObject *ret = NULL;
4210 0 : struct ndr_push *push = NULL;
4211 : DATA_BLOB blob;
4212 : enum ndr_err_code err;
4213 :
4214 0 : if (ndr_table_epmapper.num_calls < 3) {
4215 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Lookup_ndr_pack");
4216 0 : return NULL;
4217 : }
4218 0 : call = &ndr_table_epmapper.calls[2];
4219 :
4220 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
4221 0 : if (push == NULL) {
4222 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4223 0 : return NULL;
4224 : }
4225 :
4226 0 : push->flags |= ndr_push_flags;
4227 :
4228 0 : err = call->ndr_push(push, ndr_inout_flags, object);
4229 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4230 0 : TALLOC_FREE(push);
4231 0 : PyErr_SetNdrError(err);
4232 0 : return NULL;
4233 : }
4234 0 : blob = ndr_push_blob(push);
4235 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4236 0 : TALLOC_FREE(push);
4237 0 : return ret;
4238 : }
4239 :
4240 0 : static PyObject *py_epm_Lookup_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4241 : {
4242 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4243 0 : PyObject *bigendian_obj = NULL;
4244 0 : PyObject *ndr64_obj = NULL;
4245 0 : uint32_t ndr_push_flags = 0;
4246 :
4247 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
4248 : discard_const_p(char *, kwnames),
4249 : &bigendian_obj,
4250 : &ndr64_obj)) {
4251 0 : return NULL;
4252 : }
4253 :
4254 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4255 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4256 : }
4257 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4258 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4259 : }
4260 :
4261 0 : return py_epm_Lookup_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
4262 : }
4263 :
4264 0 : static PyObject *py_epm_Lookup_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4265 : {
4266 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
4267 0 : PyObject *bigendian_obj = NULL;
4268 0 : PyObject *ndr64_obj = NULL;
4269 0 : uint32_t ndr_push_flags = 0;
4270 :
4271 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
4272 : discard_const_p(char *, kwnames),
4273 : &bigendian_obj,
4274 : &ndr64_obj)) {
4275 0 : return NULL;
4276 : }
4277 :
4278 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4279 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
4280 : }
4281 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4282 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
4283 : }
4284 :
4285 0 : return py_epm_Lookup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
4286 : }
4287 :
4288 0 : static PyObject *py_epm_Lookup_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
4289 : {
4290 0 : const struct ndr_interface_call *call = NULL;
4291 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
4292 0 : struct ndr_pull *pull = NULL;
4293 : enum ndr_err_code err;
4294 :
4295 0 : if (ndr_table_epmapper.num_calls < 3) {
4296 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Lookup_ndr_unpack");
4297 0 : return NULL;
4298 : }
4299 0 : call = &ndr_table_epmapper.calls[2];
4300 :
4301 0 : pull = ndr_pull_init_blob(blob, object);
4302 0 : if (pull == NULL) {
4303 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4304 0 : return NULL;
4305 : }
4306 :
4307 0 : pull->flags |= ndr_pull_flags;
4308 :
4309 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
4310 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4311 0 : TALLOC_FREE(pull);
4312 0 : PyErr_SetNdrError(err);
4313 0 : return NULL;
4314 : }
4315 0 : if (!allow_remaining) {
4316 : uint32_t highest_ofs;
4317 :
4318 0 : if (pull->offset > pull->relative_highest_offset) {
4319 0 : highest_ofs = pull->offset;
4320 : } else {
4321 0 : highest_ofs = pull->relative_highest_offset;
4322 : }
4323 0 : if (highest_ofs < pull->data_size) {
4324 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
4325 : "not all bytes consumed ofs[%u] size[%u]",
4326 : highest_ofs, pull->data_size);
4327 0 : TALLOC_FREE(pull);
4328 0 : PyErr_SetNdrError(err);
4329 0 : return NULL;
4330 : }
4331 : }
4332 :
4333 0 : TALLOC_FREE(pull);
4334 0 : Py_RETURN_NONE;
4335 : }
4336 :
4337 0 : static PyObject *py_epm_Lookup_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4338 : {
4339 : DATA_BLOB blob;
4340 0 : Py_ssize_t blob_length = 0;
4341 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4342 0 : PyObject *bigendian_obj = NULL;
4343 0 : PyObject *ndr64_obj = NULL;
4344 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4345 0 : PyObject *allow_remaining_obj = NULL;
4346 0 : bool allow_remaining = false;
4347 :
4348 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
4349 : discard_const_p(char *, kwnames),
4350 : &blob.data, &blob_length,
4351 : &bigendian_obj,
4352 : &ndr64_obj,
4353 : &allow_remaining_obj)) {
4354 0 : return NULL;
4355 : }
4356 0 : blob.length = blob_length;
4357 :
4358 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4359 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4360 : }
4361 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4362 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4363 : }
4364 :
4365 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4366 0 : allow_remaining = true;
4367 : }
4368 :
4369 0 : return py_epm_Lookup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
4370 : }
4371 :
4372 0 : static PyObject *py_epm_Lookup_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4373 : {
4374 : DATA_BLOB blob;
4375 0 : Py_ssize_t blob_length = 0;
4376 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
4377 0 : PyObject *bigendian_obj = NULL;
4378 0 : PyObject *ndr64_obj = NULL;
4379 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
4380 0 : PyObject *allow_remaining_obj = NULL;
4381 0 : bool allow_remaining = false;
4382 :
4383 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
4384 : discard_const_p(char *, kwnames),
4385 : &blob.data, &blob_length,
4386 : &bigendian_obj,
4387 : &ndr64_obj,
4388 : &allow_remaining_obj)) {
4389 0 : return NULL;
4390 : }
4391 0 : blob.length = blob_length;
4392 :
4393 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
4394 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
4395 : }
4396 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
4397 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
4398 : }
4399 :
4400 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4401 0 : allow_remaining = true;
4402 : }
4403 :
4404 0 : return py_epm_Lookup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
4405 : }
4406 :
4407 0 : static PyObject *py_epm_Lookup_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
4408 : {
4409 0 : const struct ndr_interface_call *call = NULL;
4410 0 : struct epm_Lookup *object = (struct epm_Lookup *)pytalloc_get_ptr(py_obj);
4411 : PyObject *ret;
4412 : char *retstr;
4413 :
4414 0 : if (ndr_table_epmapper.num_calls < 3) {
4415 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Lookup_ndr_print");
4416 0 : return NULL;
4417 : }
4418 0 : call = &ndr_table_epmapper.calls[2];
4419 :
4420 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
4421 0 : ret = PyUnicode_FromString(retstr);
4422 0 : TALLOC_FREE(retstr);
4423 :
4424 0 : return ret;
4425 : }
4426 :
4427 0 : static PyObject *py_epm_Lookup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4428 : {
4429 0 : return py_epm_Lookup_ndr_print(py_obj, "epm_Lookup_in", NDR_IN);
4430 : }
4431 :
4432 0 : static PyObject *py_epm_Lookup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4433 : {
4434 0 : return py_epm_Lookup_ndr_print(py_obj, "epm_Lookup_out", NDR_OUT);
4435 : }
4436 :
4437 : static PyMethodDef py_epm_Lookup_methods[] = {
4438 : { "opnum", (PyCFunction)py_epm_Lookup_ndr_opnum, METH_NOARGS|METH_CLASS,
4439 : "epmapper.epm_Lookup.opnum() -> 2 (0x02) " },
4440 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Lookup_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
4441 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
4442 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Lookup_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
4443 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
4444 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Lookup_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
4445 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
4446 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Lookup_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
4447 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
4448 : { "__ndr_print_in__", (PyCFunction)py_epm_Lookup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
4449 : { "__ndr_print_out__", (PyCFunction)py_epm_Lookup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
4450 : { NULL, NULL, 0, NULL }
4451 : };
4452 :
4453 :
4454 : static PyTypeObject epm_Lookup_Type = {
4455 : PyVarObject_HEAD_INIT(NULL, 0)
4456 : .tp_name = "epmapper.epm_Lookup",
4457 : .tp_getset = py_epm_Lookup_getsetters,
4458 : .tp_methods = py_epm_Lookup_methods,
4459 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4460 : .tp_new = py_epm_Lookup_new,
4461 : };
4462 :
4463 0 : static bool pack_py_epm_Lookup_args_in(PyObject *args, PyObject *kwargs, struct epm_Lookup *r)
4464 : {
4465 : PyObject *py_inquiry_type;
4466 : PyObject *py_object;
4467 : PyObject *py_interface_id;
4468 : PyObject *py_vers_option;
4469 : PyObject *py_entry_handle;
4470 : PyObject *py_max_ents;
4471 0 : const char *kwnames[] = {
4472 : "inquiry_type", "object", "interface_id", "vers_option", "entry_handle", "max_ents", NULL
4473 : };
4474 :
4475 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:epm_Lookup", discard_const_p(char *, kwnames), &py_inquiry_type, &py_object, &py_interface_id, &py_vers_option, &py_entry_handle, &py_max_ents)) {
4476 0 : return false;
4477 : }
4478 :
4479 0 : if (py_inquiry_type == NULL) {
4480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.inquiry_type");
4481 0 : return false;
4482 : }
4483 : {
4484 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.inquiry_type));
4485 0 : if (PyLong_Check(py_inquiry_type)) {
4486 : unsigned long long test_var;
4487 0 : test_var = PyLong_AsUnsignedLongLong(py_inquiry_type);
4488 0 : if (PyErr_Occurred() != NULL) {
4489 0 : return false;
4490 : }
4491 0 : if (test_var > uint_max) {
4492 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4493 : PyLong_Type.tp_name, uint_max, test_var);
4494 0 : return false;
4495 : }
4496 0 : r->in.inquiry_type = test_var;
4497 : } else {
4498 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4499 : PyLong_Type.tp_name);
4500 0 : return false;
4501 : }
4502 : }
4503 0 : if (py_object == NULL) {
4504 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.object");
4505 0 : return false;
4506 : }
4507 0 : if (py_object == Py_None) {
4508 0 : r->in.object = NULL;
4509 : } else {
4510 0 : r->in.object = NULL;
4511 0 : PY_CHECK_TYPE(GUID_Type, py_object, return false;);
4512 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
4513 0 : PyErr_NoMemory();
4514 0 : return false;
4515 : }
4516 0 : r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
4517 : }
4518 0 : if (py_interface_id == NULL) {
4519 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.interface_id");
4520 0 : return false;
4521 : }
4522 0 : if (py_interface_id == Py_None) {
4523 0 : r->in.interface_id = NULL;
4524 : } else {
4525 0 : r->in.interface_id = NULL;
4526 0 : PY_CHECK_TYPE(&rpc_if_id_t_Type, py_interface_id, return false;);
4527 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_interface_id)) == NULL) {
4528 0 : PyErr_NoMemory();
4529 0 : return false;
4530 : }
4531 0 : r->in.interface_id = (struct rpc_if_id_t *)pytalloc_get_ptr(py_interface_id);
4532 : }
4533 0 : if (py_vers_option == NULL) {
4534 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.vers_option");
4535 0 : return false;
4536 : }
4537 : {
4538 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.vers_option));
4539 0 : if (PyLong_Check(py_vers_option)) {
4540 : unsigned long long test_var;
4541 0 : test_var = PyLong_AsUnsignedLongLong(py_vers_option);
4542 0 : if (PyErr_Occurred() != NULL) {
4543 0 : return false;
4544 : }
4545 0 : if (test_var > uint_max) {
4546 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4547 : PyLong_Type.tp_name, uint_max, test_var);
4548 0 : return false;
4549 : }
4550 0 : r->in.vers_option = test_var;
4551 : } else {
4552 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4553 : PyLong_Type.tp_name);
4554 0 : return false;
4555 : }
4556 : }
4557 0 : if (py_entry_handle == NULL) {
4558 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.entry_handle");
4559 0 : return false;
4560 : }
4561 0 : r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
4562 0 : if (r->in.entry_handle == NULL) {
4563 0 : PyErr_NoMemory();
4564 0 : return false;
4565 : }
4566 0 : PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
4567 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
4568 0 : PyErr_NoMemory();
4569 0 : return false;
4570 : }
4571 0 : r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
4572 0 : if (py_max_ents == NULL) {
4573 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_ents");
4574 0 : return false;
4575 : }
4576 : {
4577 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_ents));
4578 0 : if (PyLong_Check(py_max_ents)) {
4579 : unsigned long long test_var;
4580 0 : test_var = PyLong_AsUnsignedLongLong(py_max_ents);
4581 0 : if (PyErr_Occurred() != NULL) {
4582 0 : return false;
4583 : }
4584 0 : if (test_var > uint_max) {
4585 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4586 : PyLong_Type.tp_name, uint_max, test_var);
4587 0 : return false;
4588 : }
4589 0 : r->in.max_ents = test_var;
4590 : } else {
4591 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4592 : PyLong_Type.tp_name);
4593 0 : return false;
4594 : }
4595 : }
4596 0 : return true;
4597 : }
4598 :
4599 0 : static PyObject *unpack_py_epm_Lookup_args_out(struct epm_Lookup *r)
4600 : {
4601 : PyObject *result;
4602 : PyObject *py_entry_handle;
4603 : PyObject *py_entries;
4604 0 : result = PyTuple_New(3);
4605 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
4606 0 : PyTuple_SetItem(result, 0, py_entry_handle);
4607 0 : py_entries = PyList_New(*r->out.num_ents);
4608 0 : if (py_entries == NULL) {
4609 0 : return NULL;
4610 : }
4611 : {
4612 : int entries_cntr_0;
4613 0 : for (entries_cntr_0 = 0; entries_cntr_0 < (*r->out.num_ents); entries_cntr_0++) {
4614 : PyObject *py_entries_0;
4615 0 : py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, r->out.entries, &r->out.entries[entries_cntr_0]);
4616 0 : PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
4617 : }
4618 : }
4619 0 : PyTuple_SetItem(result, 1, py_entries);
4620 0 : PyTuple_SetItem(result, 2, PyLong_FromUnsignedLongLong((uint32_t)r->out.result));
4621 0 : return result;
4622 : }
4623 :
4624 :
4625 0 : static PyObject *py_epm_Map_in_get_object(PyObject *obj, void *closure)
4626 : {
4627 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(obj);
4628 : PyObject *py_object;
4629 0 : if (object->in.object == NULL) {
4630 0 : Py_RETURN_NONE;
4631 : }
4632 0 : if (object->in.object == NULL) {
4633 0 : py_object = Py_None;
4634 0 : Py_INCREF(py_object);
4635 : } else {
4636 0 : py_object = pytalloc_reference_ex(GUID_Type, object->in.object, object->in.object);
4637 : }
4638 0 : return py_object;
4639 : }
4640 :
4641 48 : static int py_epm_Map_in_set_object(PyObject *py_obj, PyObject *value, void *closure)
4642 : {
4643 48 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
4644 48 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.object));
4645 48 : if (value == NULL) {
4646 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.object");
4647 0 : return -1;
4648 : }
4649 48 : if (value == Py_None) {
4650 0 : object->in.object = NULL;
4651 : } else {
4652 48 : object->in.object = NULL;
4653 48 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
4654 48 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4655 0 : PyErr_NoMemory();
4656 0 : return -1;
4657 : }
4658 48 : object->in.object = (struct GUID *)pytalloc_get_ptr(value);
4659 : }
4660 48 : return 0;
4661 : }
4662 :
4663 0 : static PyObject *py_epm_Map_in_get_map_tower(PyObject *obj, void *closure)
4664 : {
4665 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(obj);
4666 : PyObject *py_map_tower;
4667 0 : if (object->in.map_tower == NULL) {
4668 0 : Py_RETURN_NONE;
4669 : }
4670 0 : if (object->in.map_tower == NULL) {
4671 0 : py_map_tower = Py_None;
4672 0 : Py_INCREF(py_map_tower);
4673 : } else {
4674 0 : py_map_tower = pytalloc_reference_ex(&epm_twr_t_Type, object->in.map_tower, object->in.map_tower);
4675 : }
4676 0 : return py_map_tower;
4677 : }
4678 :
4679 48 : static int py_epm_Map_in_set_map_tower(PyObject *py_obj, PyObject *value, void *closure)
4680 : {
4681 48 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
4682 48 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.map_tower));
4683 48 : if (value == NULL) {
4684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.map_tower");
4685 0 : return -1;
4686 : }
4687 48 : if (value == Py_None) {
4688 0 : object->in.map_tower = NULL;
4689 : } else {
4690 48 : object->in.map_tower = NULL;
4691 48 : PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
4692 48 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4693 0 : PyErr_NoMemory();
4694 0 : return -1;
4695 : }
4696 48 : object->in.map_tower = (struct epm_twr_t *)pytalloc_get_ptr(value);
4697 : }
4698 48 : return 0;
4699 : }
4700 :
4701 0 : static PyObject *py_epm_Map_in_get_entry_handle(PyObject *obj, void *closure)
4702 : {
4703 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(obj);
4704 : PyObject *py_entry_handle;
4705 0 : if (object->in.entry_handle == NULL) {
4706 0 : Py_RETURN_NONE;
4707 : }
4708 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->in.entry_handle, object->in.entry_handle);
4709 0 : return py_entry_handle;
4710 : }
4711 :
4712 48 : static int py_epm_Map_in_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
4713 : {
4714 48 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
4715 48 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.entry_handle));
4716 48 : if (value == NULL) {
4717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.entry_handle");
4718 0 : return -1;
4719 : }
4720 48 : object->in.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entry_handle);
4721 48 : if (object->in.entry_handle == NULL) {
4722 0 : PyErr_NoMemory();
4723 0 : return -1;
4724 : }
4725 48 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
4726 48 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4727 0 : PyErr_NoMemory();
4728 0 : return -1;
4729 : }
4730 48 : object->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
4731 48 : return 0;
4732 : }
4733 :
4734 0 : static PyObject *py_epm_Map_out_get_entry_handle(PyObject *obj, void *closure)
4735 : {
4736 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(obj);
4737 : PyObject *py_entry_handle;
4738 0 : if (object->out.entry_handle == NULL) {
4739 0 : Py_RETURN_NONE;
4740 : }
4741 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->out.entry_handle, object->out.entry_handle);
4742 0 : return py_entry_handle;
4743 : }
4744 :
4745 0 : static int py_epm_Map_out_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
4746 : {
4747 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
4748 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.entry_handle));
4749 0 : if (value == NULL) {
4750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.entry_handle");
4751 0 : return -1;
4752 : }
4753 0 : object->out.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.entry_handle);
4754 0 : if (object->out.entry_handle == NULL) {
4755 0 : PyErr_NoMemory();
4756 0 : return -1;
4757 : }
4758 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
4759 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4760 0 : PyErr_NoMemory();
4761 0 : return -1;
4762 : }
4763 0 : object->out.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
4764 0 : return 0;
4765 : }
4766 :
4767 0 : static PyObject *py_epm_Map_in_get_max_towers(PyObject *obj, void *closure)
4768 : {
4769 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(obj);
4770 : PyObject *py_max_towers;
4771 0 : py_max_towers = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_towers);
4772 0 : return py_max_towers;
4773 : }
4774 :
4775 48 : static int py_epm_Map_in_set_max_towers(PyObject *py_obj, PyObject *value, void *closure)
4776 : {
4777 48 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
4778 48 : if (value == NULL) {
4779 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_towers");
4780 0 : return -1;
4781 : }
4782 : {
4783 48 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_towers));
4784 48 : if (PyLong_Check(value)) {
4785 : unsigned long long test_var;
4786 48 : test_var = PyLong_AsUnsignedLongLong(value);
4787 48 : if (PyErr_Occurred() != NULL) {
4788 0 : return -1;
4789 : }
4790 48 : if (test_var > uint_max) {
4791 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4792 : PyLong_Type.tp_name, uint_max, test_var);
4793 0 : return -1;
4794 : }
4795 48 : object->in.max_towers = test_var;
4796 : } else {
4797 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4798 : PyLong_Type.tp_name);
4799 0 : return -1;
4800 : }
4801 : }
4802 48 : return 0;
4803 : }
4804 :
4805 48 : static PyObject *py_epm_Map_out_get_num_towers(PyObject *obj, void *closure)
4806 : {
4807 48 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(obj);
4808 : PyObject *py_num_towers;
4809 48 : if (object->out.num_towers == NULL) {
4810 0 : Py_RETURN_NONE;
4811 : }
4812 48 : py_num_towers = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_towers);
4813 48 : return py_num_towers;
4814 : }
4815 :
4816 0 : static int py_epm_Map_out_set_num_towers(PyObject *py_obj, PyObject *value, void *closure)
4817 : {
4818 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
4819 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_towers));
4820 0 : if (value == NULL) {
4821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_towers");
4822 0 : return -1;
4823 : }
4824 0 : object->out.num_towers = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_towers);
4825 0 : if (object->out.num_towers == NULL) {
4826 0 : PyErr_NoMemory();
4827 0 : return -1;
4828 : }
4829 : {
4830 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_towers));
4831 0 : if (PyLong_Check(value)) {
4832 : unsigned long long test_var;
4833 0 : test_var = PyLong_AsUnsignedLongLong(value);
4834 0 : if (PyErr_Occurred() != NULL) {
4835 0 : return -1;
4836 : }
4837 0 : if (test_var > uint_max) {
4838 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4839 : PyLong_Type.tp_name, uint_max, test_var);
4840 0 : return -1;
4841 : }
4842 0 : *object->out.num_towers = test_var;
4843 : } else {
4844 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4845 : PyLong_Type.tp_name);
4846 0 : return -1;
4847 : }
4848 : }
4849 0 : return 0;
4850 : }
4851 :
4852 16 : static PyObject *py_epm_Map_out_get_towers(PyObject *obj, void *closure)
4853 : {
4854 16 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(obj);
4855 : PyObject *py_towers;
4856 16 : py_towers = PyList_New(*object->out.num_towers);
4857 16 : if (py_towers == NULL) {
4858 0 : return NULL;
4859 : }
4860 : {
4861 : int towers_cntr_0;
4862 32 : for (towers_cntr_0 = 0; towers_cntr_0 < (*object->out.num_towers); towers_cntr_0++) {
4863 : PyObject *py_towers_0;
4864 16 : py_towers_0 = pytalloc_reference_ex(&epm_twr_p_t_Type, object->out.towers, &object->out.towers[towers_cntr_0]);
4865 16 : PyList_SetItem(py_towers, towers_cntr_0, py_towers_0);
4866 : }
4867 : }
4868 16 : return py_towers;
4869 : }
4870 :
4871 0 : static int py_epm_Map_out_set_towers(PyObject *py_obj, PyObject *value, void *closure)
4872 : {
4873 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
4874 0 : if (value == NULL) {
4875 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.towers");
4876 0 : return -1;
4877 : }
4878 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4879 : {
4880 : int towers_cntr_0;
4881 0 : object->out.towers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.towers, PyList_GET_SIZE(value));
4882 0 : if (!object->out.towers) { return -1;; }
4883 0 : talloc_set_name_const(object->out.towers, "ARRAY: object->out.towers");
4884 0 : for (towers_cntr_0 = 0; towers_cntr_0 < PyList_GET_SIZE(value); towers_cntr_0++) {
4885 0 : if (PyList_GET_ITEM(value, towers_cntr_0) == NULL) {
4886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.towers[towers_cntr_0]");
4887 0 : return -1;
4888 : }
4889 0 : PY_CHECK_TYPE(&epm_twr_p_t_Type, PyList_GET_ITEM(value, towers_cntr_0), return -1;);
4890 0 : if (talloc_reference(object->out.towers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, towers_cntr_0))) == NULL) {
4891 0 : PyErr_NoMemory();
4892 0 : return -1;
4893 : }
4894 0 : object->out.towers[towers_cntr_0] = *(struct epm_twr_p_t *)pytalloc_get_ptr(PyList_GET_ITEM(value, towers_cntr_0));
4895 : }
4896 : }
4897 0 : return 0;
4898 : }
4899 :
4900 0 : static PyObject *py_epm_Map_get_result(PyObject *obj, void *closure)
4901 : {
4902 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(obj);
4903 : PyObject *py_result;
4904 0 : py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result);
4905 0 : return py_result;
4906 : }
4907 :
4908 0 : static int py_epm_Map_set_result(PyObject *py_obj, PyObject *value, void *closure)
4909 : {
4910 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
4911 0 : if (value == NULL) {
4912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
4913 0 : return -1;
4914 : }
4915 : {
4916 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
4917 0 : if (PyLong_Check(value)) {
4918 : unsigned long long test_var;
4919 0 : test_var = PyLong_AsUnsignedLongLong(value);
4920 0 : if (PyErr_Occurred() != NULL) {
4921 0 : return -1;
4922 : }
4923 0 : if (test_var > uint_max) {
4924 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4925 : PyLong_Type.tp_name, uint_max, test_var);
4926 0 : return -1;
4927 : }
4928 0 : object->out.result = test_var;
4929 : } else {
4930 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4931 : PyLong_Type.tp_name);
4932 0 : return -1;
4933 : }
4934 : }
4935 0 : return 0;
4936 : }
4937 :
4938 : static PyGetSetDef py_epm_Map_getsetters[] = {
4939 : {
4940 : .name = discard_const_p(char, "in_object"),
4941 : .get = py_epm_Map_in_get_object,
4942 : .set = py_epm_Map_in_set_object,
4943 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
4944 : },
4945 : {
4946 : .name = discard_const_p(char, "in_map_tower"),
4947 : .get = py_epm_Map_in_get_map_tower,
4948 : .set = py_epm_Map_in_set_map_tower,
4949 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_t")
4950 : },
4951 : {
4952 : .name = discard_const_p(char, "in_entry_handle"),
4953 : .get = py_epm_Map_in_get_entry_handle,
4954 : .set = py_epm_Map_in_set_entry_handle,
4955 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
4956 : },
4957 : {
4958 : .name = discard_const_p(char, "out_entry_handle"),
4959 : .get = py_epm_Map_out_get_entry_handle,
4960 : .set = py_epm_Map_out_set_entry_handle,
4961 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
4962 : },
4963 : {
4964 : .name = discard_const_p(char, "in_max_towers"),
4965 : .get = py_epm_Map_in_get_max_towers,
4966 : .set = py_epm_Map_in_set_max_towers,
4967 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4968 : },
4969 : {
4970 : .name = discard_const_p(char, "out_num_towers"),
4971 : .get = py_epm_Map_out_get_num_towers,
4972 : .set = py_epm_Map_out_set_num_towers,
4973 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4974 : },
4975 : {
4976 : .name = discard_const_p(char, "out_towers"),
4977 : .get = py_epm_Map_out_get_towers,
4978 : .set = py_epm_Map_out_set_towers,
4979 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_p_t")
4980 : },
4981 : {
4982 : .name = discard_const_p(char, "result"),
4983 : .get = py_epm_Map_get_result,
4984 : .set = py_epm_Map_set_result,
4985 : .doc = discard_const_p(char, "PIDL-generated element of type uint32")
4986 : },
4987 : { .name = NULL }
4988 : };
4989 :
4990 48 : static PyObject *py_epm_Map_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4991 : {
4992 48 : PyObject *self = pytalloc_new(struct epm_Map, type);
4993 48 : struct epm_Map *_self = (struct epm_Map *)pytalloc_get_ptr(self);
4994 48 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
4995 48 : _self->in.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
4996 48 : _self->out.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
4997 48 : _self->out.num_towers = talloc_zero(mem_ctx, uint32_t);
4998 48 : return self;
4999 : }
5000 :
5001 48 : static PyObject *py_epm_Map_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5002 : {
5003 :
5004 :
5005 48 : return PyLong_FromLong(3);
5006 : }
5007 :
5008 48 : static PyObject *py_epm_Map_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
5009 : {
5010 48 : const struct ndr_interface_call *call = NULL;
5011 48 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
5012 48 : PyObject *ret = NULL;
5013 48 : struct ndr_push *push = NULL;
5014 : DATA_BLOB blob;
5015 : enum ndr_err_code err;
5016 :
5017 48 : if (ndr_table_epmapper.num_calls < 4) {
5018 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Map_ndr_pack");
5019 0 : return NULL;
5020 : }
5021 48 : call = &ndr_table_epmapper.calls[3];
5022 :
5023 48 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5024 48 : if (push == NULL) {
5025 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5026 0 : return NULL;
5027 : }
5028 :
5029 48 : push->flags |= ndr_push_flags;
5030 :
5031 48 : err = call->ndr_push(push, ndr_inout_flags, object);
5032 48 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5033 0 : TALLOC_FREE(push);
5034 0 : PyErr_SetNdrError(err);
5035 0 : return NULL;
5036 : }
5037 48 : blob = ndr_push_blob(push);
5038 48 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5039 48 : TALLOC_FREE(push);
5040 48 : return ret;
5041 : }
5042 :
5043 48 : static PyObject *py_epm_Map_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5044 : {
5045 48 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5046 48 : PyObject *bigendian_obj = NULL;
5047 48 : PyObject *ndr64_obj = NULL;
5048 48 : uint32_t ndr_push_flags = 0;
5049 :
5050 48 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5051 : discard_const_p(char *, kwnames),
5052 : &bigendian_obj,
5053 : &ndr64_obj)) {
5054 0 : return NULL;
5055 : }
5056 :
5057 48 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5058 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5059 : }
5060 48 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5061 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5062 : }
5063 :
5064 48 : return py_epm_Map_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
5065 : }
5066 :
5067 0 : static PyObject *py_epm_Map_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5068 : {
5069 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5070 0 : PyObject *bigendian_obj = NULL;
5071 0 : PyObject *ndr64_obj = NULL;
5072 0 : uint32_t ndr_push_flags = 0;
5073 :
5074 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
5075 : discard_const_p(char *, kwnames),
5076 : &bigendian_obj,
5077 : &ndr64_obj)) {
5078 0 : return NULL;
5079 : }
5080 :
5081 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5082 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5083 : }
5084 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5085 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5086 : }
5087 :
5088 0 : return py_epm_Map_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
5089 : }
5090 :
5091 48 : static PyObject *py_epm_Map_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
5092 : {
5093 48 : const struct ndr_interface_call *call = NULL;
5094 48 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
5095 48 : struct ndr_pull *pull = NULL;
5096 : enum ndr_err_code err;
5097 :
5098 48 : if (ndr_table_epmapper.num_calls < 4) {
5099 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Map_ndr_unpack");
5100 0 : return NULL;
5101 : }
5102 48 : call = &ndr_table_epmapper.calls[3];
5103 :
5104 48 : pull = ndr_pull_init_blob(blob, object);
5105 48 : if (pull == NULL) {
5106 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5107 0 : return NULL;
5108 : }
5109 :
5110 48 : pull->flags |= ndr_pull_flags;
5111 :
5112 48 : err = call->ndr_pull(pull, ndr_inout_flags, object);
5113 48 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5114 0 : TALLOC_FREE(pull);
5115 0 : PyErr_SetNdrError(err);
5116 0 : return NULL;
5117 : }
5118 48 : if (!allow_remaining) {
5119 : uint32_t highest_ofs;
5120 :
5121 48 : if (pull->offset > pull->relative_highest_offset) {
5122 48 : highest_ofs = pull->offset;
5123 : } else {
5124 0 : highest_ofs = pull->relative_highest_offset;
5125 : }
5126 48 : if (highest_ofs < pull->data_size) {
5127 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
5128 : "not all bytes consumed ofs[%u] size[%u]",
5129 : highest_ofs, pull->data_size);
5130 0 : TALLOC_FREE(pull);
5131 0 : PyErr_SetNdrError(err);
5132 0 : return NULL;
5133 : }
5134 : }
5135 :
5136 48 : TALLOC_FREE(pull);
5137 48 : Py_RETURN_NONE;
5138 : }
5139 :
5140 0 : static PyObject *py_epm_Map_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5141 : {
5142 : DATA_BLOB blob;
5143 0 : Py_ssize_t blob_length = 0;
5144 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5145 0 : PyObject *bigendian_obj = NULL;
5146 0 : PyObject *ndr64_obj = NULL;
5147 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5148 0 : PyObject *allow_remaining_obj = NULL;
5149 0 : bool allow_remaining = false;
5150 :
5151 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
5152 : discard_const_p(char *, kwnames),
5153 : &blob.data, &blob_length,
5154 : &bigendian_obj,
5155 : &ndr64_obj,
5156 : &allow_remaining_obj)) {
5157 0 : return NULL;
5158 : }
5159 0 : blob.length = blob_length;
5160 :
5161 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5162 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5163 : }
5164 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5165 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5166 : }
5167 :
5168 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5169 0 : allow_remaining = true;
5170 : }
5171 :
5172 0 : return py_epm_Map_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
5173 : }
5174 :
5175 48 : static PyObject *py_epm_Map_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5176 : {
5177 : DATA_BLOB blob;
5178 48 : Py_ssize_t blob_length = 0;
5179 48 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5180 48 : PyObject *bigendian_obj = NULL;
5181 48 : PyObject *ndr64_obj = NULL;
5182 48 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5183 48 : PyObject *allow_remaining_obj = NULL;
5184 48 : bool allow_remaining = false;
5185 :
5186 48 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
5187 : discard_const_p(char *, kwnames),
5188 : &blob.data, &blob_length,
5189 : &bigendian_obj,
5190 : &ndr64_obj,
5191 : &allow_remaining_obj)) {
5192 0 : return NULL;
5193 : }
5194 48 : blob.length = blob_length;
5195 :
5196 48 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5197 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5198 : }
5199 48 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5200 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5201 : }
5202 :
5203 48 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5204 0 : allow_remaining = true;
5205 : }
5206 :
5207 48 : return py_epm_Map_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
5208 : }
5209 :
5210 0 : static PyObject *py_epm_Map_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
5211 : {
5212 0 : const struct ndr_interface_call *call = NULL;
5213 0 : struct epm_Map *object = (struct epm_Map *)pytalloc_get_ptr(py_obj);
5214 : PyObject *ret;
5215 : char *retstr;
5216 :
5217 0 : if (ndr_table_epmapper.num_calls < 4) {
5218 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_Map_ndr_print");
5219 0 : return NULL;
5220 : }
5221 0 : call = &ndr_table_epmapper.calls[3];
5222 :
5223 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
5224 0 : ret = PyUnicode_FromString(retstr);
5225 0 : TALLOC_FREE(retstr);
5226 :
5227 0 : return ret;
5228 : }
5229 :
5230 0 : static PyObject *py_epm_Map_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5231 : {
5232 0 : return py_epm_Map_ndr_print(py_obj, "epm_Map_in", NDR_IN);
5233 : }
5234 :
5235 0 : static PyObject *py_epm_Map_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5236 : {
5237 0 : return py_epm_Map_ndr_print(py_obj, "epm_Map_out", NDR_OUT);
5238 : }
5239 :
5240 : static PyMethodDef py_epm_Map_methods[] = {
5241 : { "opnum", (PyCFunction)py_epm_Map_ndr_opnum, METH_NOARGS|METH_CLASS,
5242 : "epmapper.epm_Map.opnum() -> 3 (0x03) " },
5243 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Map_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
5244 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
5245 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Map_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
5246 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
5247 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Map_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
5248 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
5249 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_Map_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
5250 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
5251 : { "__ndr_print_in__", (PyCFunction)py_epm_Map_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
5252 : { "__ndr_print_out__", (PyCFunction)py_epm_Map_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
5253 : { NULL, NULL, 0, NULL }
5254 : };
5255 :
5256 :
5257 : static PyTypeObject epm_Map_Type = {
5258 : PyVarObject_HEAD_INIT(NULL, 0)
5259 : .tp_name = "epmapper.epm_Map",
5260 : .tp_getset = py_epm_Map_getsetters,
5261 : .tp_methods = py_epm_Map_methods,
5262 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5263 : .tp_new = py_epm_Map_new,
5264 : };
5265 :
5266 0 : static bool pack_py_epm_Map_args_in(PyObject *args, PyObject *kwargs, struct epm_Map *r)
5267 : {
5268 : PyObject *py_object;
5269 : PyObject *py_map_tower;
5270 : PyObject *py_entry_handle;
5271 : PyObject *py_max_towers;
5272 0 : const char *kwnames[] = {
5273 : "object", "map_tower", "entry_handle", "max_towers", NULL
5274 : };
5275 :
5276 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:epm_Map", discard_const_p(char *, kwnames), &py_object, &py_map_tower, &py_entry_handle, &py_max_towers)) {
5277 0 : return false;
5278 : }
5279 :
5280 0 : if (py_object == NULL) {
5281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.object");
5282 0 : return false;
5283 : }
5284 0 : if (py_object == Py_None) {
5285 0 : r->in.object = NULL;
5286 : } else {
5287 0 : r->in.object = NULL;
5288 0 : PY_CHECK_TYPE(GUID_Type, py_object, return false;);
5289 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
5290 0 : PyErr_NoMemory();
5291 0 : return false;
5292 : }
5293 0 : r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
5294 : }
5295 0 : if (py_map_tower == NULL) {
5296 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.map_tower");
5297 0 : return false;
5298 : }
5299 0 : if (py_map_tower == Py_None) {
5300 0 : r->in.map_tower = NULL;
5301 : } else {
5302 0 : r->in.map_tower = NULL;
5303 0 : PY_CHECK_TYPE(&epm_twr_t_Type, py_map_tower, return false;);
5304 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_map_tower)) == NULL) {
5305 0 : PyErr_NoMemory();
5306 0 : return false;
5307 : }
5308 0 : r->in.map_tower = (struct epm_twr_t *)pytalloc_get_ptr(py_map_tower);
5309 : }
5310 0 : if (py_entry_handle == NULL) {
5311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.entry_handle");
5312 0 : return false;
5313 : }
5314 0 : r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
5315 0 : if (r->in.entry_handle == NULL) {
5316 0 : PyErr_NoMemory();
5317 0 : return false;
5318 : }
5319 0 : PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
5320 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
5321 0 : PyErr_NoMemory();
5322 0 : return false;
5323 : }
5324 0 : r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
5325 0 : if (py_max_towers == NULL) {
5326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_towers");
5327 0 : return false;
5328 : }
5329 : {
5330 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_towers));
5331 0 : if (PyLong_Check(py_max_towers)) {
5332 : unsigned long long test_var;
5333 0 : test_var = PyLong_AsUnsignedLongLong(py_max_towers);
5334 0 : if (PyErr_Occurred() != NULL) {
5335 0 : return false;
5336 : }
5337 0 : if (test_var > uint_max) {
5338 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5339 : PyLong_Type.tp_name, uint_max, test_var);
5340 0 : return false;
5341 : }
5342 0 : r->in.max_towers = test_var;
5343 : } else {
5344 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5345 : PyLong_Type.tp_name);
5346 0 : return false;
5347 : }
5348 : }
5349 0 : return true;
5350 : }
5351 :
5352 0 : static PyObject *unpack_py_epm_Map_args_out(struct epm_Map *r)
5353 : {
5354 : PyObject *result;
5355 : PyObject *py_entry_handle;
5356 : PyObject *py_towers;
5357 0 : result = PyTuple_New(3);
5358 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
5359 0 : PyTuple_SetItem(result, 0, py_entry_handle);
5360 0 : py_towers = PyList_New(*r->out.num_towers);
5361 0 : if (py_towers == NULL) {
5362 0 : return NULL;
5363 : }
5364 : {
5365 : int towers_cntr_0;
5366 0 : for (towers_cntr_0 = 0; towers_cntr_0 < (*r->out.num_towers); towers_cntr_0++) {
5367 : PyObject *py_towers_0;
5368 0 : py_towers_0 = pytalloc_reference_ex(&epm_twr_p_t_Type, r->out.towers, &r->out.towers[towers_cntr_0]);
5369 0 : PyList_SetItem(py_towers, towers_cntr_0, py_towers_0);
5370 : }
5371 : }
5372 0 : PyTuple_SetItem(result, 1, py_towers);
5373 0 : PyTuple_SetItem(result, 2, PyLong_FromUnsignedLongLong((uint32_t)r->out.result));
5374 0 : return result;
5375 : }
5376 :
5377 :
5378 0 : static PyObject *py_epm_LookupHandleFree_in_get_entry_handle(PyObject *obj, void *closure)
5379 : {
5380 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(obj);
5381 : PyObject *py_entry_handle;
5382 0 : if (object->in.entry_handle == NULL) {
5383 0 : Py_RETURN_NONE;
5384 : }
5385 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->in.entry_handle, object->in.entry_handle);
5386 0 : return py_entry_handle;
5387 : }
5388 :
5389 0 : static int py_epm_LookupHandleFree_in_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
5390 : {
5391 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(py_obj);
5392 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.entry_handle));
5393 0 : if (value == NULL) {
5394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.entry_handle");
5395 0 : return -1;
5396 : }
5397 0 : object->in.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.entry_handle);
5398 0 : if (object->in.entry_handle == NULL) {
5399 0 : PyErr_NoMemory();
5400 0 : return -1;
5401 : }
5402 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
5403 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5404 0 : PyErr_NoMemory();
5405 0 : return -1;
5406 : }
5407 0 : object->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
5408 0 : return 0;
5409 : }
5410 :
5411 0 : static PyObject *py_epm_LookupHandleFree_out_get_entry_handle(PyObject *obj, void *closure)
5412 : {
5413 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(obj);
5414 : PyObject *py_entry_handle;
5415 0 : if (object->out.entry_handle == NULL) {
5416 0 : Py_RETURN_NONE;
5417 : }
5418 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, object->out.entry_handle, object->out.entry_handle);
5419 0 : return py_entry_handle;
5420 : }
5421 :
5422 0 : static int py_epm_LookupHandleFree_out_set_entry_handle(PyObject *py_obj, PyObject *value, void *closure)
5423 : {
5424 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(py_obj);
5425 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.entry_handle));
5426 0 : if (value == NULL) {
5427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.entry_handle");
5428 0 : return -1;
5429 : }
5430 0 : object->out.entry_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.entry_handle);
5431 0 : if (object->out.entry_handle == NULL) {
5432 0 : PyErr_NoMemory();
5433 0 : return -1;
5434 : }
5435 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
5436 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5437 0 : PyErr_NoMemory();
5438 0 : return -1;
5439 : }
5440 0 : object->out.entry_handle = (struct policy_handle *)pytalloc_get_ptr(value);
5441 0 : return 0;
5442 : }
5443 :
5444 0 : static PyObject *py_epm_LookupHandleFree_get_result(PyObject *obj, void *closure)
5445 : {
5446 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(obj);
5447 : PyObject *py_result;
5448 0 : py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result);
5449 0 : return py_result;
5450 : }
5451 :
5452 0 : static int py_epm_LookupHandleFree_set_result(PyObject *py_obj, PyObject *value, void *closure)
5453 : {
5454 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(py_obj);
5455 0 : if (value == NULL) {
5456 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
5457 0 : return -1;
5458 : }
5459 : {
5460 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
5461 0 : if (PyLong_Check(value)) {
5462 : unsigned long long test_var;
5463 0 : test_var = PyLong_AsUnsignedLongLong(value);
5464 0 : if (PyErr_Occurred() != NULL) {
5465 0 : return -1;
5466 : }
5467 0 : if (test_var > uint_max) {
5468 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5469 : PyLong_Type.tp_name, uint_max, test_var);
5470 0 : return -1;
5471 : }
5472 0 : object->out.result = test_var;
5473 : } else {
5474 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5475 : PyLong_Type.tp_name);
5476 0 : return -1;
5477 : }
5478 : }
5479 0 : return 0;
5480 : }
5481 :
5482 : static PyGetSetDef py_epm_LookupHandleFree_getsetters[] = {
5483 : {
5484 : .name = discard_const_p(char, "in_entry_handle"),
5485 : .get = py_epm_LookupHandleFree_in_get_entry_handle,
5486 : .set = py_epm_LookupHandleFree_in_set_entry_handle,
5487 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
5488 : },
5489 : {
5490 : .name = discard_const_p(char, "out_entry_handle"),
5491 : .get = py_epm_LookupHandleFree_out_get_entry_handle,
5492 : .set = py_epm_LookupHandleFree_out_set_entry_handle,
5493 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
5494 : },
5495 : {
5496 : .name = discard_const_p(char, "result"),
5497 : .get = py_epm_LookupHandleFree_get_result,
5498 : .set = py_epm_LookupHandleFree_set_result,
5499 : .doc = discard_const_p(char, "PIDL-generated element of type uint32")
5500 : },
5501 : { .name = NULL }
5502 : };
5503 :
5504 0 : static PyObject *py_epm_LookupHandleFree_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5505 : {
5506 0 : PyObject *self = pytalloc_new(struct epm_LookupHandleFree, type);
5507 0 : struct epm_LookupHandleFree *_self = (struct epm_LookupHandleFree *)pytalloc_get_ptr(self);
5508 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
5509 0 : _self->in.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
5510 0 : _self->out.entry_handle = talloc_zero(mem_ctx, struct policy_handle);
5511 0 : return self;
5512 : }
5513 :
5514 0 : static PyObject *py_epm_LookupHandleFree_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5515 : {
5516 :
5517 :
5518 0 : return PyLong_FromLong(4);
5519 : }
5520 :
5521 0 : static PyObject *py_epm_LookupHandleFree_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
5522 : {
5523 0 : const struct ndr_interface_call *call = NULL;
5524 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(py_obj);
5525 0 : PyObject *ret = NULL;
5526 0 : struct ndr_push *push = NULL;
5527 : DATA_BLOB blob;
5528 : enum ndr_err_code err;
5529 :
5530 0 : if (ndr_table_epmapper.num_calls < 5) {
5531 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_LookupHandleFree_ndr_pack");
5532 0 : return NULL;
5533 : }
5534 0 : call = &ndr_table_epmapper.calls[4];
5535 :
5536 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5537 0 : if (push == NULL) {
5538 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5539 0 : return NULL;
5540 : }
5541 :
5542 0 : push->flags |= ndr_push_flags;
5543 :
5544 0 : err = call->ndr_push(push, ndr_inout_flags, object);
5545 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5546 0 : TALLOC_FREE(push);
5547 0 : PyErr_SetNdrError(err);
5548 0 : return NULL;
5549 : }
5550 0 : blob = ndr_push_blob(push);
5551 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5552 0 : TALLOC_FREE(push);
5553 0 : return ret;
5554 : }
5555 :
5556 0 : static PyObject *py_epm_LookupHandleFree_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5557 : {
5558 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5559 0 : PyObject *bigendian_obj = NULL;
5560 0 : PyObject *ndr64_obj = NULL;
5561 0 : uint32_t ndr_push_flags = 0;
5562 :
5563 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5564 : discard_const_p(char *, kwnames),
5565 : &bigendian_obj,
5566 : &ndr64_obj)) {
5567 0 : return NULL;
5568 : }
5569 :
5570 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5571 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5572 : }
5573 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5574 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5575 : }
5576 :
5577 0 : return py_epm_LookupHandleFree_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
5578 : }
5579 :
5580 0 : static PyObject *py_epm_LookupHandleFree_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5581 : {
5582 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5583 0 : PyObject *bigendian_obj = NULL;
5584 0 : PyObject *ndr64_obj = NULL;
5585 0 : uint32_t ndr_push_flags = 0;
5586 :
5587 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
5588 : discard_const_p(char *, kwnames),
5589 : &bigendian_obj,
5590 : &ndr64_obj)) {
5591 0 : return NULL;
5592 : }
5593 :
5594 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5595 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5596 : }
5597 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5598 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5599 : }
5600 :
5601 0 : return py_epm_LookupHandleFree_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
5602 : }
5603 :
5604 0 : static PyObject *py_epm_LookupHandleFree_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
5605 : {
5606 0 : const struct ndr_interface_call *call = NULL;
5607 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(py_obj);
5608 0 : struct ndr_pull *pull = NULL;
5609 : enum ndr_err_code err;
5610 :
5611 0 : if (ndr_table_epmapper.num_calls < 5) {
5612 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_LookupHandleFree_ndr_unpack");
5613 0 : return NULL;
5614 : }
5615 0 : call = &ndr_table_epmapper.calls[4];
5616 :
5617 0 : pull = ndr_pull_init_blob(blob, object);
5618 0 : if (pull == NULL) {
5619 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5620 0 : return NULL;
5621 : }
5622 :
5623 0 : pull->flags |= ndr_pull_flags;
5624 :
5625 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
5626 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5627 0 : TALLOC_FREE(pull);
5628 0 : PyErr_SetNdrError(err);
5629 0 : return NULL;
5630 : }
5631 0 : if (!allow_remaining) {
5632 : uint32_t highest_ofs;
5633 :
5634 0 : if (pull->offset > pull->relative_highest_offset) {
5635 0 : highest_ofs = pull->offset;
5636 : } else {
5637 0 : highest_ofs = pull->relative_highest_offset;
5638 : }
5639 0 : if (highest_ofs < pull->data_size) {
5640 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
5641 : "not all bytes consumed ofs[%u] size[%u]",
5642 : highest_ofs, pull->data_size);
5643 0 : TALLOC_FREE(pull);
5644 0 : PyErr_SetNdrError(err);
5645 0 : return NULL;
5646 : }
5647 : }
5648 :
5649 0 : TALLOC_FREE(pull);
5650 0 : Py_RETURN_NONE;
5651 : }
5652 :
5653 0 : static PyObject *py_epm_LookupHandleFree_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5654 : {
5655 : DATA_BLOB blob;
5656 0 : Py_ssize_t blob_length = 0;
5657 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5658 0 : PyObject *bigendian_obj = NULL;
5659 0 : PyObject *ndr64_obj = NULL;
5660 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5661 0 : PyObject *allow_remaining_obj = NULL;
5662 0 : bool allow_remaining = false;
5663 :
5664 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
5665 : discard_const_p(char *, kwnames),
5666 : &blob.data, &blob_length,
5667 : &bigendian_obj,
5668 : &ndr64_obj,
5669 : &allow_remaining_obj)) {
5670 0 : return NULL;
5671 : }
5672 0 : blob.length = blob_length;
5673 :
5674 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5675 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5676 : }
5677 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5678 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5679 : }
5680 :
5681 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5682 0 : allow_remaining = true;
5683 : }
5684 :
5685 0 : return py_epm_LookupHandleFree_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
5686 : }
5687 :
5688 0 : static PyObject *py_epm_LookupHandleFree_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5689 : {
5690 : DATA_BLOB blob;
5691 0 : Py_ssize_t blob_length = 0;
5692 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
5693 0 : PyObject *bigendian_obj = NULL;
5694 0 : PyObject *ndr64_obj = NULL;
5695 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
5696 0 : PyObject *allow_remaining_obj = NULL;
5697 0 : bool allow_remaining = false;
5698 :
5699 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
5700 : discard_const_p(char *, kwnames),
5701 : &blob.data, &blob_length,
5702 : &bigendian_obj,
5703 : &ndr64_obj,
5704 : &allow_remaining_obj)) {
5705 0 : return NULL;
5706 : }
5707 0 : blob.length = blob_length;
5708 :
5709 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5710 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
5711 : }
5712 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5713 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
5714 : }
5715 :
5716 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5717 0 : allow_remaining = true;
5718 : }
5719 :
5720 0 : return py_epm_LookupHandleFree_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
5721 : }
5722 :
5723 0 : static PyObject *py_epm_LookupHandleFree_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
5724 : {
5725 0 : const struct ndr_interface_call *call = NULL;
5726 0 : struct epm_LookupHandleFree *object = (struct epm_LookupHandleFree *)pytalloc_get_ptr(py_obj);
5727 : PyObject *ret;
5728 : char *retstr;
5729 :
5730 0 : if (ndr_table_epmapper.num_calls < 5) {
5731 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_LookupHandleFree_ndr_print");
5732 0 : return NULL;
5733 : }
5734 0 : call = &ndr_table_epmapper.calls[4];
5735 :
5736 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
5737 0 : ret = PyUnicode_FromString(retstr);
5738 0 : TALLOC_FREE(retstr);
5739 :
5740 0 : return ret;
5741 : }
5742 :
5743 0 : static PyObject *py_epm_LookupHandleFree_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5744 : {
5745 0 : return py_epm_LookupHandleFree_ndr_print(py_obj, "epm_LookupHandleFree_in", NDR_IN);
5746 : }
5747 :
5748 0 : static PyObject *py_epm_LookupHandleFree_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5749 : {
5750 0 : return py_epm_LookupHandleFree_ndr_print(py_obj, "epm_LookupHandleFree_out", NDR_OUT);
5751 : }
5752 :
5753 : static PyMethodDef py_epm_LookupHandleFree_methods[] = {
5754 : { "opnum", (PyCFunction)py_epm_LookupHandleFree_ndr_opnum, METH_NOARGS|METH_CLASS,
5755 : "epmapper.epm_LookupHandleFree.opnum() -> 4 (0x04) " },
5756 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_LookupHandleFree_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
5757 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
5758 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_LookupHandleFree_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
5759 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
5760 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_LookupHandleFree_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
5761 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
5762 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_LookupHandleFree_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
5763 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
5764 : { "__ndr_print_in__", (PyCFunction)py_epm_LookupHandleFree_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
5765 : { "__ndr_print_out__", (PyCFunction)py_epm_LookupHandleFree_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
5766 : { NULL, NULL, 0, NULL }
5767 : };
5768 :
5769 :
5770 : static PyTypeObject epm_LookupHandleFree_Type = {
5771 : PyVarObject_HEAD_INIT(NULL, 0)
5772 : .tp_name = "epmapper.epm_LookupHandleFree",
5773 : .tp_getset = py_epm_LookupHandleFree_getsetters,
5774 : .tp_methods = py_epm_LookupHandleFree_methods,
5775 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5776 : .tp_new = py_epm_LookupHandleFree_new,
5777 : };
5778 :
5779 0 : static bool pack_py_epm_LookupHandleFree_args_in(PyObject *args, PyObject *kwargs, struct epm_LookupHandleFree *r)
5780 : {
5781 : PyObject *py_entry_handle;
5782 0 : const char *kwnames[] = {
5783 : "entry_handle", NULL
5784 : };
5785 :
5786 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_LookupHandleFree", discard_const_p(char *, kwnames), &py_entry_handle)) {
5787 0 : return false;
5788 : }
5789 :
5790 0 : if (py_entry_handle == NULL) {
5791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.entry_handle");
5792 0 : return false;
5793 : }
5794 0 : r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
5795 0 : if (r->in.entry_handle == NULL) {
5796 0 : PyErr_NoMemory();
5797 0 : return false;
5798 : }
5799 0 : PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
5800 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
5801 0 : PyErr_NoMemory();
5802 0 : return false;
5803 : }
5804 0 : r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
5805 0 : return true;
5806 : }
5807 :
5808 0 : static PyObject *unpack_py_epm_LookupHandleFree_args_out(struct epm_LookupHandleFree *r)
5809 : {
5810 : PyObject *result;
5811 : PyObject *py_entry_handle;
5812 0 : result = PyTuple_New(2);
5813 0 : py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
5814 0 : PyTuple_SetItem(result, 0, py_entry_handle);
5815 0 : PyTuple_SetItem(result, 1, PyLong_FromUnsignedLongLong((uint32_t)r->out.result));
5816 0 : return result;
5817 : }
5818 :
5819 :
5820 0 : static PyObject *py_epm_InqObject_in_get_epm_object(PyObject *obj, void *closure)
5821 : {
5822 0 : struct epm_InqObject *object = (struct epm_InqObject *)pytalloc_get_ptr(obj);
5823 : PyObject *py_epm_object;
5824 0 : if (object->in.epm_object == NULL) {
5825 0 : Py_RETURN_NONE;
5826 : }
5827 0 : py_epm_object = pytalloc_reference_ex(GUID_Type, object->in.epm_object, object->in.epm_object);
5828 0 : return py_epm_object;
5829 : }
5830 :
5831 0 : static int py_epm_InqObject_in_set_epm_object(PyObject *py_obj, PyObject *value, void *closure)
5832 : {
5833 0 : struct epm_InqObject *object = (struct epm_InqObject *)pytalloc_get_ptr(py_obj);
5834 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.epm_object));
5835 0 : if (value == NULL) {
5836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.epm_object");
5837 0 : return -1;
5838 : }
5839 0 : object->in.epm_object = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.epm_object);
5840 0 : if (object->in.epm_object == NULL) {
5841 0 : PyErr_NoMemory();
5842 0 : return -1;
5843 : }
5844 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
5845 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5846 0 : PyErr_NoMemory();
5847 0 : return -1;
5848 : }
5849 0 : object->in.epm_object = (struct GUID *)pytalloc_get_ptr(value);
5850 0 : return 0;
5851 : }
5852 :
5853 0 : static PyObject *py_epm_InqObject_get_result(PyObject *obj, void *closure)
5854 : {
5855 0 : struct epm_InqObject *object = (struct epm_InqObject *)pytalloc_get_ptr(obj);
5856 : PyObject *py_result;
5857 0 : py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result);
5858 0 : return py_result;
5859 : }
5860 :
5861 0 : static int py_epm_InqObject_set_result(PyObject *py_obj, PyObject *value, void *closure)
5862 : {
5863 0 : struct epm_InqObject *object = (struct epm_InqObject *)pytalloc_get_ptr(py_obj);
5864 0 : if (value == NULL) {
5865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
5866 0 : return -1;
5867 : }
5868 : {
5869 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
5870 0 : if (PyLong_Check(value)) {
5871 : unsigned long long test_var;
5872 0 : test_var = PyLong_AsUnsignedLongLong(value);
5873 0 : if (PyErr_Occurred() != NULL) {
5874 0 : return -1;
5875 : }
5876 0 : if (test_var > uint_max) {
5877 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5878 : PyLong_Type.tp_name, uint_max, test_var);
5879 0 : return -1;
5880 : }
5881 0 : object->out.result = test_var;
5882 : } else {
5883 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5884 : PyLong_Type.tp_name);
5885 0 : return -1;
5886 : }
5887 : }
5888 0 : return 0;
5889 : }
5890 :
5891 : static PyGetSetDef py_epm_InqObject_getsetters[] = {
5892 : {
5893 : .name = discard_const_p(char, "in_epm_object"),
5894 : .get = py_epm_InqObject_in_get_epm_object,
5895 : .set = py_epm_InqObject_in_set_epm_object,
5896 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
5897 : },
5898 : {
5899 : .name = discard_const_p(char, "result"),
5900 : .get = py_epm_InqObject_get_result,
5901 : .set = py_epm_InqObject_set_result,
5902 : .doc = discard_const_p(char, "PIDL-generated element of type uint32")
5903 : },
5904 : { .name = NULL }
5905 : };
5906 :
5907 0 : static PyObject *py_epm_InqObject_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5908 : {
5909 0 : PyObject *self = pytalloc_new(struct epm_InqObject, type);
5910 0 : struct epm_InqObject *_self = (struct epm_InqObject *)pytalloc_get_ptr(self);
5911 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
5912 0 : _self->in.epm_object = talloc_zero(mem_ctx, struct GUID);
5913 0 : return self;
5914 : }
5915 :
5916 0 : static PyObject *py_epm_InqObject_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
5917 : {
5918 :
5919 :
5920 0 : return PyLong_FromLong(5);
5921 : }
5922 :
5923 0 : static PyObject *py_epm_InqObject_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
5924 : {
5925 0 : const struct ndr_interface_call *call = NULL;
5926 0 : struct epm_InqObject *object = (struct epm_InqObject *)pytalloc_get_ptr(py_obj);
5927 0 : PyObject *ret = NULL;
5928 0 : struct ndr_push *push = NULL;
5929 : DATA_BLOB blob;
5930 : enum ndr_err_code err;
5931 :
5932 0 : if (ndr_table_epmapper.num_calls < 6) {
5933 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_InqObject_ndr_pack");
5934 0 : return NULL;
5935 : }
5936 0 : call = &ndr_table_epmapper.calls[5];
5937 :
5938 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
5939 0 : if (push == NULL) {
5940 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5941 0 : return NULL;
5942 : }
5943 :
5944 0 : push->flags |= ndr_push_flags;
5945 :
5946 0 : err = call->ndr_push(push, ndr_inout_flags, object);
5947 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5948 0 : TALLOC_FREE(push);
5949 0 : PyErr_SetNdrError(err);
5950 0 : return NULL;
5951 : }
5952 0 : blob = ndr_push_blob(push);
5953 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5954 0 : TALLOC_FREE(push);
5955 0 : return ret;
5956 : }
5957 :
5958 0 : static PyObject *py_epm_InqObject_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5959 : {
5960 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5961 0 : PyObject *bigendian_obj = NULL;
5962 0 : PyObject *ndr64_obj = NULL;
5963 0 : uint32_t ndr_push_flags = 0;
5964 :
5965 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
5966 : discard_const_p(char *, kwnames),
5967 : &bigendian_obj,
5968 : &ndr64_obj)) {
5969 0 : return NULL;
5970 : }
5971 :
5972 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5973 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5974 : }
5975 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
5976 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
5977 : }
5978 :
5979 0 : return py_epm_InqObject_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
5980 : }
5981 :
5982 0 : static PyObject *py_epm_InqObject_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5983 : {
5984 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
5985 0 : PyObject *bigendian_obj = NULL;
5986 0 : PyObject *ndr64_obj = NULL;
5987 0 : uint32_t ndr_push_flags = 0;
5988 :
5989 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
5990 : discard_const_p(char *, kwnames),
5991 : &bigendian_obj,
5992 : &ndr64_obj)) {
5993 0 : return NULL;
5994 : }
5995 :
5996 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
5997 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
5998 : }
5999 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6000 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6001 : }
6002 :
6003 0 : return py_epm_InqObject_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6004 : }
6005 :
6006 0 : static PyObject *py_epm_InqObject_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
6007 : {
6008 0 : const struct ndr_interface_call *call = NULL;
6009 0 : struct epm_InqObject *object = (struct epm_InqObject *)pytalloc_get_ptr(py_obj);
6010 0 : struct ndr_pull *pull = NULL;
6011 : enum ndr_err_code err;
6012 :
6013 0 : if (ndr_table_epmapper.num_calls < 6) {
6014 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_InqObject_ndr_unpack");
6015 0 : return NULL;
6016 : }
6017 0 : call = &ndr_table_epmapper.calls[5];
6018 :
6019 0 : pull = ndr_pull_init_blob(blob, object);
6020 0 : if (pull == NULL) {
6021 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6022 0 : return NULL;
6023 : }
6024 :
6025 0 : pull->flags |= ndr_pull_flags;
6026 :
6027 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6028 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6029 0 : TALLOC_FREE(pull);
6030 0 : PyErr_SetNdrError(err);
6031 0 : return NULL;
6032 : }
6033 0 : if (!allow_remaining) {
6034 : uint32_t highest_ofs;
6035 :
6036 0 : if (pull->offset > pull->relative_highest_offset) {
6037 0 : highest_ofs = pull->offset;
6038 : } else {
6039 0 : highest_ofs = pull->relative_highest_offset;
6040 : }
6041 0 : if (highest_ofs < pull->data_size) {
6042 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6043 : "not all bytes consumed ofs[%u] size[%u]",
6044 : highest_ofs, pull->data_size);
6045 0 : TALLOC_FREE(pull);
6046 0 : PyErr_SetNdrError(err);
6047 0 : return NULL;
6048 : }
6049 : }
6050 :
6051 0 : TALLOC_FREE(pull);
6052 0 : Py_RETURN_NONE;
6053 : }
6054 :
6055 0 : static PyObject *py_epm_InqObject_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6056 : {
6057 : DATA_BLOB blob;
6058 0 : Py_ssize_t blob_length = 0;
6059 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6060 0 : PyObject *bigendian_obj = NULL;
6061 0 : PyObject *ndr64_obj = NULL;
6062 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6063 0 : PyObject *allow_remaining_obj = NULL;
6064 0 : bool allow_remaining = false;
6065 :
6066 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6067 : discard_const_p(char *, kwnames),
6068 : &blob.data, &blob_length,
6069 : &bigendian_obj,
6070 : &ndr64_obj,
6071 : &allow_remaining_obj)) {
6072 0 : return NULL;
6073 : }
6074 0 : blob.length = blob_length;
6075 :
6076 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6077 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6078 : }
6079 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6080 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6081 : }
6082 :
6083 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6084 0 : allow_remaining = true;
6085 : }
6086 :
6087 0 : return py_epm_InqObject_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6088 : }
6089 :
6090 0 : static PyObject *py_epm_InqObject_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6091 : {
6092 : DATA_BLOB blob;
6093 0 : Py_ssize_t blob_length = 0;
6094 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6095 0 : PyObject *bigendian_obj = NULL;
6096 0 : PyObject *ndr64_obj = NULL;
6097 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6098 0 : PyObject *allow_remaining_obj = NULL;
6099 0 : bool allow_remaining = false;
6100 :
6101 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6102 : discard_const_p(char *, kwnames),
6103 : &blob.data, &blob_length,
6104 : &bigendian_obj,
6105 : &ndr64_obj,
6106 : &allow_remaining_obj)) {
6107 0 : return NULL;
6108 : }
6109 0 : blob.length = blob_length;
6110 :
6111 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6112 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6113 : }
6114 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6115 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6116 : }
6117 :
6118 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6119 0 : allow_remaining = true;
6120 : }
6121 :
6122 0 : return py_epm_InqObject_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6123 : }
6124 :
6125 0 : static PyObject *py_epm_InqObject_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
6126 : {
6127 0 : const struct ndr_interface_call *call = NULL;
6128 0 : struct epm_InqObject *object = (struct epm_InqObject *)pytalloc_get_ptr(py_obj);
6129 : PyObject *ret;
6130 : char *retstr;
6131 :
6132 0 : if (ndr_table_epmapper.num_calls < 6) {
6133 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_InqObject_ndr_print");
6134 0 : return NULL;
6135 : }
6136 0 : call = &ndr_table_epmapper.calls[5];
6137 :
6138 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6139 0 : ret = PyUnicode_FromString(retstr);
6140 0 : TALLOC_FREE(retstr);
6141 :
6142 0 : return ret;
6143 : }
6144 :
6145 0 : static PyObject *py_epm_InqObject_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6146 : {
6147 0 : return py_epm_InqObject_ndr_print(py_obj, "epm_InqObject_in", NDR_IN);
6148 : }
6149 :
6150 0 : static PyObject *py_epm_InqObject_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6151 : {
6152 0 : return py_epm_InqObject_ndr_print(py_obj, "epm_InqObject_out", NDR_OUT);
6153 : }
6154 :
6155 : static PyMethodDef py_epm_InqObject_methods[] = {
6156 : { "opnum", (PyCFunction)py_epm_InqObject_ndr_opnum, METH_NOARGS|METH_CLASS,
6157 : "epmapper.epm_InqObject.opnum() -> 5 (0x05) " },
6158 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_InqObject_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6159 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6160 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_InqObject_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6161 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6162 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_InqObject_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6163 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6164 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_InqObject_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6165 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6166 : { "__ndr_print_in__", (PyCFunction)py_epm_InqObject_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6167 : { "__ndr_print_out__", (PyCFunction)py_epm_InqObject_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6168 : { NULL, NULL, 0, NULL }
6169 : };
6170 :
6171 :
6172 : static PyTypeObject epm_InqObject_Type = {
6173 : PyVarObject_HEAD_INIT(NULL, 0)
6174 : .tp_name = "epmapper.epm_InqObject",
6175 : .tp_getset = py_epm_InqObject_getsetters,
6176 : .tp_methods = py_epm_InqObject_methods,
6177 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6178 : .tp_new = py_epm_InqObject_new,
6179 : };
6180 :
6181 0 : static bool pack_py_epm_InqObject_args_in(PyObject *args, PyObject *kwargs, struct epm_InqObject *r)
6182 : {
6183 : PyObject *py_epm_object;
6184 0 : const char *kwnames[] = {
6185 : "epm_object", NULL
6186 : };
6187 :
6188 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_InqObject", discard_const_p(char *, kwnames), &py_epm_object)) {
6189 0 : return false;
6190 : }
6191 :
6192 0 : if (py_epm_object == NULL) {
6193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.epm_object");
6194 0 : return false;
6195 : }
6196 0 : r->in.epm_object = talloc_ptrtype(r, r->in.epm_object);
6197 0 : if (r->in.epm_object == NULL) {
6198 0 : PyErr_NoMemory();
6199 0 : return false;
6200 : }
6201 0 : PY_CHECK_TYPE(GUID_Type, py_epm_object, return false;);
6202 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_epm_object)) == NULL) {
6203 0 : PyErr_NoMemory();
6204 0 : return false;
6205 : }
6206 0 : r->in.epm_object = (struct GUID *)pytalloc_get_ptr(py_epm_object);
6207 0 : return true;
6208 : }
6209 :
6210 0 : static PyObject *unpack_py_epm_InqObject_args_out(struct epm_InqObject *r)
6211 : {
6212 : PyObject *result;
6213 0 : result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result);
6214 0 : return result;
6215 : }
6216 :
6217 :
6218 0 : static PyObject *py_epm_MgmtDelete_in_get_object_speced(PyObject *obj, void *closure)
6219 : {
6220 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(obj);
6221 : PyObject *py_object_speced;
6222 0 : py_object_speced = PyLong_FromUnsignedLongLong((uint32_t)object->in.object_speced);
6223 0 : return py_object_speced;
6224 : }
6225 :
6226 0 : static int py_epm_MgmtDelete_in_set_object_speced(PyObject *py_obj, PyObject *value, void *closure)
6227 : {
6228 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(py_obj);
6229 0 : if (value == NULL) {
6230 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.object_speced");
6231 0 : return -1;
6232 : }
6233 : {
6234 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.object_speced));
6235 0 : if (PyLong_Check(value)) {
6236 : unsigned long long test_var;
6237 0 : test_var = PyLong_AsUnsignedLongLong(value);
6238 0 : if (PyErr_Occurred() != NULL) {
6239 0 : return -1;
6240 : }
6241 0 : if (test_var > uint_max) {
6242 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6243 : PyLong_Type.tp_name, uint_max, test_var);
6244 0 : return -1;
6245 : }
6246 0 : object->in.object_speced = test_var;
6247 : } else {
6248 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6249 : PyLong_Type.tp_name);
6250 0 : return -1;
6251 : }
6252 : }
6253 0 : return 0;
6254 : }
6255 :
6256 0 : static PyObject *py_epm_MgmtDelete_in_get_object(PyObject *obj, void *closure)
6257 : {
6258 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(obj);
6259 : PyObject *py_object;
6260 0 : if (object->in.object == NULL) {
6261 0 : Py_RETURN_NONE;
6262 : }
6263 0 : if (object->in.object == NULL) {
6264 0 : py_object = Py_None;
6265 0 : Py_INCREF(py_object);
6266 : } else {
6267 0 : py_object = pytalloc_reference_ex(GUID_Type, object->in.object, object->in.object);
6268 : }
6269 0 : return py_object;
6270 : }
6271 :
6272 0 : static int py_epm_MgmtDelete_in_set_object(PyObject *py_obj, PyObject *value, void *closure)
6273 : {
6274 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(py_obj);
6275 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.object));
6276 0 : if (value == NULL) {
6277 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.object");
6278 0 : return -1;
6279 : }
6280 0 : if (value == Py_None) {
6281 0 : object->in.object = NULL;
6282 : } else {
6283 0 : object->in.object = NULL;
6284 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
6285 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6286 0 : PyErr_NoMemory();
6287 0 : return -1;
6288 : }
6289 0 : object->in.object = (struct GUID *)pytalloc_get_ptr(value);
6290 : }
6291 0 : return 0;
6292 : }
6293 :
6294 0 : static PyObject *py_epm_MgmtDelete_in_get_tower(PyObject *obj, void *closure)
6295 : {
6296 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(obj);
6297 : PyObject *py_tower;
6298 0 : if (object->in.tower == NULL) {
6299 0 : Py_RETURN_NONE;
6300 : }
6301 0 : if (object->in.tower == NULL) {
6302 0 : py_tower = Py_None;
6303 0 : Py_INCREF(py_tower);
6304 : } else {
6305 0 : py_tower = pytalloc_reference_ex(&epm_twr_t_Type, object->in.tower, object->in.tower);
6306 : }
6307 0 : return py_tower;
6308 : }
6309 :
6310 0 : static int py_epm_MgmtDelete_in_set_tower(PyObject *py_obj, PyObject *value, void *closure)
6311 : {
6312 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(py_obj);
6313 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.tower));
6314 0 : if (value == NULL) {
6315 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.tower");
6316 0 : return -1;
6317 : }
6318 0 : if (value == Py_None) {
6319 0 : object->in.tower = NULL;
6320 : } else {
6321 0 : object->in.tower = NULL;
6322 0 : PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
6323 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6324 0 : PyErr_NoMemory();
6325 0 : return -1;
6326 : }
6327 0 : object->in.tower = (struct epm_twr_t *)pytalloc_get_ptr(value);
6328 : }
6329 0 : return 0;
6330 : }
6331 :
6332 0 : static PyObject *py_epm_MgmtDelete_get_result(PyObject *obj, void *closure)
6333 : {
6334 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(obj);
6335 : PyObject *py_result;
6336 0 : py_result = PyLong_FromUnsignedLongLong((uint32_t)object->out.result);
6337 0 : return py_result;
6338 : }
6339 :
6340 0 : static int py_epm_MgmtDelete_set_result(PyObject *py_obj, PyObject *value, void *closure)
6341 : {
6342 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(py_obj);
6343 0 : if (value == NULL) {
6344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
6345 0 : return -1;
6346 : }
6347 : {
6348 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->out.result));
6349 0 : if (PyLong_Check(value)) {
6350 : unsigned long long test_var;
6351 0 : test_var = PyLong_AsUnsignedLongLong(value);
6352 0 : if (PyErr_Occurred() != NULL) {
6353 0 : return -1;
6354 : }
6355 0 : if (test_var > uint_max) {
6356 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6357 : PyLong_Type.tp_name, uint_max, test_var);
6358 0 : return -1;
6359 : }
6360 0 : object->out.result = test_var;
6361 : } else {
6362 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6363 : PyLong_Type.tp_name);
6364 0 : return -1;
6365 : }
6366 : }
6367 0 : return 0;
6368 : }
6369 :
6370 : static PyGetSetDef py_epm_MgmtDelete_getsetters[] = {
6371 : {
6372 : .name = discard_const_p(char, "in_object_speced"),
6373 : .get = py_epm_MgmtDelete_in_get_object_speced,
6374 : .set = py_epm_MgmtDelete_in_set_object_speced,
6375 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6376 : },
6377 : {
6378 : .name = discard_const_p(char, "in_object"),
6379 : .get = py_epm_MgmtDelete_in_get_object,
6380 : .set = py_epm_MgmtDelete_in_set_object,
6381 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
6382 : },
6383 : {
6384 : .name = discard_const_p(char, "in_tower"),
6385 : .get = py_epm_MgmtDelete_in_get_tower,
6386 : .set = py_epm_MgmtDelete_in_set_tower,
6387 : .doc = discard_const_p(char, "PIDL-generated element of base type epm_twr_t")
6388 : },
6389 : {
6390 : .name = discard_const_p(char, "result"),
6391 : .get = py_epm_MgmtDelete_get_result,
6392 : .set = py_epm_MgmtDelete_set_result,
6393 : .doc = discard_const_p(char, "PIDL-generated element of type uint32")
6394 : },
6395 : { .name = NULL }
6396 : };
6397 :
6398 0 : static PyObject *py_epm_MgmtDelete_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6399 : {
6400 0 : PyObject *self = pytalloc_new(struct epm_MgmtDelete, type);
6401 0 : return self;
6402 : }
6403 :
6404 0 : static PyObject *py_epm_MgmtDelete_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
6405 : {
6406 :
6407 :
6408 0 : return PyLong_FromLong(6);
6409 : }
6410 :
6411 0 : static PyObject *py_epm_MgmtDelete_ndr_pack(PyObject *py_obj, int ndr_inout_flags, uint32_t ndr_push_flags)
6412 : {
6413 0 : const struct ndr_interface_call *call = NULL;
6414 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(py_obj);
6415 0 : PyObject *ret = NULL;
6416 0 : struct ndr_push *push = NULL;
6417 : DATA_BLOB blob;
6418 : enum ndr_err_code err;
6419 :
6420 0 : if (ndr_table_epmapper.num_calls < 7) {
6421 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_MgmtDelete_ndr_pack");
6422 0 : return NULL;
6423 : }
6424 0 : call = &ndr_table_epmapper.calls[6];
6425 :
6426 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
6427 0 : if (push == NULL) {
6428 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6429 0 : return NULL;
6430 : }
6431 :
6432 0 : push->flags |= ndr_push_flags;
6433 :
6434 0 : err = call->ndr_push(push, ndr_inout_flags, object);
6435 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6436 0 : TALLOC_FREE(push);
6437 0 : PyErr_SetNdrError(err);
6438 0 : return NULL;
6439 : }
6440 0 : blob = ndr_push_blob(push);
6441 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6442 0 : TALLOC_FREE(push);
6443 0 : return ret;
6444 : }
6445 :
6446 0 : static PyObject *py_epm_MgmtDelete_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6447 : {
6448 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6449 0 : PyObject *bigendian_obj = NULL;
6450 0 : PyObject *ndr64_obj = NULL;
6451 0 : uint32_t ndr_push_flags = 0;
6452 :
6453 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
6454 : discard_const_p(char *, kwnames),
6455 : &bigendian_obj,
6456 : &ndr64_obj)) {
6457 0 : return NULL;
6458 : }
6459 :
6460 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6461 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6462 : }
6463 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6464 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6465 : }
6466 :
6467 0 : return py_epm_MgmtDelete_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
6468 : }
6469 :
6470 0 : static PyObject *py_epm_MgmtDelete_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6471 : {
6472 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
6473 0 : PyObject *bigendian_obj = NULL;
6474 0 : PyObject *ndr64_obj = NULL;
6475 0 : uint32_t ndr_push_flags = 0;
6476 :
6477 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
6478 : discard_const_p(char *, kwnames),
6479 : &bigendian_obj,
6480 : &ndr64_obj)) {
6481 0 : return NULL;
6482 : }
6483 :
6484 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6485 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
6486 : }
6487 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6488 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
6489 : }
6490 :
6491 0 : return py_epm_MgmtDelete_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
6492 : }
6493 :
6494 0 : static PyObject *py_epm_MgmtDelete_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, int ndr_inout_flags, uint32_t ndr_pull_flags, bool allow_remaining)
6495 : {
6496 0 : const struct ndr_interface_call *call = NULL;
6497 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(py_obj);
6498 0 : struct ndr_pull *pull = NULL;
6499 : enum ndr_err_code err;
6500 :
6501 0 : if (ndr_table_epmapper.num_calls < 7) {
6502 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_MgmtDelete_ndr_unpack");
6503 0 : return NULL;
6504 : }
6505 0 : call = &ndr_table_epmapper.calls[6];
6506 :
6507 0 : pull = ndr_pull_init_blob(blob, object);
6508 0 : if (pull == NULL) {
6509 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6510 0 : return NULL;
6511 : }
6512 :
6513 0 : pull->flags |= ndr_pull_flags;
6514 :
6515 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
6516 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6517 0 : TALLOC_FREE(pull);
6518 0 : PyErr_SetNdrError(err);
6519 0 : return NULL;
6520 : }
6521 0 : if (!allow_remaining) {
6522 : uint32_t highest_ofs;
6523 :
6524 0 : if (pull->offset > pull->relative_highest_offset) {
6525 0 : highest_ofs = pull->offset;
6526 : } else {
6527 0 : highest_ofs = pull->relative_highest_offset;
6528 : }
6529 0 : if (highest_ofs < pull->data_size) {
6530 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
6531 : "not all bytes consumed ofs[%u] size[%u]",
6532 : highest_ofs, pull->data_size);
6533 0 : TALLOC_FREE(pull);
6534 0 : PyErr_SetNdrError(err);
6535 0 : return NULL;
6536 : }
6537 : }
6538 :
6539 0 : TALLOC_FREE(pull);
6540 0 : Py_RETURN_NONE;
6541 : }
6542 :
6543 0 : static PyObject *py_epm_MgmtDelete_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6544 : {
6545 : DATA_BLOB blob;
6546 0 : Py_ssize_t blob_length = 0;
6547 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6548 0 : PyObject *bigendian_obj = NULL;
6549 0 : PyObject *ndr64_obj = NULL;
6550 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6551 0 : PyObject *allow_remaining_obj = NULL;
6552 0 : bool allow_remaining = false;
6553 :
6554 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
6555 : discard_const_p(char *, kwnames),
6556 : &blob.data, &blob_length,
6557 : &bigendian_obj,
6558 : &ndr64_obj,
6559 : &allow_remaining_obj)) {
6560 0 : return NULL;
6561 : }
6562 0 : blob.length = blob_length;
6563 :
6564 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6565 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6566 : }
6567 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6568 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6569 : }
6570 :
6571 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6572 0 : allow_remaining = true;
6573 : }
6574 :
6575 0 : return py_epm_MgmtDelete_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
6576 : }
6577 :
6578 0 : static PyObject *py_epm_MgmtDelete_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6579 : {
6580 : DATA_BLOB blob;
6581 0 : Py_ssize_t blob_length = 0;
6582 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
6583 0 : PyObject *bigendian_obj = NULL;
6584 0 : PyObject *ndr64_obj = NULL;
6585 0 : uint32_t ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
6586 0 : PyObject *allow_remaining_obj = NULL;
6587 0 : bool allow_remaining = false;
6588 :
6589 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
6590 : discard_const_p(char *, kwnames),
6591 : &blob.data, &blob_length,
6592 : &bigendian_obj,
6593 : &ndr64_obj,
6594 : &allow_remaining_obj)) {
6595 0 : return NULL;
6596 : }
6597 0 : blob.length = blob_length;
6598 :
6599 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
6600 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
6601 : }
6602 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
6603 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
6604 : }
6605 :
6606 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6607 0 : allow_remaining = true;
6608 : }
6609 :
6610 0 : return py_epm_MgmtDelete_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
6611 : }
6612 :
6613 0 : static PyObject *py_epm_MgmtDelete_ndr_print(PyObject *py_obj, const char *name, int ndr_inout_flags)
6614 : {
6615 0 : const struct ndr_interface_call *call = NULL;
6616 0 : struct epm_MgmtDelete *object = (struct epm_MgmtDelete *)pytalloc_get_ptr(py_obj);
6617 : PyObject *ret;
6618 : char *retstr;
6619 :
6620 0 : if (ndr_table_epmapper.num_calls < 7) {
6621 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_epm_MgmtDelete_ndr_print");
6622 0 : return NULL;
6623 : }
6624 0 : call = &ndr_table_epmapper.calls[6];
6625 :
6626 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
6627 0 : ret = PyUnicode_FromString(retstr);
6628 0 : TALLOC_FREE(retstr);
6629 :
6630 0 : return ret;
6631 : }
6632 :
6633 0 : static PyObject *py_epm_MgmtDelete_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6634 : {
6635 0 : return py_epm_MgmtDelete_ndr_print(py_obj, "epm_MgmtDelete_in", NDR_IN);
6636 : }
6637 :
6638 0 : static PyObject *py_epm_MgmtDelete_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6639 : {
6640 0 : return py_epm_MgmtDelete_ndr_print(py_obj, "epm_MgmtDelete_out", NDR_OUT);
6641 : }
6642 :
6643 : static PyMethodDef py_epm_MgmtDelete_methods[] = {
6644 : { "opnum", (PyCFunction)py_epm_MgmtDelete_ndr_opnum, METH_NOARGS|METH_CLASS,
6645 : "epmapper.epm_MgmtDelete.opnum() -> 6 (0x06) " },
6646 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_MgmtDelete_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
6647 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
6648 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_MgmtDelete_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
6649 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
6650 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_MgmtDelete_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
6651 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
6652 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_epm_MgmtDelete_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
6653 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
6654 : { "__ndr_print_in__", (PyCFunction)py_epm_MgmtDelete_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
6655 : { "__ndr_print_out__", (PyCFunction)py_epm_MgmtDelete_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
6656 : { NULL, NULL, 0, NULL }
6657 : };
6658 :
6659 :
6660 : static PyTypeObject epm_MgmtDelete_Type = {
6661 : PyVarObject_HEAD_INIT(NULL, 0)
6662 : .tp_name = "epmapper.epm_MgmtDelete",
6663 : .tp_getset = py_epm_MgmtDelete_getsetters,
6664 : .tp_methods = py_epm_MgmtDelete_methods,
6665 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6666 : .tp_new = py_epm_MgmtDelete_new,
6667 : };
6668 :
6669 0 : static bool pack_py_epm_MgmtDelete_args_in(PyObject *args, PyObject *kwargs, struct epm_MgmtDelete *r)
6670 : {
6671 : PyObject *py_object_speced;
6672 : PyObject *py_object;
6673 : PyObject *py_tower;
6674 0 : const char *kwnames[] = {
6675 : "object_speced", "object", "tower", NULL
6676 : };
6677 :
6678 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:epm_MgmtDelete", discard_const_p(char *, kwnames), &py_object_speced, &py_object, &py_tower)) {
6679 0 : return false;
6680 : }
6681 :
6682 0 : if (py_object_speced == NULL) {
6683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.object_speced");
6684 0 : return false;
6685 : }
6686 : {
6687 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.object_speced));
6688 0 : if (PyLong_Check(py_object_speced)) {
6689 : unsigned long long test_var;
6690 0 : test_var = PyLong_AsUnsignedLongLong(py_object_speced);
6691 0 : if (PyErr_Occurred() != NULL) {
6692 0 : return false;
6693 : }
6694 0 : if (test_var > uint_max) {
6695 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6696 : PyLong_Type.tp_name, uint_max, test_var);
6697 0 : return false;
6698 : }
6699 0 : r->in.object_speced = test_var;
6700 : } else {
6701 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6702 : PyLong_Type.tp_name);
6703 0 : return false;
6704 : }
6705 : }
6706 0 : if (py_object == NULL) {
6707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.object");
6708 0 : return false;
6709 : }
6710 0 : if (py_object == Py_None) {
6711 0 : r->in.object = NULL;
6712 : } else {
6713 0 : r->in.object = NULL;
6714 0 : PY_CHECK_TYPE(GUID_Type, py_object, return false;);
6715 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
6716 0 : PyErr_NoMemory();
6717 0 : return false;
6718 : }
6719 0 : r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
6720 : }
6721 0 : if (py_tower == NULL) {
6722 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.tower");
6723 0 : return false;
6724 : }
6725 0 : if (py_tower == Py_None) {
6726 0 : r->in.tower = NULL;
6727 : } else {
6728 0 : r->in.tower = NULL;
6729 0 : PY_CHECK_TYPE(&epm_twr_t_Type, py_tower, return false;);
6730 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_tower)) == NULL) {
6731 0 : PyErr_NoMemory();
6732 0 : return false;
6733 : }
6734 0 : r->in.tower = (struct epm_twr_t *)pytalloc_get_ptr(py_tower);
6735 : }
6736 0 : return true;
6737 : }
6738 :
6739 0 : static PyObject *unpack_py_epm_MgmtDelete_args_out(struct epm_MgmtDelete *r)
6740 : {
6741 : PyObject *result;
6742 0 : result = PyLong_FromUnsignedLongLong((uint32_t)r->out.result);
6743 0 : return result;
6744 : }
6745 :
6746 : const struct PyNdrRpcMethodDef py_ndr_epmapper_methods[] = {
6747 : { "epm_Insert", "S.epm_Insert(entries, replace) -> result", (py_dcerpc_call_fn)dcerpc_epm_Insert_r, (py_data_pack_fn)pack_py_epm_Insert_args_in, (py_data_unpack_fn)unpack_py_epm_Insert_args_out, 0, &ndr_table_epmapper },
6748 : { "epm_Delete", "S.epm_Delete(entries) -> result", (py_dcerpc_call_fn)dcerpc_epm_Delete_r, (py_data_pack_fn)pack_py_epm_Delete_args_in, (py_data_unpack_fn)unpack_py_epm_Delete_args_out, 1, &ndr_table_epmapper },
6749 : { "epm_Lookup", "S.epm_Lookup(inquiry_type, object, interface_id, vers_option, entry_handle, max_ents) -> (entry_handle, entries, result)", (py_dcerpc_call_fn)dcerpc_epm_Lookup_r, (py_data_pack_fn)pack_py_epm_Lookup_args_in, (py_data_unpack_fn)unpack_py_epm_Lookup_args_out, 2, &ndr_table_epmapper },
6750 : { "epm_Map", "S.epm_Map(object, map_tower, entry_handle, max_towers) -> (entry_handle, towers, result)", (py_dcerpc_call_fn)dcerpc_epm_Map_r, (py_data_pack_fn)pack_py_epm_Map_args_in, (py_data_unpack_fn)unpack_py_epm_Map_args_out, 3, &ndr_table_epmapper },
6751 : { "epm_LookupHandleFree", "S.epm_LookupHandleFree(entry_handle) -> (entry_handle, result)", (py_dcerpc_call_fn)dcerpc_epm_LookupHandleFree_r, (py_data_pack_fn)pack_py_epm_LookupHandleFree_args_in, (py_data_unpack_fn)unpack_py_epm_LookupHandleFree_args_out, 4, &ndr_table_epmapper },
6752 : { "epm_InqObject", "S.epm_InqObject(epm_object) -> result", (py_dcerpc_call_fn)dcerpc_epm_InqObject_r, (py_data_pack_fn)pack_py_epm_InqObject_args_in, (py_data_unpack_fn)unpack_py_epm_InqObject_args_out, 5, &ndr_table_epmapper },
6753 : { "epm_MgmtDelete", "S.epm_MgmtDelete(object_speced, object, tower) -> result", (py_dcerpc_call_fn)dcerpc_epm_MgmtDelete_r, (py_data_pack_fn)pack_py_epm_MgmtDelete_args_in, (py_data_unpack_fn)unpack_py_epm_MgmtDelete_args_out, 6, &ndr_table_epmapper },
6754 : {0}
6755 : };
6756 :
6757 0 : static PyObject *interface_epmapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6758 : {
6759 0 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_epmapper);
6760 : }
6761 :
6762 : #define PY_DOC_EPMAPPER "EndPoint Mapper"
6763 : static PyTypeObject epmapper_InterfaceType = {
6764 : PyVarObject_HEAD_INIT(NULL, 0)
6765 : .tp_name = "epmapper.epmapper",
6766 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
6767 : .tp_doc = "epmapper(binding, lp_ctx=None, credentials=None) -> connection\n"
6768 : "\n"
6769 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
6770 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
6771 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_EPMAPPER,
6772 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6773 : .tp_new = interface_epmapper_new,
6774 : };
6775 :
6776 57 : static PyObject *syntax_epmapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6777 : {
6778 57 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_epmapper.syntax_id);
6779 : }
6780 :
6781 : #define PY_DOC_EPMAPPER_SYNTAX "EndPoint Mapper"
6782 : static PyTypeObject epmapper_SyntaxType = {
6783 : PyVarObject_HEAD_INIT(NULL, 0)
6784 : .tp_name = "epmapper.epmapper_abstract_syntax",
6785 : .tp_doc = "epmapper_abstract_syntax()\n"PY_DOC_EPMAPPER_SYNTAX,
6786 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6787 : .tp_new = syntax_epmapper_new,
6788 : };
6789 :
6790 : static PyMethodDef epmapper_methods[] = {
6791 : { NULL, NULL, 0, NULL }
6792 : };
6793 :
6794 : static struct PyModuleDef moduledef = {
6795 : PyModuleDef_HEAD_INIT,
6796 : .m_name = "epmapper",
6797 : .m_doc = "epmapper DCE/RPC",
6798 : .m_size = -1,
6799 : .m_methods = epmapper_methods,
6800 : };
6801 459 : MODULE_INIT_FUNC(epmapper)
6802 : {
6803 459 : PyObject *m = NULL;
6804 459 : PyObject *dep_samba_dcerpc_misc = NULL;
6805 459 : PyObject *dep_talloc = NULL;
6806 459 : PyObject *dep_samba_dcerpc_base = NULL;
6807 :
6808 459 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
6809 459 : if (dep_samba_dcerpc_misc == NULL)
6810 0 : goto out;
6811 :
6812 459 : dep_talloc = PyImport_ImportModule("talloc");
6813 459 : if (dep_talloc == NULL)
6814 0 : goto out;
6815 :
6816 459 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
6817 459 : if (dep_samba_dcerpc_base == NULL)
6818 0 : goto out;
6819 :
6820 459 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
6821 459 : if (BaseObject_Type == NULL)
6822 0 : goto out;
6823 :
6824 459 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
6825 459 : if (GUID_Type == NULL)
6826 0 : goto out;
6827 :
6828 459 : policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
6829 459 : if (policy_handle_Type == NULL)
6830 0 : goto out;
6831 :
6832 459 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
6833 459 : if (ClientConnection_Type == NULL)
6834 0 : goto out;
6835 :
6836 459 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
6837 459 : if (ndr_syntax_id_Type == NULL)
6838 0 : goto out;
6839 :
6840 459 : epm_rhs_dnet_nsp_Type.tp_base = BaseObject_Type;
6841 459 : epm_rhs_dnet_nsp_Type.tp_basicsize = pytalloc_BaseObject_size();
6842 :
6843 459 : epm_rhs_osi_tp4_Type.tp_base = BaseObject_Type;
6844 459 : epm_rhs_osi_tp4_Type.tp_basicsize = pytalloc_BaseObject_size();
6845 :
6846 459 : epm_rhs_osi_clns_Type.tp_base = BaseObject_Type;
6847 459 : epm_rhs_osi_clns_Type.tp_basicsize = pytalloc_BaseObject_size();
6848 :
6849 459 : epm_rhs_udp_Type.tp_base = BaseObject_Type;
6850 459 : epm_rhs_udp_Type.tp_basicsize = pytalloc_BaseObject_size();
6851 :
6852 459 : epm_rhs_tcp_Type.tp_base = BaseObject_Type;
6853 459 : epm_rhs_tcp_Type.tp_basicsize = pytalloc_BaseObject_size();
6854 :
6855 459 : epm_rhs_ip_Type.tp_base = BaseObject_Type;
6856 459 : epm_rhs_ip_Type.tp_basicsize = pytalloc_BaseObject_size();
6857 :
6858 459 : epm_rhs_ncadg_Type.tp_base = BaseObject_Type;
6859 459 : epm_rhs_ncadg_Type.tp_basicsize = pytalloc_BaseObject_size();
6860 :
6861 459 : epm_rhs_ncacn_Type.tp_base = BaseObject_Type;
6862 459 : epm_rhs_ncacn_Type.tp_basicsize = pytalloc_BaseObject_size();
6863 :
6864 459 : epm_rhs_uuid_Type.tp_base = BaseObject_Type;
6865 459 : epm_rhs_uuid_Type.tp_basicsize = pytalloc_BaseObject_size();
6866 :
6867 459 : epm_rhs_ipx_Type.tp_base = BaseObject_Type;
6868 459 : epm_rhs_ipx_Type.tp_basicsize = pytalloc_BaseObject_size();
6869 :
6870 459 : epm_rhs_smb_Type.tp_base = BaseObject_Type;
6871 459 : epm_rhs_smb_Type.tp_basicsize = pytalloc_BaseObject_size();
6872 :
6873 459 : epm_rhs_named_pipe_Type.tp_base = BaseObject_Type;
6874 459 : epm_rhs_named_pipe_Type.tp_basicsize = pytalloc_BaseObject_size();
6875 :
6876 459 : epm_rhs_netbios_Type.tp_base = BaseObject_Type;
6877 459 : epm_rhs_netbios_Type.tp_basicsize = pytalloc_BaseObject_size();
6878 :
6879 459 : epm_rhs_netbeui_Type.tp_base = BaseObject_Type;
6880 459 : epm_rhs_netbeui_Type.tp_basicsize = pytalloc_BaseObject_size();
6881 :
6882 459 : epm_rhs_spx_Type.tp_base = BaseObject_Type;
6883 459 : epm_rhs_spx_Type.tp_basicsize = pytalloc_BaseObject_size();
6884 :
6885 459 : epm_rhs_nb_ipx_Type.tp_base = BaseObject_Type;
6886 459 : epm_rhs_nb_ipx_Type.tp_basicsize = pytalloc_BaseObject_size();
6887 :
6888 459 : epm_rhs_http_Type.tp_base = BaseObject_Type;
6889 459 : epm_rhs_http_Type.tp_basicsize = pytalloc_BaseObject_size();
6890 :
6891 459 : epm_rhs_unix_ds_Type.tp_base = BaseObject_Type;
6892 459 : epm_rhs_unix_ds_Type.tp_basicsize = pytalloc_BaseObject_size();
6893 :
6894 459 : epm_rhs_null_Type.tp_base = BaseObject_Type;
6895 459 : epm_rhs_null_Type.tp_basicsize = pytalloc_BaseObject_size();
6896 :
6897 459 : epm_rhs_ncalrpc_Type.tp_base = BaseObject_Type;
6898 459 : epm_rhs_ncalrpc_Type.tp_basicsize = pytalloc_BaseObject_size();
6899 :
6900 459 : epm_rhs_appletalk_Type.tp_base = BaseObject_Type;
6901 459 : epm_rhs_appletalk_Type.tp_basicsize = pytalloc_BaseObject_size();
6902 :
6903 459 : epm_rhs_atalk_stream_Type.tp_base = BaseObject_Type;
6904 459 : epm_rhs_atalk_stream_Type.tp_basicsize = pytalloc_BaseObject_size();
6905 :
6906 459 : epm_rhs_atalk_datagram_Type.tp_base = BaseObject_Type;
6907 459 : epm_rhs_atalk_datagram_Type.tp_basicsize = pytalloc_BaseObject_size();
6908 :
6909 459 : epm_rhs_vines_spp_Type.tp_base = BaseObject_Type;
6910 459 : epm_rhs_vines_spp_Type.tp_basicsize = pytalloc_BaseObject_size();
6911 :
6912 459 : epm_rhs_vines_ipc_Type.tp_base = BaseObject_Type;
6913 459 : epm_rhs_vines_ipc_Type.tp_basicsize = pytalloc_BaseObject_size();
6914 :
6915 459 : epm_rhs_streettalk_Type.tp_base = BaseObject_Type;
6916 459 : epm_rhs_streettalk_Type.tp_basicsize = pytalloc_BaseObject_size();
6917 :
6918 459 : epm_rhs_Type.tp_base = BaseObject_Type;
6919 459 : epm_rhs_Type.tp_basicsize = pytalloc_BaseObject_size();
6920 :
6921 459 : epm_lhs_Type.tp_base = BaseObject_Type;
6922 459 : epm_lhs_Type.tp_basicsize = pytalloc_BaseObject_size();
6923 :
6924 459 : epm_floor_Type.tp_base = BaseObject_Type;
6925 459 : epm_floor_Type.tp_basicsize = pytalloc_BaseObject_size();
6926 :
6927 459 : epm_tower_Type.tp_base = BaseObject_Type;
6928 459 : epm_tower_Type.tp_basicsize = pytalloc_BaseObject_size();
6929 :
6930 459 : epm_twr_t_Type.tp_base = BaseObject_Type;
6931 459 : epm_twr_t_Type.tp_basicsize = pytalloc_BaseObject_size();
6932 :
6933 459 : epm_entry_t_Type.tp_base = BaseObject_Type;
6934 459 : epm_entry_t_Type.tp_basicsize = pytalloc_BaseObject_size();
6935 :
6936 459 : rpc_if_id_t_Type.tp_base = BaseObject_Type;
6937 459 : rpc_if_id_t_Type.tp_basicsize = pytalloc_BaseObject_size();
6938 :
6939 459 : epm_twr_p_t_Type.tp_base = BaseObject_Type;
6940 459 : epm_twr_p_t_Type.tp_basicsize = pytalloc_BaseObject_size();
6941 :
6942 459 : epm_Insert_Type.tp_base = BaseObject_Type;
6943 459 : epm_Insert_Type.tp_basicsize = pytalloc_BaseObject_size();
6944 :
6945 459 : epm_Delete_Type.tp_base = BaseObject_Type;
6946 459 : epm_Delete_Type.tp_basicsize = pytalloc_BaseObject_size();
6947 :
6948 459 : epm_Lookup_Type.tp_base = BaseObject_Type;
6949 459 : epm_Lookup_Type.tp_basicsize = pytalloc_BaseObject_size();
6950 :
6951 459 : epm_Map_Type.tp_base = BaseObject_Type;
6952 459 : epm_Map_Type.tp_basicsize = pytalloc_BaseObject_size();
6953 :
6954 459 : epm_LookupHandleFree_Type.tp_base = BaseObject_Type;
6955 459 : epm_LookupHandleFree_Type.tp_basicsize = pytalloc_BaseObject_size();
6956 :
6957 459 : epm_InqObject_Type.tp_base = BaseObject_Type;
6958 459 : epm_InqObject_Type.tp_basicsize = pytalloc_BaseObject_size();
6959 :
6960 459 : epm_MgmtDelete_Type.tp_base = BaseObject_Type;
6961 459 : epm_MgmtDelete_Type.tp_basicsize = pytalloc_BaseObject_size();
6962 :
6963 459 : epmapper_InterfaceType.tp_base = ClientConnection_Type;
6964 :
6965 459 : epmapper_SyntaxType.tp_base = ndr_syntax_id_Type;
6966 459 : epmapper_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
6967 :
6968 459 : if (PyType_Ready(&epm_rhs_dnet_nsp_Type) < 0)
6969 0 : goto out;
6970 459 : if (PyType_Ready(&epm_rhs_osi_tp4_Type) < 0)
6971 0 : goto out;
6972 459 : if (PyType_Ready(&epm_rhs_osi_clns_Type) < 0)
6973 0 : goto out;
6974 459 : if (PyType_Ready(&epm_rhs_udp_Type) < 0)
6975 0 : goto out;
6976 459 : if (PyType_Ready(&epm_rhs_tcp_Type) < 0)
6977 0 : goto out;
6978 459 : if (PyType_Ready(&epm_rhs_ip_Type) < 0)
6979 0 : goto out;
6980 459 : if (PyType_Ready(&epm_rhs_ncadg_Type) < 0)
6981 0 : goto out;
6982 459 : if (PyType_Ready(&epm_rhs_ncacn_Type) < 0)
6983 0 : goto out;
6984 459 : if (PyType_Ready(&epm_rhs_uuid_Type) < 0)
6985 0 : goto out;
6986 459 : if (PyType_Ready(&epm_rhs_ipx_Type) < 0)
6987 0 : goto out;
6988 459 : if (PyType_Ready(&epm_rhs_smb_Type) < 0)
6989 0 : goto out;
6990 459 : if (PyType_Ready(&epm_rhs_named_pipe_Type) < 0)
6991 0 : goto out;
6992 459 : if (PyType_Ready(&epm_rhs_netbios_Type) < 0)
6993 0 : goto out;
6994 459 : if (PyType_Ready(&epm_rhs_netbeui_Type) < 0)
6995 0 : goto out;
6996 459 : if (PyType_Ready(&epm_rhs_spx_Type) < 0)
6997 0 : goto out;
6998 459 : if (PyType_Ready(&epm_rhs_nb_ipx_Type) < 0)
6999 0 : goto out;
7000 459 : if (PyType_Ready(&epm_rhs_http_Type) < 0)
7001 0 : goto out;
7002 459 : if (PyType_Ready(&epm_rhs_unix_ds_Type) < 0)
7003 0 : goto out;
7004 459 : if (PyType_Ready(&epm_rhs_null_Type) < 0)
7005 0 : goto out;
7006 459 : if (PyType_Ready(&epm_rhs_ncalrpc_Type) < 0)
7007 0 : goto out;
7008 459 : if (PyType_Ready(&epm_rhs_appletalk_Type) < 0)
7009 0 : goto out;
7010 459 : if (PyType_Ready(&epm_rhs_atalk_stream_Type) < 0)
7011 0 : goto out;
7012 459 : if (PyType_Ready(&epm_rhs_atalk_datagram_Type) < 0)
7013 0 : goto out;
7014 459 : if (PyType_Ready(&epm_rhs_vines_spp_Type) < 0)
7015 0 : goto out;
7016 459 : if (PyType_Ready(&epm_rhs_vines_ipc_Type) < 0)
7017 0 : goto out;
7018 459 : if (PyType_Ready(&epm_rhs_streettalk_Type) < 0)
7019 0 : goto out;
7020 459 : if (PyType_Ready(&epm_rhs_Type) < 0)
7021 0 : goto out;
7022 459 : if (PyType_Ready(&epm_lhs_Type) < 0)
7023 0 : goto out;
7024 459 : if (PyType_Ready(&epm_floor_Type) < 0)
7025 0 : goto out;
7026 459 : if (PyType_Ready(&epm_tower_Type) < 0)
7027 0 : goto out;
7028 459 : if (PyType_Ready(&epm_twr_t_Type) < 0)
7029 0 : goto out;
7030 459 : if (PyType_Ready(&epm_entry_t_Type) < 0)
7031 0 : goto out;
7032 459 : if (PyType_Ready(&rpc_if_id_t_Type) < 0)
7033 0 : goto out;
7034 459 : if (PyType_Ready(&epm_twr_p_t_Type) < 0)
7035 0 : goto out;
7036 459 : if (PyType_Ready(&epm_Insert_Type) < 0)
7037 0 : goto out;
7038 459 : if (PyType_Ready(&epm_Delete_Type) < 0)
7039 0 : goto out;
7040 459 : if (PyType_Ready(&epm_Lookup_Type) < 0)
7041 0 : goto out;
7042 459 : if (PyType_Ready(&epm_Map_Type) < 0)
7043 0 : goto out;
7044 459 : if (PyType_Ready(&epm_LookupHandleFree_Type) < 0)
7045 0 : goto out;
7046 459 : if (PyType_Ready(&epm_InqObject_Type) < 0)
7047 0 : goto out;
7048 459 : if (PyType_Ready(&epm_MgmtDelete_Type) < 0)
7049 0 : goto out;
7050 459 : if (PyType_Ready(&epmapper_InterfaceType) < 0)
7051 0 : goto out;
7052 459 : if (PyType_Ready(&epmapper_SyntaxType) < 0)
7053 0 : goto out;
7054 459 : if (!PyInterface_AddNdrRpcMethods(&epmapper_InterfaceType, py_ndr_epmapper_methods))
7055 0 : return NULL;
7056 :
7057 : #ifdef PY_EPM_RHS_DNET_NSP_PATCH
7058 : PY_EPM_RHS_DNET_NSP_PATCH(&epm_rhs_dnet_nsp_Type);
7059 : #endif
7060 : #ifdef PY_EPM_RHS_OSI_TP4_PATCH
7061 : PY_EPM_RHS_OSI_TP4_PATCH(&epm_rhs_osi_tp4_Type);
7062 : #endif
7063 : #ifdef PY_EPM_RHS_OSI_CLNS_PATCH
7064 : PY_EPM_RHS_OSI_CLNS_PATCH(&epm_rhs_osi_clns_Type);
7065 : #endif
7066 : #ifdef PY_EPM_RHS_UDP_PATCH
7067 : PY_EPM_RHS_UDP_PATCH(&epm_rhs_udp_Type);
7068 : #endif
7069 : #ifdef PY_EPM_RHS_TCP_PATCH
7070 : PY_EPM_RHS_TCP_PATCH(&epm_rhs_tcp_Type);
7071 : #endif
7072 : #ifdef PY_EPM_RHS_IP_PATCH
7073 : PY_EPM_RHS_IP_PATCH(&epm_rhs_ip_Type);
7074 : #endif
7075 : #ifdef PY_EPM_RHS_NCADG_PATCH
7076 : PY_EPM_RHS_NCADG_PATCH(&epm_rhs_ncadg_Type);
7077 : #endif
7078 : #ifdef PY_EPM_RHS_NCACN_PATCH
7079 : PY_EPM_RHS_NCACN_PATCH(&epm_rhs_ncacn_Type);
7080 : #endif
7081 : #ifdef PY_EPM_RHS_UUID_PATCH
7082 : PY_EPM_RHS_UUID_PATCH(&epm_rhs_uuid_Type);
7083 : #endif
7084 : #ifdef PY_EPM_RHS_IPX_PATCH
7085 : PY_EPM_RHS_IPX_PATCH(&epm_rhs_ipx_Type);
7086 : #endif
7087 : #ifdef PY_EPM_RHS_SMB_PATCH
7088 : PY_EPM_RHS_SMB_PATCH(&epm_rhs_smb_Type);
7089 : #endif
7090 : #ifdef PY_EPM_RHS_NAMED_PIPE_PATCH
7091 : PY_EPM_RHS_NAMED_PIPE_PATCH(&epm_rhs_named_pipe_Type);
7092 : #endif
7093 : #ifdef PY_EPM_RHS_NETBIOS_PATCH
7094 : PY_EPM_RHS_NETBIOS_PATCH(&epm_rhs_netbios_Type);
7095 : #endif
7096 : #ifdef PY_EPM_RHS_NETBEUI_PATCH
7097 : PY_EPM_RHS_NETBEUI_PATCH(&epm_rhs_netbeui_Type);
7098 : #endif
7099 : #ifdef PY_EPM_RHS_SPX_PATCH
7100 : PY_EPM_RHS_SPX_PATCH(&epm_rhs_spx_Type);
7101 : #endif
7102 : #ifdef PY_EPM_RHS_NB_IPX_PATCH
7103 : PY_EPM_RHS_NB_IPX_PATCH(&epm_rhs_nb_ipx_Type);
7104 : #endif
7105 : #ifdef PY_EPM_RHS_HTTP_PATCH
7106 : PY_EPM_RHS_HTTP_PATCH(&epm_rhs_http_Type);
7107 : #endif
7108 : #ifdef PY_EPM_RHS_UNIX_DS_PATCH
7109 : PY_EPM_RHS_UNIX_DS_PATCH(&epm_rhs_unix_ds_Type);
7110 : #endif
7111 : #ifdef PY_EPM_RHS_NULL_PATCH
7112 : PY_EPM_RHS_NULL_PATCH(&epm_rhs_null_Type);
7113 : #endif
7114 : #ifdef PY_EPM_RHS_NCALRPC_PATCH
7115 : PY_EPM_RHS_NCALRPC_PATCH(&epm_rhs_ncalrpc_Type);
7116 : #endif
7117 : #ifdef PY_EPM_RHS_APPLETALK_PATCH
7118 : PY_EPM_RHS_APPLETALK_PATCH(&epm_rhs_appletalk_Type);
7119 : #endif
7120 : #ifdef PY_EPM_RHS_ATALK_STREAM_PATCH
7121 : PY_EPM_RHS_ATALK_STREAM_PATCH(&epm_rhs_atalk_stream_Type);
7122 : #endif
7123 : #ifdef PY_EPM_RHS_ATALK_DATAGRAM_PATCH
7124 : PY_EPM_RHS_ATALK_DATAGRAM_PATCH(&epm_rhs_atalk_datagram_Type);
7125 : #endif
7126 : #ifdef PY_EPM_RHS_VINES_SPP_PATCH
7127 : PY_EPM_RHS_VINES_SPP_PATCH(&epm_rhs_vines_spp_Type);
7128 : #endif
7129 : #ifdef PY_EPM_RHS_VINES_IPC_PATCH
7130 : PY_EPM_RHS_VINES_IPC_PATCH(&epm_rhs_vines_ipc_Type);
7131 : #endif
7132 : #ifdef PY_EPM_RHS_STREETTALK_PATCH
7133 : PY_EPM_RHS_STREETTALK_PATCH(&epm_rhs_streettalk_Type);
7134 : #endif
7135 : #ifdef PY_EPM_RHS_PATCH
7136 : PY_EPM_RHS_PATCH(&epm_rhs_Type);
7137 : #endif
7138 : #ifdef PY_EPM_LHS_PATCH
7139 : PY_EPM_LHS_PATCH(&epm_lhs_Type);
7140 : #endif
7141 : #ifdef PY_EPM_FLOOR_PATCH
7142 : PY_EPM_FLOOR_PATCH(&epm_floor_Type);
7143 : #endif
7144 : #ifdef PY_EPM_TOWER_PATCH
7145 : PY_EPM_TOWER_PATCH(&epm_tower_Type);
7146 : #endif
7147 : #ifdef PY_EPM_TWR_T_PATCH
7148 : PY_EPM_TWR_T_PATCH(&epm_twr_t_Type);
7149 : #endif
7150 : #ifdef PY_EPM_ENTRY_T_PATCH
7151 : PY_EPM_ENTRY_T_PATCH(&epm_entry_t_Type);
7152 : #endif
7153 : #ifdef PY_RPC_IF_ID_T_PATCH
7154 : PY_RPC_IF_ID_T_PATCH(&rpc_if_id_t_Type);
7155 : #endif
7156 : #ifdef PY_EPM_TWR_P_T_PATCH
7157 : PY_EPM_TWR_P_T_PATCH(&epm_twr_p_t_Type);
7158 : #endif
7159 : #ifdef PY_EPM_INSERT_PATCH
7160 : PY_EPM_INSERT_PATCH(&epm_Insert_Type);
7161 : #endif
7162 : #ifdef PY_EPM_DELETE_PATCH
7163 : PY_EPM_DELETE_PATCH(&epm_Delete_Type);
7164 : #endif
7165 : #ifdef PY_EPM_LOOKUP_PATCH
7166 : PY_EPM_LOOKUP_PATCH(&epm_Lookup_Type);
7167 : #endif
7168 : #ifdef PY_EPM_MAP_PATCH
7169 : PY_EPM_MAP_PATCH(&epm_Map_Type);
7170 : #endif
7171 : #ifdef PY_EPM_LOOKUPHANDLEFREE_PATCH
7172 : PY_EPM_LOOKUPHANDLEFREE_PATCH(&epm_LookupHandleFree_Type);
7173 : #endif
7174 : #ifdef PY_EPM_INQOBJECT_PATCH
7175 : PY_EPM_INQOBJECT_PATCH(&epm_InqObject_Type);
7176 : #endif
7177 : #ifdef PY_EPM_MGMTDELETE_PATCH
7178 : PY_EPM_MGMTDELETE_PATCH(&epm_MgmtDelete_Type);
7179 : #endif
7180 : #ifdef PY_EPMAPPER_PATCH
7181 : PY_EPMAPPER_PATCH(&epmapper_InterfaceType);
7182 : #endif
7183 : #ifdef PY_EPMAPPER_ABSTRACT_SYNTAX_PATCH
7184 : PY_EPMAPPER_ABSTRACT_SYNTAX_PATCH(&epmapper_SyntaxType);
7185 : #endif
7186 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
7187 : PY_ABSTRACT_SYNTAX_PATCH(&epmapper_SyntaxType);
7188 : #endif
7189 :
7190 459 : m = PyModule_Create(&moduledef);
7191 459 : if (m == NULL)
7192 0 : goto out;
7193 :
7194 459 : PyModule_AddObject(m, "EPMAPPER_STATUS_CANT_PERFORM_OP", PyLong_FromUnsignedLongLong(0x6d8));
7195 459 : PyModule_AddObject(m, "EPMAPPER_STATUS_NO_MORE_ENTRIES", PyLong_FromUnsignedLongLong(0x16c9a0d6));
7196 459 : PyModule_AddObject(m, "EPMAPPER_STATUS_NO_MEMORY", PyLong_FromUnsignedLongLong(0x16C9A012));
7197 459 : PyModule_AddObject(m, "EPMAPPER_STATUS_OK", PyLong_FromUnsignedLongLong(0));
7198 459 : PyModule_AddObject(m, "EPM_PROTOCOL_DNET_NSP", PyLong_FromLong((uint16_t)EPM_PROTOCOL_DNET_NSP));
7199 459 : PyModule_AddObject(m, "EPM_PROTOCOL_OSI_TP4", PyLong_FromLong((uint16_t)EPM_PROTOCOL_OSI_TP4));
7200 459 : PyModule_AddObject(m, "EPM_PROTOCOL_OSI_CLNS", PyLong_FromLong((uint16_t)EPM_PROTOCOL_OSI_CLNS));
7201 459 : PyModule_AddObject(m, "EPM_PROTOCOL_TCP", PyLong_FromLong((uint16_t)EPM_PROTOCOL_TCP));
7202 459 : PyModule_AddObject(m, "EPM_PROTOCOL_UDP", PyLong_FromLong((uint16_t)EPM_PROTOCOL_UDP));
7203 459 : PyModule_AddObject(m, "EPM_PROTOCOL_IP", PyLong_FromLong((uint16_t)EPM_PROTOCOL_IP));
7204 459 : PyModule_AddObject(m, "EPM_PROTOCOL_NCADG", PyLong_FromLong((uint16_t)EPM_PROTOCOL_NCADG));
7205 459 : PyModule_AddObject(m, "EPM_PROTOCOL_NCACN", PyLong_FromLong((uint16_t)EPM_PROTOCOL_NCACN));
7206 459 : PyModule_AddObject(m, "EPM_PROTOCOL_NCALRPC", PyLong_FromLong((uint16_t)EPM_PROTOCOL_NCALRPC));
7207 459 : PyModule_AddObject(m, "EPM_PROTOCOL_UUID", PyLong_FromLong((uint16_t)EPM_PROTOCOL_UUID));
7208 459 : PyModule_AddObject(m, "EPM_PROTOCOL_IPX", PyLong_FromLong((uint16_t)EPM_PROTOCOL_IPX));
7209 459 : PyModule_AddObject(m, "EPM_PROTOCOL_SMB", PyLong_FromLong((uint16_t)EPM_PROTOCOL_SMB));
7210 459 : PyModule_AddObject(m, "EPM_PROTOCOL_NAMED_PIPE", PyLong_FromLong((uint16_t)EPM_PROTOCOL_NAMED_PIPE));
7211 459 : PyModule_AddObject(m, "EPM_PROTOCOL_NETBIOS", PyLong_FromLong((uint16_t)EPM_PROTOCOL_NETBIOS));
7212 459 : PyModule_AddObject(m, "EPM_PROTOCOL_NETBEUI", PyLong_FromLong((uint16_t)EPM_PROTOCOL_NETBEUI));
7213 459 : PyModule_AddObject(m, "EPM_PROTOCOL_SPX", PyLong_FromLong((uint16_t)EPM_PROTOCOL_SPX));
7214 459 : PyModule_AddObject(m, "EPM_PROTOCOL_NB_IPX", PyLong_FromLong((uint16_t)EPM_PROTOCOL_NB_IPX));
7215 459 : PyModule_AddObject(m, "EPM_PROTOCOL_DSP", PyLong_FromLong((uint16_t)EPM_PROTOCOL_DSP));
7216 459 : PyModule_AddObject(m, "EPM_PROTOCOL_DDP", PyLong_FromLong((uint16_t)EPM_PROTOCOL_DDP));
7217 459 : PyModule_AddObject(m, "EPM_PROTOCOL_APPLETALK", PyLong_FromLong((uint16_t)EPM_PROTOCOL_APPLETALK));
7218 459 : PyModule_AddObject(m, "EPM_PROTOCOL_VINES_SPP", PyLong_FromLong((uint16_t)EPM_PROTOCOL_VINES_SPP));
7219 459 : PyModule_AddObject(m, "EPM_PROTOCOL_VINES_IPC", PyLong_FromLong((uint16_t)EPM_PROTOCOL_VINES_IPC));
7220 459 : PyModule_AddObject(m, "EPM_PROTOCOL_STREETTALK", PyLong_FromLong((uint16_t)EPM_PROTOCOL_STREETTALK));
7221 459 : PyModule_AddObject(m, "EPM_PROTOCOL_HTTP", PyLong_FromLong((uint16_t)EPM_PROTOCOL_HTTP));
7222 459 : PyModule_AddObject(m, "EPM_PROTOCOL_UNIX_DS", PyLong_FromLong((uint16_t)EPM_PROTOCOL_UNIX_DS));
7223 459 : PyModule_AddObject(m, "EPM_PROTOCOL_NULL", PyLong_FromLong((uint16_t)EPM_PROTOCOL_NULL));
7224 459 : PyModule_AddObject(m, "RPC_C_EP_ALL_ELTS", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_EP_ALL_ELTS));
7225 459 : PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_IF", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_EP_MATCH_BY_IF));
7226 459 : PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_OBJ", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_EP_MATCH_BY_OBJ));
7227 459 : PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_BOTH", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_EP_MATCH_BY_BOTH));
7228 459 : PyModule_AddObject(m, "RPC_C_VERS_ALL", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_VERS_ALL));
7229 459 : PyModule_AddObject(m, "RPC_C_VERS_COMPATIBLE", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_VERS_COMPATIBLE));
7230 459 : PyModule_AddObject(m, "RPC_C_VERS_EXACT", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_VERS_EXACT));
7231 459 : PyModule_AddObject(m, "RPC_C_VERS_MAJOR_ONLY", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_VERS_MAJOR_ONLY));
7232 459 : PyModule_AddObject(m, "RPC_C_VERS_UPTO", PyLong_FromUnsignedLongLong((uint32_t)RPC_C_VERS_UPTO));
7233 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_dnet_nsp_Type);
7234 459 : PyModule_AddObject(m, "epm_rhs_dnet_nsp", (PyObject *)(void *)&epm_rhs_dnet_nsp_Type);
7235 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_osi_tp4_Type);
7236 459 : PyModule_AddObject(m, "epm_rhs_osi_tp4", (PyObject *)(void *)&epm_rhs_osi_tp4_Type);
7237 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_osi_clns_Type);
7238 459 : PyModule_AddObject(m, "epm_rhs_osi_clns", (PyObject *)(void *)&epm_rhs_osi_clns_Type);
7239 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_udp_Type);
7240 459 : PyModule_AddObject(m, "epm_rhs_udp", (PyObject *)(void *)&epm_rhs_udp_Type);
7241 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_tcp_Type);
7242 459 : PyModule_AddObject(m, "epm_rhs_tcp", (PyObject *)(void *)&epm_rhs_tcp_Type);
7243 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_ip_Type);
7244 459 : PyModule_AddObject(m, "epm_rhs_ip", (PyObject *)(void *)&epm_rhs_ip_Type);
7245 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_ncadg_Type);
7246 459 : PyModule_AddObject(m, "epm_rhs_ncadg", (PyObject *)(void *)&epm_rhs_ncadg_Type);
7247 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_ncacn_Type);
7248 459 : PyModule_AddObject(m, "epm_rhs_ncacn", (PyObject *)(void *)&epm_rhs_ncacn_Type);
7249 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_uuid_Type);
7250 459 : PyModule_AddObject(m, "epm_rhs_uuid", (PyObject *)(void *)&epm_rhs_uuid_Type);
7251 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_ipx_Type);
7252 459 : PyModule_AddObject(m, "epm_rhs_ipx", (PyObject *)(void *)&epm_rhs_ipx_Type);
7253 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_smb_Type);
7254 459 : PyModule_AddObject(m, "epm_rhs_smb", (PyObject *)(void *)&epm_rhs_smb_Type);
7255 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_named_pipe_Type);
7256 459 : PyModule_AddObject(m, "epm_rhs_named_pipe", (PyObject *)(void *)&epm_rhs_named_pipe_Type);
7257 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_netbios_Type);
7258 459 : PyModule_AddObject(m, "epm_rhs_netbios", (PyObject *)(void *)&epm_rhs_netbios_Type);
7259 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_netbeui_Type);
7260 459 : PyModule_AddObject(m, "epm_rhs_netbeui", (PyObject *)(void *)&epm_rhs_netbeui_Type);
7261 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_spx_Type);
7262 459 : PyModule_AddObject(m, "epm_rhs_spx", (PyObject *)(void *)&epm_rhs_spx_Type);
7263 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_nb_ipx_Type);
7264 459 : PyModule_AddObject(m, "epm_rhs_nb_ipx", (PyObject *)(void *)&epm_rhs_nb_ipx_Type);
7265 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_http_Type);
7266 459 : PyModule_AddObject(m, "epm_rhs_http", (PyObject *)(void *)&epm_rhs_http_Type);
7267 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_unix_ds_Type);
7268 459 : PyModule_AddObject(m, "epm_rhs_unix_ds", (PyObject *)(void *)&epm_rhs_unix_ds_Type);
7269 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_null_Type);
7270 459 : PyModule_AddObject(m, "epm_rhs_null", (PyObject *)(void *)&epm_rhs_null_Type);
7271 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_ncalrpc_Type);
7272 459 : PyModule_AddObject(m, "epm_rhs_ncalrpc", (PyObject *)(void *)&epm_rhs_ncalrpc_Type);
7273 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_appletalk_Type);
7274 459 : PyModule_AddObject(m, "epm_rhs_appletalk", (PyObject *)(void *)&epm_rhs_appletalk_Type);
7275 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_atalk_stream_Type);
7276 459 : PyModule_AddObject(m, "epm_rhs_atalk_stream", (PyObject *)(void *)&epm_rhs_atalk_stream_Type);
7277 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_atalk_datagram_Type);
7278 459 : PyModule_AddObject(m, "epm_rhs_atalk_datagram", (PyObject *)(void *)&epm_rhs_atalk_datagram_Type);
7279 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_vines_spp_Type);
7280 459 : PyModule_AddObject(m, "epm_rhs_vines_spp", (PyObject *)(void *)&epm_rhs_vines_spp_Type);
7281 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_vines_ipc_Type);
7282 459 : PyModule_AddObject(m, "epm_rhs_vines_ipc", (PyObject *)(void *)&epm_rhs_vines_ipc_Type);
7283 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_streettalk_Type);
7284 459 : PyModule_AddObject(m, "epm_rhs_streettalk", (PyObject *)(void *)&epm_rhs_streettalk_Type);
7285 459 : Py_INCREF((PyObject *)(void *)&epm_rhs_Type);
7286 459 : PyModule_AddObject(m, "epm_rhs", (PyObject *)(void *)&epm_rhs_Type);
7287 459 : Py_INCREF((PyObject *)(void *)&epm_lhs_Type);
7288 459 : PyModule_AddObject(m, "epm_lhs", (PyObject *)(void *)&epm_lhs_Type);
7289 459 : Py_INCREF((PyObject *)(void *)&epm_floor_Type);
7290 459 : PyModule_AddObject(m, "epm_floor", (PyObject *)(void *)&epm_floor_Type);
7291 459 : Py_INCREF((PyObject *)(void *)&epm_tower_Type);
7292 459 : PyModule_AddObject(m, "epm_tower", (PyObject *)(void *)&epm_tower_Type);
7293 459 : Py_INCREF((PyObject *)(void *)&epm_twr_t_Type);
7294 459 : PyModule_AddObject(m, "epm_twr_t", (PyObject *)(void *)&epm_twr_t_Type);
7295 459 : Py_INCREF((PyObject *)(void *)&epm_entry_t_Type);
7296 459 : PyModule_AddObject(m, "epm_entry_t", (PyObject *)(void *)&epm_entry_t_Type);
7297 459 : Py_INCREF((PyObject *)(void *)&rpc_if_id_t_Type);
7298 459 : PyModule_AddObject(m, "rpc_if_id_t", (PyObject *)(void *)&rpc_if_id_t_Type);
7299 459 : Py_INCREF((PyObject *)(void *)&epm_twr_p_t_Type);
7300 459 : PyModule_AddObject(m, "epm_twr_p_t", (PyObject *)(void *)&epm_twr_p_t_Type);
7301 459 : Py_INCREF((PyObject *)(void *)&epm_Insert_Type);
7302 459 : PyModule_AddObject(m, "epm_Insert", (PyObject *)(void *)&epm_Insert_Type);
7303 459 : Py_INCREF((PyObject *)(void *)&epm_Delete_Type);
7304 459 : PyModule_AddObject(m, "epm_Delete", (PyObject *)(void *)&epm_Delete_Type);
7305 459 : Py_INCREF((PyObject *)(void *)&epm_Lookup_Type);
7306 459 : PyModule_AddObject(m, "epm_Lookup", (PyObject *)(void *)&epm_Lookup_Type);
7307 459 : Py_INCREF((PyObject *)(void *)&epm_Map_Type);
7308 459 : PyModule_AddObject(m, "epm_Map", (PyObject *)(void *)&epm_Map_Type);
7309 459 : Py_INCREF((PyObject *)(void *)&epm_LookupHandleFree_Type);
7310 459 : PyModule_AddObject(m, "epm_LookupHandleFree", (PyObject *)(void *)&epm_LookupHandleFree_Type);
7311 459 : Py_INCREF((PyObject *)(void *)&epm_InqObject_Type);
7312 459 : PyModule_AddObject(m, "epm_InqObject", (PyObject *)(void *)&epm_InqObject_Type);
7313 459 : Py_INCREF((PyObject *)(void *)&epm_MgmtDelete_Type);
7314 459 : PyModule_AddObject(m, "epm_MgmtDelete", (PyObject *)(void *)&epm_MgmtDelete_Type);
7315 459 : Py_INCREF((PyObject *)(void *)&epmapper_InterfaceType);
7316 459 : PyModule_AddObject(m, "epmapper", (PyObject *)(void *)&epmapper_InterfaceType);
7317 459 : Py_INCREF((PyObject *)(void *)&epmapper_SyntaxType);
7318 459 : PyModule_AddObject(m, "epmapper_abstract_syntax", (PyObject *)(void *)&epmapper_SyntaxType);
7319 459 : Py_INCREF((PyObject *)(void *)&epmapper_SyntaxType);
7320 459 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&epmapper_SyntaxType);
7321 : #ifdef PY_MOD_EPMAPPER_PATCH
7322 : PY_MOD_EPMAPPER_PATCH(m);
7323 : #endif
7324 459 : out:
7325 459 : Py_XDECREF(dep_samba_dcerpc_misc);
7326 459 : Py_XDECREF(dep_talloc);
7327 459 : Py_XDECREF(dep_samba_dcerpc_base);
7328 459 : return m;
7329 :
7330 : }
|