2 /* Python wrapper functions auto-generated by pidl */
6 #include "librpc/rpc/pyrpc.h"
7 #include "librpc/rpc/pyrpc_util.h"
8 #include "bin/default/librpc/gen_ndr/ndr_dcerpc.h"
9 #include "bin/default/librpc/gen_ndr/ndr_dcerpc_c.h"
12 * These functions are here to ensure they can be optomised out by
13 * the compiler based on the constant input values
16 static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
32 static inline long long ndr_sizeof2intmax(size_t var_size)
48 static inline PyObject *ndr_PyLong_FromLongLong(long long v)
50 if (v > LONG_MAX || v < LONG_MIN) {
51 return PyLong_FromLongLong(v);
53 return PyInt_FromLong(v);
57 static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)
60 return PyLong_FromUnsignedLongLong(v);
62 return PyInt_FromLong(v);
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;
128 void initdcerpc(void);static PyTypeObject *ndr_syntax_id_Type;
129 static PyTypeObject *Object_Type;
130 static PyTypeObject *GUID_Type;
132 static PyObject *py_dcerpc_ctx_list_get_context_id(PyObject *obj, void *closure)
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;
140 static int py_dcerpc_ctx_list_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
142 struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(py_obj);
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) {
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);
156 object->context_id = test_var;
157 } else if (PyInt_Check(value)) {
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);
165 object->context_id = test_var;
167 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
168 PyInt_Type.tp_name, PyLong_Type.tp_name);
175 static PyObject *py_dcerpc_ctx_list_get_num_transfer_syntaxes(PyObject *obj, void *closure)
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;
183 static int py_dcerpc_ctx_list_set_num_transfer_syntaxes(PyObject *py_obj, PyObject *value, void *closure)
185 struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(py_obj);
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) {
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);
199 object->num_transfer_syntaxes = test_var;
200 } else if (PyInt_Check(value)) {
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);
208 object->num_transfer_syntaxes = test_var;
210 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
211 PyInt_Type.tp_name, PyLong_Type.tp_name);
218 static PyObject *py_dcerpc_ctx_list_get_abstract_syntax(PyObject *obj, void *closure)
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;
226 static int py_dcerpc_ctx_list_set_abstract_syntax(PyObject *py_obj, PyObject *value, void *closure)
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) {
234 object->abstract_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
238 static PyObject *py_dcerpc_ctx_list_get_transfer_syntaxes(PyObject *obj, void *closure)
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) {
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);
254 return py_transfer_syntaxes;
257 static int py_dcerpc_ctx_list_set_transfer_syntaxes(PyObject *py_obj, PyObject *value, void *closure)
259 struct dcerpc_ctx_list *object = (struct dcerpc_ctx_list *)pytalloc_get_ptr(py_obj);
260 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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) {
272 object->transfer_syntaxes[transfer_syntaxes_cntr_0] = *(struct ndr_syntax_id *)pytalloc_get_ptr(PyList_GET_ITEM(value, transfer_syntaxes_cntr_0));
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 },
286 static PyObject *py_dcerpc_ctx_list_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
288 return pytalloc_new(struct dcerpc_ctx_list, type);
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,
297 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
298 .tp_basicsize = sizeof(pytalloc_Object),
299 .tp_new = py_dcerpc_ctx_list_new,
303 static PyObject *py_dcerpc_bind_get_max_xmit_frag(PyObject *obj, void *closure)
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;
311 static int py_dcerpc_bind_set_max_xmit_frag(PyObject *py_obj, PyObject *value, void *closure)
313 struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
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) {
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);
327 object->max_xmit_frag = test_var;
328 } else if (PyInt_Check(value)) {
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);
336 object->max_xmit_frag = test_var;
338 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
339 PyInt_Type.tp_name, PyLong_Type.tp_name);
346 static PyObject *py_dcerpc_bind_get_max_recv_frag(PyObject *obj, void *closure)
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;
354 static int py_dcerpc_bind_set_max_recv_frag(PyObject *py_obj, PyObject *value, void *closure)
356 struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
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) {
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);
370 object->max_recv_frag = test_var;
371 } else if (PyInt_Check(value)) {
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);
379 object->max_recv_frag = test_var;
381 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
382 PyInt_Type.tp_name, PyLong_Type.tp_name);
389 static PyObject *py_dcerpc_bind_get_assoc_group_id(PyObject *obj, void *closure)
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;
397 static int py_dcerpc_bind_set_assoc_group_id(PyObject *py_obj, PyObject *value, void *closure)
399 struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
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) {
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);
413 object->assoc_group_id = test_var;
414 } else if (PyInt_Check(value)) {
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);
422 object->assoc_group_id = test_var;
424 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
425 PyInt_Type.tp_name, PyLong_Type.tp_name);
432 static PyObject *py_dcerpc_bind_get_num_contexts(PyObject *obj, void *closure)
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;
440 static int py_dcerpc_bind_set_num_contexts(PyObject *py_obj, PyObject *value, void *closure)
442 struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
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) {
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);
456 object->num_contexts = test_var;
457 } else if (PyInt_Check(value)) {
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);
465 object->num_contexts = test_var;
467 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
468 PyInt_Type.tp_name, PyLong_Type.tp_name);
475 static PyObject *py_dcerpc_bind_get_ctx_list(PyObject *obj, void *closure)
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) {
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);
494 static int py_dcerpc_bind_set_ctx_list(PyObject *py_obj, PyObject *value, void *closure)
496 struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
497 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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) {
509 object->ctx_list[ctx_list_cntr_0] = *(struct dcerpc_ctx_list *)pytalloc_get_ptr(PyList_GET_ITEM(value, ctx_list_cntr_0));
515 static PyObject *py_dcerpc_bind_get_auth_info(PyObject *obj, void *closure)
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);
523 static int py_dcerpc_bind_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
540 static PyObject *py_dcerpc_bind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
542 return pytalloc_new(struct dcerpc_bind, type);
545 static PyObject *py_dcerpc_bind_ndr_pack(PyObject *py_obj)
547 struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
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);
556 return PyString_FromStringAndSize((char *)blob.data, blob.length);
559 static PyObject *py_dcerpc_bind_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
561 struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
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;
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)) {
575 blob.length = blob_length;
577 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
578 allow_remaining = true;
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);
584 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind);
586 if (err != NDR_ERR_SUCCESS) {
587 PyErr_SetNdrError(err);
594 static PyObject *py_dcerpc_bind_ndr_print(PyObject *py_obj)
596 struct dcerpc_bind *object = (struct dcerpc_bind *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
626 static PyObject *py_dcerpc_empty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
628 return pytalloc_new(struct dcerpc_empty, type);
632 static PyTypeObject dcerpc_empty_Type = {
633 PyObject_HEAD_INIT(NULL) 0,
634 .tp_name = "dcerpc.empty",
637 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
638 .tp_basicsize = sizeof(pytalloc_Object),
639 .tp_new = py_dcerpc_empty_new,
642 PyObject *py_import_dcerpc_object(TALLOC_CTX *mem_ctx, int level, union dcerpc_object *in)
647 case LIBNDR_FLAG_OBJECT_PRESENT:
648 ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->object);
652 ret = pytalloc_reference_ex(&dcerpc_empty_Type, mem_ctx, &in->empty);
656 PyErr_SetString(PyExc_TypeError, "unknown union level");
660 union dcerpc_object *py_export_dcerpc_object(TALLOC_CTX *mem_ctx, int level, PyObject *in)
662 union dcerpc_object *ret = talloc_zero(mem_ctx, union dcerpc_object);
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) {
668 talloc_free(ret); return NULL;
670 ret->object = *(struct GUID *)pytalloc_get_ptr(in);
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) {
677 talloc_free(ret); return NULL;
679 ret->empty = *(struct dcerpc_empty *)pytalloc_get_ptr(in);
688 static PyObject *py_dcerpc_request_get_alloc_hint(PyObject *obj, void *closure)
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;
696 static int py_dcerpc_request_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
698 struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
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) {
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);
712 object->alloc_hint = test_var;
713 } else if (PyInt_Check(value)) {
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);
721 object->alloc_hint = test_var;
723 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
724 PyInt_Type.tp_name, PyLong_Type.tp_name);
731 static PyObject *py_dcerpc_request_get_context_id(PyObject *obj, void *closure)
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;
739 static int py_dcerpc_request_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
741 struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
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) {
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);
755 object->context_id = test_var;
756 } else if (PyInt_Check(value)) {
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);
764 object->context_id = test_var;
766 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
767 PyInt_Type.tp_name, PyLong_Type.tp_name);
774 static PyObject *py_dcerpc_request_get_opnum(PyObject *obj, void *closure)
776 struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
778 py_opnum = PyInt_FromLong((uint16_t)object->opnum);
782 static int py_dcerpc_request_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
784 struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
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) {
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);
798 object->opnum = test_var;
799 } else if (PyInt_Check(value)) {
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);
807 object->opnum = test_var;
809 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
810 PyInt_Type.tp_name, PyLong_Type.tp_name);
817 static PyObject *py_dcerpc_request_get_object(PyObject *obj, void *closure)
819 struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
821 py_object = py_import_dcerpc_object(pytalloc_get_mem_ctx(obj), NDR_DCERPC_REQUEST_OBJECT_PRESENT, &object->object);
822 if (py_object == NULL) {
828 static int py_dcerpc_request_set_object(PyObject *py_obj, PyObject *value, void *closure)
830 struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(py_obj);
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) {
837 object->object = *object_switch_0;
842 static PyObject *py_dcerpc_request_get__pad(PyObject *obj, void *closure)
844 struct dcerpc_request *object = (struct dcerpc_request *)pytalloc_get_ptr(obj);
846 py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
850 static int py_dcerpc_request_set__pad(PyObject *py_obj, PyObject *value, void *closure)
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));
857 static PyObject *py_dcerpc_request_get_stub_and_verifier(PyObject *obj, void *closure)
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;
865 static int py_dcerpc_request_set_stub_and_verifier(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
882 static PyObject *py_dcerpc_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
884 return pytalloc_new(struct dcerpc_request, type);
888 static PyTypeObject dcerpc_request_Type = {
889 PyObject_HEAD_INIT(NULL) 0,
890 .tp_name = "dcerpc.request",
891 .tp_getset = py_dcerpc_request_getsetters,
893 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
894 .tp_basicsize = sizeof(pytalloc_Object),
895 .tp_new = py_dcerpc_request_new,
898 PyObject *py_import_dcerpc_bind_ack_reason(TALLOC_CTX *mem_ctx, int level, union dcerpc_bind_ack_reason *in)
903 case DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK:
904 ret = PyInt_FromLong((uint16_t)in->negotiate);
908 ret = PyInt_FromLong((uint16_t)in->value);
912 PyErr_SetString(PyExc_TypeError, "unknown union level");
916 union dcerpc_bind_ack_reason *py_export_dcerpc_bind_ack_reason(TALLOC_CTX *mem_ctx, int level, PyObject *in)
918 union dcerpc_bind_ack_reason *ret = talloc_zero(mem_ctx, union dcerpc_bind_ack_reason);
920 case DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK:
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;
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;
934 ret->negotiate = test_var;
935 } else if (PyInt_Check(in)) {
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;
943 ret->negotiate = test_var;
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;
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;
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;
966 ret->value = test_var;
967 } else if (PyInt_Check(in)) {
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;
975 ret->value = test_var;
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;
990 static PyObject *py_dcerpc_ack_ctx_get_result(PyObject *obj, void *closure)
992 struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(obj);
994 py_result = PyInt_FromLong((uint16_t)object->result);
998 static int py_dcerpc_ack_ctx_set_result(PyObject *py_obj, PyObject *value, void *closure)
1000 struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(py_obj);
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) {
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);
1014 object->result = test_var;
1015 } else if (PyInt_Check(value)) {
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);
1023 object->result = test_var;
1025 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1026 PyInt_Type.tp_name, PyLong_Type.tp_name);
1033 static PyObject *py_dcerpc_ack_ctx_get_reason(PyObject *obj, void *closure)
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) {
1044 static int py_dcerpc_ack_ctx_set_reason(PyObject *py_obj, PyObject *value, void *closure)
1046 struct dcerpc_ack_ctx *object = (struct dcerpc_ack_ctx *)pytalloc_get_ptr(py_obj);
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) {
1053 object->reason = *reason_switch_0;
1058 static PyObject *py_dcerpc_ack_ctx_get_syntax(PyObject *obj, void *closure)
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);
1066 static int py_dcerpc_ack_ctx_set_syntax(PyObject *py_obj, PyObject *value, void *closure)
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) {
1074 object->syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
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 },
1085 static PyObject *py_dcerpc_ack_ctx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1087 return pytalloc_new(struct dcerpc_ack_ctx, type);
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,
1096 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1097 .tp_basicsize = sizeof(pytalloc_Object),
1098 .tp_new = py_dcerpc_ack_ctx_new,
1102 static PyObject *py_dcerpc_bind_ack_get_max_xmit_frag(PyObject *obj, void *closure)
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;
1110 static int py_dcerpc_bind_ack_set_max_xmit_frag(PyObject *py_obj, PyObject *value, void *closure)
1112 struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
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) {
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);
1126 object->max_xmit_frag = test_var;
1127 } else if (PyInt_Check(value)) {
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);
1135 object->max_xmit_frag = test_var;
1137 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1138 PyInt_Type.tp_name, PyLong_Type.tp_name);
1145 static PyObject *py_dcerpc_bind_ack_get_max_recv_frag(PyObject *obj, void *closure)
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;
1153 static int py_dcerpc_bind_ack_set_max_recv_frag(PyObject *py_obj, PyObject *value, void *closure)
1155 struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
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) {
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);
1169 object->max_recv_frag = test_var;
1170 } else if (PyInt_Check(value)) {
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);
1178 object->max_recv_frag = test_var;
1180 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1181 PyInt_Type.tp_name, PyLong_Type.tp_name);
1188 static PyObject *py_dcerpc_bind_ack_get_assoc_group_id(PyObject *obj, void *closure)
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;
1196 static int py_dcerpc_bind_ack_set_assoc_group_id(PyObject *py_obj, PyObject *value, void *closure)
1198 struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
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) {
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);
1212 object->assoc_group_id = test_var;
1213 } else if (PyInt_Check(value)) {
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);
1221 object->assoc_group_id = test_var;
1223 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1224 PyInt_Type.tp_name, PyLong_Type.tp_name);
1231 static PyObject *py_dcerpc_bind_ack_get_secondary_address_size(PyObject *obj, void *closure)
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;
1239 static int py_dcerpc_bind_ack_set_secondary_address_size(PyObject *py_obj, PyObject *value, void *closure)
1241 struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
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) {
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);
1255 object->secondary_address_size = test_var;
1256 } else if (PyInt_Check(value)) {
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);
1264 object->secondary_address_size = test_var;
1266 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1267 PyInt_Type.tp_name, PyLong_Type.tp_name);
1274 static PyObject *py_dcerpc_bind_ack_get_secondary_address(PyObject *obj, void *closure)
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);
1282 py_secondary_address = PyUnicode_Decode(object->secondary_address, strlen(object->secondary_address), "utf-8", "ignore");
1284 return py_secondary_address;
1287 static int py_dcerpc_bind_ack_set_secondary_address(PyObject *py_obj, PyObject *value, void *closure)
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);
1295 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1301 static PyObject *py_dcerpc_bind_ack_get__pad1(PyObject *obj, void *closure)
1303 struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(obj);
1305 py__pad1 = PyString_FromStringAndSize((char *)(object->_pad1).data, (object->_pad1).length);
1309 static int py_dcerpc_bind_ack_set__pad1(PyObject *py_obj, PyObject *value, void *closure)
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));
1316 static PyObject *py_dcerpc_bind_ack_get_num_results(PyObject *obj, void *closure)
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;
1324 static int py_dcerpc_bind_ack_set_num_results(PyObject *py_obj, PyObject *value, void *closure)
1326 struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
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) {
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);
1340 object->num_results = test_var;
1341 } else if (PyInt_Check(value)) {
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);
1349 object->num_results = test_var;
1351 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1352 PyInt_Type.tp_name, PyLong_Type.tp_name);
1359 static PyObject *py_dcerpc_bind_ack_get_ctx_list(PyObject *obj, void *closure)
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) {
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);
1378 static int py_dcerpc_bind_ack_set_ctx_list(PyObject *py_obj, PyObject *value, void *closure)
1380 struct dcerpc_bind_ack *object = (struct dcerpc_bind_ack *)pytalloc_get_ptr(py_obj);
1381 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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) {
1393 object->ctx_list[ctx_list_cntr_0] = *(struct dcerpc_ack_ctx *)pytalloc_get_ptr(PyList_GET_ITEM(value, ctx_list_cntr_0));
1399 static PyObject *py_dcerpc_bind_ack_get_auth_info(PyObject *obj, void *closure)
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;
1407 static int py_dcerpc_bind_ack_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
1427 static PyObject *py_dcerpc_bind_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1429 return pytalloc_new(struct dcerpc_bind_ack, type);
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,
1438 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1439 .tp_basicsize = sizeof(pytalloc_Object),
1440 .tp_new = py_dcerpc_bind_ack_new,
1444 static PyObject *py_dcerpc_bind_nak_version_get_rpc_vers(PyObject *obj, void *closure)
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);
1452 static int py_dcerpc_bind_nak_version_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
1454 struct dcerpc_bind_nak_version *object = (struct dcerpc_bind_nak_version *)pytalloc_get_ptr(py_obj);
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) {
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);
1468 object->rpc_vers = test_var;
1469 } else if (PyInt_Check(value)) {
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);
1477 object->rpc_vers = test_var;
1479 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1480 PyInt_Type.tp_name, PyLong_Type.tp_name);
1487 static PyObject *py_dcerpc_bind_nak_version_get_rpc_vers_minor(PyObject *obj, void *closure)
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;
1495 static int py_dcerpc_bind_nak_version_set_rpc_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
1497 struct dcerpc_bind_nak_version *object = (struct dcerpc_bind_nak_version *)pytalloc_get_ptr(py_obj);
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) {
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);
1511 object->rpc_vers_minor = test_var;
1512 } else if (PyInt_Check(value)) {
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);
1520 object->rpc_vers_minor = test_var;
1522 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1523 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
1536 static PyObject *py_dcerpc_bind_nak_version_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1538 return pytalloc_new(struct dcerpc_bind_nak_version, type);
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,
1547 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1548 .tp_basicsize = sizeof(pytalloc_Object),
1549 .tp_new = py_dcerpc_bind_nak_version_new,
1553 static PyObject *py_dcerpc_bind_nak_get_reject_reason(PyObject *obj, void *closure)
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;
1561 static int py_dcerpc_bind_nak_set_reject_reason(PyObject *py_obj, PyObject *value, void *closure)
1563 struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(py_obj);
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) {
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);
1577 object->reject_reason = test_var;
1578 } else if (PyInt_Check(value)) {
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);
1586 object->reject_reason = test_var;
1588 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1589 PyInt_Type.tp_name, PyLong_Type.tp_name);
1596 static PyObject *py_dcerpc_bind_nak_get_num_versions(PyObject *obj, void *closure)
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;
1604 static int py_dcerpc_bind_nak_set_num_versions(PyObject *py_obj, PyObject *value, void *closure)
1606 struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(py_obj);
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) {
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);
1620 object->num_versions = test_var;
1621 } else if (PyInt_Check(value)) {
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);
1629 object->num_versions = test_var;
1631 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1632 PyInt_Type.tp_name, PyLong_Type.tp_name);
1639 static PyObject *py_dcerpc_bind_nak_get_versions(PyObject *obj, void *closure)
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) {
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);
1658 static int py_dcerpc_bind_nak_set_versions(PyObject *py_obj, PyObject *value, void *closure)
1660 struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(py_obj);
1661 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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) {
1673 object->versions[versions_cntr_0] = *(struct dcerpc_bind_nak_version *)pytalloc_get_ptr(PyList_GET_ITEM(value, versions_cntr_0));
1679 static PyObject *py_dcerpc_bind_nak_get__pad(PyObject *obj, void *closure)
1681 struct dcerpc_bind_nak *object = (struct dcerpc_bind_nak *)pytalloc_get_ptr(obj);
1683 py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
1687 static int py_dcerpc_bind_nak_set__pad(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
1702 static PyObject *py_dcerpc_bind_nak_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1704 return pytalloc_new(struct dcerpc_bind_nak, type);
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,
1713 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1714 .tp_basicsize = sizeof(pytalloc_Object),
1715 .tp_new = py_dcerpc_bind_nak_new,
1719 static PyObject *py_dcerpc_response_get_alloc_hint(PyObject *obj, void *closure)
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;
1727 static int py_dcerpc_response_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
1729 struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(py_obj);
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) {
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);
1743 object->alloc_hint = test_var;
1744 } else if (PyInt_Check(value)) {
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);
1752 object->alloc_hint = test_var;
1754 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1755 PyInt_Type.tp_name, PyLong_Type.tp_name);
1762 static PyObject *py_dcerpc_response_get_context_id(PyObject *obj, void *closure)
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;
1770 static int py_dcerpc_response_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
1772 struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(py_obj);
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) {
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);
1786 object->context_id = test_var;
1787 } else if (PyInt_Check(value)) {
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);
1795 object->context_id = test_var;
1797 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1798 PyInt_Type.tp_name, PyLong_Type.tp_name);
1805 static PyObject *py_dcerpc_response_get_cancel_count(PyObject *obj, void *closure)
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;
1813 static int py_dcerpc_response_set_cancel_count(PyObject *py_obj, PyObject *value, void *closure)
1815 struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(py_obj);
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) {
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);
1829 object->cancel_count = test_var;
1830 } else if (PyInt_Check(value)) {
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);
1838 object->cancel_count = test_var;
1840 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1841 PyInt_Type.tp_name, PyLong_Type.tp_name);
1848 static PyObject *py_dcerpc_response_get__pad(PyObject *obj, void *closure)
1850 struct dcerpc_response *object = (struct dcerpc_response *)pytalloc_get_ptr(obj);
1852 py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
1856 static int py_dcerpc_response_set__pad(PyObject *py_obj, PyObject *value, void *closure)
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));
1863 static PyObject *py_dcerpc_response_get_stub_and_verifier(PyObject *obj, void *closure)
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;
1871 static int py_dcerpc_response_set_stub_and_verifier(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
1887 static PyObject *py_dcerpc_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1889 return pytalloc_new(struct dcerpc_response, type);
1893 static PyTypeObject dcerpc_response_Type = {
1894 PyObject_HEAD_INIT(NULL) 0,
1895 .tp_name = "dcerpc.response",
1896 .tp_getset = py_dcerpc_response_getsetters,
1898 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1899 .tp_basicsize = sizeof(pytalloc_Object),
1900 .tp_new = py_dcerpc_response_new,
1904 static PyObject *py_dcerpc_fault_get_alloc_hint(PyObject *obj, void *closure)
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;
1912 static int py_dcerpc_fault_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
1914 struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
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) {
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);
1928 object->alloc_hint = test_var;
1929 } else if (PyInt_Check(value)) {
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);
1937 object->alloc_hint = test_var;
1939 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1940 PyInt_Type.tp_name, PyLong_Type.tp_name);
1947 static PyObject *py_dcerpc_fault_get_context_id(PyObject *obj, void *closure)
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;
1955 static int py_dcerpc_fault_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
1957 struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
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) {
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);
1971 object->context_id = test_var;
1972 } else if (PyInt_Check(value)) {
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);
1980 object->context_id = test_var;
1982 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1983 PyInt_Type.tp_name, PyLong_Type.tp_name);
1990 static PyObject *py_dcerpc_fault_get_cancel_count(PyObject *obj, void *closure)
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;
1998 static int py_dcerpc_fault_set_cancel_count(PyObject *py_obj, PyObject *value, void *closure)
2000 struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
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) {
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);
2014 object->cancel_count = test_var;
2015 } else if (PyInt_Check(value)) {
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);
2023 object->cancel_count = test_var;
2025 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2026 PyInt_Type.tp_name, PyLong_Type.tp_name);
2033 static PyObject *py_dcerpc_fault_get_status(PyObject *obj, void *closure)
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);
2041 static int py_dcerpc_fault_set_status(PyObject *py_obj, PyObject *value, void *closure)
2043 struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(py_obj);
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) {
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);
2057 object->status = test_var;
2058 } else if (PyInt_Check(value)) {
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);
2066 object->status = test_var;
2068 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2069 PyInt_Type.tp_name, PyLong_Type.tp_name);
2076 static PyObject *py_dcerpc_fault_get__pad(PyObject *obj, void *closure)
2078 struct dcerpc_fault *object = (struct dcerpc_fault *)pytalloc_get_ptr(obj);
2080 py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
2084 static int py_dcerpc_fault_set__pad(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
2100 static PyObject *py_dcerpc_fault_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2102 return pytalloc_new(struct dcerpc_fault, type);
2106 static PyTypeObject dcerpc_fault_Type = {
2107 PyObject_HEAD_INIT(NULL) 0,
2108 .tp_name = "dcerpc.fault",
2109 .tp_getset = py_dcerpc_fault_getsetters,
2111 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2112 .tp_basicsize = sizeof(pytalloc_Object),
2113 .tp_new = py_dcerpc_fault_new,
2117 static PyObject *py_dcerpc_auth_get_auth_type(PyObject *obj, void *closure)
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;
2125 static int py_dcerpc_auth_set_auth_type(PyObject *py_obj, PyObject *value, void *closure)
2127 struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
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) {
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);
2141 object->auth_type = test_var;
2142 } else if (PyInt_Check(value)) {
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);
2150 object->auth_type = test_var;
2152 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2153 PyInt_Type.tp_name, PyLong_Type.tp_name);
2160 static PyObject *py_dcerpc_auth_get_auth_level(PyObject *obj, void *closure)
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;
2168 static int py_dcerpc_auth_set_auth_level(PyObject *py_obj, PyObject *value, void *closure)
2170 struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
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) {
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);
2184 object->auth_level = test_var;
2185 } else if (PyInt_Check(value)) {
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);
2193 object->auth_level = test_var;
2195 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2196 PyInt_Type.tp_name, PyLong_Type.tp_name);
2203 static PyObject *py_dcerpc_auth_get_auth_pad_length(PyObject *obj, void *closure)
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;
2211 static int py_dcerpc_auth_set_auth_pad_length(PyObject *py_obj, PyObject *value, void *closure)
2213 struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
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) {
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);
2227 object->auth_pad_length = test_var;
2228 } else if (PyInt_Check(value)) {
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);
2236 object->auth_pad_length = test_var;
2238 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2239 PyInt_Type.tp_name, PyLong_Type.tp_name);
2246 static PyObject *py_dcerpc_auth_get_auth_reserved(PyObject *obj, void *closure)
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;
2254 static int py_dcerpc_auth_set_auth_reserved(PyObject *py_obj, PyObject *value, void *closure)
2256 struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
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) {
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);
2270 object->auth_reserved = test_var;
2271 } else if (PyInt_Check(value)) {
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);
2279 object->auth_reserved = test_var;
2281 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2282 PyInt_Type.tp_name, PyLong_Type.tp_name);
2289 static PyObject *py_dcerpc_auth_get_auth_context_id(PyObject *obj, void *closure)
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;
2297 static int py_dcerpc_auth_set_auth_context_id(PyObject *py_obj, PyObject *value, void *closure)
2299 struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
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) {
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);
2313 object->auth_context_id = test_var;
2314 } else if (PyInt_Check(value)) {
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);
2322 object->auth_context_id = test_var;
2324 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2325 PyInt_Type.tp_name, PyLong_Type.tp_name);
2332 static PyObject *py_dcerpc_auth_get_credentials(PyObject *obj, void *closure)
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;
2340 static int py_dcerpc_auth_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
2357 static PyObject *py_dcerpc_auth_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2359 return pytalloc_new(struct dcerpc_auth, type);
2362 static PyObject *py_dcerpc_auth_ndr_pack(PyObject *py_obj)
2364 struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
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);
2373 return PyString_FromStringAndSize((char *)blob.data, blob.length);
2376 static PyObject *py_dcerpc_auth_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2378 struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
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;
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)) {
2392 blob.length = blob_length;
2394 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2395 allow_remaining = true;
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);
2401 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth);
2403 if (err != NDR_ERR_SUCCESS) {
2404 PyErr_SetNdrError(err);
2411 static PyObject *py_dcerpc_auth_ndr_print(PyObject *py_obj)
2413 struct dcerpc_auth *object = (struct dcerpc_auth *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
2443 static PyObject *py_dcerpc_auth3_get__pad(PyObject *obj, void *closure)
2445 struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(obj);
2447 py__pad = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
2451 static int py_dcerpc_auth3_set__pad(PyObject *py_obj, PyObject *value, void *closure)
2453 struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
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) {
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);
2467 object->_pad = test_var;
2468 } else if (PyInt_Check(value)) {
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);
2476 object->_pad = test_var;
2478 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2479 PyInt_Type.tp_name, PyLong_Type.tp_name);
2486 static PyObject *py_dcerpc_auth3_get_auth_info(PyObject *obj, void *closure)
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;
2494 static int py_dcerpc_auth3_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
2507 static PyObject *py_dcerpc_auth3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2509 return pytalloc_new(struct dcerpc_auth3, type);
2512 static PyObject *py_dcerpc_auth3_ndr_pack(PyObject *py_obj)
2514 struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
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);
2523 return PyString_FromStringAndSize((char *)blob.data, blob.length);
2526 static PyObject *py_dcerpc_auth3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2528 struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
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;
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)) {
2542 blob.length = blob_length;
2544 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2545 allow_remaining = true;
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);
2551 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth3);
2553 if (err != NDR_ERR_SUCCESS) {
2554 PyErr_SetNdrError(err);
2561 static PyObject *py_dcerpc_auth3_ndr_print(PyObject *py_obj)
2563 struct dcerpc_auth3 *object = (struct dcerpc_auth3 *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
2593 static PyObject *py_dcerpc_orphaned_get__pad(PyObject *obj, void *closure)
2595 struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(obj);
2597 py__pad = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
2601 static int py_dcerpc_orphaned_set__pad(PyObject *py_obj, PyObject *value, void *closure)
2603 struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
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) {
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);
2617 object->_pad = test_var;
2618 } else if (PyInt_Check(value)) {
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);
2626 object->_pad = test_var;
2628 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2629 PyInt_Type.tp_name, PyLong_Type.tp_name);
2636 static PyObject *py_dcerpc_orphaned_get_auth_info(PyObject *obj, void *closure)
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;
2644 static int py_dcerpc_orphaned_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
2657 static PyObject *py_dcerpc_orphaned_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2659 return pytalloc_new(struct dcerpc_orphaned, type);
2662 static PyObject *py_dcerpc_orphaned_ndr_pack(PyObject *py_obj)
2664 struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
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);
2673 return PyString_FromStringAndSize((char *)blob.data, blob.length);
2676 static PyObject *py_dcerpc_orphaned_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2678 struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
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;
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)) {
2692 blob.length = blob_length;
2694 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2695 allow_remaining = true;
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);
2701 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_orphaned);
2703 if (err != NDR_ERR_SUCCESS) {
2704 PyErr_SetNdrError(err);
2711 static PyObject *py_dcerpc_orphaned_ndr_print(PyObject *py_obj)
2713 struct dcerpc_orphaned *object = (struct dcerpc_orphaned *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
2743 static PyObject *py_dcerpc_co_cancel_get__pad(PyObject *obj, void *closure)
2745 struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(obj);
2747 py__pad = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
2751 static int py_dcerpc_co_cancel_set__pad(PyObject *py_obj, PyObject *value, void *closure)
2753 struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
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) {
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);
2767 object->_pad = test_var;
2768 } else if (PyInt_Check(value)) {
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);
2776 object->_pad = test_var;
2778 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2779 PyInt_Type.tp_name, PyLong_Type.tp_name);
2786 static PyObject *py_dcerpc_co_cancel_get_auth_info(PyObject *obj, void *closure)
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;
2794 static int py_dcerpc_co_cancel_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
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));
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 },
2807 static PyObject *py_dcerpc_co_cancel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2809 return pytalloc_new(struct dcerpc_co_cancel, type);
2812 static PyObject *py_dcerpc_co_cancel_ndr_pack(PyObject *py_obj)
2814 struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
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);
2823 return PyString_FromStringAndSize((char *)blob.data, blob.length);
2826 static PyObject *py_dcerpc_co_cancel_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2828 struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
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;
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)) {
2842 blob.length = blob_length;
2844 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2845 allow_remaining = true;
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);
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);
2853 if (err != NDR_ERR_SUCCESS) {
2854 PyErr_SetNdrError(err);
2861 static PyObject *py_dcerpc_co_cancel_ndr_print(PyObject *py_obj)
2863 struct dcerpc_co_cancel *object = (struct dcerpc_co_cancel *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
2893 static PyObject *py_dcerpc_cl_cancel_get_version(PyObject *obj, void *closure)
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);
2901 static int py_dcerpc_cl_cancel_set_version(PyObject *py_obj, PyObject *value, void *closure)
2903 struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
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) {
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);
2917 object->version = test_var;
2918 } else if (PyInt_Check(value)) {
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);
2926 object->version = test_var;
2928 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2929 PyInt_Type.tp_name, PyLong_Type.tp_name);
2936 static PyObject *py_dcerpc_cl_cancel_get_id(PyObject *obj, void *closure)
2938 struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(obj);
2940 py_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->id);
2944 static int py_dcerpc_cl_cancel_set_id(PyObject *py_obj, PyObject *value, void *closure)
2946 struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
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) {
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);
2960 object->id = test_var;
2961 } else if (PyInt_Check(value)) {
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);
2969 object->id = test_var;
2971 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2972 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
2985 static PyObject *py_dcerpc_cl_cancel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2987 return pytalloc_new(struct dcerpc_cl_cancel, type);
2990 static PyObject *py_dcerpc_cl_cancel_ndr_pack(PyObject *py_obj)
2992 struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
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);
3001 return PyString_FromStringAndSize((char *)blob.data, blob.length);
3004 static PyObject *py_dcerpc_cl_cancel_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3006 struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
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;
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)) {
3020 blob.length = blob_length;
3022 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3023 allow_remaining = true;
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);
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);
3031 if (err != NDR_ERR_SUCCESS) {
3032 PyErr_SetNdrError(err);
3039 static PyObject *py_dcerpc_cl_cancel_ndr_print(PyObject *py_obj)
3041 struct dcerpc_cl_cancel *object = (struct dcerpc_cl_cancel *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
3071 static PyObject *py_dcerpc_cancel_ack_get_version(PyObject *obj, void *closure)
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);
3079 static int py_dcerpc_cancel_ack_set_version(PyObject *py_obj, PyObject *value, void *closure)
3081 struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
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) {
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);
3095 object->version = test_var;
3096 } else if (PyInt_Check(value)) {
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);
3104 object->version = test_var;
3106 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3107 PyInt_Type.tp_name, PyLong_Type.tp_name);
3114 static PyObject *py_dcerpc_cancel_ack_get_id(PyObject *obj, void *closure)
3116 struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(obj);
3118 py_id = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->id);
3122 static int py_dcerpc_cancel_ack_set_id(PyObject *py_obj, PyObject *value, void *closure)
3124 struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
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) {
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);
3138 object->id = test_var;
3139 } else if (PyInt_Check(value)) {
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);
3147 object->id = test_var;
3149 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3150 PyInt_Type.tp_name, PyLong_Type.tp_name);
3157 static PyObject *py_dcerpc_cancel_ack_get_server_is_accepting(PyObject *obj, void *closure)
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;
3165 static int py_dcerpc_cancel_ack_set_server_is_accepting(PyObject *py_obj, PyObject *value, void *closure)
3167 struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
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) {
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);
3181 object->server_is_accepting = test_var;
3182 } else if (PyInt_Check(value)) {
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);
3190 object->server_is_accepting = test_var;
3192 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3193 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
3207 static PyObject *py_dcerpc_cancel_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3209 return pytalloc_new(struct dcerpc_cancel_ack, type);
3212 static PyObject *py_dcerpc_cancel_ack_ndr_pack(PyObject *py_obj)
3214 struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
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);
3223 return PyString_FromStringAndSize((char *)blob.data, blob.length);
3226 static PyObject *py_dcerpc_cancel_ack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3228 struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
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;
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)) {
3242 blob.length = blob_length;
3244 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3245 allow_remaining = true;
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);
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);
3253 if (err != NDR_ERR_SUCCESS) {
3254 PyErr_SetNdrError(err);
3261 static PyObject *py_dcerpc_cancel_ack_ndr_print(PyObject *py_obj)
3263 struct dcerpc_cancel_ack *object = (struct dcerpc_cancel_ack *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
3293 static PyObject *py_dcerpc_fack_get_version(PyObject *obj, void *closure)
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);
3301 static int py_dcerpc_fack_set_version(PyObject *py_obj, PyObject *value, void *closure)
3303 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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) {
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);
3317 object->version = test_var;
3318 } else if (PyInt_Check(value)) {
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);
3326 object->version = test_var;
3328 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3329 PyInt_Type.tp_name, PyLong_Type.tp_name);
3336 static PyObject *py_dcerpc_fack_get__pad1(PyObject *obj, void *closure)
3338 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(obj);
3340 py__pad1 = PyInt_FromLong((uint16_t)object->_pad1);
3344 static int py_dcerpc_fack_set__pad1(PyObject *py_obj, PyObject *value, void *closure)
3346 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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) {
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);
3360 object->_pad1 = test_var;
3361 } else if (PyInt_Check(value)) {
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);
3369 object->_pad1 = test_var;
3371 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3372 PyInt_Type.tp_name, PyLong_Type.tp_name);
3379 static PyObject *py_dcerpc_fack_get_window_size(PyObject *obj, void *closure)
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;
3387 static int py_dcerpc_fack_set_window_size(PyObject *py_obj, PyObject *value, void *closure)
3389 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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) {
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);
3403 object->window_size = test_var;
3404 } else if (PyInt_Check(value)) {
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);
3412 object->window_size = test_var;
3414 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3415 PyInt_Type.tp_name, PyLong_Type.tp_name);
3422 static PyObject *py_dcerpc_fack_get_max_tdsu(PyObject *obj, void *closure)
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);
3430 static int py_dcerpc_fack_set_max_tdsu(PyObject *py_obj, PyObject *value, void *closure)
3432 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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) {
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);
3446 object->max_tdsu = test_var;
3447 } else if (PyInt_Check(value)) {
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);
3455 object->max_tdsu = test_var;
3457 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3458 PyInt_Type.tp_name, PyLong_Type.tp_name);
3465 static PyObject *py_dcerpc_fack_get_max_frag_size(PyObject *obj, void *closure)
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;
3473 static int py_dcerpc_fack_set_max_frag_size(PyObject *py_obj, PyObject *value, void *closure)
3475 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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) {
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);
3489 object->max_frag_size = test_var;
3490 } else if (PyInt_Check(value)) {
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);
3498 object->max_frag_size = test_var;
3500 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3501 PyInt_Type.tp_name, PyLong_Type.tp_name);
3508 static PyObject *py_dcerpc_fack_get_serial_no(PyObject *obj, void *closure)
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;
3516 static int py_dcerpc_fack_set_serial_no(PyObject *py_obj, PyObject *value, void *closure)
3518 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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) {
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);
3532 object->serial_no = test_var;
3533 } else if (PyInt_Check(value)) {
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);
3541 object->serial_no = test_var;
3543 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3544 PyInt_Type.tp_name, PyLong_Type.tp_name);
3551 static PyObject *py_dcerpc_fack_get_selack_size(PyObject *obj, void *closure)
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;
3559 static int py_dcerpc_fack_set_selack_size(PyObject *py_obj, PyObject *value, void *closure)
3561 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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) {
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);
3575 object->selack_size = test_var;
3576 } else if (PyInt_Check(value)) {
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);
3584 object->selack_size = test_var;
3586 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3587 PyInt_Type.tp_name, PyLong_Type.tp_name);
3594 static PyObject *py_dcerpc_fack_get_selack(PyObject *obj, void *closure)
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) {
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);
3613 static int py_dcerpc_fack_set_selack(PyObject *py_obj, PyObject *value, void *closure)
3615 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
3616 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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++) {
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) {
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);
3636 object->selack[selack_cntr_0] = test_var;
3637 } else if (PyInt_Check(PyList_GET_ITEM(value, selack_cntr_0))) {
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);
3645 object->selack[selack_cntr_0] = test_var;
3647 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3648 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
3669 static PyObject *py_dcerpc_fack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3671 return pytalloc_new(struct dcerpc_fack, type);
3674 static PyObject *py_dcerpc_fack_ndr_pack(PyObject *py_obj)
3676 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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);
3685 return PyString_FromStringAndSize((char *)blob.data, blob.length);
3688 static PyObject *py_dcerpc_fack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3690 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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;
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)) {
3704 blob.length = blob_length;
3706 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3707 allow_remaining = true;
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);
3713 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_fack);
3715 if (err != NDR_ERR_SUCCESS) {
3716 PyErr_SetNdrError(err);
3723 static PyObject *py_dcerpc_fack_ndr_print(PyObject *py_obj)
3725 struct dcerpc_fack *object = (struct dcerpc_fack *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
3755 static PyObject *py_dcerpc_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3757 return pytalloc_new(struct dcerpc_ack, type);
3760 static PyObject *py_dcerpc_ack_ndr_pack(PyObject *py_obj)
3762 struct dcerpc_ack *object = (struct dcerpc_ack *)pytalloc_get_ptr(py_obj);
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);
3771 return PyString_FromStringAndSize((char *)blob.data, blob.length);
3774 static PyObject *py_dcerpc_ack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3776 struct dcerpc_ack *object = (struct dcerpc_ack *)pytalloc_get_ptr(py_obj);
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;
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)) {
3790 blob.length = blob_length;
3792 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3793 allow_remaining = true;
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);
3799 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ack);
3801 if (err != NDR_ERR_SUCCESS) {
3802 PyErr_SetNdrError(err);
3809 static PyObject *py_dcerpc_ack_ndr_print(PyObject *py_obj)
3811 struct dcerpc_ack *object = (struct dcerpc_ack *)pytalloc_get_ptr(py_obj);
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);
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 }
3830 static PyTypeObject dcerpc_ack_Type = {
3831 PyObject_HEAD_INIT(NULL) 0,
3832 .tp_name = "dcerpc.ack",
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,
3841 static PyObject *py_dcerpc_ping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3843 return pytalloc_new(struct dcerpc_ping, type);
3846 static PyObject *py_dcerpc_ping_ndr_pack(PyObject *py_obj)
3848 struct dcerpc_ping *object = (struct dcerpc_ping *)pytalloc_get_ptr(py_obj);
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);
3857 return PyString_FromStringAndSize((char *)blob.data, blob.length);
3860 static PyObject *py_dcerpc_ping_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3862 struct dcerpc_ping *object = (struct dcerpc_ping *)pytalloc_get_ptr(py_obj);
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;
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)) {
3876 blob.length = blob_length;
3878 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3879 allow_remaining = true;
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);
3885 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ping);
3887 if (err != NDR_ERR_SUCCESS) {
3888 PyErr_SetNdrError(err);
3895 static PyObject *py_dcerpc_ping_ndr_print(PyObject *py_obj)
3897 struct dcerpc_ping *object = (struct dcerpc_ping *)pytalloc_get_ptr(py_obj);
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);
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 }
3916 static PyTypeObject dcerpc_ping_Type = {
3917 PyObject_HEAD_INIT(NULL) 0,
3918 .tp_name = "dcerpc.ping",
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,
3927 static PyObject *py_dcerpc_shutdown_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3929 return pytalloc_new(struct dcerpc_shutdown, type);
3932 static PyObject *py_dcerpc_shutdown_ndr_pack(PyObject *py_obj)
3934 struct dcerpc_shutdown *object = (struct dcerpc_shutdown *)pytalloc_get_ptr(py_obj);
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);
3943 return PyString_FromStringAndSize((char *)blob.data, blob.length);
3946 static PyObject *py_dcerpc_shutdown_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3948 struct dcerpc_shutdown *object = (struct dcerpc_shutdown *)pytalloc_get_ptr(py_obj);
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;
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)) {
3962 blob.length = blob_length;
3964 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3965 allow_remaining = true;
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);
3971 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_shutdown);
3973 if (err != NDR_ERR_SUCCESS) {
3974 PyErr_SetNdrError(err);
3981 static PyObject *py_dcerpc_shutdown_ndr_print(PyObject *py_obj)
3983 struct dcerpc_shutdown *object = (struct dcerpc_shutdown *)pytalloc_get_ptr(py_obj);
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);
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 }
4002 static PyTypeObject dcerpc_shutdown_Type = {
4003 PyObject_HEAD_INIT(NULL) 0,
4004 .tp_name = "dcerpc.shutdown",
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,
4013 static PyObject *py_dcerpc_working_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4015 return pytalloc_new(struct dcerpc_working, type);
4018 static PyObject *py_dcerpc_working_ndr_pack(PyObject *py_obj)
4020 struct dcerpc_working *object = (struct dcerpc_working *)pytalloc_get_ptr(py_obj);
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);
4029 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4032 static PyObject *py_dcerpc_working_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4034 struct dcerpc_working *object = (struct dcerpc_working *)pytalloc_get_ptr(py_obj);
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;
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)) {
4048 blob.length = blob_length;
4050 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4051 allow_remaining = true;
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);
4057 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_working);
4059 if (err != NDR_ERR_SUCCESS) {
4060 PyErr_SetNdrError(err);
4067 static PyObject *py_dcerpc_working_ndr_print(PyObject *py_obj)
4069 struct dcerpc_working *object = (struct dcerpc_working *)pytalloc_get_ptr(py_obj);
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);
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 }
4088 static PyTypeObject dcerpc_working_Type = {
4089 PyObject_HEAD_INIT(NULL) 0,
4090 .tp_name = "dcerpc.working",
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,
4099 static PyObject *py_RTSCookie_get_Cookie(PyObject *obj, void *closure)
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);
4107 static int py_RTSCookie_set_Cookie(PyObject *py_obj, PyObject *value, void *closure)
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) {
4115 object->Cookie = *(struct GUID *)pytalloc_get_ptr(value);
4119 static PyGetSetDef py_RTSCookie_getsetters[] = {
4120 { discard_const_p(char, "Cookie"), py_RTSCookie_get_Cookie, py_RTSCookie_set_Cookie },
4124 static PyObject *py_RTSCookie_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4126 return pytalloc_new(struct RTSCookie, type);
4129 static PyObject *py_RTSCookie_ndr_pack(PyObject *py_obj)
4131 struct RTSCookie *object = (struct RTSCookie *)pytalloc_get_ptr(py_obj);
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);
4140 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4143 static PyObject *py_RTSCookie_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4145 struct RTSCookie *object = (struct RTSCookie *)pytalloc_get_ptr(py_obj);
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;
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)) {
4159 blob.length = blob_length;
4161 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4162 allow_remaining = true;
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);
4168 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RTSCookie);
4170 if (err != NDR_ERR_SUCCESS) {
4171 PyErr_SetNdrError(err);
4178 static PyObject *py_RTSCookie_ndr_print(PyObject *py_obj)
4180 struct RTSCookie *object = (struct RTSCookie *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
4209 PyObject *py_import_ClientAddressType(TALLOC_CTX *mem_ctx, int level, union ClientAddressType *in)
4215 ret = PyString_FromStringOrNULL(in->ClientAddressIPV4);
4219 ret = PyString_FromStringOrNULL(in->ClientAddressIPV6);
4223 PyErr_SetString(PyExc_TypeError, "unknown union level");
4227 union ClientAddressType *py_export_ClientAddressType(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4229 union ClientAddressType *ret = talloc_zero(mem_ctx, union ClientAddressType);
4232 ret->ClientAddressIPV4 = PyString_AS_STRING(in);
4236 ret->ClientAddressIPV6 = PyString_AsString(in);
4240 PyErr_SetString(PyExc_TypeError, "invalid union level value");
4249 static PyObject *py_ClientAddress_get_AddressType(PyObject *obj, void *closure)
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;
4257 static int py_ClientAddress_set_AddressType(PyObject *py_obj, PyObject *value, void *closure)
4259 struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
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) {
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);
4273 object->AddressType = test_var;
4274 } else if (PyInt_Check(value)) {
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);
4282 object->AddressType = test_var;
4284 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4285 PyInt_Type.tp_name, PyLong_Type.tp_name);
4292 static PyObject *py_ClientAddress_get_ClientAddress(PyObject *obj, void *closure)
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) {
4300 return py_ClientAddress;
4303 static int py_ClientAddress_set_ClientAddress(PyObject *py_obj, PyObject *value, void *closure)
4305 struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
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) {
4312 object->ClientAddress = *ClientAddress_switch_0;
4317 static PyObject *py_ClientAddress_get_Padding(PyObject *obj, void *closure)
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) {
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);
4336 static int py_ClientAddress_set_Padding(PyObject *py_obj, PyObject *value, void *closure)
4338 struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
4339 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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));
4346 for (Padding_cntr_0 = 0; Padding_cntr_0 < PyList_GET_SIZE(value); Padding_cntr_0++) {
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) {
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);
4360 object->Padding[Padding_cntr_0] = test_var;
4361 } else if (PyInt_Check(PyList_GET_ITEM(value, Padding_cntr_0))) {
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);
4369 object->Padding[Padding_cntr_0] = test_var;
4371 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4372 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
4388 static PyObject *py_ClientAddress_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4390 return pytalloc_new(struct ClientAddress, type);
4393 static PyObject *py_ClientAddress_ndr_pack(PyObject *py_obj)
4395 struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
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);
4404 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4407 static PyObject *py_ClientAddress_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4409 struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
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;
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)) {
4423 blob.length = blob_length;
4425 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4426 allow_remaining = true;
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);
4432 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ClientAddress);
4434 if (err != NDR_ERR_SUCCESS) {
4435 PyErr_SetNdrError(err);
4442 static PyObject *py_ClientAddress_ndr_print(PyObject *py_obj)
4444 struct ClientAddress *object = (struct ClientAddress *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
4474 static PyObject *py_FlowControlAcknowledgment_get_BytesReceived(PyObject *obj, void *closure)
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;
4482 static int py_FlowControlAcknowledgment_set_BytesReceived(PyObject *py_obj, PyObject *value, void *closure)
4484 struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
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) {
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);
4498 object->BytesReceived = test_var;
4499 } else if (PyInt_Check(value)) {
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);
4507 object->BytesReceived = test_var;
4509 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4510 PyInt_Type.tp_name, PyLong_Type.tp_name);
4517 static PyObject *py_FlowControlAcknowledgment_get_AvailableWindow(PyObject *obj, void *closure)
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;
4525 static int py_FlowControlAcknowledgment_set_AvailableWindow(PyObject *py_obj, PyObject *value, void *closure)
4527 struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
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) {
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);
4541 object->AvailableWindow = test_var;
4542 } else if (PyInt_Check(value)) {
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);
4550 object->AvailableWindow = test_var;
4552 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4553 PyInt_Type.tp_name, PyLong_Type.tp_name);
4560 static PyObject *py_FlowControlAcknowledgment_get_ChannelCookie(PyObject *obj, void *closure)
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;
4568 static int py_FlowControlAcknowledgment_set_ChannelCookie(PyObject *py_obj, PyObject *value, void *closure)
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) {
4576 object->ChannelCookie = *(struct RTSCookie *)pytalloc_get_ptr(value);
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 },
4587 static PyObject *py_FlowControlAcknowledgment_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4589 return pytalloc_new(struct FlowControlAcknowledgment, type);
4592 static PyObject *py_FlowControlAcknowledgment_ndr_pack(PyObject *py_obj)
4594 struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
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);
4603 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4606 static PyObject *py_FlowControlAcknowledgment_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4608 struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
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;
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)) {
4622 blob.length = blob_length;
4624 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4625 allow_remaining = true;
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);
4631 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_FlowControlAcknowledgment);
4633 if (err != NDR_ERR_SUCCESS) {
4634 PyErr_SetNdrError(err);
4641 static PyObject *py_FlowControlAcknowledgment_ndr_print(PyObject *py_obj)
4643 struct FlowControlAcknowledgment *object = (struct FlowControlAcknowledgment *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
4673 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_get_ReceiveWindowSize(PyObject *obj, void *closure)
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;
4681 static int py_dcerpc_rts_cmd_ReceiveWindowSize_set_ReceiveWindowSize(PyObject *py_obj, PyObject *value, void *closure)
4683 struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(py_obj);
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) {
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);
4697 object->ReceiveWindowSize = test_var;
4698 } else if (PyInt_Check(value)) {
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);
4706 object->ReceiveWindowSize = test_var;
4708 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4709 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
4721 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4723 return pytalloc_new(struct dcerpc_rts_cmd_ReceiveWindowSize, type);
4726 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_pack(PyObject *py_obj)
4728 struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(py_obj);
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);
4737 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4740 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4742 struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(py_obj);
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;
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)) {
4756 blob.length = blob_length;
4758 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4759 allow_remaining = true;
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);
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);
4767 if (err != NDR_ERR_SUCCESS) {
4768 PyErr_SetNdrError(err);
4775 static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_print(PyObject *py_obj)
4777 struct dcerpc_rts_cmd_ReceiveWindowSize *object = (struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
4807 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_get_Ack(PyObject *obj, void *closure)
4809 struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(obj);
4811 py_Ack = pytalloc_reference_ex(&FlowControlAcknowledgment_Type, pytalloc_get_mem_ctx(obj), &object->Ack);
4815 static int py_dcerpc_rts_cmd_FlowControlAck_set_Ack(PyObject *py_obj, PyObject *value, void *closure)
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) {
4823 object->Ack = *(struct FlowControlAcknowledgment *)pytalloc_get_ptr(value);
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 },
4832 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4834 return pytalloc_new(struct dcerpc_rts_cmd_FlowControlAck, type);
4837 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_pack(PyObject *py_obj)
4839 struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(py_obj);
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);
4848 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4851 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4853 struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(py_obj);
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;
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)) {
4867 blob.length = blob_length;
4869 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4870 allow_remaining = true;
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);
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);
4878 if (err != NDR_ERR_SUCCESS) {
4879 PyErr_SetNdrError(err);
4886 static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_print(PyObject *py_obj)
4888 struct dcerpc_rts_cmd_FlowControlAck *object = (struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
4918 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_get_ConnectionTimeout(PyObject *obj, void *closure)
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;
4926 static int py_dcerpc_rts_cmd_ConnectionTimeout_set_ConnectionTimeout(PyObject *py_obj, PyObject *value, void *closure)
4928 struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(py_obj);
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) {
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);
4942 object->ConnectionTimeout = test_var;
4943 } else if (PyInt_Check(value)) {
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);
4951 object->ConnectionTimeout = test_var;
4953 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4954 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
4966 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4968 return pytalloc_new(struct dcerpc_rts_cmd_ConnectionTimeout, type);
4971 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_pack(PyObject *py_obj)
4973 struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(py_obj);
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);
4982 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4985 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4987 struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(py_obj);
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;
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)) {
5001 blob.length = blob_length;
5003 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5004 allow_remaining = true;
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);
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);
5012 if (err != NDR_ERR_SUCCESS) {
5013 PyErr_SetNdrError(err);
5020 static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_print(PyObject *py_obj)
5022 struct dcerpc_rts_cmd_ConnectionTimeout *object = (struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
5052 static PyObject *py_dcerpc_rts_cmd_Cookie_get_Cookie(PyObject *obj, void *closure)
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);
5060 static int py_dcerpc_rts_cmd_Cookie_set_Cookie(PyObject *py_obj, PyObject *value, void *closure)
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) {
5068 object->Cookie = *(struct RTSCookie *)pytalloc_get_ptr(value);
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 },
5077 static PyObject *py_dcerpc_rts_cmd_Cookie_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5079 return pytalloc_new(struct dcerpc_rts_cmd_Cookie, type);
5082 static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_pack(PyObject *py_obj)
5084 struct dcerpc_rts_cmd_Cookie *object = (struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(py_obj);
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);
5093 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5096 static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5098 struct dcerpc_rts_cmd_Cookie *object = (struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(py_obj);
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;
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)) {
5112 blob.length = blob_length;
5114 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5115 allow_remaining = true;
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);
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);
5123 if (err != NDR_ERR_SUCCESS) {
5124 PyErr_SetNdrError(err);
5131 static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_print(PyObject *py_obj)
5133 struct dcerpc_rts_cmd_Cookie *object = (struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
5163 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_get_ChannelLifetime(PyObject *obj, void *closure)
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;
5171 static int py_dcerpc_rts_cmd_ChannelLifetime_set_ChannelLifetime(PyObject *py_obj, PyObject *value, void *closure)
5173 struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(py_obj);
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) {
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);
5187 object->ChannelLifetime = test_var;
5188 } else if (PyInt_Check(value)) {
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);
5196 object->ChannelLifetime = test_var;
5198 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5199 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
5211 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5213 return pytalloc_new(struct dcerpc_rts_cmd_ChannelLifetime, type);
5216 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_pack(PyObject *py_obj)
5218 struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(py_obj);
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);
5227 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5230 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5232 struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(py_obj);
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;
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)) {
5246 blob.length = blob_length;
5248 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5249 allow_remaining = true;
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);
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);
5257 if (err != NDR_ERR_SUCCESS) {
5258 PyErr_SetNdrError(err);
5265 static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_print(PyObject *py_obj)
5267 struct dcerpc_rts_cmd_ChannelLifetime *object = (struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
5297 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_get_ClientKeepalive(PyObject *obj, void *closure)
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;
5305 static int py_dcerpc_rts_cmd_ClientKeepalive_set_ClientKeepalive(PyObject *py_obj, PyObject *value, void *closure)
5307 struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(py_obj);
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) {
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);
5321 object->ClientKeepalive = test_var;
5322 } else if (PyInt_Check(value)) {
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);
5330 object->ClientKeepalive = test_var;
5332 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5333 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
5345 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5347 return pytalloc_new(struct dcerpc_rts_cmd_ClientKeepalive, type);
5350 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_pack(PyObject *py_obj)
5352 struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(py_obj);
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);
5361 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5364 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5366 struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(py_obj);
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;
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)) {
5380 blob.length = blob_length;
5382 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5383 allow_remaining = true;
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);
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);
5391 if (err != NDR_ERR_SUCCESS) {
5392 PyErr_SetNdrError(err);
5399 static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_print(PyObject *py_obj)
5401 struct dcerpc_rts_cmd_ClientKeepalive *object = (struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
5431 static PyObject *py_dcerpc_rts_cmd_Version_get_Version(PyObject *obj, void *closure)
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);
5439 static int py_dcerpc_rts_cmd_Version_set_Version(PyObject *py_obj, PyObject *value, void *closure)
5441 struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(py_obj);
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) {
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);
5455 object->Version = test_var;
5456 } else if (PyInt_Check(value)) {
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);
5464 object->Version = test_var;
5466 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5467 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
5479 static PyObject *py_dcerpc_rts_cmd_Version_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5481 return pytalloc_new(struct dcerpc_rts_cmd_Version, type);
5484 static PyObject *py_dcerpc_rts_cmd_Version_ndr_pack(PyObject *py_obj)
5486 struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(py_obj);
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);
5495 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5498 static PyObject *py_dcerpc_rts_cmd_Version_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5500 struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(py_obj);
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;
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)) {
5514 blob.length = blob_length;
5516 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5517 allow_remaining = true;
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);
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);
5525 if (err != NDR_ERR_SUCCESS) {
5526 PyErr_SetNdrError(err);
5533 static PyObject *py_dcerpc_rts_cmd_Version_ndr_print(PyObject *py_obj)
5535 struct dcerpc_rts_cmd_Version *object = (struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
5565 static PyObject *py_dcerpc_rts_cmd_Empty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5567 return pytalloc_new(struct dcerpc_rts_cmd_Empty, type);
5570 static PyObject *py_dcerpc_rts_cmd_Empty_ndr_pack(PyObject *py_obj)
5572 struct dcerpc_rts_cmd_Empty *object = (struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(py_obj);
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);
5581 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5584 static PyObject *py_dcerpc_rts_cmd_Empty_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5586 struct dcerpc_rts_cmd_Empty *object = (struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(py_obj);
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;
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)) {
5600 blob.length = blob_length;
5602 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5603 allow_remaining = true;
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);
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);
5611 if (err != NDR_ERR_SUCCESS) {
5612 PyErr_SetNdrError(err);
5619 static PyObject *py_dcerpc_rts_cmd_Empty_ndr_print(PyObject *py_obj)
5621 struct dcerpc_rts_cmd_Empty *object = (struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(py_obj);
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);
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 }
5640 static PyTypeObject dcerpc_rts_cmd_Empty_Type = {
5641 PyObject_HEAD_INIT(NULL) 0,
5642 .tp_name = "dcerpc.rts_cmd_Empty",
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,
5651 static PyObject *py_dcerpc_rts_cmd_Padding_get_ConformanceCount(PyObject *obj, void *closure)
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;
5659 static int py_dcerpc_rts_cmd_Padding_set_ConformanceCount(PyObject *py_obj, PyObject *value, void *closure)
5661 struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
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) {
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);
5675 object->ConformanceCount = test_var;
5676 } else if (PyInt_Check(value)) {
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);
5684 object->ConformanceCount = test_var;
5686 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5687 PyInt_Type.tp_name, PyLong_Type.tp_name);
5694 static PyObject *py_dcerpc_rts_cmd_Padding_get_Padding(PyObject *obj, void *closure)
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) {
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);
5713 static int py_dcerpc_rts_cmd_Padding_set_Padding(PyObject *py_obj, PyObject *value, void *closure)
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;);
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++) {
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) {
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);
5736 object->Padding[Padding_cntr_0] = test_var;
5737 } else if (PyInt_Check(PyList_GET_ITEM(value, Padding_cntr_0))) {
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);
5745 object->Padding[Padding_cntr_0] = test_var;
5747 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5748 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
5763 static PyObject *py_dcerpc_rts_cmd_Padding_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5765 return pytalloc_new(struct dcerpc_rts_cmd_Padding, type);
5768 static PyObject *py_dcerpc_rts_cmd_Padding_ndr_pack(PyObject *py_obj)
5770 struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
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);
5779 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5782 static PyObject *py_dcerpc_rts_cmd_Padding_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5784 struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
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;
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)) {
5798 blob.length = blob_length;
5800 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5801 allow_remaining = true;
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);
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);
5809 if (err != NDR_ERR_SUCCESS) {
5810 PyErr_SetNdrError(err);
5817 static PyObject *py_dcerpc_rts_cmd_Padding_ndr_print(PyObject *py_obj)
5819 struct dcerpc_rts_cmd_Padding *object = (struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
5849 static PyObject *py_dcerpc_rts_cmd_NegativeANCE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5851 return pytalloc_new(struct dcerpc_rts_cmd_NegativeANCE, type);
5854 static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_pack(PyObject *py_obj)
5856 struct dcerpc_rts_cmd_NegativeANCE *object = (struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(py_obj);
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);
5865 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5868 static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5870 struct dcerpc_rts_cmd_NegativeANCE *object = (struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(py_obj);
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;
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)) {
5884 blob.length = blob_length;
5886 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5887 allow_remaining = true;
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);
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);
5895 if (err != NDR_ERR_SUCCESS) {
5896 PyErr_SetNdrError(err);
5903 static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_print(PyObject *py_obj)
5905 struct dcerpc_rts_cmd_NegativeANCE *object = (struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(py_obj);
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);
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 }
5924 static PyTypeObject dcerpc_rts_cmd_NegativeANCE_Type = {
5925 PyObject_HEAD_INIT(NULL) 0,
5926 .tp_name = "dcerpc.rts_cmd_NegativeANCE",
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,
5935 static PyObject *py_dcerpc_rts_cmd_ANCE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5937 return pytalloc_new(struct dcerpc_rts_cmd_ANCE, type);
5940 static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_pack(PyObject *py_obj)
5942 struct dcerpc_rts_cmd_ANCE *object = (struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(py_obj);
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);
5951 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5954 static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5956 struct dcerpc_rts_cmd_ANCE *object = (struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(py_obj);
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;
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)) {
5970 blob.length = blob_length;
5972 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5973 allow_remaining = true;
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);
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);
5981 if (err != NDR_ERR_SUCCESS) {
5982 PyErr_SetNdrError(err);
5989 static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_print(PyObject *py_obj)
5991 struct dcerpc_rts_cmd_ANCE *object = (struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(py_obj);
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);
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 }
6010 static PyTypeObject dcerpc_rts_cmd_ANCE_Type = {
6011 PyObject_HEAD_INIT(NULL) 0,
6012 .tp_name = "dcerpc.rts_cmd_ANCE",
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,
6021 static PyObject *py_dcerpc_rts_cmd_ClientAddress_get_ClientAddress(PyObject *obj, void *closure)
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;
6029 static int py_dcerpc_rts_cmd_ClientAddress_set_ClientAddress(PyObject *py_obj, PyObject *value, void *closure)
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) {
6037 object->ClientAddress = *(struct ClientAddress *)pytalloc_get_ptr(value);
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 },
6046 static PyObject *py_dcerpc_rts_cmd_ClientAddress_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6048 return pytalloc_new(struct dcerpc_rts_cmd_ClientAddress, type);
6051 static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_pack(PyObject *py_obj)
6053 struct dcerpc_rts_cmd_ClientAddress *object = (struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(py_obj);
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);
6062 return PyString_FromStringAndSize((char *)blob.data, blob.length);
6065 static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6067 struct dcerpc_rts_cmd_ClientAddress *object = (struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(py_obj);
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;
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)) {
6081 blob.length = blob_length;
6083 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6084 allow_remaining = true;
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);
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);
6092 if (err != NDR_ERR_SUCCESS) {
6093 PyErr_SetNdrError(err);
6100 static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_print(PyObject *py_obj)
6102 struct dcerpc_rts_cmd_ClientAddress *object = (struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
6132 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_get_AssociationGroupId(PyObject *obj, void *closure)
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;
6140 static int py_dcerpc_rts_cmd_AssociationGroupId_set_AssociationGroupId(PyObject *py_obj, PyObject *value, void *closure)
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) {
6148 object->AssociationGroupId = *(struct RTSCookie *)pytalloc_get_ptr(value);
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 },
6157 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6159 return pytalloc_new(struct dcerpc_rts_cmd_AssociationGroupId, type);
6162 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_pack(PyObject *py_obj)
6164 struct dcerpc_rts_cmd_AssociationGroupId *object = (struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(py_obj);
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);
6173 return PyString_FromStringAndSize((char *)blob.data, blob.length);
6176 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6178 struct dcerpc_rts_cmd_AssociationGroupId *object = (struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(py_obj);
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;
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)) {
6192 blob.length = blob_length;
6194 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6195 allow_remaining = true;
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);
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);
6203 if (err != NDR_ERR_SUCCESS) {
6204 PyErr_SetNdrError(err);
6211 static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_print(PyObject *py_obj)
6213 struct dcerpc_rts_cmd_AssociationGroupId *object = (struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
6243 static PyObject *py_dcerpc_rts_cmd_Destination_get_ForwardDestination(PyObject *obj, void *closure)
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;
6251 static int py_dcerpc_rts_cmd_Destination_set_ForwardDestination(PyObject *py_obj, PyObject *value, void *closure)
6253 struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(py_obj);
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) {
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);
6267 object->ForwardDestination = test_var;
6268 } else if (PyInt_Check(value)) {
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);
6276 object->ForwardDestination = test_var;
6278 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6279 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
6291 static PyObject *py_dcerpc_rts_cmd_Destination_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6293 return pytalloc_new(struct dcerpc_rts_cmd_Destination, type);
6296 static PyObject *py_dcerpc_rts_cmd_Destination_ndr_pack(PyObject *py_obj)
6298 struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(py_obj);
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);
6307 return PyString_FromStringAndSize((char *)blob.data, blob.length);
6310 static PyObject *py_dcerpc_rts_cmd_Destination_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6312 struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(py_obj);
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;
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)) {
6326 blob.length = blob_length;
6328 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6329 allow_remaining = true;
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);
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);
6337 if (err != NDR_ERR_SUCCESS) {
6338 PyErr_SetNdrError(err);
6345 static PyObject *py_dcerpc_rts_cmd_Destination_ndr_print(PyObject *py_obj)
6347 struct dcerpc_rts_cmd_Destination *object = (struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
6377 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_get_PingTrafficSent(PyObject *obj, void *closure)
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;
6385 static int py_dcerpc_rts_cmd_PingTrafficSentNotify_set_PingTrafficSent(PyObject *py_obj, PyObject *value, void *closure)
6387 struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(py_obj);
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) {
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);
6401 object->PingTrafficSent = test_var;
6402 } else if (PyInt_Check(value)) {
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);
6410 object->PingTrafficSent = test_var;
6412 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6413 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
6425 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6427 return pytalloc_new(struct dcerpc_rts_cmd_PingTrafficSentNotify, type);
6430 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_pack(PyObject *py_obj)
6432 struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(py_obj);
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);
6441 return PyString_FromStringAndSize((char *)blob.data, blob.length);
6444 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6446 struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(py_obj);
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;
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)) {
6460 blob.length = blob_length;
6462 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6463 allow_remaining = true;
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);
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);
6471 if (err != NDR_ERR_SUCCESS) {
6472 PyErr_SetNdrError(err);
6479 static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_print(PyObject *py_obj)
6481 struct dcerpc_rts_cmd_PingTrafficSentNotify *object = (struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
6510 PyObject *py_import_dcerpc_rts_cmds(TALLOC_CTX *mem_ctx, int level, union dcerpc_rts_cmds *in)
6516 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ReceiveWindowSize_Type, mem_ctx, &in->ReceiveWindowSize);
6520 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_FlowControlAck_Type, mem_ctx, &in->FlowControlAck);
6524 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ConnectionTimeout_Type, mem_ctx, &in->ConnectionTimeout);
6528 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Cookie_Type, mem_ctx, &in->Cookie);
6532 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ChannelLifetime_Type, mem_ctx, &in->ChannelLifetime);
6536 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ClientKeepalive_Type, mem_ctx, &in->ClientKeepalive);
6540 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Version_Type, mem_ctx, &in->Version);
6544 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Empty_Type, mem_ctx, &in->Empty);
6548 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Padding_Type, mem_ctx, &in->Padding);
6552 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_NegativeANCE_Type, mem_ctx, &in->NegativeANCE);
6556 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ANCE_Type, mem_ctx, &in->ANCE);
6560 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ClientAddress_Type, mem_ctx, &in->ClientAddress);
6564 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_AssociationGroupId_Type, mem_ctx, &in->AssociationGroupId);
6568 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Destination_Type, mem_ctx, &in->Destination);
6572 ret = pytalloc_reference_ex(&dcerpc_rts_cmd_PingTrafficSentNotify_Type, mem_ctx, &in->PingTrafficSentNotify);
6576 PyErr_SetString(PyExc_TypeError, "unknown union level");
6580 union dcerpc_rts_cmds *py_export_dcerpc_rts_cmds(TALLOC_CTX *mem_ctx, int level, PyObject *in)
6582 union dcerpc_rts_cmds *ret = talloc_zero(mem_ctx, union dcerpc_rts_cmds);
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) {
6588 talloc_free(ret); return NULL;
6590 ret->ReceiveWindowSize = *(struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(in);
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) {
6597 talloc_free(ret); return NULL;
6599 ret->FlowControlAck = *(struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(in);
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) {
6606 talloc_free(ret); return NULL;
6608 ret->ConnectionTimeout = *(struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(in);
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) {
6615 talloc_free(ret); return NULL;
6617 ret->Cookie = *(struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(in);
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) {
6624 talloc_free(ret); return NULL;
6626 ret->ChannelLifetime = *(struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(in);
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) {
6633 talloc_free(ret); return NULL;
6635 ret->ClientKeepalive = *(struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(in);
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) {
6642 talloc_free(ret); return NULL;
6644 ret->Version = *(struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(in);
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) {
6651 talloc_free(ret); return NULL;
6653 ret->Empty = *(struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(in);
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) {
6660 talloc_free(ret); return NULL;
6662 ret->Padding = *(struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(in);
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) {
6669 talloc_free(ret); return NULL;
6671 ret->NegativeANCE = *(struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(in);
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) {
6678 talloc_free(ret); return NULL;
6680 ret->ANCE = *(struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(in);
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) {
6687 talloc_free(ret); return NULL;
6689 ret->ClientAddress = *(struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(in);
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) {
6696 talloc_free(ret); return NULL;
6698 ret->AssociationGroupId = *(struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(in);
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) {
6705 talloc_free(ret); return NULL;
6707 ret->Destination = *(struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(in);
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) {
6714 talloc_free(ret); return NULL;
6716 ret->PingTrafficSentNotify = *(struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(in);
6720 PyErr_SetString(PyExc_TypeError, "invalid union level value");
6729 static PyObject *py_dcerpc_rts_cmd_get_CommandType(PyObject *obj, void *closure)
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;
6737 static int py_dcerpc_rts_cmd_set_CommandType(PyObject *py_obj, PyObject *value, void *closure)
6739 struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
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) {
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);
6753 object->CommandType = test_var;
6754 } else if (PyInt_Check(value)) {
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);
6762 object->CommandType = test_var;
6764 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6765 PyInt_Type.tp_name, PyLong_Type.tp_name);
6772 static PyObject *py_dcerpc_rts_cmd_get_Command(PyObject *obj, void *closure)
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) {
6783 static int py_dcerpc_rts_cmd_set_Command(PyObject *py_obj, PyObject *value, void *closure)
6785 struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
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) {
6792 object->Command = *Command_switch_0;
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 },
6803 static PyObject *py_dcerpc_rts_cmd_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6805 return pytalloc_new(struct dcerpc_rts_cmd, type);
6808 static PyObject *py_dcerpc_rts_cmd_ndr_pack(PyObject *py_obj)
6810 struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
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);
6819 return PyString_FromStringAndSize((char *)blob.data, blob.length);
6822 static PyObject *py_dcerpc_rts_cmd_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6824 struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
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;
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)) {
6838 blob.length = blob_length;
6840 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6841 allow_remaining = true;
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);
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);
6849 if (err != NDR_ERR_SUCCESS) {
6850 PyErr_SetNdrError(err);
6857 static PyObject *py_dcerpc_rts_cmd_ndr_print(PyObject *py_obj)
6859 struct dcerpc_rts_cmd *object = (struct dcerpc_rts_cmd *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
6889 static PyObject *py_dcerpc_rts_get_Flags(PyObject *obj, void *closure)
6891 struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(obj);
6893 py_Flags = PyInt_FromLong((uint16_t)object->Flags);
6897 static int py_dcerpc_rts_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
6899 struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
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) {
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);
6913 object->Flags = test_var;
6914 } else if (PyInt_Check(value)) {
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);
6922 object->Flags = test_var;
6924 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6925 PyInt_Type.tp_name, PyLong_Type.tp_name);
6932 static PyObject *py_dcerpc_rts_get_NumberOfCommands(PyObject *obj, void *closure)
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;
6940 static int py_dcerpc_rts_set_NumberOfCommands(PyObject *py_obj, PyObject *value, void *closure)
6942 struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
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) {
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);
6956 object->NumberOfCommands = test_var;
6957 } else if (PyInt_Check(value)) {
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);
6965 object->NumberOfCommands = test_var;
6967 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6968 PyInt_Type.tp_name, PyLong_Type.tp_name);
6975 static PyObject *py_dcerpc_rts_get_Commands(PyObject *obj, void *closure)
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) {
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);
6994 static int py_dcerpc_rts_set_Commands(PyObject *py_obj, PyObject *value, void *closure)
6996 struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
6997 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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) {
7009 object->Commands[Commands_cntr_0] = *(struct dcerpc_rts_cmd *)pytalloc_get_ptr(PyList_GET_ITEM(value, Commands_cntr_0));
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 },
7022 static PyObject *py_dcerpc_rts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7024 return pytalloc_new(struct dcerpc_rts, type);
7027 static PyObject *py_dcerpc_rts_ndr_pack(PyObject *py_obj)
7029 struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
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);
7038 return PyString_FromStringAndSize((char *)blob.data, blob.length);
7041 static PyObject *py_dcerpc_rts_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7043 struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
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;
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)) {
7057 blob.length = blob_length;
7059 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7060 allow_remaining = true;
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);
7066 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts);
7068 if (err != NDR_ERR_SUCCESS) {
7069 PyErr_SetNdrError(err);
7076 static PyObject *py_dcerpc_rts_ndr_print(PyObject *py_obj)
7078 struct dcerpc_rts *object = (struct dcerpc_rts *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
7107 PyObject *py_import_dcerpc_payload(TALLOC_CTX *mem_ctx, int level, union dcerpc_payload *in)
7112 case DCERPC_PKT_REQUEST:
7113 ret = pytalloc_reference_ex(&dcerpc_request_Type, mem_ctx, &in->request);
7116 case DCERPC_PKT_PING:
7117 ret = pytalloc_reference_ex(&dcerpc_ping_Type, mem_ctx, &in->ping);
7120 case DCERPC_PKT_RESPONSE:
7121 ret = pytalloc_reference_ex(&dcerpc_response_Type, mem_ctx, &in->response);
7124 case DCERPC_PKT_FAULT:
7125 ret = pytalloc_reference_ex(&dcerpc_fault_Type, mem_ctx, &in->fault);
7128 case DCERPC_PKT_WORKING:
7129 ret = pytalloc_reference_ex(&dcerpc_working_Type, mem_ctx, &in->working);
7132 case DCERPC_PKT_NOCALL:
7133 ret = pytalloc_reference_ex(&dcerpc_fack_Type, mem_ctx, &in->nocall);
7136 case DCERPC_PKT_REJECT:
7137 ret = pytalloc_reference_ex(&dcerpc_fault_Type, mem_ctx, &in->reject);
7140 case DCERPC_PKT_ACK:
7141 ret = pytalloc_reference_ex(&dcerpc_ack_Type, mem_ctx, &in->ack);
7144 case DCERPC_PKT_CL_CANCEL:
7145 ret = pytalloc_reference_ex(&dcerpc_cl_cancel_Type, mem_ctx, &in->cl_cancel);
7148 case DCERPC_PKT_FACK:
7149 ret = pytalloc_reference_ex(&dcerpc_fack_Type, mem_ctx, &in->fack);
7152 case DCERPC_PKT_CANCEL_ACK:
7153 ret = pytalloc_reference_ex(&dcerpc_cancel_ack_Type, mem_ctx, &in->cancel_ack);
7156 case DCERPC_PKT_BIND:
7157 ret = pytalloc_reference_ex(&dcerpc_bind_Type, mem_ctx, &in->bind);
7160 case DCERPC_PKT_BIND_ACK:
7161 ret = pytalloc_reference_ex(&dcerpc_bind_ack_Type, mem_ctx, &in->bind_ack);
7164 case DCERPC_PKT_BIND_NAK:
7165 ret = pytalloc_reference_ex(&dcerpc_bind_nak_Type, mem_ctx, &in->bind_nak);
7168 case DCERPC_PKT_ALTER:
7169 ret = pytalloc_reference_ex(&dcerpc_bind_Type, mem_ctx, &in->alter);
7172 case DCERPC_PKT_ALTER_RESP:
7173 ret = pytalloc_reference_ex(&dcerpc_bind_ack_Type, mem_ctx, &in->alter_resp);
7176 case DCERPC_PKT_SHUTDOWN:
7177 ret = pytalloc_reference_ex(&dcerpc_shutdown_Type, mem_ctx, &in->shutdown);
7180 case DCERPC_PKT_CO_CANCEL:
7181 ret = pytalloc_reference_ex(&dcerpc_co_cancel_Type, mem_ctx, &in->co_cancel);
7184 case DCERPC_PKT_ORPHANED:
7185 ret = pytalloc_reference_ex(&dcerpc_orphaned_Type, mem_ctx, &in->orphaned);
7188 case DCERPC_PKT_AUTH3:
7189 ret = pytalloc_reference_ex(&dcerpc_auth3_Type, mem_ctx, &in->auth3);
7192 case DCERPC_PKT_RTS:
7193 ret = pytalloc_reference_ex(&dcerpc_rts_Type, mem_ctx, &in->rts);
7197 PyErr_SetString(PyExc_TypeError, "unknown union level");
7201 union dcerpc_payload *py_export_dcerpc_payload(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7203 union dcerpc_payload *ret = talloc_zero(mem_ctx, union dcerpc_payload);
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) {
7209 talloc_free(ret); return NULL;
7211 ret->request = *(struct dcerpc_request *)pytalloc_get_ptr(in);
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) {
7218 talloc_free(ret); return NULL;
7220 ret->ping = *(struct dcerpc_ping *)pytalloc_get_ptr(in);
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) {
7227 talloc_free(ret); return NULL;
7229 ret->response = *(struct dcerpc_response *)pytalloc_get_ptr(in);
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) {
7236 talloc_free(ret); return NULL;
7238 ret->fault = *(struct dcerpc_fault *)pytalloc_get_ptr(in);
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) {
7245 talloc_free(ret); return NULL;
7247 ret->working = *(struct dcerpc_working *)pytalloc_get_ptr(in);
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) {
7254 talloc_free(ret); return NULL;
7256 ret->nocall = *(struct dcerpc_fack *)pytalloc_get_ptr(in);
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) {
7263 talloc_free(ret); return NULL;
7265 ret->reject = *(struct dcerpc_fault *)pytalloc_get_ptr(in);
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) {
7272 talloc_free(ret); return NULL;
7274 ret->ack = *(struct dcerpc_ack *)pytalloc_get_ptr(in);
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) {
7281 talloc_free(ret); return NULL;
7283 ret->cl_cancel = *(struct dcerpc_cl_cancel *)pytalloc_get_ptr(in);
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) {
7290 talloc_free(ret); return NULL;
7292 ret->fack = *(struct dcerpc_fack *)pytalloc_get_ptr(in);
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) {
7299 talloc_free(ret); return NULL;
7301 ret->cancel_ack = *(struct dcerpc_cancel_ack *)pytalloc_get_ptr(in);
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) {
7308 talloc_free(ret); return NULL;
7310 ret->bind = *(struct dcerpc_bind *)pytalloc_get_ptr(in);
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) {
7317 talloc_free(ret); return NULL;
7319 ret->bind_ack = *(struct dcerpc_bind_ack *)pytalloc_get_ptr(in);
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) {
7326 talloc_free(ret); return NULL;
7328 ret->bind_nak = *(struct dcerpc_bind_nak *)pytalloc_get_ptr(in);
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) {
7335 talloc_free(ret); return NULL;
7337 ret->alter = *(struct dcerpc_bind *)pytalloc_get_ptr(in);
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) {
7344 talloc_free(ret); return NULL;
7346 ret->alter_resp = *(struct dcerpc_bind_ack *)pytalloc_get_ptr(in);
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) {
7353 talloc_free(ret); return NULL;
7355 ret->shutdown = *(struct dcerpc_shutdown *)pytalloc_get_ptr(in);
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) {
7362 talloc_free(ret); return NULL;
7364 ret->co_cancel = *(struct dcerpc_co_cancel *)pytalloc_get_ptr(in);
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) {
7371 talloc_free(ret); return NULL;
7373 ret->orphaned = *(struct dcerpc_orphaned *)pytalloc_get_ptr(in);
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) {
7380 talloc_free(ret); return NULL;
7382 ret->auth3 = *(struct dcerpc_auth3 *)pytalloc_get_ptr(in);
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) {
7389 talloc_free(ret); return NULL;
7391 ret->rts = *(struct dcerpc_rts *)pytalloc_get_ptr(in);
7395 PyErr_SetString(PyExc_TypeError, "invalid union level value");
7404 static PyObject *py_ncacn_packet_get_rpc_vers(PyObject *obj, void *closure)
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);
7412 static int py_ncacn_packet_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
7414 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7428 object->rpc_vers = test_var;
7429 } else if (PyInt_Check(value)) {
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);
7437 object->rpc_vers = test_var;
7439 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7440 PyInt_Type.tp_name, PyLong_Type.tp_name);
7447 static PyObject *py_ncacn_packet_get_rpc_vers_minor(PyObject *obj, void *closure)
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;
7455 static int py_ncacn_packet_set_rpc_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
7457 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7471 object->rpc_vers_minor = test_var;
7472 } else if (PyInt_Check(value)) {
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);
7480 object->rpc_vers_minor = test_var;
7482 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7483 PyInt_Type.tp_name, PyLong_Type.tp_name);
7490 static PyObject *py_ncacn_packet_get_ptype(PyObject *obj, void *closure)
7492 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7494 py_ptype = PyInt_FromLong((uint16_t)object->ptype);
7498 static int py_ncacn_packet_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
7500 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7514 object->ptype = test_var;
7515 } else if (PyInt_Check(value)) {
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);
7523 object->ptype = test_var;
7525 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7526 PyInt_Type.tp_name, PyLong_Type.tp_name);
7533 static PyObject *py_ncacn_packet_get_pfc_flags(PyObject *obj, void *closure)
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;
7541 static int py_ncacn_packet_set_pfc_flags(PyObject *py_obj, PyObject *value, void *closure)
7543 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7557 object->pfc_flags = test_var;
7558 } else if (PyInt_Check(value)) {
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);
7566 object->pfc_flags = test_var;
7568 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7569 PyInt_Type.tp_name, PyLong_Type.tp_name);
7576 static PyObject *py_ncacn_packet_get_drep(PyObject *obj, void *closure)
7578 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7580 py_drep = PyList_New(4);
7581 if (py_drep == NULL) {
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);
7595 static int py_ncacn_packet_set_drep(PyObject *py_obj, PyObject *value, void *closure)
7597 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
7598 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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));
7605 for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
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) {
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);
7619 object->drep[drep_cntr_0] = test_var;
7620 } else if (PyInt_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
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);
7628 object->drep[drep_cntr_0] = test_var;
7630 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7631 PyInt_Type.tp_name, PyLong_Type.tp_name);
7640 static PyObject *py_ncacn_packet_get_frag_length(PyObject *obj, void *closure)
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;
7648 static int py_ncacn_packet_set_frag_length(PyObject *py_obj, PyObject *value, void *closure)
7650 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7664 object->frag_length = test_var;
7665 } else if (PyInt_Check(value)) {
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);
7673 object->frag_length = test_var;
7675 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7676 PyInt_Type.tp_name, PyLong_Type.tp_name);
7683 static PyObject *py_ncacn_packet_get_auth_length(PyObject *obj, void *closure)
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;
7691 static int py_ncacn_packet_set_auth_length(PyObject *py_obj, PyObject *value, void *closure)
7693 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7707 object->auth_length = test_var;
7708 } else if (PyInt_Check(value)) {
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);
7716 object->auth_length = test_var;
7718 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7719 PyInt_Type.tp_name, PyLong_Type.tp_name);
7726 static PyObject *py_ncacn_packet_get_call_id(PyObject *obj, void *closure)
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);
7734 static int py_ncacn_packet_set_call_id(PyObject *py_obj, PyObject *value, void *closure)
7736 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7750 object->call_id = test_var;
7751 } else if (PyInt_Check(value)) {
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);
7759 object->call_id = test_var;
7761 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7762 PyInt_Type.tp_name, PyLong_Type.tp_name);
7769 static PyObject *py_ncacn_packet_get_u(PyObject *obj, void *closure)
7771 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(obj);
7773 py_u = py_import_dcerpc_payload(pytalloc_get_mem_ctx(obj), object->ptype, &object->u);
7780 static int py_ncacn_packet_set_u(PyObject *py_obj, PyObject *value, void *closure)
7782 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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) {
7789 object->u = *u_switch_0;
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 },
7807 static PyObject *py_ncacn_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7809 return pytalloc_new(struct ncacn_packet, type);
7812 static PyObject *py_ncacn_packet_ndr_pack(PyObject *py_obj)
7814 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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);
7823 return PyString_FromStringAndSize((char *)blob.data, blob.length);
7826 static PyObject *py_ncacn_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7828 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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;
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)) {
7842 blob.length = blob_length;
7844 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7845 allow_remaining = true;
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);
7851 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncacn_packet);
7853 if (err != NDR_ERR_SUCCESS) {
7854 PyErr_SetNdrError(err);
7861 static PyObject *py_ncacn_packet_ndr_print(PyObject *py_obj)
7863 struct ncacn_packet *object = (struct ncacn_packet *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
7893 static PyObject *py_ncadg_packet_get_rpc_vers(PyObject *obj, void *closure)
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);
7901 static int py_ncadg_packet_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
7903 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7917 object->rpc_vers = test_var;
7918 } else if (PyInt_Check(value)) {
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);
7926 object->rpc_vers = test_var;
7928 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7929 PyInt_Type.tp_name, PyLong_Type.tp_name);
7936 static PyObject *py_ncadg_packet_get_ptype(PyObject *obj, void *closure)
7938 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
7940 py_ptype = PyInt_FromLong((uint16_t)object->ptype);
7944 static int py_ncadg_packet_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
7946 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
7960 object->ptype = test_var;
7961 } else if (PyInt_Check(value)) {
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);
7969 object->ptype = test_var;
7971 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7972 PyInt_Type.tp_name, PyLong_Type.tp_name);
7979 static PyObject *py_ncadg_packet_get_pfc_flags(PyObject *obj, void *closure)
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;
7987 static int py_ncadg_packet_set_pfc_flags(PyObject *py_obj, PyObject *value, void *closure)
7989 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8003 object->pfc_flags = test_var;
8004 } else if (PyInt_Check(value)) {
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);
8012 object->pfc_flags = test_var;
8014 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8015 PyInt_Type.tp_name, PyLong_Type.tp_name);
8022 static PyObject *py_ncadg_packet_get_ncadg_flags(PyObject *obj, void *closure)
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;
8030 static int py_ncadg_packet_set_ncadg_flags(PyObject *py_obj, PyObject *value, void *closure)
8032 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8046 object->ncadg_flags = test_var;
8047 } else if (PyInt_Check(value)) {
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);
8055 object->ncadg_flags = test_var;
8057 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8058 PyInt_Type.tp_name, PyLong_Type.tp_name);
8065 static PyObject *py_ncadg_packet_get_drep(PyObject *obj, void *closure)
8067 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8069 py_drep = PyList_New(3);
8070 if (py_drep == NULL) {
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);
8084 static int py_ncadg_packet_set_drep(PyObject *py_obj, PyObject *value, void *closure)
8086 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
8087 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
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));
8094 for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
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) {
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);
8108 object->drep[drep_cntr_0] = test_var;
8109 } else if (PyInt_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
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);
8117 object->drep[drep_cntr_0] = test_var;
8119 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8120 PyInt_Type.tp_name, PyLong_Type.tp_name);
8129 static PyObject *py_ncadg_packet_get_serial_high(PyObject *obj, void *closure)
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;
8137 static int py_ncadg_packet_set_serial_high(PyObject *py_obj, PyObject *value, void *closure)
8139 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8153 object->serial_high = test_var;
8154 } else if (PyInt_Check(value)) {
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);
8162 object->serial_high = test_var;
8164 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8165 PyInt_Type.tp_name, PyLong_Type.tp_name);
8172 static PyObject *py_ncadg_packet_get_object(PyObject *obj, void *closure)
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);
8180 static int py_ncadg_packet_set_object(PyObject *py_obj, PyObject *value, void *closure)
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) {
8188 object->object = *(struct GUID *)pytalloc_get_ptr(value);
8192 static PyObject *py_ncadg_packet_get_iface(PyObject *obj, void *closure)
8194 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8196 py_iface = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->iface);
8200 static int py_ncadg_packet_set_iface(PyObject *py_obj, PyObject *value, void *closure)
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) {
8208 object->iface = *(struct GUID *)pytalloc_get_ptr(value);
8212 static PyObject *py_ncadg_packet_get_activity(PyObject *obj, void *closure)
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);
8220 static int py_ncadg_packet_set_activity(PyObject *py_obj, PyObject *value, void *closure)
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) {
8228 object->activity = *(struct GUID *)pytalloc_get_ptr(value);
8232 static PyObject *py_ncadg_packet_get_server_boot(PyObject *obj, void *closure)
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;
8240 static int py_ncadg_packet_set_server_boot(PyObject *py_obj, PyObject *value, void *closure)
8242 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8256 object->server_boot = test_var;
8257 } else if (PyInt_Check(value)) {
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);
8265 object->server_boot = test_var;
8267 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8268 PyInt_Type.tp_name, PyLong_Type.tp_name);
8275 static PyObject *py_ncadg_packet_get_iface_version(PyObject *obj, void *closure)
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;
8283 static int py_ncadg_packet_set_iface_version(PyObject *py_obj, PyObject *value, void *closure)
8285 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8299 object->iface_version = test_var;
8300 } else if (PyInt_Check(value)) {
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);
8308 object->iface_version = test_var;
8310 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8311 PyInt_Type.tp_name, PyLong_Type.tp_name);
8318 static PyObject *py_ncadg_packet_get_seq_num(PyObject *obj, void *closure)
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);
8326 static int py_ncadg_packet_set_seq_num(PyObject *py_obj, PyObject *value, void *closure)
8328 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8342 object->seq_num = test_var;
8343 } else if (PyInt_Check(value)) {
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);
8351 object->seq_num = test_var;
8353 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8354 PyInt_Type.tp_name, PyLong_Type.tp_name);
8361 static PyObject *py_ncadg_packet_get_opnum(PyObject *obj, void *closure)
8363 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8365 py_opnum = PyInt_FromLong((uint16_t)object->opnum);
8369 static int py_ncadg_packet_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
8371 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8385 object->opnum = test_var;
8386 } else if (PyInt_Check(value)) {
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);
8394 object->opnum = test_var;
8396 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8397 PyInt_Type.tp_name, PyLong_Type.tp_name);
8404 static PyObject *py_ncadg_packet_get_ihint(PyObject *obj, void *closure)
8406 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8408 py_ihint = PyInt_FromLong((uint16_t)object->ihint);
8412 static int py_ncadg_packet_set_ihint(PyObject *py_obj, PyObject *value, void *closure)
8414 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8428 object->ihint = test_var;
8429 } else if (PyInt_Check(value)) {
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);
8437 object->ihint = test_var;
8439 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8440 PyInt_Type.tp_name, PyLong_Type.tp_name);
8447 static PyObject *py_ncadg_packet_get_ahint(PyObject *obj, void *closure)
8449 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8451 py_ahint = PyInt_FromLong((uint16_t)object->ahint);
8455 static int py_ncadg_packet_set_ahint(PyObject *py_obj, PyObject *value, void *closure)
8457 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8471 object->ahint = test_var;
8472 } else if (PyInt_Check(value)) {
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);
8480 object->ahint = test_var;
8482 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8483 PyInt_Type.tp_name, PyLong_Type.tp_name);
8490 static PyObject *py_ncadg_packet_get_len(PyObject *obj, void *closure)
8492 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8494 py_len = PyInt_FromLong((uint16_t)object->len);
8498 static int py_ncadg_packet_set_len(PyObject *py_obj, PyObject *value, void *closure)
8500 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8514 object->len = test_var;
8515 } else if (PyInt_Check(value)) {
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);
8523 object->len = test_var;
8525 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8526 PyInt_Type.tp_name, PyLong_Type.tp_name);
8533 static PyObject *py_ncadg_packet_get_fragnum(PyObject *obj, void *closure)
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);
8541 static int py_ncadg_packet_set_fragnum(PyObject *py_obj, PyObject *value, void *closure)
8543 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8557 object->fragnum = test_var;
8558 } else if (PyInt_Check(value)) {
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);
8566 object->fragnum = test_var;
8568 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8569 PyInt_Type.tp_name, PyLong_Type.tp_name);
8576 static PyObject *py_ncadg_packet_get_auth_proto(PyObject *obj, void *closure)
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;
8584 static int py_ncadg_packet_set_auth_proto(PyObject *py_obj, PyObject *value, void *closure)
8586 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8600 object->auth_proto = test_var;
8601 } else if (PyInt_Check(value)) {
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);
8609 object->auth_proto = test_var;
8611 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8612 PyInt_Type.tp_name, PyLong_Type.tp_name);
8619 static PyObject *py_ncadg_packet_get_serial_low(PyObject *obj, void *closure)
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;
8627 static int py_ncadg_packet_set_serial_low(PyObject *py_obj, PyObject *value, void *closure)
8629 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
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);
8643 object->serial_low = test_var;
8644 } else if (PyInt_Check(value)) {
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);
8652 object->serial_low = test_var;
8654 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8655 PyInt_Type.tp_name, PyLong_Type.tp_name);
8662 static PyObject *py_ncadg_packet_get_u(PyObject *obj, void *closure)
8664 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(obj);
8666 py_u = py_import_dcerpc_payload(pytalloc_get_mem_ctx(obj), object->ptype, &object->u);
8673 static int py_ncadg_packet_set_u(PyObject *py_obj, PyObject *value, void *closure)
8675 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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) {
8682 object->u = *u_switch_0;
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 },
8711 static PyObject *py_ncadg_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8713 return pytalloc_new(struct ncadg_packet, type);
8716 static PyObject *py_ncadg_packet_ndr_pack(PyObject *py_obj)
8718 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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);
8727 return PyString_FromStringAndSize((char *)blob.data, blob.length);
8730 static PyObject *py_ncadg_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8732 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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;
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)) {
8746 blob.length = blob_length;
8748 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8749 allow_remaining = true;
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);
8755 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncadg_packet);
8757 if (err != NDR_ERR_SUCCESS) {
8758 PyErr_SetNdrError(err);
8765 static PyObject *py_ncadg_packet_ndr_print(PyObject *py_obj)
8767 struct ncadg_packet *object = (struct ncadg_packet *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
8797 static PyObject *py_dcerpc_sec_vt_pcontext_get_abstract_syntax(PyObject *obj, void *closure)
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;
8805 static int py_dcerpc_sec_vt_pcontext_set_abstract_syntax(PyObject *py_obj, PyObject *value, void *closure)
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) {
8813 object->abstract_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
8817 static PyObject *py_dcerpc_sec_vt_pcontext_get_transfer_syntax(PyObject *obj, void *closure)
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;
8825 static int py_dcerpc_sec_vt_pcontext_set_transfer_syntax(PyObject *py_obj, PyObject *value, void *closure)
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) {
8833 object->transfer_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
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 },
8843 static PyObject *py_dcerpc_sec_vt_pcontext_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8845 return pytalloc_new(struct dcerpc_sec_vt_pcontext, type);
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,
8854 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8855 .tp_basicsize = sizeof(pytalloc_Object),
8856 .tp_new = py_dcerpc_sec_vt_pcontext_new,
8860 static PyObject *py_dcerpc_sec_vt_header2_get_ptype(PyObject *obj, void *closure)
8862 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
8864 py_ptype = PyInt_FromLong((uint16_t)object->ptype);
8868 static int py_dcerpc_sec_vt_header2_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
8870 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8884 object->ptype = test_var;
8885 } else if (PyInt_Check(value)) {
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);
8893 object->ptype = test_var;
8895 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8896 PyInt_Type.tp_name, PyLong_Type.tp_name);
8903 static PyObject *py_dcerpc_sec_vt_header2_get_reserved1(PyObject *obj, void *closure)
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;
8911 static int py_dcerpc_sec_vt_header2_set_reserved1(PyObject *py_obj, PyObject *value, void *closure)
8913 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8927 object->reserved1 = test_var;
8928 } else if (PyInt_Check(value)) {
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);
8936 object->reserved1 = test_var;
8938 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8939 PyInt_Type.tp_name, PyLong_Type.tp_name);
8946 static PyObject *py_dcerpc_sec_vt_header2_get_reserved2(PyObject *obj, void *closure)
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;
8954 static int py_dcerpc_sec_vt_header2_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
8956 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
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) {
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);
8970 object->reserved2 = test_var;
8971 } else if (PyInt_Check(value)) {
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);
8979 object->reserved2 = test_var;
8981 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8982 PyInt_Type.tp_name, PyLong_Type.tp_name);
8989 static PyObject *py_dcerpc_sec_vt_header2_get_drep(PyObject *obj, void *closure)
8991 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
8993 py_drep = PyList_New(4);
8994 if (py_drep == NULL) {
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);
9008 static int py_dcerpc_sec_vt_header2_set_drep(PyObject *py_obj, PyObject *value, void *closure)
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;);
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));
9018 for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
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) {
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);
9032 object->drep[drep_cntr_0] = test_var;
9033 } else if (PyInt_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
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);
9041 object->drep[drep_cntr_0] = test_var;
9043 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9044 PyInt_Type.tp_name, PyLong_Type.tp_name);
9053 static PyObject *py_dcerpc_sec_vt_header2_get_call_id(PyObject *obj, void *closure)
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);
9061 static int py_dcerpc_sec_vt_header2_set_call_id(PyObject *py_obj, PyObject *value, void *closure)
9063 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
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) {
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);
9077 object->call_id = test_var;
9078 } else if (PyInt_Check(value)) {
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);
9086 object->call_id = test_var;
9088 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9089 PyInt_Type.tp_name, PyLong_Type.tp_name);
9096 static PyObject *py_dcerpc_sec_vt_header2_get_context_id(PyObject *obj, void *closure)
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;
9104 static int py_dcerpc_sec_vt_header2_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
9106 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
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) {
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);
9120 object->context_id = test_var;
9121 } else if (PyInt_Check(value)) {
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);
9129 object->context_id = test_var;
9131 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9132 PyInt_Type.tp_name, PyLong_Type.tp_name);
9139 static PyObject *py_dcerpc_sec_vt_header2_get_opnum(PyObject *obj, void *closure)
9141 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(obj);
9143 py_opnum = PyInt_FromLong((uint16_t)object->opnum);
9147 static int py_dcerpc_sec_vt_header2_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
9149 struct dcerpc_sec_vt_header2 *object = (struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(py_obj);
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) {
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);
9163 object->opnum = test_var;
9164 } else if (PyInt_Check(value)) {
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);
9172 object->opnum = test_var;
9174 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9175 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
9193 static PyObject *py_dcerpc_sec_vt_header2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9195 return pytalloc_new(struct dcerpc_sec_vt_header2, type);
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,
9204 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9205 .tp_basicsize = sizeof(pytalloc_Object),
9206 .tp_new = py_dcerpc_sec_vt_header2_new,
9209 PyObject *py_import_dcerpc_sec_vt_union(TALLOC_CTX *mem_ctx, int level, union dcerpc_sec_vt_union *in)
9214 case DCERPC_SEC_VT_COMMAND_BITMASK1:
9215 ret = ndr_PyLong_FromUnsignedLongLong((uint32_t)in->bitmask1);
9218 case DCERPC_SEC_VT_COMMAND_PCONTEXT:
9219 ret = pytalloc_reference_ex(&dcerpc_sec_vt_pcontext_Type, mem_ctx, &in->pcontext);
9222 case DCERPC_SEC_VT_COMMAND_HEADER2:
9223 ret = pytalloc_reference_ex(&dcerpc_sec_vt_header2_Type, mem_ctx, &in->header2);
9227 ret = PyString_FromStringAndSize((char *)(in->_unknown).data, (in->_unknown).length);
9231 PyErr_SetString(PyExc_TypeError, "unknown union level");
9235 union dcerpc_sec_vt_union *py_export_dcerpc_sec_vt_union(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9237 union dcerpc_sec_vt_union *ret = talloc_zero(mem_ctx, union dcerpc_sec_vt_union);
9239 case DCERPC_SEC_VT_COMMAND_BITMASK1:
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;
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;
9253 ret->bitmask1 = test_var;
9254 } else if (PyInt_Check(in)) {
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;
9262 ret->bitmask1 = test_var;
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;
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) {
9275 talloc_free(ret); return NULL;
9277 ret->pcontext = *(struct dcerpc_sec_vt_pcontext *)pytalloc_get_ptr(in);
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) {
9284 talloc_free(ret); return NULL;
9286 ret->header2 = *(struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(in);
9290 ret->_unknown = data_blob_talloc(mem_ctx, PyString_AS_STRING(in), PyString_GET_SIZE(in));
9299 static PyObject *py_dcerpc_sec_vt_get_command(PyObject *obj, void *closure)
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);
9307 static int py_dcerpc_sec_vt_set_command(PyObject *py_obj, PyObject *value, void *closure)
9309 struct dcerpc_sec_vt *object = (struct dcerpc_sec_vt *)pytalloc_get_ptr(py_obj);
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) {
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);
9323 object->command = test_var;
9324 } else if (PyInt_Check(value)) {
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);
9332 object->command = test_var;
9334 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9335 PyInt_Type.tp_name, PyLong_Type.tp_name);
9342 static PyObject *py_dcerpc_sec_vt_get_u(PyObject *obj, void *closure)
9344 struct dcerpc_sec_vt *object = (struct dcerpc_sec_vt *)pytalloc_get_ptr(obj);
9346 py_u = py_import_dcerpc_sec_vt_union(pytalloc_get_mem_ctx(obj), object->command & DCERPC_SEC_VT_COMMAND_ENUM, &object->u);
9353 static int py_dcerpc_sec_vt_set_u(PyObject *py_obj, PyObject *value, void *closure)
9355 struct dcerpc_sec_vt *object = (struct dcerpc_sec_vt *)pytalloc_get_ptr(py_obj);
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) {
9362 object->u = *u_switch_1;
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 },
9373 static PyObject *py_dcerpc_sec_vt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9375 return pytalloc_new(struct dcerpc_sec_vt, type);
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,
9384 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9385 .tp_basicsize = sizeof(pytalloc_Object),
9386 .tp_new = py_dcerpc_sec_vt_new,
9390 static PyObject *py_dcerpc_sec_vt_count_get_count(PyObject *obj, void *closure)
9392 struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(obj);
9394 py_count = PyInt_FromLong((uint16_t)object->count);
9398 static int py_dcerpc_sec_vt_count_set_count(PyObject *py_obj, PyObject *value, void *closure)
9400 struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(py_obj);
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) {
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);
9414 object->count = test_var;
9415 } else if (PyInt_Check(value)) {
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);
9423 object->count = test_var;
9425 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9426 PyInt_Type.tp_name, PyLong_Type.tp_name);
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 },
9438 static PyObject *py_dcerpc_sec_vt_count_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9440 return pytalloc_new(struct dcerpc_sec_vt_count, type);
9443 static PyObject *py_dcerpc_sec_vt_count_ndr_pack(PyObject *py_obj)
9445 struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(py_obj);
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);
9454 return PyString_FromStringAndSize((char *)blob.data, blob.length);
9457 static PyObject *py_dcerpc_sec_vt_count_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9459 struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(py_obj);
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;
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)) {
9473 blob.length = blob_length;
9475 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9476 allow_remaining = true;
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);
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);
9484 if (err != NDR_ERR_SUCCESS) {
9485 PyErr_SetNdrError(err);
9492 static PyObject *py_dcerpc_sec_vt_count_ndr_print(PyObject *py_obj)
9494 struct dcerpc_sec_vt_count *object = (struct dcerpc_sec_vt_count *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
9524 static PyObject *py_dcerpc_sec_verification_trailer_get__pad(PyObject *obj, void *closure)
9526 struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(obj);
9528 py__pad = PyString_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
9532 static int py_dcerpc_sec_verification_trailer_set__pad(PyObject *py_obj, PyObject *value, void *closure)
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));
9539 static PyObject *py_dcerpc_sec_verification_trailer_get_magic(PyObject *obj, void *closure)
9541 struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(obj);
9543 py_magic = PyList_New(8);
9544 if (py_magic == NULL) {
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);
9558 static int py_dcerpc_sec_verification_trailer_set_magic(PyObject *py_obj, PyObject *value, void *closure)
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;);
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));
9568 for (magic_cntr_0 = 0; magic_cntr_0 < PyList_GET_SIZE(value); magic_cntr_0++) {
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) {
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);
9582 object->magic[magic_cntr_0] = test_var;
9583 } else if (PyInt_Check(PyList_GET_ITEM(value, magic_cntr_0))) {
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);
9591 object->magic[magic_cntr_0] = test_var;
9593 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9594 PyInt_Type.tp_name, PyLong_Type.tp_name);
9603 static PyObject *py_dcerpc_sec_verification_trailer_get_count(PyObject *obj, void *closure)
9605 struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(obj);
9607 py_count = pytalloc_reference_ex(&dcerpc_sec_vt_count_Type, pytalloc_get_mem_ctx(obj), &object->count);
9611 static int py_dcerpc_sec_verification_trailer_set_count(PyObject *py_obj, PyObject *value, void *closure)
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) {
9619 object->count = *(struct dcerpc_sec_vt_count *)pytalloc_get_ptr(value);
9623 static PyObject *py_dcerpc_sec_verification_trailer_get_commands(PyObject *obj, void *closure)
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) {
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);
9642 static int py_dcerpc_sec_verification_trailer_set_commands(PyObject *py_obj, PyObject *value, void *closure)
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;);
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) {
9657 object->commands[commands_cntr_0] = *(struct dcerpc_sec_vt *)pytalloc_get_ptr(PyList_GET_ITEM(value, commands_cntr_0));
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 },
9671 static PyObject *py_dcerpc_sec_verification_trailer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9673 return pytalloc_new(struct dcerpc_sec_verification_trailer, type);
9676 static PyObject *py_dcerpc_sec_verification_trailer_ndr_pack(PyObject *py_obj)
9678 struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
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);
9687 return PyString_FromStringAndSize((char *)blob.data, blob.length);
9690 static PyObject *py_dcerpc_sec_verification_trailer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9692 struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
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;
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)) {
9706 blob.length = blob_length;
9708 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9709 allow_remaining = true;
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);
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);
9717 if (err != NDR_ERR_SUCCESS) {
9718 PyErr_SetNdrError(err);
9725 static PyObject *py_dcerpc_sec_verification_trailer_ndr_print(PyObject *py_obj)
9727 struct dcerpc_sec_verification_trailer *object = (struct dcerpc_sec_verification_trailer *)pytalloc_get_ptr(py_obj);
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);
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 }
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,
9756 static PyMethodDef dcerpc_methods[] = {
9757 { NULL, NULL, 0, NULL }
9760 void initdcerpc(void)
9763 PyObject *dep_samba_dcerpc_misc;
9764 PyObject *dep_talloc;
9766 dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
9767 if (dep_samba_dcerpc_misc == NULL)
9770 dep_talloc = PyImport_ImportModule("talloc");
9771 if (dep_talloc == NULL)
9774 ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
9775 if (ndr_syntax_id_Type == NULL)
9778 Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
9779 if (Object_Type == NULL)
9782 GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
9783 if (GUID_Type == NULL)
9786 dcerpc_ctx_list_Type.tp_base = Object_Type;
9788 dcerpc_bind_Type.tp_base = Object_Type;
9790 dcerpc_empty_Type.tp_base = Object_Type;
9792 dcerpc_request_Type.tp_base = Object_Type;
9794 dcerpc_ack_ctx_Type.tp_base = Object_Type;
9796 dcerpc_bind_ack_Type.tp_base = Object_Type;
9798 dcerpc_bind_nak_version_Type.tp_base = Object_Type;
9800 dcerpc_bind_nak_Type.tp_base = Object_Type;
9802 dcerpc_response_Type.tp_base = Object_Type;
9804 dcerpc_fault_Type.tp_base = Object_Type;
9806 dcerpc_auth_Type.tp_base = Object_Type;
9808 dcerpc_auth3_Type.tp_base = Object_Type;
9810 dcerpc_orphaned_Type.tp_base = Object_Type;
9812 dcerpc_co_cancel_Type.tp_base = Object_Type;
9814 dcerpc_cl_cancel_Type.tp_base = Object_Type;
9816 dcerpc_cancel_ack_Type.tp_base = Object_Type;
9818 dcerpc_fack_Type.tp_base = Object_Type;
9820 dcerpc_ack_Type.tp_base = Object_Type;
9822 dcerpc_ping_Type.tp_base = Object_Type;
9824 dcerpc_shutdown_Type.tp_base = Object_Type;
9826 dcerpc_working_Type.tp_base = Object_Type;
9828 RTSCookie_Type.tp_base = Object_Type;
9830 ClientAddress_Type.tp_base = Object_Type;
9832 FlowControlAcknowledgment_Type.tp_base = Object_Type;
9834 dcerpc_rts_cmd_ReceiveWindowSize_Type.tp_base = Object_Type;
9836 dcerpc_rts_cmd_FlowControlAck_Type.tp_base = Object_Type;
9838 dcerpc_rts_cmd_ConnectionTimeout_Type.tp_base = Object_Type;
9840 dcerpc_rts_cmd_Cookie_Type.tp_base = Object_Type;
9842 dcerpc_rts_cmd_ChannelLifetime_Type.tp_base = Object_Type;
9844 dcerpc_rts_cmd_ClientKeepalive_Type.tp_base = Object_Type;
9846 dcerpc_rts_cmd_Version_Type.tp_base = Object_Type;
9848 dcerpc_rts_cmd_Empty_Type.tp_base = Object_Type;
9850 dcerpc_rts_cmd_Padding_Type.tp_base = Object_Type;
9852 dcerpc_rts_cmd_NegativeANCE_Type.tp_base = Object_Type;
9854 dcerpc_rts_cmd_ANCE_Type.tp_base = Object_Type;
9856 dcerpc_rts_cmd_ClientAddress_Type.tp_base = Object_Type;
9858 dcerpc_rts_cmd_AssociationGroupId_Type.tp_base = Object_Type;
9860 dcerpc_rts_cmd_Destination_Type.tp_base = Object_Type;
9862 dcerpc_rts_cmd_PingTrafficSentNotify_Type.tp_base = Object_Type;
9864 dcerpc_rts_cmd_Type.tp_base = Object_Type;
9866 dcerpc_rts_Type.tp_base = Object_Type;
9868 ncacn_packet_Type.tp_base = Object_Type;
9870 ncadg_packet_Type.tp_base = Object_Type;
9872 dcerpc_sec_vt_pcontext_Type.tp_base = Object_Type;
9874 dcerpc_sec_vt_header2_Type.tp_base = Object_Type;
9876 dcerpc_sec_vt_Type.tp_base = Object_Type;
9878 dcerpc_sec_vt_count_Type.tp_base = Object_Type;
9880 dcerpc_sec_verification_trailer_Type.tp_base = Object_Type;
9882 if (PyType_Ready(&dcerpc_ctx_list_Type) < 0)
9884 if (PyType_Ready(&dcerpc_bind_Type) < 0)
9886 if (PyType_Ready(&dcerpc_empty_Type) < 0)
9888 if (PyType_Ready(&dcerpc_request_Type) < 0)
9890 if (PyType_Ready(&dcerpc_ack_ctx_Type) < 0)
9892 if (PyType_Ready(&dcerpc_bind_ack_Type) < 0)
9894 if (PyType_Ready(&dcerpc_bind_nak_version_Type) < 0)
9896 if (PyType_Ready(&dcerpc_bind_nak_Type) < 0)
9898 if (PyType_Ready(&dcerpc_response_Type) < 0)
9900 if (PyType_Ready(&dcerpc_fault_Type) < 0)
9902 if (PyType_Ready(&dcerpc_auth_Type) < 0)
9904 if (PyType_Ready(&dcerpc_auth3_Type) < 0)
9906 if (PyType_Ready(&dcerpc_orphaned_Type) < 0)
9908 if (PyType_Ready(&dcerpc_co_cancel_Type) < 0)
9910 if (PyType_Ready(&dcerpc_cl_cancel_Type) < 0)
9912 if (PyType_Ready(&dcerpc_cancel_ack_Type) < 0)
9914 if (PyType_Ready(&dcerpc_fack_Type) < 0)
9916 if (PyType_Ready(&dcerpc_ack_Type) < 0)
9918 if (PyType_Ready(&dcerpc_ping_Type) < 0)
9920 if (PyType_Ready(&dcerpc_shutdown_Type) < 0)
9922 if (PyType_Ready(&dcerpc_working_Type) < 0)
9924 if (PyType_Ready(&RTSCookie_Type) < 0)
9926 if (PyType_Ready(&ClientAddress_Type) < 0)
9928 if (PyType_Ready(&FlowControlAcknowledgment_Type) < 0)
9930 if (PyType_Ready(&dcerpc_rts_cmd_ReceiveWindowSize_Type) < 0)
9932 if (PyType_Ready(&dcerpc_rts_cmd_FlowControlAck_Type) < 0)
9934 if (PyType_Ready(&dcerpc_rts_cmd_ConnectionTimeout_Type) < 0)
9936 if (PyType_Ready(&dcerpc_rts_cmd_Cookie_Type) < 0)
9938 if (PyType_Ready(&dcerpc_rts_cmd_ChannelLifetime_Type) < 0)
9940 if (PyType_Ready(&dcerpc_rts_cmd_ClientKeepalive_Type) < 0)
9942 if (PyType_Ready(&dcerpc_rts_cmd_Version_Type) < 0)
9944 if (PyType_Ready(&dcerpc_rts_cmd_Empty_Type) < 0)
9946 if (PyType_Ready(&dcerpc_rts_cmd_Padding_Type) < 0)
9948 if (PyType_Ready(&dcerpc_rts_cmd_NegativeANCE_Type) < 0)
9950 if (PyType_Ready(&dcerpc_rts_cmd_ANCE_Type) < 0)
9952 if (PyType_Ready(&dcerpc_rts_cmd_ClientAddress_Type) < 0)
9954 if (PyType_Ready(&dcerpc_rts_cmd_AssociationGroupId_Type) < 0)
9956 if (PyType_Ready(&dcerpc_rts_cmd_Destination_Type) < 0)
9958 if (PyType_Ready(&dcerpc_rts_cmd_PingTrafficSentNotify_Type) < 0)
9960 if (PyType_Ready(&dcerpc_rts_cmd_Type) < 0)
9962 if (PyType_Ready(&dcerpc_rts_Type) < 0)
9964 if (PyType_Ready(&ncacn_packet_Type) < 0)
9966 if (PyType_Ready(&ncadg_packet_Type) < 0)
9968 if (PyType_Ready(&dcerpc_sec_vt_pcontext_Type) < 0)
9970 if (PyType_Ready(&dcerpc_sec_vt_header2_Type) < 0)
9972 if (PyType_Ready(&dcerpc_sec_vt_Type) < 0)
9974 if (PyType_Ready(&dcerpc_sec_vt_count_Type) < 0)
9976 if (PyType_Ready(&dcerpc_sec_verification_trailer_Type) < 0)
9978 #ifdef PY_CTX_LIST_PATCH
9979 PY_CTX_LIST_PATCH(&dcerpc_ctx_list_Type);
9981 #ifdef PY_BIND_PATCH
9982 PY_BIND_PATCH(&dcerpc_bind_Type);
9984 #ifdef PY_EMPTY_PATCH
9985 PY_EMPTY_PATCH(&dcerpc_empty_Type);
9987 #ifdef PY_REQUEST_PATCH
9988 PY_REQUEST_PATCH(&dcerpc_request_Type);
9990 #ifdef PY_ACK_CTX_PATCH
9991 PY_ACK_CTX_PATCH(&dcerpc_ack_ctx_Type);
9993 #ifdef PY_BIND_ACK_PATCH
9994 PY_BIND_ACK_PATCH(&dcerpc_bind_ack_Type);
9996 #ifdef PY_BIND_NAK_VERSION_PATCH
9997 PY_BIND_NAK_VERSION_PATCH(&dcerpc_bind_nak_version_Type);
9999 #ifdef PY_BIND_NAK_PATCH
10000 PY_BIND_NAK_PATCH(&dcerpc_bind_nak_Type);
10002 #ifdef PY_RESPONSE_PATCH
10003 PY_RESPONSE_PATCH(&dcerpc_response_Type);
10005 #ifdef PY_FAULT_PATCH
10006 PY_FAULT_PATCH(&dcerpc_fault_Type);
10008 #ifdef PY_AUTH_PATCH
10009 PY_AUTH_PATCH(&dcerpc_auth_Type);
10011 #ifdef PY_AUTH3_PATCH
10012 PY_AUTH3_PATCH(&dcerpc_auth3_Type);
10014 #ifdef PY_ORPHANED_PATCH
10015 PY_ORPHANED_PATCH(&dcerpc_orphaned_Type);
10017 #ifdef PY_CO_CANCEL_PATCH
10018 PY_CO_CANCEL_PATCH(&dcerpc_co_cancel_Type);
10020 #ifdef PY_CL_CANCEL_PATCH
10021 PY_CL_CANCEL_PATCH(&dcerpc_cl_cancel_Type);
10023 #ifdef PY_CANCEL_ACK_PATCH
10024 PY_CANCEL_ACK_PATCH(&dcerpc_cancel_ack_Type);
10026 #ifdef PY_FACK_PATCH
10027 PY_FACK_PATCH(&dcerpc_fack_Type);
10029 #ifdef PY_ACK_PATCH
10030 PY_ACK_PATCH(&dcerpc_ack_Type);
10032 #ifdef PY_PING_PATCH
10033 PY_PING_PATCH(&dcerpc_ping_Type);
10035 #ifdef PY_SHUTDOWN_PATCH
10036 PY_SHUTDOWN_PATCH(&dcerpc_shutdown_Type);
10038 #ifdef PY_WORKING_PATCH
10039 PY_WORKING_PATCH(&dcerpc_working_Type);
10041 #ifdef PY_RTSCOOKIE_PATCH
10042 PY_RTSCOOKIE_PATCH(&RTSCookie_Type);
10044 #ifdef PY_CLIENTADDRESS_PATCH
10045 PY_CLIENTADDRESS_PATCH(&ClientAddress_Type);
10047 #ifdef PY_FLOWCONTROLACKNOWLEDGMENT_PATCH
10048 PY_FLOWCONTROLACKNOWLEDGMENT_PATCH(&FlowControlAcknowledgment_Type);
10050 #ifdef PY_RTS_CMD_RECEIVEWINDOWSIZE_PATCH
10051 PY_RTS_CMD_RECEIVEWINDOWSIZE_PATCH(&dcerpc_rts_cmd_ReceiveWindowSize_Type);
10053 #ifdef PY_RTS_CMD_FLOWCONTROLACK_PATCH
10054 PY_RTS_CMD_FLOWCONTROLACK_PATCH(&dcerpc_rts_cmd_FlowControlAck_Type);
10056 #ifdef PY_RTS_CMD_CONNECTIONTIMEOUT_PATCH
10057 PY_RTS_CMD_CONNECTIONTIMEOUT_PATCH(&dcerpc_rts_cmd_ConnectionTimeout_Type);
10059 #ifdef PY_RTS_CMD_COOKIE_PATCH
10060 PY_RTS_CMD_COOKIE_PATCH(&dcerpc_rts_cmd_Cookie_Type);
10062 #ifdef PY_RTS_CMD_CHANNELLIFETIME_PATCH
10063 PY_RTS_CMD_CHANNELLIFETIME_PATCH(&dcerpc_rts_cmd_ChannelLifetime_Type);
10065 #ifdef PY_RTS_CMD_CLIENTKEEPALIVE_PATCH
10066 PY_RTS_CMD_CLIENTKEEPALIVE_PATCH(&dcerpc_rts_cmd_ClientKeepalive_Type);
10068 #ifdef PY_RTS_CMD_VERSION_PATCH
10069 PY_RTS_CMD_VERSION_PATCH(&dcerpc_rts_cmd_Version_Type);
10071 #ifdef PY_RTS_CMD_EMPTY_PATCH
10072 PY_RTS_CMD_EMPTY_PATCH(&dcerpc_rts_cmd_Empty_Type);
10074 #ifdef PY_RTS_CMD_PADDING_PATCH
10075 PY_RTS_CMD_PADDING_PATCH(&dcerpc_rts_cmd_Padding_Type);
10077 #ifdef PY_RTS_CMD_NEGATIVEANCE_PATCH
10078 PY_RTS_CMD_NEGATIVEANCE_PATCH(&dcerpc_rts_cmd_NegativeANCE_Type);
10080 #ifdef PY_RTS_CMD_ANCE_PATCH
10081 PY_RTS_CMD_ANCE_PATCH(&dcerpc_rts_cmd_ANCE_Type);
10083 #ifdef PY_RTS_CMD_CLIENTADDRESS_PATCH
10084 PY_RTS_CMD_CLIENTADDRESS_PATCH(&dcerpc_rts_cmd_ClientAddress_Type);
10086 #ifdef PY_RTS_CMD_ASSOCIATIONGROUPID_PATCH
10087 PY_RTS_CMD_ASSOCIATIONGROUPID_PATCH(&dcerpc_rts_cmd_AssociationGroupId_Type);
10089 #ifdef PY_RTS_CMD_DESTINATION_PATCH
10090 PY_RTS_CMD_DESTINATION_PATCH(&dcerpc_rts_cmd_Destination_Type);
10092 #ifdef PY_RTS_CMD_PINGTRAFFICSENTNOTIFY_PATCH
10093 PY_RTS_CMD_PINGTRAFFICSENTNOTIFY_PATCH(&dcerpc_rts_cmd_PingTrafficSentNotify_Type);
10095 #ifdef PY_RTS_CMD_PATCH
10096 PY_RTS_CMD_PATCH(&dcerpc_rts_cmd_Type);
10098 #ifdef PY_RTS_PATCH
10099 PY_RTS_PATCH(&dcerpc_rts_Type);
10101 #ifdef PY_NCACN_PACKET_PATCH
10102 PY_NCACN_PACKET_PATCH(&ncacn_packet_Type);
10104 #ifdef PY_NCADG_PACKET_PATCH
10105 PY_NCADG_PACKET_PATCH(&ncadg_packet_Type);
10107 #ifdef PY_SEC_VT_PCONTEXT_PATCH
10108 PY_SEC_VT_PCONTEXT_PATCH(&dcerpc_sec_vt_pcontext_Type);
10110 #ifdef PY_SEC_VT_HEADER2_PATCH
10111 PY_SEC_VT_HEADER2_PATCH(&dcerpc_sec_vt_header2_Type);
10113 #ifdef PY_SEC_VT_PATCH
10114 PY_SEC_VT_PATCH(&dcerpc_sec_vt_Type);
10116 #ifdef PY_SEC_VT_COUNT_PATCH
10117 PY_SEC_VT_COUNT_PATCH(&dcerpc_sec_vt_count_Type);
10119 #ifdef PY_SEC_VERIFICATION_TRAILER_PATCH
10120 PY_SEC_VERIFICATION_TRAILER_PATCH(&dcerpc_sec_verification_trailer_Type);
10123 m = Py_InitModule3("dcerpc", dcerpc_methods, "dcerpc DCE/RPC");
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);