f6d2798f9b6c8baf20d0f17171c7166dc5557ce3
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / py_dcerpc.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_dcerpc.h"
9 #include "bin/default/librpc/gen_ndr/ndr_dcerpc_c.h"
10
11 /*
12  * These functions are here to ensure they can be optomised out by
13  * the compiler based on the constant input values
14  */
15
16 static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
17 {
18         switch (var_size) {
19         case 8:
20                 return UINT64_MAX;
21         case 4:
22                 return UINT32_MAX;
23         case 2:
24                 return UINT16_MAX;
25         case 1:
26                 return UINT8_MAX;
27         }
28
29         return 0;
30 }
31
32 static inline long long ndr_sizeof2intmax(size_t var_size)
33 {
34         switch (var_size) {
35         case 8:
36                 return INT64_MAX;
37         case 4:
38                 return INT32_MAX;
39         case 2:
40                 return INT16_MAX;
41         case 1:
42                 return INT8_MAX;
43         }
44
45         return 0;
46 }
47
48 static inline PyObject *ndr_PyLong_FromLongLong(long long v)
49 {
50         if (v > LONG_MAX || v < LONG_MIN) {
51                 return PyLong_FromLongLong(v);
52         } else {
53                 return PyInt_FromLong(v);
54         }
55 }
56
57 static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)
58 {
59         if (v > LONG_MAX) {
60                 return PyLong_FromUnsignedLongLong(v);
61         } else {
62                 return PyInt_FromLong(v);
63         }
64 }
65
66 #include "librpc/gen_ndr/misc.h"
67 static PyTypeObject dcerpc_ctx_list_Type;
68 static PyTypeObject dcerpc_bind_Type;
69 static PyTypeObject dcerpc_empty_Type;
70 PyObject *py_import_dcerpc_object(TALLOC_CTX *mem_ctx, int level, union dcerpc_object *in);
71 union dcerpc_object *py_export_dcerpc_object(TALLOC_CTX *mem_ctx, int level, PyObject *in);
72 static PyTypeObject dcerpc_request_Type;
73 PyObject *py_import_dcerpc_bind_ack_reason(TALLOC_CTX *mem_ctx, int level, union dcerpc_bind_ack_reason *in);
74 union dcerpc_bind_ack_reason *py_export_dcerpc_bind_ack_reason(TALLOC_CTX *mem_ctx, int level, PyObject *in);
75 static PyTypeObject dcerpc_ack_ctx_Type;
76 static PyTypeObject dcerpc_bind_ack_Type;
77 static PyTypeObject dcerpc_bind_nak_version_Type;
78 static PyTypeObject dcerpc_bind_nak_Type;
79 static PyTypeObject dcerpc_response_Type;
80 static PyTypeObject dcerpc_fault_Type;
81 static PyTypeObject dcerpc_auth_Type;
82 static PyTypeObject dcerpc_auth3_Type;
83 static PyTypeObject dcerpc_orphaned_Type;
84 static PyTypeObject dcerpc_co_cancel_Type;
85 static PyTypeObject dcerpc_cl_cancel_Type;
86 static PyTypeObject dcerpc_cancel_ack_Type;
87 static PyTypeObject dcerpc_fack_Type;
88 static PyTypeObject dcerpc_ack_Type;
89 static PyTypeObject dcerpc_ping_Type;
90 static PyTypeObject dcerpc_shutdown_Type;
91 static PyTypeObject dcerpc_working_Type;
92 static PyTypeObject RTSCookie_Type;
93 PyObject *py_import_ClientAddressType(TALLOC_CTX *mem_ctx, int level, union ClientAddressType *in);
94 union ClientAddressType *py_export_ClientAddressType(TALLOC_CTX *mem_ctx, int level, PyObject *in);
95 static PyTypeObject ClientAddress_Type;
96 static PyTypeObject FlowControlAcknowledgment_Type;
97 static PyTypeObject dcerpc_rts_cmd_ReceiveWindowSize_Type;
98 static PyTypeObject dcerpc_rts_cmd_FlowControlAck_Type;
99 static PyTypeObject dcerpc_rts_cmd_ConnectionTimeout_Type;
100 static PyTypeObject dcerpc_rts_cmd_Cookie_Type;
101 static PyTypeObject dcerpc_rts_cmd_ChannelLifetime_Type;
102 static PyTypeObject dcerpc_rts_cmd_ClientKeepalive_Type;
103 static PyTypeObject dcerpc_rts_cmd_Version_Type;
104 static PyTypeObject dcerpc_rts_cmd_Empty_Type;
105 static PyTypeObject dcerpc_rts_cmd_Padding_Type;
106 static PyTypeObject dcerpc_rts_cmd_NegativeANCE_Type;
107 static PyTypeObject dcerpc_rts_cmd_ANCE_Type;
108 static PyTypeObject dcerpc_rts_cmd_ClientAddress_Type;
109 static PyTypeObject dcerpc_rts_cmd_AssociationGroupId_Type;
110 static PyTypeObject dcerpc_rts_cmd_Destination_Type;
111 static PyTypeObject dcerpc_rts_cmd_PingTrafficSentNotify_Type;
112 PyObject *py_import_dcerpc_rts_cmds(TALLOC_CTX *mem_ctx, int level, union dcerpc_rts_cmds *in);
113 union dcerpc_rts_cmds *py_export_dcerpc_rts_cmds(TALLOC_CTX *mem_ctx, int level, PyObject *in);
114 static PyTypeObject dcerpc_rts_cmd_Type;
115 static PyTypeObject dcerpc_rts_Type;
116 PyObject *py_import_dcerpc_payload(TALLOC_CTX *mem_ctx, int level, union dcerpc_payload *in);
117 union dcerpc_payload *py_export_dcerpc_payload(TALLOC_CTX *mem_ctx, int level, PyObject *in);
118 static PyTypeObject ncacn_packet_Type;
119 static PyTypeObject ncadg_packet_Type;
120 static PyTypeObject dcerpc_sec_vt_pcontext_Type;
121 static PyTypeObject dcerpc_sec_vt_header2_Type;
122 PyObject *py_import_dcerpc_sec_vt_union(TALLOC_CTX *mem_ctx, int level, union dcerpc_sec_vt_union *in);
123 union dcerpc_sec_vt_union *py_export_dcerpc_sec_vt_union(TALLOC_CTX *mem_ctx, int level, PyObject *in);
124 static PyTypeObject dcerpc_sec_vt_Type;
125 static PyTypeObject dcerpc_sec_vt_count_Type;
126 static PyTypeObject dcerpc_sec_verification_trailer_Type;
127
128 void initdcerpc(void);static PyTypeObject *ndr_syntax_id_Type;
129 static PyTypeObject *Object_Type;
130 static PyTypeObject *GUID_Type;
131
132 static PyObject *py_dcerpc_ctx_list_get_context_id(PyObject *obj, void *closure)
133 {
134         struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(obj);
135         PyObject *py_context_id;
136         py_context_id = PyInt_FromLong((uint16_t)object->context_id);
137         return py_context_id;
138 }
139
140 static int py_dcerpc_ctx_list_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
141 {
142         struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(py_obj);
143         {
144                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
145                 if (PyLong_Check(value)) {
146                         unsigned long long test_var;
147                         test_var = PyLong_AsUnsignedLongLong(value);
148                         if (PyErr_Occurred() != NULL) {
149                                 return -1;
150                         }
151                         if (test_var > uint_max) {
152                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
153                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
154                                 return -1;
155                         }
156                         object->context_id = test_var;
157                 } else if (PyInt_Check(value)) {
158                         long test_var;
159                         test_var = PyInt_AsLong(value);
160                         if (test_var < 0 || test_var > uint_max) {
161                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
162                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
163                                 return -1;
164                         }
165                         object->context_id = test_var;
166                 } else {
167                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
168                           PyInt_Type.tp_name, PyLong_Type.tp_name);
169                         return -1;
170                 }
171         }
172         return 0;
173 }
174
175 static PyObject *py_dcerpc_ctx_list_get_num_transfer_syntaxes(PyObject *obj, void *closure)
176 {
177         struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(obj);
178         PyObject *py_num_transfer_syntaxes;
179         py_num_transfer_syntaxes = PyInt_FromLong((uint16_t)object->num_transfer_syntaxes);
180         return py_num_transfer_syntaxes;
181 }
182
183 static int py_dcerpc_ctx_list_set_num_transfer_syntaxes(PyObject *py_obj, PyObject *value, void *closure)
184 {
185         struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(py_obj);
186         {
187                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_transfer_syntaxes));
188                 if (PyLong_Check(value)) {
189                         unsigned long long test_var;
190                         test_var = PyLong_AsUnsignedLongLong(value);
191                         if (PyErr_Occurred() != NULL) {
192                                 return -1;
193                         }
194                         if (test_var > uint_max) {
195                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
196                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
197                                 return -1;
198                         }
199                         object->num_transfer_syntaxes = test_var;
200                 } else if (PyInt_Check(value)) {
201                         long test_var;
202                         test_var = PyInt_AsLong(value);
203                         if (test_var < 0 || test_var > uint_max) {
204                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
205                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
206                                 return -1;
207                         }
208                         object->num_transfer_syntaxes = test_var;
209                 } else {
210                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
211                           PyInt_Type.tp_name, PyLong_Type.tp_name);
212                         return -1;
213                 }
214         }
215         return 0;
216 }
217
218 static PyObject *py_dcerpc_ctx_list_get_abstract_syntax(PyObject *obj, void *closure)
219 {
220         struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(obj);
221         PyObject *py_abstract_syntax;
222         py_abstract_syntax = pytalloc_reference_ex(ndr_syntax_id_Type, pytalloc_get_mem_ctx(obj), &object->abstract_syntax);
223         return py_abstract_syntax;
224 }
225
226 static int py_dcerpc_ctx_list_set_abstract_syntax(PyObject *py_obj, PyObject *value, void *closure)
227 {
228         struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(py_obj);
229         PY_CHECK_TYPE(ndr_syntax_id_Type, value, return -1;);
230         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
231                 PyErr_NoMemory();
232                 return -1;
233         }
234         object->abstract_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
235         return 0;
236 }
237
238 static PyObject *py_dcerpc_ctx_list_get_transfer_syntaxes(PyObject *obj, void *closure)
239 {
240         struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(obj);
241         PyObject *py_transfer_syntaxes;
242         py_transfer_syntaxes = PyList_New(object->num_transfer_syntaxes);
243         if (py_transfer_syntaxes == NULL) {
244                 return NULL;
245         }
246         {
247                 int transfer_syntaxes_cntr_0;
248                 for (transfer_syntaxes_cntr_0 = 0; transfer_syntaxes_cntr_0 < (object->num_transfer_syntaxes); transfer_syntaxes_cntr_0++) {
249                         PyObject *py_transfer_syntaxes_0;
250                         py_transfer_syntaxes_0 = pytalloc_reference_ex(ndr_syntax_id_Type, object->transfer_syntaxes, &object->transfer_syntaxes[transfer_syntaxes_cntr_0]);
251                         PyList_SetItem(py_transfer_syntaxes, transfer_syntaxes_cntr_0, py_transfer_syntaxes_0);
252                 }
253         }
254         return py_transfer_syntaxes;
255 }
256
257 static int py_dcerpc_ctx_list_set_transfer_syntaxes(PyObject *py_obj, PyObject *value, void *closure)
258 {
259         struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(py_obj);
260         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
261         {
262                 int transfer_syntaxes_cntr_0;
263                 object->transfer_syntaxes = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->transfer_syntaxes, PyList_GET_SIZE(value));
264                 if (!object->transfer_syntaxes) { return -1;; }
265                 talloc_set_name_const(object->transfer_syntaxes, "ARRAY: object->transfer_syntaxes");
266                 for (transfer_syntaxes_cntr_0 = 0; transfer_syntaxes_cntr_0 < PyList_GET_SIZE(value); transfer_syntaxes_cntr_0++) {
267                         PY_CHECK_TYPE(ndr_syntax_id_Type, PyList_GET_ITEM(value, transfer_syntaxes_cntr_0), return -1;);
268                         if (talloc_reference(object->transfer_syntaxes, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, transfer_syntaxes_cntr_0))) == NULL) {
269                                 PyErr_NoMemory();
270                                 return -1;
271                         }
272                         object->transfer_syntaxes[transfer_syntaxes_cntr_0] = *(struct ndr_syntax_id *)pytalloc_get_ptr(PyList_GET_ITEM(value, transfer_syntaxes_cntr_0));
273                 }
274         }
275         return 0;
276 }
277
278 static PyGetSetDef py_dcerpc_ctx_list_getsetters[] = {
279         { discard_const_p(char, "context_id"), py_dcerpc_ctx_list_get_context_id, py_dcerpc_ctx_list_set_context_id },
280         { discard_const_p(char, "num_transfer_syntaxes"), py_dcerpc_ctx_list_get_num_transfer_syntaxes, py_dcerpc_ctx_list_set_num_transfer_syntaxes },
281         { discard_const_p(char, "abstract_syntax"), py_dcerpc_ctx_list_get_abstract_syntax, py_dcerpc_ctx_list_set_abstract_syntax },
282         { discard_const_p(char, "transfer_syntaxes"), py_dcerpc_ctx_list_get_transfer_syntaxes, py_dcerpc_ctx_list_set_transfer_syntaxes },
283         { NULL }
284 };
285
286 static PyObject *py_dcerpc_ctx_list_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
287 {
288         return pytalloc_new(struct dcerpc_ctx_list, type);
289 }
290
291
292 static PyTypeObject dcerpc_ctx_list_Type = {
293         PyObject_HEAD_INIT(NULL) 0,
294         .tp_name = "dcerpc.ctx_list",
295         .tp_getset = py_dcerpc_ctx_list_getsetters,
296         .tp_methods = NULL,
297         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
298         .tp_basicsize = sizeof(pytalloc_Object),
299         .tp_new = py_dcerpc_ctx_list_new,
300 };
301
302
303 static PyObject *py_dcerpc_bind_get_max_xmit_frag(PyObject *obj, void *closure)
304 {
305         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(obj);
306         PyObject *py_max_xmit_frag;
307         py_max_xmit_frag = PyInt_FromLong((uint16_t)object->max_xmit_frag);
308         return py_max_xmit_frag;
309 }
310
311 static int py_dcerpc_bind_set_max_xmit_frag(PyObject *py_obj, PyObject *value, void *closure)
312 {
313         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
314         {
315                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_xmit_frag));
316                 if (PyLong_Check(value)) {
317                         unsigned long long test_var;
318                         test_var = PyLong_AsUnsignedLongLong(value);
319                         if (PyErr_Occurred() != NULL) {
320                                 return -1;
321                         }
322                         if (test_var > uint_max) {
323                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
324                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
325                                 return -1;
326                         }
327                         object->max_xmit_frag = test_var;
328                 } else if (PyInt_Check(value)) {
329                         long test_var;
330                         test_var = PyInt_AsLong(value);
331                         if (test_var < 0 || test_var > uint_max) {
332                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
333                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
334                                 return -1;
335                         }
336                         object->max_xmit_frag = test_var;
337                 } else {
338                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
339                           PyInt_Type.tp_name, PyLong_Type.tp_name);
340                         return -1;
341                 }
342         }
343         return 0;
344 }
345
346 static PyObject *py_dcerpc_bind_get_max_recv_frag(PyObject *obj, void *closure)
347 {
348         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(obj);
349         PyObject *py_max_recv_frag;
350         py_max_recv_frag = PyInt_FromLong((uint16_t)object->max_recv_frag);
351         return py_max_recv_frag;
352 }
353
354 static int py_dcerpc_bind_set_max_recv_frag(PyObject *py_obj, PyObject *value, void *closure)
355 {
356         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
357         {
358                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_recv_frag));
359                 if (PyLong_Check(value)) {
360                         unsigned long long test_var;
361                         test_var = PyLong_AsUnsignedLongLong(value);
362                         if (PyErr_Occurred() != NULL) {
363                                 return -1;
364                         }
365                         if (test_var > uint_max) {
366                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
367                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
368                                 return -1;
369                         }
370                         object->max_recv_frag = test_var;
371                 } else if (PyInt_Check(value)) {
372                         long test_var;
373                         test_var = PyInt_AsLong(value);
374                         if (test_var < 0 || test_var > uint_max) {
375                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
376                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
377                                 return -1;
378                         }
379                         object->max_recv_frag = test_var;
380                 } else {
381                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
382                           PyInt_Type.tp_name, PyLong_Type.tp_name);
383                         return -1;
384                 }
385         }
386         return 0;
387 }
388
389 static PyObject *py_dcerpc_bind_get_assoc_group_id(PyObject *obj, void *closure)
390 {
391         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(obj);
392         PyObject *py_assoc_group_id;
393         py_assoc_group_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->assoc_group_id);
394         return py_assoc_group_id;
395 }
396
397 static int py_dcerpc_bind_set_assoc_group_id(PyObject *py_obj, PyObject *value, void *closure)
398 {
399         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
400         {
401                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->assoc_group_id));
402                 if (PyLong_Check(value)) {
403                         unsigned long long test_var;
404                         test_var = PyLong_AsUnsignedLongLong(value);
405                         if (PyErr_Occurred() != NULL) {
406                                 return -1;
407                         }
408                         if (test_var > uint_max) {
409                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
410                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
411                                 return -1;
412                         }
413                         object->assoc_group_id = test_var;
414                 } else if (PyInt_Check(value)) {
415                         long test_var;
416                         test_var = PyInt_AsLong(value);
417                         if (test_var < 0 || test_var > uint_max) {
418                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
419                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
420                                 return -1;
421                         }
422                         object->assoc_group_id = test_var;
423                 } else {
424                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
425                           PyInt_Type.tp_name, PyLong_Type.tp_name);
426                         return -1;
427                 }
428         }
429         return 0;
430 }
431
432 static PyObject *py_dcerpc_bind_get_num_contexts(PyObject *obj, void *closure)
433 {
434         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(obj);
435         PyObject *py_num_contexts;
436         py_num_contexts = PyInt_FromLong((uint16_t)object->num_contexts);
437         return py_num_contexts;
438 }
439
440 static int py_dcerpc_bind_set_num_contexts(PyObject *py_obj, PyObject *value, void *closure)
441 {
442         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
443         {
444                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_contexts));
445                 if (PyLong_Check(value)) {
446                         unsigned long long test_var;
447                         test_var = PyLong_AsUnsignedLongLong(value);
448                         if (PyErr_Occurred() != NULL) {
449                                 return -1;
450                         }
451                         if (test_var > uint_max) {
452                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
453                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
454                                 return -1;
455                         }
456                         object->num_contexts = test_var;
457                 } else if (PyInt_Check(value)) {
458                         long test_var;
459                         test_var = PyInt_AsLong(value);
460                         if (test_var < 0 || test_var > uint_max) {
461                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
462                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
463                                 return -1;
464                         }
465                         object->num_contexts = test_var;
466                 } else {
467                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
468                           PyInt_Type.tp_name, PyLong_Type.tp_name);
469                         return -1;
470                 }
471         }
472         return 0;
473 }
474
475 static PyObject *py_dcerpc_bind_get_ctx_list(PyObject *obj, void *closure)
476 {
477         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(obj);
478         PyObject *py_ctx_list;
479         py_ctx_list = PyList_New(object->num_contexts);
480         if (py_ctx_list == NULL) {
481                 return NULL;
482         }
483         {
484                 int ctx_list_cntr_0;
485                 for (ctx_list_cntr_0 = 0; ctx_list_cntr_0 < (object->num_contexts); ctx_list_cntr_0++) {
486                         PyObject *py_ctx_list_0;
487                         py_ctx_list_0 = pytalloc_reference_ex(&dcerpc_ctx_list_Type, object->ctx_list, &object->ctx_list[ctx_list_cntr_0]);
488                         PyList_SetItem(py_ctx_list, ctx_list_cntr_0, py_ctx_list_0);
489                 }
490         }
491         return py_ctx_list;
492 }
493
494 static int py_dcerpc_bind_set_ctx_list(PyObject *py_obj, PyObject *value, void *closure)
495 {
496         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
497         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
498         {
499                 int ctx_list_cntr_0;
500                 object->ctx_list = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ctx_list, PyList_GET_SIZE(value));
501                 if (!object->ctx_list) { return -1;; }
502                 talloc_set_name_const(object->ctx_list, "ARRAY: object->ctx_list");
503                 for (ctx_list_cntr_0 = 0; ctx_list_cntr_0 < PyList_GET_SIZE(value); ctx_list_cntr_0++) {
504                         PY_CHECK_TYPE(&dcerpc_ctx_list_Type, PyList_GET_ITEM(value, ctx_list_cntr_0), return -1;);
505                         if (talloc_reference(object->ctx_list, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ctx_list_cntr_0))) == NULL) {
506                                 PyErr_NoMemory();
507                                 return -1;
508                         }
509                         object->ctx_list[ctx_list_cntr_0] = *(struct dcerpc_ctx_list *)pytalloc_get_ptr(PyList_GET_ITEM(value, ctx_list_cntr_0));
510                 }
511         }
512         return 0;
513 }
514
515 static PyObject *py_dcerpc_bind_get_auth_info(PyObject *obj, void *closure)
516 {
517         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(obj);
518         PyObject *py_auth_info;
519         py_auth_info = PyString_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
520         return py_auth_info;
521 }
522
523 static int py_dcerpc_bind_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
524 {
525         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
526         object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
527         return 0;
528 }
529
530 static PyGetSetDef py_dcerpc_bind_getsetters[] = {
531         { discard_const_p(char, "max_xmit_frag"), py_dcerpc_bind_get_max_xmit_frag, py_dcerpc_bind_set_max_xmit_frag },
532         { discard_const_p(char, "max_recv_frag"), py_dcerpc_bind_get_max_recv_frag, py_dcerpc_bind_set_max_recv_frag },
533         { discard_const_p(char, "assoc_group_id"), py_dcerpc_bind_get_assoc_group_id, py_dcerpc_bind_set_assoc_group_id },
534         { discard_const_p(char, "num_contexts"), py_dcerpc_bind_get_num_contexts, py_dcerpc_bind_set_num_contexts },
535         { discard_const_p(char, "ctx_list"), py_dcerpc_bind_get_ctx_list, py_dcerpc_bind_set_ctx_list },
536         { discard_const_p(char, "auth_info"), py_dcerpc_bind_get_auth_info, py_dcerpc_bind_set_auth_info },
537         { NULL }
538 };
539
540 static PyObject *py_dcerpc_bind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
541 {
542         return pytalloc_new(struct dcerpc_bind, type);
543 }
544
545 static PyObject *py_dcerpc_bind_ndr_pack(PyObject *py_obj)
546 {
547         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
548         DATA_BLOB blob;
549         enum ndr_err_code err;
550         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_bind);
551         if (err != NDR_ERR_SUCCESS) {
552                 PyErr_SetNdrError(err);
553                 return NULL;
554         }
555
556         return PyString_FromStringAndSize((char *)blob.data, blob.length);
557 }
558
559 static PyObject *py_dcerpc_bind_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
560 {
561         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
562         DATA_BLOB blob;
563         int blob_length = 0;
564         enum ndr_err_code err;
565         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
566         PyObject *allow_remaining_obj = NULL;
567         bool allow_remaining = false;
568
569         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
570                 discard_const_p(char *, kwnames),
571                 &blob.data, &blob_length,
572                 &allow_remaining_obj)) {
573                 return NULL;
574         }
575         blob.length = blob_length;
576
577         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
578                 allow_remaining = true;
579         }
580
581         if (allow_remaining) {
582                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind);
583         } else {
584                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind);
585         }
586         if (err != NDR_ERR_SUCCESS) {
587                 PyErr_SetNdrError(err);
588                 return NULL;
589         }
590
591         Py_RETURN_NONE;
592 }
593
594 static PyObject *py_dcerpc_bind_ndr_print(PyObject *py_obj)
595 {
596         struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
597         PyObject *ret;
598         char *retstr;
599
600         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_bind, "dcerpc_bind", object);
601         ret = PyString_FromString(retstr);
602         talloc_free(retstr);
603
604         return ret;
605 }
606
607 static PyMethodDef py_dcerpc_bind_methods[] = {
608         { "__ndr_pack__", (PyCFunction)py_dcerpc_bind_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
609         { "__ndr_unpack__", (PyCFunction)py_dcerpc_bind_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
610         { "__ndr_print__", (PyCFunction)py_dcerpc_bind_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
611         { NULL, NULL, 0, NULL }
612 };
613
614
615 static PyTypeObject dcerpc_bind_Type = {
616         PyObject_HEAD_INIT(NULL) 0,
617         .tp_name = "dcerpc.bind",
618         .tp_getset = py_dcerpc_bind_getsetters,
619         .tp_methods = py_dcerpc_bind_methods,
620         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
621         .tp_basicsize = sizeof(pytalloc_Object),
622         .tp_new = py_dcerpc_bind_new,
623 };
624
625
626 static PyObject *py_dcerpc_empty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
627 {
628         return pytalloc_new(struct dcerpc_empty, type);
629 }
630
631
632 static PyTypeObject dcerpc_empty_Type = {
633         PyObject_HEAD_INIT(NULL) 0,
634         .tp_name = "dcerpc.empty",
635         .tp_getset = NULL,
636         .tp_methods = NULL,
637         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
638         .tp_basicsize = sizeof(pytalloc_Object),
639         .tp_new = py_dcerpc_empty_new,
640 };
641
642 PyObject *py_import_dcerpc_object(TALLOC_CTX *mem_ctx, int level, union dcerpc_object *in)
643 {
644         PyObject *ret;
645
646         switch (level) {
647                 case LIBNDR_FLAG_OBJECT_PRESENT:
648                         ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->object);
649                         return ret;
650
651                 default:
652                         ret = pytalloc_reference_ex(&dcerpc_empty_Type, mem_ctx, &in->empty);
653                         return ret;
654
655         }
656         PyErr_SetString(PyExc_TypeError, "unknown union level");
657         return NULL;
658 }
659
660 union dcerpc_object *py_export_dcerpc_object(TALLOC_CTX *mem_ctx, int level, PyObject *in)
661 {
662         union dcerpc_object *ret = talloc_zero(mem_ctx, union dcerpc_object);
663         switch (level) {
664                 case LIBNDR_FLAG_OBJECT_PRESENT:
665                         PY_CHECK_TYPE(GUID_Type, in, talloc_free(ret); return NULL;);
666                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
667                                 PyErr_NoMemory();
668                                 talloc_free(ret); return NULL;
669                         }
670                         ret->object = *(struct GUID *)pytalloc_get_ptr(in);
671                         break;
672
673                 default:
674                         PY_CHECK_TYPE(&dcerpc_empty_Type, in, talloc_free(ret); return NULL;);
675                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
676                                 PyErr_NoMemory();
677                                 talloc_free(ret); return NULL;
678                         }
679                         ret->empty = *(struct dcerpc_empty *)pytalloc_get_ptr(in);
680                         break;
681
682         }
683
684         return ret;
685 }
686
687
688 static PyObject *py_dcerpc_request_get_alloc_hint(PyObject *obj, void *closure)
689 {
690         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
691         PyObject *py_alloc_hint;
692         py_alloc_hint = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alloc_hint);
693         return py_alloc_hint;
694 }
695
696 static int py_dcerpc_request_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
697 {
698         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
699         {
700                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_hint));
701                 if (PyLong_Check(value)) {
702                         unsigned long long test_var;
703                         test_var = PyLong_AsUnsignedLongLong(value);
704                         if (PyErr_Occurred() != NULL) {
705                                 return -1;
706                         }
707                         if (test_var > uint_max) {
708                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
709                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
710                                 return -1;
711                         }
712                         object->alloc_hint = test_var;
713                 } else if (PyInt_Check(value)) {
714                         long test_var;
715                         test_var = PyInt_AsLong(value);
716                         if (test_var < 0 || test_var > uint_max) {
717                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
718                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
719                                 return -1;
720                         }
721                         object->alloc_hint = test_var;
722                 } else {
723                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
724                           PyInt_Type.tp_name, PyLong_Type.tp_name);
725                         return -1;
726                 }
727         }
728         return 0;
729 }
730
731 static PyObject *py_dcerpc_request_get_context_id(PyObject *obj, void *closure)
732 {
733         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
734         PyObject *py_context_id;
735         py_context_id = PyInt_FromLong((uint16_t)object->context_id);
736         return py_context_id;
737 }
738
739 static int py_dcerpc_request_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
740 {
741         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
742         {
743                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
744                 if (PyLong_Check(value)) {
745                         unsigned long long test_var;
746                         test_var = PyLong_AsUnsignedLongLong(value);
747                         if (PyErr_Occurred() != NULL) {
748                                 return -1;
749                         }
750                         if (test_var > uint_max) {
751                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
752                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
753                                 return -1;
754                         }
755                         object->context_id = test_var;
756                 } else if (PyInt_Check(value)) {
757                         long test_var;
758                         test_var = PyInt_AsLong(value);
759                         if (test_var < 0 || test_var > uint_max) {
760                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
761                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
762                                 return -1;
763                         }
764                         object->context_id = test_var;
765                 } else {
766                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
767                           PyInt_Type.tp_name, PyLong_Type.tp_name);
768                         return -1;
769                 }
770         }
771         return 0;
772 }
773
774 static PyObject *py_dcerpc_request_get_opnum(PyObject *obj, void *closure)
775 {
776         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
777         PyObject *py_opnum;
778         py_opnum = PyInt_FromLong((uint16_t)object->opnum);
779         return py_opnum;
780 }
781
782 static int py_dcerpc_request_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
783 {
784         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
785         {
786                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opnum));
787                 if (PyLong_Check(value)) {
788                         unsigned long long test_var;
789                         test_var = PyLong_AsUnsignedLongLong(value);
790                         if (PyErr_Occurred() != NULL) {
791                                 return -1;
792                         }
793                         if (test_var > uint_max) {
794                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
795                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
796                                 return -1;
797                         }
798                         object->opnum = test_var;
799                 } else if (PyInt_Check(value)) {
800                         long test_var;
801                         test_var = PyInt_AsLong(value);
802                         if (test_var < 0 || test_var > uint_max) {
803                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
804                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
805                                 return -1;
806                         }
807                         object->opnum = test_var;
808                 } else {
809                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
810                           PyInt_Type.tp_name, PyLong_Type.tp_name);
811                         return -1;
812                 }
813         }
814         return 0;
815 }
816
817 static PyObject *py_dcerpc_request_get_object(PyObject *obj, void *closure)
818 {
819         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
820         PyObject *py_object;
821         py_object = py_import_dcerpc_object(pytalloc_get_mem_ctx(obj), NDR_DCERPC_REQUEST_OBJECT_PRESENT, &object->object);
822         if (py_object == NULL) {
823                 return NULL;
824         }
825         return py_object;
826 }
827
828 static int py_dcerpc_request_set_object(PyObject *py_obj, PyObject *value, void *closure)
829 {
830         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
831         {
832                 union dcerpc_object *object_switch_0;
833                 object_switch_0 = py_export_dcerpc_object(pytalloc_get_mem_ctx(py_obj), NDR_DCERPC_REQUEST_OBJECT_PRESENT, value);
834                 if (object_switch_0 == NULL) {
835                         return -1;
836                 }
837                 object->object = *object_switch_0;
838         }
839         return 0;
840 }
841
842 static PyObject *py_dcerpc_request_get__pad(PyObject *obj, void *closure)
843 {
844         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
845         PyObject *py__pad;
846         py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
847         return py__pad;
848 }
849
850 static int py_dcerpc_request_set__pad(PyObject *py_obj, PyObject *value, void *closure)
851 {
852         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
853         object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
854         return 0;
855 }
856
857 static PyObject *py_dcerpc_request_get_stub_and_verifier(PyObject *obj, void *closure)
858 {
859         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
860         PyObject *py_stub_and_verifier;
861         py_stub_and_verifier = PyString_FromStringAndSize((char *)(object->stub_and_verifier).data, (object->stub_and_verifier).length);
862         return py_stub_and_verifier;
863 }
864
865 static int py_dcerpc_request_set_stub_and_verifier(PyObject *py_obj, PyObject *value, void *closure)
866 {
867         struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
868         object->stub_and_verifier = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
869         return 0;
870 }
871
872 static PyGetSetDef py_dcerpc_request_getsetters[] = {
873         { discard_const_p(char, "alloc_hint"), py_dcerpc_request_get_alloc_hint, py_dcerpc_request_set_alloc_hint },
874         { discard_const_p(char, "context_id"), py_dcerpc_request_get_context_id, py_dcerpc_request_set_context_id },
875         { discard_const_p(char, "opnum"), py_dcerpc_request_get_opnum, py_dcerpc_request_set_opnum },
876         { discard_const_p(char, "object"), py_dcerpc_request_get_object, py_dcerpc_request_set_object },
877         { discard_const_p(char, "_pad"), py_dcerpc_request_get__pad, py_dcerpc_request_set__pad },
878         { discard_const_p(char, "stub_and_verifier"), py_dcerpc_request_get_stub_and_verifier, py_dcerpc_request_set_stub_and_verifier },
879         { NULL }
880 };
881
882 static PyObject *py_dcerpc_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
883 {
884         return pytalloc_new(struct dcerpc_request, type);
885 }
886
887
888 static PyTypeObject dcerpc_request_Type = {
889         PyObject_HEAD_INIT(NULL) 0,
890         .tp_name = "dcerpc.request",
891         .tp_getset = py_dcerpc_request_getsetters,
892         .tp_methods = NULL,
893         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
894         .tp_basicsize = sizeof(pytalloc_Object),
895         .tp_new = py_dcerpc_request_new,
896 };
897
898 PyObject *py_import_dcerpc_bind_ack_reason(TALLOC_CTX *mem_ctx, int level, union dcerpc_bind_ack_reason *in)
899 {
900         PyObject *ret;
901
902         switch (level) {
903                 case DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK:
904                         ret = PyInt_FromLong((uint16_t)in->negotiate);
905                         return ret;
906
907                 default:
908                         ret = PyInt_FromLong((uint16_t)in->value);
909                         return ret;
910
911         }
912         PyErr_SetString(PyExc_TypeError, "unknown union level");
913         return NULL;
914 }
915
916 union dcerpc_bind_ack_reason *py_export_dcerpc_bind_ack_reason(TALLOC_CTX *mem_ctx, int level, PyObject *in)
917 {
918         union dcerpc_bind_ack_reason *ret = talloc_zero(mem_ctx, union dcerpc_bind_ack_reason);
919         switch (level) {
920                 case DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK:
921                         {
922                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->negotiate));
923                                 if (PyLong_Check(in)) {
924                                         unsigned long long test_var;
925                                         test_var = PyLong_AsUnsignedLongLong(in);
926                                         if (PyErr_Occurred() != NULL) {
927                                                 talloc_free(ret); return NULL;
928                                         }
929                                         if (test_var > uint_max) {
930                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
931                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
932                                                 talloc_free(ret); return NULL;
933                                         }
934                                         ret->negotiate = test_var;
935                                 } else if (PyInt_Check(in)) {
936                                         long test_var;
937                                         test_var = PyInt_AsLong(in);
938                                         if (test_var < 0 || test_var > uint_max) {
939                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
940                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
941                                                 talloc_free(ret); return NULL;
942                                         }
943                                         ret->negotiate = test_var;
944                                 } else {
945                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
946                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
947                                         talloc_free(ret); return NULL;
948                                 }
949                         }
950                         break;
951
952                 default:
953                         {
954                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->value));
955                                 if (PyLong_Check(in)) {
956                                         unsigned long long test_var;
957                                         test_var = PyLong_AsUnsignedLongLong(in);
958                                         if (PyErr_Occurred() != NULL) {
959                                                 talloc_free(ret); return NULL;
960                                         }
961                                         if (test_var > uint_max) {
962                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
963                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
964                                                 talloc_free(ret); return NULL;
965                                         }
966                                         ret->value = test_var;
967                                 } else if (PyInt_Check(in)) {
968                                         long test_var;
969                                         test_var = PyInt_AsLong(in);
970                                         if (test_var < 0 || test_var > uint_max) {
971                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
972                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
973                                                 talloc_free(ret); return NULL;
974                                         }
975                                         ret->value = test_var;
976                                 } else {
977                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
978                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
979                                         talloc_free(ret); return NULL;
980                                 }
981                         }
982                         break;
983
984         }
985
986         return ret;
987 }
988
989
990 static PyObject *py_dcerpc_ack_ctx_get_result(PyObject *obj, void *closure)
991 {
992         struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(obj);
993         PyObject *py_result;
994         py_result = PyInt_FromLong((uint16_t)object->result);
995         return py_result;
996 }
997
998 static int py_dcerpc_ack_ctx_set_result(PyObject *py_obj, PyObject *value, void *closure)
999 {
1000         struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(py_obj);
1001         {
1002                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->result));
1003                 if (PyLong_Check(value)) {
1004                         unsigned long long test_var;
1005                         test_var = PyLong_AsUnsignedLongLong(value);
1006                         if (PyErr_Occurred() != NULL) {
1007                                 return -1;
1008                         }
1009                         if (test_var > uint_max) {
1010                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1011                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1012                                 return -1;
1013                         }
1014                         object->result = test_var;
1015                 } else if (PyInt_Check(value)) {
1016                         long test_var;
1017                         test_var = PyInt_AsLong(value);
1018                         if (test_var < 0 || test_var > uint_max) {
1019                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1020                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1021                                 return -1;
1022                         }
1023                         object->result = test_var;
1024                 } else {
1025                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1026                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1027                         return -1;
1028                 }
1029         }
1030         return 0;
1031 }
1032
1033 static PyObject *py_dcerpc_ack_ctx_get_reason(PyObject *obj, void *closure)
1034 {
1035         struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(obj);
1036         PyObject *py_reason;
1037         py_reason = py_import_dcerpc_bind_ack_reason(pytalloc_get_mem_ctx(obj), object->result, &object->reason);
1038         if (py_reason == NULL) {
1039                 return NULL;
1040         }
1041         return py_reason;
1042 }
1043
1044 static int py_dcerpc_ack_ctx_set_reason(PyObject *py_obj, PyObject *value, void *closure)
1045 {
1046         struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(py_obj);
1047         {
1048                 union dcerpc_bind_ack_reason *reason_switch_0;
1049                 reason_switch_0 = py_export_dcerpc_bind_ack_reason(pytalloc_get_mem_ctx(py_obj), object->result, value);
1050                 if (reason_switch_0 == NULL) {
1051                         return -1;
1052                 }
1053                 object->reason = *reason_switch_0;
1054         }
1055         return 0;
1056 }
1057
1058 static PyObject *py_dcerpc_ack_ctx_get_syntax(PyObject *obj, void *closure)
1059 {
1060         struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(obj);
1061         PyObject *py_syntax;
1062         py_syntax = pytalloc_reference_ex(ndr_syntax_id_Type, pytalloc_get_mem_ctx(obj), &object->syntax);
1063         return py_syntax;
1064 }
1065
1066 static int py_dcerpc_ack_ctx_set_syntax(PyObject *py_obj, PyObject *value, void *closure)
1067 {
1068         struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(py_obj);
1069         PY_CHECK_TYPE(ndr_syntax_id_Type, value, return -1;);
1070         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1071                 PyErr_NoMemory();
1072                 return -1;
1073         }
1074         object->syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
1075         return 0;
1076 }
1077
1078 static PyGetSetDef py_dcerpc_ack_ctx_getsetters[] = {
1079         { discard_const_p(char, "result"), py_dcerpc_ack_ctx_get_result, py_dcerpc_ack_ctx_set_result },
1080         { discard_const_p(char, "reason"), py_dcerpc_ack_ctx_get_reason, py_dcerpc_ack_ctx_set_reason },
1081         { discard_const_p(char, "syntax"), py_dcerpc_ack_ctx_get_syntax, py_dcerpc_ack_ctx_set_syntax },
1082         { NULL }
1083 };
1084
1085 static PyObject *py_dcerpc_ack_ctx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1086 {
1087         return pytalloc_new(struct dcerpc_ack_ctx, type);
1088 }
1089
1090
1091 static PyTypeObject dcerpc_ack_ctx_Type = {
1092         PyObject_HEAD_INIT(NULL) 0,
1093         .tp_name = "dcerpc.ack_ctx",
1094         .tp_getset = py_dcerpc_ack_ctx_getsetters,
1095         .tp_methods = NULL,
1096         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1097         .tp_basicsize = sizeof(pytalloc_Object),
1098         .tp_new = py_dcerpc_ack_ctx_new,
1099 };
1100
1101
1102 static PyObject *py_dcerpc_bind_ack_get_max_xmit_frag(PyObject *obj, void *closure)
1103 {
1104         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1105         PyObject *py_max_xmit_frag;
1106         py_max_xmit_frag = PyInt_FromLong((uint16_t)object->max_xmit_frag);
1107         return py_max_xmit_frag;
1108 }
1109
1110 static int py_dcerpc_bind_ack_set_max_xmit_frag(PyObject *py_obj, PyObject *value, void *closure)
1111 {
1112         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1113         {
1114                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_xmit_frag));
1115                 if (PyLong_Check(value)) {
1116                         unsigned long long test_var;
1117                         test_var = PyLong_AsUnsignedLongLong(value);
1118                         if (PyErr_Occurred() != NULL) {
1119                                 return -1;
1120                         }
1121                         if (test_var > uint_max) {
1122                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1123                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1124                                 return -1;
1125                         }
1126                         object->max_xmit_frag = test_var;
1127                 } else if (PyInt_Check(value)) {
1128                         long test_var;
1129                         test_var = PyInt_AsLong(value);
1130                         if (test_var < 0 || test_var > uint_max) {
1131                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1132                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1133                                 return -1;
1134                         }
1135                         object->max_xmit_frag = test_var;
1136                 } else {
1137                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1138                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1139                         return -1;
1140                 }
1141         }
1142         return 0;
1143 }
1144
1145 static PyObject *py_dcerpc_bind_ack_get_max_recv_frag(PyObject *obj, void *closure)
1146 {
1147         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1148         PyObject *py_max_recv_frag;
1149         py_max_recv_frag = PyInt_FromLong((uint16_t)object->max_recv_frag);
1150         return py_max_recv_frag;
1151 }
1152
1153 static int py_dcerpc_bind_ack_set_max_recv_frag(PyObject *py_obj, PyObject *value, void *closure)
1154 {
1155         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1156         {
1157                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_recv_frag));
1158                 if (PyLong_Check(value)) {
1159                         unsigned long long test_var;
1160                         test_var = PyLong_AsUnsignedLongLong(value);
1161                         if (PyErr_Occurred() != NULL) {
1162                                 return -1;
1163                         }
1164                         if (test_var > uint_max) {
1165                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1166                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1167                                 return -1;
1168                         }
1169                         object->max_recv_frag = test_var;
1170                 } else if (PyInt_Check(value)) {
1171                         long test_var;
1172                         test_var = PyInt_AsLong(value);
1173                         if (test_var < 0 || test_var > uint_max) {
1174                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1175                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1176                                 return -1;
1177                         }
1178                         object->max_recv_frag = test_var;
1179                 } else {
1180                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1181                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1182                         return -1;
1183                 }
1184         }
1185         return 0;
1186 }
1187
1188 static PyObject *py_dcerpc_bind_ack_get_assoc_group_id(PyObject *obj, void *closure)
1189 {
1190         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1191         PyObject *py_assoc_group_id;
1192         py_assoc_group_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->assoc_group_id);
1193         return py_assoc_group_id;
1194 }
1195
1196 static int py_dcerpc_bind_ack_set_assoc_group_id(PyObject *py_obj, PyObject *value, void *closure)
1197 {
1198         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1199         {
1200                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->assoc_group_id));
1201                 if (PyLong_Check(value)) {
1202                         unsigned long long test_var;
1203                         test_var = PyLong_AsUnsignedLongLong(value);
1204                         if (PyErr_Occurred() != NULL) {
1205                                 return -1;
1206                         }
1207                         if (test_var > uint_max) {
1208                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1209                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1210                                 return -1;
1211                         }
1212                         object->assoc_group_id = test_var;
1213                 } else if (PyInt_Check(value)) {
1214                         long test_var;
1215                         test_var = PyInt_AsLong(value);
1216                         if (test_var < 0 || test_var > uint_max) {
1217                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1218                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1219                                 return -1;
1220                         }
1221                         object->assoc_group_id = test_var;
1222                 } else {
1223                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1224                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1225                         return -1;
1226                 }
1227         }
1228         return 0;
1229 }
1230
1231 static PyObject *py_dcerpc_bind_ack_get_secondary_address_size(PyObject *obj, void *closure)
1232 {
1233         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1234         PyObject *py_secondary_address_size;
1235         py_secondary_address_size = PyInt_FromLong((uint16_t)object->secondary_address_size);
1236         return py_secondary_address_size;
1237 }
1238
1239 static int py_dcerpc_bind_ack_set_secondary_address_size(PyObject *py_obj, PyObject *value, void *closure)
1240 {
1241         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1242         {
1243                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->secondary_address_size));
1244                 if (PyLong_Check(value)) {
1245                         unsigned long long test_var;
1246                         test_var = PyLong_AsUnsignedLongLong(value);
1247                         if (PyErr_Occurred() != NULL) {
1248                                 return -1;
1249                         }
1250                         if (test_var > uint_max) {
1251                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1252                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1253                                 return -1;
1254                         }
1255                         object->secondary_address_size = test_var;
1256                 } else if (PyInt_Check(value)) {
1257                         long test_var;
1258                         test_var = PyInt_AsLong(value);
1259                         if (test_var < 0 || test_var > uint_max) {
1260                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1261                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1262                                 return -1;
1263                         }
1264                         object->secondary_address_size = test_var;
1265                 } else {
1266                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1267                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1268                         return -1;
1269                 }
1270         }
1271         return 0;
1272 }
1273
1274 static PyObject *py_dcerpc_bind_ack_get_secondary_address(PyObject *obj, void *closure)
1275 {
1276         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1277         PyObject *py_secondary_address;
1278         if (object->secondary_address == NULL) {
1279                 py_secondary_address = Py_None;
1280                 Py_INCREF(py_secondary_address);
1281         } else {
1282                 py_secondary_address = PyUnicode_Decode(object->secondary_address, strlen(object->secondary_address), "utf-8", "ignore");
1283         }
1284         return py_secondary_address;
1285 }
1286
1287 static int py_dcerpc_bind_ack_set_secondary_address(PyObject *py_obj, PyObject *value, void *closure)
1288 {
1289         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1290         if (PyUnicode_Check(value)) {
1291                 object->secondary_address = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
1292         } else if (PyString_Check(value)) {
1293                 object->secondary_address = PyString_AS_STRING(value);
1294         } else {
1295                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1296                 return -1;
1297         }
1298         return 0;
1299 }
1300
1301 static PyObject *py_dcerpc_bind_ack_get__pad1(PyObject *obj, void *closure)
1302 {
1303         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1304         PyObject *py__pad1;
1305         py__pad1 = PyString_FromStringAndSize((char *)(object->_pad1).data, (object->_pad1).length);
1306         return py__pad1;
1307 }
1308
1309 static int py_dcerpc_bind_ack_set__pad1(PyObject *py_obj, PyObject *value, void *closure)
1310 {
1311         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1312         object->_pad1 = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
1313         return 0;
1314 }
1315
1316 static PyObject *py_dcerpc_bind_ack_get_num_results(PyObject *obj, void *closure)
1317 {
1318         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1319         PyObject *py_num_results;
1320         py_num_results = PyInt_FromLong((uint16_t)object->num_results);
1321         return py_num_results;
1322 }
1323
1324 static int py_dcerpc_bind_ack_set_num_results(PyObject *py_obj, PyObject *value, void *closure)
1325 {
1326         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1327         {
1328                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_results));
1329                 if (PyLong_Check(value)) {
1330                         unsigned long long test_var;
1331                         test_var = PyLong_AsUnsignedLongLong(value);
1332                         if (PyErr_Occurred() != NULL) {
1333                                 return -1;
1334                         }
1335                         if (test_var > uint_max) {
1336                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1337                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1338                                 return -1;
1339                         }
1340                         object->num_results = test_var;
1341                 } else if (PyInt_Check(value)) {
1342                         long test_var;
1343                         test_var = PyInt_AsLong(value);
1344                         if (test_var < 0 || test_var > uint_max) {
1345                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1346                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1347                                 return -1;
1348                         }
1349                         object->num_results = test_var;
1350                 } else {
1351                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1352                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1353                         return -1;
1354                 }
1355         }
1356         return 0;
1357 }
1358
1359 static PyObject *py_dcerpc_bind_ack_get_ctx_list(PyObject *obj, void *closure)
1360 {
1361         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1362         PyObject *py_ctx_list;
1363         py_ctx_list = PyList_New(object->num_results);
1364         if (py_ctx_list == NULL) {
1365                 return NULL;
1366         }
1367         {
1368                 int ctx_list_cntr_0;
1369                 for (ctx_list_cntr_0 = 0; ctx_list_cntr_0 < (object->num_results); ctx_list_cntr_0++) {
1370                         PyObject *py_ctx_list_0;
1371                         py_ctx_list_0 = pytalloc_reference_ex(&dcerpc_ack_ctx_Type, object->ctx_list, &object->ctx_list[ctx_list_cntr_0]);
1372                         PyList_SetItem(py_ctx_list, ctx_list_cntr_0, py_ctx_list_0);
1373                 }
1374         }
1375         return py_ctx_list;
1376 }
1377
1378 static int py_dcerpc_bind_ack_set_ctx_list(PyObject *py_obj, PyObject *value, void *closure)
1379 {
1380         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1381         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1382         {
1383                 int ctx_list_cntr_0;
1384                 object->ctx_list = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ctx_list, PyList_GET_SIZE(value));
1385                 if (!object->ctx_list) { return -1;; }
1386                 talloc_set_name_const(object->ctx_list, "ARRAY: object->ctx_list");
1387                 for (ctx_list_cntr_0 = 0; ctx_list_cntr_0 < PyList_GET_SIZE(value); ctx_list_cntr_0++) {
1388                         PY_CHECK_TYPE(&dcerpc_ack_ctx_Type, PyList_GET_ITEM(value, ctx_list_cntr_0), return -1;);
1389                         if (talloc_reference(object->ctx_list, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ctx_list_cntr_0))) == NULL) {
1390                                 PyErr_NoMemory();
1391                                 return -1;
1392                         }
1393                         object->ctx_list[ctx_list_cntr_0] = *(struct dcerpc_ack_ctx *)pytalloc_get_ptr(PyList_GET_ITEM(value, ctx_list_cntr_0));
1394                 }
1395         }
1396         return 0;
1397 }
1398
1399 static PyObject *py_dcerpc_bind_ack_get_auth_info(PyObject *obj, void *closure)
1400 {
1401         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1402         PyObject *py_auth_info;
1403         py_auth_info = PyString_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
1404         return py_auth_info;
1405 }
1406
1407 static int py_dcerpc_bind_ack_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
1408 {
1409         struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1410         object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
1411         return 0;
1412 }
1413
1414 static PyGetSetDef py_dcerpc_bind_ack_getsetters[] = {
1415         { discard_const_p(char, "max_xmit_frag"), py_dcerpc_bind_ack_get_max_xmit_frag, py_dcerpc_bind_ack_set_max_xmit_frag },
1416         { discard_const_p(char, "max_recv_frag"), py_dcerpc_bind_ack_get_max_recv_frag, py_dcerpc_bind_ack_set_max_recv_frag },
1417         { discard_const_p(char, "assoc_group_id"), py_dcerpc_bind_ack_get_assoc_group_id, py_dcerpc_bind_ack_set_assoc_group_id },
1418         { discard_const_p(char, "secondary_address_size"), py_dcerpc_bind_ack_get_secondary_address_size, py_dcerpc_bind_ack_set_secondary_address_size },
1419         { discard_const_p(char, "secondary_address"), py_dcerpc_bind_ack_get_secondary_address, py_dcerpc_bind_ack_set_secondary_address },
1420         { discard_const_p(char, "_pad1"), py_dcerpc_bind_ack_get__pad1, py_dcerpc_bind_ack_set__pad1 },
1421         { discard_const_p(char, "num_results"), py_dcerpc_bind_ack_get_num_results, py_dcerpc_bind_ack_set_num_results },
1422         { discard_const_p(char, "ctx_list"), py_dcerpc_bind_ack_get_ctx_list, py_dcerpc_bind_ack_set_ctx_list },
1423         { discard_const_p(char, "auth_info"), py_dcerpc_bind_ack_get_auth_info, py_dcerpc_bind_ack_set_auth_info },
1424         { NULL }
1425 };
1426
1427 static PyObject *py_dcerpc_bind_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1428 {
1429         return pytalloc_new(struct dcerpc_bind_ack, type);
1430 }
1431
1432
1433 static PyTypeObject dcerpc_bind_ack_Type = {
1434         PyObject_HEAD_INIT(NULL) 0,
1435         .tp_name = "dcerpc.bind_ack",
1436         .tp_getset = py_dcerpc_bind_ack_getsetters,
1437         .tp_methods = NULL,
1438         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1439         .tp_basicsize = sizeof(pytalloc_Object),
1440         .tp_new = py_dcerpc_bind_ack_new,
1441 };
1442
1443
1444 static PyObject *py_dcerpc_bind_nak_version_get_rpc_vers(PyObject *obj, void *closure)
1445 {
1446         struct dcerpc_bind_nak_version *object = (struct dcerpc_bind_nak_version *)pytalloc_get_ptr(obj);
1447         PyObject *py_rpc_vers;
1448         py_rpc_vers = PyInt_FromLong((uint16_t)object->rpc_vers);
1449         return py_rpc_vers;
1450 }
1451
1452 static int py_dcerpc_bind_nak_version_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
1453 {
1454         struct dcerpc_bind_nak_version *object = (struct dcerpc_bind_nak_version *)pytalloc_get_ptr(py_obj);
1455         {
1456                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers));
1457                 if (PyLong_Check(value)) {
1458                         unsigned long long test_var;
1459                         test_var = PyLong_AsUnsignedLongLong(value);
1460                         if (PyErr_Occurred() != NULL) {
1461                                 return -1;
1462                         }
1463                         if (test_var > uint_max) {
1464                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1465                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1466                                 return -1;
1467                         }
1468                         object->rpc_vers = test_var;
1469                 } else if (PyInt_Check(value)) {
1470                         long test_var;
1471                         test_var = PyInt_AsLong(value);
1472                         if (test_var < 0 || test_var > uint_max) {
1473                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1474                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1475                                 return -1;
1476                         }
1477                         object->rpc_vers = test_var;
1478                 } else {
1479                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1480                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1481                         return -1;
1482                 }
1483         }
1484         return 0;
1485 }
1486
1487 static PyObject *py_dcerpc_bind_nak_version_get_rpc_vers_minor(PyObject *obj, void *closure)
1488 {
1489         struct dcerpc_bind_nak_version *object = (struct dcerpc_bind_nak_version *)pytalloc_get_ptr(obj);
1490         PyObject *py_rpc_vers_minor;
1491         py_rpc_vers_minor = PyInt_FromLong((uint16_t)object->rpc_vers_minor);
1492         return py_rpc_vers_minor;
1493 }
1494
1495 static int py_dcerpc_bind_nak_version_set_rpc_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
1496 {
1497         struct dcerpc_bind_nak_version *object = (struct dcerpc_bind_nak_version *)pytalloc_get_ptr(py_obj);
1498         {
1499                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers_minor));
1500                 if (PyLong_Check(value)) {
1501                         unsigned long long test_var;
1502                         test_var = PyLong_AsUnsignedLongLong(value);
1503                         if (PyErr_Occurred() != NULL) {
1504                                 return -1;
1505                         }
1506                         if (test_var > uint_max) {
1507                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1508                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1509                                 return -1;
1510                         }
1511                         object->rpc_vers_minor = test_var;
1512                 } else if (PyInt_Check(value)) {
1513                         long test_var;
1514                         test_var = PyInt_AsLong(value);
1515                         if (test_var < 0 || test_var > uint_max) {
1516                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1517                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1518                                 return -1;
1519                         }
1520                         object->rpc_vers_minor = test_var;
1521                 } else {
1522                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1523                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1524                         return -1;
1525                 }
1526         }
1527         return 0;
1528 }
1529
1530 static PyGetSetDef py_dcerpc_bind_nak_version_getsetters[] = {
1531         { discard_const_p(char, "rpc_vers"), py_dcerpc_bind_nak_version_get_rpc_vers, py_dcerpc_bind_nak_version_set_rpc_vers },
1532         { discard_const_p(char, "rpc_vers_minor"), py_dcerpc_bind_nak_version_get_rpc_vers_minor, py_dcerpc_bind_nak_version_set_rpc_vers_minor },
1533         { NULL }
1534 };
1535
1536 static PyObject *py_dcerpc_bind_nak_version_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1537 {
1538         return pytalloc_new(struct dcerpc_bind_nak_version, type);
1539 }
1540
1541
1542 static PyTypeObject dcerpc_bind_nak_version_Type = {
1543         PyObject_HEAD_INIT(NULL) 0,
1544         .tp_name = "dcerpc.bind_nak_version",
1545         .tp_getset = py_dcerpc_bind_nak_version_getsetters,
1546         .tp_methods = NULL,
1547         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1548         .tp_basicsize = sizeof(pytalloc_Object),
1549         .tp_new = py_dcerpc_bind_nak_version_new,
1550 };
1551
1552
1553 static PyObject *py_dcerpc_bind_nak_get_reject_reason(PyObject *obj, void *closure)
1554 {
1555         struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(obj);
1556         PyObject *py_reject_reason;
1557         py_reject_reason = PyInt_FromLong((uint16_t)object->reject_reason);
1558         return py_reject_reason;
1559 }
1560
1561 static int py_dcerpc_bind_nak_set_reject_reason(PyObject *py_obj, PyObject *value, void *closure)
1562 {
1563         struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(py_obj);
1564         {
1565                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reject_reason));
1566                 if (PyLong_Check(value)) {
1567                         unsigned long long test_var;
1568                         test_var = PyLong_AsUnsignedLongLong(value);
1569                         if (PyErr_Occurred() != NULL) {
1570                                 return -1;
1571                         }
1572                         if (test_var > uint_max) {
1573                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1574                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1575                                 return -1;
1576                         }
1577                         object->reject_reason = test_var;
1578                 } else if (PyInt_Check(value)) {
1579                         long test_var;
1580                         test_var = PyInt_AsLong(value);
1581                         if (test_var < 0 || test_var > uint_max) {
1582                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1583                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1584                                 return -1;
1585                         }
1586                         object->reject_reason = test_var;
1587                 } else {
1588                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1589                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1590                         return -1;
1591                 }
1592         }
1593         return 0;
1594 }
1595
1596 static PyObject *py_dcerpc_bind_nak_get_num_versions(PyObject *obj, void *closure)
1597 {
1598         struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(obj);
1599         PyObject *py_num_versions;
1600         py_num_versions = PyInt_FromLong((uint16_t)object->num_versions);
1601         return py_num_versions;
1602 }
1603
1604 static int py_dcerpc_bind_nak_set_num_versions(PyObject *py_obj, PyObject *value, void *closure)
1605 {
1606         struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(py_obj);
1607         {
1608                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_versions));
1609                 if (PyLong_Check(value)) {
1610                         unsigned long long test_var;
1611                         test_var = PyLong_AsUnsignedLongLong(value);
1612                         if (PyErr_Occurred() != NULL) {
1613                                 return -1;
1614                         }
1615                         if (test_var > uint_max) {
1616                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1617                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1618                                 return -1;
1619                         }
1620                         object->num_versions = test_var;
1621                 } else if (PyInt_Check(value)) {
1622                         long test_var;
1623                         test_var = PyInt_AsLong(value);
1624                         if (test_var < 0 || test_var > uint_max) {
1625                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1626                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1627                                 return -1;
1628                         }
1629                         object->num_versions = test_var;
1630                 } else {
1631                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1632                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1633                         return -1;
1634                 }
1635         }
1636         return 0;
1637 }
1638
1639 static PyObject *py_dcerpc_bind_nak_get_versions(PyObject *obj, void *closure)
1640 {
1641         struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(obj);
1642         PyObject *py_versions;
1643         py_versions = PyList_New(object->num_versions);
1644         if (py_versions == NULL) {
1645                 return NULL;
1646         }
1647         {
1648                 int versions_cntr_0;
1649                 for (versions_cntr_0 = 0; versions_cntr_0 < (object->num_versions); versions_cntr_0++) {
1650                         PyObject *py_versions_0;
1651                         py_versions_0 = pytalloc_reference_ex(&dcerpc_bind_nak_version_Type, object->versions, &object->versions[versions_cntr_0]);
1652                         PyList_SetItem(py_versions, versions_cntr_0, py_versions_0);
1653                 }
1654         }
1655         return py_versions;
1656 }
1657
1658 static int py_dcerpc_bind_nak_set_versions(PyObject *py_obj, PyObject *value, void *closure)
1659 {
1660         struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(py_obj);
1661         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1662         {
1663                 int versions_cntr_0;
1664                 object->versions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->versions, PyList_GET_SIZE(value));
1665                 if (!object->versions) { return -1;; }
1666                 talloc_set_name_const(object->versions, "ARRAY: object->versions");
1667                 for (versions_cntr_0 = 0; versions_cntr_0 < PyList_GET_SIZE(value); versions_cntr_0++) {
1668                         PY_CHECK_TYPE(&dcerpc_bind_nak_version_Type, PyList_GET_ITEM(value, versions_cntr_0), return -1;);
1669                         if (talloc_reference(object->versions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, versions_cntr_0))) == NULL) {
1670                                 PyErr_NoMemory();
1671                                 return -1;
1672                         }
1673                         object->versions[versions_cntr_0] = *(struct dcerpc_bind_nak_version *)pytalloc_get_ptr(PyList_GET_ITEM(value, versions_cntr_0));
1674                 }
1675         }
1676         return 0;
1677 }
1678
1679 static PyObject *py_dcerpc_bind_nak_get__pad(PyObject *obj, void *closure)
1680 {
1681         struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(obj);
1682         PyObject *py__pad;
1683         py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
1684         return py__pad;
1685 }
1686
1687 static int py_dcerpc_bind_nak_set__pad(PyObject *py_obj, PyObject *value, void *closure)
1688 {
1689         struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(py_obj);
1690         object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
1691         return 0;
1692 }
1693
1694 static PyGetSetDef py_dcerpc_bind_nak_getsetters[] = {
1695         { discard_const_p(char, "reject_reason"), py_dcerpc_bind_nak_get_reject_reason, py_dcerpc_bind_nak_set_reject_reason },
1696         { discard_const_p(char, "num_versions"), py_dcerpc_bind_nak_get_num_versions, py_dcerpc_bind_nak_set_num_versions },
1697         { discard_const_p(char, "versions"), py_dcerpc_bind_nak_get_versions, py_dcerpc_bind_nak_set_versions },
1698         { discard_const_p(char, "_pad"), py_dcerpc_bind_nak_get__pad, py_dcerpc_bind_nak_set__pad },
1699         { NULL }
1700 };
1701
1702 static PyObject *py_dcerpc_bind_nak_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1703 {
1704         return pytalloc_new(struct dcerpc_bind_nak, type);
1705 }
1706
1707
1708 static PyTypeObject dcerpc_bind_nak_Type = {
1709         PyObject_HEAD_INIT(NULL) 0,
1710         .tp_name = "dcerpc.bind_nak",
1711         .tp_getset = py_dcerpc_bind_nak_getsetters,
1712         .tp_methods = NULL,
1713         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1714         .tp_basicsize = sizeof(pytalloc_Object),
1715         .tp_new = py_dcerpc_bind_nak_new,
1716 };
1717
1718
1719 static PyObject *py_dcerpc_response_get_alloc_hint(PyObject *obj, void *closure)
1720 {
1721         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(obj);
1722         PyObject *py_alloc_hint;
1723         py_alloc_hint = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alloc_hint);
1724         return py_alloc_hint;
1725 }
1726
1727 static int py_dcerpc_response_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
1728 {
1729         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(py_obj);
1730         {
1731                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_hint));
1732                 if (PyLong_Check(value)) {
1733                         unsigned long long test_var;
1734                         test_var = PyLong_AsUnsignedLongLong(value);
1735                         if (PyErr_Occurred() != NULL) {
1736                                 return -1;
1737                         }
1738                         if (test_var > uint_max) {
1739                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1740                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1741                                 return -1;
1742                         }
1743                         object->alloc_hint = test_var;
1744                 } else if (PyInt_Check(value)) {
1745                         long test_var;
1746                         test_var = PyInt_AsLong(value);
1747                         if (test_var < 0 || test_var > uint_max) {
1748                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1749                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1750                                 return -1;
1751                         }
1752                         object->alloc_hint = test_var;
1753                 } else {
1754                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1755                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1756                         return -1;
1757                 }
1758         }
1759         return 0;
1760 }
1761
1762 static PyObject *py_dcerpc_response_get_context_id(PyObject *obj, void *closure)
1763 {
1764         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(obj);
1765         PyObject *py_context_id;
1766         py_context_id = PyInt_FromLong((uint16_t)object->context_id);
1767         return py_context_id;
1768 }
1769
1770 static int py_dcerpc_response_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
1771 {
1772         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(py_obj);
1773         {
1774                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
1775                 if (PyLong_Check(value)) {
1776                         unsigned long long test_var;
1777                         test_var = PyLong_AsUnsignedLongLong(value);
1778                         if (PyErr_Occurred() != NULL) {
1779                                 return -1;
1780                         }
1781                         if (test_var > uint_max) {
1782                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1783                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1784                                 return -1;
1785                         }
1786                         object->context_id = test_var;
1787                 } else if (PyInt_Check(value)) {
1788                         long test_var;
1789                         test_var = PyInt_AsLong(value);
1790                         if (test_var < 0 || test_var > uint_max) {
1791                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1792                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1793                                 return -1;
1794                         }
1795                         object->context_id = test_var;
1796                 } else {
1797                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1798                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1799                         return -1;
1800                 }
1801         }
1802         return 0;
1803 }
1804
1805 static PyObject *py_dcerpc_response_get_cancel_count(PyObject *obj, void *closure)
1806 {
1807         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(obj);
1808         PyObject *py_cancel_count;
1809         py_cancel_count = PyInt_FromLong((uint16_t)object->cancel_count);
1810         return py_cancel_count;
1811 }
1812
1813 static int py_dcerpc_response_set_cancel_count(PyObject *py_obj, PyObject *value, void *closure)
1814 {
1815         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(py_obj);
1816         {
1817                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cancel_count));
1818                 if (PyLong_Check(value)) {
1819                         unsigned long long test_var;
1820                         test_var = PyLong_AsUnsignedLongLong(value);
1821                         if (PyErr_Occurred() != NULL) {
1822                                 return -1;
1823                         }
1824                         if (test_var > uint_max) {
1825                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1826                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1827                                 return -1;
1828                         }
1829                         object->cancel_count = test_var;
1830                 } else if (PyInt_Check(value)) {
1831                         long test_var;
1832                         test_var = PyInt_AsLong(value);
1833                         if (test_var < 0 || test_var > uint_max) {
1834                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1835                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1836                                 return -1;
1837                         }
1838                         object->cancel_count = test_var;
1839                 } else {
1840                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1841                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1842                         return -1;
1843                 }
1844         }
1845         return 0;
1846 }
1847
1848 static PyObject *py_dcerpc_response_get__pad(PyObject *obj, void *closure)
1849 {
1850         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(obj);
1851         PyObject *py__pad;
1852         py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
1853         return py__pad;
1854 }
1855
1856 static int py_dcerpc_response_set__pad(PyObject *py_obj, PyObject *value, void *closure)
1857 {
1858         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(py_obj);
1859         object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
1860         return 0;
1861 }
1862
1863 static PyObject *py_dcerpc_response_get_stub_and_verifier(PyObject *obj, void *closure)
1864 {
1865         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(obj);
1866         PyObject *py_stub_and_verifier;
1867         py_stub_and_verifier = PyString_FromStringAndSize((char *)(object->stub_and_verifier).data, (object->stub_and_verifier).length);
1868         return py_stub_and_verifier;
1869 }
1870
1871 static int py_dcerpc_response_set_stub_and_verifier(PyObject *py_obj, PyObject *value, void *closure)
1872 {
1873         struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(py_obj);
1874         object->stub_and_verifier = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
1875         return 0;
1876 }
1877
1878 static PyGetSetDef py_dcerpc_response_getsetters[] = {
1879         { discard_const_p(char, "alloc_hint"), py_dcerpc_response_get_alloc_hint, py_dcerpc_response_set_alloc_hint },
1880         { discard_const_p(char, "context_id"), py_dcerpc_response_get_context_id, py_dcerpc_response_set_context_id },
1881         { discard_const_p(char, "cancel_count"), py_dcerpc_response_get_cancel_count, py_dcerpc_response_set_cancel_count },
1882         { discard_const_p(char, "_pad"), py_dcerpc_response_get__pad, py_dcerpc_response_set__pad },
1883         { discard_const_p(char, "stub_and_verifier"), py_dcerpc_response_get_stub_and_verifier, py_dcerpc_response_set_stub_and_verifier },
1884         { NULL }
1885 };
1886
1887 static PyObject *py_dcerpc_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1888 {
1889         return pytalloc_new(struct dcerpc_response, type);
1890 }
1891
1892
1893 static PyTypeObject dcerpc_response_Type = {
1894         PyObject_HEAD_INIT(NULL) 0,
1895         .tp_name = "dcerpc.response",
1896         .tp_getset = py_dcerpc_response_getsetters,
1897         .tp_methods = NULL,
1898         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1899         .tp_basicsize = sizeof(pytalloc_Object),
1900         .tp_new = py_dcerpc_response_new,
1901 };
1902
1903
1904 static PyObject *py_dcerpc_fault_get_alloc_hint(PyObject *obj, void *closure)
1905 {
1906         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(obj);
1907         PyObject *py_alloc_hint;
1908         py_alloc_hint = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->alloc_hint);
1909         return py_alloc_hint;
1910 }
1911
1912 static int py_dcerpc_fault_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
1913 {
1914         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
1915         {
1916                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_hint));
1917                 if (PyLong_Check(value)) {
1918                         unsigned long long test_var;
1919                         test_var = PyLong_AsUnsignedLongLong(value);
1920                         if (PyErr_Occurred() != NULL) {
1921                                 return -1;
1922                         }
1923                         if (test_var > uint_max) {
1924                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1925                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1926                                 return -1;
1927                         }
1928                         object->alloc_hint = test_var;
1929                 } else if (PyInt_Check(value)) {
1930                         long test_var;
1931                         test_var = PyInt_AsLong(value);
1932                         if (test_var < 0 || test_var > uint_max) {
1933                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1934                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1935                                 return -1;
1936                         }
1937                         object->alloc_hint = test_var;
1938                 } else {
1939                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1940                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1941                         return -1;
1942                 }
1943         }
1944         return 0;
1945 }
1946
1947 static PyObject *py_dcerpc_fault_get_context_id(PyObject *obj, void *closure)
1948 {
1949         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(obj);
1950         PyObject *py_context_id;
1951         py_context_id = PyInt_FromLong((uint16_t)object->context_id);
1952         return py_context_id;
1953 }
1954
1955 static int py_dcerpc_fault_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
1956 {
1957         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
1958         {
1959                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
1960                 if (PyLong_Check(value)) {
1961                         unsigned long long test_var;
1962                         test_var = PyLong_AsUnsignedLongLong(value);
1963                         if (PyErr_Occurred() != NULL) {
1964                                 return -1;
1965                         }
1966                         if (test_var > uint_max) {
1967                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1968                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1969                                 return -1;
1970                         }
1971                         object->context_id = test_var;
1972                 } else if (PyInt_Check(value)) {
1973                         long test_var;
1974                         test_var = PyInt_AsLong(value);
1975                         if (test_var < 0 || test_var > uint_max) {
1976                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1977                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1978                                 return -1;
1979                         }
1980                         object->context_id = test_var;
1981                 } else {
1982                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1983                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1984                         return -1;
1985                 }
1986         }
1987         return 0;
1988 }
1989
1990 static PyObject *py_dcerpc_fault_get_cancel_count(PyObject *obj, void *closure)
1991 {
1992         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(obj);
1993         PyObject *py_cancel_count;
1994         py_cancel_count = PyInt_FromLong((uint16_t)object->cancel_count);
1995         return py_cancel_count;
1996 }
1997
1998 static int py_dcerpc_fault_set_cancel_count(PyObject *py_obj, PyObject *value, void *closure)
1999 {
2000         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
2001         {
2002                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cancel_count));
2003                 if (PyLong_Check(value)) {
2004                         unsigned long long test_var;
2005                         test_var = PyLong_AsUnsignedLongLong(value);
2006                         if (PyErr_Occurred() != NULL) {
2007                                 return -1;
2008                         }
2009                         if (test_var > uint_max) {
2010                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2011                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2012                                 return -1;
2013                         }
2014                         object->cancel_count = test_var;
2015                 } else if (PyInt_Check(value)) {
2016                         long test_var;
2017                         test_var = PyInt_AsLong(value);
2018                         if (test_var < 0 || test_var > uint_max) {
2019                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2020                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2021                                 return -1;
2022                         }
2023                         object->cancel_count = test_var;
2024                 } else {
2025                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2026                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2027                         return -1;
2028                 }
2029         }
2030         return 0;
2031 }
2032
2033 static PyObject *py_dcerpc_fault_get_status(PyObject *obj, void *closure)
2034 {
2035         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(obj);
2036         PyObject *py_status;
2037         py_status = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->status);
2038         return py_status;
2039 }
2040
2041 static int py_dcerpc_fault_set_status(PyObject *py_obj, PyObject *value, void *closure)
2042 {
2043         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
2044         {
2045                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
2046                 if (PyLong_Check(value)) {
2047                         unsigned long long test_var;
2048                         test_var = PyLong_AsUnsignedLongLong(value);
2049                         if (PyErr_Occurred() != NULL) {
2050                                 return -1;
2051                         }
2052                         if (test_var > uint_max) {
2053                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2054                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2055                                 return -1;
2056                         }
2057                         object->status = test_var;
2058                 } else if (PyInt_Check(value)) {
2059                         long test_var;
2060                         test_var = PyInt_AsLong(value);
2061                         if (test_var < 0 || test_var > uint_max) {
2062                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2063                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2064                                 return -1;
2065                         }
2066                         object->status = test_var;
2067                 } else {
2068                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2069                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2070                         return -1;
2071                 }
2072         }
2073         return 0;
2074 }
2075
2076 static PyObject *py_dcerpc_fault_get__pad(PyObject *obj, void *closure)
2077 {
2078         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(obj);
2079         PyObject *py__pad;
2080         py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
2081         return py__pad;
2082 }
2083
2084 static int py_dcerpc_fault_set__pad(PyObject *py_obj, PyObject *value, void *closure)
2085 {
2086         struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
2087         object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
2088         return 0;
2089 }
2090
2091 static PyGetSetDef py_dcerpc_fault_getsetters[] = {
2092         { discard_const_p(char, "alloc_hint"), py_dcerpc_fault_get_alloc_hint, py_dcerpc_fault_set_alloc_hint },
2093         { discard_const_p(char, "context_id"), py_dcerpc_fault_get_context_id, py_dcerpc_fault_set_context_id },
2094         { discard_const_p(char, "cancel_count"), py_dcerpc_fault_get_cancel_count, py_dcerpc_fault_set_cancel_count },
2095         { discard_const_p(char, "status"), py_dcerpc_fault_get_status, py_dcerpc_fault_set_status },
2096         { discard_const_p(char, "_pad"), py_dcerpc_fault_get__pad, py_dcerpc_fault_set__pad },
2097         { NULL }
2098 };
2099
2100 static PyObject *py_dcerpc_fault_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2101 {
2102         return pytalloc_new(struct dcerpc_fault, type);
2103 }
2104
2105
2106 static PyTypeObject dcerpc_fault_Type = {
2107         PyObject_HEAD_INIT(NULL) 0,
2108         .tp_name = "dcerpc.fault",
2109         .tp_getset = py_dcerpc_fault_getsetters,
2110         .tp_methods = NULL,
2111         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2112         .tp_basicsize = sizeof(pytalloc_Object),
2113         .tp_new = py_dcerpc_fault_new,
2114 };
2115
2116
2117 static PyObject *py_dcerpc_auth_get_auth_type(PyObject *obj, void *closure)
2118 {
2119         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(obj);
2120         PyObject *py_auth_type;
2121         py_auth_type = PyInt_FromLong((uint16_t)object->auth_type);
2122         return py_auth_type;
2123 }
2124
2125 static int py_dcerpc_auth_set_auth_type(PyObject *py_obj, PyObject *value, void *closure)
2126 {
2127         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2128         {
2129                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_type));
2130                 if (PyLong_Check(value)) {
2131                         unsigned long long test_var;
2132                         test_var = PyLong_AsUnsignedLongLong(value);
2133                         if (PyErr_Occurred() != NULL) {
2134                                 return -1;
2135                         }
2136                         if (test_var > uint_max) {
2137                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2138                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2139                                 return -1;
2140                         }
2141                         object->auth_type = test_var;
2142                 } else if (PyInt_Check(value)) {
2143                         long test_var;
2144                         test_var = PyInt_AsLong(value);
2145                         if (test_var < 0 || test_var > uint_max) {
2146                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2147                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2148                                 return -1;
2149                         }
2150                         object->auth_type = test_var;
2151                 } else {
2152                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2153                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2154                         return -1;
2155                 }
2156         }
2157         return 0;
2158 }
2159
2160 static PyObject *py_dcerpc_auth_get_auth_level(PyObject *obj, void *closure)
2161 {
2162         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(obj);
2163         PyObject *py_auth_level;
2164         py_auth_level = PyInt_FromLong((uint16_t)object->auth_level);
2165         return py_auth_level;
2166 }
2167
2168 static int py_dcerpc_auth_set_auth_level(PyObject *py_obj, PyObject *value, void *closure)
2169 {
2170         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2171         {
2172                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_level));
2173                 if (PyLong_Check(value)) {
2174                         unsigned long long test_var;
2175                         test_var = PyLong_AsUnsignedLongLong(value);
2176                         if (PyErr_Occurred() != NULL) {
2177                                 return -1;
2178                         }
2179                         if (test_var > uint_max) {
2180                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2181                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2182                                 return -1;
2183                         }
2184                         object->auth_level = test_var;
2185                 } else if (PyInt_Check(value)) {
2186                         long test_var;
2187                         test_var = PyInt_AsLong(value);
2188                         if (test_var < 0 || test_var > uint_max) {
2189                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2190                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2191                                 return -1;
2192                         }
2193                         object->auth_level = test_var;
2194                 } else {
2195                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2196                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2197                         return -1;
2198                 }
2199         }
2200         return 0;
2201 }
2202
2203 static PyObject *py_dcerpc_auth_get_auth_pad_length(PyObject *obj, void *closure)
2204 {
2205         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(obj);
2206         PyObject *py_auth_pad_length;
2207         py_auth_pad_length = PyInt_FromLong((uint16_t)object->auth_pad_length);
2208         return py_auth_pad_length;
2209 }
2210
2211 static int py_dcerpc_auth_set_auth_pad_length(PyObject *py_obj, PyObject *value, void *closure)
2212 {
2213         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2214         {
2215                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_pad_length));
2216                 if (PyLong_Check(value)) {
2217                         unsigned long long test_var;
2218                         test_var = PyLong_AsUnsignedLongLong(value);
2219                         if (PyErr_Occurred() != NULL) {
2220                                 return -1;
2221                         }
2222                         if (test_var > uint_max) {
2223                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2224                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2225                                 return -1;
2226                         }
2227                         object->auth_pad_length = test_var;
2228                 } else if (PyInt_Check(value)) {
2229                         long test_var;
2230                         test_var = PyInt_AsLong(value);
2231                         if (test_var < 0 || test_var > uint_max) {
2232                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2233                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2234                                 return -1;
2235                         }
2236                         object->auth_pad_length = test_var;
2237                 } else {
2238                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2239                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2240                         return -1;
2241                 }
2242         }
2243         return 0;
2244 }
2245
2246 static PyObject *py_dcerpc_auth_get_auth_reserved(PyObject *obj, void *closure)
2247 {
2248         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(obj);
2249         PyObject *py_auth_reserved;
2250         py_auth_reserved = PyInt_FromLong((uint16_t)object->auth_reserved);
2251         return py_auth_reserved;
2252 }
2253
2254 static int py_dcerpc_auth_set_auth_reserved(PyObject *py_obj, PyObject *value, void *closure)
2255 {
2256         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2257         {
2258                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_reserved));
2259                 if (PyLong_Check(value)) {
2260                         unsigned long long test_var;
2261                         test_var = PyLong_AsUnsignedLongLong(value);
2262                         if (PyErr_Occurred() != NULL) {
2263                                 return -1;
2264                         }
2265                         if (test_var > uint_max) {
2266                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2267                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2268                                 return -1;
2269                         }
2270                         object->auth_reserved = test_var;
2271                 } else if (PyInt_Check(value)) {
2272                         long test_var;
2273                         test_var = PyInt_AsLong(value);
2274                         if (test_var < 0 || test_var > uint_max) {
2275                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2276                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2277                                 return -1;
2278                         }
2279                         object->auth_reserved = test_var;
2280                 } else {
2281                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2282                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2283                         return -1;
2284                 }
2285         }
2286         return 0;
2287 }
2288
2289 static PyObject *py_dcerpc_auth_get_auth_context_id(PyObject *obj, void *closure)
2290 {
2291         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(obj);
2292         PyObject *py_auth_context_id;
2293         py_auth_context_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->auth_context_id);
2294         return py_auth_context_id;
2295 }
2296
2297 static int py_dcerpc_auth_set_auth_context_id(PyObject *py_obj, PyObject *value, void *closure)
2298 {
2299         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2300         {
2301                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_context_id));
2302                 if (PyLong_Check(value)) {
2303                         unsigned long long test_var;
2304                         test_var = PyLong_AsUnsignedLongLong(value);
2305                         if (PyErr_Occurred() != NULL) {
2306                                 return -1;
2307                         }
2308                         if (test_var > uint_max) {
2309                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2310                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2311                                 return -1;
2312                         }
2313                         object->auth_context_id = test_var;
2314                 } else if (PyInt_Check(value)) {
2315                         long test_var;
2316                         test_var = PyInt_AsLong(value);
2317                         if (test_var < 0 || test_var > uint_max) {
2318                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2319                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2320                                 return -1;
2321                         }
2322                         object->auth_context_id = test_var;
2323                 } else {
2324                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2325                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2326                         return -1;
2327                 }
2328         }
2329         return 0;
2330 }
2331
2332 static PyObject *py_dcerpc_auth_get_credentials(PyObject *obj, void *closure)
2333 {
2334         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(obj);
2335         PyObject *py_credentials;
2336         py_credentials = PyString_FromStringAndSize((char *)(object->credentials).data, (object->credentials).length);
2337         return py_credentials;
2338 }
2339
2340 static int py_dcerpc_auth_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
2341 {
2342         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2343         object->credentials = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
2344         return 0;
2345 }
2346
2347 static PyGetSetDef py_dcerpc_auth_getsetters[] = {
2348         { discard_const_p(char, "auth_type"), py_dcerpc_auth_get_auth_type, py_dcerpc_auth_set_auth_type },
2349         { discard_const_p(char, "auth_level"), py_dcerpc_auth_get_auth_level, py_dcerpc_auth_set_auth_level },
2350         { discard_const_p(char, "auth_pad_length"), py_dcerpc_auth_get_auth_pad_length, py_dcerpc_auth_set_auth_pad_length },
2351         { discard_const_p(char, "auth_reserved"), py_dcerpc_auth_get_auth_reserved, py_dcerpc_auth_set_auth_reserved },
2352         { discard_const_p(char, "auth_context_id"), py_dcerpc_auth_get_auth_context_id, py_dcerpc_auth_set_auth_context_id },
2353         { discard_const_p(char, "credentials"), py_dcerpc_auth_get_credentials, py_dcerpc_auth_set_credentials },
2354         { NULL }
2355 };
2356
2357 static PyObject *py_dcerpc_auth_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2358 {
2359         return pytalloc_new(struct dcerpc_auth, type);
2360 }
2361
2362 static PyObject *py_dcerpc_auth_ndr_pack(PyObject *py_obj)
2363 {
2364         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2365         DATA_BLOB blob;
2366         enum ndr_err_code err;
2367         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_auth);
2368         if (err != NDR_ERR_SUCCESS) {
2369                 PyErr_SetNdrError(err);
2370                 return NULL;
2371         }
2372
2373         return PyString_FromStringAndSize((char *)blob.data, blob.length);
2374 }
2375
2376 static PyObject *py_dcerpc_auth_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2377 {
2378         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2379         DATA_BLOB blob;
2380         int blob_length = 0;
2381         enum ndr_err_code err;
2382         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2383         PyObject *allow_remaining_obj = NULL;
2384         bool allow_remaining = false;
2385
2386         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
2387                 discard_const_p(char *, kwnames),
2388                 &blob.data, &blob_length,
2389                 &allow_remaining_obj)) {
2390                 return NULL;
2391         }
2392         blob.length = blob_length;
2393
2394         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2395                 allow_remaining = true;
2396         }
2397
2398         if (allow_remaining) {
2399                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth);
2400         } else {
2401                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth);
2402         }
2403         if (err != NDR_ERR_SUCCESS) {
2404                 PyErr_SetNdrError(err);
2405                 return NULL;
2406         }
2407
2408         Py_RETURN_NONE;
2409 }
2410
2411 static PyObject *py_dcerpc_auth_ndr_print(PyObject *py_obj)
2412 {
2413         struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
2414         PyObject *ret;
2415         char *retstr;
2416
2417         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_auth, "dcerpc_auth", object);
2418         ret = PyString_FromString(retstr);
2419         talloc_free(retstr);
2420
2421         return ret;
2422 }
2423
2424 static PyMethodDef py_dcerpc_auth_methods[] = {
2425         { "__ndr_pack__", (PyCFunction)py_dcerpc_auth_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2426         { "__ndr_unpack__", (PyCFunction)py_dcerpc_auth_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2427         { "__ndr_print__", (PyCFunction)py_dcerpc_auth_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
2428         { NULL, NULL, 0, NULL }
2429 };
2430
2431
2432 static PyTypeObject dcerpc_auth_Type = {
2433         PyObject_HEAD_INIT(NULL) 0,
2434         .tp_name = "dcerpc.auth",
2435         .tp_getset = py_dcerpc_auth_getsetters,
2436         .tp_methods = py_dcerpc_auth_methods,
2437         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2438         .tp_basicsize = sizeof(pytalloc_Object),
2439         .tp_new = py_dcerpc_auth_new,
2440 };
2441
2442
2443 static PyObject *py_dcerpc_auth3_get__pad(PyObject *obj, void *closure)
2444 {
2445         struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(obj);
2446         PyObject *py__pad;
2447         py__pad = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
2448         return py__pad;
2449 }
2450
2451 static int py_dcerpc_auth3_set__pad(PyObject *py_obj, PyObject *value, void *closure)
2452 {
2453         struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
2454         {
2455                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad));
2456                 if (PyLong_Check(value)) {
2457                         unsigned long long test_var;
2458                         test_var = PyLong_AsUnsignedLongLong(value);
2459                         if (PyErr_Occurred() != NULL) {
2460                                 return -1;
2461                         }
2462                         if (test_var > uint_max) {
2463                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2464                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2465                                 return -1;
2466                         }
2467                         object->_pad = test_var;
2468                 } else if (PyInt_Check(value)) {
2469                         long test_var;
2470                         test_var = PyInt_AsLong(value);
2471                         if (test_var < 0 || test_var > uint_max) {
2472                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2473                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2474                                 return -1;
2475                         }
2476                         object->_pad = test_var;
2477                 } else {
2478                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2479                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2480                         return -1;
2481                 }
2482         }
2483         return 0;
2484 }
2485
2486 static PyObject *py_dcerpc_auth3_get_auth_info(PyObject *obj, void *closure)
2487 {
2488         struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(obj);
2489         PyObject *py_auth_info;
2490         py_auth_info = PyString_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
2491         return py_auth_info;
2492 }
2493
2494 static int py_dcerpc_auth3_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
2495 {
2496         struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
2497         object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
2498         return 0;
2499 }
2500
2501 static PyGetSetDef py_dcerpc_auth3_getsetters[] = {
2502         { discard_const_p(char, "_pad"), py_dcerpc_auth3_get__pad, py_dcerpc_auth3_set__pad },
2503         { discard_const_p(char, "auth_info"), py_dcerpc_auth3_get_auth_info, py_dcerpc_auth3_set_auth_info },
2504         { NULL }
2505 };
2506
2507 static PyObject *py_dcerpc_auth3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2508 {
2509         return pytalloc_new(struct dcerpc_auth3, type);
2510 }
2511
2512 static PyObject *py_dcerpc_auth3_ndr_pack(PyObject *py_obj)
2513 {
2514         struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
2515         DATA_BLOB blob;
2516         enum ndr_err_code err;
2517         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_auth3);
2518         if (err != NDR_ERR_SUCCESS) {
2519                 PyErr_SetNdrError(err);
2520                 return NULL;
2521         }
2522
2523         return PyString_FromStringAndSize((char *)blob.data, blob.length);
2524 }
2525
2526 static PyObject *py_dcerpc_auth3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2527 {
2528         struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
2529         DATA_BLOB blob;
2530         int blob_length = 0;
2531         enum ndr_err_code err;
2532         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2533         PyObject *allow_remaining_obj = NULL;
2534         bool allow_remaining = false;
2535
2536         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
2537                 discard_const_p(char *, kwnames),
2538                 &blob.data, &blob_length,
2539                 &allow_remaining_obj)) {
2540                 return NULL;
2541         }
2542         blob.length = blob_length;
2543
2544         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2545                 allow_remaining = true;
2546         }
2547
2548         if (allow_remaining) {
2549                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth3);
2550         } else {
2551                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth3);
2552         }
2553         if (err != NDR_ERR_SUCCESS) {
2554                 PyErr_SetNdrError(err);
2555                 return NULL;
2556         }
2557
2558         Py_RETURN_NONE;
2559 }
2560
2561 static PyObject *py_dcerpc_auth3_ndr_print(PyObject *py_obj)
2562 {
2563         struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
2564         PyObject *ret;
2565         char *retstr;
2566
2567         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_auth3, "dcerpc_auth3", object);
2568         ret = PyString_FromString(retstr);
2569         talloc_free(retstr);
2570
2571         return ret;
2572 }
2573
2574 static PyMethodDef py_dcerpc_auth3_methods[] = {
2575         { "__ndr_pack__", (PyCFunction)py_dcerpc_auth3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2576         { "__ndr_unpack__", (PyCFunction)py_dcerpc_auth3_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2577         { "__ndr_print__", (PyCFunction)py_dcerpc_auth3_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
2578         { NULL, NULL, 0, NULL }
2579 };
2580
2581
2582 static PyTypeObject dcerpc_auth3_Type = {
2583         PyObject_HEAD_INIT(NULL) 0,
2584         .tp_name = "dcerpc.auth3",
2585         .tp_getset = py_dcerpc_auth3_getsetters,
2586         .tp_methods = py_dcerpc_auth3_methods,
2587         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2588         .tp_basicsize = sizeof(pytalloc_Object),
2589         .tp_new = py_dcerpc_auth3_new,
2590 };
2591
2592
2593 static PyObject *py_dcerpc_orphaned_get__pad(PyObject *obj, void *closure)
2594 {
2595         struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(obj);
2596         PyObject *py__pad;
2597         py__pad = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
2598         return py__pad;
2599 }
2600
2601 static int py_dcerpc_orphaned_set__pad(PyObject *py_obj, PyObject *value, void *closure)
2602 {
2603         struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
2604         {
2605                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad));
2606                 if (PyLong_Check(value)) {
2607                         unsigned long long test_var;
2608                         test_var = PyLong_AsUnsignedLongLong(value);
2609                         if (PyErr_Occurred() != NULL) {
2610                                 return -1;
2611                         }
2612                         if (test_var > uint_max) {
2613                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2614                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2615                                 return -1;
2616                         }
2617                         object->_pad = test_var;
2618                 } else if (PyInt_Check(value)) {
2619                         long test_var;
2620                         test_var = PyInt_AsLong(value);
2621                         if (test_var < 0 || test_var > uint_max) {
2622                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2623                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2624                                 return -1;
2625                         }
2626                         object->_pad = test_var;
2627                 } else {
2628                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2629                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2630                         return -1;
2631                 }
2632         }
2633         return 0;
2634 }
2635
2636 static PyObject *py_dcerpc_orphaned_get_auth_info(PyObject *obj, void *closure)
2637 {
2638         struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(obj);
2639         PyObject *py_auth_info;
2640         py_auth_info = PyString_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
2641         return py_auth_info;
2642 }
2643
2644 static int py_dcerpc_orphaned_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
2645 {
2646         struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
2647         object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
2648         return 0;
2649 }
2650
2651 static PyGetSetDef py_dcerpc_orphaned_getsetters[] = {
2652         { discard_const_p(char, "_pad"), py_dcerpc_orphaned_get__pad, py_dcerpc_orphaned_set__pad },
2653         { discard_const_p(char, "auth_info"), py_dcerpc_orphaned_get_auth_info, py_dcerpc_orphaned_set_auth_info },
2654         { NULL }
2655 };
2656
2657 static PyObject *py_dcerpc_orphaned_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2658 {
2659         return pytalloc_new(struct dcerpc_orphaned, type);
2660 }
2661
2662 static PyObject *py_dcerpc_orphaned_ndr_pack(PyObject *py_obj)
2663 {
2664         struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
2665         DATA_BLOB blob;
2666         enum ndr_err_code err;
2667         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_orphaned);
2668         if (err != NDR_ERR_SUCCESS) {
2669                 PyErr_SetNdrError(err);
2670                 return NULL;
2671         }
2672
2673         return PyString_FromStringAndSize((char *)blob.data, blob.length);
2674 }
2675
2676 static PyObject *py_dcerpc_orphaned_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2677 {
2678         struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
2679         DATA_BLOB blob;
2680         int blob_length = 0;
2681         enum ndr_err_code err;
2682         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2683         PyObject *allow_remaining_obj = NULL;
2684         bool allow_remaining = false;
2685
2686         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
2687                 discard_const_p(char *, kwnames),
2688                 &blob.data, &blob_length,
2689                 &allow_remaining_obj)) {
2690                 return NULL;
2691         }
2692         blob.length = blob_length;
2693
2694         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2695                 allow_remaining = true;
2696         }
2697
2698         if (allow_remaining) {
2699                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_orphaned);
2700         } else {
2701                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_orphaned);
2702         }
2703         if (err != NDR_ERR_SUCCESS) {
2704                 PyErr_SetNdrError(err);
2705                 return NULL;
2706         }
2707
2708         Py_RETURN_NONE;
2709 }
2710
2711 static PyObject *py_dcerpc_orphaned_ndr_print(PyObject *py_obj)
2712 {
2713         struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
2714         PyObject *ret;
2715         char *retstr;
2716
2717         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_orphaned, "dcerpc_orphaned", object);
2718         ret = PyString_FromString(retstr);
2719         talloc_free(retstr);
2720
2721         return ret;
2722 }
2723
2724 static PyMethodDef py_dcerpc_orphaned_methods[] = {
2725         { "__ndr_pack__", (PyCFunction)py_dcerpc_orphaned_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2726         { "__ndr_unpack__", (PyCFunction)py_dcerpc_orphaned_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2727         { "__ndr_print__", (PyCFunction)py_dcerpc_orphaned_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
2728         { NULL, NULL, 0, NULL }
2729 };
2730
2731
2732 static PyTypeObject dcerpc_orphaned_Type = {
2733         PyObject_HEAD_INIT(NULL) 0,
2734         .tp_name = "dcerpc.orphaned",
2735         .tp_getset = py_dcerpc_orphaned_getsetters,
2736         .tp_methods = py_dcerpc_orphaned_methods,
2737         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2738         .tp_basicsize = sizeof(pytalloc_Object),
2739         .tp_new = py_dcerpc_orphaned_new,
2740 };
2741
2742
2743 static PyObject *py_dcerpc_co_cancel_get__pad(PyObject *obj, void *closure)
2744 {
2745         struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(obj);
2746         PyObject *py__pad;
2747         py__pad = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
2748         return py__pad;
2749 }
2750
2751 static int py_dcerpc_co_cancel_set__pad(PyObject *py_obj, PyObject *value, void *closure)
2752 {
2753         struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
2754         {
2755                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad));
2756                 if (PyLong_Check(value)) {
2757                         unsigned long long test_var;
2758                         test_var = PyLong_AsUnsignedLongLong(value);
2759                         if (PyErr_Occurred() != NULL) {
2760                                 return -1;
2761                         }
2762                         if (test_var > uint_max) {
2763                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2764                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2765                                 return -1;
2766                         }
2767                         object->_pad = test_var;
2768                 } else if (PyInt_Check(value)) {
2769                         long test_var;
2770                         test_var = PyInt_AsLong(value);
2771                         if (test_var < 0 || test_var > uint_max) {
2772                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2773                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2774                                 return -1;
2775                         }
2776                         object->_pad = test_var;
2777                 } else {
2778                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2779                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2780                         return -1;
2781                 }
2782         }
2783         return 0;
2784 }
2785
2786 static PyObject *py_dcerpc_co_cancel_get_auth_info(PyObject *obj, void *closure)
2787 {
2788         struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(obj);
2789         PyObject *py_auth_info;
2790         py_auth_info = PyString_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
2791         return py_auth_info;
2792 }
2793
2794 static int py_dcerpc_co_cancel_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
2795 {
2796         struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
2797         object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
2798         return 0;
2799 }
2800
2801 static PyGetSetDef py_dcerpc_co_cancel_getsetters[] = {
2802         { discard_const_p(char, "_pad"), py_dcerpc_co_cancel_get__pad, py_dcerpc_co_cancel_set__pad },
2803         { discard_const_p(char, "auth_info"), py_dcerpc_co_cancel_get_auth_info, py_dcerpc_co_cancel_set_auth_info },
2804         { NULL }
2805 };
2806
2807 static PyObject *py_dcerpc_co_cancel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2808 {
2809         return pytalloc_new(struct dcerpc_co_cancel, type);
2810 }
2811
2812 static PyObject *py_dcerpc_co_cancel_ndr_pack(PyObject *py_obj)
2813 {
2814         struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
2815         DATA_BLOB blob;
2816         enum ndr_err_code err;
2817         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_co_cancel);
2818         if (err != NDR_ERR_SUCCESS) {
2819                 PyErr_SetNdrError(err);
2820                 return NULL;
2821         }
2822
2823         return PyString_FromStringAndSize((char *)blob.data, blob.length);
2824 }
2825
2826 static PyObject *py_dcerpc_co_cancel_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2827 {
2828         struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
2829         DATA_BLOB blob;
2830         int blob_length = 0;
2831         enum ndr_err_code err;
2832         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2833         PyObject *allow_remaining_obj = NULL;
2834         bool allow_remaining = false;
2835
2836         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
2837                 discard_const_p(char *, kwnames),
2838                 &blob.data, &blob_length,
2839                 &allow_remaining_obj)) {
2840                 return NULL;
2841         }
2842         blob.length = blob_length;
2843
2844         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2845                 allow_remaining = true;
2846         }
2847
2848         if (allow_remaining) {
2849                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_co_cancel);
2850         } else {
2851                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_co_cancel);
2852         }
2853         if (err != NDR_ERR_SUCCESS) {
2854                 PyErr_SetNdrError(err);
2855                 return NULL;
2856         }
2857
2858         Py_RETURN_NONE;
2859 }
2860
2861 static PyObject *py_dcerpc_co_cancel_ndr_print(PyObject *py_obj)
2862 {
2863         struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
2864         PyObject *ret;
2865         char *retstr;
2866
2867         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_co_cancel, "dcerpc_co_cancel", object);
2868         ret = PyString_FromString(retstr);
2869         talloc_free(retstr);
2870
2871         return ret;
2872 }
2873
2874 static PyMethodDef py_dcerpc_co_cancel_methods[] = {
2875         { "__ndr_pack__", (PyCFunction)py_dcerpc_co_cancel_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2876         { "__ndr_unpack__", (PyCFunction)py_dcerpc_co_cancel_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2877         { "__ndr_print__", (PyCFunction)py_dcerpc_co_cancel_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
2878         { NULL, NULL, 0, NULL }
2879 };
2880
2881
2882 static PyTypeObject dcerpc_co_cancel_Type = {
2883         PyObject_HEAD_INIT(NULL) 0,
2884         .tp_name = "dcerpc.co_cancel",
2885         .tp_getset = py_dcerpc_co_cancel_getsetters,
2886         .tp_methods = py_dcerpc_co_cancel_methods,
2887         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2888         .tp_basicsize = sizeof(pytalloc_Object),
2889         .tp_new = py_dcerpc_co_cancel_new,
2890 };
2891
2892
2893 static PyObject *py_dcerpc_cl_cancel_get_version(PyObject *obj, void *closure)
2894 {
2895         struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(obj);
2896         PyObject *py_version;
2897         py_version = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version);
2898         return py_version;
2899 }
2900
2901 static int py_dcerpc_cl_cancel_set_version(PyObject *py_obj, PyObject *value, void *closure)
2902 {
2903         struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
2904         {
2905                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
2906                 if (PyLong_Check(value)) {
2907                         unsigned long long test_var;
2908                         test_var = PyLong_AsUnsignedLongLong(value);
2909                         if (PyErr_Occurred() != NULL) {
2910                                 return -1;
2911                         }
2912                         if (test_var > uint_max) {
2913                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2914                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2915                                 return -1;
2916                         }
2917                         object->version = test_var;
2918                 } else if (PyInt_Check(value)) {
2919                         long test_var;
2920                         test_var = PyInt_AsLong(value);
2921                         if (test_var < 0 || test_var > uint_max) {
2922                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2923                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2924                                 return -1;
2925                         }
2926                         object->version = test_var;
2927                 } else {
2928                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2929                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2930                         return -1;
2931                 }
2932         }
2933         return 0;
2934 }
2935
2936 static PyObject *py_dcerpc_cl_cancel_get_id(PyObject *obj, void *closure)
2937 {
2938         struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(obj);
2939         PyObject *py_id;
2940         py_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->id);
2941         return py_id;
2942 }
2943
2944 static int py_dcerpc_cl_cancel_set_id(PyObject *py_obj, PyObject *value, void *closure)
2945 {
2946         struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
2947         {
2948                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->id));
2949                 if (PyLong_Check(value)) {
2950                         unsigned long long test_var;
2951                         test_var = PyLong_AsUnsignedLongLong(value);
2952                         if (PyErr_Occurred() != NULL) {
2953                                 return -1;
2954                         }
2955                         if (test_var > uint_max) {
2956                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2957                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2958                                 return -1;
2959                         }
2960                         object->id = test_var;
2961                 } else if (PyInt_Check(value)) {
2962                         long test_var;
2963                         test_var = PyInt_AsLong(value);
2964                         if (test_var < 0 || test_var > uint_max) {
2965                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2966                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2967                                 return -1;
2968                         }
2969                         object->id = test_var;
2970                 } else {
2971                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2972                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2973                         return -1;
2974                 }
2975         }
2976         return 0;
2977 }
2978
2979 static PyGetSetDef py_dcerpc_cl_cancel_getsetters[] = {
2980         { discard_const_p(char, "version"), py_dcerpc_cl_cancel_get_version, py_dcerpc_cl_cancel_set_version },
2981         { discard_const_p(char, "id"), py_dcerpc_cl_cancel_get_id, py_dcerpc_cl_cancel_set_id },
2982         { NULL }
2983 };
2984
2985 static PyObject *py_dcerpc_cl_cancel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2986 {
2987         return pytalloc_new(struct dcerpc_cl_cancel, type);
2988 }
2989
2990 static PyObject *py_dcerpc_cl_cancel_ndr_pack(PyObject *py_obj)
2991 {
2992         struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
2993         DATA_BLOB blob;
2994         enum ndr_err_code err;
2995         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_cl_cancel);
2996         if (err != NDR_ERR_SUCCESS) {
2997                 PyErr_SetNdrError(err);
2998                 return NULL;
2999         }
3000
3001         return PyString_FromStringAndSize((char *)blob.data, blob.length);
3002 }
3003
3004 static PyObject *py_dcerpc_cl_cancel_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3005 {
3006         struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
3007         DATA_BLOB blob;
3008         int blob_length = 0;
3009         enum ndr_err_code err;
3010         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3011         PyObject *allow_remaining_obj = NULL;
3012         bool allow_remaining = false;
3013
3014         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
3015                 discard_const_p(char *, kwnames),
3016                 &blob.data, &blob_length,
3017                 &allow_remaining_obj)) {
3018                 return NULL;
3019         }
3020         blob.length = blob_length;
3021
3022         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3023                 allow_remaining = true;
3024         }
3025
3026         if (allow_remaining) {
3027                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_cl_cancel);
3028         } else {
3029                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_cl_cancel);
3030         }
3031         if (err != NDR_ERR_SUCCESS) {
3032                 PyErr_SetNdrError(err);
3033                 return NULL;
3034         }
3035
3036         Py_RETURN_NONE;
3037 }
3038
3039 static PyObject *py_dcerpc_cl_cancel_ndr_print(PyObject *py_obj)
3040 {
3041         struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
3042         PyObject *ret;
3043         char *retstr;
3044
3045         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_cl_cancel, "dcerpc_cl_cancel", object);
3046         ret = PyString_FromString(retstr);
3047         talloc_free(retstr);
3048
3049         return ret;
3050 }
3051
3052 static PyMethodDef py_dcerpc_cl_cancel_methods[] = {
3053         { "__ndr_pack__", (PyCFunction)py_dcerpc_cl_cancel_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3054         { "__ndr_unpack__", (PyCFunction)py_dcerpc_cl_cancel_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3055         { "__ndr_print__", (PyCFunction)py_dcerpc_cl_cancel_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
3056         { NULL, NULL, 0, NULL }
3057 };
3058
3059
3060 static PyTypeObject dcerpc_cl_cancel_Type = {
3061         PyObject_HEAD_INIT(NULL) 0,
3062         .tp_name = "dcerpc.cl_cancel",
3063         .tp_getset = py_dcerpc_cl_cancel_getsetters,
3064         .tp_methods = py_dcerpc_cl_cancel_methods,
3065         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3066         .tp_basicsize = sizeof(pytalloc_Object),
3067         .tp_new = py_dcerpc_cl_cancel_new,
3068 };
3069
3070
3071 static PyObject *py_dcerpc_cancel_ack_get_version(PyObject *obj, void *closure)
3072 {
3073         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(obj);
3074         PyObject *py_version;
3075         py_version = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version);
3076         return py_version;
3077 }
3078
3079 static int py_dcerpc_cancel_ack_set_version(PyObject *py_obj, PyObject *value, void *closure)
3080 {
3081         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
3082         {
3083                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
3084                 if (PyLong_Check(value)) {
3085                         unsigned long long test_var;
3086                         test_var = PyLong_AsUnsignedLongLong(value);
3087                         if (PyErr_Occurred() != NULL) {
3088                                 return -1;
3089                         }
3090                         if (test_var > uint_max) {
3091                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3092                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3093                                 return -1;
3094                         }
3095                         object->version = test_var;
3096                 } else if (PyInt_Check(value)) {
3097                         long test_var;
3098                         test_var = PyInt_AsLong(value);
3099                         if (test_var < 0 || test_var > uint_max) {
3100                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3101                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3102                                 return -1;
3103                         }
3104                         object->version = test_var;
3105                 } else {
3106                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3107                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3108                         return -1;
3109                 }
3110         }
3111         return 0;
3112 }
3113
3114 static PyObject *py_dcerpc_cancel_ack_get_id(PyObject *obj, void *closure)
3115 {
3116         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(obj);
3117         PyObject *py_id;
3118         py_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->id);
3119         return py_id;
3120 }
3121
3122 static int py_dcerpc_cancel_ack_set_id(PyObject *py_obj, PyObject *value, void *closure)
3123 {
3124         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
3125         {
3126                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->id));
3127                 if (PyLong_Check(value)) {
3128                         unsigned long long test_var;
3129                         test_var = PyLong_AsUnsignedLongLong(value);
3130                         if (PyErr_Occurred() != NULL) {
3131                                 return -1;
3132                         }
3133                         if (test_var > uint_max) {
3134                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3135                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3136                                 return -1;
3137                         }
3138                         object->id = test_var;
3139                 } else if (PyInt_Check(value)) {
3140                         long test_var;
3141                         test_var = PyInt_AsLong(value);
3142                         if (test_var < 0 || test_var > uint_max) {
3143                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3144                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3145                                 return -1;
3146                         }
3147                         object->id = test_var;
3148                 } else {
3149                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3150                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3151                         return -1;
3152                 }
3153         }
3154         return 0;
3155 }
3156
3157 static PyObject *py_dcerpc_cancel_ack_get_server_is_accepting(PyObject *obj, void *closure)
3158 {
3159         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(obj);
3160         PyObject *py_server_is_accepting;
3161         py_server_is_accepting = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->server_is_accepting);
3162         return py_server_is_accepting;
3163 }
3164
3165 static int py_dcerpc_cancel_ack_set_server_is_accepting(PyObject *py_obj, PyObject *value, void *closure)
3166 {
3167         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
3168         {
3169                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_is_accepting));
3170                 if (PyLong_Check(value)) {
3171                         unsigned long long test_var;
3172                         test_var = PyLong_AsUnsignedLongLong(value);
3173                         if (PyErr_Occurred() != NULL) {
3174                                 return -1;
3175                         }
3176                         if (test_var > uint_max) {
3177                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3178                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3179                                 return -1;
3180                         }
3181                         object->server_is_accepting = test_var;
3182                 } else if (PyInt_Check(value)) {
3183                         long test_var;
3184                         test_var = PyInt_AsLong(value);
3185                         if (test_var < 0 || test_var > uint_max) {
3186                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3187                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3188                                 return -1;
3189                         }
3190                         object->server_is_accepting = test_var;
3191                 } else {
3192                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3193                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3194                         return -1;
3195                 }
3196         }
3197         return 0;
3198 }
3199
3200 static PyGetSetDef py_dcerpc_cancel_ack_getsetters[] = {
3201         { discard_const_p(char, "version"), py_dcerpc_cancel_ack_get_version, py_dcerpc_cancel_ack_set_version },
3202         { discard_const_p(char, "id"), py_dcerpc_cancel_ack_get_id, py_dcerpc_cancel_ack_set_id },
3203         { discard_const_p(char, "server_is_accepting"), py_dcerpc_cancel_ack_get_server_is_accepting, py_dcerpc_cancel_ack_set_server_is_accepting },
3204         { NULL }
3205 };
3206
3207 static PyObject *py_dcerpc_cancel_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3208 {
3209         return pytalloc_new(struct dcerpc_cancel_ack, type);
3210 }
3211
3212 static PyObject *py_dcerpc_cancel_ack_ndr_pack(PyObject *py_obj)
3213 {
3214         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
3215         DATA_BLOB blob;
3216         enum ndr_err_code err;
3217         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_cancel_ack);
3218         if (err != NDR_ERR_SUCCESS) {
3219                 PyErr_SetNdrError(err);
3220                 return NULL;
3221         }
3222
3223         return PyString_FromStringAndSize((char *)blob.data, blob.length);
3224 }
3225
3226 static PyObject *py_dcerpc_cancel_ack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3227 {
3228         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
3229         DATA_BLOB blob;
3230         int blob_length = 0;
3231         enum ndr_err_code err;
3232         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3233         PyObject *allow_remaining_obj = NULL;
3234         bool allow_remaining = false;
3235
3236         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
3237                 discard_const_p(char *, kwnames),
3238                 &blob.data, &blob_length,
3239                 &allow_remaining_obj)) {
3240                 return NULL;
3241         }
3242         blob.length = blob_length;
3243
3244         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3245                 allow_remaining = true;
3246         }
3247
3248         if (allow_remaining) {
3249                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_cancel_ack);
3250         } else {
3251                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_cancel_ack);
3252         }
3253         if (err != NDR_ERR_SUCCESS) {
3254                 PyErr_SetNdrError(err);
3255                 return NULL;
3256         }
3257
3258         Py_RETURN_NONE;
3259 }
3260
3261 static PyObject *py_dcerpc_cancel_ack_ndr_print(PyObject *py_obj)
3262 {
3263         struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
3264         PyObject *ret;
3265         char *retstr;
3266
3267         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_cancel_ack, "dcerpc_cancel_ack", object);
3268         ret = PyString_FromString(retstr);
3269         talloc_free(retstr);
3270
3271         return ret;
3272 }
3273
3274 static PyMethodDef py_dcerpc_cancel_ack_methods[] = {
3275         { "__ndr_pack__", (PyCFunction)py_dcerpc_cancel_ack_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3276         { "__ndr_unpack__", (PyCFunction)py_dcerpc_cancel_ack_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3277         { "__ndr_print__", (PyCFunction)py_dcerpc_cancel_ack_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
3278         { NULL, NULL, 0, NULL }
3279 };
3280
3281
3282 static PyTypeObject dcerpc_cancel_ack_Type = {
3283         PyObject_HEAD_INIT(NULL) 0,
3284         .tp_name = "dcerpc.cancel_ack",
3285         .tp_getset = py_dcerpc_cancel_ack_getsetters,
3286         .tp_methods = py_dcerpc_cancel_ack_methods,
3287         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3288         .tp_basicsize = sizeof(pytalloc_Object),
3289         .tp_new = py_dcerpc_cancel_ack_new,
3290 };
3291
3292
3293 static PyObject *py_dcerpc_fack_get_version(PyObject *obj, void *closure)
3294 {
3295         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3296         PyObject *py_version;
3297         py_version = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version);
3298         return py_version;
3299 }
3300
3301 static int py_dcerpc_fack_set_version(PyObject *py_obj, PyObject *value, void *closure)
3302 {
3303         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3304         {
3305                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
3306                 if (PyLong_Check(value)) {
3307                         unsigned long long test_var;
3308                         test_var = PyLong_AsUnsignedLongLong(value);
3309                         if (PyErr_Occurred() != NULL) {
3310                                 return -1;
3311                         }
3312                         if (test_var > uint_max) {
3313                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3314                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3315                                 return -1;
3316                         }
3317                         object->version = test_var;
3318                 } else if (PyInt_Check(value)) {
3319                         long test_var;
3320                         test_var = PyInt_AsLong(value);
3321                         if (test_var < 0 || test_var > uint_max) {
3322                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3323                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3324                                 return -1;
3325                         }
3326                         object->version = test_var;
3327                 } else {
3328                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3329                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3330                         return -1;
3331                 }
3332         }
3333         return 0;
3334 }
3335
3336 static PyObject *py_dcerpc_fack_get__pad1(PyObject *obj, void *closure)
3337 {
3338         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3339         PyObject *py__pad1;
3340         py__pad1 = PyInt_FromLong((uint16_t)object->_pad1);
3341         return py__pad1;
3342 }
3343
3344 static int py_dcerpc_fack_set__pad1(PyObject *py_obj, PyObject *value, void *closure)
3345 {
3346         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3347         {
3348                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad1));
3349                 if (PyLong_Check(value)) {
3350                         unsigned long long test_var;
3351                         test_var = PyLong_AsUnsignedLongLong(value);
3352                         if (PyErr_Occurred() != NULL) {
3353                                 return -1;
3354                         }
3355                         if (test_var > uint_max) {
3356                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3357                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3358                                 return -1;
3359                         }
3360                         object->_pad1 = test_var;
3361                 } else if (PyInt_Check(value)) {
3362                         long test_var;
3363                         test_var = PyInt_AsLong(value);
3364                         if (test_var < 0 || test_var > uint_max) {
3365                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3366                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3367                                 return -1;
3368                         }
3369                         object->_pad1 = test_var;
3370                 } else {
3371                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3372                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3373                         return -1;
3374                 }
3375         }
3376         return 0;
3377 }
3378
3379 static PyObject *py_dcerpc_fack_get_window_size(PyObject *obj, void *closure)
3380 {
3381         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3382         PyObject *py_window_size;
3383         py_window_size = PyInt_FromLong((uint16_t)object->window_size);
3384         return py_window_size;
3385 }
3386
3387 static int py_dcerpc_fack_set_window_size(PyObject *py_obj, PyObject *value, void *closure)
3388 {
3389         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3390         {
3391                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->window_size));
3392                 if (PyLong_Check(value)) {
3393                         unsigned long long test_var;
3394                         test_var = PyLong_AsUnsignedLongLong(value);
3395                         if (PyErr_Occurred() != NULL) {
3396                                 return -1;
3397                         }
3398                         if (test_var > uint_max) {
3399                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3400                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3401                                 return -1;
3402                         }
3403                         object->window_size = test_var;
3404                 } else if (PyInt_Check(value)) {
3405                         long test_var;
3406                         test_var = PyInt_AsLong(value);
3407                         if (test_var < 0 || test_var > uint_max) {
3408                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3409                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3410                                 return -1;
3411                         }
3412                         object->window_size = test_var;
3413                 } else {
3414                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3415                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3416                         return -1;
3417                 }
3418         }
3419         return 0;
3420 }
3421
3422 static PyObject *py_dcerpc_fack_get_max_tdsu(PyObject *obj, void *closure)
3423 {
3424         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3425         PyObject *py_max_tdsu;
3426         py_max_tdsu = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->max_tdsu);
3427         return py_max_tdsu;
3428 }
3429
3430 static int py_dcerpc_fack_set_max_tdsu(PyObject *py_obj, PyObject *value, void *closure)
3431 {
3432         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3433         {
3434                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_tdsu));
3435                 if (PyLong_Check(value)) {
3436                         unsigned long long test_var;
3437                         test_var = PyLong_AsUnsignedLongLong(value);
3438                         if (PyErr_Occurred() != NULL) {
3439                                 return -1;
3440                         }
3441                         if (test_var > uint_max) {
3442                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3443                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3444                                 return -1;
3445                         }
3446                         object->max_tdsu = test_var;
3447                 } else if (PyInt_Check(value)) {
3448                         long test_var;
3449                         test_var = PyInt_AsLong(value);
3450                         if (test_var < 0 || test_var > uint_max) {
3451                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3452                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3453                                 return -1;
3454                         }
3455                         object->max_tdsu = test_var;
3456                 } else {
3457                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3458                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3459                         return -1;
3460                 }
3461         }
3462         return 0;
3463 }
3464
3465 static PyObject *py_dcerpc_fack_get_max_frag_size(PyObject *obj, void *closure)
3466 {
3467         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3468         PyObject *py_max_frag_size;
3469         py_max_frag_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->max_frag_size);
3470         return py_max_frag_size;
3471 }
3472
3473 static int py_dcerpc_fack_set_max_frag_size(PyObject *py_obj, PyObject *value, void *closure)
3474 {
3475         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3476         {
3477                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_frag_size));
3478                 if (PyLong_Check(value)) {
3479                         unsigned long long test_var;
3480                         test_var = PyLong_AsUnsignedLongLong(value);
3481                         if (PyErr_Occurred() != NULL) {
3482                                 return -1;
3483                         }
3484                         if (test_var > uint_max) {
3485                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3486                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3487                                 return -1;
3488                         }
3489                         object->max_frag_size = test_var;
3490                 } else if (PyInt_Check(value)) {
3491                         long test_var;
3492                         test_var = PyInt_AsLong(value);
3493                         if (test_var < 0 || test_var > uint_max) {
3494                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3495                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3496                                 return -1;
3497                         }
3498                         object->max_frag_size = test_var;
3499                 } else {
3500                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3501                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3502                         return -1;
3503                 }
3504         }
3505         return 0;
3506 }
3507
3508 static PyObject *py_dcerpc_fack_get_serial_no(PyObject *obj, void *closure)
3509 {
3510         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3511         PyObject *py_serial_no;
3512         py_serial_no = PyInt_FromLong((uint16_t)object->serial_no);
3513         return py_serial_no;
3514 }
3515
3516 static int py_dcerpc_fack_set_serial_no(PyObject *py_obj, PyObject *value, void *closure)
3517 {
3518         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3519         {
3520                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_no));
3521                 if (PyLong_Check(value)) {
3522                         unsigned long long test_var;
3523                         test_var = PyLong_AsUnsignedLongLong(value);
3524                         if (PyErr_Occurred() != NULL) {
3525                                 return -1;
3526                         }
3527                         if (test_var > uint_max) {
3528                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3529                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3530                                 return -1;
3531                         }
3532                         object->serial_no = test_var;
3533                 } else if (PyInt_Check(value)) {
3534                         long test_var;
3535                         test_var = PyInt_AsLong(value);
3536                         if (test_var < 0 || test_var > uint_max) {
3537                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3538                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3539                                 return -1;
3540                         }
3541                         object->serial_no = test_var;
3542                 } else {
3543                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3544                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3545                         return -1;
3546                 }
3547         }
3548         return 0;
3549 }
3550
3551 static PyObject *py_dcerpc_fack_get_selack_size(PyObject *obj, void *closure)
3552 {
3553         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3554         PyObject *py_selack_size;
3555         py_selack_size = PyInt_FromLong((uint16_t)object->selack_size);
3556         return py_selack_size;
3557 }
3558
3559 static int py_dcerpc_fack_set_selack_size(PyObject *py_obj, PyObject *value, void *closure)
3560 {
3561         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3562         {
3563                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->selack_size));
3564                 if (PyLong_Check(value)) {
3565                         unsigned long long test_var;
3566                         test_var = PyLong_AsUnsignedLongLong(value);
3567                         if (PyErr_Occurred() != NULL) {
3568                                 return -1;
3569                         }
3570                         if (test_var > uint_max) {
3571                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3572                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3573                                 return -1;
3574                         }
3575                         object->selack_size = test_var;
3576                 } else if (PyInt_Check(value)) {
3577                         long test_var;
3578                         test_var = PyInt_AsLong(value);
3579                         if (test_var < 0 || test_var > uint_max) {
3580                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3581                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3582                                 return -1;
3583                         }
3584                         object->selack_size = test_var;
3585                 } else {
3586                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3587                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3588                         return -1;
3589                 }
3590         }
3591         return 0;
3592 }
3593
3594 static PyObject *py_dcerpc_fack_get_selack(PyObject *obj, void *closure)
3595 {
3596         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3597         PyObject *py_selack;
3598         py_selack = PyList_New(object->selack_size);
3599         if (py_selack == NULL) {
3600                 return NULL;
3601         }
3602         {
3603                 int selack_cntr_0;
3604                 for (selack_cntr_0 = 0; selack_cntr_0 < (object->selack_size); selack_cntr_0++) {
3605                         PyObject *py_selack_0;
3606                         py_selack_0 = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->selack[selack_cntr_0]);
3607                         PyList_SetItem(py_selack, selack_cntr_0, py_selack_0);
3608                 }
3609         }
3610         return py_selack;
3611 }
3612
3613 static int py_dcerpc_fack_set_selack(PyObject *py_obj, PyObject *value, void *closure)
3614 {
3615         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3616         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3617         {
3618                 int selack_cntr_0;
3619                 object->selack = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->selack, PyList_GET_SIZE(value));
3620                 if (!object->selack) { return -1;; }
3621                 talloc_set_name_const(object->selack, "ARRAY: object->selack");
3622                 for (selack_cntr_0 = 0; selack_cntr_0 < PyList_GET_SIZE(value); selack_cntr_0++) {
3623                         {
3624                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->selack[selack_cntr_0]));
3625                                 if (PyLong_Check(PyList_GET_ITEM(value, selack_cntr_0))) {
3626                                         unsigned long long test_var;
3627                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, selack_cntr_0));
3628                                         if (PyErr_Occurred() != NULL) {
3629                                                 return -1;
3630                                         }
3631                                         if (test_var > uint_max) {
3632                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3633                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3634                                                 return -1;
3635                                         }
3636                                         object->selack[selack_cntr_0] = test_var;
3637                                 } else if (PyInt_Check(PyList_GET_ITEM(value, selack_cntr_0))) {
3638                                         long test_var;
3639                                         test_var = PyInt_AsLong(PyList_GET_ITEM(value, selack_cntr_0));
3640                                         if (test_var < 0 || test_var > uint_max) {
3641                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3642                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3643                                                 return -1;
3644                                         }
3645                                         object->selack[selack_cntr_0] = test_var;
3646                                 } else {
3647                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3648                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3649                                         return -1;
3650                                 }
3651                         }
3652                 }
3653         }
3654         return 0;
3655 }
3656
3657 static PyGetSetDef py_dcerpc_fack_getsetters[] = {
3658         { discard_const_p(char, "version"), py_dcerpc_fack_get_version, py_dcerpc_fack_set_version },
3659         { discard_const_p(char, "_pad1"), py_dcerpc_fack_get__pad1, py_dcerpc_fack_set__pad1 },
3660         { discard_const_p(char, "window_size"), py_dcerpc_fack_get_window_size, py_dcerpc_fack_set_window_size },
3661         { discard_const_p(char, "max_tdsu"), py_dcerpc_fack_get_max_tdsu, py_dcerpc_fack_set_max_tdsu },
3662         { discard_const_p(char, "max_frag_size"), py_dcerpc_fack_get_max_frag_size, py_dcerpc_fack_set_max_frag_size },
3663         { discard_const_p(char, "serial_no"), py_dcerpc_fack_get_serial_no, py_dcerpc_fack_set_serial_no },
3664         { discard_const_p(char, "selack_size"), py_dcerpc_fack_get_selack_size, py_dcerpc_fack_set_selack_size },
3665         { discard_const_p(char, "selack"), py_dcerpc_fack_get_selack, py_dcerpc_fack_set_selack },
3666         { NULL }
3667 };
3668
3669 static PyObject *py_dcerpc_fack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3670 {
3671         return pytalloc_new(struct dcerpc_fack, type);
3672 }
3673
3674 static PyObject *py_dcerpc_fack_ndr_pack(PyObject *py_obj)
3675 {
3676         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3677         DATA_BLOB blob;
3678         enum ndr_err_code err;
3679         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_fack);
3680         if (err != NDR_ERR_SUCCESS) {
3681                 PyErr_SetNdrError(err);
3682                 return NULL;
3683         }
3684
3685         return PyString_FromStringAndSize((char *)blob.data, blob.length);
3686 }
3687
3688 static PyObject *py_dcerpc_fack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3689 {
3690         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3691         DATA_BLOB blob;
3692         int blob_length = 0;
3693         enum ndr_err_code err;
3694         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3695         PyObject *allow_remaining_obj = NULL;
3696         bool allow_remaining = false;
3697
3698         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
3699                 discard_const_p(char *, kwnames),
3700                 &blob.data, &blob_length,
3701                 &allow_remaining_obj)) {
3702                 return NULL;
3703         }
3704         blob.length = blob_length;
3705
3706         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3707                 allow_remaining = true;
3708         }
3709
3710         if (allow_remaining) {
3711                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_fack);
3712         } else {
3713                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_fack);
3714         }
3715         if (err != NDR_ERR_SUCCESS) {
3716                 PyErr_SetNdrError(err);
3717                 return NULL;
3718         }
3719
3720         Py_RETURN_NONE;
3721 }
3722
3723 static PyObject *py_dcerpc_fack_ndr_print(PyObject *py_obj)
3724 {
3725         struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3726         PyObject *ret;
3727         char *retstr;
3728
3729         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_fack, "dcerpc_fack", object);
3730         ret = PyString_FromString(retstr);
3731         talloc_free(retstr);
3732
3733         return ret;
3734 }
3735
3736 static PyMethodDef py_dcerpc_fack_methods[] = {
3737         { "__ndr_pack__", (PyCFunction)py_dcerpc_fack_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3738         { "__ndr_unpack__", (PyCFunction)py_dcerpc_fack_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3739         { "__ndr_print__", (PyCFunction)py_dcerpc_fack_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
3740         { NULL, NULL, 0, NULL }
3741 };
3742
3743
3744 static PyTypeObject dcerpc_fack_Type = {
3745         PyObject_HEAD_INIT(NULL) 0,
3746         .tp_name = "dcerpc.fack",
3747         .tp_getset = py_dcerpc_fack_getsetters,
3748         .tp_methods = py_dcerpc_fack_methods,
3749         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3750         .tp_basicsize = sizeof(pytalloc_Object),
3751         .tp_new = py_dcerpc_fack_new,
3752 };
3753
3754
3755 static PyObject *py_dcerpc_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3756 {
3757         return pytalloc_new(struct dcerpc_ack, type);
3758 }
3759
3760 static PyObject *py_dcerpc_ack_ndr_pack(PyObject *py_obj)
3761 {
3762         struct dcerpc_ack *object = (struct dcerpc_ack *)pytalloc_get_ptr(py_obj);
3763         DATA_BLOB blob;
3764         enum ndr_err_code err;
3765         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_ack);
3766         if (err != NDR_ERR_SUCCESS) {
3767                 PyErr_SetNdrError(err);
3768                 return NULL;
3769         }
3770
3771         return PyString_FromStringAndSize((char *)blob.data, blob.length);
3772 }
3773
3774 static PyObject *py_dcerpc_ack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3775 {
3776         struct dcerpc_ack *object = (struct dcerpc_ack *)pytalloc_get_ptr(py_obj);
3777         DATA_BLOB blob;
3778         int blob_length = 0;
3779         enum ndr_err_code err;
3780         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3781         PyObject *allow_remaining_obj = NULL;
3782         bool allow_remaining = false;
3783
3784         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
3785                 discard_const_p(char *, kwnames),
3786                 &blob.data, &blob_length,
3787                 &allow_remaining_obj)) {
3788                 return NULL;
3789         }
3790         blob.length = blob_length;
3791
3792         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3793                 allow_remaining = true;
3794         }
3795
3796         if (allow_remaining) {
3797                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ack);
3798         } else {
3799                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ack);
3800         }
3801         if (err != NDR_ERR_SUCCESS) {
3802                 PyErr_SetNdrError(err);
3803                 return NULL;
3804         }
3805
3806         Py_RETURN_NONE;
3807 }
3808
3809 static PyObject *py_dcerpc_ack_ndr_print(PyObject *py_obj)
3810 {
3811         struct dcerpc_ack *object = (struct dcerpc_ack *)pytalloc_get_ptr(py_obj);
3812         PyObject *ret;
3813         char *retstr;
3814
3815         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_ack, "dcerpc_ack", object);
3816         ret = PyString_FromString(retstr);
3817         talloc_free(retstr);
3818
3819         return ret;
3820 }
3821
3822 static PyMethodDef py_dcerpc_ack_methods[] = {
3823         { "__ndr_pack__", (PyCFunction)py_dcerpc_ack_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3824         { "__ndr_unpack__", (PyCFunction)py_dcerpc_ack_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3825         { "__ndr_print__", (PyCFunction)py_dcerpc_ack_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
3826         { NULL, NULL, 0, NULL }
3827 };
3828
3829
3830 static PyTypeObject dcerpc_ack_Type = {
3831         PyObject_HEAD_INIT(NULL) 0,
3832         .tp_name = "dcerpc.ack",
3833         .tp_getset = NULL,
3834         .tp_methods = py_dcerpc_ack_methods,
3835         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3836         .tp_basicsize = sizeof(pytalloc_Object),
3837         .tp_new = py_dcerpc_ack_new,
3838 };
3839
3840
3841 static PyObject *py_dcerpc_ping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3842 {
3843         return pytalloc_new(struct dcerpc_ping, type);
3844 }
3845
3846 static PyObject *py_dcerpc_ping_ndr_pack(PyObject *py_obj)
3847 {
3848         struct dcerpc_ping *object = (struct dcerpc_ping *)pytalloc_get_ptr(py_obj);
3849         DATA_BLOB blob;
3850         enum ndr_err_code err;
3851         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_ping);
3852         if (err != NDR_ERR_SUCCESS) {
3853                 PyErr_SetNdrError(err);
3854                 return NULL;
3855         }
3856
3857         return PyString_FromStringAndSize((char *)blob.data, blob.length);
3858 }
3859
3860 static PyObject *py_dcerpc_ping_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3861 {
3862         struct dcerpc_ping *object = (struct dcerpc_ping *)pytalloc_get_ptr(py_obj);
3863         DATA_BLOB blob;
3864         int blob_length = 0;
3865         enum ndr_err_code err;
3866         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3867         PyObject *allow_remaining_obj = NULL;
3868         bool allow_remaining = false;
3869
3870         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
3871                 discard_const_p(char *, kwnames),
3872                 &blob.data, &blob_length,
3873                 &allow_remaining_obj)) {
3874                 return NULL;
3875         }
3876         blob.length = blob_length;
3877
3878         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3879                 allow_remaining = true;
3880         }
3881
3882         if (allow_remaining) {
3883                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ping);
3884         } else {
3885                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ping);
3886         }
3887         if (err != NDR_ERR_SUCCESS) {
3888                 PyErr_SetNdrError(err);
3889                 return NULL;
3890         }
3891
3892         Py_RETURN_NONE;
3893 }
3894
3895 static PyObject *py_dcerpc_ping_ndr_print(PyObject *py_obj)
3896 {
3897         struct dcerpc_ping *object = (struct dcerpc_ping *)pytalloc_get_ptr(py_obj);
3898         PyObject *ret;
3899         char *retstr;
3900
3901         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_ping, "dcerpc_ping", object);
3902         ret = PyString_FromString(retstr);
3903         talloc_free(retstr);
3904
3905         return ret;
3906 }
3907
3908 static PyMethodDef py_dcerpc_ping_methods[] = {
3909         { "__ndr_pack__", (PyCFunction)py_dcerpc_ping_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3910         { "__ndr_unpack__", (PyCFunction)py_dcerpc_ping_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3911         { "__ndr_print__", (PyCFunction)py_dcerpc_ping_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
3912         { NULL, NULL, 0, NULL }
3913 };
3914
3915
3916 static PyTypeObject dcerpc_ping_Type = {
3917         PyObject_HEAD_INIT(NULL) 0,
3918         .tp_name = "dcerpc.ping",
3919         .tp_getset = NULL,
3920         .tp_methods = py_dcerpc_ping_methods,
3921         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3922         .tp_basicsize = sizeof(pytalloc_Object),
3923         .tp_new = py_dcerpc_ping_new,
3924 };
3925
3926
3927 static PyObject *py_dcerpc_shutdown_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3928 {
3929         return pytalloc_new(struct dcerpc_shutdown, type);
3930 }
3931
3932 static PyObject *py_dcerpc_shutdown_ndr_pack(PyObject *py_obj)
3933 {
3934         struct dcerpc_shutdown *object = (struct dcerpc_shutdown *)pytalloc_get_ptr(py_obj);
3935         DATA_BLOB blob;
3936         enum ndr_err_code err;
3937         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_shutdown);
3938         if (err != NDR_ERR_SUCCESS) {
3939                 PyErr_SetNdrError(err);
3940                 return NULL;
3941         }
3942
3943         return PyString_FromStringAndSize((char *)blob.data, blob.length);
3944 }
3945
3946 static PyObject *py_dcerpc_shutdown_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3947 {
3948         struct dcerpc_shutdown *object = (struct dcerpc_shutdown *)pytalloc_get_ptr(py_obj);
3949         DATA_BLOB blob;
3950         int blob_length = 0;
3951         enum ndr_err_code err;
3952         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3953         PyObject *allow_remaining_obj = NULL;
3954         bool allow_remaining = false;
3955
3956         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
3957                 discard_const_p(char *, kwnames),
3958                 &blob.data, &blob_length,
3959                 &allow_remaining_obj)) {
3960                 return NULL;
3961         }
3962         blob.length = blob_length;
3963
3964         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3965                 allow_remaining = true;
3966         }
3967
3968         if (allow_remaining) {
3969                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_shutdown);
3970         } else {
3971                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_shutdown);
3972         }
3973         if (err != NDR_ERR_SUCCESS) {
3974                 PyErr_SetNdrError(err);
3975                 return NULL;
3976         }
3977
3978         Py_RETURN_NONE;
3979 }
3980
3981 static PyObject *py_dcerpc_shutdown_ndr_print(PyObject *py_obj)
3982 {
3983         struct dcerpc_shutdown *object = (struct dcerpc_shutdown *)pytalloc_get_ptr(py_obj);
3984         PyObject *ret;
3985         char *retstr;
3986
3987         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_shutdown, "dcerpc_shutdown", object);
3988         ret = PyString_FromString(retstr);
3989         talloc_free(retstr);
3990
3991         return ret;
3992 }
3993
3994 static PyMethodDef py_dcerpc_shutdown_methods[] = {
3995         { "__ndr_pack__", (PyCFunction)py_dcerpc_shutdown_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3996         { "__ndr_unpack__", (PyCFunction)py_dcerpc_shutdown_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3997         { "__ndr_print__", (PyCFunction)py_dcerpc_shutdown_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
3998         { NULL, NULL, 0, NULL }
3999 };
4000
4001
4002 static PyTypeObject dcerpc_shutdown_Type = {
4003         PyObject_HEAD_INIT(NULL) 0,
4004         .tp_name = "dcerpc.shutdown",
4005         .tp_getset = NULL,
4006         .tp_methods = py_dcerpc_shutdown_methods,
4007         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4008         .tp_basicsize = sizeof(pytalloc_Object),
4009         .tp_new = py_dcerpc_shutdown_new,
4010 };
4011
4012
4013 static PyObject *py_dcerpc_working_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4014 {
4015         return pytalloc_new(struct dcerpc_working, type);
4016 }
4017
4018 static PyObject *py_dcerpc_working_ndr_pack(PyObject *py_obj)
4019 {
4020         struct dcerpc_working *object = (struct dcerpc_working *)pytalloc_get_ptr(py_obj);
4021         DATA_BLOB blob;
4022         enum ndr_err_code err;
4023         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_working);
4024         if (err != NDR_ERR_SUCCESS) {
4025                 PyErr_SetNdrError(err);
4026                 return NULL;
4027         }
4028
4029         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4030 }
4031
4032 static PyObject *py_dcerpc_working_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4033 {
4034         struct dcerpc_working *object = (struct dcerpc_working *)pytalloc_get_ptr(py_obj);
4035         DATA_BLOB blob;
4036         int blob_length = 0;
4037         enum ndr_err_code err;
4038         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4039         PyObject *allow_remaining_obj = NULL;
4040         bool allow_remaining = false;
4041
4042         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4043                 discard_const_p(char *, kwnames),
4044                 &blob.data, &blob_length,
4045                 &allow_remaining_obj)) {
4046                 return NULL;
4047         }
4048         blob.length = blob_length;
4049
4050         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4051                 allow_remaining = true;
4052         }
4053
4054         if (allow_remaining) {
4055                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_working);
4056         } else {
4057                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_working);
4058         }
4059         if (err != NDR_ERR_SUCCESS) {
4060                 PyErr_SetNdrError(err);
4061                 return NULL;
4062         }
4063
4064         Py_RETURN_NONE;
4065 }
4066
4067 static PyObject *py_dcerpc_working_ndr_print(PyObject *py_obj)
4068 {
4069         struct dcerpc_working *object = (struct dcerpc_working *)pytalloc_get_ptr(py_obj);
4070         PyObject *ret;
4071         char *retstr;
4072
4073         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_working, "dcerpc_working", object);
4074         ret = PyString_FromString(retstr);
4075         talloc_free(retstr);
4076
4077         return ret;
4078 }
4079
4080 static PyMethodDef py_dcerpc_working_methods[] = {
4081         { "__ndr_pack__", (PyCFunction)py_dcerpc_working_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4082         { "__ndr_unpack__", (PyCFunction)py_dcerpc_working_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4083         { "__ndr_print__", (PyCFunction)py_dcerpc_working_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4084         { NULL, NULL, 0, NULL }
4085 };
4086
4087
4088 static PyTypeObject dcerpc_working_Type = {
4089         PyObject_HEAD_INIT(NULL) 0,
4090         .tp_name = "dcerpc.working",
4091         .tp_getset = NULL,
4092         .tp_methods = py_dcerpc_working_methods,
4093         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4094         .tp_basicsize = sizeof(pytalloc_Object),
4095         .tp_new = py_dcerpc_working_new,
4096 };
4097
4098
4099 static PyObject *py_RTSCookie_get_Cookie(PyObject *obj, void *closure)
4100 {
4101         struct RTSCookie *object = (struct RTSCookie *)pytalloc_get_ptr(obj);
4102         PyObject *py_Cookie;
4103         py_Cookie = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->Cookie);
4104         return py_Cookie;
4105 }
4106
4107 static int py_RTSCookie_set_Cookie(PyObject *py_obj, PyObject *value, void *closure)
4108 {
4109         struct RTSCookie *object = (struct RTSCookie *)pytalloc_get_ptr(py_obj);
4110         PY_CHECK_TYPE(GUID_Type, value, return -1;);
4111         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4112                 PyErr_NoMemory();
4113                 return -1;
4114         }
4115         object->Cookie = *(struct GUID *)pytalloc_get_ptr(value);
4116         return 0;
4117 }
4118
4119 static PyGetSetDef py_RTSCookie_getsetters[] = {
4120         { discard_const_p(char, "Cookie"), py_RTSCookie_get_Cookie, py_RTSCookie_set_Cookie },
4121         { NULL }
4122 };
4123
4124 static PyObject *py_RTSCookie_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4125 {
4126         return pytalloc_new(struct RTSCookie, type);
4127 }
4128
4129 static PyObject *py_RTSCookie_ndr_pack(PyObject *py_obj)
4130 {
4131         struct RTSCookie *object = (struct RTSCookie *)pytalloc_get_ptr(py_obj);
4132         DATA_BLOB blob;
4133         enum ndr_err_code err;
4134         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_RTSCookie);
4135         if (err != NDR_ERR_SUCCESS) {
4136                 PyErr_SetNdrError(err);
4137                 return NULL;
4138         }
4139
4140         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4141 }
4142
4143 static PyObject *py_RTSCookie_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4144 {
4145         struct RTSCookie *object = (struct RTSCookie *)pytalloc_get_ptr(py_obj);
4146         DATA_BLOB blob;
4147         int blob_length = 0;
4148         enum ndr_err_code err;
4149         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4150         PyObject *allow_remaining_obj = NULL;
4151         bool allow_remaining = false;
4152
4153         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4154                 discard_const_p(char *, kwnames),
4155                 &blob.data, &blob_length,
4156                 &allow_remaining_obj)) {
4157                 return NULL;
4158         }
4159         blob.length = blob_length;
4160
4161         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4162                 allow_remaining = true;
4163         }
4164
4165         if (allow_remaining) {
4166                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RTSCookie);
4167         } else {
4168                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RTSCookie);
4169         }
4170         if (err != NDR_ERR_SUCCESS) {
4171                 PyErr_SetNdrError(err);
4172                 return NULL;
4173         }
4174
4175         Py_RETURN_NONE;
4176 }
4177
4178 static PyObject *py_RTSCookie_ndr_print(PyObject *py_obj)
4179 {
4180         struct RTSCookie *object = (struct RTSCookie *)pytalloc_get_ptr(py_obj);
4181         PyObject *ret;
4182         char *retstr;
4183
4184         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_RTSCookie, "RTSCookie", object);
4185         ret = PyString_FromString(retstr);
4186         talloc_free(retstr);
4187
4188         return ret;
4189 }
4190
4191 static PyMethodDef py_RTSCookie_methods[] = {
4192         { "__ndr_pack__", (PyCFunction)py_RTSCookie_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4193         { "__ndr_unpack__", (PyCFunction)py_RTSCookie_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4194         { "__ndr_print__", (PyCFunction)py_RTSCookie_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4195         { NULL, NULL, 0, NULL }
4196 };
4197
4198
4199 static PyTypeObject RTSCookie_Type = {
4200         PyObject_HEAD_INIT(NULL) 0,
4201         .tp_name = "dcerpc.RTSCookie",
4202         .tp_getset = py_RTSCookie_getsetters,
4203         .tp_methods = py_RTSCookie_methods,
4204         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4205         .tp_basicsize = sizeof(pytalloc_Object),
4206         .tp_new = py_RTSCookie_new,
4207 };
4208
4209 PyObject *py_import_ClientAddressType(TALLOC_CTX *mem_ctx, int level, union ClientAddressType *in)
4210 {
4211         PyObject *ret;
4212
4213         switch (level) {
4214                 case RTS_IPV4:
4215                         ret = PyString_FromStringOrNULL(in->ClientAddressIPV4);
4216                         return ret;
4217
4218                 case RTS_IPV6:
4219                         ret = PyString_FromStringOrNULL(in->ClientAddressIPV6);
4220                         return ret;
4221
4222         }
4223         PyErr_SetString(PyExc_TypeError, "unknown union level");
4224         return NULL;
4225 }
4226
4227 union ClientAddressType *py_export_ClientAddressType(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4228 {
4229         union ClientAddressType *ret = talloc_zero(mem_ctx, union ClientAddressType);
4230         switch (level) {
4231                 case RTS_IPV4:
4232                         ret->ClientAddressIPV4 = PyString_AS_STRING(in);
4233                         break;
4234
4235                 case RTS_IPV6:
4236                         ret->ClientAddressIPV6 = PyString_AsString(in);
4237                         break;
4238
4239                 default:
4240                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
4241                         talloc_free(ret);
4242                         ret = NULL;
4243         }
4244
4245         return ret;
4246 }
4247
4248
4249 static PyObject *py_ClientAddress_get_AddressType(PyObject *obj, void *closure)
4250 {
4251         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(obj);
4252         PyObject *py_AddressType;
4253         py_AddressType = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->AddressType);
4254         return py_AddressType;
4255 }
4256
4257 static int py_ClientAddress_set_AddressType(PyObject *py_obj, PyObject *value, void *closure)
4258 {
4259         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
4260         {
4261                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AddressType));
4262                 if (PyLong_Check(value)) {
4263                         unsigned long long test_var;
4264                         test_var = PyLong_AsUnsignedLongLong(value);
4265                         if (PyErr_Occurred() != NULL) {
4266                                 return -1;
4267                         }
4268                         if (test_var > uint_max) {
4269                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4270                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4271                                 return -1;
4272                         }
4273                         object->AddressType = test_var;
4274                 } else if (PyInt_Check(value)) {
4275                         long test_var;
4276                         test_var = PyInt_AsLong(value);
4277                         if (test_var < 0 || test_var > uint_max) {
4278                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4279                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4280                                 return -1;
4281                         }
4282                         object->AddressType = test_var;
4283                 } else {
4284                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4285                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4286                         return -1;
4287                 }
4288         }
4289         return 0;
4290 }
4291
4292 static PyObject *py_ClientAddress_get_ClientAddress(PyObject *obj, void *closure)
4293 {
4294         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(obj);
4295         PyObject *py_ClientAddress;
4296         py_ClientAddress = py_import_ClientAddressType(pytalloc_get_mem_ctx(obj), object->AddressType, &object->ClientAddress);
4297         if (py_ClientAddress == NULL) {
4298                 return NULL;
4299         }
4300         return py_ClientAddress;
4301 }
4302
4303 static int py_ClientAddress_set_ClientAddress(PyObject *py_obj, PyObject *value, void *closure)
4304 {
4305         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
4306         {
4307                 union ClientAddressType *ClientAddress_switch_0;
4308                 ClientAddress_switch_0 = py_export_ClientAddressType(pytalloc_get_mem_ctx(py_obj), object->AddressType, value);
4309                 if (ClientAddress_switch_0 == NULL) {
4310                         return -1;
4311                 }
4312                 object->ClientAddress = *ClientAddress_switch_0;
4313         }
4314         return 0;
4315 }
4316
4317 static PyObject *py_ClientAddress_get_Padding(PyObject *obj, void *closure)
4318 {
4319         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(obj);
4320         PyObject *py_Padding;
4321         py_Padding = PyList_New(12);
4322         if (py_Padding == NULL) {
4323                 return NULL;
4324         }
4325         {
4326                 int Padding_cntr_0;
4327                 for (Padding_cntr_0 = 0; Padding_cntr_0 < (12); Padding_cntr_0++) {
4328                         PyObject *py_Padding_0;
4329                         py_Padding_0 = PyInt_FromLong((uint16_t)object->Padding[Padding_cntr_0]);
4330                         PyList_SetItem(py_Padding, Padding_cntr_0, py_Padding_0);
4331                 }
4332         }
4333         return py_Padding;
4334 }
4335
4336 static int py_ClientAddress_set_Padding(PyObject *py_obj, PyObject *value, void *closure)
4337 {
4338         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
4339         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4340         {
4341                 int Padding_cntr_0;
4342                 if (ARRAY_SIZE(object->Padding) != PyList_GET_SIZE(value)) {
4343                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->Padding),  PyList_GET_SIZE(value));
4344                         return -1;
4345                 }
4346                 for (Padding_cntr_0 = 0; Padding_cntr_0 < PyList_GET_SIZE(value); Padding_cntr_0++) {
4347                         {
4348                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Padding[Padding_cntr_0]));
4349                                 if (PyLong_Check(PyList_GET_ITEM(value, Padding_cntr_0))) {
4350                                         unsigned long long test_var;
4351                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, Padding_cntr_0));
4352                                         if (PyErr_Occurred() != NULL) {
4353                                                 return -1;
4354                                         }
4355                                         if (test_var > uint_max) {
4356                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4357                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4358                                                 return -1;
4359                                         }
4360                                         object->Padding[Padding_cntr_0] = test_var;
4361                                 } else if (PyInt_Check(PyList_GET_ITEM(value, Padding_cntr_0))) {
4362                                         long test_var;
4363                                         test_var = PyInt_AsLong(PyList_GET_ITEM(value, Padding_cntr_0));
4364                                         if (test_var < 0 || test_var > uint_max) {
4365                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4366                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4367                                                 return -1;
4368                                         }
4369                                         object->Padding[Padding_cntr_0] = test_var;
4370                                 } else {
4371                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4372                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4373                                         return -1;
4374                                 }
4375                         }
4376                 }
4377         }
4378         return 0;
4379 }
4380
4381 static PyGetSetDef py_ClientAddress_getsetters[] = {
4382         { discard_const_p(char, "AddressType"), py_ClientAddress_get_AddressType, py_ClientAddress_set_AddressType },
4383         { discard_const_p(char, "ClientAddress"), py_ClientAddress_get_ClientAddress, py_ClientAddress_set_ClientAddress },
4384         { discard_const_p(char, "Padding"), py_ClientAddress_get_Padding, py_ClientAddress_set_Padding },
4385         { NULL }
4386 };
4387
4388 static PyObject *py_ClientAddress_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4389 {
4390         return pytalloc_new(struct ClientAddress, type);
4391 }
4392
4393 static PyObject *py_ClientAddress_ndr_pack(PyObject *py_obj)
4394 {
4395         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
4396         DATA_BLOB blob;
4397         enum ndr_err_code err;
4398         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ClientAddress);
4399         if (err != NDR_ERR_SUCCESS) {
4400                 PyErr_SetNdrError(err);
4401                 return NULL;
4402         }
4403
4404         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4405 }
4406
4407 static PyObject *py_ClientAddress_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4408 {
4409         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
4410         DATA_BLOB blob;
4411         int blob_length = 0;
4412         enum ndr_err_code err;
4413         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4414         PyObject *allow_remaining_obj = NULL;
4415         bool allow_remaining = false;
4416
4417         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4418                 discard_const_p(char *, kwnames),
4419                 &blob.data, &blob_length,
4420                 &allow_remaining_obj)) {
4421                 return NULL;
4422         }
4423         blob.length = blob_length;
4424
4425         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4426                 allow_remaining = true;
4427         }
4428
4429         if (allow_remaining) {
4430                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ClientAddress);
4431         } else {
4432                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ClientAddress);
4433         }
4434         if (err != NDR_ERR_SUCCESS) {
4435                 PyErr_SetNdrError(err);
4436                 return NULL;
4437         }
4438
4439         Py_RETURN_NONE;
4440 }
4441
4442 static PyObject *py_ClientAddress_ndr_print(PyObject *py_obj)
4443 {
4444         struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
4445         PyObject *ret;
4446         char *retstr;
4447
4448         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ClientAddress, "ClientAddress", object);
4449         ret = PyString_FromString(retstr);
4450         talloc_free(retstr);
4451
4452         return ret;
4453 }
4454
4455 static PyMethodDef py_ClientAddress_methods[] = {
4456         { "__ndr_pack__", (PyCFunction)py_ClientAddress_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4457         { "__ndr_unpack__", (PyCFunction)py_ClientAddress_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4458         { "__ndr_print__", (PyCFunction)py_ClientAddress_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4459         { NULL, NULL, 0, NULL }
4460 };
4461
4462
4463 static PyTypeObject ClientAddress_Type = {
4464         PyObject_HEAD_INIT(NULL) 0,
4465         .tp_name = "dcerpc.ClientAddress",
4466         .tp_getset = py_ClientAddress_getsetters,
4467         .tp_methods = py_ClientAddress_methods,
4468         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4469         .tp_basicsize = sizeof(pytalloc_Object),
4470         .tp_new = py_ClientAddress_new,
4471 };
4472
4473
4474 static PyObject *py_FlowControlAcknowledgment_get_BytesReceived(PyObject *obj, void *closure)
4475 {
4476         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(obj);
4477         PyObject *py_BytesReceived;
4478         py_BytesReceived = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->BytesReceived);
4479         return py_BytesReceived;
4480 }
4481
4482 static int py_FlowControlAcknowledgment_set_BytesReceived(PyObject *py_obj, PyObject *value, void *closure)
4483 {
4484         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
4485         {
4486                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BytesReceived));
4487                 if (PyLong_Check(value)) {
4488                         unsigned long long test_var;
4489                         test_var = PyLong_AsUnsignedLongLong(value);
4490                         if (PyErr_Occurred() != NULL) {
4491                                 return -1;
4492                         }
4493                         if (test_var > uint_max) {
4494                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4495                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4496                                 return -1;
4497                         }
4498                         object->BytesReceived = test_var;
4499                 } else if (PyInt_Check(value)) {
4500                         long test_var;
4501                         test_var = PyInt_AsLong(value);
4502                         if (test_var < 0 || test_var > uint_max) {
4503                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4504                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4505                                 return -1;
4506                         }
4507                         object->BytesReceived = test_var;
4508                 } else {
4509                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4510                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4511                         return -1;
4512                 }
4513         }
4514         return 0;
4515 }
4516
4517 static PyObject *py_FlowControlAcknowledgment_get_AvailableWindow(PyObject *obj, void *closure)
4518 {
4519         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(obj);
4520         PyObject *py_AvailableWindow;
4521         py_AvailableWindow = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->AvailableWindow);
4522         return py_AvailableWindow;
4523 }
4524
4525 static int py_FlowControlAcknowledgment_set_AvailableWindow(PyObject *py_obj, PyObject *value, void *closure)
4526 {
4527         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
4528         {
4529                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AvailableWindow));
4530                 if (PyLong_Check(value)) {
4531                         unsigned long long test_var;
4532                         test_var = PyLong_AsUnsignedLongLong(value);
4533                         if (PyErr_Occurred() != NULL) {
4534                                 return -1;
4535                         }
4536                         if (test_var > uint_max) {
4537                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4538                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4539                                 return -1;
4540                         }
4541                         object->AvailableWindow = test_var;
4542                 } else if (PyInt_Check(value)) {
4543                         long test_var;
4544                         test_var = PyInt_AsLong(value);
4545                         if (test_var < 0 || test_var > uint_max) {
4546                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4547                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4548                                 return -1;
4549                         }
4550                         object->AvailableWindow = test_var;
4551                 } else {
4552                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4553                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4554                         return -1;
4555                 }
4556         }
4557         return 0;
4558 }
4559
4560 static PyObject *py_FlowControlAcknowledgment_get_ChannelCookie(PyObject *obj, void *closure)
4561 {
4562         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(obj);
4563         PyObject *py_ChannelCookie;
4564         py_ChannelCookie = pytalloc_reference_ex(&RTSCookie_Type, pytalloc_get_mem_ctx(obj), &object->ChannelCookie);
4565         return py_ChannelCookie;
4566 }
4567
4568 static int py_FlowControlAcknowledgment_set_ChannelCookie(PyObject *py_obj, PyObject *value, void *closure)
4569 {
4570         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
4571         PY_CHECK_TYPE(&RTSCookie_Type, value, return -1;);
4572         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4573                 PyErr_NoMemory();
4574                 return -1;
4575         }
4576         object->ChannelCookie = *(struct RTSCookie *)pytalloc_get_ptr(value);
4577         return 0;
4578 }
4579
4580 static PyGetSetDef py_FlowControlAcknowledgment_getsetters[] = {
4581         { discard_const_p(char, "BytesReceived"), py_FlowControlAcknowledgment_get_BytesReceived, py_FlowControlAcknowledgment_set_BytesReceived },
4582         { discard_const_p(char, "AvailableWindow"), py_FlowControlAcknowledgment_get_AvailableWindow, py_FlowControlAcknowledgment_set_AvailableWindow },
4583         { discard_const_p(char, "ChannelCookie"), py_FlowControlAcknowledgment_get_ChannelCookie, py_FlowControlAcknowledgment_set_ChannelCookie },
4584         { NULL }
4585 };
4586
4587 static PyObject *py_FlowControlAcknowledgment_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4588 {
4589         return pytalloc_new(struct FlowControlAcknowledgment, type);
4590 }
4591
4592 static PyObject *py_FlowControlAcknowledgment_ndr_pack(PyObject *py_obj)
4593 {
4594         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
4595         DATA_BLOB blob;
4596         enum ndr_err_code err;
4597         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_FlowControlAcknowledgment);
4598         if (err != NDR_ERR_SUCCESS) {
4599                 PyErr_SetNdrError(err);
4600                 return NULL;
4601         }
4602
4603         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4604 }
4605
4606 static PyObject *py_FlowControlAcknowledgment_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4607 {
4608         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
4609         DATA_BLOB blob;
4610         int blob_length = 0;
4611         enum ndr_err_code err;
4612         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4613         PyObject *allow_remaining_obj = NULL;
4614         bool allow_remaining = false;
4615
4616         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4617                 discard_const_p(char *, kwnames),
4618                 &blob.data, &blob_length,
4619                 &allow_remaining_obj)) {
4620                 return NULL;
4621         }
4622         blob.length = blob_length;
4623
4624         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4625                 allow_remaining = true;
4626         }
4627
4628         if (allow_remaining) {
4629                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_FlowControlAcknowledgment);
4630         } else {
4631                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_FlowControlAcknowledgment);
4632         }
4633         if (err != NDR_ERR_SUCCESS) {
4634                 PyErr_SetNdrError(err);
4635                 return NULL;
4636         }
4637
4638         Py_RETURN_NONE;
4639 }
4640
4641 static PyObject *py_FlowControlAcknowledgment_ndr_print(PyObject *py_obj)
4642 {
4643         struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
4644         PyObject *ret;
4645         char *retstr;
4646
4647         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_FlowControlAcknowledgment, "FlowControlAcknowledgment", object);
4648         ret = PyString_FromString(retstr);
4649         talloc_free(retstr);
4650
4651         return ret;
4652 }
4653
4654 static PyMethodDef py_FlowControlAcknowledgment_methods[] = {
4655         { "__ndr_pack__", (PyCFunction)py_FlowControlAcknowledgment_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4656         { "__ndr_unpack__", (PyCFunction)py_FlowControlAcknowledgment_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4657         { "__ndr_print__", (PyCFunction)py_FlowControlAcknowledgment_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4658         { NULL, NULL, 0, NULL }
4659 };
4660
4661
4662 static PyTypeObject FlowControlAcknowledgment_Type = {
4663         PyObject_HEAD_INIT(NULL) 0,
4664         .tp_name = "dcerpc.FlowControlAcknowledgment",
4665         .tp_getset = py_FlowControlAcknowledgment_getsetters,
4666         .tp_methods = py_FlowControlAcknowledgment_methods,
4667         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4668         .tp_basicsize = sizeof(pytalloc_Object),
4669         .tp_new = py_FlowControlAcknowledgment_new,
4670 };
4671
4672
4673 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_get_ReceiveWindowSize(PyObject *obj, void *closure)
4674 {
4675         struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(obj);
4676         PyObject *py_ReceiveWindowSize;
4677         py_ReceiveWindowSize = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->ReceiveWindowSize);
4678         return py_ReceiveWindowSize;
4679 }
4680
4681 static int py_dcerpc_rts_cmd_ReceiveWindowSize_set_ReceiveWindowSize(PyObject *py_obj, PyObject *value, void *closure)
4682 {
4683         struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(py_obj);
4684         {
4685                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ReceiveWindowSize));
4686                 if (PyLong_Check(value)) {
4687                         unsigned long long test_var;
4688                         test_var = PyLong_AsUnsignedLongLong(value);
4689                         if (PyErr_Occurred() != NULL) {
4690                                 return -1;
4691                         }
4692                         if (test_var > uint_max) {
4693                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4694                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4695                                 return -1;
4696                         }
4697                         object->ReceiveWindowSize = test_var;
4698                 } else if (PyInt_Check(value)) {
4699                         long test_var;
4700                         test_var = PyInt_AsLong(value);
4701                         if (test_var < 0 || test_var > uint_max) {
4702                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4703                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4704                                 return -1;
4705                         }
4706                         object->ReceiveWindowSize = test_var;
4707                 } else {
4708                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4709                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4710                         return -1;
4711                 }
4712         }
4713         return 0;
4714 }
4715
4716 static PyGetSetDef py_dcerpc_rts_cmd_ReceiveWindowSize_getsetters[] = {
4717         { discard_const_p(char, "ReceiveWindowSize"), py_dcerpc_rts_cmd_ReceiveWindowSize_get_ReceiveWindowSize, py_dcerpc_rts_cmd_ReceiveWindowSize_set_ReceiveWindowSize },
4718         { NULL }
4719 };
4720
4721 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4722 {
4723         return pytalloc_new(struct dcerpc_rts_cmd_ReceiveWindowSize, type);
4724 }
4725
4726 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_pack(PyObject *py_obj)
4727 {
4728         struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(py_obj);
4729         DATA_BLOB blob;
4730         enum ndr_err_code err;
4731         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ReceiveWindowSize);
4732         if (err != NDR_ERR_SUCCESS) {
4733                 PyErr_SetNdrError(err);
4734                 return NULL;
4735         }
4736
4737         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4738 }
4739
4740 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4741 {
4742         struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(py_obj);
4743         DATA_BLOB blob;
4744         int blob_length = 0;
4745         enum ndr_err_code err;
4746         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4747         PyObject *allow_remaining_obj = NULL;
4748         bool allow_remaining = false;
4749
4750         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4751                 discard_const_p(char *, kwnames),
4752                 &blob.data, &blob_length,
4753                 &allow_remaining_obj)) {
4754                 return NULL;
4755         }
4756         blob.length = blob_length;
4757
4758         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4759                 allow_remaining = true;
4760         }
4761
4762         if (allow_remaining) {
4763                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ReceiveWindowSize);
4764         } else {
4765                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ReceiveWindowSize);
4766         }
4767         if (err != NDR_ERR_SUCCESS) {
4768                 PyErr_SetNdrError(err);
4769                 return NULL;
4770         }
4771
4772         Py_RETURN_NONE;
4773 }
4774
4775 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_print(PyObject *py_obj)
4776 {
4777         struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(py_obj);
4778         PyObject *ret;
4779         char *retstr;
4780
4781         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_ReceiveWindowSize, "dcerpc_rts_cmd_ReceiveWindowSize", object);
4782         ret = PyString_FromString(retstr);
4783         talloc_free(retstr);
4784
4785         return ret;
4786 }
4787
4788 static PyMethodDef py_dcerpc_rts_cmd_ReceiveWindowSize_methods[] = {
4789         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4790         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4791         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4792         { NULL, NULL, 0, NULL }
4793 };
4794
4795
4796 static PyTypeObject dcerpc_rts_cmd_ReceiveWindowSize_Type = {
4797         PyObject_HEAD_INIT(NULL) 0,
4798         .tp_name = "dcerpc.rts_cmd_ReceiveWindowSize",
4799         .tp_getset = py_dcerpc_rts_cmd_ReceiveWindowSize_getsetters,
4800         .tp_methods = py_dcerpc_rts_cmd_ReceiveWindowSize_methods,
4801         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4802         .tp_basicsize = sizeof(pytalloc_Object),
4803         .tp_new = py_dcerpc_rts_cmd_ReceiveWindowSize_new,
4804 };
4805
4806
4807 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_get_Ack(PyObject *obj, void *closure)
4808 {
4809         struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(obj);
4810         PyObject *py_Ack;
4811         py_Ack = pytalloc_reference_ex(&FlowControlAcknowledgment_Type, pytalloc_get_mem_ctx(obj), &object->Ack);
4812         return py_Ack;
4813 }
4814
4815 static int py_dcerpc_rts_cmd_FlowControlAck_set_Ack(PyObject *py_obj, PyObject *value, void *closure)
4816 {
4817         struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(py_obj);
4818         PY_CHECK_TYPE(&FlowControlAcknowledgment_Type, value, return -1;);
4819         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4820                 PyErr_NoMemory();
4821                 return -1;
4822         }
4823         object->Ack = *(struct FlowControlAcknowledgment *)pytalloc_get_ptr(value);
4824         return 0;
4825 }
4826
4827 static PyGetSetDef py_dcerpc_rts_cmd_FlowControlAck_getsetters[] = {
4828         { discard_const_p(char, "Ack"), py_dcerpc_rts_cmd_FlowControlAck_get_Ack, py_dcerpc_rts_cmd_FlowControlAck_set_Ack },
4829         { NULL }
4830 };
4831
4832 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4833 {
4834         return pytalloc_new(struct dcerpc_rts_cmd_FlowControlAck, type);
4835 }
4836
4837 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_pack(PyObject *py_obj)
4838 {
4839         struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(py_obj);
4840         DATA_BLOB blob;
4841         enum ndr_err_code err;
4842         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_FlowControlAck);
4843         if (err != NDR_ERR_SUCCESS) {
4844                 PyErr_SetNdrError(err);
4845                 return NULL;
4846         }
4847
4848         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4849 }
4850
4851 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4852 {
4853         struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(py_obj);
4854         DATA_BLOB blob;
4855         int blob_length = 0;
4856         enum ndr_err_code err;
4857         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4858         PyObject *allow_remaining_obj = NULL;
4859         bool allow_remaining = false;
4860
4861         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4862                 discard_const_p(char *, kwnames),
4863                 &blob.data, &blob_length,
4864                 &allow_remaining_obj)) {
4865                 return NULL;
4866         }
4867         blob.length = blob_length;
4868
4869         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4870                 allow_remaining = true;
4871         }
4872
4873         if (allow_remaining) {
4874                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_FlowControlAck);
4875         } else {
4876                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_FlowControlAck);
4877         }
4878         if (err != NDR_ERR_SUCCESS) {
4879                 PyErr_SetNdrError(err);
4880                 return NULL;
4881         }
4882
4883         Py_RETURN_NONE;
4884 }
4885
4886 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_print(PyObject *py_obj)
4887 {
4888         struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(py_obj);
4889         PyObject *ret;
4890         char *retstr;
4891
4892         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_FlowControlAck, "dcerpc_rts_cmd_FlowControlAck", object);
4893         ret = PyString_FromString(retstr);
4894         talloc_free(retstr);
4895
4896         return ret;
4897 }
4898
4899 static PyMethodDef py_dcerpc_rts_cmd_FlowControlAck_methods[] = {
4900         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_FlowControlAck_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4901         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_FlowControlAck_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4902         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_FlowControlAck_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4903         { NULL, NULL, 0, NULL }
4904 };
4905
4906
4907 static PyTypeObject dcerpc_rts_cmd_FlowControlAck_Type = {
4908         PyObject_HEAD_INIT(NULL) 0,
4909         .tp_name = "dcerpc.rts_cmd_FlowControlAck",
4910         .tp_getset = py_dcerpc_rts_cmd_FlowControlAck_getsetters,
4911         .tp_methods = py_dcerpc_rts_cmd_FlowControlAck_methods,
4912         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4913         .tp_basicsize = sizeof(pytalloc_Object),
4914         .tp_new = py_dcerpc_rts_cmd_FlowControlAck_new,
4915 };
4916
4917
4918 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_get_ConnectionTimeout(PyObject *obj, void *closure)
4919 {
4920         struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(obj);
4921         PyObject *py_ConnectionTimeout;
4922         py_ConnectionTimeout = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->ConnectionTimeout);
4923         return py_ConnectionTimeout;
4924 }
4925
4926 static int py_dcerpc_rts_cmd_ConnectionTimeout_set_ConnectionTimeout(PyObject *py_obj, PyObject *value, void *closure)
4927 {
4928         struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(py_obj);
4929         {
4930                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ConnectionTimeout));
4931                 if (PyLong_Check(value)) {
4932                         unsigned long long test_var;
4933                         test_var = PyLong_AsUnsignedLongLong(value);
4934                         if (PyErr_Occurred() != NULL) {
4935                                 return -1;
4936                         }
4937                         if (test_var > uint_max) {
4938                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4939                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4940                                 return -1;
4941                         }
4942                         object->ConnectionTimeout = test_var;
4943                 } else if (PyInt_Check(value)) {
4944                         long test_var;
4945                         test_var = PyInt_AsLong(value);
4946                         if (test_var < 0 || test_var > uint_max) {
4947                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4948                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4949                                 return -1;
4950                         }
4951                         object->ConnectionTimeout = test_var;
4952                 } else {
4953                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4954                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4955                         return -1;
4956                 }
4957         }
4958         return 0;
4959 }
4960
4961 static PyGetSetDef py_dcerpc_rts_cmd_ConnectionTimeout_getsetters[] = {
4962         { discard_const_p(char, "ConnectionTimeout"), py_dcerpc_rts_cmd_ConnectionTimeout_get_ConnectionTimeout, py_dcerpc_rts_cmd_ConnectionTimeout_set_ConnectionTimeout },
4963         { NULL }
4964 };
4965
4966 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4967 {
4968         return pytalloc_new(struct dcerpc_rts_cmd_ConnectionTimeout, type);
4969 }
4970
4971 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_pack(PyObject *py_obj)
4972 {
4973         struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(py_obj);
4974         DATA_BLOB blob;
4975         enum ndr_err_code err;
4976         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ConnectionTimeout);
4977         if (err != NDR_ERR_SUCCESS) {
4978                 PyErr_SetNdrError(err);
4979                 return NULL;
4980         }
4981
4982         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4983 }
4984
4985 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4986 {
4987         struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(py_obj);
4988         DATA_BLOB blob;
4989         int blob_length = 0;
4990         enum ndr_err_code err;
4991         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4992         PyObject *allow_remaining_obj = NULL;
4993         bool allow_remaining = false;
4994
4995         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4996                 discard_const_p(char *, kwnames),
4997                 &blob.data, &blob_length,
4998                 &allow_remaining_obj)) {
4999                 return NULL;
5000         }
5001         blob.length = blob_length;
5002
5003         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5004                 allow_remaining = true;
5005         }
5006
5007         if (allow_remaining) {
5008                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ConnectionTimeout);
5009         } else {
5010                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ConnectionTimeout);
5011         }
5012         if (err != NDR_ERR_SUCCESS) {
5013                 PyErr_SetNdrError(err);
5014                 return NULL;
5015         }
5016
5017         Py_RETURN_NONE;
5018 }
5019
5020 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_print(PyObject *py_obj)
5021 {
5022         struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(py_obj);
5023         PyObject *ret;
5024         char *retstr;
5025
5026         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_ConnectionTimeout, "dcerpc_rts_cmd_ConnectionTimeout", object);
5027         ret = PyString_FromString(retstr);
5028         talloc_free(retstr);
5029
5030         return ret;
5031 }
5032
5033 static PyMethodDef py_dcerpc_rts_cmd_ConnectionTimeout_methods[] = {
5034         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ConnectionTimeout_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5035         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_ConnectionTimeout_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5036         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ConnectionTimeout_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5037         { NULL, NULL, 0, NULL }
5038 };
5039
5040
5041 static PyTypeObject dcerpc_rts_cmd_ConnectionTimeout_Type = {
5042         PyObject_HEAD_INIT(NULL) 0,
5043         .tp_name = "dcerpc.rts_cmd_ConnectionTimeout",
5044         .tp_getset = py_dcerpc_rts_cmd_ConnectionTimeout_getsetters,
5045         .tp_methods = py_dcerpc_rts_cmd_ConnectionTimeout_methods,
5046         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5047         .tp_basicsize = sizeof(pytalloc_Object),
5048         .tp_new = py_dcerpc_rts_cmd_ConnectionTimeout_new,
5049 };
5050
5051
5052 static PyObject *py_dcerpc_rts_cmd_Cookie_get_Cookie(PyObject *obj, void *closure)
5053 {
5054         struct dcerpc_rts_cmd_Cookie *object = (struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(obj);
5055         PyObject *py_Cookie;
5056         py_Cookie = pytalloc_reference_ex(&RTSCookie_Type, pytalloc_get_mem_ctx(obj), &object->Cookie);
5057         return py_Cookie;
5058 }
5059
5060 static int py_dcerpc_rts_cmd_Cookie_set_Cookie(PyObject *py_obj, PyObject *value, void *closure)
5061 {
5062         struct dcerpc_rts_cmd_Cookie *object = (struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(py_obj);
5063         PY_CHECK_TYPE(&RTSCookie_Type, value, return -1;);
5064         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5065                 PyErr_NoMemory();
5066                 return -1;
5067         }
5068         object->Cookie = *(struct RTSCookie *)pytalloc_get_ptr(value);
5069         return 0;
5070 }
5071
5072 static PyGetSetDef py_dcerpc_rts_cmd_Cookie_getsetters[] = {
5073         { discard_const_p(char, "Cookie"), py_dcerpc_rts_cmd_Cookie_get_Cookie, py_dcerpc_rts_cmd_Cookie_set_Cookie },
5074         { NULL }
5075 };
5076
5077 static PyObject *py_dcerpc_rts_cmd_Cookie_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5078 {
5079         return pytalloc_new(struct dcerpc_rts_cmd_Cookie, type);
5080 }
5081
5082 static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_pack(PyObject *py_obj)
5083 {
5084         struct dcerpc_rts_cmd_Cookie *object = (struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(py_obj);
5085         DATA_BLOB blob;
5086         enum ndr_err_code err;
5087         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Cookie);
5088         if (err != NDR_ERR_SUCCESS) {
5089                 PyErr_SetNdrError(err);
5090                 return NULL;
5091         }
5092
5093         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5094 }
5095
5096 static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5097 {
5098         struct dcerpc_rts_cmd_Cookie *object = (struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(py_obj);
5099         DATA_BLOB blob;
5100         int blob_length = 0;
5101         enum ndr_err_code err;
5102         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5103         PyObject *allow_remaining_obj = NULL;
5104         bool allow_remaining = false;
5105
5106         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5107                 discard_const_p(char *, kwnames),
5108                 &blob.data, &blob_length,
5109                 &allow_remaining_obj)) {
5110                 return NULL;
5111         }
5112         blob.length = blob_length;
5113
5114         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5115                 allow_remaining = true;
5116         }
5117
5118         if (allow_remaining) {
5119                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Cookie);
5120         } else {
5121                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Cookie);
5122         }
5123         if (err != NDR_ERR_SUCCESS) {
5124                 PyErr_SetNdrError(err);
5125                 return NULL;
5126         }
5127
5128         Py_RETURN_NONE;
5129 }
5130
5131 static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_print(PyObject *py_obj)
5132 {
5133         struct dcerpc_rts_cmd_Cookie *object = (struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(py_obj);
5134         PyObject *ret;
5135         char *retstr;
5136
5137         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_Cookie, "dcerpc_rts_cmd_Cookie", object);
5138         ret = PyString_FromString(retstr);
5139         talloc_free(retstr);
5140
5141         return ret;
5142 }
5143
5144 static PyMethodDef py_dcerpc_rts_cmd_Cookie_methods[] = {
5145         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Cookie_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5146         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_Cookie_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5147         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Cookie_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5148         { NULL, NULL, 0, NULL }
5149 };
5150
5151
5152 static PyTypeObject dcerpc_rts_cmd_Cookie_Type = {
5153         PyObject_HEAD_INIT(NULL) 0,
5154         .tp_name = "dcerpc.rts_cmd_Cookie",
5155         .tp_getset = py_dcerpc_rts_cmd_Cookie_getsetters,
5156         .tp_methods = py_dcerpc_rts_cmd_Cookie_methods,
5157         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5158         .tp_basicsize = sizeof(pytalloc_Object),
5159         .tp_new = py_dcerpc_rts_cmd_Cookie_new,
5160 };
5161
5162
5163 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_get_ChannelLifetime(PyObject *obj, void *closure)
5164 {
5165         struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(obj);
5166         PyObject *py_ChannelLifetime;
5167         py_ChannelLifetime = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->ChannelLifetime);
5168         return py_ChannelLifetime;
5169 }
5170
5171 static int py_dcerpc_rts_cmd_ChannelLifetime_set_ChannelLifetime(PyObject *py_obj, PyObject *value, void *closure)
5172 {
5173         struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(py_obj);
5174         {
5175                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ChannelLifetime));
5176                 if (PyLong_Check(value)) {
5177                         unsigned long long test_var;
5178                         test_var = PyLong_AsUnsignedLongLong(value);
5179                         if (PyErr_Occurred() != NULL) {
5180                                 return -1;
5181                         }
5182                         if (test_var > uint_max) {
5183                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5184                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5185                                 return -1;
5186                         }
5187                         object->ChannelLifetime = test_var;
5188                 } else if (PyInt_Check(value)) {
5189                         long test_var;
5190                         test_var = PyInt_AsLong(value);
5191                         if (test_var < 0 || test_var > uint_max) {
5192                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5193                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5194                                 return -1;
5195                         }
5196                         object->ChannelLifetime = test_var;
5197                 } else {
5198                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5199                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5200                         return -1;
5201                 }
5202         }
5203         return 0;
5204 }
5205
5206 static PyGetSetDef py_dcerpc_rts_cmd_ChannelLifetime_getsetters[] = {
5207         { discard_const_p(char, "ChannelLifetime"), py_dcerpc_rts_cmd_ChannelLifetime_get_ChannelLifetime, py_dcerpc_rts_cmd_ChannelLifetime_set_ChannelLifetime },
5208         { NULL }
5209 };
5210
5211 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5212 {
5213         return pytalloc_new(struct dcerpc_rts_cmd_ChannelLifetime, type);
5214 }
5215
5216 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_pack(PyObject *py_obj)
5217 {
5218         struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(py_obj);
5219         DATA_BLOB blob;
5220         enum ndr_err_code err;
5221         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ChannelLifetime);
5222         if (err != NDR_ERR_SUCCESS) {
5223                 PyErr_SetNdrError(err);
5224                 return NULL;
5225         }
5226
5227         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5228 }
5229
5230 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5231 {
5232         struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(py_obj);
5233         DATA_BLOB blob;
5234         int blob_length = 0;
5235         enum ndr_err_code err;
5236         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5237         PyObject *allow_remaining_obj = NULL;
5238         bool allow_remaining = false;
5239
5240         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5241                 discard_const_p(char *, kwnames),
5242                 &blob.data, &blob_length,
5243                 &allow_remaining_obj)) {
5244                 return NULL;
5245         }
5246         blob.length = blob_length;
5247
5248         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5249                 allow_remaining = true;
5250         }
5251
5252         if (allow_remaining) {
5253                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ChannelLifetime);
5254         } else {
5255                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ChannelLifetime);
5256         }
5257         if (err != NDR_ERR_SUCCESS) {
5258                 PyErr_SetNdrError(err);
5259                 return NULL;
5260         }
5261
5262         Py_RETURN_NONE;
5263 }
5264
5265 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_print(PyObject *py_obj)
5266 {
5267         struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(py_obj);
5268         PyObject *ret;
5269         char *retstr;
5270
5271         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_ChannelLifetime, "dcerpc_rts_cmd_ChannelLifetime", object);
5272         ret = PyString_FromString(retstr);
5273         talloc_free(retstr);
5274
5275         return ret;
5276 }
5277
5278 static PyMethodDef py_dcerpc_rts_cmd_ChannelLifetime_methods[] = {
5279         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ChannelLifetime_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5280         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_ChannelLifetime_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5281         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ChannelLifetime_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5282         { NULL, NULL, 0, NULL }
5283 };
5284
5285
5286 static PyTypeObject dcerpc_rts_cmd_ChannelLifetime_Type = {
5287         PyObject_HEAD_INIT(NULL) 0,
5288         .tp_name = "dcerpc.rts_cmd_ChannelLifetime",
5289         .tp_getset = py_dcerpc_rts_cmd_ChannelLifetime_getsetters,
5290         .tp_methods = py_dcerpc_rts_cmd_ChannelLifetime_methods,
5291         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5292         .tp_basicsize = sizeof(pytalloc_Object),
5293         .tp_new = py_dcerpc_rts_cmd_ChannelLifetime_new,
5294 };
5295
5296
5297 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_get_ClientKeepalive(PyObject *obj, void *closure)
5298 {
5299         struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(obj);
5300         PyObject *py_ClientKeepalive;
5301         py_ClientKeepalive = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->ClientKeepalive);
5302         return py_ClientKeepalive;
5303 }
5304
5305 static int py_dcerpc_rts_cmd_ClientKeepalive_set_ClientKeepalive(PyObject *py_obj, PyObject *value, void *closure)
5306 {
5307         struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(py_obj);
5308         {
5309                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ClientKeepalive));
5310                 if (PyLong_Check(value)) {
5311                         unsigned long long test_var;
5312                         test_var = PyLong_AsUnsignedLongLong(value);
5313                         if (PyErr_Occurred() != NULL) {
5314                                 return -1;
5315                         }
5316                         if (test_var > uint_max) {
5317                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5318                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5319                                 return -1;
5320                         }
5321                         object->ClientKeepalive = test_var;
5322                 } else if (PyInt_Check(value)) {
5323                         long test_var;
5324                         test_var = PyInt_AsLong(value);
5325                         if (test_var < 0 || test_var > uint_max) {
5326                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5327                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5328                                 return -1;
5329                         }
5330                         object->ClientKeepalive = test_var;
5331                 } else {
5332                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5333                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5334                         return -1;
5335                 }
5336         }
5337         return 0;
5338 }
5339
5340 static PyGetSetDef py_dcerpc_rts_cmd_ClientKeepalive_getsetters[] = {
5341         { discard_const_p(char, "ClientKeepalive"), py_dcerpc_rts_cmd_ClientKeepalive_get_ClientKeepalive, py_dcerpc_rts_cmd_ClientKeepalive_set_ClientKeepalive },
5342         { NULL }
5343 };
5344
5345 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5346 {
5347         return pytalloc_new(struct dcerpc_rts_cmd_ClientKeepalive, type);
5348 }
5349
5350 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_pack(PyObject *py_obj)
5351 {
5352         struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(py_obj);
5353         DATA_BLOB blob;
5354         enum ndr_err_code err;
5355         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ClientKeepalive);
5356         if (err != NDR_ERR_SUCCESS) {
5357                 PyErr_SetNdrError(err);
5358                 return NULL;
5359         }
5360
5361         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5362 }
5363
5364 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5365 {
5366         struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(py_obj);
5367         DATA_BLOB blob;
5368         int blob_length = 0;
5369         enum ndr_err_code err;
5370         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5371         PyObject *allow_remaining_obj = NULL;
5372         bool allow_remaining = false;
5373
5374         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5375                 discard_const_p(char *, kwnames),
5376                 &blob.data, &blob_length,
5377                 &allow_remaining_obj)) {
5378                 return NULL;
5379         }
5380         blob.length = blob_length;
5381
5382         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5383                 allow_remaining = true;
5384         }
5385
5386         if (allow_remaining) {
5387                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ClientKeepalive);
5388         } else {
5389                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ClientKeepalive);
5390         }
5391         if (err != NDR_ERR_SUCCESS) {
5392                 PyErr_SetNdrError(err);
5393                 return NULL;
5394         }
5395
5396         Py_RETURN_NONE;
5397 }
5398
5399 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_print(PyObject *py_obj)
5400 {
5401         struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(py_obj);
5402         PyObject *ret;
5403         char *retstr;
5404
5405         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_ClientKeepalive, "dcerpc_rts_cmd_ClientKeepalive", object);
5406         ret = PyString_FromString(retstr);
5407         talloc_free(retstr);
5408
5409         return ret;
5410 }
5411
5412 static PyMethodDef py_dcerpc_rts_cmd_ClientKeepalive_methods[] = {
5413         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ClientKeepalive_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5414         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_ClientKeepalive_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5415         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ClientKeepalive_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5416         { NULL, NULL, 0, NULL }
5417 };
5418
5419
5420 static PyTypeObject dcerpc_rts_cmd_ClientKeepalive_Type = {
5421         PyObject_HEAD_INIT(NULL) 0,
5422         .tp_name = "dcerpc.rts_cmd_ClientKeepalive",
5423         .tp_getset = py_dcerpc_rts_cmd_ClientKeepalive_getsetters,
5424         .tp_methods = py_dcerpc_rts_cmd_ClientKeepalive_methods,
5425         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5426         .tp_basicsize = sizeof(pytalloc_Object),
5427         .tp_new = py_dcerpc_rts_cmd_ClientKeepalive_new,
5428 };
5429
5430
5431 static PyObject *py_dcerpc_rts_cmd_Version_get_Version(PyObject *obj, void *closure)
5432 {
5433         struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(obj);
5434         PyObject *py_Version;
5435         py_Version = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->Version);
5436         return py_Version;
5437 }
5438
5439 static int py_dcerpc_rts_cmd_Version_set_Version(PyObject *py_obj, PyObject *value, void *closure)
5440 {
5441         struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(py_obj);
5442         {
5443                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Version));
5444                 if (PyLong_Check(value)) {
5445                         unsigned long long test_var;
5446                         test_var = PyLong_AsUnsignedLongLong(value);
5447                         if (PyErr_Occurred() != NULL) {
5448                                 return -1;
5449                         }
5450                         if (test_var > uint_max) {
5451                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5452                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5453                                 return -1;
5454                         }
5455                         object->Version = test_var;
5456                 } else if (PyInt_Check(value)) {
5457                         long test_var;
5458                         test_var = PyInt_AsLong(value);
5459                         if (test_var < 0 || test_var > uint_max) {
5460                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5461                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5462                                 return -1;
5463                         }
5464                         object->Version = test_var;
5465                 } else {
5466                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5467                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5468                         return -1;
5469                 }
5470         }
5471         return 0;
5472 }
5473
5474 static PyGetSetDef py_dcerpc_rts_cmd_Version_getsetters[] = {
5475         { discard_const_p(char, "Version"), py_dcerpc_rts_cmd_Version_get_Version, py_dcerpc_rts_cmd_Version_set_Version },
5476         { NULL }
5477 };
5478
5479 static PyObject *py_dcerpc_rts_cmd_Version_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5480 {
5481         return pytalloc_new(struct dcerpc_rts_cmd_Version, type);
5482 }
5483
5484 static PyObject *py_dcerpc_rts_cmd_Version_ndr_pack(PyObject *py_obj)
5485 {
5486         struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(py_obj);
5487         DATA_BLOB blob;
5488         enum ndr_err_code err;
5489         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Version);
5490         if (err != NDR_ERR_SUCCESS) {
5491                 PyErr_SetNdrError(err);
5492                 return NULL;
5493         }
5494
5495         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5496 }
5497
5498 static PyObject *py_dcerpc_rts_cmd_Version_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5499 {
5500         struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(py_obj);
5501         DATA_BLOB blob;
5502         int blob_length = 0;
5503         enum ndr_err_code err;
5504         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5505         PyObject *allow_remaining_obj = NULL;
5506         bool allow_remaining = false;
5507
5508         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5509                 discard_const_p(char *, kwnames),
5510                 &blob.data, &blob_length,
5511                 &allow_remaining_obj)) {
5512                 return NULL;
5513         }
5514         blob.length = blob_length;
5515
5516         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5517                 allow_remaining = true;
5518         }
5519
5520         if (allow_remaining) {
5521                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Version);
5522         } else {
5523                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Version);
5524         }
5525         if (err != NDR_ERR_SUCCESS) {
5526                 PyErr_SetNdrError(err);
5527                 return NULL;
5528         }
5529
5530         Py_RETURN_NONE;
5531 }
5532
5533 static PyObject *py_dcerpc_rts_cmd_Version_ndr_print(PyObject *py_obj)
5534 {
5535         struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(py_obj);
5536         PyObject *ret;
5537         char *retstr;
5538
5539         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_Version, "dcerpc_rts_cmd_Version", object);
5540         ret = PyString_FromString(retstr);
5541         talloc_free(retstr);
5542
5543         return ret;
5544 }
5545
5546 static PyMethodDef py_dcerpc_rts_cmd_Version_methods[] = {
5547         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Version_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5548         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_Version_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5549         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Version_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5550         { NULL, NULL, 0, NULL }
5551 };
5552
5553
5554 static PyTypeObject dcerpc_rts_cmd_Version_Type = {
5555         PyObject_HEAD_INIT(NULL) 0,
5556         .tp_name = "dcerpc.rts_cmd_Version",
5557         .tp_getset = py_dcerpc_rts_cmd_Version_getsetters,
5558         .tp_methods = py_dcerpc_rts_cmd_Version_methods,
5559         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5560         .tp_basicsize = sizeof(pytalloc_Object),
5561         .tp_new = py_dcerpc_rts_cmd_Version_new,
5562 };
5563
5564
5565 static PyObject *py_dcerpc_rts_cmd_Empty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5566 {
5567         return pytalloc_new(struct dcerpc_rts_cmd_Empty, type);
5568 }
5569
5570 static PyObject *py_dcerpc_rts_cmd_Empty_ndr_pack(PyObject *py_obj)
5571 {
5572         struct dcerpc_rts_cmd_Empty *object = (struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(py_obj);
5573         DATA_BLOB blob;
5574         enum ndr_err_code err;
5575         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Empty);
5576         if (err != NDR_ERR_SUCCESS) {
5577                 PyErr_SetNdrError(err);
5578                 return NULL;
5579         }
5580
5581         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5582 }
5583
5584 static PyObject *py_dcerpc_rts_cmd_Empty_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5585 {
5586         struct dcerpc_rts_cmd_Empty *object = (struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(py_obj);
5587         DATA_BLOB blob;
5588         int blob_length = 0;
5589         enum ndr_err_code err;
5590         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5591         PyObject *allow_remaining_obj = NULL;
5592         bool allow_remaining = false;
5593
5594         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5595                 discard_const_p(char *, kwnames),
5596                 &blob.data, &blob_length,
5597                 &allow_remaining_obj)) {
5598                 return NULL;
5599         }
5600         blob.length = blob_length;
5601
5602         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5603                 allow_remaining = true;
5604         }
5605
5606         if (allow_remaining) {
5607                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Empty);
5608         } else {
5609                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Empty);
5610         }
5611         if (err != NDR_ERR_SUCCESS) {
5612                 PyErr_SetNdrError(err);
5613                 return NULL;
5614         }
5615
5616         Py_RETURN_NONE;
5617 }
5618
5619 static PyObject *py_dcerpc_rts_cmd_Empty_ndr_print(PyObject *py_obj)
5620 {
5621         struct dcerpc_rts_cmd_Empty *object = (struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(py_obj);
5622         PyObject *ret;
5623         char *retstr;
5624
5625         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_Empty, "dcerpc_rts_cmd_Empty", object);
5626         ret = PyString_FromString(retstr);
5627         talloc_free(retstr);
5628
5629         return ret;
5630 }
5631
5632 static PyMethodDef py_dcerpc_rts_cmd_Empty_methods[] = {
5633         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Empty_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5634         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_Empty_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5635         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Empty_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5636         { NULL, NULL, 0, NULL }
5637 };
5638
5639
5640 static PyTypeObject dcerpc_rts_cmd_Empty_Type = {
5641         PyObject_HEAD_INIT(NULL) 0,
5642         .tp_name = "dcerpc.rts_cmd_Empty",
5643         .tp_getset = NULL,
5644         .tp_methods = py_dcerpc_rts_cmd_Empty_methods,
5645         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5646         .tp_basicsize = sizeof(pytalloc_Object),
5647         .tp_new = py_dcerpc_rts_cmd_Empty_new,
5648 };
5649
5650
5651 static PyObject *py_dcerpc_rts_cmd_Padding_get_ConformanceCount(PyObject *obj, void *closure)
5652 {
5653         struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(obj);
5654         PyObject *py_ConformanceCount;
5655         py_ConformanceCount = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->ConformanceCount);
5656         return py_ConformanceCount;
5657 }
5658
5659 static int py_dcerpc_rts_cmd_Padding_set_ConformanceCount(PyObject *py_obj, PyObject *value, void *closure)
5660 {
5661         struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
5662         {
5663                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ConformanceCount));
5664                 if (PyLong_Check(value)) {
5665                         unsigned long long test_var;
5666                         test_var = PyLong_AsUnsignedLongLong(value);
5667                         if (PyErr_Occurred() != NULL) {
5668                                 return -1;
5669                         }
5670                         if (test_var > uint_max) {
5671                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5672                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5673                                 return -1;
5674                         }
5675                         object->ConformanceCount = test_var;
5676                 } else if (PyInt_Check(value)) {
5677                         long test_var;
5678                         test_var = PyInt_AsLong(value);
5679                         if (test_var < 0 || test_var > uint_max) {
5680                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5681                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5682                                 return -1;
5683                         }
5684                         object->ConformanceCount = test_var;
5685                 } else {
5686                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5687                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5688                         return -1;
5689                 }
5690         }
5691         return 0;
5692 }
5693
5694 static PyObject *py_dcerpc_rts_cmd_Padding_get_Padding(PyObject *obj, void *closure)
5695 {
5696         struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(obj);
5697         PyObject *py_Padding;
5698         py_Padding = PyList_New(object->ConformanceCount);
5699         if (py_Padding == NULL) {
5700                 return NULL;
5701         }
5702         {
5703                 int Padding_cntr_0;
5704                 for (Padding_cntr_0 = 0; Padding_cntr_0 < (object->ConformanceCount); Padding_cntr_0++) {
5705                         PyObject *py_Padding_0;
5706                         py_Padding_0 = PyInt_FromLong((uint16_t)object->Padding[Padding_cntr_0]);
5707                         PyList_SetItem(py_Padding, Padding_cntr_0, py_Padding_0);
5708                 }
5709         }
5710         return py_Padding;
5711 }
5712
5713 static int py_dcerpc_rts_cmd_Padding_set_Padding(PyObject *py_obj, PyObject *value, void *closure)
5714 {
5715         struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
5716         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5717         {
5718                 int Padding_cntr_0;
5719                 object->Padding = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->Padding, PyList_GET_SIZE(value));
5720                 if (!object->Padding) { return -1;; }
5721                 talloc_set_name_const(object->Padding, "ARRAY: object->Padding");
5722                 for (Padding_cntr_0 = 0; Padding_cntr_0 < PyList_GET_SIZE(value); Padding_cntr_0++) {
5723                         {
5724                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Padding[Padding_cntr_0]));
5725                                 if (PyLong_Check(PyList_GET_ITEM(value, Padding_cntr_0))) {
5726                                         unsigned long long test_var;
5727                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, Padding_cntr_0));
5728                                         if (PyErr_Occurred() != NULL) {
5729                                                 return -1;
5730                                         }
5731                                         if (test_var > uint_max) {
5732                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5733                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5734                                                 return -1;
5735                                         }
5736                                         object->Padding[Padding_cntr_0] = test_var;
5737                                 } else if (PyInt_Check(PyList_GET_ITEM(value, Padding_cntr_0))) {
5738                                         long test_var;
5739                                         test_var = PyInt_AsLong(PyList_GET_ITEM(value, Padding_cntr_0));
5740                                         if (test_var < 0 || test_var > uint_max) {
5741                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5742                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5743                                                 return -1;
5744                                         }
5745                                         object->Padding[Padding_cntr_0] = test_var;
5746                                 } else {
5747                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5748                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5749                                         return -1;
5750                                 }
5751                         }
5752                 }
5753         }
5754         return 0;
5755 }
5756
5757 static PyGetSetDef py_dcerpc_rts_cmd_Padding_getsetters[] = {
5758         { discard_const_p(char, "ConformanceCount"), py_dcerpc_rts_cmd_Padding_get_ConformanceCount, py_dcerpc_rts_cmd_Padding_set_ConformanceCount },
5759         { discard_const_p(char, "Padding"), py_dcerpc_rts_cmd_Padding_get_Padding, py_dcerpc_rts_cmd_Padding_set_Padding },
5760         { NULL }
5761 };
5762
5763 static PyObject *py_dcerpc_rts_cmd_Padding_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5764 {
5765         return pytalloc_new(struct dcerpc_rts_cmd_Padding, type);
5766 }
5767
5768 static PyObject *py_dcerpc_rts_cmd_Padding_ndr_pack(PyObject *py_obj)
5769 {
5770         struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
5771         DATA_BLOB blob;
5772         enum ndr_err_code err;
5773         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Padding);
5774         if (err != NDR_ERR_SUCCESS) {
5775                 PyErr_SetNdrError(err);
5776                 return NULL;
5777         }
5778
5779         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5780 }
5781
5782 static PyObject *py_dcerpc_rts_cmd_Padding_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5783 {
5784         struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
5785         DATA_BLOB blob;
5786         int blob_length = 0;
5787         enum ndr_err_code err;
5788         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5789         PyObject *allow_remaining_obj = NULL;
5790         bool allow_remaining = false;
5791
5792         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5793                 discard_const_p(char *, kwnames),
5794                 &blob.data, &blob_length,
5795                 &allow_remaining_obj)) {
5796                 return NULL;
5797         }
5798         blob.length = blob_length;
5799
5800         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5801                 allow_remaining = true;
5802         }
5803
5804         if (allow_remaining) {
5805                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Padding);
5806         } else {
5807                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Padding);
5808         }
5809         if (err != NDR_ERR_SUCCESS) {
5810                 PyErr_SetNdrError(err);
5811                 return NULL;
5812         }
5813
5814         Py_RETURN_NONE;
5815 }
5816
5817 static PyObject *py_dcerpc_rts_cmd_Padding_ndr_print(PyObject *py_obj)
5818 {
5819         struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
5820         PyObject *ret;
5821         char *retstr;
5822
5823         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_Padding, "dcerpc_rts_cmd_Padding", object);
5824         ret = PyString_FromString(retstr);
5825         talloc_free(retstr);
5826
5827         return ret;
5828 }
5829
5830 static PyMethodDef py_dcerpc_rts_cmd_Padding_methods[] = {
5831         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Padding_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5832         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_Padding_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5833         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Padding_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5834         { NULL, NULL, 0, NULL }
5835 };
5836
5837
5838 static PyTypeObject dcerpc_rts_cmd_Padding_Type = {
5839         PyObject_HEAD_INIT(NULL) 0,
5840         .tp_name = "dcerpc.rts_cmd_Padding",
5841         .tp_getset = py_dcerpc_rts_cmd_Padding_getsetters,
5842         .tp_methods = py_dcerpc_rts_cmd_Padding_methods,
5843         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5844         .tp_basicsize = sizeof(pytalloc_Object),
5845         .tp_new = py_dcerpc_rts_cmd_Padding_new,
5846 };
5847
5848
5849 static PyObject *py_dcerpc_rts_cmd_NegativeANCE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5850 {
5851         return pytalloc_new(struct dcerpc_rts_cmd_NegativeANCE, type);
5852 }
5853
5854 static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_pack(PyObject *py_obj)
5855 {
5856         struct dcerpc_rts_cmd_NegativeANCE *object = (struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(py_obj);
5857         DATA_BLOB blob;
5858         enum ndr_err_code err;
5859         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_NegativeANCE);
5860         if (err != NDR_ERR_SUCCESS) {
5861                 PyErr_SetNdrError(err);
5862                 return NULL;
5863         }
5864
5865         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5866 }
5867
5868 static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5869 {
5870         struct dcerpc_rts_cmd_NegativeANCE *object = (struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(py_obj);
5871         DATA_BLOB blob;
5872         int blob_length = 0;
5873         enum ndr_err_code err;
5874         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5875         PyObject *allow_remaining_obj = NULL;
5876         bool allow_remaining = false;
5877
5878         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5879                 discard_const_p(char *, kwnames),
5880                 &blob.data, &blob_length,
5881                 &allow_remaining_obj)) {
5882                 return NULL;
5883         }
5884         blob.length = blob_length;
5885
5886         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5887                 allow_remaining = true;
5888         }
5889
5890         if (allow_remaining) {
5891                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_NegativeANCE);
5892         } else {
5893                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_NegativeANCE);
5894         }
5895         if (err != NDR_ERR_SUCCESS) {
5896                 PyErr_SetNdrError(err);
5897                 return NULL;
5898         }
5899
5900         Py_RETURN_NONE;
5901 }
5902
5903 static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_print(PyObject *py_obj)
5904 {
5905         struct dcerpc_rts_cmd_NegativeANCE *object = (struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(py_obj);
5906         PyObject *ret;
5907         char *retstr;
5908
5909         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_NegativeANCE, "dcerpc_rts_cmd_NegativeANCE", object);
5910         ret = PyString_FromString(retstr);
5911         talloc_free(retstr);
5912
5913         return ret;
5914 }
5915
5916 static PyMethodDef py_dcerpc_rts_cmd_NegativeANCE_methods[] = {
5917         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_NegativeANCE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5918         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_NegativeANCE_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5919         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_NegativeANCE_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5920         { NULL, NULL, 0, NULL }
5921 };
5922
5923
5924 static PyTypeObject dcerpc_rts_cmd_NegativeANCE_Type = {
5925         PyObject_HEAD_INIT(NULL) 0,
5926         .tp_name = "dcerpc.rts_cmd_NegativeANCE",
5927         .tp_getset = NULL,
5928         .tp_methods = py_dcerpc_rts_cmd_NegativeANCE_methods,
5929         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5930         .tp_basicsize = sizeof(pytalloc_Object),
5931         .tp_new = py_dcerpc_rts_cmd_NegativeANCE_new,
5932 };
5933
5934
5935 static PyObject *py_dcerpc_rts_cmd_ANCE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5936 {
5937         return pytalloc_new(struct dcerpc_rts_cmd_ANCE, type);
5938 }
5939
5940 static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_pack(PyObject *py_obj)
5941 {
5942         struct dcerpc_rts_cmd_ANCE *object = (struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(py_obj);
5943         DATA_BLOB blob;
5944         enum ndr_err_code err;
5945         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ANCE);
5946         if (err != NDR_ERR_SUCCESS) {
5947                 PyErr_SetNdrError(err);
5948                 return NULL;
5949         }
5950
5951         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5952 }
5953
5954 static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5955 {
5956         struct dcerpc_rts_cmd_ANCE *object = (struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(py_obj);
5957         DATA_BLOB blob;
5958         int blob_length = 0;
5959         enum ndr_err_code err;
5960         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5961         PyObject *allow_remaining_obj = NULL;
5962         bool allow_remaining = false;
5963
5964         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5965                 discard_const_p(char *, kwnames),
5966                 &blob.data, &blob_length,
5967                 &allow_remaining_obj)) {
5968                 return NULL;
5969         }
5970         blob.length = blob_length;
5971
5972         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5973                 allow_remaining = true;
5974         }
5975
5976         if (allow_remaining) {
5977                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ANCE);
5978         } else {
5979                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ANCE);
5980         }
5981         if (err != NDR_ERR_SUCCESS) {
5982                 PyErr_SetNdrError(err);
5983                 return NULL;
5984         }
5985
5986         Py_RETURN_NONE;
5987 }
5988
5989 static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_print(PyObject *py_obj)
5990 {
5991         struct dcerpc_rts_cmd_ANCE *object = (struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(py_obj);
5992         PyObject *ret;
5993         char *retstr;
5994
5995         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_ANCE, "dcerpc_rts_cmd_ANCE", object);
5996         ret = PyString_FromString(retstr);
5997         talloc_free(retstr);
5998
5999         return ret;
6000 }
6001
6002 static PyMethodDef py_dcerpc_rts_cmd_ANCE_methods[] = {
6003         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ANCE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6004         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_ANCE_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6005         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ANCE_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
6006         { NULL, NULL, 0, NULL }
6007 };
6008
6009
6010 static PyTypeObject dcerpc_rts_cmd_ANCE_Type = {
6011         PyObject_HEAD_INIT(NULL) 0,
6012         .tp_name = "dcerpc.rts_cmd_ANCE",
6013         .tp_getset = NULL,
6014         .tp_methods = py_dcerpc_rts_cmd_ANCE_methods,
6015         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6016         .tp_basicsize = sizeof(pytalloc_Object),
6017         .tp_new = py_dcerpc_rts_cmd_ANCE_new,
6018 };
6019
6020
6021 static PyObject *py_dcerpc_rts_cmd_ClientAddress_get_ClientAddress(PyObject *obj, void *closure)
6022 {
6023         struct dcerpc_rts_cmd_ClientAddress *object = (struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(obj);
6024         PyObject *py_ClientAddress;
6025         py_ClientAddress = pytalloc_reference_ex(&ClientAddress_Type, pytalloc_get_mem_ctx(obj), &object->ClientAddress);
6026         return py_ClientAddress;
6027 }
6028
6029 static int py_dcerpc_rts_cmd_ClientAddress_set_ClientAddress(PyObject *py_obj, PyObject *value, void *closure)
6030 {
6031         struct dcerpc_rts_cmd_ClientAddress *object = (struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(py_obj);
6032         PY_CHECK_TYPE(&ClientAddress_Type, value, return -1;);
6033         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6034                 PyErr_NoMemory();
6035                 return -1;
6036         }
6037         object->ClientAddress = *(struct ClientAddress *)pytalloc_get_ptr(value);
6038         return 0;
6039 }
6040
6041 static PyGetSetDef py_dcerpc_rts_cmd_ClientAddress_getsetters[] = {
6042         { discard_const_p(char, "ClientAddress"), py_dcerpc_rts_cmd_ClientAddress_get_ClientAddress, py_dcerpc_rts_cmd_ClientAddress_set_ClientAddress },
6043         { NULL }
6044 };
6045
6046 static PyObject *py_dcerpc_rts_cmd_ClientAddress_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6047 {
6048         return pytalloc_new(struct dcerpc_rts_cmd_ClientAddress, type);
6049 }
6050
6051 static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_pack(PyObject *py_obj)
6052 {
6053         struct dcerpc_rts_cmd_ClientAddress *object = (struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(py_obj);
6054         DATA_BLOB blob;
6055         enum ndr_err_code err;
6056         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ClientAddress);
6057         if (err != NDR_ERR_SUCCESS) {
6058                 PyErr_SetNdrError(err);
6059                 return NULL;
6060         }
6061
6062         return PyString_FromStringAndSize((char *)blob.data, blob.length);
6063 }
6064
6065 static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6066 {
6067         struct dcerpc_rts_cmd_ClientAddress *object = (struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(py_obj);
6068         DATA_BLOB blob;
6069         int blob_length = 0;
6070         enum ndr_err_code err;
6071         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6072         PyObject *allow_remaining_obj = NULL;
6073         bool allow_remaining = false;
6074
6075         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
6076                 discard_const_p(char *, kwnames),
6077                 &blob.data, &blob_length,
6078                 &allow_remaining_obj)) {
6079                 return NULL;
6080         }
6081         blob.length = blob_length;
6082
6083         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6084                 allow_remaining = true;
6085         }
6086
6087         if (allow_remaining) {
6088                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ClientAddress);
6089         } else {
6090                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ClientAddress);
6091         }
6092         if (err != NDR_ERR_SUCCESS) {
6093                 PyErr_SetNdrError(err);
6094                 return NULL;
6095         }
6096
6097         Py_RETURN_NONE;
6098 }
6099
6100 static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_print(PyObject *py_obj)
6101 {
6102         struct dcerpc_rts_cmd_ClientAddress *object = (struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(py_obj);
6103         PyObject *ret;
6104         char *retstr;
6105
6106         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_ClientAddress, "dcerpc_rts_cmd_ClientAddress", object);
6107         ret = PyString_FromString(retstr);
6108         talloc_free(retstr);
6109
6110         return ret;
6111 }
6112
6113 static PyMethodDef py_dcerpc_rts_cmd_ClientAddress_methods[] = {
6114         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ClientAddress_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6115         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_ClientAddress_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6116         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ClientAddress_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
6117         { NULL, NULL, 0, NULL }
6118 };
6119
6120
6121 static PyTypeObject dcerpc_rts_cmd_ClientAddress_Type = {
6122         PyObject_HEAD_INIT(NULL) 0,
6123         .tp_name = "dcerpc.rts_cmd_ClientAddress",
6124         .tp_getset = py_dcerpc_rts_cmd_ClientAddress_getsetters,
6125         .tp_methods = py_dcerpc_rts_cmd_ClientAddress_methods,
6126         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6127         .tp_basicsize = sizeof(pytalloc_Object),
6128         .tp_new = py_dcerpc_rts_cmd_ClientAddress_new,
6129 };
6130
6131
6132 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_get_AssociationGroupId(PyObject *obj, void *closure)
6133 {
6134         struct dcerpc_rts_cmd_AssociationGroupId *object = (struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(obj);
6135         PyObject *py_AssociationGroupId;
6136         py_AssociationGroupId = pytalloc_reference_ex(&RTSCookie_Type, pytalloc_get_mem_ctx(obj), &object->AssociationGroupId);
6137         return py_AssociationGroupId;
6138 }
6139
6140 static int py_dcerpc_rts_cmd_AssociationGroupId_set_AssociationGroupId(PyObject *py_obj, PyObject *value, void *closure)
6141 {
6142         struct dcerpc_rts_cmd_AssociationGroupId *object = (struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(py_obj);
6143         PY_CHECK_TYPE(&RTSCookie_Type, value, return -1;);
6144         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6145                 PyErr_NoMemory();
6146                 return -1;
6147         }
6148         object->AssociationGroupId = *(struct RTSCookie *)pytalloc_get_ptr(value);
6149         return 0;
6150 }
6151
6152 static PyGetSetDef py_dcerpc_rts_cmd_AssociationGroupId_getsetters[] = {
6153         { discard_const_p(char, "AssociationGroupId"), py_dcerpc_rts_cmd_AssociationGroupId_get_AssociationGroupId, py_dcerpc_rts_cmd_AssociationGroupId_set_AssociationGroupId },
6154         { NULL }
6155 };
6156
6157 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6158 {
6159         return pytalloc_new(struct dcerpc_rts_cmd_AssociationGroupId, type);
6160 }
6161
6162 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_pack(PyObject *py_obj)
6163 {
6164         struct dcerpc_rts_cmd_AssociationGroupId *object = (struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(py_obj);
6165         DATA_BLOB blob;
6166         enum ndr_err_code err;
6167         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_AssociationGroupId);
6168         if (err != NDR_ERR_SUCCESS) {
6169                 PyErr_SetNdrError(err);
6170                 return NULL;
6171         }
6172
6173         return PyString_FromStringAndSize((char *)blob.data, blob.length);
6174 }
6175
6176 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6177 {
6178         struct dcerpc_rts_cmd_AssociationGroupId *object = (struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(py_obj);
6179         DATA_BLOB blob;
6180         int blob_length = 0;
6181         enum ndr_err_code err;
6182         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6183         PyObject *allow_remaining_obj = NULL;
6184         bool allow_remaining = false;
6185
6186         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
6187                 discard_const_p(char *, kwnames),
6188                 &blob.data, &blob_length,
6189                 &allow_remaining_obj)) {
6190                 return NULL;
6191         }
6192         blob.length = blob_length;
6193
6194         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6195                 allow_remaining = true;
6196         }
6197
6198         if (allow_remaining) {
6199                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_AssociationGroupId);
6200         } else {
6201                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_AssociationGroupId);
6202         }
6203         if (err != NDR_ERR_SUCCESS) {
6204                 PyErr_SetNdrError(err);
6205                 return NULL;
6206         }
6207
6208         Py_RETURN_NONE;
6209 }
6210
6211 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_print(PyObject *py_obj)
6212 {
6213         struct dcerpc_rts_cmd_AssociationGroupId *object = (struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(py_obj);
6214         PyObject *ret;
6215         char *retstr;
6216
6217         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_AssociationGroupId, "dcerpc_rts_cmd_AssociationGroupId", object);
6218         ret = PyString_FromString(retstr);
6219         talloc_free(retstr);
6220
6221         return ret;
6222 }
6223
6224 static PyMethodDef py_dcerpc_rts_cmd_AssociationGroupId_methods[] = {
6225         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_AssociationGroupId_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6226         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_AssociationGroupId_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6227         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_AssociationGroupId_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
6228         { NULL, NULL, 0, NULL }
6229 };
6230
6231
6232 static PyTypeObject dcerpc_rts_cmd_AssociationGroupId_Type = {
6233         PyObject_HEAD_INIT(NULL) 0,
6234         .tp_name = "dcerpc.rts_cmd_AssociationGroupId",
6235         .tp_getset = py_dcerpc_rts_cmd_AssociationGroupId_getsetters,
6236         .tp_methods = py_dcerpc_rts_cmd_AssociationGroupId_methods,
6237         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6238         .tp_basicsize = sizeof(pytalloc_Object),
6239         .tp_new = py_dcerpc_rts_cmd_AssociationGroupId_new,
6240 };
6241
6242
6243 static PyObject *py_dcerpc_rts_cmd_Destination_get_ForwardDestination(PyObject *obj, void *closure)
6244 {
6245         struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(obj);
6246         PyObject *py_ForwardDestination;
6247         py_ForwardDestination = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->ForwardDestination);
6248         return py_ForwardDestination;
6249 }
6250
6251 static int py_dcerpc_rts_cmd_Destination_set_ForwardDestination(PyObject *py_obj, PyObject *value, void *closure)
6252 {
6253         struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(py_obj);
6254         {
6255                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ForwardDestination));
6256                 if (PyLong_Check(value)) {
6257                         unsigned long long test_var;
6258                         test_var = PyLong_AsUnsignedLongLong(value);
6259                         if (PyErr_Occurred() != NULL) {
6260                                 return -1;
6261                         }
6262                         if (test_var > uint_max) {
6263                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6264                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6265                                 return -1;
6266                         }
6267                         object->ForwardDestination = test_var;
6268                 } else if (PyInt_Check(value)) {
6269                         long test_var;
6270                         test_var = PyInt_AsLong(value);
6271                         if (test_var < 0 || test_var > uint_max) {
6272                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6273                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6274                                 return -1;
6275                         }
6276                         object->ForwardDestination = test_var;
6277                 } else {
6278                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6279                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6280                         return -1;
6281                 }
6282         }
6283         return 0;
6284 }
6285
6286 static PyGetSetDef py_dcerpc_rts_cmd_Destination_getsetters[] = {
6287         { discard_const_p(char, "ForwardDestination"), py_dcerpc_rts_cmd_Destination_get_ForwardDestination, py_dcerpc_rts_cmd_Destination_set_ForwardDestination },
6288         { NULL }
6289 };
6290
6291 static PyObject *py_dcerpc_rts_cmd_Destination_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6292 {
6293         return pytalloc_new(struct dcerpc_rts_cmd_Destination, type);
6294 }
6295
6296 static PyObject *py_dcerpc_rts_cmd_Destination_ndr_pack(PyObject *py_obj)
6297 {
6298         struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(py_obj);
6299         DATA_BLOB blob;
6300         enum ndr_err_code err;
6301         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Destination);
6302         if (err != NDR_ERR_SUCCESS) {
6303                 PyErr_SetNdrError(err);
6304                 return NULL;
6305         }
6306
6307         return PyString_FromStringAndSize((char *)blob.data, blob.length);
6308 }
6309
6310 static PyObject *py_dcerpc_rts_cmd_Destination_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6311 {
6312         struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(py_obj);
6313         DATA_BLOB blob;
6314         int blob_length = 0;
6315         enum ndr_err_code err;
6316         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6317         PyObject *allow_remaining_obj = NULL;
6318         bool allow_remaining = false;
6319
6320         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
6321                 discard_const_p(char *, kwnames),
6322                 &blob.data, &blob_length,
6323                 &allow_remaining_obj)) {
6324                 return NULL;
6325         }
6326         blob.length = blob_length;
6327
6328         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6329                 allow_remaining = true;
6330         }
6331
6332         if (allow_remaining) {
6333                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Destination);
6334         } else {
6335                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Destination);
6336         }
6337         if (err != NDR_ERR_SUCCESS) {
6338                 PyErr_SetNdrError(err);
6339                 return NULL;
6340         }
6341
6342         Py_RETURN_NONE;
6343 }
6344
6345 static PyObject *py_dcerpc_rts_cmd_Destination_ndr_print(PyObject *py_obj)
6346 {
6347         struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(py_obj);
6348         PyObject *ret;
6349         char *retstr;
6350
6351         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_Destination, "dcerpc_rts_cmd_Destination", object);
6352         ret = PyString_FromString(retstr);
6353         talloc_free(retstr);
6354
6355         return ret;
6356 }
6357
6358 static PyMethodDef py_dcerpc_rts_cmd_Destination_methods[] = {
6359         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Destination_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6360         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_Destination_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6361         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Destination_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
6362         { NULL, NULL, 0, NULL }
6363 };
6364
6365
6366 static PyTypeObject dcerpc_rts_cmd_Destination_Type = {
6367         PyObject_HEAD_INIT(NULL) 0,
6368         .tp_name = "dcerpc.rts_cmd_Destination",
6369         .tp_getset = py_dcerpc_rts_cmd_Destination_getsetters,
6370         .tp_methods = py_dcerpc_rts_cmd_Destination_methods,
6371         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6372         .tp_basicsize = sizeof(pytalloc_Object),
6373         .tp_new = py_dcerpc_rts_cmd_Destination_new,
6374 };
6375
6376
6377 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_get_PingTrafficSent(PyObject *obj, void *closure)
6378 {
6379         struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(obj);
6380         PyObject *py_PingTrafficSent;
6381         py_PingTrafficSent = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->PingTrafficSent);
6382         return py_PingTrafficSent;
6383 }
6384
6385 static int py_dcerpc_rts_cmd_PingTrafficSentNotify_set_PingTrafficSent(PyObject *py_obj, PyObject *value, void *closure)
6386 {
6387         struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(py_obj);
6388         {
6389                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PingTrafficSent));
6390                 if (PyLong_Check(value)) {
6391                         unsigned long long test_var;
6392                         test_var = PyLong_AsUnsignedLongLong(value);
6393                         if (PyErr_Occurred() != NULL) {
6394                                 return -1;
6395                         }
6396                         if (test_var > uint_max) {
6397                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6398                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6399                                 return -1;
6400                         }
6401                         object->PingTrafficSent = test_var;
6402                 } else if (PyInt_Check(value)) {
6403                         long test_var;
6404                         test_var = PyInt_AsLong(value);
6405                         if (test_var < 0 || test_var > uint_max) {
6406                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6407                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6408                                 return -1;
6409                         }
6410                         object->PingTrafficSent = test_var;
6411                 } else {
6412                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6413                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6414                         return -1;
6415                 }
6416         }
6417         return 0;
6418 }
6419
6420 static PyGetSetDef py_dcerpc_rts_cmd_PingTrafficSentNotify_getsetters[] = {
6421         { discard_const_p(char, "PingTrafficSent"), py_dcerpc_rts_cmd_PingTrafficSentNotify_get_PingTrafficSent, py_dcerpc_rts_cmd_PingTrafficSentNotify_set_PingTrafficSent },
6422         { NULL }
6423 };
6424
6425 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6426 {
6427         return pytalloc_new(struct dcerpc_rts_cmd_PingTrafficSentNotify, type);
6428 }
6429
6430 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_pack(PyObject *py_obj)
6431 {
6432         struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(py_obj);
6433         DATA_BLOB blob;
6434         enum ndr_err_code err;
6435         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_PingTrafficSentNotify);
6436         if (err != NDR_ERR_SUCCESS) {
6437                 PyErr_SetNdrError(err);
6438                 return NULL;
6439         }
6440
6441         return PyString_FromStringAndSize((char *)blob.data, blob.length);
6442 }
6443
6444 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6445 {
6446         struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(py_obj);
6447         DATA_BLOB blob;
6448         int blob_length = 0;
6449         enum ndr_err_code err;
6450         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6451         PyObject *allow_remaining_obj = NULL;
6452         bool allow_remaining = false;
6453
6454         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
6455                 discard_const_p(char *, kwnames),
6456                 &blob.data, &blob_length,
6457                 &allow_remaining_obj)) {
6458                 return NULL;
6459         }
6460         blob.length = blob_length;
6461
6462         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6463                 allow_remaining = true;
6464         }
6465
6466         if (allow_remaining) {
6467                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_PingTrafficSentNotify);
6468         } else {
6469                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_PingTrafficSentNotify);
6470         }
6471         if (err != NDR_ERR_SUCCESS) {
6472                 PyErr_SetNdrError(err);
6473                 return NULL;
6474         }
6475
6476         Py_RETURN_NONE;
6477 }
6478
6479 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_print(PyObject *py_obj)
6480 {
6481         struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(py_obj);
6482         PyObject *ret;
6483         char *retstr;
6484
6485         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd_PingTrafficSentNotify, "dcerpc_rts_cmd_PingTrafficSentNotify", object);
6486         ret = PyString_FromString(retstr);
6487         talloc_free(retstr);
6488
6489         return ret;
6490 }
6491
6492 static PyMethodDef py_dcerpc_rts_cmd_PingTrafficSentNotify_methods[] = {
6493         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6494         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6495         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
6496         { NULL, NULL, 0, NULL }
6497 };
6498
6499
6500 static PyTypeObject dcerpc_rts_cmd_PingTrafficSentNotify_Type = {
6501         PyObject_HEAD_INIT(NULL) 0,
6502         .tp_name = "dcerpc.rts_cmd_PingTrafficSentNotify",
6503         .tp_getset = py_dcerpc_rts_cmd_PingTrafficSentNotify_getsetters,
6504         .tp_methods = py_dcerpc_rts_cmd_PingTrafficSentNotify_methods,
6505         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6506         .tp_basicsize = sizeof(pytalloc_Object),
6507         .tp_new = py_dcerpc_rts_cmd_PingTrafficSentNotify_new,
6508 };
6509
6510 PyObject *py_import_dcerpc_rts_cmds(TALLOC_CTX *mem_ctx, int level, union dcerpc_rts_cmds *in)
6511 {
6512         PyObject *ret;
6513
6514         switch (level) {
6515                 case 0x0:
6516                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ReceiveWindowSize_Type, mem_ctx, &in->ReceiveWindowSize);
6517                         return ret;
6518
6519                 case 0x1:
6520                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_FlowControlAck_Type, mem_ctx, &in->FlowControlAck);
6521                         return ret;
6522
6523                 case 0x2:
6524                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ConnectionTimeout_Type, mem_ctx, &in->ConnectionTimeout);
6525                         return ret;
6526
6527                 case 0x3:
6528                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Cookie_Type, mem_ctx, &in->Cookie);
6529                         return ret;
6530
6531                 case 0x4:
6532                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ChannelLifetime_Type, mem_ctx, &in->ChannelLifetime);
6533                         return ret;
6534
6535                 case 0x5:
6536                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ClientKeepalive_Type, mem_ctx, &in->ClientKeepalive);
6537                         return ret;
6538
6539                 case 0x6:
6540                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Version_Type, mem_ctx, &in->Version);
6541                         return ret;
6542
6543                 case 0x7:
6544                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Empty_Type, mem_ctx, &in->Empty);
6545                         return ret;
6546
6547                 case 0x8:
6548                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Padding_Type, mem_ctx, &in->Padding);
6549                         return ret;
6550
6551                 case 0x9:
6552                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_NegativeANCE_Type, mem_ctx, &in->NegativeANCE);
6553                         return ret;
6554
6555                 case 0xA:
6556                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ANCE_Type, mem_ctx, &in->ANCE);
6557                         return ret;
6558
6559                 case 0xB:
6560                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ClientAddress_Type, mem_ctx, &in->ClientAddress);
6561                         return ret;
6562
6563                 case 0xC:
6564                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_AssociationGroupId_Type, mem_ctx, &in->AssociationGroupId);
6565                         return ret;
6566
6567                 case 0xD:
6568                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Destination_Type, mem_ctx, &in->Destination);
6569                         return ret;
6570
6571                 case 0xE:
6572                         ret = pytalloc_reference_ex(&dcerpc_rts_cmd_PingTrafficSentNotify_Type, mem_ctx, &in->PingTrafficSentNotify);
6573                         return ret;
6574
6575         }
6576         PyErr_SetString(PyExc_TypeError, "unknown union level");
6577         return NULL;
6578 }
6579
6580 union dcerpc_rts_cmds *py_export_dcerpc_rts_cmds(TALLOC_CTX *mem_ctx, int level, PyObject *in)
6581 {
6582         union dcerpc_rts_cmds *ret = talloc_zero(mem_ctx, union dcerpc_rts_cmds);
6583         switch (level) {
6584                 case 0x0:
6585                         PY_CHECK_TYPE(&dcerpc_rts_cmd_ReceiveWindowSize_Type, in, talloc_free(ret); return NULL;);
6586                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6587                                 PyErr_NoMemory();
6588                                 talloc_free(ret); return NULL;
6589                         }
6590                         ret->ReceiveWindowSize = *(struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(in);
6591                         break;
6592
6593                 case 0x1:
6594                         PY_CHECK_TYPE(&dcerpc_rts_cmd_FlowControlAck_Type, in, talloc_free(ret); return NULL;);
6595                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6596                                 PyErr_NoMemory();
6597                                 talloc_free(ret); return NULL;
6598                         }
6599                         ret->FlowControlAck = *(struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(in);
6600                         break;
6601
6602                 case 0x2:
6603                         PY_CHECK_TYPE(&dcerpc_rts_cmd_ConnectionTimeout_Type, in, talloc_free(ret); return NULL;);
6604                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6605                                 PyErr_NoMemory();
6606                                 talloc_free(ret); return NULL;
6607                         }
6608                         ret->ConnectionTimeout = *(struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(in);
6609                         break;
6610
6611                 case 0x3:
6612                         PY_CHECK_TYPE(&dcerpc_rts_cmd_Cookie_Type, in, talloc_free(ret); return NULL;);
6613                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6614                                 PyErr_NoMemory();
6615                                 talloc_free(ret); return NULL;
6616                         }
6617                         ret->Cookie = *(struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(in);
6618                         break;
6619
6620                 case 0x4:
6621                         PY_CHECK_TYPE(&dcerpc_rts_cmd_ChannelLifetime_Type, in, talloc_free(ret); return NULL;);
6622                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6623                                 PyErr_NoMemory();
6624                                 talloc_free(ret); return NULL;
6625                         }
6626                         ret->ChannelLifetime = *(struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(in);
6627                         break;
6628
6629                 case 0x5:
6630                         PY_CHECK_TYPE(&dcerpc_rts_cmd_ClientKeepalive_Type, in, talloc_free(ret); return NULL;);
6631                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6632                                 PyErr_NoMemory();
6633                                 talloc_free(ret); return NULL;
6634                         }
6635                         ret->ClientKeepalive = *(struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(in);
6636                         break;
6637
6638                 case 0x6:
6639                         PY_CHECK_TYPE(&dcerpc_rts_cmd_Version_Type, in, talloc_free(ret); return NULL;);
6640                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6641                                 PyErr_NoMemory();
6642                                 talloc_free(ret); return NULL;
6643                         }
6644                         ret->Version = *(struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(in);
6645                         break;
6646
6647                 case 0x7:
6648                         PY_CHECK_TYPE(&dcerpc_rts_cmd_Empty_Type, in, talloc_free(ret); return NULL;);
6649                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6650                                 PyErr_NoMemory();
6651                                 talloc_free(ret); return NULL;
6652                         }
6653                         ret->Empty = *(struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(in);
6654                         break;
6655
6656                 case 0x8:
6657                         PY_CHECK_TYPE(&dcerpc_rts_cmd_Padding_Type, in, talloc_free(ret); return NULL;);
6658                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6659                                 PyErr_NoMemory();
6660                                 talloc_free(ret); return NULL;
6661                         }
6662                         ret->Padding = *(struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(in);
6663                         break;
6664
6665                 case 0x9:
6666                         PY_CHECK_TYPE(&dcerpc_rts_cmd_NegativeANCE_Type, in, talloc_free(ret); return NULL;);
6667                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6668                                 PyErr_NoMemory();
6669                                 talloc_free(ret); return NULL;
6670                         }
6671                         ret->NegativeANCE = *(struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(in);
6672                         break;
6673
6674                 case 0xA:
6675                         PY_CHECK_TYPE(&dcerpc_rts_cmd_ANCE_Type, in, talloc_free(ret); return NULL;);
6676                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6677                                 PyErr_NoMemory();
6678                                 talloc_free(ret); return NULL;
6679                         }
6680                         ret->ANCE = *(struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(in);
6681                         break;
6682
6683                 case 0xB:
6684                         PY_CHECK_TYPE(&dcerpc_rts_cmd_ClientAddress_Type, in, talloc_free(ret); return NULL;);
6685                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6686                                 PyErr_NoMemory();
6687                                 talloc_free(ret); return NULL;
6688                         }
6689                         ret->ClientAddress = *(struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(in);
6690                         break;
6691
6692                 case 0xC:
6693                         PY_CHECK_TYPE(&dcerpc_rts_cmd_AssociationGroupId_Type, in, talloc_free(ret); return NULL;);
6694                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6695                                 PyErr_NoMemory();
6696                                 talloc_free(ret); return NULL;
6697                         }
6698                         ret->AssociationGroupId = *(struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(in);
6699                         break;
6700
6701                 case 0xD:
6702                         PY_CHECK_TYPE(&dcerpc_rts_cmd_Destination_Type, in, talloc_free(ret); return NULL;);
6703                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6704                                 PyErr_NoMemory();
6705                                 talloc_free(ret); return NULL;
6706                         }
6707                         ret->Destination = *(struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(in);
6708                         break;
6709
6710                 case 0xE:
6711                         PY_CHECK_TYPE(&dcerpc_rts_cmd_PingTrafficSentNotify_Type, in, talloc_free(ret); return NULL;);
6712                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6713                                 PyErr_NoMemory();
6714                                 talloc_free(ret); return NULL;
6715                         }
6716                         ret->PingTrafficSentNotify = *(struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(in);
6717                         break;
6718
6719                 default:
6720                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
6721                         talloc_free(ret);
6722                         ret = NULL;
6723         }
6724
6725         return ret;
6726 }
6727
6728
6729 static PyObject *py_dcerpc_rts_cmd_get_CommandType(PyObject *obj, void *closure)
6730 {
6731         struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(obj);
6732         PyObject *py_CommandType;
6733         py_CommandType = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->CommandType);
6734         return py_CommandType;
6735 }
6736
6737 static int py_dcerpc_rts_cmd_set_CommandType(PyObject *py_obj, PyObject *value, void *closure)
6738 {
6739         struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
6740         {
6741                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->CommandType));
6742                 if (PyLong_Check(value)) {
6743                         unsigned long long test_var;
6744                         test_var = PyLong_AsUnsignedLongLong(value);
6745                         if (PyErr_Occurred() != NULL) {
6746                                 return -1;
6747                         }
6748                         if (test_var > uint_max) {
6749                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6750                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6751                                 return -1;
6752                         }
6753                         object->CommandType = test_var;
6754                 } else if (PyInt_Check(value)) {
6755                         long test_var;
6756                         test_var = PyInt_AsLong(value);
6757                         if (test_var < 0 || test_var > uint_max) {
6758                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6759                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6760                                 return -1;
6761                         }
6762                         object->CommandType = test_var;
6763                 } else {
6764                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6765                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6766                         return -1;
6767                 }
6768         }
6769         return 0;
6770 }
6771
6772 static PyObject *py_dcerpc_rts_cmd_get_Command(PyObject *obj, void *closure)
6773 {
6774         struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(obj);
6775         PyObject *py_Command;
6776         py_Command = py_import_dcerpc_rts_cmds(pytalloc_get_mem_ctx(obj), object->CommandType, &object->Command);
6777         if (py_Command == NULL) {
6778                 return NULL;
6779         }
6780         return py_Command;
6781 }
6782
6783 static int py_dcerpc_rts_cmd_set_Command(PyObject *py_obj, PyObject *value, void *closure)
6784 {
6785         struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
6786         {
6787                 union dcerpc_rts_cmds *Command_switch_0;
6788                 Command_switch_0 = py_export_dcerpc_rts_cmds(pytalloc_get_mem_ctx(py_obj), object->CommandType, value);
6789                 if (Command_switch_0 == NULL) {
6790                         return -1;
6791                 }
6792                 object->Command = *Command_switch_0;
6793         }
6794         return 0;
6795 }
6796
6797 static PyGetSetDef py_dcerpc_rts_cmd_getsetters[] = {
6798         { discard_const_p(char, "CommandType"), py_dcerpc_rts_cmd_get_CommandType, py_dcerpc_rts_cmd_set_CommandType },
6799         { discard_const_p(char, "Command"), py_dcerpc_rts_cmd_get_Command, py_dcerpc_rts_cmd_set_Command },
6800         { NULL }
6801 };
6802
6803 static PyObject *py_dcerpc_rts_cmd_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6804 {
6805         return pytalloc_new(struct dcerpc_rts_cmd, type);
6806 }
6807
6808 static PyObject *py_dcerpc_rts_cmd_ndr_pack(PyObject *py_obj)
6809 {
6810         struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
6811         DATA_BLOB blob;
6812         enum ndr_err_code err;
6813         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd);
6814         if (err != NDR_ERR_SUCCESS) {
6815                 PyErr_SetNdrError(err);
6816                 return NULL;
6817         }
6818
6819         return PyString_FromStringAndSize((char *)blob.data, blob.length);
6820 }
6821
6822 static PyObject *py_dcerpc_rts_cmd_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6823 {
6824         struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
6825         DATA_BLOB blob;
6826         int blob_length = 0;
6827         enum ndr_err_code err;
6828         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6829         PyObject *allow_remaining_obj = NULL;
6830         bool allow_remaining = false;
6831
6832         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
6833                 discard_const_p(char *, kwnames),
6834                 &blob.data, &blob_length,
6835                 &allow_remaining_obj)) {
6836                 return NULL;
6837         }
6838         blob.length = blob_length;
6839
6840         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6841                 allow_remaining = true;
6842         }
6843
6844         if (allow_remaining) {
6845                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd);
6846         } else {
6847                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd);
6848         }
6849         if (err != NDR_ERR_SUCCESS) {
6850                 PyErr_SetNdrError(err);
6851                 return NULL;
6852         }
6853
6854         Py_RETURN_NONE;
6855 }
6856
6857 static PyObject *py_dcerpc_rts_cmd_ndr_print(PyObject *py_obj)
6858 {
6859         struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
6860         PyObject *ret;
6861         char *retstr;
6862
6863         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd, "dcerpc_rts_cmd", object);
6864         ret = PyString_FromString(retstr);
6865         talloc_free(retstr);
6866
6867         return ret;
6868 }
6869
6870 static PyMethodDef py_dcerpc_rts_cmd_methods[] = {
6871         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6872         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_cmd_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6873         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
6874         { NULL, NULL, 0, NULL }
6875 };
6876
6877
6878 static PyTypeObject dcerpc_rts_cmd_Type = {
6879         PyObject_HEAD_INIT(NULL) 0,
6880         .tp_name = "dcerpc.rts_cmd",
6881         .tp_getset = py_dcerpc_rts_cmd_getsetters,
6882         .tp_methods = py_dcerpc_rts_cmd_methods,
6883         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6884         .tp_basicsize = sizeof(pytalloc_Object),
6885         .tp_new = py_dcerpc_rts_cmd_new,
6886 };
6887
6888
6889 static PyObject *py_dcerpc_rts_get_Flags(PyObject *obj, void *closure)
6890 {
6891         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(obj);
6892         PyObject *py_Flags;
6893         py_Flags = PyInt_FromLong((uint16_t)object->Flags);
6894         return py_Flags;
6895 }
6896
6897 static int py_dcerpc_rts_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
6898 {
6899         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
6900         {
6901                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Flags));
6902                 if (PyLong_Check(value)) {
6903                         unsigned long long test_var;
6904                         test_var = PyLong_AsUnsignedLongLong(value);
6905                         if (PyErr_Occurred() != NULL) {
6906                                 return -1;
6907                         }
6908                         if (test_var > uint_max) {
6909                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6910                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6911                                 return -1;
6912                         }
6913                         object->Flags = test_var;
6914                 } else if (PyInt_Check(value)) {
6915                         long test_var;
6916                         test_var = PyInt_AsLong(value);
6917                         if (test_var < 0 || test_var > uint_max) {
6918                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6919                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6920                                 return -1;
6921                         }
6922                         object->Flags = test_var;
6923                 } else {
6924                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6925                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6926                         return -1;
6927                 }
6928         }
6929         return 0;
6930 }
6931
6932 static PyObject *py_dcerpc_rts_get_NumberOfCommands(PyObject *obj, void *closure)
6933 {
6934         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(obj);
6935         PyObject *py_NumberOfCommands;
6936         py_NumberOfCommands = PyInt_FromLong((uint16_t)object->NumberOfCommands);
6937         return py_NumberOfCommands;
6938 }
6939
6940 static int py_dcerpc_rts_set_NumberOfCommands(PyObject *py_obj, PyObject *value, void *closure)
6941 {
6942         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
6943         {
6944                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->NumberOfCommands));
6945                 if (PyLong_Check(value)) {
6946                         unsigned long long test_var;
6947                         test_var = PyLong_AsUnsignedLongLong(value);
6948                         if (PyErr_Occurred() != NULL) {
6949                                 return -1;
6950                         }
6951                         if (test_var > uint_max) {
6952                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
6953                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6954                                 return -1;
6955                         }
6956                         object->NumberOfCommands = test_var;
6957                 } else if (PyInt_Check(value)) {
6958                         long test_var;
6959                         test_var = PyInt_AsLong(value);
6960                         if (test_var < 0 || test_var > uint_max) {
6961                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
6962                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
6963                                 return -1;
6964                         }
6965                         object->NumberOfCommands = test_var;
6966                 } else {
6967                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6968                           PyInt_Type.tp_name, PyLong_Type.tp_name);
6969                         return -1;
6970                 }
6971         }
6972         return 0;
6973 }
6974
6975 static PyObject *py_dcerpc_rts_get_Commands(PyObject *obj, void *closure)
6976 {
6977         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(obj);
6978         PyObject *py_Commands;
6979         py_Commands = PyList_New(object->NumberOfCommands);
6980         if (py_Commands == NULL) {
6981                 return NULL;
6982         }
6983         {
6984                 int Commands_cntr_0;
6985                 for (Commands_cntr_0 = 0; Commands_cntr_0 < (object->NumberOfCommands); Commands_cntr_0++) {
6986                         PyObject *py_Commands_0;
6987                         py_Commands_0 = pytalloc_reference_ex(&dcerpc_rts_cmd_Type, object->Commands, &object->Commands[Commands_cntr_0]);
6988                         PyList_SetItem(py_Commands, Commands_cntr_0, py_Commands_0);
6989                 }
6990         }
6991         return py_Commands;
6992 }
6993
6994 static int py_dcerpc_rts_set_Commands(PyObject *py_obj, PyObject *value, void *closure)
6995 {
6996         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
6997         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6998         {
6999                 int Commands_cntr_0;
7000                 object->Commands = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->Commands, PyList_GET_SIZE(value));
7001                 if (!object->Commands) { return -1;; }
7002                 talloc_set_name_const(object->Commands, "ARRAY: object->Commands");
7003                 for (Commands_cntr_0 = 0; Commands_cntr_0 < PyList_GET_SIZE(value); Commands_cntr_0++) {
7004                         PY_CHECK_TYPE(&dcerpc_rts_cmd_Type, PyList_GET_ITEM(value, Commands_cntr_0), return -1;);
7005                         if (talloc_reference(object->Commands, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, Commands_cntr_0))) == NULL) {
7006                                 PyErr_NoMemory();
7007                                 return -1;
7008                         }
7009                         object->Commands[Commands_cntr_0] = *(struct dcerpc_rts_cmd *)pytalloc_get_ptr(PyList_GET_ITEM(value, Commands_cntr_0));
7010                 }
7011         }
7012         return 0;
7013 }
7014
7015 static PyGetSetDef py_dcerpc_rts_getsetters[] = {
7016         { discard_const_p(char, "Flags"), py_dcerpc_rts_get_Flags, py_dcerpc_rts_set_Flags },
7017         { discard_const_p(char, "NumberOfCommands"), py_dcerpc_rts_get_NumberOfCommands, py_dcerpc_rts_set_NumberOfCommands },
7018         { discard_const_p(char, "Commands"), py_dcerpc_rts_get_Commands, py_dcerpc_rts_set_Commands },
7019         { NULL }
7020 };
7021
7022 static PyObject *py_dcerpc_rts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7023 {
7024         return pytalloc_new(struct dcerpc_rts, type);
7025 }
7026
7027 static PyObject *py_dcerpc_rts_ndr_pack(PyObject *py_obj)
7028 {
7029         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
7030         DATA_BLOB blob;
7031         enum ndr_err_code err;
7032         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts);
7033         if (err != NDR_ERR_SUCCESS) {
7034                 PyErr_SetNdrError(err);
7035                 return NULL;
7036         }
7037
7038         return PyString_FromStringAndSize((char *)blob.data, blob.length);
7039 }
7040
7041 static PyObject *py_dcerpc_rts_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7042 {
7043         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
7044         DATA_BLOB blob;
7045         int blob_length = 0;
7046         enum ndr_err_code err;
7047         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7048         PyObject *allow_remaining_obj = NULL;
7049         bool allow_remaining = false;
7050
7051         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
7052                 discard_const_p(char *, kwnames),
7053                 &blob.data, &blob_length,
7054                 &allow_remaining_obj)) {
7055                 return NULL;
7056         }
7057         blob.length = blob_length;
7058
7059         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7060                 allow_remaining = true;
7061         }
7062
7063         if (allow_remaining) {
7064                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts);
7065         } else {
7066                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts);
7067         }
7068         if (err != NDR_ERR_SUCCESS) {
7069                 PyErr_SetNdrError(err);
7070                 return NULL;
7071         }
7072
7073         Py_RETURN_NONE;
7074 }
7075
7076 static PyObject *py_dcerpc_rts_ndr_print(PyObject *py_obj)
7077 {
7078         struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
7079         PyObject *ret;
7080         char *retstr;
7081
7082         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts, "dcerpc_rts", object);
7083         ret = PyString_FromString(retstr);
7084         talloc_free(retstr);
7085
7086         return ret;
7087 }
7088
7089 static PyMethodDef py_dcerpc_rts_methods[] = {
7090         { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7091         { "__ndr_unpack__", (PyCFunction)py_dcerpc_rts_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7092         { "__ndr_print__", (PyCFunction)py_dcerpc_rts_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
7093         { NULL, NULL, 0, NULL }
7094 };
7095
7096
7097 static PyTypeObject dcerpc_rts_Type = {
7098         PyObject_HEAD_INIT(NULL) 0,
7099         .tp_name = "dcerpc.rts",
7100         .tp_getset = py_dcerpc_rts_getsetters,
7101         .tp_methods = py_dcerpc_rts_methods,
7102         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7103         .tp_basicsize = sizeof(pytalloc_Object),
7104         .tp_new = py_dcerpc_rts_new,
7105 };
7106
7107 PyObject *py_import_dcerpc_payload(TALLOC_CTX *mem_ctx, int level, union dcerpc_payload *in)
7108 {
7109         PyObject *ret;
7110
7111         switch (level) {
7112                 case DCERPC_PKT_REQUEST:
7113                         ret = pytalloc_reference_ex(&dcerpc_request_Type, mem_ctx, &in->request);
7114                         return ret;
7115
7116                 case DCERPC_PKT_PING:
7117                         ret = pytalloc_reference_ex(&dcerpc_ping_Type, mem_ctx, &in->ping);
7118                         return ret;
7119
7120                 case DCERPC_PKT_RESPONSE:
7121                         ret = pytalloc_reference_ex(&dcerpc_response_Type, mem_ctx, &in->response);
7122                         return ret;
7123
7124                 case DCERPC_PKT_FAULT:
7125                         ret = pytalloc_reference_ex(&dcerpc_fault_Type, mem_ctx, &in->fault);
7126                         return ret;
7127
7128                 case DCERPC_PKT_WORKING:
7129                         ret = pytalloc_reference_ex(&dcerpc_working_Type, mem_ctx, &in->working);
7130                         return ret;
7131
7132                 case DCERPC_PKT_NOCALL:
7133                         ret = pytalloc_reference_ex(&dcerpc_fack_Type, mem_ctx, &in->nocall);
7134                         return ret;
7135
7136                 case DCERPC_PKT_REJECT:
7137                         ret = pytalloc_reference_ex(&dcerpc_fault_Type, mem_ctx, &in->reject);
7138                         return ret;
7139
7140                 case DCERPC_PKT_ACK:
7141                         ret = pytalloc_reference_ex(&dcerpc_ack_Type, mem_ctx, &in->ack);
7142                         return ret;
7143
7144                 case DCERPC_PKT_CL_CANCEL:
7145                         ret = pytalloc_reference_ex(&dcerpc_cl_cancel_Type, mem_ctx, &in->cl_cancel);
7146                         return ret;
7147
7148                 case DCERPC_PKT_FACK:
7149                         ret = pytalloc_reference_ex(&dcerpc_fack_Type, mem_ctx, &in->fack);
7150                         return ret;
7151
7152                 case DCERPC_PKT_CANCEL_ACK:
7153                         ret = pytalloc_reference_ex(&dcerpc_cancel_ack_Type, mem_ctx, &in->cancel_ack);
7154                         return ret;
7155
7156                 case DCERPC_PKT_BIND:
7157                         ret = pytalloc_reference_ex(&dcerpc_bind_Type, mem_ctx, &in->bind);
7158                         return ret;
7159
7160                 case DCERPC_PKT_BIND_ACK:
7161                         ret = pytalloc_reference_ex(&dcerpc_bind_ack_Type, mem_ctx, &in->bind_ack);
7162                         return ret;
7163
7164                 case DCERPC_PKT_BIND_NAK:
7165                         ret = pytalloc_reference_ex(&dcerpc_bind_nak_Type, mem_ctx, &in->bind_nak);
7166                         return ret;
7167
7168                 case DCERPC_PKT_ALTER:
7169                         ret = pytalloc_reference_ex(&dcerpc_bind_Type, mem_ctx, &in->alter);
7170                         return ret;
7171
7172                 case DCERPC_PKT_ALTER_RESP:
7173                         ret = pytalloc_reference_ex(&dcerpc_bind_ack_Type, mem_ctx, &in->alter_resp);
7174                         return ret;
7175
7176                 case DCERPC_PKT_SHUTDOWN:
7177                         ret = pytalloc_reference_ex(&dcerpc_shutdown_Type, mem_ctx, &in->shutdown);
7178                         return ret;
7179
7180                 case DCERPC_PKT_CO_CANCEL:
7181                         ret = pytalloc_reference_ex(&dcerpc_co_cancel_Type, mem_ctx, &in->co_cancel);
7182                         return ret;
7183
7184                 case DCERPC_PKT_ORPHANED:
7185                         ret = pytalloc_reference_ex(&dcerpc_orphaned_Type, mem_ctx, &in->orphaned);
7186                         return ret;
7187
7188                 case DCERPC_PKT_AUTH3:
7189                         ret = pytalloc_reference_ex(&dcerpc_auth3_Type, mem_ctx, &in->auth3);
7190                         return ret;
7191
7192                 case DCERPC_PKT_RTS:
7193                         ret = pytalloc_reference_ex(&dcerpc_rts_Type, mem_ctx, &in->rts);
7194                         return ret;
7195
7196         }
7197         PyErr_SetString(PyExc_TypeError, "unknown union level");
7198         return NULL;
7199 }
7200
7201 union dcerpc_payload *py_export_dcerpc_payload(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7202 {
7203         union dcerpc_payload *ret = talloc_zero(mem_ctx, union dcerpc_payload);
7204         switch (level) {
7205                 case DCERPC_PKT_REQUEST:
7206                         PY_CHECK_TYPE(&dcerpc_request_Type, in, talloc_free(ret); return NULL;);
7207                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7208                                 PyErr_NoMemory();
7209                                 talloc_free(ret); return NULL;
7210                         }
7211                         ret->request = *(struct dcerpc_request *)pytalloc_get_ptr(in);
7212                         break;
7213
7214                 case DCERPC_PKT_PING:
7215                         PY_CHECK_TYPE(&dcerpc_ping_Type, in, talloc_free(ret); return NULL;);
7216                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7217                                 PyErr_NoMemory();
7218                                 talloc_free(ret); return NULL;
7219                         }
7220                         ret->ping = *(struct dcerpc_ping *)pytalloc_get_ptr(in);
7221                         break;
7222
7223                 case DCERPC_PKT_RESPONSE:
7224                         PY_CHECK_TYPE(&dcerpc_response_Type, in, talloc_free(ret); return NULL;);
7225                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7226                                 PyErr_NoMemory();
7227                                 talloc_free(ret); return NULL;
7228                         }
7229                         ret->response = *(struct dcerpc_response *)pytalloc_get_ptr(in);
7230                         break;
7231
7232                 case DCERPC_PKT_FAULT:
7233                         PY_CHECK_TYPE(&dcerpc_fault_Type, in, talloc_free(ret); return NULL;);
7234                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7235                                 PyErr_NoMemory();
7236                                 talloc_free(ret); return NULL;
7237                         }
7238                         ret->fault = *(struct dcerpc_fault *)pytalloc_get_ptr(in);
7239                         break;
7240
7241                 case DCERPC_PKT_WORKING:
7242                         PY_CHECK_TYPE(&dcerpc_working_Type, in, talloc_free(ret); return NULL;);
7243                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7244                                 PyErr_NoMemory();
7245                                 talloc_free(ret); return NULL;
7246                         }
7247                         ret->working = *(struct dcerpc_working *)pytalloc_get_ptr(in);
7248                         break;
7249
7250                 case DCERPC_PKT_NOCALL:
7251                         PY_CHECK_TYPE(&dcerpc_fack_Type, in, talloc_free(ret); return NULL;);
7252                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7253                                 PyErr_NoMemory();
7254                                 talloc_free(ret); return NULL;
7255                         }
7256                         ret->nocall = *(struct dcerpc_fack *)pytalloc_get_ptr(in);
7257                         break;
7258
7259                 case DCERPC_PKT_REJECT:
7260                         PY_CHECK_TYPE(&dcerpc_fault_Type, in, talloc_free(ret); return NULL;);
7261                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7262                                 PyErr_NoMemory();
7263                                 talloc_free(ret); return NULL;
7264                         }
7265                         ret->reject = *(struct dcerpc_fault *)pytalloc_get_ptr(in);
7266                         break;
7267
7268                 case DCERPC_PKT_ACK:
7269                         PY_CHECK_TYPE(&dcerpc_ack_Type, in, talloc_free(ret); return NULL;);
7270                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7271                                 PyErr_NoMemory();
7272                                 talloc_free(ret); return NULL;
7273                         }
7274                         ret->ack = *(struct dcerpc_ack *)pytalloc_get_ptr(in);
7275                         break;
7276
7277                 case DCERPC_PKT_CL_CANCEL:
7278                         PY_CHECK_TYPE(&dcerpc_cl_cancel_Type, in, talloc_free(ret); return NULL;);
7279                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7280                                 PyErr_NoMemory();
7281                                 talloc_free(ret); return NULL;
7282                         }
7283                         ret->cl_cancel = *(struct dcerpc_cl_cancel *)pytalloc_get_ptr(in);
7284                         break;
7285
7286                 case DCERPC_PKT_FACK:
7287                         PY_CHECK_TYPE(&dcerpc_fack_Type, in, talloc_free(ret); return NULL;);
7288                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7289                                 PyErr_NoMemory();
7290                                 talloc_free(ret); return NULL;
7291                         }
7292                         ret->fack = *(struct dcerpc_fack *)pytalloc_get_ptr(in);
7293                         break;
7294
7295                 case DCERPC_PKT_CANCEL_ACK:
7296                         PY_CHECK_TYPE(&dcerpc_cancel_ack_Type, in, talloc_free(ret); return NULL;);
7297                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7298                                 PyErr_NoMemory();
7299                                 talloc_free(ret); return NULL;
7300                         }
7301                         ret->cancel_ack = *(struct dcerpc_cancel_ack *)pytalloc_get_ptr(in);
7302                         break;
7303
7304                 case DCERPC_PKT_BIND:
7305                         PY_CHECK_TYPE(&dcerpc_bind_Type, in, talloc_free(ret); return NULL;);
7306                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7307                                 PyErr_NoMemory();
7308                                 talloc_free(ret); return NULL;
7309                         }
7310                         ret->bind = *(struct dcerpc_bind *)pytalloc_get_ptr(in);
7311                         break;
7312
7313                 case DCERPC_PKT_BIND_ACK:
7314                         PY_CHECK_TYPE(&dcerpc_bind_ack_Type, in, talloc_free(ret); return NULL;);
7315                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7316                                 PyErr_NoMemory();
7317                                 talloc_free(ret); return NULL;
7318                         }
7319                         ret->bind_ack = *(struct dcerpc_bind_ack *)pytalloc_get_ptr(in);
7320                         break;
7321
7322                 case DCERPC_PKT_BIND_NAK:
7323                         PY_CHECK_TYPE(&dcerpc_bind_nak_Type, in, talloc_free(ret); return NULL;);
7324                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7325                                 PyErr_NoMemory();
7326                                 talloc_free(ret); return NULL;
7327                         }
7328                         ret->bind_nak = *(struct dcerpc_bind_nak *)pytalloc_get_ptr(in);
7329                         break;
7330
7331                 case DCERPC_PKT_ALTER:
7332                         PY_CHECK_TYPE(&dcerpc_bind_Type, in, talloc_free(ret); return NULL;);
7333                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7334                                 PyErr_NoMemory();
7335                                 talloc_free(ret); return NULL;
7336                         }
7337                         ret->alter = *(struct dcerpc_bind *)pytalloc_get_ptr(in);
7338                         break;
7339
7340                 case DCERPC_PKT_ALTER_RESP:
7341                         PY_CHECK_TYPE(&dcerpc_bind_ack_Type, in, talloc_free(ret); return NULL;);
7342                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7343                                 PyErr_NoMemory();
7344                                 talloc_free(ret); return NULL;
7345                         }
7346                         ret->alter_resp = *(struct dcerpc_bind_ack *)pytalloc_get_ptr(in);
7347                         break;
7348
7349                 case DCERPC_PKT_SHUTDOWN:
7350                         PY_CHECK_TYPE(&dcerpc_shutdown_Type, in, talloc_free(ret); return NULL;);
7351                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7352                                 PyErr_NoMemory();
7353                                 talloc_free(ret); return NULL;
7354                         }
7355                         ret->shutdown = *(struct dcerpc_shutdown *)pytalloc_get_ptr(in);
7356                         break;
7357
7358                 case DCERPC_PKT_CO_CANCEL:
7359                         PY_CHECK_TYPE(&dcerpc_co_cancel_Type, in, talloc_free(ret); return NULL;);
7360                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7361                                 PyErr_NoMemory();
7362                                 talloc_free(ret); return NULL;
7363                         }
7364                         ret->co_cancel = *(struct dcerpc_co_cancel *)pytalloc_get_ptr(in);
7365                         break;
7366
7367                 case DCERPC_PKT_ORPHANED:
7368                         PY_CHECK_TYPE(&dcerpc_orphaned_Type, in, talloc_free(ret); return NULL;);
7369                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7370                                 PyErr_NoMemory();
7371                                 talloc_free(ret); return NULL;
7372                         }
7373                         ret->orphaned = *(struct dcerpc_orphaned *)pytalloc_get_ptr(in);
7374                         break;
7375
7376                 case DCERPC_PKT_AUTH3:
7377                         PY_CHECK_TYPE(&dcerpc_auth3_Type, in, talloc_free(ret); return NULL;);
7378                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7379                                 PyErr_NoMemory();
7380                                 talloc_free(ret); return NULL;
7381                         }
7382                         ret->auth3 = *(struct dcerpc_auth3 *)pytalloc_get_ptr(in);
7383                         break;
7384
7385                 case DCERPC_PKT_RTS:
7386                         PY_CHECK_TYPE(&dcerpc_rts_Type, in, talloc_free(ret); return NULL;);
7387                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7388                                 PyErr_NoMemory();
7389                                 talloc_free(ret); return NULL;
7390                         }
7391                         ret->rts = *(struct dcerpc_rts *)pytalloc_get_ptr(in);
7392                         break;
7393
7394                 default:
7395                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
7396                         talloc_free(ret);
7397                         ret = NULL;
7398         }
7399
7400         return ret;
7401 }
7402
7403
7404 static PyObject *py_ncacn_packet_get_rpc_vers(PyObject *obj, void *closure)
7405 {
7406         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7407         PyObject *py_rpc_vers;
7408         py_rpc_vers = PyInt_FromLong((uint16_t)object->rpc_vers);
7409         return py_rpc_vers;
7410 }
7411
7412 static int py_ncacn_packet_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
7413 {
7414         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7415         {
7416                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers));
7417                 if (PyLong_Check(value)) {
7418                         unsigned long long test_var;
7419                         test_var = PyLong_AsUnsignedLongLong(value);
7420                         if (PyErr_Occurred() != NULL) {
7421                                 return -1;
7422                         }
7423                         if (test_var > uint_max) {
7424                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7425                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7426                                 return -1;
7427                         }
7428                         object->rpc_vers = test_var;
7429                 } else if (PyInt_Check(value)) {
7430                         long test_var;
7431                         test_var = PyInt_AsLong(value);
7432                         if (test_var < 0 || test_var > uint_max) {
7433                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7434                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7435                                 return -1;
7436                         }
7437                         object->rpc_vers = test_var;
7438                 } else {
7439                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7440                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7441                         return -1;
7442                 }
7443         }
7444         return 0;
7445 }
7446
7447 static PyObject *py_ncacn_packet_get_rpc_vers_minor(PyObject *obj, void *closure)
7448 {
7449         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7450         PyObject *py_rpc_vers_minor;
7451         py_rpc_vers_minor = PyInt_FromLong((uint16_t)object->rpc_vers_minor);
7452         return py_rpc_vers_minor;
7453 }
7454
7455 static int py_ncacn_packet_set_rpc_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
7456 {
7457         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7458         {
7459                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers_minor));
7460                 if (PyLong_Check(value)) {
7461                         unsigned long long test_var;
7462                         test_var = PyLong_AsUnsignedLongLong(value);
7463                         if (PyErr_Occurred() != NULL) {
7464                                 return -1;
7465                         }
7466                         if (test_var > uint_max) {
7467                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7468                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7469                                 return -1;
7470                         }
7471                         object->rpc_vers_minor = test_var;
7472                 } else if (PyInt_Check(value)) {
7473                         long test_var;
7474                         test_var = PyInt_AsLong(value);
7475                         if (test_var < 0 || test_var > uint_max) {
7476                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7477                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7478                                 return -1;
7479                         }
7480                         object->rpc_vers_minor = test_var;
7481                 } else {
7482                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7483                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7484                         return -1;
7485                 }
7486         }
7487         return 0;
7488 }
7489
7490 static PyObject *py_ncacn_packet_get_ptype(PyObject *obj, void *closure)
7491 {
7492         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7493         PyObject *py_ptype;
7494         py_ptype = PyInt_FromLong((uint16_t)object->ptype);
7495         return py_ptype;
7496 }
7497
7498 static int py_ncacn_packet_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
7499 {
7500         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7501         {
7502                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ptype));
7503                 if (PyLong_Check(value)) {
7504                         unsigned long long test_var;
7505                         test_var = PyLong_AsUnsignedLongLong(value);
7506                         if (PyErr_Occurred() != NULL) {
7507                                 return -1;
7508                         }
7509                         if (test_var > uint_max) {
7510                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7511                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7512                                 return -1;
7513                         }
7514                         object->ptype = test_var;
7515                 } else if (PyInt_Check(value)) {
7516                         long test_var;
7517                         test_var = PyInt_AsLong(value);
7518                         if (test_var < 0 || test_var > uint_max) {
7519                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7520                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7521                                 return -1;
7522                         }
7523                         object->ptype = test_var;
7524                 } else {
7525                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7526                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7527                         return -1;
7528                 }
7529         }
7530         return 0;
7531 }
7532
7533 static PyObject *py_ncacn_packet_get_pfc_flags(PyObject *obj, void *closure)
7534 {
7535         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7536         PyObject *py_pfc_flags;
7537         py_pfc_flags = PyInt_FromLong((uint16_t)object->pfc_flags);
7538         return py_pfc_flags;
7539 }
7540
7541 static int py_ncacn_packet_set_pfc_flags(PyObject *py_obj, PyObject *value, void *closure)
7542 {
7543         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7544         {
7545                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pfc_flags));
7546                 if (PyLong_Check(value)) {
7547                         unsigned long long test_var;
7548                         test_var = PyLong_AsUnsignedLongLong(value);
7549                         if (PyErr_Occurred() != NULL) {
7550                                 return -1;
7551                         }
7552                         if (test_var > uint_max) {
7553                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7554                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7555                                 return -1;
7556                         }
7557                         object->pfc_flags = test_var;
7558                 } else if (PyInt_Check(value)) {
7559                         long test_var;
7560                         test_var = PyInt_AsLong(value);
7561                         if (test_var < 0 || test_var > uint_max) {
7562                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7563                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7564                                 return -1;
7565                         }
7566                         object->pfc_flags = test_var;
7567                 } else {
7568                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7569                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7570                         return -1;
7571                 }
7572         }
7573         return 0;
7574 }
7575
7576 static PyObject *py_ncacn_packet_get_drep(PyObject *obj, void *closure)
7577 {
7578         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7579         PyObject *py_drep;
7580         py_drep = PyList_New(4);
7581         if (py_drep == NULL) {
7582                 return NULL;
7583         }
7584         {
7585                 int drep_cntr_0;
7586                 for (drep_cntr_0 = 0; drep_cntr_0 < (4); drep_cntr_0++) {
7587                         PyObject *py_drep_0;
7588                         py_drep_0 = PyInt_FromLong((uint16_t)object->drep[drep_cntr_0]);
7589                         PyList_SetItem(py_drep, drep_cntr_0, py_drep_0);
7590                 }
7591         }
7592         return py_drep;
7593 }
7594
7595 static int py_ncacn_packet_set_drep(PyObject *py_obj, PyObject *value, void *closure)
7596 {
7597         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7598         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7599         {
7600                 int drep_cntr_0;
7601                 if (ARRAY_SIZE(object->drep) != PyList_GET_SIZE(value)) {
7602                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->drep),  PyList_GET_SIZE(value));
7603                         return -1;
7604                 }
7605                 for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
7606                         {
7607                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->drep[drep_cntr_0]));
7608                                 if (PyLong_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
7609                                         unsigned long long test_var;
7610                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, drep_cntr_0));
7611                                         if (PyErr_Occurred() != NULL) {
7612                                                 return -1;
7613                                         }
7614                                         if (test_var > uint_max) {
7615                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7616                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7617                                                 return -1;
7618                                         }
7619                                         object->drep[drep_cntr_0] = test_var;
7620                                 } else if (PyInt_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
7621                                         long test_var;
7622                                         test_var = PyInt_AsLong(PyList_GET_ITEM(value, drep_cntr_0));
7623                                         if (test_var < 0 || test_var > uint_max) {
7624                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7625                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7626                                                 return -1;
7627                                         }
7628                                         object->drep[drep_cntr_0] = test_var;
7629                                 } else {
7630                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7631                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7632                                         return -1;
7633                                 }
7634                         }
7635                 }
7636         }
7637         return 0;
7638 }
7639
7640 static PyObject *py_ncacn_packet_get_frag_length(PyObject *obj, void *closure)
7641 {
7642         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7643         PyObject *py_frag_length;
7644         py_frag_length = PyInt_FromLong((uint16_t)object->frag_length);
7645         return py_frag_length;
7646 }
7647
7648 static int py_ncacn_packet_set_frag_length(PyObject *py_obj, PyObject *value, void *closure)
7649 {
7650         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7651         {
7652                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->frag_length));
7653                 if (PyLong_Check(value)) {
7654                         unsigned long long test_var;
7655                         test_var = PyLong_AsUnsignedLongLong(value);
7656                         if (PyErr_Occurred() != NULL) {
7657                                 return -1;
7658                         }
7659                         if (test_var > uint_max) {
7660                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7661                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7662                                 return -1;
7663                         }
7664                         object->frag_length = test_var;
7665                 } else if (PyInt_Check(value)) {
7666                         long test_var;
7667                         test_var = PyInt_AsLong(value);
7668                         if (test_var < 0 || test_var > uint_max) {
7669                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7670                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7671                                 return -1;
7672                         }
7673                         object->frag_length = test_var;
7674                 } else {
7675                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7676                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7677                         return -1;
7678                 }
7679         }
7680         return 0;
7681 }
7682
7683 static PyObject *py_ncacn_packet_get_auth_length(PyObject *obj, void *closure)
7684 {
7685         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7686         PyObject *py_auth_length;
7687         py_auth_length = PyInt_FromLong((uint16_t)object->auth_length);
7688         return py_auth_length;
7689 }
7690
7691 static int py_ncacn_packet_set_auth_length(PyObject *py_obj, PyObject *value, void *closure)
7692 {
7693         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7694         {
7695                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_length));
7696                 if (PyLong_Check(value)) {
7697                         unsigned long long test_var;
7698                         test_var = PyLong_AsUnsignedLongLong(value);
7699                         if (PyErr_Occurred() != NULL) {
7700                                 return -1;
7701                         }
7702                         if (test_var > uint_max) {
7703                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7704                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7705                                 return -1;
7706                         }
7707                         object->auth_length = test_var;
7708                 } else if (PyInt_Check(value)) {
7709                         long test_var;
7710                         test_var = PyInt_AsLong(value);
7711                         if (test_var < 0 || test_var > uint_max) {
7712                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7713                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7714                                 return -1;
7715                         }
7716                         object->auth_length = test_var;
7717                 } else {
7718                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7719                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7720                         return -1;
7721                 }
7722         }
7723         return 0;
7724 }
7725
7726 static PyObject *py_ncacn_packet_get_call_id(PyObject *obj, void *closure)
7727 {
7728         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7729         PyObject *py_call_id;
7730         py_call_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->call_id);
7731         return py_call_id;
7732 }
7733
7734 static int py_ncacn_packet_set_call_id(PyObject *py_obj, PyObject *value, void *closure)
7735 {
7736         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7737         {
7738                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->call_id));
7739                 if (PyLong_Check(value)) {
7740                         unsigned long long test_var;
7741                         test_var = PyLong_AsUnsignedLongLong(value);
7742                         if (PyErr_Occurred() != NULL) {
7743                                 return -1;
7744                         }
7745                         if (test_var > uint_max) {
7746                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7747                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7748                                 return -1;
7749                         }
7750                         object->call_id = test_var;
7751                 } else if (PyInt_Check(value)) {
7752                         long test_var;
7753                         test_var = PyInt_AsLong(value);
7754                         if (test_var < 0 || test_var > uint_max) {
7755                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7756                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7757                                 return -1;
7758                         }
7759                         object->call_id = test_var;
7760                 } else {
7761                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7762                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7763                         return -1;
7764                 }
7765         }
7766         return 0;
7767 }
7768
7769 static PyObject *py_ncacn_packet_get_u(PyObject *obj, void *closure)
7770 {
7771         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7772         PyObject *py_u;
7773         py_u = py_import_dcerpc_payload(pytalloc_get_mem_ctx(obj), object->ptype, &object->u);
7774         if (py_u == NULL) {
7775                 return NULL;
7776         }
7777         return py_u;
7778 }
7779
7780 static int py_ncacn_packet_set_u(PyObject *py_obj, PyObject *value, void *closure)
7781 {
7782         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7783         {
7784                 union dcerpc_payload *u_switch_0;
7785                 u_switch_0 = py_export_dcerpc_payload(pytalloc_get_mem_ctx(py_obj), object->ptype, value);
7786                 if (u_switch_0 == NULL) {
7787                         return -1;
7788                 }
7789                 object->u = *u_switch_0;
7790         }
7791         return 0;
7792 }
7793
7794 static PyGetSetDef py_ncacn_packet_getsetters[] = {
7795         { discard_const_p(char, "rpc_vers"), py_ncacn_packet_get_rpc_vers, py_ncacn_packet_set_rpc_vers },
7796         { discard_const_p(char, "rpc_vers_minor"), py_ncacn_packet_get_rpc_vers_minor, py_ncacn_packet_set_rpc_vers_minor },
7797         { discard_const_p(char, "ptype"), py_ncacn_packet_get_ptype, py_ncacn_packet_set_ptype },
7798         { discard_const_p(char, "pfc_flags"), py_ncacn_packet_get_pfc_flags, py_ncacn_packet_set_pfc_flags },
7799         { discard_const_p(char, "drep"), py_ncacn_packet_get_drep, py_ncacn_packet_set_drep },
7800         { discard_const_p(char, "frag_length"), py_ncacn_packet_get_frag_length, py_ncacn_packet_set_frag_length },
7801         { discard_const_p(char, "auth_length"), py_ncacn_packet_get_auth_length, py_ncacn_packet_set_auth_length },
7802         { discard_const_p(char, "call_id"), py_ncacn_packet_get_call_id, py_ncacn_packet_set_call_id },
7803         { discard_const_p(char, "u"), py_ncacn_packet_get_u, py_ncacn_packet_set_u },
7804         { NULL }
7805 };
7806
7807 static PyObject *py_ncacn_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7808 {
7809         return pytalloc_new(struct ncacn_packet, type);
7810 }
7811
7812 static PyObject *py_ncacn_packet_ndr_pack(PyObject *py_obj)
7813 {
7814         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7815         DATA_BLOB blob;
7816         enum ndr_err_code err;
7817         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ncacn_packet);
7818         if (err != NDR_ERR_SUCCESS) {
7819                 PyErr_SetNdrError(err);
7820                 return NULL;
7821         }
7822
7823         return PyString_FromStringAndSize((char *)blob.data, blob.length);
7824 }
7825
7826 static PyObject *py_ncacn_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7827 {
7828         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7829         DATA_BLOB blob;
7830         int blob_length = 0;
7831         enum ndr_err_code err;
7832         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7833         PyObject *allow_remaining_obj = NULL;
7834         bool allow_remaining = false;
7835
7836         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
7837                 discard_const_p(char *, kwnames),
7838                 &blob.data, &blob_length,
7839                 &allow_remaining_obj)) {
7840                 return NULL;
7841         }
7842         blob.length = blob_length;
7843
7844         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7845                 allow_remaining = true;
7846         }
7847
7848         if (allow_remaining) {
7849                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncacn_packet);
7850         } else {
7851                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncacn_packet);
7852         }
7853         if (err != NDR_ERR_SUCCESS) {
7854                 PyErr_SetNdrError(err);
7855                 return NULL;
7856         }
7857
7858         Py_RETURN_NONE;
7859 }
7860
7861 static PyObject *py_ncacn_packet_ndr_print(PyObject *py_obj)
7862 {
7863         struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7864         PyObject *ret;
7865         char *retstr;
7866
7867         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ncacn_packet, "ncacn_packet", object);
7868         ret = PyString_FromString(retstr);
7869         talloc_free(retstr);
7870
7871         return ret;
7872 }
7873
7874 static PyMethodDef py_ncacn_packet_methods[] = {
7875         { "__ndr_pack__", (PyCFunction)py_ncacn_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7876         { "__ndr_unpack__", (PyCFunction)py_ncacn_packet_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7877         { "__ndr_print__", (PyCFunction)py_ncacn_packet_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
7878         { NULL, NULL, 0, NULL }
7879 };
7880
7881
7882 static PyTypeObject ncacn_packet_Type = {
7883         PyObject_HEAD_INIT(NULL) 0,
7884         .tp_name = "dcerpc.ncacn_packet",
7885         .tp_getset = py_ncacn_packet_getsetters,
7886         .tp_methods = py_ncacn_packet_methods,
7887         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7888         .tp_basicsize = sizeof(pytalloc_Object),
7889         .tp_new = py_ncacn_packet_new,
7890 };
7891
7892
7893 static PyObject *py_ncadg_packet_get_rpc_vers(PyObject *obj, void *closure)
7894 {
7895         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
7896         PyObject *py_rpc_vers;
7897         py_rpc_vers = PyInt_FromLong((uint16_t)object->rpc_vers);
7898         return py_rpc_vers;
7899 }
7900
7901 static int py_ncadg_packet_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
7902 {
7903         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
7904         {
7905                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers));
7906                 if (PyLong_Check(value)) {
7907                         unsigned long long test_var;
7908                         test_var = PyLong_AsUnsignedLongLong(value);
7909                         if (PyErr_Occurred() != NULL) {
7910                                 return -1;
7911                         }
7912                         if (test_var > uint_max) {
7913                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7914                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7915                                 return -1;
7916                         }
7917                         object->rpc_vers = test_var;
7918                 } else if (PyInt_Check(value)) {
7919                         long test_var;
7920                         test_var = PyInt_AsLong(value);
7921                         if (test_var < 0 || test_var > uint_max) {
7922                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7923                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7924                                 return -1;
7925                         }
7926                         object->rpc_vers = test_var;
7927                 } else {
7928                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7929                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7930                         return -1;
7931                 }
7932         }
7933         return 0;
7934 }
7935
7936 static PyObject *py_ncadg_packet_get_ptype(PyObject *obj, void *closure)
7937 {
7938         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
7939         PyObject *py_ptype;
7940         py_ptype = PyInt_FromLong((uint16_t)object->ptype);
7941         return py_ptype;
7942 }
7943
7944 static int py_ncadg_packet_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
7945 {
7946         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
7947         {
7948                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ptype));
7949                 if (PyLong_Check(value)) {
7950                         unsigned long long test_var;
7951                         test_var = PyLong_AsUnsignedLongLong(value);
7952                         if (PyErr_Occurred() != NULL) {
7953                                 return -1;
7954                         }
7955                         if (test_var > uint_max) {
7956                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
7957                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7958                                 return -1;
7959                         }
7960                         object->ptype = test_var;
7961                 } else if (PyInt_Check(value)) {
7962                         long test_var;
7963                         test_var = PyInt_AsLong(value);
7964                         if (test_var < 0 || test_var > uint_max) {
7965                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
7966                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
7967                                 return -1;
7968                         }
7969                         object->ptype = test_var;
7970                 } else {
7971                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7972                           PyInt_Type.tp_name, PyLong_Type.tp_name);
7973                         return -1;
7974                 }
7975         }
7976         return 0;
7977 }
7978
7979 static PyObject *py_ncadg_packet_get_pfc_flags(PyObject *obj, void *closure)
7980 {
7981         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
7982         PyObject *py_pfc_flags;
7983         py_pfc_flags = PyInt_FromLong((uint16_t)object->pfc_flags);
7984         return py_pfc_flags;
7985 }
7986
7987 static int py_ncadg_packet_set_pfc_flags(PyObject *py_obj, PyObject *value, void *closure)
7988 {
7989         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
7990         {
7991                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pfc_flags));
7992                 if (PyLong_Check(value)) {
7993                         unsigned long long test_var;
7994                         test_var = PyLong_AsUnsignedLongLong(value);
7995                         if (PyErr_Occurred() != NULL) {
7996                                 return -1;
7997                         }
7998                         if (test_var > uint_max) {
7999                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8000                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8001                                 return -1;
8002                         }
8003                         object->pfc_flags = test_var;
8004                 } else if (PyInt_Check(value)) {
8005                         long test_var;
8006                         test_var = PyInt_AsLong(value);
8007                         if (test_var < 0 || test_var > uint_max) {
8008                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8009                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8010                                 return -1;
8011                         }
8012                         object->pfc_flags = test_var;
8013                 } else {
8014                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8015                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8016                         return -1;
8017                 }
8018         }
8019         return 0;
8020 }
8021
8022 static PyObject *py_ncadg_packet_get_ncadg_flags(PyObject *obj, void *closure)
8023 {
8024         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8025         PyObject *py_ncadg_flags;
8026         py_ncadg_flags = PyInt_FromLong((uint16_t)object->ncadg_flags);
8027         return py_ncadg_flags;
8028 }
8029
8030 static int py_ncadg_packet_set_ncadg_flags(PyObject *py_obj, PyObject *value, void *closure)
8031 {
8032         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8033         {
8034                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ncadg_flags));
8035                 if (PyLong_Check(value)) {
8036                         unsigned long long test_var;
8037                         test_var = PyLong_AsUnsignedLongLong(value);
8038                         if (PyErr_Occurred() != NULL) {
8039                                 return -1;
8040                         }
8041                         if (test_var > uint_max) {
8042                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8043                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8044                                 return -1;
8045                         }
8046                         object->ncadg_flags = test_var;
8047                 } else if (PyInt_Check(value)) {
8048                         long test_var;
8049                         test_var = PyInt_AsLong(value);
8050                         if (test_var < 0 || test_var > uint_max) {
8051                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8052                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8053                                 return -1;
8054                         }
8055                         object->ncadg_flags = test_var;
8056                 } else {
8057                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8058                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8059                         return -1;
8060                 }
8061         }
8062         return 0;
8063 }
8064
8065 static PyObject *py_ncadg_packet_get_drep(PyObject *obj, void *closure)
8066 {
8067         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8068         PyObject *py_drep;
8069         py_drep = PyList_New(3);
8070         if (py_drep == NULL) {
8071                 return NULL;
8072         }
8073         {
8074                 int drep_cntr_0;
8075                 for (drep_cntr_0 = 0; drep_cntr_0 < (3); drep_cntr_0++) {
8076                         PyObject *py_drep_0;
8077                         py_drep_0 = PyInt_FromLong((uint16_t)object->drep[drep_cntr_0]);
8078                         PyList_SetItem(py_drep, drep_cntr_0, py_drep_0);
8079                 }
8080         }
8081         return py_drep;
8082 }
8083
8084 static int py_ncadg_packet_set_drep(PyObject *py_obj, PyObject *value, void *closure)
8085 {
8086         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8087         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8088         {
8089                 int drep_cntr_0;
8090                 if (ARRAY_SIZE(object->drep) != PyList_GET_SIZE(value)) {
8091                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->drep),  PyList_GET_SIZE(value));
8092                         return -1;
8093                 }
8094                 for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
8095                         {
8096                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->drep[drep_cntr_0]));
8097                                 if (PyLong_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
8098                                         unsigned long long test_var;
8099                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, drep_cntr_0));
8100                                         if (PyErr_Occurred() != NULL) {
8101                                                 return -1;
8102                                         }
8103                                         if (test_var > uint_max) {
8104                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8105                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8106                                                 return -1;
8107                                         }
8108                                         object->drep[drep_cntr_0] = test_var;
8109                                 } else if (PyInt_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
8110                                         long test_var;
8111                                         test_var = PyInt_AsLong(PyList_GET_ITEM(value, drep_cntr_0));
8112                                         if (test_var < 0 || test_var > uint_max) {
8113                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8114                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8115                                                 return -1;
8116                                         }
8117                                         object->drep[drep_cntr_0] = test_var;
8118                                 } else {
8119                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8120                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8121                                         return -1;
8122                                 }
8123                         }
8124                 }
8125         }
8126         return 0;
8127 }
8128
8129 static PyObject *py_ncadg_packet_get_serial_high(PyObject *obj, void *closure)
8130 {
8131         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8132         PyObject *py_serial_high;
8133         py_serial_high = PyInt_FromLong((uint16_t)object->serial_high);
8134         return py_serial_high;
8135 }
8136
8137 static int py_ncadg_packet_set_serial_high(PyObject *py_obj, PyObject *value, void *closure)
8138 {
8139         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8140         {
8141                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_high));
8142                 if (PyLong_Check(value)) {
8143                         unsigned long long test_var;
8144                         test_var = PyLong_AsUnsignedLongLong(value);
8145                         if (PyErr_Occurred() != NULL) {
8146                                 return -1;
8147                         }
8148                         if (test_var > uint_max) {
8149                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8150                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8151                                 return -1;
8152                         }
8153                         object->serial_high = test_var;
8154                 } else if (PyInt_Check(value)) {
8155                         long test_var;
8156                         test_var = PyInt_AsLong(value);
8157                         if (test_var < 0 || test_var > uint_max) {
8158                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8159                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8160                                 return -1;
8161                         }
8162                         object->serial_high = test_var;
8163                 } else {
8164                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8165                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8166                         return -1;
8167                 }
8168         }
8169         return 0;
8170 }
8171
8172 static PyObject *py_ncadg_packet_get_object(PyObject *obj, void *closure)
8173 {
8174         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8175         PyObject *py_object;
8176         py_object = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->object);
8177         return py_object;
8178 }
8179
8180 static int py_ncadg_packet_set_object(PyObject *py_obj, PyObject *value, void *closure)
8181 {
8182         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8183         PY_CHECK_TYPE(GUID_Type, value, return -1;);
8184         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8185                 PyErr_NoMemory();
8186                 return -1;
8187         }
8188         object->object = *(struct GUID *)pytalloc_get_ptr(value);
8189         return 0;
8190 }
8191
8192 static PyObject *py_ncadg_packet_get_iface(PyObject *obj, void *closure)
8193 {
8194         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8195         PyObject *py_iface;
8196         py_iface = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->iface);
8197         return py_iface;
8198 }
8199
8200 static int py_ncadg_packet_set_iface(PyObject *py_obj, PyObject *value, void *closure)
8201 {
8202         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8203         PY_CHECK_TYPE(GUID_Type, value, return -1;);
8204         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8205                 PyErr_NoMemory();
8206                 return -1;
8207         }
8208         object->iface = *(struct GUID *)pytalloc_get_ptr(value);
8209         return 0;
8210 }
8211
8212 static PyObject *py_ncadg_packet_get_activity(PyObject *obj, void *closure)
8213 {
8214         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8215         PyObject *py_activity;
8216         py_activity = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->activity);
8217         return py_activity;
8218 }
8219
8220 static int py_ncadg_packet_set_activity(PyObject *py_obj, PyObject *value, void *closure)
8221 {
8222         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8223         PY_CHECK_TYPE(GUID_Type, value, return -1;);
8224         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8225                 PyErr_NoMemory();
8226                 return -1;
8227         }
8228         object->activity = *(struct GUID *)pytalloc_get_ptr(value);
8229         return 0;
8230 }
8231
8232 static PyObject *py_ncadg_packet_get_server_boot(PyObject *obj, void *closure)
8233 {
8234         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8235         PyObject *py_server_boot;
8236         py_server_boot = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->server_boot);
8237         return py_server_boot;
8238 }
8239
8240 static int py_ncadg_packet_set_server_boot(PyObject *py_obj, PyObject *value, void *closure)
8241 {
8242         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8243         {
8244                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_boot));
8245                 if (PyLong_Check(value)) {
8246                         unsigned long long test_var;
8247                         test_var = PyLong_AsUnsignedLongLong(value);
8248                         if (PyErr_Occurred() != NULL) {
8249                                 return -1;
8250                         }
8251                         if (test_var > uint_max) {
8252                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8253                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8254                                 return -1;
8255                         }
8256                         object->server_boot = test_var;
8257                 } else if (PyInt_Check(value)) {
8258                         long test_var;
8259                         test_var = PyInt_AsLong(value);
8260                         if (test_var < 0 || test_var > uint_max) {
8261                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8262                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8263                                 return -1;
8264                         }
8265                         object->server_boot = test_var;
8266                 } else {
8267                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8268                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8269                         return -1;
8270                 }
8271         }
8272         return 0;
8273 }
8274
8275 static PyObject *py_ncadg_packet_get_iface_version(PyObject *obj, void *closure)
8276 {
8277         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8278         PyObject *py_iface_version;
8279         py_iface_version = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->iface_version);
8280         return py_iface_version;
8281 }
8282
8283 static int py_ncadg_packet_set_iface_version(PyObject *py_obj, PyObject *value, void *closure)
8284 {
8285         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8286         {
8287                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iface_version));
8288                 if (PyLong_Check(value)) {
8289                         unsigned long long test_var;
8290                         test_var = PyLong_AsUnsignedLongLong(value);
8291                         if (PyErr_Occurred() != NULL) {
8292                                 return -1;
8293                         }
8294                         if (test_var > uint_max) {
8295                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8296                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8297                                 return -1;
8298                         }
8299                         object->iface_version = test_var;
8300                 } else if (PyInt_Check(value)) {
8301                         long test_var;
8302                         test_var = PyInt_AsLong(value);
8303                         if (test_var < 0 || test_var > uint_max) {
8304                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8305                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8306                                 return -1;
8307                         }
8308                         object->iface_version = test_var;
8309                 } else {
8310                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8311                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8312                         return -1;
8313                 }
8314         }
8315         return 0;
8316 }
8317
8318 static PyObject *py_ncadg_packet_get_seq_num(PyObject *obj, void *closure)
8319 {
8320         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8321         PyObject *py_seq_num;
8322         py_seq_num = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->seq_num);
8323         return py_seq_num;
8324 }
8325
8326 static int py_ncadg_packet_set_seq_num(PyObject *py_obj, PyObject *value, void *closure)
8327 {
8328         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8329         {
8330                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->seq_num));
8331                 if (PyLong_Check(value)) {
8332                         unsigned long long test_var;
8333                         test_var = PyLong_AsUnsignedLongLong(value);
8334                         if (PyErr_Occurred() != NULL) {
8335                                 return -1;
8336                         }
8337                         if (test_var > uint_max) {
8338                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8339                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8340                                 return -1;
8341                         }
8342                         object->seq_num = test_var;
8343                 } else if (PyInt_Check(value)) {
8344                         long test_var;
8345                         test_var = PyInt_AsLong(value);
8346                         if (test_var < 0 || test_var > uint_max) {
8347                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8348                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8349                                 return -1;
8350                         }
8351                         object->seq_num = test_var;
8352                 } else {
8353                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8354                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8355                         return -1;
8356                 }
8357         }
8358         return 0;
8359 }
8360
8361 static PyObject *py_ncadg_packet_get_opnum(PyObject *obj, void *closure)
8362 {
8363         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8364         PyObject *py_opnum;
8365         py_opnum = PyInt_FromLong((uint16_t)object->opnum);
8366         return py_opnum;
8367 }
8368
8369 static int py_ncadg_packet_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
8370 {
8371         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8372         {
8373                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opnum));
8374                 if (PyLong_Check(value)) {
8375                         unsigned long long test_var;
8376                         test_var = PyLong_AsUnsignedLongLong(value);
8377                         if (PyErr_Occurred() != NULL) {
8378                                 return -1;
8379                         }
8380                         if (test_var > uint_max) {
8381                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8382                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8383                                 return -1;
8384                         }
8385                         object->opnum = test_var;
8386                 } else if (PyInt_Check(value)) {
8387                         long test_var;
8388                         test_var = PyInt_AsLong(value);
8389                         if (test_var < 0 || test_var > uint_max) {
8390                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8391                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8392                                 return -1;
8393                         }
8394                         object->opnum = test_var;
8395                 } else {
8396                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8397                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8398                         return -1;
8399                 }
8400         }
8401         return 0;
8402 }
8403
8404 static PyObject *py_ncadg_packet_get_ihint(PyObject *obj, void *closure)
8405 {
8406         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8407         PyObject *py_ihint;
8408         py_ihint = PyInt_FromLong((uint16_t)object->ihint);
8409         return py_ihint;
8410 }
8411
8412 static int py_ncadg_packet_set_ihint(PyObject *py_obj, PyObject *value, void *closure)
8413 {
8414         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8415         {
8416                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ihint));
8417                 if (PyLong_Check(value)) {
8418                         unsigned long long test_var;
8419                         test_var = PyLong_AsUnsignedLongLong(value);
8420                         if (PyErr_Occurred() != NULL) {
8421                                 return -1;
8422                         }
8423                         if (test_var > uint_max) {
8424                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8425                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8426                                 return -1;
8427                         }
8428                         object->ihint = test_var;
8429                 } else if (PyInt_Check(value)) {
8430                         long test_var;
8431                         test_var = PyInt_AsLong(value);
8432                         if (test_var < 0 || test_var > uint_max) {
8433                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8434                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8435                                 return -1;
8436                         }
8437                         object->ihint = test_var;
8438                 } else {
8439                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8440                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8441                         return -1;
8442                 }
8443         }
8444         return 0;
8445 }
8446
8447 static PyObject *py_ncadg_packet_get_ahint(PyObject *obj, void *closure)
8448 {
8449         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8450         PyObject *py_ahint;
8451         py_ahint = PyInt_FromLong((uint16_t)object->ahint);
8452         return py_ahint;
8453 }
8454
8455 static int py_ncadg_packet_set_ahint(PyObject *py_obj, PyObject *value, void *closure)
8456 {
8457         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8458         {
8459                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ahint));
8460                 if (PyLong_Check(value)) {
8461                         unsigned long long test_var;
8462                         test_var = PyLong_AsUnsignedLongLong(value);
8463                         if (PyErr_Occurred() != NULL) {
8464                                 return -1;
8465                         }
8466                         if (test_var > uint_max) {
8467                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8468                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8469                                 return -1;
8470                         }
8471                         object->ahint = test_var;
8472                 } else if (PyInt_Check(value)) {
8473                         long test_var;
8474                         test_var = PyInt_AsLong(value);
8475                         if (test_var < 0 || test_var > uint_max) {
8476                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8477                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8478                                 return -1;
8479                         }
8480                         object->ahint = test_var;
8481                 } else {
8482                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8483                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8484                         return -1;
8485                 }
8486         }
8487         return 0;
8488 }
8489
8490 static PyObject *py_ncadg_packet_get_len(PyObject *obj, void *closure)
8491 {
8492         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8493         PyObject *py_len;
8494         py_len = PyInt_FromLong((uint16_t)object->len);
8495         return py_len;
8496 }
8497
8498 static int py_ncadg_packet_set_len(PyObject *py_obj, PyObject *value, void *closure)
8499 {
8500         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8501         {
8502                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
8503                 if (PyLong_Check(value)) {
8504                         unsigned long long test_var;
8505                         test_var = PyLong_AsUnsignedLongLong(value);
8506                         if (PyErr_Occurred() != NULL) {
8507                                 return -1;
8508                         }
8509                         if (test_var > uint_max) {
8510                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8511                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8512                                 return -1;
8513                         }
8514                         object->len = test_var;
8515                 } else if (PyInt_Check(value)) {
8516                         long test_var;
8517                         test_var = PyInt_AsLong(value);
8518                         if (test_var < 0 || test_var > uint_max) {
8519                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8520                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8521                                 return -1;
8522                         }
8523                         object->len = test_var;
8524                 } else {
8525                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8526                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8527                         return -1;
8528                 }
8529         }
8530         return 0;
8531 }
8532
8533 static PyObject *py_ncadg_packet_get_fragnum(PyObject *obj, void *closure)
8534 {
8535         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8536         PyObject *py_fragnum;
8537         py_fragnum = PyInt_FromLong((uint16_t)object->fragnum);
8538         return py_fragnum;
8539 }
8540
8541 static int py_ncadg_packet_set_fragnum(PyObject *py_obj, PyObject *value, void *closure)
8542 {
8543         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8544         {
8545                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fragnum));
8546                 if (PyLong_Check(value)) {
8547                         unsigned long long test_var;
8548                         test_var = PyLong_AsUnsignedLongLong(value);
8549                         if (PyErr_Occurred() != NULL) {
8550                                 return -1;
8551                         }
8552                         if (test_var > uint_max) {
8553                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8554                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8555                                 return -1;
8556                         }
8557                         object->fragnum = test_var;
8558                 } else if (PyInt_Check(value)) {
8559                         long test_var;
8560                         test_var = PyInt_AsLong(value);
8561                         if (test_var < 0 || test_var > uint_max) {
8562                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8563                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8564                                 return -1;
8565                         }
8566                         object->fragnum = test_var;
8567                 } else {
8568                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8569                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8570                         return -1;
8571                 }
8572         }
8573         return 0;
8574 }
8575
8576 static PyObject *py_ncadg_packet_get_auth_proto(PyObject *obj, void *closure)
8577 {
8578         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8579         PyObject *py_auth_proto;
8580         py_auth_proto = PyInt_FromLong((uint16_t)object->auth_proto);
8581         return py_auth_proto;
8582 }
8583
8584 static int py_ncadg_packet_set_auth_proto(PyObject *py_obj, PyObject *value, void *closure)
8585 {
8586         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8587         {
8588                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_proto));
8589                 if (PyLong_Check(value)) {
8590                         unsigned long long test_var;
8591                         test_var = PyLong_AsUnsignedLongLong(value);
8592                         if (PyErr_Occurred() != NULL) {
8593                                 return -1;
8594                         }
8595                         if (test_var > uint_max) {
8596                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8597                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8598                                 return -1;
8599                         }
8600                         object->auth_proto = test_var;
8601                 } else if (PyInt_Check(value)) {
8602                         long test_var;
8603                         test_var = PyInt_AsLong(value);
8604                         if (test_var < 0 || test_var > uint_max) {
8605                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8606                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8607                                 return -1;
8608                         }
8609                         object->auth_proto = test_var;
8610                 } else {
8611                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8612                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8613                         return -1;
8614                 }
8615         }
8616         return 0;
8617 }
8618
8619 static PyObject *py_ncadg_packet_get_serial_low(PyObject *obj, void *closure)
8620 {
8621         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8622         PyObject *py_serial_low;
8623         py_serial_low = PyInt_FromLong((uint16_t)object->serial_low);
8624         return py_serial_low;
8625 }
8626
8627 static int py_ncadg_packet_set_serial_low(PyObject *py_obj, PyObject *value, void *closure)
8628 {
8629         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8630         {
8631                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_low));
8632                 if (PyLong_Check(value)) {
8633                         unsigned long long test_var;
8634                         test_var = PyLong_AsUnsignedLongLong(value);
8635                         if (PyErr_Occurred() != NULL) {
8636                                 return -1;
8637                         }
8638                         if (test_var > uint_max) {
8639                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8640                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8641                                 return -1;
8642                         }
8643                         object->serial_low = test_var;
8644                 } else if (PyInt_Check(value)) {
8645                         long test_var;
8646                         test_var = PyInt_AsLong(value);
8647                         if (test_var < 0 || test_var > uint_max) {
8648                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8649                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8650                                 return -1;
8651                         }
8652                         object->serial_low = test_var;
8653                 } else {
8654                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8655                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8656                         return -1;
8657                 }
8658         }
8659         return 0;
8660 }
8661
8662 static PyObject *py_ncadg_packet_get_u(PyObject *obj, void *closure)
8663 {
8664         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8665         PyObject *py_u;
8666         py_u = py_import_dcerpc_payload(pytalloc_get_mem_ctx(obj), object->ptype, &object->u);
8667         if (py_u == NULL) {
8668                 return NULL;
8669         }
8670         return py_u;
8671 }
8672
8673 static int py_ncadg_packet_set_u(PyObject *py_obj, PyObject *value, void *closure)
8674 {
8675         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8676         {
8677                 union dcerpc_payload *u_switch_0;
8678                 u_switch_0 = py_export_dcerpc_payload(pytalloc_get_mem_ctx(py_obj), object->ptype, value);
8679                 if (u_switch_0 == NULL) {
8680                         return -1;
8681                 }
8682                 object->u = *u_switch_0;
8683         }
8684         return 0;
8685 }
8686
8687 static PyGetSetDef py_ncadg_packet_getsetters[] = {
8688         { discard_const_p(char, "rpc_vers"), py_ncadg_packet_get_rpc_vers, py_ncadg_packet_set_rpc_vers },
8689         { discard_const_p(char, "ptype"), py_ncadg_packet_get_ptype, py_ncadg_packet_set_ptype },
8690         { discard_const_p(char, "pfc_flags"), py_ncadg_packet_get_pfc_flags, py_ncadg_packet_set_pfc_flags },
8691         { discard_const_p(char, "ncadg_flags"), py_ncadg_packet_get_ncadg_flags, py_ncadg_packet_set_ncadg_flags },
8692         { discard_const_p(char, "drep"), py_ncadg_packet_get_drep, py_ncadg_packet_set_drep },
8693         { discard_const_p(char, "serial_high"), py_ncadg_packet_get_serial_high, py_ncadg_packet_set_serial_high },
8694         { discard_const_p(char, "object"), py_ncadg_packet_get_object, py_ncadg_packet_set_object },
8695         { discard_const_p(char, "iface"), py_ncadg_packet_get_iface, py_ncadg_packet_set_iface },
8696         { discard_const_p(char, "activity"), py_ncadg_packet_get_activity, py_ncadg_packet_set_activity },
8697         { discard_const_p(char, "server_boot"), py_ncadg_packet_get_server_boot, py_ncadg_packet_set_server_boot },
8698         { discard_const_p(char, "iface_version"), py_ncadg_packet_get_iface_version, py_ncadg_packet_set_iface_version },
8699         { discard_const_p(char, "seq_num"), py_ncadg_packet_get_seq_num, py_ncadg_packet_set_seq_num },
8700         { discard_const_p(char, "opnum"), py_ncadg_packet_get_opnum, py_ncadg_packet_set_opnum },
8701         { discard_const_p(char, "ihint"), py_ncadg_packet_get_ihint, py_ncadg_packet_set_ihint },
8702         { discard_const_p(char, "ahint"), py_ncadg_packet_get_ahint, py_ncadg_packet_set_ahint },
8703         { discard_const_p(char, "len"), py_ncadg_packet_get_len, py_ncadg_packet_set_len },
8704         { discard_const_p(char, "fragnum"), py_ncadg_packet_get_fragnum, py_ncadg_packet_set_fragnum },
8705         { discard_const_p(char, "auth_proto"), py_ncadg_packet_get_auth_proto, py_ncadg_packet_set_auth_proto },
8706         { discard_const_p(char, "serial_low"), py_ncadg_packet_get_serial_low, py_ncadg_packet_set_serial_low },
8707         { discard_const_p(char, "u"), py_ncadg_packet_get_u, py_ncadg_packet_set_u },
8708         { NULL }
8709 };
8710
8711 static PyObject *py_ncadg_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8712 {
8713         return pytalloc_new(struct ncadg_packet, type);
8714 }
8715
8716 static PyObject *py_ncadg_packet_ndr_pack(PyObject *py_obj)
8717 {
8718         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8719         DATA_BLOB blob;
8720         enum ndr_err_code err;
8721         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ncadg_packet);
8722         if (err != NDR_ERR_SUCCESS) {
8723                 PyErr_SetNdrError(err);
8724                 return NULL;
8725         }
8726
8727         return PyString_FromStringAndSize((char *)blob.data, blob.length);
8728 }
8729
8730 static PyObject *py_ncadg_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8731 {
8732         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8733         DATA_BLOB blob;
8734         int blob_length = 0;
8735         enum ndr_err_code err;
8736         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8737         PyObject *allow_remaining_obj = NULL;
8738         bool allow_remaining = false;
8739
8740         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
8741                 discard_const_p(char *, kwnames),
8742                 &blob.data, &blob_length,
8743                 &allow_remaining_obj)) {
8744                 return NULL;
8745         }
8746         blob.length = blob_length;
8747
8748         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8749                 allow_remaining = true;
8750         }
8751
8752         if (allow_remaining) {
8753                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncadg_packet);
8754         } else {
8755                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncadg_packet);
8756         }
8757         if (err != NDR_ERR_SUCCESS) {
8758                 PyErr_SetNdrError(err);
8759                 return NULL;
8760         }
8761
8762         Py_RETURN_NONE;
8763 }
8764
8765 static PyObject *py_ncadg_packet_ndr_print(PyObject *py_obj)
8766 {
8767         struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8768         PyObject *ret;
8769         char *retstr;
8770
8771         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ncadg_packet, "ncadg_packet", object);
8772         ret = PyString_FromString(retstr);
8773         talloc_free(retstr);
8774
8775         return ret;
8776 }
8777
8778 static PyMethodDef py_ncadg_packet_methods[] = {
8779         { "__ndr_pack__", (PyCFunction)py_ncadg_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8780         { "__ndr_unpack__", (PyCFunction)py_ncadg_packet_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
8781         { "__ndr_print__", (PyCFunction)py_ncadg_packet_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
8782         { NULL, NULL, 0, NULL }
8783 };
8784
8785
8786 static PyTypeObject ncadg_packet_Type = {
8787         PyObject_HEAD_INIT(NULL) 0,
8788         .tp_name = "dcerpc.ncadg_packet",
8789         .tp_getset = py_ncadg_packet_getsetters,
8790         .tp_methods = py_ncadg_packet_methods,
8791         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8792         .tp_basicsize = sizeof(pytalloc_Object),
8793         .tp_new = py_ncadg_packet_new,
8794 };
8795
8796
8797 static PyObject *py_dcerpc_sec_vt_pcontext_get_abstract_syntax(PyObject *obj, void *closure)
8798 {
8799         struct dcerpc_sec_vt_pcontext *object = (struct dcerpc_sec_vt_pcontext *)pytalloc_get_ptr(obj);
8800         PyObject *py_abstract_syntax;
8801         py_abstract_syntax = pytalloc_reference_ex(ndr_syntax_id_Type, pytalloc_get_mem_ctx(obj), &object->abstract_syntax);
8802         return py_abstract_syntax;
8803 }
8804
8805 static int py_dcerpc_sec_vt_pcontext_set_abstract_syntax(PyObject *py_obj, PyObject *value, void *closure)
8806 {
8807         struct dcerpc_sec_vt_pcontext *object = (struct dcerpc_sec_vt_pcontext *)pytalloc_get_ptr(py_obj);
8808         PY_CHECK_TYPE(ndr_syntax_id_Type, value, return -1;);
8809         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8810                 PyErr_NoMemory();
8811                 return -1;
8812         }
8813         object->abstract_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
8814         return 0;
8815 }
8816
8817 static PyObject *py_dcerpc_sec_vt_pcontext_get_transfer_syntax(PyObject *obj, void *closure)
8818 {
8819         struct dcerpc_sec_vt_pcontext *object = (struct dcerpc_sec_vt_pcontext *)pytalloc_get_ptr(obj);
8820         PyObject *py_transfer_syntax;
8821         py_transfer_syntax = pytalloc_reference_ex(ndr_syntax_id_Type, pytalloc_get_mem_ctx(obj), &object->transfer_syntax);
8822         return py_transfer_syntax;
8823 }
8824
8825 static int py_dcerpc_sec_vt_pcontext_set_transfer_syntax(PyObject *py_obj, PyObject *value, void *closure)
8826 {
8827         struct dcerpc_sec_vt_pcontext *object = (struct dcerpc_sec_vt_pcontext *)pytalloc_get_ptr(py_obj);
8828         PY_CHECK_TYPE(ndr_syntax_id_Type, value, return -1;);
8829         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8830                 PyErr_NoMemory();
8831                 return -1;
8832         }
8833         object->transfer_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
8834         return 0;
8835 }
8836
8837 static PyGetSetDef py_dcerpc_sec_vt_pcontext_getsetters[] = {
8838         { discard_const_p(char, "abstract_syntax"), py_dcerpc_sec_vt_pcontext_get_abstract_syntax, py_dcerpc_sec_vt_pcontext_set_abstract_syntax },
8839         { discard_const_p(char, "transfer_syntax"), py_dcerpc_sec_vt_pcontext_get_transfer_syntax, py_dcerpc_sec_vt_pcontext_set_transfer_syntax },
8840         { NULL }
8841 };
8842
8843 static PyObject *py_dcerpc_sec_vt_pcontext_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8844 {
8845         return pytalloc_new(struct dcerpc_sec_vt_pcontext, type);
8846 }
8847
8848
8849 static PyTypeObject dcerpc_sec_vt_pcontext_Type = {
8850         PyObject_HEAD_INIT(NULL) 0,
8851         .tp_name = "dcerpc.sec_vt_pcontext",
8852         .tp_getset = py_dcerpc_sec_vt_pcontext_getsetters,
8853         .tp_methods = NULL,
8854         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8855         .tp_basicsize = sizeof(pytalloc_Object),
8856         .tp_new = py_dcerpc_sec_vt_pcontext_new,
8857 };
8858
8859
8860 static PyObject *py_dcerpc_sec_vt_header2_get_ptype(PyObject *obj, void *closure)
8861 {
8862         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
8863         PyObject *py_ptype;
8864         py_ptype = PyInt_FromLong((uint16_t)object->ptype);
8865         return py_ptype;
8866 }
8867
8868 static int py_dcerpc_sec_vt_header2_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
8869 {
8870         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
8871         {
8872                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ptype));
8873                 if (PyLong_Check(value)) {
8874                         unsigned long long test_var;
8875                         test_var = PyLong_AsUnsignedLongLong(value);
8876                         if (PyErr_Occurred() != NULL) {
8877                                 return -1;
8878                         }
8879                         if (test_var > uint_max) {
8880                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8881                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8882                                 return -1;
8883                         }
8884                         object->ptype = test_var;
8885                 } else if (PyInt_Check(value)) {
8886                         long test_var;
8887                         test_var = PyInt_AsLong(value);
8888                         if (test_var < 0 || test_var > uint_max) {
8889                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8890                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8891                                 return -1;
8892                         }
8893                         object->ptype = test_var;
8894                 } else {
8895                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8896                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8897                         return -1;
8898                 }
8899         }
8900         return 0;
8901 }
8902
8903 static PyObject *py_dcerpc_sec_vt_header2_get_reserved1(PyObject *obj, void *closure)
8904 {
8905         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
8906         PyObject *py_reserved1;
8907         py_reserved1 = PyInt_FromLong((uint16_t)object->reserved1);
8908         return py_reserved1;
8909 }
8910
8911 static int py_dcerpc_sec_vt_header2_set_reserved1(PyObject *py_obj, PyObject *value, void *closure)
8912 {
8913         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
8914         {
8915                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved1));
8916                 if (PyLong_Check(value)) {
8917                         unsigned long long test_var;
8918                         test_var = PyLong_AsUnsignedLongLong(value);
8919                         if (PyErr_Occurred() != NULL) {
8920                                 return -1;
8921                         }
8922                         if (test_var > uint_max) {
8923                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8924                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8925                                 return -1;
8926                         }
8927                         object->reserved1 = test_var;
8928                 } else if (PyInt_Check(value)) {
8929                         long test_var;
8930                         test_var = PyInt_AsLong(value);
8931                         if (test_var < 0 || test_var > uint_max) {
8932                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8933                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8934                                 return -1;
8935                         }
8936                         object->reserved1 = test_var;
8937                 } else {
8938                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8939                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8940                         return -1;
8941                 }
8942         }
8943         return 0;
8944 }
8945
8946 static PyObject *py_dcerpc_sec_vt_header2_get_reserved2(PyObject *obj, void *closure)
8947 {
8948         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
8949         PyObject *py_reserved2;
8950         py_reserved2 = PyInt_FromLong((uint16_t)object->reserved2);
8951         return py_reserved2;
8952 }
8953
8954 static int py_dcerpc_sec_vt_header2_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
8955 {
8956         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
8957         {
8958                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved2));
8959                 if (PyLong_Check(value)) {
8960                         unsigned long long test_var;
8961                         test_var = PyLong_AsUnsignedLongLong(value);
8962                         if (PyErr_Occurred() != NULL) {
8963                                 return -1;
8964                         }
8965                         if (test_var > uint_max) {
8966                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
8967                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8968                                 return -1;
8969                         }
8970                         object->reserved2 = test_var;
8971                 } else if (PyInt_Check(value)) {
8972                         long test_var;
8973                         test_var = PyInt_AsLong(value);
8974                         if (test_var < 0 || test_var > uint_max) {
8975                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
8976                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
8977                                 return -1;
8978                         }
8979                         object->reserved2 = test_var;
8980                 } else {
8981                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8982                           PyInt_Type.tp_name, PyLong_Type.tp_name);
8983                         return -1;
8984                 }
8985         }
8986         return 0;
8987 }
8988
8989 static PyObject *py_dcerpc_sec_vt_header2_get_drep(PyObject *obj, void *closure)
8990 {
8991         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
8992         PyObject *py_drep;
8993         py_drep = PyList_New(4);
8994         if (py_drep == NULL) {
8995                 return NULL;
8996         }
8997         {
8998                 int drep_cntr_0;
8999                 for (drep_cntr_0 = 0; drep_cntr_0 < (4); drep_cntr_0++) {
9000                         PyObject *py_drep_0;
9001                         py_drep_0 = PyInt_FromLong((uint16_t)object->drep[drep_cntr_0]);
9002                         PyList_SetItem(py_drep, drep_cntr_0, py_drep_0);
9003                 }
9004         }
9005         return py_drep;
9006 }
9007
9008 static int py_dcerpc_sec_vt_header2_set_drep(PyObject *py_obj, PyObject *value, void *closure)
9009 {
9010         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
9011         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9012         {
9013                 int drep_cntr_0;
9014                 if (ARRAY_SIZE(object->drep) != PyList_GET_SIZE(value)) {
9015                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->drep),  PyList_GET_SIZE(value));
9016                         return -1;
9017                 }
9018                 for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
9019                         {
9020                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->drep[drep_cntr_0]));
9021                                 if (PyLong_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
9022                                         unsigned long long test_var;
9023                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, drep_cntr_0));
9024                                         if (PyErr_Occurred() != NULL) {
9025                                                 return -1;
9026                                         }
9027                                         if (test_var > uint_max) {
9028                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9029                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9030                                                 return -1;
9031                                         }
9032                                         object->drep[drep_cntr_0] = test_var;
9033                                 } else if (PyInt_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
9034                                         long test_var;
9035                                         test_var = PyInt_AsLong(PyList_GET_ITEM(value, drep_cntr_0));
9036                                         if (test_var < 0 || test_var > uint_max) {
9037                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9038                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9039                                                 return -1;
9040                                         }
9041                                         object->drep[drep_cntr_0] = test_var;
9042                                 } else {
9043                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9044                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9045                                         return -1;
9046                                 }
9047                         }
9048                 }
9049         }
9050         return 0;
9051 }
9052
9053 static PyObject *py_dcerpc_sec_vt_header2_get_call_id(PyObject *obj, void *closure)
9054 {
9055         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
9056         PyObject *py_call_id;
9057         py_call_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->call_id);
9058         return py_call_id;
9059 }
9060
9061 static int py_dcerpc_sec_vt_header2_set_call_id(PyObject *py_obj, PyObject *value, void *closure)
9062 {
9063         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
9064         {
9065                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->call_id));
9066                 if (PyLong_Check(value)) {
9067                         unsigned long long test_var;
9068                         test_var = PyLong_AsUnsignedLongLong(value);
9069                         if (PyErr_Occurred() != NULL) {
9070                                 return -1;
9071                         }
9072                         if (test_var > uint_max) {
9073                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9074                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9075                                 return -1;
9076                         }
9077                         object->call_id = test_var;
9078                 } else if (PyInt_Check(value)) {
9079                         long test_var;
9080                         test_var = PyInt_AsLong(value);
9081                         if (test_var < 0 || test_var > uint_max) {
9082                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9083                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9084                                 return -1;
9085                         }
9086                         object->call_id = test_var;
9087                 } else {
9088                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9089                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9090                         return -1;
9091                 }
9092         }
9093         return 0;
9094 }
9095
9096 static PyObject *py_dcerpc_sec_vt_header2_get_context_id(PyObject *obj, void *closure)
9097 {
9098         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
9099         PyObject *py_context_id;
9100         py_context_id = PyInt_FromLong((uint16_t)object->context_id);
9101         return py_context_id;
9102 }
9103
9104 static int py_dcerpc_sec_vt_header2_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
9105 {
9106         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
9107         {
9108                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
9109                 if (PyLong_Check(value)) {
9110                         unsigned long long test_var;
9111                         test_var = PyLong_AsUnsignedLongLong(value);
9112                         if (PyErr_Occurred() != NULL) {
9113                                 return -1;
9114                         }
9115                         if (test_var > uint_max) {
9116                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9117                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9118                                 return -1;
9119                         }
9120                         object->context_id = test_var;
9121                 } else if (PyInt_Check(value)) {
9122                         long test_var;
9123                         test_var = PyInt_AsLong(value);
9124                         if (test_var < 0 || test_var > uint_max) {
9125                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9126                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9127                                 return -1;
9128                         }
9129                         object->context_id = test_var;
9130                 } else {
9131                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9132                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9133                         return -1;
9134                 }
9135         }
9136         return 0;
9137 }
9138
9139 static PyObject *py_dcerpc_sec_vt_header2_get_opnum(PyObject *obj, void *closure)
9140 {
9141         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
9142         PyObject *py_opnum;
9143         py_opnum = PyInt_FromLong((uint16_t)object->opnum);
9144         return py_opnum;
9145 }
9146
9147 static int py_dcerpc_sec_vt_header2_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
9148 {
9149         struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
9150         {
9151                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opnum));
9152                 if (PyLong_Check(value)) {
9153                         unsigned long long test_var;
9154                         test_var = PyLong_AsUnsignedLongLong(value);
9155                         if (PyErr_Occurred() != NULL) {
9156                                 return -1;
9157                         }
9158                         if (test_var > uint_max) {
9159                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9160                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9161                                 return -1;
9162                         }
9163                         object->opnum = test_var;
9164                 } else if (PyInt_Check(value)) {
9165                         long test_var;
9166                         test_var = PyInt_AsLong(value);
9167                         if (test_var < 0 || test_var > uint_max) {
9168                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9169                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9170                                 return -1;
9171                         }
9172                         object->opnum = test_var;
9173                 } else {
9174                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9175                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9176                         return -1;
9177                 }
9178         }
9179         return 0;
9180 }
9181
9182 static PyGetSetDef py_dcerpc_sec_vt_header2_getsetters[] = {
9183         { discard_const_p(char, "ptype"), py_dcerpc_sec_vt_header2_get_ptype, py_dcerpc_sec_vt_header2_set_ptype },
9184         { discard_const_p(char, "reserved1"), py_dcerpc_sec_vt_header2_get_reserved1, py_dcerpc_sec_vt_header2_set_reserved1 },
9185         { discard_const_p(char, "reserved2"), py_dcerpc_sec_vt_header2_get_reserved2, py_dcerpc_sec_vt_header2_set_reserved2 },
9186         { discard_const_p(char, "drep"), py_dcerpc_sec_vt_header2_get_drep, py_dcerpc_sec_vt_header2_set_drep },
9187         { discard_const_p(char, "call_id"), py_dcerpc_sec_vt_header2_get_call_id, py_dcerpc_sec_vt_header2_set_call_id },
9188         { discard_const_p(char, "context_id"), py_dcerpc_sec_vt_header2_get_context_id, py_dcerpc_sec_vt_header2_set_context_id },
9189         { discard_const_p(char, "opnum"), py_dcerpc_sec_vt_header2_get_opnum, py_dcerpc_sec_vt_header2_set_opnum },
9190         { NULL }
9191 };
9192
9193 static PyObject *py_dcerpc_sec_vt_header2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9194 {
9195         return pytalloc_new(struct dcerpc_sec_vt_header2, type);
9196 }
9197
9198
9199 static PyTypeObject dcerpc_sec_vt_header2_Type = {
9200         PyObject_HEAD_INIT(NULL) 0,
9201         .tp_name = "dcerpc.sec_vt_header2",
9202         .tp_getset = py_dcerpc_sec_vt_header2_getsetters,
9203         .tp_methods = NULL,
9204         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9205         .tp_basicsize = sizeof(pytalloc_Object),
9206         .tp_new = py_dcerpc_sec_vt_header2_new,
9207 };
9208
9209 PyObject *py_import_dcerpc_sec_vt_union(TALLOC_CTX *mem_ctx, int level, union dcerpc_sec_vt_union *in)
9210 {
9211         PyObject *ret;
9212
9213         switch (level) {
9214                 case DCERPC_SEC_VT_COMMAND_BITMASK1:
9215                         ret = ndr_PyLong_FromUnsignedLongLong((uint32_t)in->bitmask1);
9216                         return ret;
9217
9218                 case DCERPC_SEC_VT_COMMAND_PCONTEXT:
9219                         ret = pytalloc_reference_ex(&dcerpc_sec_vt_pcontext_Type, mem_ctx, &in->pcontext);
9220                         return ret;
9221
9222                 case DCERPC_SEC_VT_COMMAND_HEADER2:
9223                         ret = pytalloc_reference_ex(&dcerpc_sec_vt_header2_Type, mem_ctx, &in->header2);
9224                         return ret;
9225
9226                 default:
9227                         ret = PyString_FromStringAndSize((char *)(in->_unknown).data, (in->_unknown).length);
9228                         return ret;
9229
9230         }
9231         PyErr_SetString(PyExc_TypeError, "unknown union level");
9232         return NULL;
9233 }
9234
9235 union dcerpc_sec_vt_union *py_export_dcerpc_sec_vt_union(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9236 {
9237         union dcerpc_sec_vt_union *ret = talloc_zero(mem_ctx, union dcerpc_sec_vt_union);
9238         switch (level) {
9239                 case DCERPC_SEC_VT_COMMAND_BITMASK1:
9240                         {
9241                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->bitmask1));
9242                                 if (PyLong_Check(in)) {
9243                                         unsigned long long test_var;
9244                                         test_var = PyLong_AsUnsignedLongLong(in);
9245                                         if (PyErr_Occurred() != NULL) {
9246                                                 talloc_free(ret); return NULL;
9247                                         }
9248                                         if (test_var > uint_max) {
9249                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9250                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9251                                                 talloc_free(ret); return NULL;
9252                                         }
9253                                         ret->bitmask1 = test_var;
9254                                 } else if (PyInt_Check(in)) {
9255                                         long test_var;
9256                                         test_var = PyInt_AsLong(in);
9257                                         if (test_var < 0 || test_var > uint_max) {
9258                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9259                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9260                                                 talloc_free(ret); return NULL;
9261                                         }
9262                                         ret->bitmask1 = test_var;
9263                                 } else {
9264                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9265                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9266                                         talloc_free(ret); return NULL;
9267                                 }
9268                         }
9269                         break;
9270
9271                 case DCERPC_SEC_VT_COMMAND_PCONTEXT:
9272                         PY_CHECK_TYPE(&dcerpc_sec_vt_pcontext_Type, in, talloc_free(ret); return NULL;);
9273                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9274                                 PyErr_NoMemory();
9275                                 talloc_free(ret); return NULL;
9276                         }
9277                         ret->pcontext = *(struct dcerpc_sec_vt_pcontext *)pytalloc_get_ptr(in);
9278                         break;
9279
9280                 case DCERPC_SEC_VT_COMMAND_HEADER2:
9281                         PY_CHECK_TYPE(&dcerpc_sec_vt_header2_Type, in, talloc_free(ret); return NULL;);
9282                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9283                                 PyErr_NoMemory();
9284                                 talloc_free(ret); return NULL;
9285                         }
9286                         ret->header2 = *(struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(in);
9287                         break;
9288
9289                 default:
9290                         ret->_unknown = data_blob_talloc(mem_ctx, PyString_AS_STRING(in), PyString_GET_SIZE(in));
9291                         break;
9292
9293         }
9294
9295         return ret;
9296 }
9297
9298
9299 static PyObject *py_dcerpc_sec_vt_get_command(PyObject *obj, void *closure)
9300 {
9301         struct dcerpc_sec_vt *object = (struct dcerpc_sec_vt *)pytalloc_get_ptr(obj);
9302         PyObject *py_command;
9303         py_command = PyInt_FromLong((uint16_t)object->command);
9304         return py_command;
9305 }
9306
9307 static int py_dcerpc_sec_vt_set_command(PyObject *py_obj, PyObject *value, void *closure)
9308 {
9309         struct dcerpc_sec_vt *object = (struct dcerpc_sec_vt *)pytalloc_get_ptr(py_obj);
9310         {
9311                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
9312                 if (PyLong_Check(value)) {
9313                         unsigned long long test_var;
9314                         test_var = PyLong_AsUnsignedLongLong(value);
9315                         if (PyErr_Occurred() != NULL) {
9316                                 return -1;
9317                         }
9318                         if (test_var > uint_max) {
9319                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9320                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9321                                 return -1;
9322                         }
9323                         object->command = test_var;
9324                 } else if (PyInt_Check(value)) {
9325                         long test_var;
9326                         test_var = PyInt_AsLong(value);
9327                         if (test_var < 0 || test_var > uint_max) {
9328                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9329                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9330                                 return -1;
9331                         }
9332                         object->command = test_var;
9333                 } else {
9334                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9335                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9336                         return -1;
9337                 }
9338         }
9339         return 0;
9340 }
9341
9342 static PyObject *py_dcerpc_sec_vt_get_u(PyObject *obj, void *closure)
9343 {
9344         struct dcerpc_sec_vt *object = (struct dcerpc_sec_vt *)pytalloc_get_ptr(obj);
9345         PyObject *py_u;
9346         py_u = py_import_dcerpc_sec_vt_union(pytalloc_get_mem_ctx(obj), object->command & DCERPC_SEC_VT_COMMAND_ENUM, &object->u);
9347         if (py_u == NULL) {
9348                 return NULL;
9349         }
9350         return py_u;
9351 }
9352
9353 static int py_dcerpc_sec_vt_set_u(PyObject *py_obj, PyObject *value, void *closure)
9354 {
9355         struct dcerpc_sec_vt *object = (struct dcerpc_sec_vt *)pytalloc_get_ptr(py_obj);
9356         {
9357                 union dcerpc_sec_vt_union *u_switch_1;
9358                 u_switch_1 = py_export_dcerpc_sec_vt_union(pytalloc_get_mem_ctx(py_obj), object->command & DCERPC_SEC_VT_COMMAND_ENUM, value);
9359                 if (u_switch_1 == NULL) {
9360                         return -1;
9361                 }
9362                 object->u = *u_switch_1;
9363         }
9364         return 0;
9365 }
9366
9367 static PyGetSetDef py_dcerpc_sec_vt_getsetters[] = {
9368         { discard_const_p(char, "command"), py_dcerpc_sec_vt_get_command, py_dcerpc_sec_vt_set_command },
9369         { discard_const_p(char, "u"), py_dcerpc_sec_vt_get_u, py_dcerpc_sec_vt_set_u },
9370         { NULL }
9371 };
9372
9373 static PyObject *py_dcerpc_sec_vt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9374 {
9375         return pytalloc_new(struct dcerpc_sec_vt, type);
9376 }
9377
9378
9379 static PyTypeObject dcerpc_sec_vt_Type = {
9380         PyObject_HEAD_INIT(NULL) 0,
9381         .tp_name = "dcerpc.sec_vt",
9382         .tp_getset = py_dcerpc_sec_vt_getsetters,
9383         .tp_methods = NULL,
9384         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9385         .tp_basicsize = sizeof(pytalloc_Object),
9386         .tp_new = py_dcerpc_sec_vt_new,
9387 };
9388
9389
9390 static PyObject *py_dcerpc_sec_vt_count_get_count(PyObject *obj, void *closure)
9391 {
9392         struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(obj);
9393         PyObject *py_count;
9394         py_count = PyInt_FromLong((uint16_t)object->count);
9395         return py_count;
9396 }
9397
9398 static int py_dcerpc_sec_vt_count_set_count(PyObject *py_obj, PyObject *value, void *closure)
9399 {
9400         struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(py_obj);
9401         {
9402                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
9403                 if (PyLong_Check(value)) {
9404                         unsigned long long test_var;
9405                         test_var = PyLong_AsUnsignedLongLong(value);
9406                         if (PyErr_Occurred() != NULL) {
9407                                 return -1;
9408                         }
9409                         if (test_var > uint_max) {
9410                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9411                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9412                                 return -1;
9413                         }
9414                         object->count = test_var;
9415                 } else if (PyInt_Check(value)) {
9416                         long test_var;
9417                         test_var = PyInt_AsLong(value);
9418                         if (test_var < 0 || test_var > uint_max) {
9419                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9420                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9421                                 return -1;
9422                         }
9423                         object->count = test_var;
9424                 } else {
9425                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9426                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9427                         return -1;
9428                 }
9429         }
9430         return 0;
9431 }
9432
9433 static PyGetSetDef py_dcerpc_sec_vt_count_getsetters[] = {
9434         { discard_const_p(char, "count"), py_dcerpc_sec_vt_count_get_count, py_dcerpc_sec_vt_count_set_count },
9435         { NULL }
9436 };
9437
9438 static PyObject *py_dcerpc_sec_vt_count_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9439 {
9440         return pytalloc_new(struct dcerpc_sec_vt_count, type);
9441 }
9442
9443 static PyObject *py_dcerpc_sec_vt_count_ndr_pack(PyObject *py_obj)
9444 {
9445         struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(py_obj);
9446         DATA_BLOB blob;
9447         enum ndr_err_code err;
9448         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_sec_vt_count);
9449         if (err != NDR_ERR_SUCCESS) {
9450                 PyErr_SetNdrError(err);
9451                 return NULL;
9452         }
9453
9454         return PyString_FromStringAndSize((char *)blob.data, blob.length);
9455 }
9456
9457 static PyObject *py_dcerpc_sec_vt_count_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9458 {
9459         struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(py_obj);
9460         DATA_BLOB blob;
9461         int blob_length = 0;
9462         enum ndr_err_code err;
9463         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9464         PyObject *allow_remaining_obj = NULL;
9465         bool allow_remaining = false;
9466
9467         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
9468                 discard_const_p(char *, kwnames),
9469                 &blob.data, &blob_length,
9470                 &allow_remaining_obj)) {
9471                 return NULL;
9472         }
9473         blob.length = blob_length;
9474
9475         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9476                 allow_remaining = true;
9477         }
9478
9479         if (allow_remaining) {
9480                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_sec_vt_count);
9481         } else {
9482                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_sec_vt_count);
9483         }
9484         if (err != NDR_ERR_SUCCESS) {
9485                 PyErr_SetNdrError(err);
9486                 return NULL;
9487         }
9488
9489         Py_RETURN_NONE;
9490 }
9491
9492 static PyObject *py_dcerpc_sec_vt_count_ndr_print(PyObject *py_obj)
9493 {
9494         struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(py_obj);
9495         PyObject *ret;
9496         char *retstr;
9497
9498         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_sec_vt_count, "dcerpc_sec_vt_count", object);
9499         ret = PyString_FromString(retstr);
9500         talloc_free(retstr);
9501
9502         return ret;
9503 }
9504
9505 static PyMethodDef py_dcerpc_sec_vt_count_methods[] = {
9506         { "__ndr_pack__", (PyCFunction)py_dcerpc_sec_vt_count_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9507         { "__ndr_unpack__", (PyCFunction)py_dcerpc_sec_vt_count_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
9508         { "__ndr_print__", (PyCFunction)py_dcerpc_sec_vt_count_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
9509         { NULL, NULL, 0, NULL }
9510 };
9511
9512
9513 static PyTypeObject dcerpc_sec_vt_count_Type = {
9514         PyObject_HEAD_INIT(NULL) 0,
9515         .tp_name = "dcerpc.sec_vt_count",
9516         .tp_getset = py_dcerpc_sec_vt_count_getsetters,
9517         .tp_methods = py_dcerpc_sec_vt_count_methods,
9518         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9519         .tp_basicsize = sizeof(pytalloc_Object),
9520         .tp_new = py_dcerpc_sec_vt_count_new,
9521 };
9522
9523
9524 static PyObject *py_dcerpc_sec_verification_trailer_get__pad(PyObject *obj, void *closure)
9525 {
9526         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(obj);
9527         PyObject *py__pad;
9528         py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
9529         return py__pad;
9530 }
9531
9532 static int py_dcerpc_sec_verification_trailer_set__pad(PyObject *py_obj, PyObject *value, void *closure)
9533 {
9534         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
9535         object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
9536         return 0;
9537 }
9538
9539 static PyObject *py_dcerpc_sec_verification_trailer_get_magic(PyObject *obj, void *closure)
9540 {
9541         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(obj);
9542         PyObject *py_magic;
9543         py_magic = PyList_New(8);
9544         if (py_magic == NULL) {
9545                 return NULL;
9546         }
9547         {
9548                 int magic_cntr_0;
9549                 for (magic_cntr_0 = 0; magic_cntr_0 < (8); magic_cntr_0++) {
9550                         PyObject *py_magic_0;
9551                         py_magic_0 = PyInt_FromLong((uint16_t)object->magic[magic_cntr_0]);
9552                         PyList_SetItem(py_magic, magic_cntr_0, py_magic_0);
9553                 }
9554         }
9555         return py_magic;
9556 }
9557
9558 static int py_dcerpc_sec_verification_trailer_set_magic(PyObject *py_obj, PyObject *value, void *closure)
9559 {
9560         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
9561         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9562         {
9563                 int magic_cntr_0;
9564                 if (ARRAY_SIZE(object->magic) != PyList_GET_SIZE(value)) {
9565                         PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->magic),  PyList_GET_SIZE(value));
9566                         return -1;
9567                 }
9568                 for (magic_cntr_0 = 0; magic_cntr_0 < PyList_GET_SIZE(value); magic_cntr_0++) {
9569                         {
9570                                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->magic[magic_cntr_0]));
9571                                 if (PyLong_Check(PyList_GET_ITEM(value, magic_cntr_0))) {
9572                                         unsigned long long test_var;
9573                                         test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, magic_cntr_0));
9574                                         if (PyErr_Occurred() != NULL) {
9575                                                 return -1;
9576                                         }
9577                                         if (test_var > uint_max) {
9578                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
9579                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9580                                                 return -1;
9581                                         }
9582                                         object->magic[magic_cntr_0] = test_var;
9583                                 } else if (PyInt_Check(PyList_GET_ITEM(value, magic_cntr_0))) {
9584                                         long test_var;
9585                                         test_var = PyInt_AsLong(PyList_GET_ITEM(value, magic_cntr_0));
9586                                         if (test_var < 0 || test_var > uint_max) {
9587                                                 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
9588                                                   PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
9589                                                 return -1;
9590                                         }
9591                                         object->magic[magic_cntr_0] = test_var;
9592                                 } else {
9593                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9594                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
9595                                         return -1;
9596                                 }
9597                         }
9598                 }
9599         }
9600         return 0;
9601 }
9602
9603 static PyObject *py_dcerpc_sec_verification_trailer_get_count(PyObject *obj, void *closure)
9604 {
9605         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(obj);
9606         PyObject *py_count;
9607         py_count = pytalloc_reference_ex(&dcerpc_sec_vt_count_Type, pytalloc_get_mem_ctx(obj), &object->count);
9608         return py_count;
9609 }
9610
9611 static int py_dcerpc_sec_verification_trailer_set_count(PyObject *py_obj, PyObject *value, void *closure)
9612 {
9613         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
9614         PY_CHECK_TYPE(&dcerpc_sec_vt_count_Type, value, return -1;);
9615         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9616                 PyErr_NoMemory();
9617                 return -1;
9618         }
9619         object->count = *(struct dcerpc_sec_vt_count *)pytalloc_get_ptr(value);
9620         return 0;
9621 }
9622
9623 static PyObject *py_dcerpc_sec_verification_trailer_get_commands(PyObject *obj, void *closure)
9624 {
9625         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(obj);
9626         PyObject *py_commands;
9627         py_commands = PyList_New(object->count.count);
9628         if (py_commands == NULL) {
9629                 return NULL;
9630         }
9631         {
9632                 int commands_cntr_0;
9633                 for (commands_cntr_0 = 0; commands_cntr_0 < (object->count.count); commands_cntr_0++) {
9634                         PyObject *py_commands_0;
9635                         py_commands_0 = pytalloc_reference_ex(&dcerpc_sec_vt_Type, object->commands, &object->commands[commands_cntr_0]);
9636                         PyList_SetItem(py_commands, commands_cntr_0, py_commands_0);
9637                 }
9638         }
9639         return py_commands;
9640 }
9641
9642 static int py_dcerpc_sec_verification_trailer_set_commands(PyObject *py_obj, PyObject *value, void *closure)
9643 {
9644         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
9645         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9646         {
9647                 int commands_cntr_0;
9648                 object->commands = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->commands, PyList_GET_SIZE(value));
9649                 if (!object->commands) { return -1;; }
9650                 talloc_set_name_const(object->commands, "ARRAY: object->commands");
9651                 for (commands_cntr_0 = 0; commands_cntr_0 < PyList_GET_SIZE(value); commands_cntr_0++) {
9652                         PY_CHECK_TYPE(&dcerpc_sec_vt_Type, PyList_GET_ITEM(value, commands_cntr_0), return -1;);
9653                         if (talloc_reference(object->commands, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, commands_cntr_0))) == NULL) {
9654                                 PyErr_NoMemory();
9655                                 return -1;
9656                         }
9657                         object->commands[commands_cntr_0] = *(struct dcerpc_sec_vt *)pytalloc_get_ptr(PyList_GET_ITEM(value, commands_cntr_0));
9658                 }
9659         }
9660         return 0;
9661 }
9662
9663 static PyGetSetDef py_dcerpc_sec_verification_trailer_getsetters[] = {
9664         { discard_const_p(char, "_pad"), py_dcerpc_sec_verification_trailer_get__pad, py_dcerpc_sec_verification_trailer_set__pad },
9665         { discard_const_p(char, "magic"), py_dcerpc_sec_verification_trailer_get_magic, py_dcerpc_sec_verification_trailer_set_magic },
9666         { discard_const_p(char, "count"), py_dcerpc_sec_verification_trailer_get_count, py_dcerpc_sec_verification_trailer_set_count },
9667         { discard_const_p(char, "commands"), py_dcerpc_sec_verification_trailer_get_commands, py_dcerpc_sec_verification_trailer_set_commands },
9668         { NULL }
9669 };
9670
9671 static PyObject *py_dcerpc_sec_verification_trailer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9672 {
9673         return pytalloc_new(struct dcerpc_sec_verification_trailer, type);
9674 }
9675
9676 static PyObject *py_dcerpc_sec_verification_trailer_ndr_pack(PyObject *py_obj)
9677 {
9678         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
9679         DATA_BLOB blob;
9680         enum ndr_err_code err;
9681         err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dcerpc_sec_verification_trailer);
9682         if (err != NDR_ERR_SUCCESS) {
9683                 PyErr_SetNdrError(err);
9684                 return NULL;
9685         }
9686
9687         return PyString_FromStringAndSize((char *)blob.data, blob.length);
9688 }
9689
9690 static PyObject *py_dcerpc_sec_verification_trailer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9691 {
9692         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
9693         DATA_BLOB blob;
9694         int blob_length = 0;
9695         enum ndr_err_code err;
9696         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9697         PyObject *allow_remaining_obj = NULL;
9698         bool allow_remaining = false;
9699
9700         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
9701                 discard_const_p(char *, kwnames),
9702                 &blob.data, &blob_length,
9703                 &allow_remaining_obj)) {
9704                 return NULL;
9705         }
9706         blob.length = blob_length;
9707
9708         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9709                 allow_remaining = true;
9710         }
9711
9712         if (allow_remaining) {
9713                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_sec_verification_trailer);
9714         } else {
9715                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_sec_verification_trailer);
9716         }
9717         if (err != NDR_ERR_SUCCESS) {
9718                 PyErr_SetNdrError(err);
9719                 return NULL;
9720         }
9721
9722         Py_RETURN_NONE;
9723 }
9724
9725 static PyObject *py_dcerpc_sec_verification_trailer_ndr_print(PyObject *py_obj)
9726 {
9727         struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
9728         PyObject *ret;
9729         char *retstr;
9730
9731         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_sec_verification_trailer, "dcerpc_sec_verification_trailer", object);
9732         ret = PyString_FromString(retstr);
9733         talloc_free(retstr);
9734
9735         return ret;
9736 }
9737
9738 static PyMethodDef py_dcerpc_sec_verification_trailer_methods[] = {
9739         { "__ndr_pack__", (PyCFunction)py_dcerpc_sec_verification_trailer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9740         { "__ndr_unpack__", (PyCFunction)py_dcerpc_sec_verification_trailer_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
9741         { "__ndr_print__", (PyCFunction)py_dcerpc_sec_verification_trailer_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
9742         { NULL, NULL, 0, NULL }
9743 };
9744
9745
9746 static PyTypeObject dcerpc_sec_verification_trailer_Type = {
9747         PyObject_HEAD_INIT(NULL) 0,
9748         .tp_name = "dcerpc.sec_verification_trailer",
9749         .tp_getset = py_dcerpc_sec_verification_trailer_getsetters,
9750         .tp_methods = py_dcerpc_sec_verification_trailer_methods,
9751         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9752         .tp_basicsize = sizeof(pytalloc_Object),
9753         .tp_new = py_dcerpc_sec_verification_trailer_new,
9754 };
9755
9756 static PyMethodDef dcerpc_methods[] = {
9757         { NULL, NULL, 0, NULL }
9758 };
9759
9760 void initdcerpc(void)
9761 {
9762         PyObject *m;
9763         PyObject *dep_samba_dcerpc_misc;
9764         PyObject *dep_talloc;
9765
9766         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
9767         if (dep_samba_dcerpc_misc == NULL)
9768                 return;
9769
9770         dep_talloc = PyImport_ImportModule("talloc");
9771         if (dep_talloc == NULL)
9772                 return;
9773
9774         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
9775         if (ndr_syntax_id_Type == NULL)
9776                 return;
9777
9778         Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
9779         if (Object_Type == NULL)
9780                 return;
9781
9782         GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
9783         if (GUID_Type == NULL)
9784                 return;
9785
9786         dcerpc_ctx_list_Type.tp_base = Object_Type;
9787
9788         dcerpc_bind_Type.tp_base = Object_Type;
9789
9790         dcerpc_empty_Type.tp_base = Object_Type;
9791
9792         dcerpc_request_Type.tp_base = Object_Type;
9793
9794         dcerpc_ack_ctx_Type.tp_base = Object_Type;
9795
9796         dcerpc_bind_ack_Type.tp_base = Object_Type;
9797
9798         dcerpc_bind_nak_version_Type.tp_base = Object_Type;
9799
9800         dcerpc_bind_nak_Type.tp_base = Object_Type;
9801
9802         dcerpc_response_Type.tp_base = Object_Type;
9803
9804         dcerpc_fault_Type.tp_base = Object_Type;
9805
9806         dcerpc_auth_Type.tp_base = Object_Type;
9807
9808         dcerpc_auth3_Type.tp_base = Object_Type;
9809
9810         dcerpc_orphaned_Type.tp_base = Object_Type;
9811
9812         dcerpc_co_cancel_Type.tp_base = Object_Type;
9813
9814         dcerpc_cl_cancel_Type.tp_base = Object_Type;
9815
9816         dcerpc_cancel_ack_Type.tp_base = Object_Type;
9817
9818         dcerpc_fack_Type.tp_base = Object_Type;
9819
9820         dcerpc_ack_Type.tp_base = Object_Type;
9821
9822         dcerpc_ping_Type.tp_base = Object_Type;
9823
9824         dcerpc_shutdown_Type.tp_base = Object_Type;
9825
9826         dcerpc_working_Type.tp_base = Object_Type;
9827
9828         RTSCookie_Type.tp_base = Object_Type;
9829
9830         ClientAddress_Type.tp_base = Object_Type;
9831
9832         FlowControlAcknowledgment_Type.tp_base = Object_Type;
9833
9834         dcerpc_rts_cmd_ReceiveWindowSize_Type.tp_base = Object_Type;
9835
9836         dcerpc_rts_cmd_FlowControlAck_Type.tp_base = Object_Type;
9837
9838         dcerpc_rts_cmd_ConnectionTimeout_Type.tp_base = Object_Type;
9839
9840         dcerpc_rts_cmd_Cookie_Type.tp_base = Object_Type;
9841
9842         dcerpc_rts_cmd_ChannelLifetime_Type.tp_base = Object_Type;
9843
9844         dcerpc_rts_cmd_ClientKeepalive_Type.tp_base = Object_Type;
9845
9846         dcerpc_rts_cmd_Version_Type.tp_base = Object_Type;
9847
9848         dcerpc_rts_cmd_Empty_Type.tp_base = Object_Type;
9849
9850         dcerpc_rts_cmd_Padding_Type.tp_base = Object_Type;
9851
9852         dcerpc_rts_cmd_NegativeANCE_Type.tp_base = Object_Type;
9853
9854         dcerpc_rts_cmd_ANCE_Type.tp_base = Object_Type;
9855
9856         dcerpc_rts_cmd_ClientAddress_Type.tp_base = Object_Type;
9857
9858         dcerpc_rts_cmd_AssociationGroupId_Type.tp_base = Object_Type;
9859
9860         dcerpc_rts_cmd_Destination_Type.tp_base = Object_Type;
9861
9862         dcerpc_rts_cmd_PingTrafficSentNotify_Type.tp_base = Object_Type;
9863
9864         dcerpc_rts_cmd_Type.tp_base = Object_Type;
9865
9866         dcerpc_rts_Type.tp_base = Object_Type;
9867
9868         ncacn_packet_Type.tp_base = Object_Type;
9869
9870         ncadg_packet_Type.tp_base = Object_Type;
9871
9872         dcerpc_sec_vt_pcontext_Type.tp_base = Object_Type;
9873
9874         dcerpc_sec_vt_header2_Type.tp_base = Object_Type;
9875
9876         dcerpc_sec_vt_Type.tp_base = Object_Type;
9877
9878         dcerpc_sec_vt_count_Type.tp_base = Object_Type;
9879
9880         dcerpc_sec_verification_trailer_Type.tp_base = Object_Type;
9881
9882         if (PyType_Ready(&dcerpc_ctx_list_Type) < 0)
9883                 return;
9884         if (PyType_Ready(&dcerpc_bind_Type) < 0)
9885                 return;
9886         if (PyType_Ready(&dcerpc_empty_Type) < 0)
9887                 return;
9888         if (PyType_Ready(&dcerpc_request_Type) < 0)
9889                 return;
9890         if (PyType_Ready(&dcerpc_ack_ctx_Type) < 0)
9891                 return;
9892         if (PyType_Ready(&dcerpc_bind_ack_Type) < 0)
9893                 return;
9894         if (PyType_Ready(&dcerpc_bind_nak_version_Type) < 0)
9895                 return;
9896         if (PyType_Ready(&dcerpc_bind_nak_Type) < 0)
9897                 return;
9898         if (PyType_Ready(&dcerpc_response_Type) < 0)
9899                 return;
9900         if (PyType_Ready(&dcerpc_fault_Type) < 0)
9901                 return;
9902         if (PyType_Ready(&dcerpc_auth_Type) < 0)
9903                 return;
9904         if (PyType_Ready(&dcerpc_auth3_Type) < 0)
9905                 return;
9906         if (PyType_Ready(&dcerpc_orphaned_Type) < 0)
9907                 return;
9908         if (PyType_Ready(&dcerpc_co_cancel_Type) < 0)
9909                 return;
9910         if (PyType_Ready(&dcerpc_cl_cancel_Type) < 0)
9911                 return;
9912         if (PyType_Ready(&dcerpc_cancel_ack_Type) < 0)
9913                 return;
9914         if (PyType_Ready(&dcerpc_fack_Type) < 0)
9915                 return;
9916         if (PyType_Ready(&dcerpc_ack_Type) < 0)
9917                 return;
9918         if (PyType_Ready(&dcerpc_ping_Type) < 0)
9919                 return;
9920         if (PyType_Ready(&dcerpc_shutdown_Type) < 0)
9921                 return;
9922         if (PyType_Ready(&dcerpc_working_Type) < 0)
9923                 return;
9924         if (PyType_Ready(&RTSCookie_Type) < 0)
9925                 return;
9926         if (PyType_Ready(&ClientAddress_Type) < 0)
9927                 return;
9928         if (PyType_Ready(&FlowControlAcknowledgment_Type) < 0)
9929                 return;
9930         if (PyType_Ready(&dcerpc_rts_cmd_ReceiveWindowSize_Type) < 0)
9931                 return;
9932         if (PyType_Ready(&dcerpc_rts_cmd_FlowControlAck_Type) < 0)
9933                 return;
9934         if (PyType_Ready(&dcerpc_rts_cmd_ConnectionTimeout_Type) < 0)
9935                 return;
9936         if (PyType_Ready(&dcerpc_rts_cmd_Cookie_Type) < 0)
9937                 return;
9938         if (PyType_Ready(&dcerpc_rts_cmd_ChannelLifetime_Type) < 0)
9939                 return;
9940         if (PyType_Ready(&dcerpc_rts_cmd_ClientKeepalive_Type) < 0)
9941                 return;
9942         if (PyType_Ready(&dcerpc_rts_cmd_Version_Type) < 0)
9943                 return;
9944         if (PyType_Ready(&dcerpc_rts_cmd_Empty_Type) < 0)
9945                 return;
9946         if (PyType_Ready(&dcerpc_rts_cmd_Padding_Type) < 0)
9947                 return;
9948         if (PyType_Ready(&dcerpc_rts_cmd_NegativeANCE_Type) < 0)
9949                 return;
9950         if (PyType_Ready(&dcerpc_rts_cmd_ANCE_Type) < 0)
9951                 return;
9952         if (PyType_Ready(&dcerpc_rts_cmd_ClientAddress_Type) < 0)
9953                 return;
9954         if (PyType_Ready(&dcerpc_rts_cmd_AssociationGroupId_Type) < 0)
9955                 return;
9956         if (PyType_Ready(&dcerpc_rts_cmd_Destination_Type) < 0)
9957                 return;
9958         if (PyType_Ready(&dcerpc_rts_cmd_PingTrafficSentNotify_Type) < 0)
9959                 return;
9960         if (PyType_Ready(&dcerpc_rts_cmd_Type) < 0)
9961                 return;
9962         if (PyType_Ready(&dcerpc_rts_Type) < 0)
9963                 return;
9964         if (PyType_Ready(&ncacn_packet_Type) < 0)
9965                 return;
9966         if (PyType_Ready(&ncadg_packet_Type) < 0)
9967                 return;
9968         if (PyType_Ready(&dcerpc_sec_vt_pcontext_Type) < 0)
9969                 return;
9970         if (PyType_Ready(&dcerpc_sec_vt_header2_Type) < 0)
9971                 return;
9972         if (PyType_Ready(&dcerpc_sec_vt_Type) < 0)
9973                 return;
9974         if (PyType_Ready(&dcerpc_sec_vt_count_Type) < 0)
9975                 return;
9976         if (PyType_Ready(&dcerpc_sec_verification_trailer_Type) < 0)
9977                 return;
9978 #ifdef PY_CTX_LIST_PATCH
9979         PY_CTX_LIST_PATCH(&dcerpc_ctx_list_Type);
9980 #endif
9981 #ifdef PY_BIND_PATCH
9982         PY_BIND_PATCH(&dcerpc_bind_Type);
9983 #endif
9984 #ifdef PY_EMPTY_PATCH
9985         PY_EMPTY_PATCH(&dcerpc_empty_Type);
9986 #endif
9987 #ifdef PY_REQUEST_PATCH
9988         PY_REQUEST_PATCH(&dcerpc_request_Type);
9989 #endif
9990 #ifdef PY_ACK_CTX_PATCH
9991         PY_ACK_CTX_PATCH(&dcerpc_ack_ctx_Type);
9992 #endif
9993 #ifdef PY_BIND_ACK_PATCH
9994         PY_BIND_ACK_PATCH(&dcerpc_bind_ack_Type);
9995 #endif
9996 #ifdef PY_BIND_NAK_VERSION_PATCH
9997         PY_BIND_NAK_VERSION_PATCH(&dcerpc_bind_nak_version_Type);
9998 #endif
9999 #ifdef PY_BIND_NAK_PATCH
10000         PY_BIND_NAK_PATCH(&dcerpc_bind_nak_Type);
10001 #endif
10002 #ifdef PY_RESPONSE_PATCH
10003         PY_RESPONSE_PATCH(&dcerpc_response_Type);
10004 #endif
10005 #ifdef PY_FAULT_PATCH
10006         PY_FAULT_PATCH(&dcerpc_fault_Type);
10007 #endif
10008 #ifdef PY_AUTH_PATCH
10009         PY_AUTH_PATCH(&dcerpc_auth_Type);
10010 #endif
10011 #ifdef PY_AUTH3_PATCH
10012         PY_AUTH3_PATCH(&dcerpc_auth3_Type);
10013 #endif
10014 #ifdef PY_ORPHANED_PATCH
10015         PY_ORPHANED_PATCH(&dcerpc_orphaned_Type);
10016 #endif
10017 #ifdef PY_CO_CANCEL_PATCH
10018         PY_CO_CANCEL_PATCH(&dcerpc_co_cancel_Type);
10019 #endif
10020 #ifdef PY_CL_CANCEL_PATCH
10021         PY_CL_CANCEL_PATCH(&dcerpc_cl_cancel_Type);
10022 #endif
10023 #ifdef PY_CANCEL_ACK_PATCH
10024         PY_CANCEL_ACK_PATCH(&dcerpc_cancel_ack_Type);
10025 #endif
10026 #ifdef PY_FACK_PATCH
10027         PY_FACK_PATCH(&dcerpc_fack_Type);
10028 #endif
10029 #ifdef PY_ACK_PATCH
10030         PY_ACK_PATCH(&dcerpc_ack_Type);
10031 #endif
10032 #ifdef PY_PING_PATCH
10033         PY_PING_PATCH(&dcerpc_ping_Type);
10034 #endif
10035 #ifdef PY_SHUTDOWN_PATCH
10036         PY_SHUTDOWN_PATCH(&dcerpc_shutdown_Type);
10037 #endif
10038 #ifdef PY_WORKING_PATCH
10039         PY_WORKING_PATCH(&dcerpc_working_Type);
10040 #endif
10041 #ifdef PY_RTSCOOKIE_PATCH
10042         PY_RTSCOOKIE_PATCH(&RTSCookie_Type);
10043 #endif
10044 #ifdef PY_CLIENTADDRESS_PATCH
10045         PY_CLIENTADDRESS_PATCH(&ClientAddress_Type);
10046 #endif
10047 #ifdef PY_FLOWCONTROLACKNOWLEDGMENT_PATCH
10048         PY_FLOWCONTROLACKNOWLEDGMENT_PATCH(&FlowControlAcknowledgment_Type);
10049 #endif
10050 #ifdef PY_RTS_CMD_RECEIVEWINDOWSIZE_PATCH
10051         PY_RTS_CMD_RECEIVEWINDOWSIZE_PATCH(&dcerpc_rts_cmd_ReceiveWindowSize_Type);
10052 #endif
10053 #ifdef PY_RTS_CMD_FLOWCONTROLACK_PATCH
10054         PY_RTS_CMD_FLOWCONTROLACK_PATCH(&dcerpc_rts_cmd_FlowControlAck_Type);
10055 #endif
10056 #ifdef PY_RTS_CMD_CONNECTIONTIMEOUT_PATCH
10057         PY_RTS_CMD_CONNECTIONTIMEOUT_PATCH(&dcerpc_rts_cmd_ConnectionTimeout_Type);
10058 #endif
10059 #ifdef PY_RTS_CMD_COOKIE_PATCH
10060         PY_RTS_CMD_COOKIE_PATCH(&dcerpc_rts_cmd_Cookie_Type);
10061 #endif
10062 #ifdef PY_RTS_CMD_CHANNELLIFETIME_PATCH
10063         PY_RTS_CMD_CHANNELLIFETIME_PATCH(&dcerpc_rts_cmd_ChannelLifetime_Type);
10064 #endif
10065 #ifdef PY_RTS_CMD_CLIENTKEEPALIVE_PATCH
10066         PY_RTS_CMD_CLIENTKEEPALIVE_PATCH(&dcerpc_rts_cmd_ClientKeepalive_Type);
10067 #endif
10068 #ifdef PY_RTS_CMD_VERSION_PATCH
10069         PY_RTS_CMD_VERSION_PATCH(&dcerpc_rts_cmd_Version_Type);
10070 #endif
10071 #ifdef PY_RTS_CMD_EMPTY_PATCH
10072         PY_RTS_CMD_EMPTY_PATCH(&dcerpc_rts_cmd_Empty_Type);
10073 #endif
10074 #ifdef PY_RTS_CMD_PADDING_PATCH
10075         PY_RTS_CMD_PADDING_PATCH(&dcerpc_rts_cmd_Padding_Type);
10076 #endif
10077 #ifdef PY_RTS_CMD_NEGATIVEANCE_PATCH
10078         PY_RTS_CMD_NEGATIVEANCE_PATCH(&dcerpc_rts_cmd_NegativeANCE_Type);
10079 #endif
10080 #ifdef PY_RTS_CMD_ANCE_PATCH
10081         PY_RTS_CMD_ANCE_PATCH(&dcerpc_rts_cmd_ANCE_Type);
10082 #endif
10083 #ifdef PY_RTS_CMD_CLIENTADDRESS_PATCH
10084         PY_RTS_CMD_CLIENTADDRESS_PATCH(&dcerpc_rts_cmd_ClientAddress_Type);
10085 #endif
10086 #ifdef PY_RTS_CMD_ASSOCIATIONGROUPID_PATCH
10087         PY_RTS_CMD_ASSOCIATIONGROUPID_PATCH(&dcerpc_rts_cmd_AssociationGroupId_Type);
10088 #endif
10089 #ifdef PY_RTS_CMD_DESTINATION_PATCH
10090         PY_RTS_CMD_DESTINATION_PATCH(&dcerpc_rts_cmd_Destination_Type);
10091 #endif
10092 #ifdef PY_RTS_CMD_PINGTRAFFICSENTNOTIFY_PATCH
10093         PY_RTS_CMD_PINGTRAFFICSENTNOTIFY_PATCH(&dcerpc_rts_cmd_PingTrafficSentNotify_Type);
10094 #endif
10095 #ifdef PY_RTS_CMD_PATCH
10096         PY_RTS_CMD_PATCH(&dcerpc_rts_cmd_Type);
10097 #endif
10098 #ifdef PY_RTS_PATCH
10099         PY_RTS_PATCH(&dcerpc_rts_Type);
10100 #endif
10101 #ifdef PY_NCACN_PACKET_PATCH
10102         PY_NCACN_PACKET_PATCH(&ncacn_packet_Type);
10103 #endif
10104 #ifdef PY_NCADG_PACKET_PATCH
10105         PY_NCADG_PACKET_PATCH(&ncadg_packet_Type);
10106 #endif
10107 #ifdef PY_SEC_VT_PCONTEXT_PATCH
10108         PY_SEC_VT_PCONTEXT_PATCH(&dcerpc_sec_vt_pcontext_Type);
10109 #endif
10110 #ifdef PY_SEC_VT_HEADER2_PATCH
10111         PY_SEC_VT_HEADER2_PATCH(&dcerpc_sec_vt_header2_Type);
10112 #endif
10113 #ifdef PY_SEC_VT_PATCH
10114         PY_SEC_VT_PATCH(&dcerpc_sec_vt_Type);
10115 #endif
10116 #ifdef PY_SEC_VT_COUNT_PATCH
10117         PY_SEC_VT_COUNT_PATCH(&dcerpc_sec_vt_count_Type);
10118 #endif
10119 #ifdef PY_SEC_VERIFICATION_TRAILER_PATCH
10120         PY_SEC_VERIFICATION_TRAILER_PATCH(&dcerpc_sec_verification_trailer_Type);
10121 #endif
10122
10123         m = Py_InitModule3("dcerpc", dcerpc_methods, "dcerpc DCE/RPC");
10124         if (m == NULL)
10125                 return;
10126
10127         PyModule_AddObject(m, "DCERPC_REQUEST_LENGTH", ndr_PyLong_FromUnsignedLongLong(24));
10128         PyModule_AddObject(m, "DCERPC_BIND_PROVIDER_REJECT", PyInt_FromLong(DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION));
10129         PyModule_AddObject(m, "DCERPC_BIND_REASON_ASYNTAX", PyInt_FromLong(DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED));
10130         PyModule_AddObject(m, "DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED", PyInt_FromLong(DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED));
10131         PyModule_AddObject(m, "DCERPC_BIND_REASON_INVALID_AUTH_TYPE", PyInt_FromLong(DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE));
10132         PyModule_AddObject(m, "DCERPC_RESPONSE_LENGTH", ndr_PyLong_FromUnsignedLongLong(24));
10133         PyModule_AddObject(m, "DCERPC_FAULT_OP_RNG_ERROR", PyInt_FromLong(DCERPC_NCA_S_OP_RNG_ERROR));
10134         PyModule_AddObject(m, "DCERPC_FAULT_UNK_IF", PyInt_FromLong(DCERPC_NCA_S_UNKNOWN_IF));
10135         PyModule_AddObject(m, "DCERPC_FAULT_NDR", ndr_PyLong_FromUnsignedLongLong(0x000006f7));
10136         PyModule_AddObject(m, "DCERPC_FAULT_INVALID_TAG", PyInt_FromLong(DCERPC_NCA_S_FAULT_INVALID_TAG));
10137         PyModule_AddObject(m, "DCERPC_FAULT_CONTEXT_MISMATCH", PyInt_FromLong(DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH));
10138         PyModule_AddObject(m, "DCERPC_FAULT_OTHER", ndr_PyLong_FromUnsignedLongLong(0x00000001));
10139         PyModule_AddObject(m, "DCERPC_FAULT_ACCESS_DENIED", ndr_PyLong_FromUnsignedLongLong(0x00000005));
10140         PyModule_AddObject(m, "DCERPC_FAULT_CANT_PERFORM", ndr_PyLong_FromUnsignedLongLong(0x000006d8));
10141         PyModule_AddObject(m, "DCERPC_FAULT_SEC_PKG_ERROR", ndr_PyLong_FromUnsignedLongLong(0x00000721));
10142         PyModule_AddObject(m, "DCERPC_FAULT_TODO", ndr_PyLong_FromUnsignedLongLong(0x00000042));
10143         PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_DEFAULT", PyInt_FromLong((uint16_t)DCERPC_AUTH_LEVEL_CONNECT));
10144         PyModule_AddObject(m, "DCERPC_AUTH_TRAILER_LENGTH", ndr_PyLong_FromUnsignedLongLong(8));
10145         PyModule_AddObject(m, "DCERPC_AUTH_PAD_ALIGNMENT", ndr_PyLong_FromUnsignedLongLong(16));
10146         PyModule_AddObject(m, "DCERPC_PFC_FLAG_PENDING_CANCEL", PyInt_FromLong(DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING));
10147         PyModule_AddObject(m, "DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN", PyInt_FromLong(DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING));
10148         PyModule_AddObject(m, "DCERPC_PFC_OFFSET", ndr_PyLong_FromUnsignedLongLong(3));
10149         PyModule_AddObject(m, "DCERPC_DREP_OFFSET", ndr_PyLong_FromUnsignedLongLong(4));
10150         PyModule_AddObject(m, "DCERPC_FRAG_LEN_OFFSET", ndr_PyLong_FromUnsignedLongLong(8));
10151         PyModule_AddObject(m, "DCERPC_AUTH_LEN_OFFSET", ndr_PyLong_FromUnsignedLongLong(10));
10152         PyModule_AddObject(m, "DCERPC_NCACN_PAYLOAD_OFFSET", ndr_PyLong_FromUnsignedLongLong(16));
10153         PyModule_AddObject(m, "DCERPC_DREP_LE", ndr_PyLong_FromUnsignedLongLong(0x10));
10154         PyModule_AddObject(m, "DCERPC_SEC_VT_MAX_SIZE", ndr_PyLong_FromUnsignedLongLong(1024));
10155         PyModule_AddObject(m, "DCERPC_BIND_ACK_RESULT_ACCEPTANCE", PyInt_FromLong((uint16_t)DCERPC_BIND_ACK_RESULT_ACCEPTANCE));
10156         PyModule_AddObject(m, "DCERPC_BIND_ACK_RESULT_USER_REJECTION", PyInt_FromLong((uint16_t)DCERPC_BIND_ACK_RESULT_USER_REJECTION));
10157         PyModule_AddObject(m, "DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION", PyInt_FromLong((uint16_t)DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION));
10158         PyModule_AddObject(m, "DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK", PyInt_FromLong((uint16_t)DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK));
10159         PyModule_AddObject(m, "DCERPC_BIND_ACK_REASON_NOT_SPECIFIED", PyInt_FromLong((uint16_t)DCERPC_BIND_ACK_REASON_NOT_SPECIFIED));
10160         PyModule_AddObject(m, "DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED", PyInt_FromLong((uint16_t)DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED));
10161         PyModule_AddObject(m, "DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED", PyInt_FromLong((uint16_t)DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED));
10162         PyModule_AddObject(m, "DCERPC_BIND_ACK_REASON_LOCAL_LIMIT_EXCEEDED", PyInt_FromLong((uint16_t)DCERPC_BIND_ACK_REASON_LOCAL_LIMIT_EXCEEDED));
10163         PyModule_AddObject(m, "DCERPC_BIND_TIME_SECURITY_CONTEXT_MULTIPLEXING", PyInt_FromLong((uint16_t)DCERPC_BIND_TIME_SECURITY_CONTEXT_MULTIPLEXING));
10164         PyModule_AddObject(m, "DCERPC_BIND_TIME_KEEP_CONNECTION_ON_ORPHAN", PyInt_FromLong((uint16_t)DCERPC_BIND_TIME_KEEP_CONNECTION_ON_ORPHAN));
10165         PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_NOT_SPECIFIED", PyInt_FromLong((uint16_t)DCERPC_BIND_NAK_REASON_NOT_SPECIFIED));
10166         PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_TEMPORARY_CONGESTION", PyInt_FromLong((uint16_t)DCERPC_BIND_NAK_REASON_TEMPORARY_CONGESTION));
10167         PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_LOCAL_LIMIT_EXCEEDED", PyInt_FromLong((uint16_t)DCERPC_BIND_NAK_REASON_LOCAL_LIMIT_EXCEEDED));
10168         PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED", PyInt_FromLong((uint16_t)DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED));
10169         PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE", PyInt_FromLong((uint16_t)DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE));
10170         PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM", PyInt_FromLong((uint16_t)DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM));
10171         PyModule_AddObject(m, "DCERPC_NCA_S_COMM_FAILURE", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_COMM_FAILURE));
10172         PyModule_AddObject(m, "DCERPC_NCA_S_OP_RNG_ERROR", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_OP_RNG_ERROR));
10173         PyModule_AddObject(m, "DCERPC_NCA_S_UNKNOWN_IF", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_UNKNOWN_IF));
10174         PyModule_AddObject(m, "DCERPC_NCA_S_WRONG_BOOT_TIME", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_WRONG_BOOT_TIME));
10175         PyModule_AddObject(m, "DCERPC_NCA_S_YOU_CRASHED", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_YOU_CRASHED));
10176         PyModule_AddObject(m, "DCERPC_NCA_S_PROTO_ERROR", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_PROTO_ERROR));
10177         PyModule_AddObject(m, "DCERPC_NCA_S_OUT_ARGS_TOO_BIG", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_OUT_ARGS_TOO_BIG));
10178         PyModule_AddObject(m, "DCERPC_NCA_S_SERVER_TOO_BUSY", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_SERVER_TOO_BUSY));
10179         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_STRING_TOO_LARGE", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_STRING_TOO_LARGE));
10180         PyModule_AddObject(m, "DCERPC_NCA_S_UNSUPPORTED_TYPE", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_UNSUPPORTED_TYPE));
10181         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_INT_DIV_BY_ZERO", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_INT_DIV_BY_ZERO));
10182         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_ADDR_ERROR", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_ADDR_ERROR));
10183         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_FP_DIV_BY_ZERO", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_FP_DIV_BY_ZERO));
10184         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_FP_UNDERFLOW", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_FP_UNDERFLOW));
10185         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_FP_OVERRFLOW", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_FP_OVERRFLOW));
10186         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_INVALID_TAG", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_INVALID_TAG));
10187         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_INVALID_BOUND", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_INVALID_BOUND));
10188         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH));
10189         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_UNSPEC_REJECT", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_UNSPEC_REJECT));
10190         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_BAD_ACTID", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_BAD_ACTID));
10191         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED));
10192         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED));
10193         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_CANCEL", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_CANCEL));
10194         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_ILL_INST", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_ILL_INST));
10195         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_FP_ERROR", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_FP_ERROR));
10196         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_INT_OVERFLOW", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_INT_OVERFLOW));
10197         PyModule_AddObject(m, "DCERPC_NCA_S_UNUSED_1C000011", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_UNUSED_1C000011));
10198         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_UNSPEC", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_UNSPEC));
10199         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE));
10200         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_EMPTY", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_PIPE_EMPTY));
10201         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_CLOSED", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_PIPE_CLOSED));
10202         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_ORDER", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_PIPE_ORDER));
10203         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_DISCIPLINE", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_PIPE_DISCIPLINE));
10204         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_COMM_ERROR", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_PIPE_COMM_ERROR));
10205         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_MEMORY", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_PIPE_MEMORY));
10206         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH));
10207         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY));
10208         PyModule_AddObject(m, "DCERPC_NCA_S_INVALID_PRES_CONTEXT_ID", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_INVALID_PRES_CONTEXT_ID));
10209         PyModule_AddObject(m, "DCERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL));
10210         PyModule_AddObject(m, "DCERPC_NCA_S_UNUSED_1C00001E", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_UNUSED_1C00001E));
10211         PyModule_AddObject(m, "DCERPC_NCA_S_INVALID_CHECKSUM", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_INVALID_CHECKSUM));
10212         PyModule_AddObject(m, "DCERPC_NCA_S_INVALID_CRC", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_INVALID_CRC));
10213         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_USER_DEFINED", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_USER_DEFINED));
10214         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_TX_OPEN_FAILED", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_TX_OPEN_FAILED));
10215         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR));
10216         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND));
10217         PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_NO_CLIENT_STUB", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_NCA_S_FAULT_NO_CLIENT_STUB));
10218         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_NONE", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_NONE));
10219         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_KRB5_1", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_KRB5_1));
10220         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_SPNEGO", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_SPNEGO));
10221         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_NTLMSSP", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_NTLMSSP));
10222         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_KRB5", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_KRB5));
10223         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_DPA", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_DPA));
10224         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_MSN", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_MSN));
10225         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_DIGEST", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_DIGEST));
10226         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_SCHANNEL", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_SCHANNEL));
10227         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_MSMQ", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_MSMQ));
10228         PyModule_AddObject(m, "DCERPC_AUTH_TYPE_NCALRPC_AS_SYSTEM", PyInt_FromLong((uint16_t)DCERPC_AUTH_TYPE_NCALRPC_AS_SYSTEM));
10229         PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_NONE", PyInt_FromLong((uint16_t)DCERPC_AUTH_LEVEL_NONE));
10230         PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_CONNECT", PyInt_FromLong((uint16_t)DCERPC_AUTH_LEVEL_CONNECT));
10231         PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_CALL", PyInt_FromLong((uint16_t)DCERPC_AUTH_LEVEL_CALL));
10232         PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_PACKET", PyInt_FromLong((uint16_t)DCERPC_AUTH_LEVEL_PACKET));
10233         PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_INTEGRITY", PyInt_FromLong((uint16_t)DCERPC_AUTH_LEVEL_INTEGRITY));
10234         PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_PRIVACY", PyInt_FromLong((uint16_t)DCERPC_AUTH_LEVEL_PRIVACY));
10235         PyModule_AddObject(m, "RTS_IPV4", ndr_PyLong_FromUnsignedLongLong((uint32_t)RTS_IPV4));
10236         PyModule_AddObject(m, "RTS_IPV6", ndr_PyLong_FromUnsignedLongLong((uint32_t)RTS_IPV6));
10237         PyModule_AddObject(m, "FDClient", ndr_PyLong_FromUnsignedLongLong((uint32_t)FDClient));
10238         PyModule_AddObject(m, "FDInProxy", ndr_PyLong_FromUnsignedLongLong((uint32_t)FDInProxy));
10239         PyModule_AddObject(m, "FDServer", ndr_PyLong_FromUnsignedLongLong((uint32_t)FDServer));
10240         PyModule_AddObject(m, "FDOutProxy", ndr_PyLong_FromUnsignedLongLong((uint32_t)FDOutProxy));
10241         PyModule_AddObject(m, "RTS_FLAG_NONE", PyInt_FromLong((uint16_t)RTS_FLAG_NONE));
10242         PyModule_AddObject(m, "RTS_FLAG_PING", PyInt_FromLong((uint16_t)RTS_FLAG_PING));
10243         PyModule_AddObject(m, "RTS_FLAG_OTHER_CMD", PyInt_FromLong((uint16_t)RTS_FLAG_OTHER_CMD));
10244         PyModule_AddObject(m, "RTS_FLAG_RECYCLE_CHANNEL", PyInt_FromLong((uint16_t)RTS_FLAG_RECYCLE_CHANNEL));
10245         PyModule_AddObject(m, "RTS_FLAG_IN_CHANNEL", PyInt_FromLong((uint16_t)RTS_FLAG_IN_CHANNEL));
10246         PyModule_AddObject(m, "RTS_FLAG_OUT_CHANNEL", PyInt_FromLong((uint16_t)RTS_FLAG_OUT_CHANNEL));
10247         PyModule_AddObject(m, "RTS_FLAG_EOF", PyInt_FromLong((uint16_t)RTS_FLAG_EOF));
10248         PyModule_AddObject(m, "RTS_FLAG_ECHO", PyInt_FromLong((uint16_t)RTS_FLAG_ECHO));
10249         PyModule_AddObject(m, "DCERPC_PKT_REQUEST", PyInt_FromLong((uint16_t)DCERPC_PKT_REQUEST));
10250         PyModule_AddObject(m, "DCERPC_PKT_PING", PyInt_FromLong((uint16_t)DCERPC_PKT_PING));
10251         PyModule_AddObject(m, "DCERPC_PKT_RESPONSE", PyInt_FromLong((uint16_t)DCERPC_PKT_RESPONSE));
10252         PyModule_AddObject(m, "DCERPC_PKT_FAULT", PyInt_FromLong((uint16_t)DCERPC_PKT_FAULT));
10253         PyModule_AddObject(m, "DCERPC_PKT_WORKING", PyInt_FromLong((uint16_t)DCERPC_PKT_WORKING));
10254         PyModule_AddObject(m, "DCERPC_PKT_NOCALL", PyInt_FromLong((uint16_t)DCERPC_PKT_NOCALL));
10255         PyModule_AddObject(m, "DCERPC_PKT_REJECT", PyInt_FromLong((uint16_t)DCERPC_PKT_REJECT));
10256         PyModule_AddObject(m, "DCERPC_PKT_ACK", PyInt_FromLong((uint16_t)DCERPC_PKT_ACK));
10257         PyModule_AddObject(m, "DCERPC_PKT_CL_CANCEL", PyInt_FromLong((uint16_t)DCERPC_PKT_CL_CANCEL));
10258         PyModule_AddObject(m, "DCERPC_PKT_FACK", PyInt_FromLong((uint16_t)DCERPC_PKT_FACK));
10259         PyModule_AddObject(m, "DCERPC_PKT_CANCEL_ACK", PyInt_FromLong((uint16_t)DCERPC_PKT_CANCEL_ACK));
10260         PyModule_AddObject(m, "DCERPC_PKT_BIND", PyInt_FromLong((uint16_t)DCERPC_PKT_BIND));
10261         PyModule_AddObject(m, "DCERPC_PKT_BIND_ACK", PyInt_FromLong((uint16_t)DCERPC_PKT_BIND_ACK));
10262         PyModule_AddObject(m, "DCERPC_PKT_BIND_NAK", PyInt_FromLong((uint16_t)DCERPC_PKT_BIND_NAK));
10263         PyModule_AddObject(m, "DCERPC_PKT_ALTER", PyInt_FromLong((uint16_t)DCERPC_PKT_ALTER));
10264         PyModule_AddObject(m, "DCERPC_PKT_ALTER_RESP", PyInt_FromLong((uint16_t)DCERPC_PKT_ALTER_RESP));
10265         PyModule_AddObject(m, "DCERPC_PKT_AUTH3", PyInt_FromLong((uint16_t)DCERPC_PKT_AUTH3));
10266         PyModule_AddObject(m, "DCERPC_PKT_SHUTDOWN", PyInt_FromLong((uint16_t)DCERPC_PKT_SHUTDOWN));
10267         PyModule_AddObject(m, "DCERPC_PKT_CO_CANCEL", PyInt_FromLong((uint16_t)DCERPC_PKT_CO_CANCEL));
10268         PyModule_AddObject(m, "DCERPC_PKT_ORPHANED", PyInt_FromLong((uint16_t)DCERPC_PKT_ORPHANED));
10269         PyModule_AddObject(m, "DCERPC_PKT_RTS", PyInt_FromLong((uint16_t)DCERPC_PKT_RTS));
10270         PyModule_AddObject(m, "DCERPC_PFC_FLAG_FIRST", PyInt_FromLong((uint16_t)DCERPC_PFC_FLAG_FIRST));
10271         PyModule_AddObject(m, "DCERPC_PFC_FLAG_LAST", PyInt_FromLong((uint16_t)DCERPC_PFC_FLAG_LAST));
10272         PyModule_AddObject(m, "DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING", PyInt_FromLong((uint16_t)DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING));
10273         PyModule_AddObject(m, "DCERPC_PFC_FLAG_CONC_MPX", PyInt_FromLong((uint16_t)DCERPC_PFC_FLAG_CONC_MPX));
10274         PyModule_AddObject(m, "DCERPC_PFC_FLAG_DID_NOT_EXECUTE", PyInt_FromLong((uint16_t)DCERPC_PFC_FLAG_DID_NOT_EXECUTE));
10275         PyModule_AddObject(m, "DCERPC_PFC_FLAG_MAYBE", PyInt_FromLong((uint16_t)DCERPC_PFC_FLAG_MAYBE));
10276         PyModule_AddObject(m, "DCERPC_PFC_FLAG_OBJECT_UUID", PyInt_FromLong((uint16_t)DCERPC_PFC_FLAG_OBJECT_UUID));
10277         PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_ENUM", PyInt_FromLong((uint16_t)DCERPC_SEC_VT_COMMAND_ENUM));
10278         PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_END", PyInt_FromLong((uint16_t)DCERPC_SEC_VT_COMMAND_END));
10279         PyModule_AddObject(m, "DCERPC_SEC_VT_MUST_PROCESS", PyInt_FromLong((uint16_t)DCERPC_SEC_VT_MUST_PROCESS));
10280         PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_BITMASK1", PyInt_FromLong((uint16_t)DCERPC_SEC_VT_COMMAND_BITMASK1));
10281         PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_PCONTEXT", PyInt_FromLong((uint16_t)DCERPC_SEC_VT_COMMAND_PCONTEXT));
10282         PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_HEADER2", PyInt_FromLong((uint16_t)DCERPC_SEC_VT_COMMAND_HEADER2));
10283         PyModule_AddObject(m, "DCERPC_SEC_VT_CLIENT_SUPPORTS_HEADER_SIGNING", ndr_PyLong_FromUnsignedLongLong((uint32_t)DCERPC_SEC_VT_CLIENT_SUPPORTS_HEADER_SIGNING));
10284         Py_INCREF((PyObject *)(void *)&dcerpc_ctx_list_Type);
10285         PyModule_AddObject(m, "ctx_list", (PyObject *)(void *)&dcerpc_ctx_list_Type);
10286         Py_INCREF((PyObject *)(void *)&dcerpc_bind_Type);
10287         PyModule_AddObject(m, "bind", (PyObject *)(void *)&dcerpc_bind_Type);
10288         Py_INCREF((PyObject *)(void *)&dcerpc_empty_Type);
10289         PyModule_AddObject(m, "empty", (PyObject *)(void *)&dcerpc_empty_Type);
10290         Py_INCREF((PyObject *)(void *)&dcerpc_request_Type);
10291         PyModule_AddObject(m, "request", (PyObject *)(void *)&dcerpc_request_Type);
10292         Py_INCREF((PyObject *)(void *)&dcerpc_ack_ctx_Type);
10293         PyModule_AddObject(m, "ack_ctx", (PyObject *)(void *)&dcerpc_ack_ctx_Type);
10294         Py_INCREF((PyObject *)(void *)&dcerpc_bind_ack_Type);
10295         PyModule_AddObject(m, "bind_ack", (PyObject *)(void *)&dcerpc_bind_ack_Type);
10296         Py_INCREF((PyObject *)(void *)&dcerpc_bind_nak_version_Type);
10297         PyModule_AddObject(m, "bind_nak_version", (PyObject *)(void *)&dcerpc_bind_nak_version_Type);
10298         Py_INCREF((PyObject *)(void *)&dcerpc_bind_nak_Type);
10299         PyModule_AddObject(m, "bind_nak", (PyObject *)(void *)&dcerpc_bind_nak_Type);
10300         Py_INCREF((PyObject *)(void *)&dcerpc_response_Type);
10301         PyModule_AddObject(m, "response", (PyObject *)(void *)&dcerpc_response_Type);
10302         Py_INCREF((PyObject *)(void *)&dcerpc_fault_Type);
10303         PyModule_AddObject(m, "fault", (PyObject *)(void *)&dcerpc_fault_Type);
10304         Py_INCREF((PyObject *)(void *)&dcerpc_auth_Type);
10305         PyModule_AddObject(m, "auth", (PyObject *)(void *)&dcerpc_auth_Type);
10306         Py_INCREF((PyObject *)(void *)&dcerpc_auth3_Type);
10307         PyModule_AddObject(m, "auth3", (PyObject *)(void *)&dcerpc_auth3_Type);
10308         Py_INCREF((PyObject *)(void *)&dcerpc_orphaned_Type);
10309         PyModule_AddObject(m, "orphaned", (PyObject *)(void *)&dcerpc_orphaned_Type);
10310         Py_INCREF((PyObject *)(void *)&dcerpc_co_cancel_Type);
10311         PyModule_AddObject(m, "co_cancel", (PyObject *)(void *)&dcerpc_co_cancel_Type);
10312         Py_INCREF((PyObject *)(void *)&dcerpc_cl_cancel_Type);
10313         PyModule_AddObject(m, "cl_cancel", (PyObject *)(void *)&dcerpc_cl_cancel_Type);
10314         Py_INCREF((PyObject *)(void *)&dcerpc_cancel_ack_Type);
10315         PyModule_AddObject(m, "cancel_ack", (PyObject *)(void *)&dcerpc_cancel_ack_Type);
10316         Py_INCREF((PyObject *)(void *)&dcerpc_fack_Type);
10317         PyModule_AddObject(m, "fack", (PyObject *)(void *)&dcerpc_fack_Type);
10318         Py_INCREF((PyObject *)(void *)&dcerpc_ack_Type);
10319         PyModule_AddObject(m, "ack", (PyObject *)(void *)&dcerpc_ack_Type);
10320         Py_INCREF((PyObject *)(void *)&dcerpc_ping_Type);
10321         PyModule_AddObject(m, "ping", (PyObject *)(void *)&dcerpc_ping_Type);
10322         Py_INCREF((PyObject *)(void *)&dcerpc_shutdown_Type);
10323         PyModule_AddObject(m, "shutdown", (PyObject *)(void *)&dcerpc_shutdown_Type);
10324         Py_INCREF((PyObject *)(void *)&dcerpc_working_Type);
10325         PyModule_AddObject(m, "working", (PyObject *)(void *)&dcerpc_working_Type);
10326         Py_INCREF((PyObject *)(void *)&RTSCookie_Type);
10327         PyModule_AddObject(m, "RTSCookie", (PyObject *)(void *)&RTSCookie_Type);
10328         Py_INCREF((PyObject *)(void *)&ClientAddress_Type);
10329         PyModule_AddObject(m, "ClientAddress", (PyObject *)(void *)&ClientAddress_Type);
10330         Py_INCREF((PyObject *)(void *)&FlowControlAcknowledgment_Type);
10331         PyModule_AddObject(m, "FlowControlAcknowledgment", (PyObject *)(void *)&FlowControlAcknowledgment_Type);
10332         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ReceiveWindowSize_Type);
10333         PyModule_AddObject(m, "rts_cmd_ReceiveWindowSize", (PyObject *)(void *)&dcerpc_rts_cmd_ReceiveWindowSize_Type);
10334         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_FlowControlAck_Type);
10335         PyModule_AddObject(m, "rts_cmd_FlowControlAck", (PyObject *)(void *)&dcerpc_rts_cmd_FlowControlAck_Type);
10336         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ConnectionTimeout_Type);
10337         PyModule_AddObject(m, "rts_cmd_ConnectionTimeout", (PyObject *)(void *)&dcerpc_rts_cmd_ConnectionTimeout_Type);
10338         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Cookie_Type);
10339         PyModule_AddObject(m, "rts_cmd_Cookie", (PyObject *)(void *)&dcerpc_rts_cmd_Cookie_Type);
10340         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ChannelLifetime_Type);
10341         PyModule_AddObject(m, "rts_cmd_ChannelLifetime", (PyObject *)(void *)&dcerpc_rts_cmd_ChannelLifetime_Type);
10342         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ClientKeepalive_Type);
10343         PyModule_AddObject(m, "rts_cmd_ClientKeepalive", (PyObject *)(void *)&dcerpc_rts_cmd_ClientKeepalive_Type);
10344         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Version_Type);
10345         PyModule_AddObject(m, "rts_cmd_Version", (PyObject *)(void *)&dcerpc_rts_cmd_Version_Type);
10346         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Empty_Type);
10347         PyModule_AddObject(m, "rts_cmd_Empty", (PyObject *)(void *)&dcerpc_rts_cmd_Empty_Type);
10348         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Padding_Type);
10349         PyModule_AddObject(m, "rts_cmd_Padding", (PyObject *)(void *)&dcerpc_rts_cmd_Padding_Type);
10350         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_NegativeANCE_Type);
10351         PyModule_AddObject(m, "rts_cmd_NegativeANCE", (PyObject *)(void *)&dcerpc_rts_cmd_NegativeANCE_Type);
10352         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ANCE_Type);
10353         PyModule_AddObject(m, "rts_cmd_ANCE", (PyObject *)(void *)&dcerpc_rts_cmd_ANCE_Type);
10354         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ClientAddress_Type);
10355         PyModule_AddObject(m, "rts_cmd_ClientAddress", (PyObject *)(void *)&dcerpc_rts_cmd_ClientAddress_Type);
10356         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_AssociationGroupId_Type);
10357         PyModule_AddObject(m, "rts_cmd_AssociationGroupId", (PyObject *)(void *)&dcerpc_rts_cmd_AssociationGroupId_Type);
10358         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Destination_Type);
10359         PyModule_AddObject(m, "rts_cmd_Destination", (PyObject *)(void *)&dcerpc_rts_cmd_Destination_Type);
10360         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_PingTrafficSentNotify_Type);
10361         PyModule_AddObject(m, "rts_cmd_PingTrafficSentNotify", (PyObject *)(void *)&dcerpc_rts_cmd_PingTrafficSentNotify_Type);
10362         Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Type);
10363         PyModule_AddObject(m, "rts_cmd", (PyObject *)(void *)&dcerpc_rts_cmd_Type);
10364         Py_INCREF((PyObject *)(void *)&dcerpc_rts_Type);
10365         PyModule_AddObject(m, "rts", (PyObject *)(void *)&dcerpc_rts_Type);
10366         Py_INCREF((PyObject *)(void *)&ncacn_packet_Type);
10367         PyModule_AddObject(m, "ncacn_packet", (PyObject *)(void *)&ncacn_packet_Type);
10368         Py_INCREF((PyObject *)(void *)&ncadg_packet_Type);
10369         PyModule_AddObject(m, "ncadg_packet", (PyObject *)(void *)&ncadg_packet_Type);
10370         Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_pcontext_Type);
10371         PyModule_AddObject(m, "sec_vt_pcontext", (PyObject *)(void *)&dcerpc_sec_vt_pcontext_Type);
10372         Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_header2_Type);
10373         PyModule_AddObject(m, "sec_vt_header2", (PyObject *)(void *)&dcerpc_sec_vt_header2_Type);
10374         Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_Type);
10375         PyModule_AddObject(m, "sec_vt", (PyObject *)(void *)&dcerpc_sec_vt_Type);
10376         Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_count_Type);
10377         PyModule_AddObject(m, "sec_vt_count", (PyObject *)(void *)&dcerpc_sec_vt_count_Type);
10378         Py_INCREF((PyObject *)(void *)&dcerpc_sec_verification_trailer_Type);
10379         PyModule_AddObject(m, "sec_verification_trailer", (PyObject *)(void *)&dcerpc_sec_verification_trailer_Type);
10380 #ifdef PY_MOD_DCERPC_PATCH
10381         PY_MOD_DCERPC_PATCH(m);
10382 #endif
10383
10384 }