2 /* Python wrapper functions auto-generated by pidl */
6 #include "librpc/rpc/pyrpc.h"
7 #include "librpc/rpc/pyrpc_util.h"
8 #include "bin/default/librpc/gen_ndr/ndr_epmapper.h"
9 #include "bin/default/librpc/gen_ndr/ndr_epmapper_c.h"
11 #include "librpc/gen_ndr/misc.h"
12 staticforward PyTypeObject epm_rhs_dnet_nsp_Type;
13 staticforward PyTypeObject epm_rhs_osi_tp4_Type;
14 staticforward PyTypeObject epm_rhs_osi_clns_Type;
15 staticforward PyTypeObject epm_rhs_udp_Type;
16 staticforward PyTypeObject epm_rhs_tcp_Type;
17 staticforward PyTypeObject epm_rhs_ip_Type;
18 staticforward PyTypeObject epm_rhs_ncadg_Type;
19 staticforward PyTypeObject epm_rhs_ncacn_Type;
20 staticforward PyTypeObject epm_rhs_uuid_Type;
21 staticforward PyTypeObject epm_rhs_ipx_Type;
22 staticforward PyTypeObject epm_rhs_smb_Type;
23 staticforward PyTypeObject epm_rhs_named_pipe_Type;
24 staticforward PyTypeObject epm_rhs_netbios_Type;
25 staticforward PyTypeObject epm_rhs_netbeui_Type;
26 staticforward PyTypeObject epm_rhs_spx_Type;
27 staticforward PyTypeObject epm_rhs_nb_ipx_Type;
28 staticforward PyTypeObject epm_rhs_http_Type;
29 staticforward PyTypeObject epm_rhs_unix_ds_Type;
30 staticforward PyTypeObject epm_rhs_null_Type;
31 staticforward PyTypeObject epm_rhs_ncalrpc_Type;
32 staticforward PyTypeObject epm_rhs_appletalk_Type;
33 staticforward PyTypeObject epm_rhs_atalk_stream_Type;
34 staticforward PyTypeObject epm_rhs_atalk_datagram_Type;
35 staticforward PyTypeObject epm_rhs_vines_spp_Type;
36 staticforward PyTypeObject epm_rhs_vines_ipc_Type;
37 staticforward PyTypeObject epm_rhs_streettalk_Type;
38 staticforward PyTypeObject epm_lhs_Type;
39 staticforward PyTypeObject epm_floor_Type;
40 staticforward PyTypeObject epm_tower_Type;
41 staticforward PyTypeObject epm_twr_t_Type;
42 staticforward PyTypeObject epm_entry_t_Type;
43 staticforward PyTypeObject rpc_if_id_t_Type;
44 staticforward PyTypeObject epm_twr_p_t_Type;
45 staticforward PyTypeObject epmapper_InterfaceType;
47 void initepmapper(void);static PyTypeObject *Object_Type;
48 static PyTypeObject *GUID_Type;
49 static PyTypeObject *policy_handle_Type;
50 static PyTypeObject *ClientConnection_Type;
51 static PyTypeObject *ndr_syntax_id_Type;
53 static PyObject *py_epm_rhs_dnet_nsp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
55 return pytalloc_new(struct epm_rhs_dnet_nsp, type);
59 static PyTypeObject epm_rhs_dnet_nsp_Type = {
60 PyObject_HEAD_INIT(NULL) 0,
61 .tp_name = "epmapper.epm_rhs_dnet_nsp",
64 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
65 .tp_basicsize = sizeof(pytalloc_Object),
66 .tp_new = py_epm_rhs_dnet_nsp_new,
70 static PyObject *py_epm_rhs_osi_tp4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
72 return pytalloc_new(struct epm_rhs_osi_tp4, type);
76 static PyTypeObject epm_rhs_osi_tp4_Type = {
77 PyObject_HEAD_INIT(NULL) 0,
78 .tp_name = "epmapper.epm_rhs_osi_tp4",
81 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
82 .tp_basicsize = sizeof(pytalloc_Object),
83 .tp_new = py_epm_rhs_osi_tp4_new,
87 static PyObject *py_epm_rhs_osi_clns_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
89 return pytalloc_new(struct epm_rhs_osi_clns, type);
93 static PyTypeObject epm_rhs_osi_clns_Type = {
94 PyObject_HEAD_INIT(NULL) 0,
95 .tp_name = "epmapper.epm_rhs_osi_clns",
98 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
99 .tp_basicsize = sizeof(pytalloc_Object),
100 .tp_new = py_epm_rhs_osi_clns_new,
104 static PyObject *py_epm_rhs_udp_get_port(PyObject *obj, void *closure)
106 struct epm_rhs_udp *object = (struct epm_rhs_udp *)pytalloc_get_ptr(obj);
108 py_port = PyInt_FromLong(object->port);
112 static int py_epm_rhs_udp_set_port(PyObject *py_obj, PyObject *value, void *closure)
114 struct epm_rhs_udp *object = (struct epm_rhs_udp *)pytalloc_get_ptr(py_obj);
115 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
116 object->port = PyInt_AsLong(value);
120 static PyGetSetDef py_epm_rhs_udp_getsetters[] = {
121 { discard_const_p(char, "port"), py_epm_rhs_udp_get_port, py_epm_rhs_udp_set_port },
125 static PyObject *py_epm_rhs_udp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
127 return pytalloc_new(struct epm_rhs_udp, type);
131 static PyTypeObject epm_rhs_udp_Type = {
132 PyObject_HEAD_INIT(NULL) 0,
133 .tp_name = "epmapper.epm_rhs_udp",
134 .tp_getset = py_epm_rhs_udp_getsetters,
136 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
137 .tp_basicsize = sizeof(pytalloc_Object),
138 .tp_new = py_epm_rhs_udp_new,
142 static PyObject *py_epm_rhs_tcp_get_port(PyObject *obj, void *closure)
144 struct epm_rhs_tcp *object = (struct epm_rhs_tcp *)pytalloc_get_ptr(obj);
146 py_port = PyInt_FromLong(object->port);
150 static int py_epm_rhs_tcp_set_port(PyObject *py_obj, PyObject *value, void *closure)
152 struct epm_rhs_tcp *object = (struct epm_rhs_tcp *)pytalloc_get_ptr(py_obj);
153 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
154 object->port = PyInt_AsLong(value);
158 static PyGetSetDef py_epm_rhs_tcp_getsetters[] = {
159 { discard_const_p(char, "port"), py_epm_rhs_tcp_get_port, py_epm_rhs_tcp_set_port },
163 static PyObject *py_epm_rhs_tcp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
165 return pytalloc_new(struct epm_rhs_tcp, type);
169 static PyTypeObject epm_rhs_tcp_Type = {
170 PyObject_HEAD_INIT(NULL) 0,
171 .tp_name = "epmapper.epm_rhs_tcp",
172 .tp_getset = py_epm_rhs_tcp_getsetters,
174 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
175 .tp_basicsize = sizeof(pytalloc_Object),
176 .tp_new = py_epm_rhs_tcp_new,
180 static PyObject *py_epm_rhs_ip_get_ipaddr(PyObject *obj, void *closure)
182 struct epm_rhs_ip *object = (struct epm_rhs_ip *)pytalloc_get_ptr(obj);
184 py_ipaddr = PyString_FromStringOrNULL(object->ipaddr);
188 static int py_epm_rhs_ip_set_ipaddr(PyObject *py_obj, PyObject *value, void *closure)
190 struct epm_rhs_ip *object = (struct epm_rhs_ip *)pytalloc_get_ptr(py_obj);
191 object->ipaddr = PyString_AS_STRING(value);
195 static PyGetSetDef py_epm_rhs_ip_getsetters[] = {
196 { discard_const_p(char, "ipaddr"), py_epm_rhs_ip_get_ipaddr, py_epm_rhs_ip_set_ipaddr },
200 static PyObject *py_epm_rhs_ip_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
202 return pytalloc_new(struct epm_rhs_ip, type);
206 static PyTypeObject epm_rhs_ip_Type = {
207 PyObject_HEAD_INIT(NULL) 0,
208 .tp_name = "epmapper.epm_rhs_ip",
209 .tp_getset = py_epm_rhs_ip_getsetters,
211 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
212 .tp_basicsize = sizeof(pytalloc_Object),
213 .tp_new = py_epm_rhs_ip_new,
217 static PyObject *py_epm_rhs_ncadg_get_minor_version(PyObject *obj, void *closure)
219 struct epm_rhs_ncadg *object = (struct epm_rhs_ncadg *)pytalloc_get_ptr(obj);
220 PyObject *py_minor_version;
221 py_minor_version = PyInt_FromLong(object->minor_version);
222 return py_minor_version;
225 static int py_epm_rhs_ncadg_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
227 struct epm_rhs_ncadg *object = (struct epm_rhs_ncadg *)pytalloc_get_ptr(py_obj);
228 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
229 object->minor_version = PyInt_AsLong(value);
233 static PyGetSetDef py_epm_rhs_ncadg_getsetters[] = {
234 { discard_const_p(char, "minor_version"), py_epm_rhs_ncadg_get_minor_version, py_epm_rhs_ncadg_set_minor_version },
238 static PyObject *py_epm_rhs_ncadg_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
240 return pytalloc_new(struct epm_rhs_ncadg, type);
244 static PyTypeObject epm_rhs_ncadg_Type = {
245 PyObject_HEAD_INIT(NULL) 0,
246 .tp_name = "epmapper.epm_rhs_ncadg",
247 .tp_getset = py_epm_rhs_ncadg_getsetters,
249 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
250 .tp_basicsize = sizeof(pytalloc_Object),
251 .tp_new = py_epm_rhs_ncadg_new,
255 static PyObject *py_epm_rhs_ncacn_get_minor_version(PyObject *obj, void *closure)
257 struct epm_rhs_ncacn *object = (struct epm_rhs_ncacn *)pytalloc_get_ptr(obj);
258 PyObject *py_minor_version;
259 py_minor_version = PyInt_FromLong(object->minor_version);
260 return py_minor_version;
263 static int py_epm_rhs_ncacn_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
265 struct epm_rhs_ncacn *object = (struct epm_rhs_ncacn *)pytalloc_get_ptr(py_obj);
266 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
267 object->minor_version = PyInt_AsLong(value);
271 static PyGetSetDef py_epm_rhs_ncacn_getsetters[] = {
272 { discard_const_p(char, "minor_version"), py_epm_rhs_ncacn_get_minor_version, py_epm_rhs_ncacn_set_minor_version },
276 static PyObject *py_epm_rhs_ncacn_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
278 return pytalloc_new(struct epm_rhs_ncacn, type);
282 static PyTypeObject epm_rhs_ncacn_Type = {
283 PyObject_HEAD_INIT(NULL) 0,
284 .tp_name = "epmapper.epm_rhs_ncacn",
285 .tp_getset = py_epm_rhs_ncacn_getsetters,
287 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
288 .tp_basicsize = sizeof(pytalloc_Object),
289 .tp_new = py_epm_rhs_ncacn_new,
293 static PyObject *py_epm_rhs_uuid_get_unknown(PyObject *obj, void *closure)
295 struct epm_rhs_uuid *object = (struct epm_rhs_uuid *)pytalloc_get_ptr(obj);
296 PyObject *py_unknown;
297 py_unknown = PyString_FromStringAndSize((char *)(object->unknown).data, (object->unknown).length);
301 static int py_epm_rhs_uuid_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
303 struct epm_rhs_uuid *object = (struct epm_rhs_uuid *)pytalloc_get_ptr(py_obj);
304 object->unknown = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
308 static PyGetSetDef py_epm_rhs_uuid_getsetters[] = {
309 { discard_const_p(char, "unknown"), py_epm_rhs_uuid_get_unknown, py_epm_rhs_uuid_set_unknown },
313 static PyObject *py_epm_rhs_uuid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
315 return pytalloc_new(struct epm_rhs_uuid, type);
319 static PyTypeObject epm_rhs_uuid_Type = {
320 PyObject_HEAD_INIT(NULL) 0,
321 .tp_name = "epmapper.epm_rhs_uuid",
322 .tp_getset = py_epm_rhs_uuid_getsetters,
324 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
325 .tp_basicsize = sizeof(pytalloc_Object),
326 .tp_new = py_epm_rhs_uuid_new,
330 static PyObject *py_epm_rhs_ipx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
332 return pytalloc_new(struct epm_rhs_ipx, type);
336 static PyTypeObject epm_rhs_ipx_Type = {
337 PyObject_HEAD_INIT(NULL) 0,
338 .tp_name = "epmapper.epm_rhs_ipx",
341 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
342 .tp_basicsize = sizeof(pytalloc_Object),
343 .tp_new = py_epm_rhs_ipx_new,
347 static PyObject *py_epm_rhs_smb_get_unc(PyObject *obj, void *closure)
349 struct epm_rhs_smb *object = (struct epm_rhs_smb *)pytalloc_get_ptr(obj);
351 py_unc = PyString_FromStringOrNULL(object->unc);
355 static int py_epm_rhs_smb_set_unc(PyObject *py_obj, PyObject *value, void *closure)
357 struct epm_rhs_smb *object = (struct epm_rhs_smb *)pytalloc_get_ptr(py_obj);
358 object->unc = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
362 static PyGetSetDef py_epm_rhs_smb_getsetters[] = {
363 { discard_const_p(char, "unc"), py_epm_rhs_smb_get_unc, py_epm_rhs_smb_set_unc },
367 static PyObject *py_epm_rhs_smb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
369 return pytalloc_new(struct epm_rhs_smb, type);
373 static PyTypeObject epm_rhs_smb_Type = {
374 PyObject_HEAD_INIT(NULL) 0,
375 .tp_name = "epmapper.epm_rhs_smb",
376 .tp_getset = py_epm_rhs_smb_getsetters,
378 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
379 .tp_basicsize = sizeof(pytalloc_Object),
380 .tp_new = py_epm_rhs_smb_new,
384 static PyObject *py_epm_rhs_named_pipe_get_path(PyObject *obj, void *closure)
386 struct epm_rhs_named_pipe *object = (struct epm_rhs_named_pipe *)pytalloc_get_ptr(obj);
388 py_path = PyString_FromStringOrNULL(object->path);
392 static int py_epm_rhs_named_pipe_set_path(PyObject *py_obj, PyObject *value, void *closure)
394 struct epm_rhs_named_pipe *object = (struct epm_rhs_named_pipe *)pytalloc_get_ptr(py_obj);
395 object->path = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
399 static PyGetSetDef py_epm_rhs_named_pipe_getsetters[] = {
400 { discard_const_p(char, "path"), py_epm_rhs_named_pipe_get_path, py_epm_rhs_named_pipe_set_path },
404 static PyObject *py_epm_rhs_named_pipe_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
406 return pytalloc_new(struct epm_rhs_named_pipe, type);
410 static PyTypeObject epm_rhs_named_pipe_Type = {
411 PyObject_HEAD_INIT(NULL) 0,
412 .tp_name = "epmapper.epm_rhs_named_pipe",
413 .tp_getset = py_epm_rhs_named_pipe_getsetters,
415 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
416 .tp_basicsize = sizeof(pytalloc_Object),
417 .tp_new = py_epm_rhs_named_pipe_new,
421 static PyObject *py_epm_rhs_netbios_get_name(PyObject *obj, void *closure)
423 struct epm_rhs_netbios *object = (struct epm_rhs_netbios *)pytalloc_get_ptr(obj);
425 py_name = PyString_FromStringOrNULL(object->name);
429 static int py_epm_rhs_netbios_set_name(PyObject *py_obj, PyObject *value, void *closure)
431 struct epm_rhs_netbios *object = (struct epm_rhs_netbios *)pytalloc_get_ptr(py_obj);
432 object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
436 static PyGetSetDef py_epm_rhs_netbios_getsetters[] = {
437 { discard_const_p(char, "name"), py_epm_rhs_netbios_get_name, py_epm_rhs_netbios_set_name },
441 static PyObject *py_epm_rhs_netbios_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
443 return pytalloc_new(struct epm_rhs_netbios, type);
447 static PyTypeObject epm_rhs_netbios_Type = {
448 PyObject_HEAD_INIT(NULL) 0,
449 .tp_name = "epmapper.epm_rhs_netbios",
450 .tp_getset = py_epm_rhs_netbios_getsetters,
452 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
453 .tp_basicsize = sizeof(pytalloc_Object),
454 .tp_new = py_epm_rhs_netbios_new,
458 static PyObject *py_epm_rhs_netbeui_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
460 return pytalloc_new(struct epm_rhs_netbeui, type);
464 static PyTypeObject epm_rhs_netbeui_Type = {
465 PyObject_HEAD_INIT(NULL) 0,
466 .tp_name = "epmapper.epm_rhs_netbeui",
469 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
470 .tp_basicsize = sizeof(pytalloc_Object),
471 .tp_new = py_epm_rhs_netbeui_new,
475 static PyObject *py_epm_rhs_spx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
477 return pytalloc_new(struct epm_rhs_spx, type);
481 static PyTypeObject epm_rhs_spx_Type = {
482 PyObject_HEAD_INIT(NULL) 0,
483 .tp_name = "epmapper.epm_rhs_spx",
486 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
487 .tp_basicsize = sizeof(pytalloc_Object),
488 .tp_new = py_epm_rhs_spx_new,
492 static PyObject *py_epm_rhs_nb_ipx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
494 return pytalloc_new(struct epm_rhs_nb_ipx, type);
498 static PyTypeObject epm_rhs_nb_ipx_Type = {
499 PyObject_HEAD_INIT(NULL) 0,
500 .tp_name = "epmapper.epm_rhs_nb_ipx",
503 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
504 .tp_basicsize = sizeof(pytalloc_Object),
505 .tp_new = py_epm_rhs_nb_ipx_new,
509 static PyObject *py_epm_rhs_http_get_port(PyObject *obj, void *closure)
511 struct epm_rhs_http *object = (struct epm_rhs_http *)pytalloc_get_ptr(obj);
513 py_port = PyInt_FromLong(object->port);
517 static int py_epm_rhs_http_set_port(PyObject *py_obj, PyObject *value, void *closure)
519 struct epm_rhs_http *object = (struct epm_rhs_http *)pytalloc_get_ptr(py_obj);
520 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
521 object->port = PyInt_AsLong(value);
525 static PyGetSetDef py_epm_rhs_http_getsetters[] = {
526 { discard_const_p(char, "port"), py_epm_rhs_http_get_port, py_epm_rhs_http_set_port },
530 static PyObject *py_epm_rhs_http_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
532 return pytalloc_new(struct epm_rhs_http, type);
536 static PyTypeObject epm_rhs_http_Type = {
537 PyObject_HEAD_INIT(NULL) 0,
538 .tp_name = "epmapper.epm_rhs_http",
539 .tp_getset = py_epm_rhs_http_getsetters,
541 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
542 .tp_basicsize = sizeof(pytalloc_Object),
543 .tp_new = py_epm_rhs_http_new,
547 static PyObject *py_epm_rhs_unix_ds_get_path(PyObject *obj, void *closure)
549 struct epm_rhs_unix_ds *object = (struct epm_rhs_unix_ds *)pytalloc_get_ptr(obj);
551 py_path = PyString_FromStringOrNULL(object->path);
555 static int py_epm_rhs_unix_ds_set_path(PyObject *py_obj, PyObject *value, void *closure)
557 struct epm_rhs_unix_ds *object = (struct epm_rhs_unix_ds *)pytalloc_get_ptr(py_obj);
558 object->path = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
562 static PyGetSetDef py_epm_rhs_unix_ds_getsetters[] = {
563 { discard_const_p(char, "path"), py_epm_rhs_unix_ds_get_path, py_epm_rhs_unix_ds_set_path },
567 static PyObject *py_epm_rhs_unix_ds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
569 return pytalloc_new(struct epm_rhs_unix_ds, type);
573 static PyTypeObject epm_rhs_unix_ds_Type = {
574 PyObject_HEAD_INIT(NULL) 0,
575 .tp_name = "epmapper.epm_rhs_unix_ds",
576 .tp_getset = py_epm_rhs_unix_ds_getsetters,
578 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
579 .tp_basicsize = sizeof(pytalloc_Object),
580 .tp_new = py_epm_rhs_unix_ds_new,
584 static PyObject *py_epm_rhs_null_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
586 return pytalloc_new(struct epm_rhs_null, type);
590 static PyTypeObject epm_rhs_null_Type = {
591 PyObject_HEAD_INIT(NULL) 0,
592 .tp_name = "epmapper.epm_rhs_null",
595 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
596 .tp_basicsize = sizeof(pytalloc_Object),
597 .tp_new = py_epm_rhs_null_new,
601 static PyObject *py_epm_rhs_ncalrpc_get_minor_version(PyObject *obj, void *closure)
603 struct epm_rhs_ncalrpc *object = (struct epm_rhs_ncalrpc *)pytalloc_get_ptr(obj);
604 PyObject *py_minor_version;
605 py_minor_version = PyInt_FromLong(object->minor_version);
606 return py_minor_version;
609 static int py_epm_rhs_ncalrpc_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
611 struct epm_rhs_ncalrpc *object = (struct epm_rhs_ncalrpc *)pytalloc_get_ptr(py_obj);
612 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
613 object->minor_version = PyInt_AsLong(value);
617 static PyGetSetDef py_epm_rhs_ncalrpc_getsetters[] = {
618 { discard_const_p(char, "minor_version"), py_epm_rhs_ncalrpc_get_minor_version, py_epm_rhs_ncalrpc_set_minor_version },
622 static PyObject *py_epm_rhs_ncalrpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
624 return pytalloc_new(struct epm_rhs_ncalrpc, type);
628 static PyTypeObject epm_rhs_ncalrpc_Type = {
629 PyObject_HEAD_INIT(NULL) 0,
630 .tp_name = "epmapper.epm_rhs_ncalrpc",
631 .tp_getset = py_epm_rhs_ncalrpc_getsetters,
633 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
634 .tp_basicsize = sizeof(pytalloc_Object),
635 .tp_new = py_epm_rhs_ncalrpc_new,
639 static PyObject *py_epm_rhs_appletalk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
641 return pytalloc_new(struct epm_rhs_appletalk, type);
645 static PyTypeObject epm_rhs_appletalk_Type = {
646 PyObject_HEAD_INIT(NULL) 0,
647 .tp_name = "epmapper.epm_rhs_appletalk",
650 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
651 .tp_basicsize = sizeof(pytalloc_Object),
652 .tp_new = py_epm_rhs_appletalk_new,
656 static PyObject *py_epm_rhs_atalk_stream_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
658 return pytalloc_new(struct epm_rhs_atalk_stream, type);
662 static PyTypeObject epm_rhs_atalk_stream_Type = {
663 PyObject_HEAD_INIT(NULL) 0,
664 .tp_name = "epmapper.epm_rhs_atalk_stream",
667 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
668 .tp_basicsize = sizeof(pytalloc_Object),
669 .tp_new = py_epm_rhs_atalk_stream_new,
673 static PyObject *py_epm_rhs_atalk_datagram_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
675 return pytalloc_new(struct epm_rhs_atalk_datagram, type);
679 static PyTypeObject epm_rhs_atalk_datagram_Type = {
680 PyObject_HEAD_INIT(NULL) 0,
681 .tp_name = "epmapper.epm_rhs_atalk_datagram",
684 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
685 .tp_basicsize = sizeof(pytalloc_Object),
686 .tp_new = py_epm_rhs_atalk_datagram_new,
690 static PyObject *py_epm_rhs_vines_spp_get_port(PyObject *obj, void *closure)
692 struct epm_rhs_vines_spp *object = (struct epm_rhs_vines_spp *)pytalloc_get_ptr(obj);
694 py_port = PyInt_FromLong(object->port);
698 static int py_epm_rhs_vines_spp_set_port(PyObject *py_obj, PyObject *value, void *closure)
700 struct epm_rhs_vines_spp *object = (struct epm_rhs_vines_spp *)pytalloc_get_ptr(py_obj);
701 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
702 object->port = PyInt_AsLong(value);
706 static PyGetSetDef py_epm_rhs_vines_spp_getsetters[] = {
707 { discard_const_p(char, "port"), py_epm_rhs_vines_spp_get_port, py_epm_rhs_vines_spp_set_port },
711 static PyObject *py_epm_rhs_vines_spp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
713 return pytalloc_new(struct epm_rhs_vines_spp, type);
717 static PyTypeObject epm_rhs_vines_spp_Type = {
718 PyObject_HEAD_INIT(NULL) 0,
719 .tp_name = "epmapper.epm_rhs_vines_spp",
720 .tp_getset = py_epm_rhs_vines_spp_getsetters,
722 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
723 .tp_basicsize = sizeof(pytalloc_Object),
724 .tp_new = py_epm_rhs_vines_spp_new,
728 static PyObject *py_epm_rhs_vines_ipc_get_port(PyObject *obj, void *closure)
730 struct epm_rhs_vines_ipc *object = (struct epm_rhs_vines_ipc *)pytalloc_get_ptr(obj);
732 py_port = PyInt_FromLong(object->port);
736 static int py_epm_rhs_vines_ipc_set_port(PyObject *py_obj, PyObject *value, void *closure)
738 struct epm_rhs_vines_ipc *object = (struct epm_rhs_vines_ipc *)pytalloc_get_ptr(py_obj);
739 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
740 object->port = PyInt_AsLong(value);
744 static PyGetSetDef py_epm_rhs_vines_ipc_getsetters[] = {
745 { discard_const_p(char, "port"), py_epm_rhs_vines_ipc_get_port, py_epm_rhs_vines_ipc_set_port },
749 static PyObject *py_epm_rhs_vines_ipc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
751 return pytalloc_new(struct epm_rhs_vines_ipc, type);
755 static PyTypeObject epm_rhs_vines_ipc_Type = {
756 PyObject_HEAD_INIT(NULL) 0,
757 .tp_name = "epmapper.epm_rhs_vines_ipc",
758 .tp_getset = py_epm_rhs_vines_ipc_getsetters,
760 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
761 .tp_basicsize = sizeof(pytalloc_Object),
762 .tp_new = py_epm_rhs_vines_ipc_new,
766 static PyObject *py_epm_rhs_streettalk_get_streettalk(PyObject *obj, void *closure)
768 struct epm_rhs_streettalk *object = (struct epm_rhs_streettalk *)pytalloc_get_ptr(obj);
769 PyObject *py_streettalk;
770 py_streettalk = PyString_FromStringOrNULL(object->streettalk);
771 return py_streettalk;
774 static int py_epm_rhs_streettalk_set_streettalk(PyObject *py_obj, PyObject *value, void *closure)
776 struct epm_rhs_streettalk *object = (struct epm_rhs_streettalk *)pytalloc_get_ptr(py_obj);
777 object->streettalk = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
781 static PyGetSetDef py_epm_rhs_streettalk_getsetters[] = {
782 { discard_const_p(char, "streettalk"), py_epm_rhs_streettalk_get_streettalk, py_epm_rhs_streettalk_set_streettalk },
786 static PyObject *py_epm_rhs_streettalk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
788 return pytalloc_new(struct epm_rhs_streettalk, type);
792 static PyTypeObject epm_rhs_streettalk_Type = {
793 PyObject_HEAD_INIT(NULL) 0,
794 .tp_name = "epmapper.epm_rhs_streettalk",
795 .tp_getset = py_epm_rhs_streettalk_getsetters,
797 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
798 .tp_basicsize = sizeof(pytalloc_Object),
799 .tp_new = py_epm_rhs_streettalk_new,
802 static PyObject *py_import_epm_rhs(TALLOC_CTX *mem_ctx, int level, union epm_rhs *in)
807 case EPM_PROTOCOL_DNET_NSP:
808 ret = pytalloc_reference_ex(&epm_rhs_dnet_nsp_Type, mem_ctx, &in->dnet_nsp);
811 case EPM_PROTOCOL_OSI_TP4:
812 ret = pytalloc_reference_ex(&epm_rhs_osi_tp4_Type, mem_ctx, &in->osi_tp4);
815 case EPM_PROTOCOL_OSI_CLNS:
816 ret = pytalloc_reference_ex(&epm_rhs_osi_clns_Type, mem_ctx, &in->osi_clns);
819 case EPM_PROTOCOL_TCP:
820 ret = pytalloc_reference_ex(&epm_rhs_tcp_Type, mem_ctx, &in->tcp);
823 case EPM_PROTOCOL_UDP:
824 ret = pytalloc_reference_ex(&epm_rhs_udp_Type, mem_ctx, &in->udp);
827 case EPM_PROTOCOL_IP:
828 ret = pytalloc_reference_ex(&epm_rhs_ip_Type, mem_ctx, &in->ip);
831 case EPM_PROTOCOL_NCADG:
832 ret = pytalloc_reference_ex(&epm_rhs_ncadg_Type, mem_ctx, &in->ncadg);
835 case EPM_PROTOCOL_NCACN:
836 ret = pytalloc_reference_ex(&epm_rhs_ncacn_Type, mem_ctx, &in->ncacn);
839 case EPM_PROTOCOL_NCALRPC:
840 ret = pytalloc_reference_ex(&epm_rhs_ncalrpc_Type, mem_ctx, &in->ncalrpc);
843 case EPM_PROTOCOL_UUID:
844 ret = pytalloc_reference_ex(&epm_rhs_uuid_Type, mem_ctx, &in->uuid);
847 case EPM_PROTOCOL_IPX:
848 ret = pytalloc_reference_ex(&epm_rhs_ipx_Type, mem_ctx, &in->ipx);
851 case EPM_PROTOCOL_SMB:
852 ret = pytalloc_reference_ex(&epm_rhs_smb_Type, mem_ctx, &in->smb);
855 case EPM_PROTOCOL_NAMED_PIPE:
856 ret = pytalloc_reference_ex(&epm_rhs_named_pipe_Type, mem_ctx, &in->named_pipe);
859 case EPM_PROTOCOL_NETBIOS:
860 ret = pytalloc_reference_ex(&epm_rhs_netbios_Type, mem_ctx, &in->netbios);
863 case EPM_PROTOCOL_NETBEUI:
864 ret = pytalloc_reference_ex(&epm_rhs_netbeui_Type, mem_ctx, &in->netbeui);
867 case EPM_PROTOCOL_SPX:
868 ret = pytalloc_reference_ex(&epm_rhs_spx_Type, mem_ctx, &in->spx);
871 case EPM_PROTOCOL_NB_IPX:
872 ret = pytalloc_reference_ex(&epm_rhs_nb_ipx_Type, mem_ctx, &in->nb_ipx);
875 case EPM_PROTOCOL_DSP:
876 ret = pytalloc_reference_ex(&epm_rhs_atalk_stream_Type, mem_ctx, &in->atalk_stream);
879 case EPM_PROTOCOL_DDP:
880 ret = pytalloc_reference_ex(&epm_rhs_atalk_datagram_Type, mem_ctx, &in->atalk_datagram);
883 case EPM_PROTOCOL_APPLETALK:
884 ret = pytalloc_reference_ex(&epm_rhs_appletalk_Type, mem_ctx, &in->appletalk);
887 case EPM_PROTOCOL_VINES_SPP:
888 ret = pytalloc_reference_ex(&epm_rhs_vines_spp_Type, mem_ctx, &in->vines_spp);
891 case EPM_PROTOCOL_VINES_IPC:
892 ret = pytalloc_reference_ex(&epm_rhs_vines_ipc_Type, mem_ctx, &in->vines_ipc);
895 case EPM_PROTOCOL_STREETTALK:
896 ret = pytalloc_reference_ex(&epm_rhs_streettalk_Type, mem_ctx, &in->streettalk);
899 case EPM_PROTOCOL_HTTP:
900 ret = pytalloc_reference_ex(&epm_rhs_http_Type, mem_ctx, &in->http);
903 case EPM_PROTOCOL_UNIX_DS:
904 ret = pytalloc_reference_ex(&epm_rhs_unix_ds_Type, mem_ctx, &in->unix_ds);
907 case EPM_PROTOCOL_NULL:
908 ret = pytalloc_reference_ex(&epm_rhs_null_Type, mem_ctx, &in->null);
912 ret = PyString_FromStringAndSize((char *)(in->unknown).data, (in->unknown).length);
916 PyErr_SetString(PyExc_TypeError, "unknown union level");
920 static union epm_rhs *py_export_epm_rhs(TALLOC_CTX *mem_ctx, int level, PyObject *in)
922 union epm_rhs *ret = talloc_zero(mem_ctx, union epm_rhs);
924 case EPM_PROTOCOL_DNET_NSP:
925 PY_CHECK_TYPE(&epm_rhs_dnet_nsp_Type, in, talloc_free(ret); return NULL;);
926 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
928 talloc_free(ret); return NULL;
930 ret->dnet_nsp = *(struct epm_rhs_dnet_nsp *)pytalloc_get_ptr(in);
933 case EPM_PROTOCOL_OSI_TP4:
934 PY_CHECK_TYPE(&epm_rhs_osi_tp4_Type, in, talloc_free(ret); return NULL;);
935 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
937 talloc_free(ret); return NULL;
939 ret->osi_tp4 = *(struct epm_rhs_osi_tp4 *)pytalloc_get_ptr(in);
942 case EPM_PROTOCOL_OSI_CLNS:
943 PY_CHECK_TYPE(&epm_rhs_osi_clns_Type, in, talloc_free(ret); return NULL;);
944 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
946 talloc_free(ret); return NULL;
948 ret->osi_clns = *(struct epm_rhs_osi_clns *)pytalloc_get_ptr(in);
951 case EPM_PROTOCOL_TCP:
952 PY_CHECK_TYPE(&epm_rhs_tcp_Type, in, talloc_free(ret); return NULL;);
953 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
955 talloc_free(ret); return NULL;
957 ret->tcp = *(struct epm_rhs_tcp *)pytalloc_get_ptr(in);
960 case EPM_PROTOCOL_UDP:
961 PY_CHECK_TYPE(&epm_rhs_udp_Type, in, talloc_free(ret); return NULL;);
962 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
964 talloc_free(ret); return NULL;
966 ret->udp = *(struct epm_rhs_udp *)pytalloc_get_ptr(in);
969 case EPM_PROTOCOL_IP:
970 PY_CHECK_TYPE(&epm_rhs_ip_Type, in, talloc_free(ret); return NULL;);
971 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
973 talloc_free(ret); return NULL;
975 ret->ip = *(struct epm_rhs_ip *)pytalloc_get_ptr(in);
978 case EPM_PROTOCOL_NCADG:
979 PY_CHECK_TYPE(&epm_rhs_ncadg_Type, in, talloc_free(ret); return NULL;);
980 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
982 talloc_free(ret); return NULL;
984 ret->ncadg = *(struct epm_rhs_ncadg *)pytalloc_get_ptr(in);
987 case EPM_PROTOCOL_NCACN:
988 PY_CHECK_TYPE(&epm_rhs_ncacn_Type, in, talloc_free(ret); return NULL;);
989 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
991 talloc_free(ret); return NULL;
993 ret->ncacn = *(struct epm_rhs_ncacn *)pytalloc_get_ptr(in);
996 case EPM_PROTOCOL_NCALRPC:
997 PY_CHECK_TYPE(&epm_rhs_ncalrpc_Type, in, talloc_free(ret); return NULL;);
998 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1000 talloc_free(ret); return NULL;
1002 ret->ncalrpc = *(struct epm_rhs_ncalrpc *)pytalloc_get_ptr(in);
1005 case EPM_PROTOCOL_UUID:
1006 PY_CHECK_TYPE(&epm_rhs_uuid_Type, in, talloc_free(ret); return NULL;);
1007 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1009 talloc_free(ret); return NULL;
1011 ret->uuid = *(struct epm_rhs_uuid *)pytalloc_get_ptr(in);
1014 case EPM_PROTOCOL_IPX:
1015 PY_CHECK_TYPE(&epm_rhs_ipx_Type, in, talloc_free(ret); return NULL;);
1016 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1018 talloc_free(ret); return NULL;
1020 ret->ipx = *(struct epm_rhs_ipx *)pytalloc_get_ptr(in);
1023 case EPM_PROTOCOL_SMB:
1024 PY_CHECK_TYPE(&epm_rhs_smb_Type, in, talloc_free(ret); return NULL;);
1025 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1027 talloc_free(ret); return NULL;
1029 ret->smb = *(struct epm_rhs_smb *)pytalloc_get_ptr(in);
1032 case EPM_PROTOCOL_NAMED_PIPE:
1033 PY_CHECK_TYPE(&epm_rhs_named_pipe_Type, in, talloc_free(ret); return NULL;);
1034 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1036 talloc_free(ret); return NULL;
1038 ret->named_pipe = *(struct epm_rhs_named_pipe *)pytalloc_get_ptr(in);
1041 case EPM_PROTOCOL_NETBIOS:
1042 PY_CHECK_TYPE(&epm_rhs_netbios_Type, in, talloc_free(ret); return NULL;);
1043 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1045 talloc_free(ret); return NULL;
1047 ret->netbios = *(struct epm_rhs_netbios *)pytalloc_get_ptr(in);
1050 case EPM_PROTOCOL_NETBEUI:
1051 PY_CHECK_TYPE(&epm_rhs_netbeui_Type, in, talloc_free(ret); return NULL;);
1052 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1054 talloc_free(ret); return NULL;
1056 ret->netbeui = *(struct epm_rhs_netbeui *)pytalloc_get_ptr(in);
1059 case EPM_PROTOCOL_SPX:
1060 PY_CHECK_TYPE(&epm_rhs_spx_Type, in, talloc_free(ret); return NULL;);
1061 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1063 talloc_free(ret); return NULL;
1065 ret->spx = *(struct epm_rhs_spx *)pytalloc_get_ptr(in);
1068 case EPM_PROTOCOL_NB_IPX:
1069 PY_CHECK_TYPE(&epm_rhs_nb_ipx_Type, in, talloc_free(ret); return NULL;);
1070 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1072 talloc_free(ret); return NULL;
1074 ret->nb_ipx = *(struct epm_rhs_nb_ipx *)pytalloc_get_ptr(in);
1077 case EPM_PROTOCOL_DSP:
1078 PY_CHECK_TYPE(&epm_rhs_atalk_stream_Type, in, talloc_free(ret); return NULL;);
1079 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1081 talloc_free(ret); return NULL;
1083 ret->atalk_stream = *(struct epm_rhs_atalk_stream *)pytalloc_get_ptr(in);
1086 case EPM_PROTOCOL_DDP:
1087 PY_CHECK_TYPE(&epm_rhs_atalk_datagram_Type, in, talloc_free(ret); return NULL;);
1088 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1090 talloc_free(ret); return NULL;
1092 ret->atalk_datagram = *(struct epm_rhs_atalk_datagram *)pytalloc_get_ptr(in);
1095 case EPM_PROTOCOL_APPLETALK:
1096 PY_CHECK_TYPE(&epm_rhs_appletalk_Type, in, talloc_free(ret); return NULL;);
1097 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1099 talloc_free(ret); return NULL;
1101 ret->appletalk = *(struct epm_rhs_appletalk *)pytalloc_get_ptr(in);
1104 case EPM_PROTOCOL_VINES_SPP:
1105 PY_CHECK_TYPE(&epm_rhs_vines_spp_Type, in, talloc_free(ret); return NULL;);
1106 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1108 talloc_free(ret); return NULL;
1110 ret->vines_spp = *(struct epm_rhs_vines_spp *)pytalloc_get_ptr(in);
1113 case EPM_PROTOCOL_VINES_IPC:
1114 PY_CHECK_TYPE(&epm_rhs_vines_ipc_Type, in, talloc_free(ret); return NULL;);
1115 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1117 talloc_free(ret); return NULL;
1119 ret->vines_ipc = *(struct epm_rhs_vines_ipc *)pytalloc_get_ptr(in);
1122 case EPM_PROTOCOL_STREETTALK:
1123 PY_CHECK_TYPE(&epm_rhs_streettalk_Type, in, talloc_free(ret); return NULL;);
1124 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1126 talloc_free(ret); return NULL;
1128 ret->streettalk = *(struct epm_rhs_streettalk *)pytalloc_get_ptr(in);
1131 case EPM_PROTOCOL_HTTP:
1132 PY_CHECK_TYPE(&epm_rhs_http_Type, in, talloc_free(ret); return NULL;);
1133 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1135 talloc_free(ret); return NULL;
1137 ret->http = *(struct epm_rhs_http *)pytalloc_get_ptr(in);
1140 case EPM_PROTOCOL_UNIX_DS:
1141 PY_CHECK_TYPE(&epm_rhs_unix_ds_Type, in, talloc_free(ret); return NULL;);
1142 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1144 talloc_free(ret); return NULL;
1146 ret->unix_ds = *(struct epm_rhs_unix_ds *)pytalloc_get_ptr(in);
1149 case EPM_PROTOCOL_NULL:
1150 PY_CHECK_TYPE(&epm_rhs_null_Type, in, talloc_free(ret); return NULL;);
1151 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1153 talloc_free(ret); return NULL;
1155 ret->null = *(struct epm_rhs_null *)pytalloc_get_ptr(in);
1159 ret->unknown = data_blob_talloc(mem_ctx, PyString_AS_STRING(in), PyString_GET_SIZE(in));
1168 static PyObject *py_epm_lhs_get_protocol(PyObject *obj, void *closure)
1170 struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(obj);
1171 PyObject *py_protocol;
1172 py_protocol = PyInt_FromLong(object->protocol);
1176 static int py_epm_lhs_set_protocol(PyObject *py_obj, PyObject *value, void *closure)
1178 struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(py_obj);
1179 if (PyLong_Check(value)) {
1180 object->protocol = PyLong_AsLongLong(value);
1181 } else if (PyInt_Check(value)) {
1182 object->protocol = PyInt_AsLong(value);
1184 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1185 PyInt_Type.tp_name, PyLong_Type.tp_name);
1191 static PyObject *py_epm_lhs_get_lhs_data(PyObject *obj, void *closure)
1193 struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(obj);
1194 PyObject *py_lhs_data;
1195 py_lhs_data = PyString_FromStringAndSize((char *)(object->lhs_data).data, (object->lhs_data).length);
1199 static int py_epm_lhs_set_lhs_data(PyObject *py_obj, PyObject *value, void *closure)
1201 struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(py_obj);
1202 object->lhs_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
1206 static PyGetSetDef py_epm_lhs_getsetters[] = {
1207 { discard_const_p(char, "protocol"), py_epm_lhs_get_protocol, py_epm_lhs_set_protocol },
1208 { discard_const_p(char, "lhs_data"), py_epm_lhs_get_lhs_data, py_epm_lhs_set_lhs_data },
1212 static PyObject *py_epm_lhs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1214 return pytalloc_new(struct epm_lhs, type);
1218 static PyTypeObject epm_lhs_Type = {
1219 PyObject_HEAD_INIT(NULL) 0,
1220 .tp_name = "epmapper.epm_lhs",
1221 .tp_getset = py_epm_lhs_getsetters,
1223 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1224 .tp_basicsize = sizeof(pytalloc_Object),
1225 .tp_new = py_epm_lhs_new,
1229 static PyObject *py_epm_floor_get_lhs(PyObject *obj, void *closure)
1231 struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(obj);
1233 py_lhs = pytalloc_reference_ex(&epm_lhs_Type, pytalloc_get_mem_ctx(obj), &object->lhs);
1237 static int py_epm_floor_set_lhs(PyObject *py_obj, PyObject *value, void *closure)
1239 struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(py_obj);
1240 PY_CHECK_TYPE(&epm_lhs_Type, value, return -1;);
1241 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1245 object->lhs = *(struct epm_lhs *)pytalloc_get_ptr(value);
1249 static PyObject *py_epm_floor_get_rhs(PyObject *obj, void *closure)
1251 struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(obj);
1253 py_rhs = py_import_epm_rhs(pytalloc_get_mem_ctx(obj), object->lhs.protocol, &object->rhs);
1254 if (py_rhs == NULL) {
1260 static int py_epm_floor_set_rhs(PyObject *py_obj, PyObject *value, void *closure)
1262 struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(py_obj);
1264 union epm_rhs *rhs_switch_1;
1265 rhs_switch_1 = py_export_epm_rhs(pytalloc_get_mem_ctx(py_obj), object->lhs.protocol, value);
1266 if (rhs_switch_1 == NULL) {
1269 object->rhs = *rhs_switch_1;
1274 static PyGetSetDef py_epm_floor_getsetters[] = {
1275 { discard_const_p(char, "lhs"), py_epm_floor_get_lhs, py_epm_floor_set_lhs },
1276 { discard_const_p(char, "rhs"), py_epm_floor_get_rhs, py_epm_floor_set_rhs },
1280 static PyObject *py_epm_floor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1282 return pytalloc_new(struct epm_floor, type);
1286 static PyTypeObject epm_floor_Type = {
1287 PyObject_HEAD_INIT(NULL) 0,
1288 .tp_name = "epmapper.epm_floor",
1289 .tp_getset = py_epm_floor_getsetters,
1291 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1292 .tp_basicsize = sizeof(pytalloc_Object),
1293 .tp_new = py_epm_floor_new,
1297 static PyObject *py_epm_tower_get_num_floors(PyObject *obj, void *closure)
1299 struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(obj);
1300 PyObject *py_num_floors;
1301 py_num_floors = PyInt_FromLong(object->num_floors);
1302 return py_num_floors;
1305 static int py_epm_tower_set_num_floors(PyObject *py_obj, PyObject *value, void *closure)
1307 struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(py_obj);
1308 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1309 object->num_floors = PyInt_AsLong(value);
1313 static PyObject *py_epm_tower_get_floors(PyObject *obj, void *closure)
1315 struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(obj);
1316 PyObject *py_floors;
1317 py_floors = PyList_New(object->num_floors);
1318 if (py_floors == NULL) {
1323 for (floors_cntr_0 = 0; floors_cntr_0 < object->num_floors; floors_cntr_0++) {
1324 PyObject *py_floors_0;
1325 py_floors_0 = pytalloc_reference_ex(&epm_floor_Type, object->floors, &object->floors[floors_cntr_0]);
1326 PyList_SetItem(py_floors, floors_cntr_0, py_floors_0);
1332 static int py_epm_tower_set_floors(PyObject *py_obj, PyObject *value, void *closure)
1334 struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(py_obj);
1335 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1338 object->floors = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->floors, PyList_GET_SIZE(value));
1339 if (!object->floors) { return -1;; }
1340 talloc_set_name_const(object->floors, "ARRAY: object->floors");
1341 for (floors_cntr_0 = 0; floors_cntr_0 < PyList_GET_SIZE(value); floors_cntr_0++) {
1342 PY_CHECK_TYPE(&epm_floor_Type, PyList_GET_ITEM(value, floors_cntr_0), return -1;);
1343 if (talloc_reference(object->floors, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, floors_cntr_0))) == NULL) {
1347 object->floors[floors_cntr_0] = *(struct epm_floor *)pytalloc_get_ptr(PyList_GET_ITEM(value, floors_cntr_0));
1353 static PyGetSetDef py_epm_tower_getsetters[] = {
1354 { discard_const_p(char, "num_floors"), py_epm_tower_get_num_floors, py_epm_tower_set_num_floors },
1355 { discard_const_p(char, "floors"), py_epm_tower_get_floors, py_epm_tower_set_floors },
1359 static PyObject *py_epm_tower_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1361 return pytalloc_new(struct epm_tower, type);
1365 static PyTypeObject epm_tower_Type = {
1366 PyObject_HEAD_INIT(NULL) 0,
1367 .tp_name = "epmapper.epm_tower",
1368 .tp_getset = py_epm_tower_getsetters,
1370 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1371 .tp_basicsize = sizeof(pytalloc_Object),
1372 .tp_new = py_epm_tower_new,
1376 static PyObject *py_epm_twr_t_get_tower_length(PyObject *obj, void *closure)
1378 struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(obj);
1379 PyObject *py_tower_length;
1380 py_tower_length = PyInt_FromLong(object->tower_length);
1381 return py_tower_length;
1384 static int py_epm_twr_t_set_tower_length(PyObject *py_obj, PyObject *value, void *closure)
1386 struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(py_obj);
1387 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1388 object->tower_length = PyInt_AsLong(value);
1392 static PyObject *py_epm_twr_t_get_tower(PyObject *obj, void *closure)
1394 struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(obj);
1396 py_tower = pytalloc_reference_ex(&epm_tower_Type, pytalloc_get_mem_ctx(obj), &object->tower);
1400 static int py_epm_twr_t_set_tower(PyObject *py_obj, PyObject *value, void *closure)
1402 struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(py_obj);
1403 PY_CHECK_TYPE(&epm_tower_Type, value, return -1;);
1404 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1408 object->tower = *(struct epm_tower *)pytalloc_get_ptr(value);
1412 static PyGetSetDef py_epm_twr_t_getsetters[] = {
1413 { discard_const_p(char, "tower_length"), py_epm_twr_t_get_tower_length, py_epm_twr_t_set_tower_length },
1414 { discard_const_p(char, "tower"), py_epm_twr_t_get_tower, py_epm_twr_t_set_tower },
1418 static PyObject *py_epm_twr_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1420 return pytalloc_new(struct epm_twr_t, type);
1424 static PyTypeObject epm_twr_t_Type = {
1425 PyObject_HEAD_INIT(NULL) 0,
1426 .tp_name = "epmapper.epm_twr_t",
1427 .tp_getset = py_epm_twr_t_getsetters,
1429 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1430 .tp_basicsize = sizeof(pytalloc_Object),
1431 .tp_new = py_epm_twr_t_new,
1435 static PyObject *py_epm_entry_t_get_object(PyObject *obj, void *closure)
1437 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
1438 PyObject *py_object;
1439 py_object = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->object);
1443 static int py_epm_entry_t_set_object(PyObject *py_obj, PyObject *value, void *closure)
1445 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
1446 PY_CHECK_TYPE(GUID_Type, value, return -1;);
1447 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1451 object->object = *(struct GUID *)pytalloc_get_ptr(value);
1455 static PyObject *py_epm_entry_t_get_tower(PyObject *obj, void *closure)
1457 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
1459 if (object->tower == NULL) {
1461 Py_INCREF(py_tower);
1463 py_tower = pytalloc_reference_ex(&epm_twr_t_Type, object->tower, object->tower);
1468 static int py_epm_entry_t_set_tower(PyObject *py_obj, PyObject *value, void *closure)
1470 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
1471 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->tower);
1472 if (value == Py_None) {
1473 object->tower = NULL;
1475 object->tower = NULL;
1476 PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
1477 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1481 object->tower = (struct epm_twr_t *)pytalloc_get_ptr(value);
1486 static PyObject *py_epm_entry_t_get___annotation_offset(PyObject *obj, void *closure)
1488 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
1489 PyObject *py___annotation_offset;
1490 py___annotation_offset = PyInt_FromLong(object->__annotation_offset);
1491 return py___annotation_offset;
1494 static int py_epm_entry_t_set___annotation_offset(PyObject *py_obj, PyObject *value, void *closure)
1496 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
1497 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1498 object->__annotation_offset = PyInt_AsLong(value);
1502 static PyObject *py_epm_entry_t_get___annotation_length(PyObject *obj, void *closure)
1504 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
1505 PyObject *py___annotation_length;
1506 py___annotation_length = PyInt_FromLong(object->__annotation_length);
1507 return py___annotation_length;
1510 static int py_epm_entry_t_set___annotation_length(PyObject *py_obj, PyObject *value, void *closure)
1512 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
1513 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1514 object->__annotation_length = PyInt_AsLong(value);
1518 static PyObject *py_epm_entry_t_get_annotation(PyObject *obj, void *closure)
1520 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
1521 PyObject *py_annotation;
1522 if (object->annotation == NULL) {
1523 py_annotation = Py_None;
1524 Py_INCREF(py_annotation);
1526 py_annotation = PyUnicode_Decode(object->annotation, strlen(object->annotation), "utf-8", "ignore");
1528 return py_annotation;
1531 static int py_epm_entry_t_set_annotation(PyObject *py_obj, PyObject *value, void *closure)
1533 struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(py_obj);
1534 if (PyUnicode_Check(value)) {
1535 object->annotation = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
1536 } else if (PyString_Check(value)) {
1537 object->annotation = PyString_AS_STRING(value);
1539 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1545 static PyGetSetDef py_epm_entry_t_getsetters[] = {
1546 { discard_const_p(char, "object"), py_epm_entry_t_get_object, py_epm_entry_t_set_object },
1547 { discard_const_p(char, "tower"), py_epm_entry_t_get_tower, py_epm_entry_t_set_tower },
1548 { discard_const_p(char, "__annotation_offset"), py_epm_entry_t_get___annotation_offset, py_epm_entry_t_set___annotation_offset },
1549 { discard_const_p(char, "__annotation_length"), py_epm_entry_t_get___annotation_length, py_epm_entry_t_set___annotation_length },
1550 { discard_const_p(char, "annotation"), py_epm_entry_t_get_annotation, py_epm_entry_t_set_annotation },
1554 static PyObject *py_epm_entry_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1556 return pytalloc_new(struct epm_entry_t, type);
1560 static PyTypeObject epm_entry_t_Type = {
1561 PyObject_HEAD_INIT(NULL) 0,
1562 .tp_name = "epmapper.epm_entry_t",
1563 .tp_getset = py_epm_entry_t_getsetters,
1565 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1566 .tp_basicsize = sizeof(pytalloc_Object),
1567 .tp_new = py_epm_entry_t_new,
1571 static PyObject *py_rpc_if_id_t_get_uuid(PyObject *obj, void *closure)
1573 struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(obj);
1575 py_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->uuid);
1579 static int py_rpc_if_id_t_set_uuid(PyObject *py_obj, PyObject *value, void *closure)
1581 struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(py_obj);
1582 PY_CHECK_TYPE(GUID_Type, value, return -1;);
1583 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1587 object->uuid = *(struct GUID *)pytalloc_get_ptr(value);
1591 static PyObject *py_rpc_if_id_t_get_vers_major(PyObject *obj, void *closure)
1593 struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(obj);
1594 PyObject *py_vers_major;
1595 py_vers_major = PyInt_FromLong(object->vers_major);
1596 return py_vers_major;
1599 static int py_rpc_if_id_t_set_vers_major(PyObject *py_obj, PyObject *value, void *closure)
1601 struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(py_obj);
1602 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1603 object->vers_major = PyInt_AsLong(value);
1607 static PyObject *py_rpc_if_id_t_get_vers_minor(PyObject *obj, void *closure)
1609 struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(obj);
1610 PyObject *py_vers_minor;
1611 py_vers_minor = PyInt_FromLong(object->vers_minor);
1612 return py_vers_minor;
1615 static int py_rpc_if_id_t_set_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
1617 struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(py_obj);
1618 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1619 object->vers_minor = PyInt_AsLong(value);
1623 static PyGetSetDef py_rpc_if_id_t_getsetters[] = {
1624 { discard_const_p(char, "uuid"), py_rpc_if_id_t_get_uuid, py_rpc_if_id_t_set_uuid },
1625 { discard_const_p(char, "vers_major"), py_rpc_if_id_t_get_vers_major, py_rpc_if_id_t_set_vers_major },
1626 { discard_const_p(char, "vers_minor"), py_rpc_if_id_t_get_vers_minor, py_rpc_if_id_t_set_vers_minor },
1630 static PyObject *py_rpc_if_id_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1632 return pytalloc_new(struct rpc_if_id_t, type);
1636 static PyTypeObject rpc_if_id_t_Type = {
1637 PyObject_HEAD_INIT(NULL) 0,
1638 .tp_name = "epmapper.rpc_if_id_t",
1639 .tp_getset = py_rpc_if_id_t_getsetters,
1641 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1642 .tp_basicsize = sizeof(pytalloc_Object),
1643 .tp_new = py_rpc_if_id_t_new,
1647 static PyObject *py_epm_twr_p_t_get_twr(PyObject *obj, void *closure)
1649 struct epm_twr_p_t *object = (struct epm_twr_p_t *)pytalloc_get_ptr(obj);
1651 if (object->twr == NULL) {
1655 py_twr = pytalloc_reference_ex(&epm_twr_t_Type, object->twr, object->twr);
1660 static int py_epm_twr_p_t_set_twr(PyObject *py_obj, PyObject *value, void *closure)
1662 struct epm_twr_p_t *object = (struct epm_twr_p_t *)pytalloc_get_ptr(py_obj);
1663 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->twr);
1664 if (value == Py_None) {
1668 PY_CHECK_TYPE(&epm_twr_t_Type, value, return -1;);
1669 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1673 object->twr = (struct epm_twr_t *)pytalloc_get_ptr(value);
1678 static PyGetSetDef py_epm_twr_p_t_getsetters[] = {
1679 { discard_const_p(char, "twr"), py_epm_twr_p_t_get_twr, py_epm_twr_p_t_set_twr },
1683 static PyObject *py_epm_twr_p_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1685 return pytalloc_new(struct epm_twr_p_t, type);
1689 static PyTypeObject epm_twr_p_t_Type = {
1690 PyObject_HEAD_INIT(NULL) 0,
1691 .tp_name = "epmapper.epm_twr_p_t",
1692 .tp_getset = py_epm_twr_p_t_getsetters,
1694 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1695 .tp_basicsize = sizeof(pytalloc_Object),
1696 .tp_new = py_epm_twr_p_t_new,
1700 static bool pack_py_epm_Insert_args_in(PyObject *args, PyObject *kwargs, struct epm_Insert *r)
1702 PyObject *py_entries;
1703 PyObject *py_replace;
1704 const char *kwnames[] = {
1705 "entries", "replace", NULL
1708 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:epm_Insert", discard_const_p(char *, kwnames), &py_entries, &py_replace)) {
1712 PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
1713 r->in.num_ents = PyList_GET_SIZE(py_entries);
1714 PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
1717 r->in.entries = talloc_array_ptrtype(r, r->in.entries, PyList_GET_SIZE(py_entries));
1718 if (!r->in.entries) { return false;; }
1719 talloc_set_name_const(r->in.entries, "ARRAY: r->in.entries");
1720 for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(py_entries); entries_cntr_0++) {
1721 PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(py_entries, entries_cntr_0), return false;);
1722 if (talloc_reference(r->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_entries, entries_cntr_0))) == NULL) {
1726 r->in.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(py_entries, entries_cntr_0));
1729 PY_CHECK_TYPE(&PyInt_Type, py_replace, return false;);
1730 r->in.replace = PyInt_AsLong(py_replace);
1734 static PyObject *unpack_py_epm_Insert_args_out(struct epm_Insert *r)
1737 result = PyInt_FromLong(r->out.result);
1741 static bool pack_py_epm_Delete_args_in(PyObject *args, PyObject *kwargs, struct epm_Delete *r)
1743 PyObject *py_entries;
1744 const char *kwnames[] = {
1748 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_Delete", discard_const_p(char *, kwnames), &py_entries)) {
1752 PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
1753 r->in.num_ents = PyList_GET_SIZE(py_entries);
1754 PY_CHECK_TYPE(&PyList_Type, py_entries, return false;);
1757 r->in.entries = talloc_array_ptrtype(r, r->in.entries, PyList_GET_SIZE(py_entries));
1758 if (!r->in.entries) { return false;; }
1759 talloc_set_name_const(r->in.entries, "ARRAY: r->in.entries");
1760 for (entries_cntr_0 = 0; entries_cntr_0 < PyList_GET_SIZE(py_entries); entries_cntr_0++) {
1761 PY_CHECK_TYPE(&epm_entry_t_Type, PyList_GET_ITEM(py_entries, entries_cntr_0), return false;);
1762 if (talloc_reference(r->in.entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_entries, entries_cntr_0))) == NULL) {
1766 r->in.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(py_entries, entries_cntr_0));
1772 static PyObject *unpack_py_epm_Delete_args_out(struct epm_Delete *r)
1775 result = PyInt_FromLong(r->out.result);
1779 static bool pack_py_epm_Lookup_args_in(PyObject *args, PyObject *kwargs, struct epm_Lookup *r)
1781 PyObject *py_inquiry_type;
1782 PyObject *py_object;
1783 PyObject *py_interface_id;
1784 PyObject *py_vers_option;
1785 PyObject *py_entry_handle;
1786 PyObject *py_max_ents;
1787 const char *kwnames[] = {
1788 "inquiry_type", "object", "interface_id", "vers_option", "entry_handle", "max_ents", NULL
1791 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)) {
1795 if (PyLong_Check(py_inquiry_type)) {
1796 r->in.inquiry_type = PyLong_AsLongLong(py_inquiry_type);
1797 } else if (PyInt_Check(py_inquiry_type)) {
1798 r->in.inquiry_type = PyInt_AsLong(py_inquiry_type);
1800 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1801 PyInt_Type.tp_name, PyLong_Type.tp_name);
1804 if (py_object == Py_None) {
1805 r->in.object = NULL;
1807 r->in.object = NULL;
1808 PY_CHECK_TYPE(GUID_Type, py_object, return false;);
1809 if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
1813 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
1815 if (py_interface_id == Py_None) {
1816 r->in.interface_id = NULL;
1818 r->in.interface_id = NULL;
1819 PY_CHECK_TYPE(&rpc_if_id_t_Type, py_interface_id, return false;);
1820 if (talloc_reference(r, pytalloc_get_mem_ctx(py_interface_id)) == NULL) {
1824 r->in.interface_id = (struct rpc_if_id_t *)pytalloc_get_ptr(py_interface_id);
1826 if (PyLong_Check(py_vers_option)) {
1827 r->in.vers_option = PyLong_AsLongLong(py_vers_option);
1828 } else if (PyInt_Check(py_vers_option)) {
1829 r->in.vers_option = PyInt_AsLong(py_vers_option);
1831 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1832 PyInt_Type.tp_name, PyLong_Type.tp_name);
1835 r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
1836 PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
1837 if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
1841 r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
1842 PY_CHECK_TYPE(&PyInt_Type, py_max_ents, return false;);
1843 r->in.max_ents = PyInt_AsLong(py_max_ents);
1847 static PyObject *unpack_py_epm_Lookup_args_out(struct epm_Lookup *r)
1850 PyObject *py_entry_handle;
1851 PyObject *py_entries;
1852 result = PyTuple_New(3);
1853 py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
1854 PyTuple_SetItem(result, 0, py_entry_handle);
1855 py_entries = PyList_New(*r->out.num_ents);
1856 if (py_entries == NULL) {
1861 for (entries_cntr_0 = 0; entries_cntr_0 < *r->out.num_ents; entries_cntr_0++) {
1862 PyObject *py_entries_0;
1863 py_entries_0 = pytalloc_reference_ex(&epm_entry_t_Type, r->out.entries, &r->out.entries[entries_cntr_0]);
1864 PyList_SetItem(py_entries, entries_cntr_0, py_entries_0);
1867 PyTuple_SetItem(result, 1, py_entries);
1868 PyTuple_SetItem(result, 2, PyInt_FromLong(r->out.result));
1872 static bool pack_py_epm_Map_args_in(PyObject *args, PyObject *kwargs, struct epm_Map *r)
1874 PyObject *py_object;
1875 PyObject *py_map_tower;
1876 PyObject *py_entry_handle;
1877 PyObject *py_max_towers;
1878 const char *kwnames[] = {
1879 "object", "map_tower", "entry_handle", "max_towers", NULL
1882 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:epm_Map", discard_const_p(char *, kwnames), &py_object, &py_map_tower, &py_entry_handle, &py_max_towers)) {
1886 if (py_object == Py_None) {
1887 r->in.object = NULL;
1889 r->in.object = NULL;
1890 PY_CHECK_TYPE(GUID_Type, py_object, return false;);
1891 if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
1895 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
1897 if (py_map_tower == Py_None) {
1898 r->in.map_tower = NULL;
1900 r->in.map_tower = NULL;
1901 PY_CHECK_TYPE(&epm_twr_t_Type, py_map_tower, return false;);
1902 if (talloc_reference(r, pytalloc_get_mem_ctx(py_map_tower)) == NULL) {
1906 r->in.map_tower = (struct epm_twr_t *)pytalloc_get_ptr(py_map_tower);
1908 r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
1909 PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
1910 if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
1914 r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
1915 PY_CHECK_TYPE(&PyInt_Type, py_max_towers, return false;);
1916 r->in.max_towers = PyInt_AsLong(py_max_towers);
1920 static PyObject *unpack_py_epm_Map_args_out(struct epm_Map *r)
1923 PyObject *py_entry_handle;
1924 PyObject *py_towers;
1925 result = PyTuple_New(3);
1926 py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
1927 PyTuple_SetItem(result, 0, py_entry_handle);
1928 py_towers = PyList_New(*r->out.num_towers);
1929 if (py_towers == NULL) {
1934 for (towers_cntr_0 = 0; towers_cntr_0 < *r->out.num_towers; towers_cntr_0++) {
1935 PyObject *py_towers_0;
1936 py_towers_0 = pytalloc_reference_ex(&epm_twr_p_t_Type, r->out.towers, &r->out.towers[towers_cntr_0]);
1937 PyList_SetItem(py_towers, towers_cntr_0, py_towers_0);
1940 PyTuple_SetItem(result, 1, py_towers);
1941 PyTuple_SetItem(result, 2, PyInt_FromLong(r->out.result));
1945 static bool pack_py_epm_LookupHandleFree_args_in(PyObject *args, PyObject *kwargs, struct epm_LookupHandleFree *r)
1947 PyObject *py_entry_handle;
1948 const char *kwnames[] = {
1949 "entry_handle", NULL
1952 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_LookupHandleFree", discard_const_p(char *, kwnames), &py_entry_handle)) {
1956 r->in.entry_handle = talloc_ptrtype(r, r->in.entry_handle);
1957 PY_CHECK_TYPE(policy_handle_Type, py_entry_handle, return false;);
1958 if (talloc_reference(r, pytalloc_get_mem_ctx(py_entry_handle)) == NULL) {
1962 r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
1966 static PyObject *unpack_py_epm_LookupHandleFree_args_out(struct epm_LookupHandleFree *r)
1969 PyObject *py_entry_handle;
1970 result = PyTuple_New(2);
1971 py_entry_handle = pytalloc_reference_ex(policy_handle_Type, r->out.entry_handle, r->out.entry_handle);
1972 PyTuple_SetItem(result, 0, py_entry_handle);
1973 PyTuple_SetItem(result, 1, PyInt_FromLong(r->out.result));
1977 static bool pack_py_epm_InqObject_args_in(PyObject *args, PyObject *kwargs, struct epm_InqObject *r)
1979 PyObject *py_epm_object;
1980 const char *kwnames[] = {
1984 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_InqObject", discard_const_p(char *, kwnames), &py_epm_object)) {
1988 r->in.epm_object = talloc_ptrtype(r, r->in.epm_object);
1989 PY_CHECK_TYPE(GUID_Type, py_epm_object, return false;);
1990 if (talloc_reference(r, pytalloc_get_mem_ctx(py_epm_object)) == NULL) {
1994 r->in.epm_object = (struct GUID *)pytalloc_get_ptr(py_epm_object);
1998 static PyObject *unpack_py_epm_InqObject_args_out(struct epm_InqObject *r)
2001 result = PyInt_FromLong(r->out.result);
2005 static bool pack_py_epm_MgmtDelete_args_in(PyObject *args, PyObject *kwargs, struct epm_MgmtDelete *r)
2007 PyObject *py_object_speced;
2008 PyObject *py_object;
2010 const char *kwnames[] = {
2011 "object_speced", "object", "tower", NULL
2014 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:epm_MgmtDelete", discard_const_p(char *, kwnames), &py_object_speced, &py_object, &py_tower)) {
2018 PY_CHECK_TYPE(&PyInt_Type, py_object_speced, return false;);
2019 r->in.object_speced = PyInt_AsLong(py_object_speced);
2020 if (py_object == Py_None) {
2021 r->in.object = NULL;
2023 r->in.object = NULL;
2024 PY_CHECK_TYPE(GUID_Type, py_object, return false;);
2025 if (talloc_reference(r, pytalloc_get_mem_ctx(py_object)) == NULL) {
2029 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
2031 if (py_tower == Py_None) {
2035 PY_CHECK_TYPE(&epm_twr_t_Type, py_tower, return false;);
2036 if (talloc_reference(r, pytalloc_get_mem_ctx(py_tower)) == NULL) {
2040 r->in.tower = (struct epm_twr_t *)pytalloc_get_ptr(py_tower);
2045 static PyObject *unpack_py_epm_MgmtDelete_args_out(struct epm_MgmtDelete *r)
2048 result = PyInt_FromLong(r->out.result);
2052 const struct PyNdrRpcMethodDef py_ndr_epmapper_methods[] = {
2053 { "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 },
2054 { "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 },
2055 { "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 },
2056 { "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 },
2057 { "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 },
2058 { "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 },
2059 { "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 },
2063 static PyObject *interface_epmapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2065 return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_epmapper);
2068 #define PY_DOC_EPMAPPER "EndPoint Mapper"
2069 static PyTypeObject epmapper_InterfaceType = {
2070 PyObject_HEAD_INIT(NULL) 0,
2071 .tp_name = "epmapper.epmapper",
2072 .tp_basicsize = sizeof(dcerpc_InterfaceObject),
2073 .tp_doc = "epmapper(binding, lp_ctx=None, credentials=None) -> connection\n"
2075 "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
2076 "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
2077 "credentials should be a credentials.Credentials object.\n\n"PY_DOC_EPMAPPER,
2078 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2079 .tp_new = interface_epmapper_new,
2082 static PyObject *syntax_epmapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2084 return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_epmapper.syntax_id);
2087 #define PY_DOC_EPMAPPER_SYNTAX "EndPoint Mapper"
2088 static PyTypeObject epmapper_SyntaxType = {
2089 PyObject_HEAD_INIT(NULL) 0,
2090 .tp_name = "epmapper.epmapper",
2091 .tp_basicsize = sizeof(pytalloc_Object),
2092 .tp_doc = "abstract_syntax()\n"PY_DOC_EPMAPPER_SYNTAX,
2093 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2094 .tp_new = syntax_epmapper_new,
2097 static PyMethodDef epmapper_methods[] = {
2098 { NULL, NULL, 0, NULL }
2101 void initepmapper(void)
2104 PyObject *dep_samba_dcerpc_misc;
2105 PyObject *dep_talloc;
2106 PyObject *dep_samba_dcerpc_base;
2108 dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
2109 if (dep_samba_dcerpc_misc == NULL)
2112 dep_talloc = PyImport_ImportModule("talloc");
2113 if (dep_talloc == NULL)
2116 dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
2117 if (dep_samba_dcerpc_base == NULL)
2120 Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
2121 if (Object_Type == NULL)
2124 GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
2125 if (GUID_Type == NULL)
2128 policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
2129 if (policy_handle_Type == NULL)
2132 ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
2133 if (ClientConnection_Type == NULL)
2136 ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
2137 if (ndr_syntax_id_Type == NULL)
2140 epm_rhs_dnet_nsp_Type.tp_base = Object_Type;
2142 epm_rhs_osi_tp4_Type.tp_base = Object_Type;
2144 epm_rhs_osi_clns_Type.tp_base = Object_Type;
2146 epm_rhs_udp_Type.tp_base = Object_Type;
2148 epm_rhs_tcp_Type.tp_base = Object_Type;
2150 epm_rhs_ip_Type.tp_base = Object_Type;
2152 epm_rhs_ncadg_Type.tp_base = Object_Type;
2154 epm_rhs_ncacn_Type.tp_base = Object_Type;
2156 epm_rhs_uuid_Type.tp_base = Object_Type;
2158 epm_rhs_ipx_Type.tp_base = Object_Type;
2160 epm_rhs_smb_Type.tp_base = Object_Type;
2162 epm_rhs_named_pipe_Type.tp_base = Object_Type;
2164 epm_rhs_netbios_Type.tp_base = Object_Type;
2166 epm_rhs_netbeui_Type.tp_base = Object_Type;
2168 epm_rhs_spx_Type.tp_base = Object_Type;
2170 epm_rhs_nb_ipx_Type.tp_base = Object_Type;
2172 epm_rhs_http_Type.tp_base = Object_Type;
2174 epm_rhs_unix_ds_Type.tp_base = Object_Type;
2176 epm_rhs_null_Type.tp_base = Object_Type;
2178 epm_rhs_ncalrpc_Type.tp_base = Object_Type;
2180 epm_rhs_appletalk_Type.tp_base = Object_Type;
2182 epm_rhs_atalk_stream_Type.tp_base = Object_Type;
2184 epm_rhs_atalk_datagram_Type.tp_base = Object_Type;
2186 epm_rhs_vines_spp_Type.tp_base = Object_Type;
2188 epm_rhs_vines_ipc_Type.tp_base = Object_Type;
2190 epm_rhs_streettalk_Type.tp_base = Object_Type;
2192 epm_lhs_Type.tp_base = Object_Type;
2194 epm_floor_Type.tp_base = Object_Type;
2196 epm_tower_Type.tp_base = Object_Type;
2198 epm_twr_t_Type.tp_base = Object_Type;
2200 epm_entry_t_Type.tp_base = Object_Type;
2202 rpc_if_id_t_Type.tp_base = Object_Type;
2204 epm_twr_p_t_Type.tp_base = Object_Type;
2206 epmapper_InterfaceType.tp_base = ClientConnection_Type;
2208 epmapper_SyntaxType.tp_base = ndr_syntax_id_Type;
2210 if (PyType_Ready(&epm_rhs_dnet_nsp_Type) < 0)
2212 if (PyType_Ready(&epm_rhs_osi_tp4_Type) < 0)
2214 if (PyType_Ready(&epm_rhs_osi_clns_Type) < 0)
2216 if (PyType_Ready(&epm_rhs_udp_Type) < 0)
2218 if (PyType_Ready(&epm_rhs_tcp_Type) < 0)
2220 if (PyType_Ready(&epm_rhs_ip_Type) < 0)
2222 if (PyType_Ready(&epm_rhs_ncadg_Type) < 0)
2224 if (PyType_Ready(&epm_rhs_ncacn_Type) < 0)
2226 if (PyType_Ready(&epm_rhs_uuid_Type) < 0)
2228 if (PyType_Ready(&epm_rhs_ipx_Type) < 0)
2230 if (PyType_Ready(&epm_rhs_smb_Type) < 0)
2232 if (PyType_Ready(&epm_rhs_named_pipe_Type) < 0)
2234 if (PyType_Ready(&epm_rhs_netbios_Type) < 0)
2236 if (PyType_Ready(&epm_rhs_netbeui_Type) < 0)
2238 if (PyType_Ready(&epm_rhs_spx_Type) < 0)
2240 if (PyType_Ready(&epm_rhs_nb_ipx_Type) < 0)
2242 if (PyType_Ready(&epm_rhs_http_Type) < 0)
2244 if (PyType_Ready(&epm_rhs_unix_ds_Type) < 0)
2246 if (PyType_Ready(&epm_rhs_null_Type) < 0)
2248 if (PyType_Ready(&epm_rhs_ncalrpc_Type) < 0)
2250 if (PyType_Ready(&epm_rhs_appletalk_Type) < 0)
2252 if (PyType_Ready(&epm_rhs_atalk_stream_Type) < 0)
2254 if (PyType_Ready(&epm_rhs_atalk_datagram_Type) < 0)
2256 if (PyType_Ready(&epm_rhs_vines_spp_Type) < 0)
2258 if (PyType_Ready(&epm_rhs_vines_ipc_Type) < 0)
2260 if (PyType_Ready(&epm_rhs_streettalk_Type) < 0)
2262 if (PyType_Ready(&epm_lhs_Type) < 0)
2264 if (PyType_Ready(&epm_floor_Type) < 0)
2266 if (PyType_Ready(&epm_tower_Type) < 0)
2268 if (PyType_Ready(&epm_twr_t_Type) < 0)
2270 if (PyType_Ready(&epm_entry_t_Type) < 0)
2272 if (PyType_Ready(&rpc_if_id_t_Type) < 0)
2274 if (PyType_Ready(&epm_twr_p_t_Type) < 0)
2276 if (PyType_Ready(&epmapper_InterfaceType) < 0)
2278 if (PyType_Ready(&epmapper_SyntaxType) < 0)
2280 if (!PyInterface_AddNdrRpcMethods(&epmapper_InterfaceType, py_ndr_epmapper_methods))
2283 #ifdef PY_EPM_RHS_DNET_NSP_PATCH
2284 PY_EPM_RHS_DNET_NSP_PATCH(&epm_rhs_dnet_nsp_Type);
2286 #ifdef PY_EPM_RHS_OSI_TP4_PATCH
2287 PY_EPM_RHS_OSI_TP4_PATCH(&epm_rhs_osi_tp4_Type);
2289 #ifdef PY_EPM_RHS_OSI_CLNS_PATCH
2290 PY_EPM_RHS_OSI_CLNS_PATCH(&epm_rhs_osi_clns_Type);
2292 #ifdef PY_EPM_RHS_UDP_PATCH
2293 PY_EPM_RHS_UDP_PATCH(&epm_rhs_udp_Type);
2295 #ifdef PY_EPM_RHS_TCP_PATCH
2296 PY_EPM_RHS_TCP_PATCH(&epm_rhs_tcp_Type);
2298 #ifdef PY_EPM_RHS_IP_PATCH
2299 PY_EPM_RHS_IP_PATCH(&epm_rhs_ip_Type);
2301 #ifdef PY_EPM_RHS_NCADG_PATCH
2302 PY_EPM_RHS_NCADG_PATCH(&epm_rhs_ncadg_Type);
2304 #ifdef PY_EPM_RHS_NCACN_PATCH
2305 PY_EPM_RHS_NCACN_PATCH(&epm_rhs_ncacn_Type);
2307 #ifdef PY_EPM_RHS_UUID_PATCH
2308 PY_EPM_RHS_UUID_PATCH(&epm_rhs_uuid_Type);
2310 #ifdef PY_EPM_RHS_IPX_PATCH
2311 PY_EPM_RHS_IPX_PATCH(&epm_rhs_ipx_Type);
2313 #ifdef PY_EPM_RHS_SMB_PATCH
2314 PY_EPM_RHS_SMB_PATCH(&epm_rhs_smb_Type);
2316 #ifdef PY_EPM_RHS_NAMED_PIPE_PATCH
2317 PY_EPM_RHS_NAMED_PIPE_PATCH(&epm_rhs_named_pipe_Type);
2319 #ifdef PY_EPM_RHS_NETBIOS_PATCH
2320 PY_EPM_RHS_NETBIOS_PATCH(&epm_rhs_netbios_Type);
2322 #ifdef PY_EPM_RHS_NETBEUI_PATCH
2323 PY_EPM_RHS_NETBEUI_PATCH(&epm_rhs_netbeui_Type);
2325 #ifdef PY_EPM_RHS_SPX_PATCH
2326 PY_EPM_RHS_SPX_PATCH(&epm_rhs_spx_Type);
2328 #ifdef PY_EPM_RHS_NB_IPX_PATCH
2329 PY_EPM_RHS_NB_IPX_PATCH(&epm_rhs_nb_ipx_Type);
2331 #ifdef PY_EPM_RHS_HTTP_PATCH
2332 PY_EPM_RHS_HTTP_PATCH(&epm_rhs_http_Type);
2334 #ifdef PY_EPM_RHS_UNIX_DS_PATCH
2335 PY_EPM_RHS_UNIX_DS_PATCH(&epm_rhs_unix_ds_Type);
2337 #ifdef PY_EPM_RHS_NULL_PATCH
2338 PY_EPM_RHS_NULL_PATCH(&epm_rhs_null_Type);
2340 #ifdef PY_EPM_RHS_NCALRPC_PATCH
2341 PY_EPM_RHS_NCALRPC_PATCH(&epm_rhs_ncalrpc_Type);
2343 #ifdef PY_EPM_RHS_APPLETALK_PATCH
2344 PY_EPM_RHS_APPLETALK_PATCH(&epm_rhs_appletalk_Type);
2346 #ifdef PY_EPM_RHS_ATALK_STREAM_PATCH
2347 PY_EPM_RHS_ATALK_STREAM_PATCH(&epm_rhs_atalk_stream_Type);
2349 #ifdef PY_EPM_RHS_ATALK_DATAGRAM_PATCH
2350 PY_EPM_RHS_ATALK_DATAGRAM_PATCH(&epm_rhs_atalk_datagram_Type);
2352 #ifdef PY_EPM_RHS_VINES_SPP_PATCH
2353 PY_EPM_RHS_VINES_SPP_PATCH(&epm_rhs_vines_spp_Type);
2355 #ifdef PY_EPM_RHS_VINES_IPC_PATCH
2356 PY_EPM_RHS_VINES_IPC_PATCH(&epm_rhs_vines_ipc_Type);
2358 #ifdef PY_EPM_RHS_STREETTALK_PATCH
2359 PY_EPM_RHS_STREETTALK_PATCH(&epm_rhs_streettalk_Type);
2361 #ifdef PY_EPM_LHS_PATCH
2362 PY_EPM_LHS_PATCH(&epm_lhs_Type);
2364 #ifdef PY_EPM_FLOOR_PATCH
2365 PY_EPM_FLOOR_PATCH(&epm_floor_Type);
2367 #ifdef PY_EPM_TOWER_PATCH
2368 PY_EPM_TOWER_PATCH(&epm_tower_Type);
2370 #ifdef PY_EPM_TWR_T_PATCH
2371 PY_EPM_TWR_T_PATCH(&epm_twr_t_Type);
2373 #ifdef PY_EPM_ENTRY_T_PATCH
2374 PY_EPM_ENTRY_T_PATCH(&epm_entry_t_Type);
2376 #ifdef PY_RPC_IF_ID_T_PATCH
2377 PY_RPC_IF_ID_T_PATCH(&rpc_if_id_t_Type);
2379 #ifdef PY_EPM_TWR_P_T_PATCH
2380 PY_EPM_TWR_P_T_PATCH(&epm_twr_p_t_Type);
2382 #ifdef PY_EPMAPPER_PATCH
2383 PY_EPMAPPER_PATCH(&epmapper_InterfaceType);
2385 #ifdef PY_ABSTRACT_SYNTAX_PATCH
2386 PY_ABSTRACT_SYNTAX_PATCH(&epmapper_SyntaxType);
2389 m = Py_InitModule3("epmapper", epmapper_methods, "epmapper DCE/RPC");
2393 PyModule_AddObject(m, "EPMAPPER_STATUS_CANT_PERFORM_OP", PyInt_FromLong(0x6d8));
2394 PyModule_AddObject(m, "EPMAPPER_STATUS_NO_MORE_ENTRIES", PyInt_FromLong(0x16c9a0d6));
2395 PyModule_AddObject(m, "EPMAPPER_STATUS_NO_MEMORY", PyInt_FromLong(0x16C9A012));
2396 PyModule_AddObject(m, "EPMAPPER_STATUS_OK", PyInt_FromLong(0));
2397 PyModule_AddObject(m, "EPM_PROTOCOL_DNET_NSP", PyInt_FromLong(EPM_PROTOCOL_DNET_NSP));
2398 PyModule_AddObject(m, "EPM_PROTOCOL_OSI_TP4", PyInt_FromLong(EPM_PROTOCOL_OSI_TP4));
2399 PyModule_AddObject(m, "EPM_PROTOCOL_OSI_CLNS", PyInt_FromLong(EPM_PROTOCOL_OSI_CLNS));
2400 PyModule_AddObject(m, "EPM_PROTOCOL_TCP", PyInt_FromLong(EPM_PROTOCOL_TCP));
2401 PyModule_AddObject(m, "EPM_PROTOCOL_UDP", PyInt_FromLong(EPM_PROTOCOL_UDP));
2402 PyModule_AddObject(m, "EPM_PROTOCOL_IP", PyInt_FromLong(EPM_PROTOCOL_IP));
2403 PyModule_AddObject(m, "EPM_PROTOCOL_NCADG", PyInt_FromLong(EPM_PROTOCOL_NCADG));
2404 PyModule_AddObject(m, "EPM_PROTOCOL_NCACN", PyInt_FromLong(EPM_PROTOCOL_NCACN));
2405 PyModule_AddObject(m, "EPM_PROTOCOL_NCALRPC", PyInt_FromLong(EPM_PROTOCOL_NCALRPC));
2406 PyModule_AddObject(m, "EPM_PROTOCOL_UUID", PyInt_FromLong(EPM_PROTOCOL_UUID));
2407 PyModule_AddObject(m, "EPM_PROTOCOL_IPX", PyInt_FromLong(EPM_PROTOCOL_IPX));
2408 PyModule_AddObject(m, "EPM_PROTOCOL_SMB", PyInt_FromLong(EPM_PROTOCOL_SMB));
2409 PyModule_AddObject(m, "EPM_PROTOCOL_NAMED_PIPE", PyInt_FromLong(EPM_PROTOCOL_NAMED_PIPE));
2410 PyModule_AddObject(m, "EPM_PROTOCOL_NETBIOS", PyInt_FromLong(EPM_PROTOCOL_NETBIOS));
2411 PyModule_AddObject(m, "EPM_PROTOCOL_NETBEUI", PyInt_FromLong(EPM_PROTOCOL_NETBEUI));
2412 PyModule_AddObject(m, "EPM_PROTOCOL_SPX", PyInt_FromLong(EPM_PROTOCOL_SPX));
2413 PyModule_AddObject(m, "EPM_PROTOCOL_NB_IPX", PyInt_FromLong(EPM_PROTOCOL_NB_IPX));
2414 PyModule_AddObject(m, "EPM_PROTOCOL_DSP", PyInt_FromLong(EPM_PROTOCOL_DSP));
2415 PyModule_AddObject(m, "EPM_PROTOCOL_DDP", PyInt_FromLong(EPM_PROTOCOL_DDP));
2416 PyModule_AddObject(m, "EPM_PROTOCOL_APPLETALK", PyInt_FromLong(EPM_PROTOCOL_APPLETALK));
2417 PyModule_AddObject(m, "EPM_PROTOCOL_VINES_SPP", PyInt_FromLong(EPM_PROTOCOL_VINES_SPP));
2418 PyModule_AddObject(m, "EPM_PROTOCOL_VINES_IPC", PyInt_FromLong(EPM_PROTOCOL_VINES_IPC));
2419 PyModule_AddObject(m, "EPM_PROTOCOL_STREETTALK", PyInt_FromLong(EPM_PROTOCOL_STREETTALK));
2420 PyModule_AddObject(m, "EPM_PROTOCOL_HTTP", PyInt_FromLong(EPM_PROTOCOL_HTTP));
2421 PyModule_AddObject(m, "EPM_PROTOCOL_UNIX_DS", PyInt_FromLong(EPM_PROTOCOL_UNIX_DS));
2422 PyModule_AddObject(m, "EPM_PROTOCOL_NULL", PyInt_FromLong(EPM_PROTOCOL_NULL));
2423 PyModule_AddObject(m, "RPC_C_EP_ALL_ELTS", PyInt_FromLong(RPC_C_EP_ALL_ELTS));
2424 PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_IF", PyInt_FromLong(RPC_C_EP_MATCH_BY_IF));
2425 PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_OBJ", PyInt_FromLong(RPC_C_EP_MATCH_BY_OBJ));
2426 PyModule_AddObject(m, "RPC_C_EP_MATCH_BY_BOTH", PyInt_FromLong(RPC_C_EP_MATCH_BY_BOTH));
2427 PyModule_AddObject(m, "RPC_C_VERS_ALL", PyInt_FromLong(RPC_C_VERS_ALL));
2428 PyModule_AddObject(m, "RPC_C_VERS_COMPATIBLE", PyInt_FromLong(RPC_C_VERS_COMPATIBLE));
2429 PyModule_AddObject(m, "RPC_C_VERS_EXACT", PyInt_FromLong(RPC_C_VERS_EXACT));
2430 PyModule_AddObject(m, "RPC_C_VERS_MAJOR_ONLY", PyInt_FromLong(RPC_C_VERS_MAJOR_ONLY));
2431 PyModule_AddObject(m, "RPC_C_VERS_UPTO", PyInt_FromLong(RPC_C_VERS_UPTO));
2432 Py_INCREF((PyObject *)(void *)&epm_rhs_dnet_nsp_Type);
2433 PyModule_AddObject(m, "epm_rhs_dnet_nsp", (PyObject *)(void *)&epm_rhs_dnet_nsp_Type);
2434 Py_INCREF((PyObject *)(void *)&epm_rhs_osi_tp4_Type);
2435 PyModule_AddObject(m, "epm_rhs_osi_tp4", (PyObject *)(void *)&epm_rhs_osi_tp4_Type);
2436 Py_INCREF((PyObject *)(void *)&epm_rhs_osi_clns_Type);
2437 PyModule_AddObject(m, "epm_rhs_osi_clns", (PyObject *)(void *)&epm_rhs_osi_clns_Type);
2438 Py_INCREF((PyObject *)(void *)&epm_rhs_udp_Type);
2439 PyModule_AddObject(m, "epm_rhs_udp", (PyObject *)(void *)&epm_rhs_udp_Type);
2440 Py_INCREF((PyObject *)(void *)&epm_rhs_tcp_Type);
2441 PyModule_AddObject(m, "epm_rhs_tcp", (PyObject *)(void *)&epm_rhs_tcp_Type);
2442 Py_INCREF((PyObject *)(void *)&epm_rhs_ip_Type);
2443 PyModule_AddObject(m, "epm_rhs_ip", (PyObject *)(void *)&epm_rhs_ip_Type);
2444 Py_INCREF((PyObject *)(void *)&epm_rhs_ncadg_Type);
2445 PyModule_AddObject(m, "epm_rhs_ncadg", (PyObject *)(void *)&epm_rhs_ncadg_Type);
2446 Py_INCREF((PyObject *)(void *)&epm_rhs_ncacn_Type);
2447 PyModule_AddObject(m, "epm_rhs_ncacn", (PyObject *)(void *)&epm_rhs_ncacn_Type);
2448 Py_INCREF((PyObject *)(void *)&epm_rhs_uuid_Type);
2449 PyModule_AddObject(m, "epm_rhs_uuid", (PyObject *)(void *)&epm_rhs_uuid_Type);
2450 Py_INCREF((PyObject *)(void *)&epm_rhs_ipx_Type);
2451 PyModule_AddObject(m, "epm_rhs_ipx", (PyObject *)(void *)&epm_rhs_ipx_Type);
2452 Py_INCREF((PyObject *)(void *)&epm_rhs_smb_Type);
2453 PyModule_AddObject(m, "epm_rhs_smb", (PyObject *)(void *)&epm_rhs_smb_Type);
2454 Py_INCREF((PyObject *)(void *)&epm_rhs_named_pipe_Type);
2455 PyModule_AddObject(m, "epm_rhs_named_pipe", (PyObject *)(void *)&epm_rhs_named_pipe_Type);
2456 Py_INCREF((PyObject *)(void *)&epm_rhs_netbios_Type);
2457 PyModule_AddObject(m, "epm_rhs_netbios", (PyObject *)(void *)&epm_rhs_netbios_Type);
2458 Py_INCREF((PyObject *)(void *)&epm_rhs_netbeui_Type);
2459 PyModule_AddObject(m, "epm_rhs_netbeui", (PyObject *)(void *)&epm_rhs_netbeui_Type);
2460 Py_INCREF((PyObject *)(void *)&epm_rhs_spx_Type);
2461 PyModule_AddObject(m, "epm_rhs_spx", (PyObject *)(void *)&epm_rhs_spx_Type);
2462 Py_INCREF((PyObject *)(void *)&epm_rhs_nb_ipx_Type);
2463 PyModule_AddObject(m, "epm_rhs_nb_ipx", (PyObject *)(void *)&epm_rhs_nb_ipx_Type);
2464 Py_INCREF((PyObject *)(void *)&epm_rhs_http_Type);
2465 PyModule_AddObject(m, "epm_rhs_http", (PyObject *)(void *)&epm_rhs_http_Type);
2466 Py_INCREF((PyObject *)(void *)&epm_rhs_unix_ds_Type);
2467 PyModule_AddObject(m, "epm_rhs_unix_ds", (PyObject *)(void *)&epm_rhs_unix_ds_Type);
2468 Py_INCREF((PyObject *)(void *)&epm_rhs_null_Type);
2469 PyModule_AddObject(m, "epm_rhs_null", (PyObject *)(void *)&epm_rhs_null_Type);
2470 Py_INCREF((PyObject *)(void *)&epm_rhs_ncalrpc_Type);
2471 PyModule_AddObject(m, "epm_rhs_ncalrpc", (PyObject *)(void *)&epm_rhs_ncalrpc_Type);
2472 Py_INCREF((PyObject *)(void *)&epm_rhs_appletalk_Type);
2473 PyModule_AddObject(m, "epm_rhs_appletalk", (PyObject *)(void *)&epm_rhs_appletalk_Type);
2474 Py_INCREF((PyObject *)(void *)&epm_rhs_atalk_stream_Type);
2475 PyModule_AddObject(m, "epm_rhs_atalk_stream", (PyObject *)(void *)&epm_rhs_atalk_stream_Type);
2476 Py_INCREF((PyObject *)(void *)&epm_rhs_atalk_datagram_Type);
2477 PyModule_AddObject(m, "epm_rhs_atalk_datagram", (PyObject *)(void *)&epm_rhs_atalk_datagram_Type);
2478 Py_INCREF((PyObject *)(void *)&epm_rhs_vines_spp_Type);
2479 PyModule_AddObject(m, "epm_rhs_vines_spp", (PyObject *)(void *)&epm_rhs_vines_spp_Type);
2480 Py_INCREF((PyObject *)(void *)&epm_rhs_vines_ipc_Type);
2481 PyModule_AddObject(m, "epm_rhs_vines_ipc", (PyObject *)(void *)&epm_rhs_vines_ipc_Type);
2482 Py_INCREF((PyObject *)(void *)&epm_rhs_streettalk_Type);
2483 PyModule_AddObject(m, "epm_rhs_streettalk", (PyObject *)(void *)&epm_rhs_streettalk_Type);
2484 Py_INCREF((PyObject *)(void *)&epm_lhs_Type);
2485 PyModule_AddObject(m, "epm_lhs", (PyObject *)(void *)&epm_lhs_Type);
2486 Py_INCREF((PyObject *)(void *)&epm_floor_Type);
2487 PyModule_AddObject(m, "epm_floor", (PyObject *)(void *)&epm_floor_Type);
2488 Py_INCREF((PyObject *)(void *)&epm_tower_Type);
2489 PyModule_AddObject(m, "epm_tower", (PyObject *)(void *)&epm_tower_Type);
2490 Py_INCREF((PyObject *)(void *)&epm_twr_t_Type);
2491 PyModule_AddObject(m, "epm_twr_t", (PyObject *)(void *)&epm_twr_t_Type);
2492 Py_INCREF((PyObject *)(void *)&epm_entry_t_Type);
2493 PyModule_AddObject(m, "epm_entry_t", (PyObject *)(void *)&epm_entry_t_Type);
2494 Py_INCREF((PyObject *)(void *)&rpc_if_id_t_Type);
2495 PyModule_AddObject(m, "rpc_if_id_t", (PyObject *)(void *)&rpc_if_id_t_Type);
2496 Py_INCREF((PyObject *)(void *)&epm_twr_p_t_Type);
2497 PyModule_AddObject(m, "epm_twr_p_t", (PyObject *)(void *)&epm_twr_p_t_Type);
2498 Py_INCREF((PyObject *)(void *)&epmapper_InterfaceType);
2499 PyModule_AddObject(m, "epmapper", (PyObject *)(void *)&epmapper_InterfaceType);
2500 Py_INCREF((PyObject *)(void *)&epmapper_SyntaxType);
2501 PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&epmapper_SyntaxType);
2502 #ifdef PY_MOD_EPMAPPER_PATCH
2503 PY_MOD_EPMAPPER_PATCH(m);