git add -f bin/default/librpc/gen_ndr/*.{c,h,ndr,pidl} bin/default/source*/librpc...
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / py_epmapper.c
1
2 /* Python wrapper functions auto-generated by pidl */
3 #include <Python.h>
4 #include "includes.h"
5 #include <pytalloc.h>
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"
10
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;
46
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;
52
53 static PyObject *py_epm_rhs_dnet_nsp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
54 {
55         return pytalloc_new(struct epm_rhs_dnet_nsp, type);
56 }
57
58
59 static PyTypeObject epm_rhs_dnet_nsp_Type = {
60         PyObject_HEAD_INIT(NULL) 0,
61         .tp_name = "epmapper.epm_rhs_dnet_nsp",
62         .tp_getset = NULL,
63         .tp_methods = NULL,
64         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
65         .tp_basicsize = sizeof(pytalloc_Object),
66         .tp_new = py_epm_rhs_dnet_nsp_new,
67 };
68
69
70 static PyObject *py_epm_rhs_osi_tp4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
71 {
72         return pytalloc_new(struct epm_rhs_osi_tp4, type);
73 }
74
75
76 static PyTypeObject epm_rhs_osi_tp4_Type = {
77         PyObject_HEAD_INIT(NULL) 0,
78         .tp_name = "epmapper.epm_rhs_osi_tp4",
79         .tp_getset = NULL,
80         .tp_methods = NULL,
81         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
82         .tp_basicsize = sizeof(pytalloc_Object),
83         .tp_new = py_epm_rhs_osi_tp4_new,
84 };
85
86
87 static PyObject *py_epm_rhs_osi_clns_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
88 {
89         return pytalloc_new(struct epm_rhs_osi_clns, type);
90 }
91
92
93 static PyTypeObject epm_rhs_osi_clns_Type = {
94         PyObject_HEAD_INIT(NULL) 0,
95         .tp_name = "epmapper.epm_rhs_osi_clns",
96         .tp_getset = NULL,
97         .tp_methods = NULL,
98         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
99         .tp_basicsize = sizeof(pytalloc_Object),
100         .tp_new = py_epm_rhs_osi_clns_new,
101 };
102
103
104 static PyObject *py_epm_rhs_udp_get_port(PyObject *obj, void *closure)
105 {
106         struct epm_rhs_udp *object = (struct epm_rhs_udp *)pytalloc_get_ptr(obj);
107         PyObject *py_port;
108         py_port = PyInt_FromLong(object->port);
109         return py_port;
110 }
111
112 static int py_epm_rhs_udp_set_port(PyObject *py_obj, PyObject *value, void *closure)
113 {
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);
117         return 0;
118 }
119
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 },
122         { NULL }
123 };
124
125 static PyObject *py_epm_rhs_udp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
126 {
127         return pytalloc_new(struct epm_rhs_udp, type);
128 }
129
130
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,
135         .tp_methods = NULL,
136         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
137         .tp_basicsize = sizeof(pytalloc_Object),
138         .tp_new = py_epm_rhs_udp_new,
139 };
140
141
142 static PyObject *py_epm_rhs_tcp_get_port(PyObject *obj, void *closure)
143 {
144         struct epm_rhs_tcp *object = (struct epm_rhs_tcp *)pytalloc_get_ptr(obj);
145         PyObject *py_port;
146         py_port = PyInt_FromLong(object->port);
147         return py_port;
148 }
149
150 static int py_epm_rhs_tcp_set_port(PyObject *py_obj, PyObject *value, void *closure)
151 {
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);
155         return 0;
156 }
157
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 },
160         { NULL }
161 };
162
163 static PyObject *py_epm_rhs_tcp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
164 {
165         return pytalloc_new(struct epm_rhs_tcp, type);
166 }
167
168
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,
173         .tp_methods = NULL,
174         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
175         .tp_basicsize = sizeof(pytalloc_Object),
176         .tp_new = py_epm_rhs_tcp_new,
177 };
178
179
180 static PyObject *py_epm_rhs_ip_get_ipaddr(PyObject *obj, void *closure)
181 {
182         struct epm_rhs_ip *object = (struct epm_rhs_ip *)pytalloc_get_ptr(obj);
183         PyObject *py_ipaddr;
184         py_ipaddr = PyString_FromStringOrNULL(object->ipaddr);
185         return py_ipaddr;
186 }
187
188 static int py_epm_rhs_ip_set_ipaddr(PyObject *py_obj, PyObject *value, void *closure)
189 {
190         struct epm_rhs_ip *object = (struct epm_rhs_ip *)pytalloc_get_ptr(py_obj);
191         object->ipaddr = PyString_AS_STRING(value);
192         return 0;
193 }
194
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 },
197         { NULL }
198 };
199
200 static PyObject *py_epm_rhs_ip_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
201 {
202         return pytalloc_new(struct epm_rhs_ip, type);
203 }
204
205
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,
210         .tp_methods = NULL,
211         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
212         .tp_basicsize = sizeof(pytalloc_Object),
213         .tp_new = py_epm_rhs_ip_new,
214 };
215
216
217 static PyObject *py_epm_rhs_ncadg_get_minor_version(PyObject *obj, void *closure)
218 {
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;
223 }
224
225 static int py_epm_rhs_ncadg_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
226 {
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);
230         return 0;
231 }
232
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 },
235         { NULL }
236 };
237
238 static PyObject *py_epm_rhs_ncadg_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
239 {
240         return pytalloc_new(struct epm_rhs_ncadg, type);
241 }
242
243
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,
248         .tp_methods = NULL,
249         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
250         .tp_basicsize = sizeof(pytalloc_Object),
251         .tp_new = py_epm_rhs_ncadg_new,
252 };
253
254
255 static PyObject *py_epm_rhs_ncacn_get_minor_version(PyObject *obj, void *closure)
256 {
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;
261 }
262
263 static int py_epm_rhs_ncacn_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
264 {
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);
268         return 0;
269 }
270
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 },
273         { NULL }
274 };
275
276 static PyObject *py_epm_rhs_ncacn_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
277 {
278         return pytalloc_new(struct epm_rhs_ncacn, type);
279 }
280
281
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,
286         .tp_methods = NULL,
287         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
288         .tp_basicsize = sizeof(pytalloc_Object),
289         .tp_new = py_epm_rhs_ncacn_new,
290 };
291
292
293 static PyObject *py_epm_rhs_uuid_get_unknown(PyObject *obj, void *closure)
294 {
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);
298         return py_unknown;
299 }
300
301 static int py_epm_rhs_uuid_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
302 {
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));
305         return 0;
306 }
307
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 },
310         { NULL }
311 };
312
313 static PyObject *py_epm_rhs_uuid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
314 {
315         return pytalloc_new(struct epm_rhs_uuid, type);
316 }
317
318
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,
323         .tp_methods = NULL,
324         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
325         .tp_basicsize = sizeof(pytalloc_Object),
326         .tp_new = py_epm_rhs_uuid_new,
327 };
328
329
330 static PyObject *py_epm_rhs_ipx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
331 {
332         return pytalloc_new(struct epm_rhs_ipx, type);
333 }
334
335
336 static PyTypeObject epm_rhs_ipx_Type = {
337         PyObject_HEAD_INIT(NULL) 0,
338         .tp_name = "epmapper.epm_rhs_ipx",
339         .tp_getset = NULL,
340         .tp_methods = NULL,
341         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
342         .tp_basicsize = sizeof(pytalloc_Object),
343         .tp_new = py_epm_rhs_ipx_new,
344 };
345
346
347 static PyObject *py_epm_rhs_smb_get_unc(PyObject *obj, void *closure)
348 {
349         struct epm_rhs_smb *object = (struct epm_rhs_smb *)pytalloc_get_ptr(obj);
350         PyObject *py_unc;
351         py_unc = PyString_FromStringOrNULL(object->unc);
352         return py_unc;
353 }
354
355 static int py_epm_rhs_smb_set_unc(PyObject *py_obj, PyObject *value, void *closure)
356 {
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));
359         return 0;
360 }
361
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 },
364         { NULL }
365 };
366
367 static PyObject *py_epm_rhs_smb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
368 {
369         return pytalloc_new(struct epm_rhs_smb, type);
370 }
371
372
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,
377         .tp_methods = NULL,
378         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
379         .tp_basicsize = sizeof(pytalloc_Object),
380         .tp_new = py_epm_rhs_smb_new,
381 };
382
383
384 static PyObject *py_epm_rhs_named_pipe_get_path(PyObject *obj, void *closure)
385 {
386         struct epm_rhs_named_pipe *object = (struct epm_rhs_named_pipe *)pytalloc_get_ptr(obj);
387         PyObject *py_path;
388         py_path = PyString_FromStringOrNULL(object->path);
389         return py_path;
390 }
391
392 static int py_epm_rhs_named_pipe_set_path(PyObject *py_obj, PyObject *value, void *closure)
393 {
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));
396         return 0;
397 }
398
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 },
401         { NULL }
402 };
403
404 static PyObject *py_epm_rhs_named_pipe_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
405 {
406         return pytalloc_new(struct epm_rhs_named_pipe, type);
407 }
408
409
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,
414         .tp_methods = NULL,
415         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
416         .tp_basicsize = sizeof(pytalloc_Object),
417         .tp_new = py_epm_rhs_named_pipe_new,
418 };
419
420
421 static PyObject *py_epm_rhs_netbios_get_name(PyObject *obj, void *closure)
422 {
423         struct epm_rhs_netbios *object = (struct epm_rhs_netbios *)pytalloc_get_ptr(obj);
424         PyObject *py_name;
425         py_name = PyString_FromStringOrNULL(object->name);
426         return py_name;
427 }
428
429 static int py_epm_rhs_netbios_set_name(PyObject *py_obj, PyObject *value, void *closure)
430 {
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));
433         return 0;
434 }
435
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 },
438         { NULL }
439 };
440
441 static PyObject *py_epm_rhs_netbios_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
442 {
443         return pytalloc_new(struct epm_rhs_netbios, type);
444 }
445
446
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,
451         .tp_methods = NULL,
452         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
453         .tp_basicsize = sizeof(pytalloc_Object),
454         .tp_new = py_epm_rhs_netbios_new,
455 };
456
457
458 static PyObject *py_epm_rhs_netbeui_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
459 {
460         return pytalloc_new(struct epm_rhs_netbeui, type);
461 }
462
463
464 static PyTypeObject epm_rhs_netbeui_Type = {
465         PyObject_HEAD_INIT(NULL) 0,
466         .tp_name = "epmapper.epm_rhs_netbeui",
467         .tp_getset = NULL,
468         .tp_methods = NULL,
469         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
470         .tp_basicsize = sizeof(pytalloc_Object),
471         .tp_new = py_epm_rhs_netbeui_new,
472 };
473
474
475 static PyObject *py_epm_rhs_spx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
476 {
477         return pytalloc_new(struct epm_rhs_spx, type);
478 }
479
480
481 static PyTypeObject epm_rhs_spx_Type = {
482         PyObject_HEAD_INIT(NULL) 0,
483         .tp_name = "epmapper.epm_rhs_spx",
484         .tp_getset = NULL,
485         .tp_methods = NULL,
486         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
487         .tp_basicsize = sizeof(pytalloc_Object),
488         .tp_new = py_epm_rhs_spx_new,
489 };
490
491
492 static PyObject *py_epm_rhs_nb_ipx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
493 {
494         return pytalloc_new(struct epm_rhs_nb_ipx, type);
495 }
496
497
498 static PyTypeObject epm_rhs_nb_ipx_Type = {
499         PyObject_HEAD_INIT(NULL) 0,
500         .tp_name = "epmapper.epm_rhs_nb_ipx",
501         .tp_getset = NULL,
502         .tp_methods = NULL,
503         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
504         .tp_basicsize = sizeof(pytalloc_Object),
505         .tp_new = py_epm_rhs_nb_ipx_new,
506 };
507
508
509 static PyObject *py_epm_rhs_http_get_port(PyObject *obj, void *closure)
510 {
511         struct epm_rhs_http *object = (struct epm_rhs_http *)pytalloc_get_ptr(obj);
512         PyObject *py_port;
513         py_port = PyInt_FromLong(object->port);
514         return py_port;
515 }
516
517 static int py_epm_rhs_http_set_port(PyObject *py_obj, PyObject *value, void *closure)
518 {
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);
522         return 0;
523 }
524
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 },
527         { NULL }
528 };
529
530 static PyObject *py_epm_rhs_http_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
531 {
532         return pytalloc_new(struct epm_rhs_http, type);
533 }
534
535
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,
540         .tp_methods = NULL,
541         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
542         .tp_basicsize = sizeof(pytalloc_Object),
543         .tp_new = py_epm_rhs_http_new,
544 };
545
546
547 static PyObject *py_epm_rhs_unix_ds_get_path(PyObject *obj, void *closure)
548 {
549         struct epm_rhs_unix_ds *object = (struct epm_rhs_unix_ds *)pytalloc_get_ptr(obj);
550         PyObject *py_path;
551         py_path = PyString_FromStringOrNULL(object->path);
552         return py_path;
553 }
554
555 static int py_epm_rhs_unix_ds_set_path(PyObject *py_obj, PyObject *value, void *closure)
556 {
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));
559         return 0;
560 }
561
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 },
564         { NULL }
565 };
566
567 static PyObject *py_epm_rhs_unix_ds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
568 {
569         return pytalloc_new(struct epm_rhs_unix_ds, type);
570 }
571
572
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,
577         .tp_methods = NULL,
578         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
579         .tp_basicsize = sizeof(pytalloc_Object),
580         .tp_new = py_epm_rhs_unix_ds_new,
581 };
582
583
584 static PyObject *py_epm_rhs_null_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
585 {
586         return pytalloc_new(struct epm_rhs_null, type);
587 }
588
589
590 static PyTypeObject epm_rhs_null_Type = {
591         PyObject_HEAD_INIT(NULL) 0,
592         .tp_name = "epmapper.epm_rhs_null",
593         .tp_getset = NULL,
594         .tp_methods = NULL,
595         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
596         .tp_basicsize = sizeof(pytalloc_Object),
597         .tp_new = py_epm_rhs_null_new,
598 };
599
600
601 static PyObject *py_epm_rhs_ncalrpc_get_minor_version(PyObject *obj, void *closure)
602 {
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;
607 }
608
609 static int py_epm_rhs_ncalrpc_set_minor_version(PyObject *py_obj, PyObject *value, void *closure)
610 {
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);
614         return 0;
615 }
616
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 },
619         { NULL }
620 };
621
622 static PyObject *py_epm_rhs_ncalrpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
623 {
624         return pytalloc_new(struct epm_rhs_ncalrpc, type);
625 }
626
627
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,
632         .tp_methods = NULL,
633         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
634         .tp_basicsize = sizeof(pytalloc_Object),
635         .tp_new = py_epm_rhs_ncalrpc_new,
636 };
637
638
639 static PyObject *py_epm_rhs_appletalk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
640 {
641         return pytalloc_new(struct epm_rhs_appletalk, type);
642 }
643
644
645 static PyTypeObject epm_rhs_appletalk_Type = {
646         PyObject_HEAD_INIT(NULL) 0,
647         .tp_name = "epmapper.epm_rhs_appletalk",
648         .tp_getset = NULL,
649         .tp_methods = NULL,
650         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
651         .tp_basicsize = sizeof(pytalloc_Object),
652         .tp_new = py_epm_rhs_appletalk_new,
653 };
654
655
656 static PyObject *py_epm_rhs_atalk_stream_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
657 {
658         return pytalloc_new(struct epm_rhs_atalk_stream, type);
659 }
660
661
662 static PyTypeObject epm_rhs_atalk_stream_Type = {
663         PyObject_HEAD_INIT(NULL) 0,
664         .tp_name = "epmapper.epm_rhs_atalk_stream",
665         .tp_getset = NULL,
666         .tp_methods = NULL,
667         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
668         .tp_basicsize = sizeof(pytalloc_Object),
669         .tp_new = py_epm_rhs_atalk_stream_new,
670 };
671
672
673 static PyObject *py_epm_rhs_atalk_datagram_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
674 {
675         return pytalloc_new(struct epm_rhs_atalk_datagram, type);
676 }
677
678
679 static PyTypeObject epm_rhs_atalk_datagram_Type = {
680         PyObject_HEAD_INIT(NULL) 0,
681         .tp_name = "epmapper.epm_rhs_atalk_datagram",
682         .tp_getset = NULL,
683         .tp_methods = NULL,
684         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
685         .tp_basicsize = sizeof(pytalloc_Object),
686         .tp_new = py_epm_rhs_atalk_datagram_new,
687 };
688
689
690 static PyObject *py_epm_rhs_vines_spp_get_port(PyObject *obj, void *closure)
691 {
692         struct epm_rhs_vines_spp *object = (struct epm_rhs_vines_spp *)pytalloc_get_ptr(obj);
693         PyObject *py_port;
694         py_port = PyInt_FromLong(object->port);
695         return py_port;
696 }
697
698 static int py_epm_rhs_vines_spp_set_port(PyObject *py_obj, PyObject *value, void *closure)
699 {
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);
703         return 0;
704 }
705
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 },
708         { NULL }
709 };
710
711 static PyObject *py_epm_rhs_vines_spp_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
712 {
713         return pytalloc_new(struct epm_rhs_vines_spp, type);
714 }
715
716
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,
721         .tp_methods = NULL,
722         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
723         .tp_basicsize = sizeof(pytalloc_Object),
724         .tp_new = py_epm_rhs_vines_spp_new,
725 };
726
727
728 static PyObject *py_epm_rhs_vines_ipc_get_port(PyObject *obj, void *closure)
729 {
730         struct epm_rhs_vines_ipc *object = (struct epm_rhs_vines_ipc *)pytalloc_get_ptr(obj);
731         PyObject *py_port;
732         py_port = PyInt_FromLong(object->port);
733         return py_port;
734 }
735
736 static int py_epm_rhs_vines_ipc_set_port(PyObject *py_obj, PyObject *value, void *closure)
737 {
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);
741         return 0;
742 }
743
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 },
746         { NULL }
747 };
748
749 static PyObject *py_epm_rhs_vines_ipc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
750 {
751         return pytalloc_new(struct epm_rhs_vines_ipc, type);
752 }
753
754
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,
759         .tp_methods = NULL,
760         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
761         .tp_basicsize = sizeof(pytalloc_Object),
762         .tp_new = py_epm_rhs_vines_ipc_new,
763 };
764
765
766 static PyObject *py_epm_rhs_streettalk_get_streettalk(PyObject *obj, void *closure)
767 {
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;
772 }
773
774 static int py_epm_rhs_streettalk_set_streettalk(PyObject *py_obj, PyObject *value, void *closure)
775 {
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));
778         return 0;
779 }
780
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 },
783         { NULL }
784 };
785
786 static PyObject *py_epm_rhs_streettalk_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
787 {
788         return pytalloc_new(struct epm_rhs_streettalk, type);
789 }
790
791
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,
796         .tp_methods = NULL,
797         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
798         .tp_basicsize = sizeof(pytalloc_Object),
799         .tp_new = py_epm_rhs_streettalk_new,
800 };
801
802 static PyObject *py_import_epm_rhs(TALLOC_CTX *mem_ctx, int level, union epm_rhs *in)
803 {
804         PyObject *ret;
805
806         switch (level) {
807                 case EPM_PROTOCOL_DNET_NSP:
808                         ret = pytalloc_reference_ex(&epm_rhs_dnet_nsp_Type, mem_ctx, &in->dnet_nsp);
809                         return ret;
810
811                 case EPM_PROTOCOL_OSI_TP4:
812                         ret = pytalloc_reference_ex(&epm_rhs_osi_tp4_Type, mem_ctx, &in->osi_tp4);
813                         return ret;
814
815                 case EPM_PROTOCOL_OSI_CLNS:
816                         ret = pytalloc_reference_ex(&epm_rhs_osi_clns_Type, mem_ctx, &in->osi_clns);
817                         return ret;
818
819                 case EPM_PROTOCOL_TCP:
820                         ret = pytalloc_reference_ex(&epm_rhs_tcp_Type, mem_ctx, &in->tcp);
821                         return ret;
822
823                 case EPM_PROTOCOL_UDP:
824                         ret = pytalloc_reference_ex(&epm_rhs_udp_Type, mem_ctx, &in->udp);
825                         return ret;
826
827                 case EPM_PROTOCOL_IP:
828                         ret = pytalloc_reference_ex(&epm_rhs_ip_Type, mem_ctx, &in->ip);
829                         return ret;
830
831                 case EPM_PROTOCOL_NCADG:
832                         ret = pytalloc_reference_ex(&epm_rhs_ncadg_Type, mem_ctx, &in->ncadg);
833                         return ret;
834
835                 case EPM_PROTOCOL_NCACN:
836                         ret = pytalloc_reference_ex(&epm_rhs_ncacn_Type, mem_ctx, &in->ncacn);
837                         return ret;
838
839                 case EPM_PROTOCOL_NCALRPC:
840                         ret = pytalloc_reference_ex(&epm_rhs_ncalrpc_Type, mem_ctx, &in->ncalrpc);
841                         return ret;
842
843                 case EPM_PROTOCOL_UUID:
844                         ret = pytalloc_reference_ex(&epm_rhs_uuid_Type, mem_ctx, &in->uuid);
845                         return ret;
846
847                 case EPM_PROTOCOL_IPX:
848                         ret = pytalloc_reference_ex(&epm_rhs_ipx_Type, mem_ctx, &in->ipx);
849                         return ret;
850
851                 case EPM_PROTOCOL_SMB:
852                         ret = pytalloc_reference_ex(&epm_rhs_smb_Type, mem_ctx, &in->smb);
853                         return ret;
854
855                 case EPM_PROTOCOL_NAMED_PIPE:
856                         ret = pytalloc_reference_ex(&epm_rhs_named_pipe_Type, mem_ctx, &in->named_pipe);
857                         return ret;
858
859                 case EPM_PROTOCOL_NETBIOS:
860                         ret = pytalloc_reference_ex(&epm_rhs_netbios_Type, mem_ctx, &in->netbios);
861                         return ret;
862
863                 case EPM_PROTOCOL_NETBEUI:
864                         ret = pytalloc_reference_ex(&epm_rhs_netbeui_Type, mem_ctx, &in->netbeui);
865                         return ret;
866
867                 case EPM_PROTOCOL_SPX:
868                         ret = pytalloc_reference_ex(&epm_rhs_spx_Type, mem_ctx, &in->spx);
869                         return ret;
870
871                 case EPM_PROTOCOL_NB_IPX:
872                         ret = pytalloc_reference_ex(&epm_rhs_nb_ipx_Type, mem_ctx, &in->nb_ipx);
873                         return ret;
874
875                 case EPM_PROTOCOL_DSP:
876                         ret = pytalloc_reference_ex(&epm_rhs_atalk_stream_Type, mem_ctx, &in->atalk_stream);
877                         return ret;
878
879                 case EPM_PROTOCOL_DDP:
880                         ret = pytalloc_reference_ex(&epm_rhs_atalk_datagram_Type, mem_ctx, &in->atalk_datagram);
881                         return ret;
882
883                 case EPM_PROTOCOL_APPLETALK:
884                         ret = pytalloc_reference_ex(&epm_rhs_appletalk_Type, mem_ctx, &in->appletalk);
885                         return ret;
886
887                 case EPM_PROTOCOL_VINES_SPP:
888                         ret = pytalloc_reference_ex(&epm_rhs_vines_spp_Type, mem_ctx, &in->vines_spp);
889                         return ret;
890
891                 case EPM_PROTOCOL_VINES_IPC:
892                         ret = pytalloc_reference_ex(&epm_rhs_vines_ipc_Type, mem_ctx, &in->vines_ipc);
893                         return ret;
894
895                 case EPM_PROTOCOL_STREETTALK:
896                         ret = pytalloc_reference_ex(&epm_rhs_streettalk_Type, mem_ctx, &in->streettalk);
897                         return ret;
898
899                 case EPM_PROTOCOL_HTTP:
900                         ret = pytalloc_reference_ex(&epm_rhs_http_Type, mem_ctx, &in->http);
901                         return ret;
902
903                 case EPM_PROTOCOL_UNIX_DS:
904                         ret = pytalloc_reference_ex(&epm_rhs_unix_ds_Type, mem_ctx, &in->unix_ds);
905                         return ret;
906
907                 case EPM_PROTOCOL_NULL:
908                         ret = pytalloc_reference_ex(&epm_rhs_null_Type, mem_ctx, &in->null);
909                         return ret;
910
911                 default:
912                         ret = PyString_FromStringAndSize((char *)(in->unknown).data, (in->unknown).length);
913                         return ret;
914
915         }
916         PyErr_SetString(PyExc_TypeError, "unknown union level");
917         return NULL;
918 }
919
920 static union epm_rhs *py_export_epm_rhs(TALLOC_CTX *mem_ctx, int level, PyObject *in)
921 {
922         union epm_rhs *ret = talloc_zero(mem_ctx, union epm_rhs);
923         switch (level) {
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) {
927                                 PyErr_NoMemory();
928                                 talloc_free(ret); return NULL;
929                         }
930                         ret->dnet_nsp = *(struct epm_rhs_dnet_nsp *)pytalloc_get_ptr(in);
931                         break;
932
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) {
936                                 PyErr_NoMemory();
937                                 talloc_free(ret); return NULL;
938                         }
939                         ret->osi_tp4 = *(struct epm_rhs_osi_tp4 *)pytalloc_get_ptr(in);
940                         break;
941
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) {
945                                 PyErr_NoMemory();
946                                 talloc_free(ret); return NULL;
947                         }
948                         ret->osi_clns = *(struct epm_rhs_osi_clns *)pytalloc_get_ptr(in);
949                         break;
950
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) {
954                                 PyErr_NoMemory();
955                                 talloc_free(ret); return NULL;
956                         }
957                         ret->tcp = *(struct epm_rhs_tcp *)pytalloc_get_ptr(in);
958                         break;
959
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) {
963                                 PyErr_NoMemory();
964                                 talloc_free(ret); return NULL;
965                         }
966                         ret->udp = *(struct epm_rhs_udp *)pytalloc_get_ptr(in);
967                         break;
968
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) {
972                                 PyErr_NoMemory();
973                                 talloc_free(ret); return NULL;
974                         }
975                         ret->ip = *(struct epm_rhs_ip *)pytalloc_get_ptr(in);
976                         break;
977
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) {
981                                 PyErr_NoMemory();
982                                 talloc_free(ret); return NULL;
983                         }
984                         ret->ncadg = *(struct epm_rhs_ncadg *)pytalloc_get_ptr(in);
985                         break;
986
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) {
990                                 PyErr_NoMemory();
991                                 talloc_free(ret); return NULL;
992                         }
993                         ret->ncacn = *(struct epm_rhs_ncacn *)pytalloc_get_ptr(in);
994                         break;
995
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) {
999                                 PyErr_NoMemory();
1000                                 talloc_free(ret); return NULL;
1001                         }
1002                         ret->ncalrpc = *(struct epm_rhs_ncalrpc *)pytalloc_get_ptr(in);
1003                         break;
1004
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) {
1008                                 PyErr_NoMemory();
1009                                 talloc_free(ret); return NULL;
1010                         }
1011                         ret->uuid = *(struct epm_rhs_uuid *)pytalloc_get_ptr(in);
1012                         break;
1013
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) {
1017                                 PyErr_NoMemory();
1018                                 talloc_free(ret); return NULL;
1019                         }
1020                         ret->ipx = *(struct epm_rhs_ipx *)pytalloc_get_ptr(in);
1021                         break;
1022
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) {
1026                                 PyErr_NoMemory();
1027                                 talloc_free(ret); return NULL;
1028                         }
1029                         ret->smb = *(struct epm_rhs_smb *)pytalloc_get_ptr(in);
1030                         break;
1031
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) {
1035                                 PyErr_NoMemory();
1036                                 talloc_free(ret); return NULL;
1037                         }
1038                         ret->named_pipe = *(struct epm_rhs_named_pipe *)pytalloc_get_ptr(in);
1039                         break;
1040
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) {
1044                                 PyErr_NoMemory();
1045                                 talloc_free(ret); return NULL;
1046                         }
1047                         ret->netbios = *(struct epm_rhs_netbios *)pytalloc_get_ptr(in);
1048                         break;
1049
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) {
1053                                 PyErr_NoMemory();
1054                                 talloc_free(ret); return NULL;
1055                         }
1056                         ret->netbeui = *(struct epm_rhs_netbeui *)pytalloc_get_ptr(in);
1057                         break;
1058
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) {
1062                                 PyErr_NoMemory();
1063                                 talloc_free(ret); return NULL;
1064                         }
1065                         ret->spx = *(struct epm_rhs_spx *)pytalloc_get_ptr(in);
1066                         break;
1067
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) {
1071                                 PyErr_NoMemory();
1072                                 talloc_free(ret); return NULL;
1073                         }
1074                         ret->nb_ipx = *(struct epm_rhs_nb_ipx *)pytalloc_get_ptr(in);
1075                         break;
1076
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) {
1080                                 PyErr_NoMemory();
1081                                 talloc_free(ret); return NULL;
1082                         }
1083                         ret->atalk_stream = *(struct epm_rhs_atalk_stream *)pytalloc_get_ptr(in);
1084                         break;
1085
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) {
1089                                 PyErr_NoMemory();
1090                                 talloc_free(ret); return NULL;
1091                         }
1092                         ret->atalk_datagram = *(struct epm_rhs_atalk_datagram *)pytalloc_get_ptr(in);
1093                         break;
1094
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) {
1098                                 PyErr_NoMemory();
1099                                 talloc_free(ret); return NULL;
1100                         }
1101                         ret->appletalk = *(struct epm_rhs_appletalk *)pytalloc_get_ptr(in);
1102                         break;
1103
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) {
1107                                 PyErr_NoMemory();
1108                                 talloc_free(ret); return NULL;
1109                         }
1110                         ret->vines_spp = *(struct epm_rhs_vines_spp *)pytalloc_get_ptr(in);
1111                         break;
1112
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) {
1116                                 PyErr_NoMemory();
1117                                 talloc_free(ret); return NULL;
1118                         }
1119                         ret->vines_ipc = *(struct epm_rhs_vines_ipc *)pytalloc_get_ptr(in);
1120                         break;
1121
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) {
1125                                 PyErr_NoMemory();
1126                                 talloc_free(ret); return NULL;
1127                         }
1128                         ret->streettalk = *(struct epm_rhs_streettalk *)pytalloc_get_ptr(in);
1129                         break;
1130
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) {
1134                                 PyErr_NoMemory();
1135                                 talloc_free(ret); return NULL;
1136                         }
1137                         ret->http = *(struct epm_rhs_http *)pytalloc_get_ptr(in);
1138                         break;
1139
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) {
1143                                 PyErr_NoMemory();
1144                                 talloc_free(ret); return NULL;
1145                         }
1146                         ret->unix_ds = *(struct epm_rhs_unix_ds *)pytalloc_get_ptr(in);
1147                         break;
1148
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) {
1152                                 PyErr_NoMemory();
1153                                 talloc_free(ret); return NULL;
1154                         }
1155                         ret->null = *(struct epm_rhs_null *)pytalloc_get_ptr(in);
1156                         break;
1157
1158                 default:
1159                         ret->unknown = data_blob_talloc(mem_ctx, PyString_AS_STRING(in), PyString_GET_SIZE(in));
1160                         break;
1161
1162         }
1163
1164         return ret;
1165 }
1166
1167
1168 static PyObject *py_epm_lhs_get_protocol(PyObject *obj, void *closure)
1169 {
1170         struct epm_lhs *object = (struct epm_lhs *)pytalloc_get_ptr(obj);
1171         PyObject *py_protocol;
1172         py_protocol = PyInt_FromLong(object->protocol);
1173         return py_protocol;
1174 }
1175
1176 static int py_epm_lhs_set_protocol(PyObject *py_obj, PyObject *value, void *closure)
1177 {
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);
1183         } else {
1184                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1185                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1186                 return -1;
1187         }
1188         return 0;
1189 }
1190
1191 static PyObject *py_epm_lhs_get_lhs_data(PyObject *obj, void *closure)
1192 {
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);
1196         return py_lhs_data;
1197 }
1198
1199 static int py_epm_lhs_set_lhs_data(PyObject *py_obj, PyObject *value, void *closure)
1200 {
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));
1203         return 0;
1204 }
1205
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 },
1209         { NULL }
1210 };
1211
1212 static PyObject *py_epm_lhs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1213 {
1214         return pytalloc_new(struct epm_lhs, type);
1215 }
1216
1217
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,
1222         .tp_methods = NULL,
1223         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1224         .tp_basicsize = sizeof(pytalloc_Object),
1225         .tp_new = py_epm_lhs_new,
1226 };
1227
1228
1229 static PyObject *py_epm_floor_get_lhs(PyObject *obj, void *closure)
1230 {
1231         struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(obj);
1232         PyObject *py_lhs;
1233         py_lhs = pytalloc_reference_ex(&epm_lhs_Type, pytalloc_get_mem_ctx(obj), &object->lhs);
1234         return py_lhs;
1235 }
1236
1237 static int py_epm_floor_set_lhs(PyObject *py_obj, PyObject *value, void *closure)
1238 {
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) {
1242                 PyErr_NoMemory();
1243                 return -1;
1244         }
1245         object->lhs = *(struct epm_lhs *)pytalloc_get_ptr(value);
1246         return 0;
1247 }
1248
1249 static PyObject *py_epm_floor_get_rhs(PyObject *obj, void *closure)
1250 {
1251         struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(obj);
1252         PyObject *py_rhs;
1253         py_rhs = py_import_epm_rhs(pytalloc_get_mem_ctx(obj), object->lhs.protocol, &object->rhs);
1254         if (py_rhs == NULL) {
1255                 return NULL;
1256         }
1257         return py_rhs;
1258 }
1259
1260 static int py_epm_floor_set_rhs(PyObject *py_obj, PyObject *value, void *closure)
1261 {
1262         struct epm_floor *object = (struct epm_floor *)pytalloc_get_ptr(py_obj);
1263         {
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) {
1267                         return -1;
1268                 }
1269                 object->rhs = *rhs_switch_1;
1270         }
1271         return 0;
1272 }
1273
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 },
1277         { NULL }
1278 };
1279
1280 static PyObject *py_epm_floor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1281 {
1282         return pytalloc_new(struct epm_floor, type);
1283 }
1284
1285
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,
1290         .tp_methods = NULL,
1291         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1292         .tp_basicsize = sizeof(pytalloc_Object),
1293         .tp_new = py_epm_floor_new,
1294 };
1295
1296
1297 static PyObject *py_epm_tower_get_num_floors(PyObject *obj, void *closure)
1298 {
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;
1303 }
1304
1305 static int py_epm_tower_set_num_floors(PyObject *py_obj, PyObject *value, void *closure)
1306 {
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);
1310         return 0;
1311 }
1312
1313 static PyObject *py_epm_tower_get_floors(PyObject *obj, void *closure)
1314 {
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) {
1319                 return NULL;
1320         }
1321         {
1322                 int floors_cntr_0;
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);
1327                 }
1328         }
1329         return py_floors;
1330 }
1331
1332 static int py_epm_tower_set_floors(PyObject *py_obj, PyObject *value, void *closure)
1333 {
1334         struct epm_tower *object = (struct epm_tower *)pytalloc_get_ptr(py_obj);
1335         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1336         {
1337                 int floors_cntr_0;
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) {
1344                                 PyErr_NoMemory();
1345                                 return -1;
1346                         }
1347                         object->floors[floors_cntr_0] = *(struct epm_floor *)pytalloc_get_ptr(PyList_GET_ITEM(value, floors_cntr_0));
1348                 }
1349         }
1350         return 0;
1351 }
1352
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 },
1356         { NULL }
1357 };
1358
1359 static PyObject *py_epm_tower_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1360 {
1361         return pytalloc_new(struct epm_tower, type);
1362 }
1363
1364
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,
1369         .tp_methods = NULL,
1370         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1371         .tp_basicsize = sizeof(pytalloc_Object),
1372         .tp_new = py_epm_tower_new,
1373 };
1374
1375
1376 static PyObject *py_epm_twr_t_get_tower_length(PyObject *obj, void *closure)
1377 {
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;
1382 }
1383
1384 static int py_epm_twr_t_set_tower_length(PyObject *py_obj, PyObject *value, void *closure)
1385 {
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);
1389         return 0;
1390 }
1391
1392 static PyObject *py_epm_twr_t_get_tower(PyObject *obj, void *closure)
1393 {
1394         struct epm_twr_t *object = (struct epm_twr_t *)pytalloc_get_ptr(obj);
1395         PyObject *py_tower;
1396         py_tower = pytalloc_reference_ex(&epm_tower_Type, pytalloc_get_mem_ctx(obj), &object->tower);
1397         return py_tower;
1398 }
1399
1400 static int py_epm_twr_t_set_tower(PyObject *py_obj, PyObject *value, void *closure)
1401 {
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) {
1405                 PyErr_NoMemory();
1406                 return -1;
1407         }
1408         object->tower = *(struct epm_tower *)pytalloc_get_ptr(value);
1409         return 0;
1410 }
1411
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 },
1415         { NULL }
1416 };
1417
1418 static PyObject *py_epm_twr_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1419 {
1420         return pytalloc_new(struct epm_twr_t, type);
1421 }
1422
1423
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,
1428         .tp_methods = NULL,
1429         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1430         .tp_basicsize = sizeof(pytalloc_Object),
1431         .tp_new = py_epm_twr_t_new,
1432 };
1433
1434
1435 static PyObject *py_epm_entry_t_get_object(PyObject *obj, void *closure)
1436 {
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);
1440         return py_object;
1441 }
1442
1443 static int py_epm_entry_t_set_object(PyObject *py_obj, PyObject *value, void *closure)
1444 {
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) {
1448                 PyErr_NoMemory();
1449                 return -1;
1450         }
1451         object->object = *(struct GUID *)pytalloc_get_ptr(value);
1452         return 0;
1453 }
1454
1455 static PyObject *py_epm_entry_t_get_tower(PyObject *obj, void *closure)
1456 {
1457         struct epm_entry_t *object = (struct epm_entry_t *)pytalloc_get_ptr(obj);
1458         PyObject *py_tower;
1459         if (object->tower == NULL) {
1460                 py_tower = Py_None;
1461                 Py_INCREF(py_tower);
1462         } else {
1463                 py_tower = pytalloc_reference_ex(&epm_twr_t_Type, object->tower, object->tower);
1464         }
1465         return py_tower;
1466 }
1467
1468 static int py_epm_entry_t_set_tower(PyObject *py_obj, PyObject *value, void *closure)
1469 {
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;
1474         } else {
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) {
1478                         PyErr_NoMemory();
1479                         return -1;
1480                 }
1481                 object->tower = (struct epm_twr_t *)pytalloc_get_ptr(value);
1482         }
1483         return 0;
1484 }
1485
1486 static PyObject *py_epm_entry_t_get___annotation_offset(PyObject *obj, void *closure)
1487 {
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;
1492 }
1493
1494 static int py_epm_entry_t_set___annotation_offset(PyObject *py_obj, PyObject *value, void *closure)
1495 {
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);
1499         return 0;
1500 }
1501
1502 static PyObject *py_epm_entry_t_get___annotation_length(PyObject *obj, void *closure)
1503 {
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;
1508 }
1509
1510 static int py_epm_entry_t_set___annotation_length(PyObject *py_obj, PyObject *value, void *closure)
1511 {
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);
1515         return 0;
1516 }
1517
1518 static PyObject *py_epm_entry_t_get_annotation(PyObject *obj, void *closure)
1519 {
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);
1525         } else {
1526                 py_annotation = PyUnicode_Decode(object->annotation, strlen(object->annotation), "utf-8", "ignore");
1527         }
1528         return py_annotation;
1529 }
1530
1531 static int py_epm_entry_t_set_annotation(PyObject *py_obj, PyObject *value, void *closure)
1532 {
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);
1538         } else {
1539                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1540                 return -1;
1541         }
1542         return 0;
1543 }
1544
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 },
1551         { NULL }
1552 };
1553
1554 static PyObject *py_epm_entry_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1555 {
1556         return pytalloc_new(struct epm_entry_t, type);
1557 }
1558
1559
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,
1564         .tp_methods = NULL,
1565         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1566         .tp_basicsize = sizeof(pytalloc_Object),
1567         .tp_new = py_epm_entry_t_new,
1568 };
1569
1570
1571 static PyObject *py_rpc_if_id_t_get_uuid(PyObject *obj, void *closure)
1572 {
1573         struct rpc_if_id_t *object = (struct rpc_if_id_t *)pytalloc_get_ptr(obj);
1574         PyObject *py_uuid;
1575         py_uuid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->uuid);
1576         return py_uuid;
1577 }
1578
1579 static int py_rpc_if_id_t_set_uuid(PyObject *py_obj, PyObject *value, void *closure)
1580 {
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) {
1584                 PyErr_NoMemory();
1585                 return -1;
1586         }
1587         object->uuid = *(struct GUID *)pytalloc_get_ptr(value);
1588         return 0;
1589 }
1590
1591 static PyObject *py_rpc_if_id_t_get_vers_major(PyObject *obj, void *closure)
1592 {
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;
1597 }
1598
1599 static int py_rpc_if_id_t_set_vers_major(PyObject *py_obj, PyObject *value, void *closure)
1600 {
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);
1604         return 0;
1605 }
1606
1607 static PyObject *py_rpc_if_id_t_get_vers_minor(PyObject *obj, void *closure)
1608 {
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;
1613 }
1614
1615 static int py_rpc_if_id_t_set_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
1616 {
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);
1620         return 0;
1621 }
1622
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 },
1627         { NULL }
1628 };
1629
1630 static PyObject *py_rpc_if_id_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1631 {
1632         return pytalloc_new(struct rpc_if_id_t, type);
1633 }
1634
1635
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,
1640         .tp_methods = NULL,
1641         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1642         .tp_basicsize = sizeof(pytalloc_Object),
1643         .tp_new = py_rpc_if_id_t_new,
1644 };
1645
1646
1647 static PyObject *py_epm_twr_p_t_get_twr(PyObject *obj, void *closure)
1648 {
1649         struct epm_twr_p_t *object = (struct epm_twr_p_t *)pytalloc_get_ptr(obj);
1650         PyObject *py_twr;
1651         if (object->twr == NULL) {
1652                 py_twr = Py_None;
1653                 Py_INCREF(py_twr);
1654         } else {
1655                 py_twr = pytalloc_reference_ex(&epm_twr_t_Type, object->twr, object->twr);
1656         }
1657         return py_twr;
1658 }
1659
1660 static int py_epm_twr_p_t_set_twr(PyObject *py_obj, PyObject *value, void *closure)
1661 {
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) {
1665                 object->twr = NULL;
1666         } else {
1667                 object->twr = NULL;
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) {
1670                         PyErr_NoMemory();
1671                         return -1;
1672                 }
1673                 object->twr = (struct epm_twr_t *)pytalloc_get_ptr(value);
1674         }
1675         return 0;
1676 }
1677
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 },
1680         { NULL }
1681 };
1682
1683 static PyObject *py_epm_twr_p_t_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1684 {
1685         return pytalloc_new(struct epm_twr_p_t, type);
1686 }
1687
1688
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,
1693         .tp_methods = NULL,
1694         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1695         .tp_basicsize = sizeof(pytalloc_Object),
1696         .tp_new = py_epm_twr_p_t_new,
1697 };
1698
1699
1700 static bool pack_py_epm_Insert_args_in(PyObject *args, PyObject *kwargs, struct epm_Insert *r)
1701 {
1702         PyObject *py_entries;
1703         PyObject *py_replace;
1704         const char *kwnames[] = {
1705                 "entries", "replace", NULL
1706         };
1707
1708         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:epm_Insert", discard_const_p(char *, kwnames), &py_entries, &py_replace)) {
1709                 return false;
1710         }
1711
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;);
1715         {
1716                 int entries_cntr_0;
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) {
1723                                 PyErr_NoMemory();
1724                                 return false;
1725                         }
1726                         r->in.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(py_entries, entries_cntr_0));
1727                 }
1728         }
1729         PY_CHECK_TYPE(&PyInt_Type, py_replace, return false;);
1730         r->in.replace = PyInt_AsLong(py_replace);
1731         return true;
1732 }
1733
1734 static PyObject *unpack_py_epm_Insert_args_out(struct epm_Insert *r)
1735 {
1736         PyObject *result;
1737         result = PyInt_FromLong(r->out.result);
1738         return result;
1739 }
1740
1741 static bool pack_py_epm_Delete_args_in(PyObject *args, PyObject *kwargs, struct epm_Delete *r)
1742 {
1743         PyObject *py_entries;
1744         const char *kwnames[] = {
1745                 "entries", NULL
1746         };
1747
1748         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_Delete", discard_const_p(char *, kwnames), &py_entries)) {
1749                 return false;
1750         }
1751
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;);
1755         {
1756                 int entries_cntr_0;
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) {
1763                                 PyErr_NoMemory();
1764                                 return false;
1765                         }
1766                         r->in.entries[entries_cntr_0] = *(struct epm_entry_t *)pytalloc_get_ptr(PyList_GET_ITEM(py_entries, entries_cntr_0));
1767                 }
1768         }
1769         return true;
1770 }
1771
1772 static PyObject *unpack_py_epm_Delete_args_out(struct epm_Delete *r)
1773 {
1774         PyObject *result;
1775         result = PyInt_FromLong(r->out.result);
1776         return result;
1777 }
1778
1779 static bool pack_py_epm_Lookup_args_in(PyObject *args, PyObject *kwargs, struct epm_Lookup *r)
1780 {
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
1789         };
1790
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)) {
1792                 return false;
1793         }
1794
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);
1799         } else {
1800                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1801                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1802                 return false;
1803         }
1804         if (py_object == Py_None) {
1805                 r->in.object = NULL;
1806         } else {
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) {
1810                         PyErr_NoMemory();
1811                         return false;
1812                 }
1813                 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
1814         }
1815         if (py_interface_id == Py_None) {
1816                 r->in.interface_id = NULL;
1817         } else {
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) {
1821                         PyErr_NoMemory();
1822                         return false;
1823                 }
1824                 r->in.interface_id = (struct rpc_if_id_t *)pytalloc_get_ptr(py_interface_id);
1825         }
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);
1830         } else {
1831                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1832                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1833                 return false;
1834         }
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) {
1838                 PyErr_NoMemory();
1839                 return false;
1840         }
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);
1844         return true;
1845 }
1846
1847 static PyObject *unpack_py_epm_Lookup_args_out(struct epm_Lookup *r)
1848 {
1849         PyObject *result;
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) {
1857                 return NULL;
1858         }
1859         {
1860                 int entries_cntr_0;
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);
1865                 }
1866         }
1867         PyTuple_SetItem(result, 1, py_entries);
1868         PyTuple_SetItem(result, 2, PyInt_FromLong(r->out.result));
1869         return result;
1870 }
1871
1872 static bool pack_py_epm_Map_args_in(PyObject *args, PyObject *kwargs, struct epm_Map *r)
1873 {
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
1880         };
1881
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)) {
1883                 return false;
1884         }
1885
1886         if (py_object == Py_None) {
1887                 r->in.object = NULL;
1888         } else {
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) {
1892                         PyErr_NoMemory();
1893                         return false;
1894                 }
1895                 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
1896         }
1897         if (py_map_tower == Py_None) {
1898                 r->in.map_tower = NULL;
1899         } else {
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) {
1903                         PyErr_NoMemory();
1904                         return false;
1905                 }
1906                 r->in.map_tower = (struct epm_twr_t *)pytalloc_get_ptr(py_map_tower);
1907         }
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) {
1911                 PyErr_NoMemory();
1912                 return false;
1913         }
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);
1917         return true;
1918 }
1919
1920 static PyObject *unpack_py_epm_Map_args_out(struct epm_Map *r)
1921 {
1922         PyObject *result;
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) {
1930                 return NULL;
1931         }
1932         {
1933                 int towers_cntr_0;
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);
1938                 }
1939         }
1940         PyTuple_SetItem(result, 1, py_towers);
1941         PyTuple_SetItem(result, 2, PyInt_FromLong(r->out.result));
1942         return result;
1943 }
1944
1945 static bool pack_py_epm_LookupHandleFree_args_in(PyObject *args, PyObject *kwargs, struct epm_LookupHandleFree *r)
1946 {
1947         PyObject *py_entry_handle;
1948         const char *kwnames[] = {
1949                 "entry_handle", NULL
1950         };
1951
1952         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_LookupHandleFree", discard_const_p(char *, kwnames), &py_entry_handle)) {
1953                 return false;
1954         }
1955
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) {
1959                 PyErr_NoMemory();
1960                 return false;
1961         }
1962         r->in.entry_handle = (struct policy_handle *)pytalloc_get_ptr(py_entry_handle);
1963         return true;
1964 }
1965
1966 static PyObject *unpack_py_epm_LookupHandleFree_args_out(struct epm_LookupHandleFree *r)
1967 {
1968         PyObject *result;
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));
1974         return result;
1975 }
1976
1977 static bool pack_py_epm_InqObject_args_in(PyObject *args, PyObject *kwargs, struct epm_InqObject *r)
1978 {
1979         PyObject *py_epm_object;
1980         const char *kwnames[] = {
1981                 "epm_object", NULL
1982         };
1983
1984         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:epm_InqObject", discard_const_p(char *, kwnames), &py_epm_object)) {
1985                 return false;
1986         }
1987
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) {
1991                 PyErr_NoMemory();
1992                 return false;
1993         }
1994         r->in.epm_object = (struct GUID *)pytalloc_get_ptr(py_epm_object);
1995         return true;
1996 }
1997
1998 static PyObject *unpack_py_epm_InqObject_args_out(struct epm_InqObject *r)
1999 {
2000         PyObject *result;
2001         result = PyInt_FromLong(r->out.result);
2002         return result;
2003 }
2004
2005 static bool pack_py_epm_MgmtDelete_args_in(PyObject *args, PyObject *kwargs, struct epm_MgmtDelete *r)
2006 {
2007         PyObject *py_object_speced;
2008         PyObject *py_object;
2009         PyObject *py_tower;
2010         const char *kwnames[] = {
2011                 "object_speced", "object", "tower", NULL
2012         };
2013
2014         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:epm_MgmtDelete", discard_const_p(char *, kwnames), &py_object_speced, &py_object, &py_tower)) {
2015                 return false;
2016         }
2017
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;
2022         } else {
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) {
2026                         PyErr_NoMemory();
2027                         return false;
2028                 }
2029                 r->in.object = (struct GUID *)pytalloc_get_ptr(py_object);
2030         }
2031         if (py_tower == Py_None) {
2032                 r->in.tower = NULL;
2033         } else {
2034                 r->in.tower = NULL;
2035                 PY_CHECK_TYPE(&epm_twr_t_Type, py_tower, return false;);
2036                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_tower)) == NULL) {
2037                         PyErr_NoMemory();
2038                         return false;
2039                 }
2040                 r->in.tower = (struct epm_twr_t *)pytalloc_get_ptr(py_tower);
2041         }
2042         return true;
2043 }
2044
2045 static PyObject *unpack_py_epm_MgmtDelete_args_out(struct epm_MgmtDelete *r)
2046 {
2047         PyObject *result;
2048         result = PyInt_FromLong(r->out.result);
2049         return result;
2050 }
2051
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 },
2060         { NULL }
2061 };
2062
2063 static PyObject *interface_epmapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2064 {
2065         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_epmapper);
2066 }
2067
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"
2074 "\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,
2080 };
2081
2082 static PyObject *syntax_epmapper_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2083 {
2084         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_epmapper.syntax_id);
2085 }
2086
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,
2095 };
2096
2097 static PyMethodDef epmapper_methods[] = {
2098         { NULL, NULL, 0, NULL }
2099 };
2100
2101 void initepmapper(void)
2102 {
2103         PyObject *m;
2104         PyObject *dep_samba_dcerpc_misc;
2105         PyObject *dep_talloc;
2106         PyObject *dep_samba_dcerpc_base;
2107
2108         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
2109         if (dep_samba_dcerpc_misc == NULL)
2110                 return;
2111
2112         dep_talloc = PyImport_ImportModule("talloc");
2113         if (dep_talloc == NULL)
2114                 return;
2115
2116         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
2117         if (dep_samba_dcerpc_base == NULL)
2118                 return;
2119
2120         Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
2121         if (Object_Type == NULL)
2122                 return;
2123
2124         GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
2125         if (GUID_Type == NULL)
2126                 return;
2127
2128         policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
2129         if (policy_handle_Type == NULL)
2130                 return;
2131
2132         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
2133         if (ClientConnection_Type == NULL)
2134                 return;
2135
2136         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
2137         if (ndr_syntax_id_Type == NULL)
2138                 return;
2139
2140         epm_rhs_dnet_nsp_Type.tp_base = Object_Type;
2141
2142         epm_rhs_osi_tp4_Type.tp_base = Object_Type;
2143
2144         epm_rhs_osi_clns_Type.tp_base = Object_Type;
2145
2146         epm_rhs_udp_Type.tp_base = Object_Type;
2147
2148         epm_rhs_tcp_Type.tp_base = Object_Type;
2149
2150         epm_rhs_ip_Type.tp_base = Object_Type;
2151
2152         epm_rhs_ncadg_Type.tp_base = Object_Type;
2153
2154         epm_rhs_ncacn_Type.tp_base = Object_Type;
2155
2156         epm_rhs_uuid_Type.tp_base = Object_Type;
2157
2158         epm_rhs_ipx_Type.tp_base = Object_Type;
2159
2160         epm_rhs_smb_Type.tp_base = Object_Type;
2161
2162         epm_rhs_named_pipe_Type.tp_base = Object_Type;
2163
2164         epm_rhs_netbios_Type.tp_base = Object_Type;
2165
2166         epm_rhs_netbeui_Type.tp_base = Object_Type;
2167
2168         epm_rhs_spx_Type.tp_base = Object_Type;
2169
2170         epm_rhs_nb_ipx_Type.tp_base = Object_Type;
2171
2172         epm_rhs_http_Type.tp_base = Object_Type;
2173
2174         epm_rhs_unix_ds_Type.tp_base = Object_Type;
2175
2176         epm_rhs_null_Type.tp_base = Object_Type;
2177
2178         epm_rhs_ncalrpc_Type.tp_base = Object_Type;
2179
2180         epm_rhs_appletalk_Type.tp_base = Object_Type;
2181
2182         epm_rhs_atalk_stream_Type.tp_base = Object_Type;
2183
2184         epm_rhs_atalk_datagram_Type.tp_base = Object_Type;
2185
2186         epm_rhs_vines_spp_Type.tp_base = Object_Type;
2187
2188         epm_rhs_vines_ipc_Type.tp_base = Object_Type;
2189
2190         epm_rhs_streettalk_Type.tp_base = Object_Type;
2191
2192         epm_lhs_Type.tp_base = Object_Type;
2193
2194         epm_floor_Type.tp_base = Object_Type;
2195
2196         epm_tower_Type.tp_base = Object_Type;
2197
2198         epm_twr_t_Type.tp_base = Object_Type;
2199
2200         epm_entry_t_Type.tp_base = Object_Type;
2201
2202         rpc_if_id_t_Type.tp_base = Object_Type;
2203
2204         epm_twr_p_t_Type.tp_base = Object_Type;
2205
2206         epmapper_InterfaceType.tp_base = ClientConnection_Type;
2207
2208         epmapper_SyntaxType.tp_base = ndr_syntax_id_Type;
2209
2210         if (PyType_Ready(&epm_rhs_dnet_nsp_Type) < 0)
2211                 return;
2212         if (PyType_Ready(&epm_rhs_osi_tp4_Type) < 0)
2213                 return;
2214         if (PyType_Ready(&epm_rhs_osi_clns_Type) < 0)
2215                 return;
2216         if (PyType_Ready(&epm_rhs_udp_Type) < 0)
2217                 return;
2218         if (PyType_Ready(&epm_rhs_tcp_Type) < 0)
2219                 return;
2220         if (PyType_Ready(&epm_rhs_ip_Type) < 0)
2221                 return;
2222         if (PyType_Ready(&epm_rhs_ncadg_Type) < 0)
2223                 return;
2224         if (PyType_Ready(&epm_rhs_ncacn_Type) < 0)
2225                 return;
2226         if (PyType_Ready(&epm_rhs_uuid_Type) < 0)
2227                 return;
2228         if (PyType_Ready(&epm_rhs_ipx_Type) < 0)
2229                 return;
2230         if (PyType_Ready(&epm_rhs_smb_Type) < 0)
2231                 return;
2232         if (PyType_Ready(&epm_rhs_named_pipe_Type) < 0)
2233                 return;
2234         if (PyType_Ready(&epm_rhs_netbios_Type) < 0)
2235                 return;
2236         if (PyType_Ready(&epm_rhs_netbeui_Type) < 0)
2237                 return;
2238         if (PyType_Ready(&epm_rhs_spx_Type) < 0)
2239                 return;
2240         if (PyType_Ready(&epm_rhs_nb_ipx_Type) < 0)
2241                 return;
2242         if (PyType_Ready(&epm_rhs_http_Type) < 0)
2243                 return;
2244         if (PyType_Ready(&epm_rhs_unix_ds_Type) < 0)
2245                 return;
2246         if (PyType_Ready(&epm_rhs_null_Type) < 0)
2247                 return;
2248         if (PyType_Ready(&epm_rhs_ncalrpc_Type) < 0)
2249                 return;
2250         if (PyType_Ready(&epm_rhs_appletalk_Type) < 0)
2251                 return;
2252         if (PyType_Ready(&epm_rhs_atalk_stream_Type) < 0)
2253                 return;
2254         if (PyType_Ready(&epm_rhs_atalk_datagram_Type) < 0)
2255                 return;
2256         if (PyType_Ready(&epm_rhs_vines_spp_Type) < 0)
2257                 return;
2258         if (PyType_Ready(&epm_rhs_vines_ipc_Type) < 0)
2259                 return;
2260         if (PyType_Ready(&epm_rhs_streettalk_Type) < 0)
2261                 return;
2262         if (PyType_Ready(&epm_lhs_Type) < 0)
2263                 return;
2264         if (PyType_Ready(&epm_floor_Type) < 0)
2265                 return;
2266         if (PyType_Ready(&epm_tower_Type) < 0)
2267                 return;
2268         if (PyType_Ready(&epm_twr_t_Type) < 0)
2269                 return;
2270         if (PyType_Ready(&epm_entry_t_Type) < 0)
2271                 return;
2272         if (PyType_Ready(&rpc_if_id_t_Type) < 0)
2273                 return;
2274         if (PyType_Ready(&epm_twr_p_t_Type) < 0)
2275                 return;
2276         if (PyType_Ready(&epmapper_InterfaceType) < 0)
2277                 return;
2278         if (PyType_Ready(&epmapper_SyntaxType) < 0)
2279                 return;
2280         if (!PyInterface_AddNdrRpcMethods(&epmapper_InterfaceType, py_ndr_epmapper_methods))
2281                 return;
2282
2283 #ifdef PY_EPM_RHS_DNET_NSP_PATCH
2284         PY_EPM_RHS_DNET_NSP_PATCH(&epm_rhs_dnet_nsp_Type);
2285 #endif
2286 #ifdef PY_EPM_RHS_OSI_TP4_PATCH
2287         PY_EPM_RHS_OSI_TP4_PATCH(&epm_rhs_osi_tp4_Type);
2288 #endif
2289 #ifdef PY_EPM_RHS_OSI_CLNS_PATCH
2290         PY_EPM_RHS_OSI_CLNS_PATCH(&epm_rhs_osi_clns_Type);
2291 #endif
2292 #ifdef PY_EPM_RHS_UDP_PATCH
2293         PY_EPM_RHS_UDP_PATCH(&epm_rhs_udp_Type);
2294 #endif
2295 #ifdef PY_EPM_RHS_TCP_PATCH
2296         PY_EPM_RHS_TCP_PATCH(&epm_rhs_tcp_Type);
2297 #endif
2298 #ifdef PY_EPM_RHS_IP_PATCH
2299         PY_EPM_RHS_IP_PATCH(&epm_rhs_ip_Type);
2300 #endif
2301 #ifdef PY_EPM_RHS_NCADG_PATCH
2302         PY_EPM_RHS_NCADG_PATCH(&epm_rhs_ncadg_Type);
2303 #endif
2304 #ifdef PY_EPM_RHS_NCACN_PATCH
2305         PY_EPM_RHS_NCACN_PATCH(&epm_rhs_ncacn_Type);
2306 #endif
2307 #ifdef PY_EPM_RHS_UUID_PATCH
2308         PY_EPM_RHS_UUID_PATCH(&epm_rhs_uuid_Type);
2309 #endif
2310 #ifdef PY_EPM_RHS_IPX_PATCH
2311         PY_EPM_RHS_IPX_PATCH(&epm_rhs_ipx_Type);
2312 #endif
2313 #ifdef PY_EPM_RHS_SMB_PATCH
2314         PY_EPM_RHS_SMB_PATCH(&epm_rhs_smb_Type);
2315 #endif
2316 #ifdef PY_EPM_RHS_NAMED_PIPE_PATCH
2317         PY_EPM_RHS_NAMED_PIPE_PATCH(&epm_rhs_named_pipe_Type);
2318 #endif
2319 #ifdef PY_EPM_RHS_NETBIOS_PATCH
2320         PY_EPM_RHS_NETBIOS_PATCH(&epm_rhs_netbios_Type);
2321 #endif
2322 #ifdef PY_EPM_RHS_NETBEUI_PATCH
2323         PY_EPM_RHS_NETBEUI_PATCH(&epm_rhs_netbeui_Type);
2324 #endif
2325 #ifdef PY_EPM_RHS_SPX_PATCH
2326         PY_EPM_RHS_SPX_PATCH(&epm_rhs_spx_Type);
2327 #endif
2328 #ifdef PY_EPM_RHS_NB_IPX_PATCH
2329         PY_EPM_RHS_NB_IPX_PATCH(&epm_rhs_nb_ipx_Type);
2330 #endif
2331 #ifdef PY_EPM_RHS_HTTP_PATCH
2332         PY_EPM_RHS_HTTP_PATCH(&epm_rhs_http_Type);
2333 #endif
2334 #ifdef PY_EPM_RHS_UNIX_DS_PATCH
2335         PY_EPM_RHS_UNIX_DS_PATCH(&epm_rhs_unix_ds_Type);
2336 #endif
2337 #ifdef PY_EPM_RHS_NULL_PATCH
2338         PY_EPM_RHS_NULL_PATCH(&epm_rhs_null_Type);
2339 #endif
2340 #ifdef PY_EPM_RHS_NCALRPC_PATCH
2341         PY_EPM_RHS_NCALRPC_PATCH(&epm_rhs_ncalrpc_Type);
2342 #endif
2343 #ifdef PY_EPM_RHS_APPLETALK_PATCH
2344         PY_EPM_RHS_APPLETALK_PATCH(&epm_rhs_appletalk_Type);
2345 #endif
2346 #ifdef PY_EPM_RHS_ATALK_STREAM_PATCH
2347         PY_EPM_RHS_ATALK_STREAM_PATCH(&epm_rhs_atalk_stream_Type);
2348 #endif
2349 #ifdef PY_EPM_RHS_ATALK_DATAGRAM_PATCH
2350         PY_EPM_RHS_ATALK_DATAGRAM_PATCH(&epm_rhs_atalk_datagram_Type);
2351 #endif
2352 #ifdef PY_EPM_RHS_VINES_SPP_PATCH
2353         PY_EPM_RHS_VINES_SPP_PATCH(&epm_rhs_vines_spp_Type);
2354 #endif
2355 #ifdef PY_EPM_RHS_VINES_IPC_PATCH
2356         PY_EPM_RHS_VINES_IPC_PATCH(&epm_rhs_vines_ipc_Type);
2357 #endif
2358 #ifdef PY_EPM_RHS_STREETTALK_PATCH
2359         PY_EPM_RHS_STREETTALK_PATCH(&epm_rhs_streettalk_Type);
2360 #endif
2361 #ifdef PY_EPM_LHS_PATCH
2362         PY_EPM_LHS_PATCH(&epm_lhs_Type);
2363 #endif
2364 #ifdef PY_EPM_FLOOR_PATCH
2365         PY_EPM_FLOOR_PATCH(&epm_floor_Type);
2366 #endif
2367 #ifdef PY_EPM_TOWER_PATCH
2368         PY_EPM_TOWER_PATCH(&epm_tower_Type);
2369 #endif
2370 #ifdef PY_EPM_TWR_T_PATCH
2371         PY_EPM_TWR_T_PATCH(&epm_twr_t_Type);
2372 #endif
2373 #ifdef PY_EPM_ENTRY_T_PATCH
2374         PY_EPM_ENTRY_T_PATCH(&epm_entry_t_Type);
2375 #endif
2376 #ifdef PY_RPC_IF_ID_T_PATCH
2377         PY_RPC_IF_ID_T_PATCH(&rpc_if_id_t_Type);
2378 #endif
2379 #ifdef PY_EPM_TWR_P_T_PATCH
2380         PY_EPM_TWR_P_T_PATCH(&epm_twr_p_t_Type);
2381 #endif
2382 #ifdef PY_EPMAPPER_PATCH
2383         PY_EPMAPPER_PATCH(&epmapper_InterfaceType);
2384 #endif
2385 #ifdef PY_ABSTRACT_SYNTAX_PATCH
2386         PY_ABSTRACT_SYNTAX_PATCH(&epmapper_SyntaxType);
2387 #endif
2388
2389         m = Py_InitModule3("epmapper", epmapper_methods, "epmapper DCE/RPC");
2390         if (m == NULL)
2391                 return;
2392
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);
2504 #endif
2505
2506 }