Line data Source code
1 :
2 : /* Python wrapper functions auto-generated by pidl */
3 : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
4 : #include "lib/replace/system/python.h"
5 : #include "python/py3compat.h"
6 : #include "includes.h"
7 : #include "python/modules.h"
8 : #include <pytalloc.h>
9 : #include "librpc/rpc/pyrpc.h"
10 : #include "librpc/rpc/pyrpc_util.h"
11 : #include "bin/default/librpc/gen_ndr/ndr_dcerpc.h"
12 :
13 :
14 : /*
15 : * Suppress compiler warnings if the generated code does not call these
16 : * functions
17 : */
18 : #ifndef _MAYBE_UNUSED_
19 : #ifdef __has_attribute
20 : #if __has_attribute(unused)
21 : #define _MAYBE_UNUSED_ __attribute__ ((unused))
22 : #else
23 : #define _MAYBE_UNUSED_
24 : #endif
25 : #endif
26 : #endif
27 : /*
28 : * These functions are here to ensure they can be optimized out by
29 : * the compiler based on the constant input values
30 : */
31 :
32 92868 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 92868 : switch (var_size) {
35 0 : case 8:
36 0 : return UINT64_MAX;
37 21231 : case 4:
38 21231 : return UINT32_MAX;
39 29128 : case 2:
40 29128 : return UINT16_MAX;
41 42509 : case 1:
42 42509 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 : switch (var_size) {
51 : case 8:
52 : return INT64_MAX;
53 : case 4:
54 : return INT32_MAX;
55 : case 2:
56 : return INT16_MAX;
57 : case 1:
58 : return INT8_MAX;
59 : }
60 :
61 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/misc.h"
65 : static PyTypeObject dcerpc_ctx_list_Type;
66 : static PyTypeObject dcerpc_bind_Type;
67 : static PyTypeObject dcerpc_empty_Type;
68 : static PyTypeObject dcerpc_object_Type;
69 : static PyTypeObject dcerpc_request_Type;
70 : static PyTypeObject dcerpc_bind_ack_reason_Type;
71 : static PyTypeObject dcerpc_ack_ctx_Type;
72 : static PyTypeObject dcerpc_bind_ack_Type;
73 : static PyTypeObject dcerpc_bind_nak_version_Type;
74 : static PyTypeObject dcerpc_bind_nak_Type;
75 : static PyTypeObject dcerpc_response_Type;
76 : static PyTypeObject dcerpc_fault_Type;
77 : static PyTypeObject dcerpc_auth_Type;
78 : static PyTypeObject dcerpc_auth3_Type;
79 : static PyTypeObject dcerpc_orphaned_Type;
80 : static PyTypeObject dcerpc_co_cancel_Type;
81 : static PyTypeObject dcerpc_cl_cancel_Type;
82 : static PyTypeObject dcerpc_cancel_ack_Type;
83 : static PyTypeObject dcerpc_fack_Type;
84 : static PyTypeObject dcerpc_ack_Type;
85 : static PyTypeObject dcerpc_ping_Type;
86 : static PyTypeObject dcerpc_shutdown_Type;
87 : static PyTypeObject dcerpc_working_Type;
88 : static PyTypeObject RTSCookie_Type;
89 : static PyTypeObject ClientAddressType_Type;
90 : static PyTypeObject ClientAddress_Type;
91 : static PyTypeObject FlowControlAcknowledgment_Type;
92 : static PyTypeObject dcerpc_rts_cmd_ReceiveWindowSize_Type;
93 : static PyTypeObject dcerpc_rts_cmd_FlowControlAck_Type;
94 : static PyTypeObject dcerpc_rts_cmd_ConnectionTimeout_Type;
95 : static PyTypeObject dcerpc_rts_cmd_Cookie_Type;
96 : static PyTypeObject dcerpc_rts_cmd_ChannelLifetime_Type;
97 : static PyTypeObject dcerpc_rts_cmd_ClientKeepalive_Type;
98 : static PyTypeObject dcerpc_rts_cmd_Version_Type;
99 : static PyTypeObject dcerpc_rts_cmd_Empty_Type;
100 : static PyTypeObject dcerpc_rts_cmd_Padding_Type;
101 : static PyTypeObject dcerpc_rts_cmd_NegativeANCE_Type;
102 : static PyTypeObject dcerpc_rts_cmd_ANCE_Type;
103 : static PyTypeObject dcerpc_rts_cmd_ClientAddress_Type;
104 : static PyTypeObject dcerpc_rts_cmd_AssociationGroupId_Type;
105 : static PyTypeObject dcerpc_rts_cmd_Destination_Type;
106 : static PyTypeObject dcerpc_rts_cmd_PingTrafficSentNotify_Type;
107 : static PyTypeObject dcerpc_rts_cmds_Type;
108 : static PyTypeObject dcerpc_rts_cmd_Type;
109 : static PyTypeObject dcerpc_rts_Type;
110 : static PyTypeObject dcerpc_payload_Type;
111 : static PyTypeObject ncacn_packet_Type;
112 : static PyTypeObject ncadg_packet_Type;
113 : static PyTypeObject dcerpc_sec_vt_pcontext_Type;
114 : static PyTypeObject dcerpc_sec_vt_header2_Type;
115 : static PyTypeObject dcerpc_sec_vt_union_Type;
116 : static PyTypeObject dcerpc_sec_vt_Type;
117 : static PyTypeObject dcerpc_sec_vt_count_Type;
118 : static PyTypeObject dcerpc_sec_verification_trailer_Type;
119 :
120 : static PyTypeObject *ndr_syntax_id_Type;
121 : static PyTypeObject *BaseObject_Type;
122 : static PyTypeObject *GUID_Type;
123 :
124 5063 : static PyObject *py_dcerpc_ctx_list_get_context_id(PyObject *obj, void *closure)
125 : {
126 5063 : struct dcerpc_ctx_list *object = pytalloc_get_ptr(obj);
127 0 : PyObject *py_context_id;
128 5063 : py_context_id = PyLong_FromLong((uint16_t)(object->context_id));
129 5063 : return py_context_id;
130 : }
131 :
132 652 : static int py_dcerpc_ctx_list_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
133 : {
134 652 : struct dcerpc_ctx_list *object = pytalloc_get_ptr(py_obj);
135 652 : if (value == NULL) {
136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->context_id");
137 0 : return -1;
138 : }
139 : {
140 652 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
141 652 : if (PyLong_Check(value)) {
142 0 : unsigned long long test_var;
143 652 : test_var = PyLong_AsUnsignedLongLong(value);
144 652 : if (PyErr_Occurred() != NULL) {
145 0 : return -1;
146 : }
147 652 : if (test_var > uint_max) {
148 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
149 : PyLong_Type.tp_name, uint_max, test_var);
150 0 : return -1;
151 : }
152 652 : object->context_id = test_var;
153 : } else {
154 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
155 : PyLong_Type.tp_name);
156 0 : return -1;
157 : }
158 : }
159 652 : return 0;
160 : }
161 :
162 0 : static PyObject *py_dcerpc_ctx_list_get_num_transfer_syntaxes(PyObject *obj, void *closure)
163 : {
164 0 : struct dcerpc_ctx_list *object = pytalloc_get_ptr(obj);
165 0 : PyObject *py_num_transfer_syntaxes;
166 0 : py_num_transfer_syntaxes = PyLong_FromLong((uint16_t)(object->num_transfer_syntaxes));
167 0 : return py_num_transfer_syntaxes;
168 : }
169 :
170 652 : static int py_dcerpc_ctx_list_set_num_transfer_syntaxes(PyObject *py_obj, PyObject *value, void *closure)
171 : {
172 652 : struct dcerpc_ctx_list *object = pytalloc_get_ptr(py_obj);
173 652 : if (value == NULL) {
174 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_transfer_syntaxes");
175 0 : return -1;
176 : }
177 : {
178 652 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_transfer_syntaxes));
179 652 : if (PyLong_Check(value)) {
180 0 : unsigned long long test_var;
181 652 : test_var = PyLong_AsUnsignedLongLong(value);
182 652 : if (PyErr_Occurred() != NULL) {
183 0 : return -1;
184 : }
185 652 : if (test_var > uint_max) {
186 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
187 : PyLong_Type.tp_name, uint_max, test_var);
188 0 : return -1;
189 : }
190 652 : object->num_transfer_syntaxes = test_var;
191 : } else {
192 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
193 : PyLong_Type.tp_name);
194 0 : return -1;
195 : }
196 : }
197 652 : return 0;
198 : }
199 :
200 0 : static PyObject *py_dcerpc_ctx_list_get_abstract_syntax(PyObject *obj, void *closure)
201 : {
202 0 : struct dcerpc_ctx_list *object = pytalloc_get_ptr(obj);
203 0 : PyObject *py_abstract_syntax;
204 0 : py_abstract_syntax = pytalloc_reference_ex(ndr_syntax_id_Type, pytalloc_get_mem_ctx(obj), &object->abstract_syntax);
205 0 : return py_abstract_syntax;
206 : }
207 :
208 652 : static int py_dcerpc_ctx_list_set_abstract_syntax(PyObject *py_obj, PyObject *value, void *closure)
209 : {
210 652 : struct dcerpc_ctx_list *object = pytalloc_get_ptr(py_obj);
211 652 : if (value == NULL) {
212 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->abstract_syntax");
213 0 : return -1;
214 : }
215 652 : PY_CHECK_TYPE(ndr_syntax_id_Type, value, return -1;);
216 652 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
217 0 : PyErr_NoMemory();
218 0 : return -1;
219 : }
220 652 : object->abstract_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
221 652 : return 0;
222 : }
223 :
224 901 : static PyObject *py_dcerpc_ctx_list_get_transfer_syntaxes(PyObject *obj, void *closure)
225 : {
226 901 : struct dcerpc_ctx_list *object = pytalloc_get_ptr(obj);
227 0 : PyObject *py_transfer_syntaxes;
228 901 : py_transfer_syntaxes = PyList_New(object->num_transfer_syntaxes);
229 901 : if (py_transfer_syntaxes == NULL) {
230 0 : return NULL;
231 : }
232 : {
233 : int transfer_syntaxes_cntr_0;
234 1802 : for (transfer_syntaxes_cntr_0 = 0; transfer_syntaxes_cntr_0 < (object->num_transfer_syntaxes); transfer_syntaxes_cntr_0++) {
235 0 : PyObject *py_transfer_syntaxes_0;
236 901 : py_transfer_syntaxes_0 = pytalloc_reference_ex(ndr_syntax_id_Type, object->transfer_syntaxes, &(object->transfer_syntaxes)[transfer_syntaxes_cntr_0]);
237 901 : PyList_SetItem(py_transfer_syntaxes, transfer_syntaxes_cntr_0, py_transfer_syntaxes_0);
238 : }
239 : }
240 901 : return py_transfer_syntaxes;
241 : }
242 :
243 652 : static int py_dcerpc_ctx_list_set_transfer_syntaxes(PyObject *py_obj, PyObject *value, void *closure)
244 : {
245 652 : struct dcerpc_ctx_list *object = pytalloc_get_ptr(py_obj);
246 652 : if (value == NULL) {
247 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->transfer_syntaxes");
248 0 : return -1;
249 : }
250 652 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
251 : {
252 0 : int transfer_syntaxes_cntr_0;
253 652 : object->transfer_syntaxes = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->transfer_syntaxes, PyList_GET_SIZE(value));
254 652 : if (!object->transfer_syntaxes) { return -1; }
255 652 : talloc_set_name_const(object->transfer_syntaxes, "ARRAY: object->transfer_syntaxes");
256 1379 : for (transfer_syntaxes_cntr_0 = 0; transfer_syntaxes_cntr_0 < PyList_GET_SIZE(value); transfer_syntaxes_cntr_0++) {
257 727 : if (PyList_GET_ITEM(value, transfer_syntaxes_cntr_0) == NULL) {
258 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->transfer_syntaxes)[transfer_syntaxes_cntr_0]");
259 0 : return -1;
260 : }
261 727 : PY_CHECK_TYPE(ndr_syntax_id_Type, PyList_GET_ITEM(value, transfer_syntaxes_cntr_0), return -1;);
262 727 : if (talloc_reference(object->transfer_syntaxes, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, transfer_syntaxes_cntr_0))) == NULL) {
263 0 : PyErr_NoMemory();
264 0 : return -1;
265 : }
266 727 : (object->transfer_syntaxes)[transfer_syntaxes_cntr_0] = *(struct ndr_syntax_id *)pytalloc_get_ptr(PyList_GET_ITEM(value, transfer_syntaxes_cntr_0));
267 : }
268 : }
269 652 : return 0;
270 : }
271 :
272 : static PyGetSetDef py_dcerpc_ctx_list_getsetters[] = {
273 : {
274 : .name = discard_const_p(char, "context_id"),
275 : .get = py_dcerpc_ctx_list_get_context_id,
276 : .set = py_dcerpc_ctx_list_set_context_id,
277 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
278 : },
279 : {
280 : .name = discard_const_p(char, "num_transfer_syntaxes"),
281 : .get = py_dcerpc_ctx_list_get_num_transfer_syntaxes,
282 : .set = py_dcerpc_ctx_list_set_num_transfer_syntaxes,
283 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
284 : },
285 : {
286 : .name = discard_const_p(char, "abstract_syntax"),
287 : .get = py_dcerpc_ctx_list_get_abstract_syntax,
288 : .set = py_dcerpc_ctx_list_set_abstract_syntax,
289 : .doc = discard_const_p(char, "PIDL-generated element of base type ndr_syntax_id")
290 : },
291 : {
292 : .name = discard_const_p(char, "transfer_syntaxes"),
293 : .get = py_dcerpc_ctx_list_get_transfer_syntaxes,
294 : .set = py_dcerpc_ctx_list_set_transfer_syntaxes,
295 : .doc = discard_const_p(char, "PIDL-generated element of base type ndr_syntax_id")
296 : },
297 : { .name = NULL }
298 : };
299 :
300 652 : static PyObject *py_dcerpc_ctx_list_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
301 : {
302 652 : return pytalloc_new(struct dcerpc_ctx_list, type);
303 : }
304 :
305 :
306 : static PyTypeObject dcerpc_ctx_list_Type = {
307 : PyVarObject_HEAD_INIT(NULL, 0)
308 : .tp_name = "dcerpc.ctx_list",
309 : .tp_getset = py_dcerpc_ctx_list_getsetters,
310 : .tp_methods = NULL,
311 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
312 : .tp_new = py_dcerpc_ctx_list_new,
313 : };
314 :
315 :
316 1159 : static PyObject *py_dcerpc_bind_get_max_xmit_frag(PyObject *obj, void *closure)
317 : {
318 1159 : struct dcerpc_bind *object = pytalloc_get_ptr(obj);
319 0 : PyObject *py_max_xmit_frag;
320 1159 : py_max_xmit_frag = PyLong_FromLong((uint16_t)(object->max_xmit_frag));
321 1159 : return py_max_xmit_frag;
322 : }
323 :
324 1342 : static int py_dcerpc_bind_set_max_xmit_frag(PyObject *py_obj, PyObject *value, void *closure)
325 : {
326 1342 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
327 1342 : if (value == NULL) {
328 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_xmit_frag");
329 0 : return -1;
330 : }
331 : {
332 1342 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_xmit_frag));
333 1342 : if (PyLong_Check(value)) {
334 0 : unsigned long long test_var;
335 1342 : test_var = PyLong_AsUnsignedLongLong(value);
336 1342 : if (PyErr_Occurred() != NULL) {
337 0 : return -1;
338 : }
339 1342 : if (test_var > uint_max) {
340 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
341 : PyLong_Type.tp_name, uint_max, test_var);
342 0 : return -1;
343 : }
344 1342 : object->max_xmit_frag = test_var;
345 : } else {
346 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
347 : PyLong_Type.tp_name);
348 0 : return -1;
349 : }
350 : }
351 1342 : return 0;
352 : }
353 :
354 1159 : static PyObject *py_dcerpc_bind_get_max_recv_frag(PyObject *obj, void *closure)
355 : {
356 1159 : struct dcerpc_bind *object = pytalloc_get_ptr(obj);
357 0 : PyObject *py_max_recv_frag;
358 1159 : py_max_recv_frag = PyLong_FromLong((uint16_t)(object->max_recv_frag));
359 1159 : return py_max_recv_frag;
360 : }
361 :
362 1342 : static int py_dcerpc_bind_set_max_recv_frag(PyObject *py_obj, PyObject *value, void *closure)
363 : {
364 1342 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
365 1342 : if (value == NULL) {
366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_recv_frag");
367 0 : return -1;
368 : }
369 : {
370 1342 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_recv_frag));
371 1342 : if (PyLong_Check(value)) {
372 0 : unsigned long long test_var;
373 1342 : test_var = PyLong_AsUnsignedLongLong(value);
374 1342 : if (PyErr_Occurred() != NULL) {
375 0 : return -1;
376 : }
377 1342 : if (test_var > uint_max) {
378 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
379 : PyLong_Type.tp_name, uint_max, test_var);
380 0 : return -1;
381 : }
382 1342 : object->max_recv_frag = test_var;
383 : } else {
384 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
385 : PyLong_Type.tp_name);
386 0 : return -1;
387 : }
388 : }
389 1342 : return 0;
390 : }
391 :
392 282 : static PyObject *py_dcerpc_bind_get_assoc_group_id(PyObject *obj, void *closure)
393 : {
394 282 : struct dcerpc_bind *object = pytalloc_get_ptr(obj);
395 0 : PyObject *py_assoc_group_id;
396 282 : py_assoc_group_id = PyLong_FromUnsignedLongLong((uint32_t)(object->assoc_group_id));
397 282 : return py_assoc_group_id;
398 : }
399 :
400 1342 : static int py_dcerpc_bind_set_assoc_group_id(PyObject *py_obj, PyObject *value, void *closure)
401 : {
402 1342 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
403 1342 : if (value == NULL) {
404 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->assoc_group_id");
405 0 : return -1;
406 : }
407 : {
408 1342 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->assoc_group_id));
409 1342 : if (PyLong_Check(value)) {
410 0 : unsigned long long test_var;
411 1342 : test_var = PyLong_AsUnsignedLongLong(value);
412 1342 : if (PyErr_Occurred() != NULL) {
413 0 : return -1;
414 : }
415 1342 : if (test_var > uint_max) {
416 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
417 : PyLong_Type.tp_name, uint_max, test_var);
418 0 : return -1;
419 : }
420 1342 : object->assoc_group_id = test_var;
421 : } else {
422 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
423 : PyLong_Type.tp_name);
424 0 : return -1;
425 : }
426 : }
427 1342 : return 0;
428 : }
429 :
430 0 : static PyObject *py_dcerpc_bind_get_num_contexts(PyObject *obj, void *closure)
431 : {
432 0 : struct dcerpc_bind *object = pytalloc_get_ptr(obj);
433 0 : PyObject *py_num_contexts;
434 0 : py_num_contexts = PyLong_FromLong((uint16_t)(object->num_contexts));
435 0 : return py_num_contexts;
436 : }
437 :
438 1342 : static int py_dcerpc_bind_set_num_contexts(PyObject *py_obj, PyObject *value, void *closure)
439 : {
440 1342 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
441 1342 : if (value == NULL) {
442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_contexts");
443 0 : return -1;
444 : }
445 : {
446 1342 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_contexts));
447 1342 : if (PyLong_Check(value)) {
448 0 : unsigned long long test_var;
449 1342 : test_var = PyLong_AsUnsignedLongLong(value);
450 1342 : if (PyErr_Occurred() != NULL) {
451 0 : return -1;
452 : }
453 1342 : if (test_var > uint_max) {
454 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
455 : PyLong_Type.tp_name, uint_max, test_var);
456 0 : return -1;
457 : }
458 1342 : object->num_contexts = test_var;
459 : } else {
460 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
461 : PyLong_Type.tp_name);
462 0 : return -1;
463 : }
464 : }
465 1342 : return 0;
466 : }
467 :
468 0 : static PyObject *py_dcerpc_bind_get_ctx_list(PyObject *obj, void *closure)
469 : {
470 0 : struct dcerpc_bind *object = pytalloc_get_ptr(obj);
471 0 : PyObject *py_ctx_list;
472 0 : py_ctx_list = PyList_New(object->num_contexts);
473 0 : if (py_ctx_list == NULL) {
474 0 : return NULL;
475 : }
476 : {
477 : int ctx_list_cntr_0;
478 0 : for (ctx_list_cntr_0 = 0; ctx_list_cntr_0 < (object->num_contexts); ctx_list_cntr_0++) {
479 0 : PyObject *py_ctx_list_0;
480 0 : py_ctx_list_0 = pytalloc_reference_ex(&dcerpc_ctx_list_Type, object->ctx_list, &(object->ctx_list)[ctx_list_cntr_0]);
481 0 : PyList_SetItem(py_ctx_list, ctx_list_cntr_0, py_ctx_list_0);
482 : }
483 : }
484 0 : return py_ctx_list;
485 : }
486 :
487 1342 : static int py_dcerpc_bind_set_ctx_list(PyObject *py_obj, PyObject *value, void *closure)
488 : {
489 1342 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
490 1342 : if (value == NULL) {
491 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ctx_list");
492 0 : return -1;
493 : }
494 1342 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
495 : {
496 0 : int ctx_list_cntr_0;
497 1342 : object->ctx_list = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ctx_list, PyList_GET_SIZE(value));
498 1342 : if (!object->ctx_list) { return -1; }
499 1342 : talloc_set_name_const(object->ctx_list, "ARRAY: object->ctx_list");
500 2690 : for (ctx_list_cntr_0 = 0; ctx_list_cntr_0 < PyList_GET_SIZE(value); ctx_list_cntr_0++) {
501 1348 : if (PyList_GET_ITEM(value, ctx_list_cntr_0) == NULL) {
502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->ctx_list)[ctx_list_cntr_0]");
503 0 : return -1;
504 : }
505 1348 : PY_CHECK_TYPE(&dcerpc_ctx_list_Type, PyList_GET_ITEM(value, ctx_list_cntr_0), return -1;);
506 1348 : if (talloc_reference(object->ctx_list, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ctx_list_cntr_0))) == NULL) {
507 0 : PyErr_NoMemory();
508 0 : return -1;
509 : }
510 1348 : (object->ctx_list)[ctx_list_cntr_0] = *(struct dcerpc_ctx_list *)pytalloc_get_ptr(PyList_GET_ITEM(value, ctx_list_cntr_0));
511 : }
512 : }
513 1342 : return 0;
514 : }
515 :
516 2155 : static PyObject *py_dcerpc_bind_get_auth_info(PyObject *obj, void *closure)
517 : {
518 2155 : struct dcerpc_bind *object = pytalloc_get_ptr(obj);
519 0 : PyObject *py_auth_info;
520 2155 : py_auth_info = PyBytes_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
521 2155 : return py_auth_info;
522 : }
523 :
524 1342 : static int py_dcerpc_bind_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
525 : {
526 1342 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
527 1342 : if (value == NULL) {
528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
529 0 : return -1;
530 : }
531 1342 : object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
532 1342 : return 0;
533 : }
534 :
535 : static PyGetSetDef py_dcerpc_bind_getsetters[] = {
536 : {
537 : .name = discard_const_p(char, "max_xmit_frag"),
538 : .get = py_dcerpc_bind_get_max_xmit_frag,
539 : .set = py_dcerpc_bind_set_max_xmit_frag,
540 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
541 : },
542 : {
543 : .name = discard_const_p(char, "max_recv_frag"),
544 : .get = py_dcerpc_bind_get_max_recv_frag,
545 : .set = py_dcerpc_bind_set_max_recv_frag,
546 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
547 : },
548 : {
549 : .name = discard_const_p(char, "assoc_group_id"),
550 : .get = py_dcerpc_bind_get_assoc_group_id,
551 : .set = py_dcerpc_bind_set_assoc_group_id,
552 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
553 : },
554 : {
555 : .name = discard_const_p(char, "num_contexts"),
556 : .get = py_dcerpc_bind_get_num_contexts,
557 : .set = py_dcerpc_bind_set_num_contexts,
558 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
559 : },
560 : {
561 : .name = discard_const_p(char, "ctx_list"),
562 : .get = py_dcerpc_bind_get_ctx_list,
563 : .set = py_dcerpc_bind_set_ctx_list,
564 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_ctx_list")
565 : },
566 : {
567 : .name = discard_const_p(char, "auth_info"),
568 : .get = py_dcerpc_bind_get_auth_info,
569 : .set = py_dcerpc_bind_set_auth_info,
570 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
571 : },
572 : { .name = NULL }
573 : };
574 :
575 1342 : static PyObject *py_dcerpc_bind_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
576 : {
577 1342 : return pytalloc_new(struct dcerpc_bind, type);
578 : }
579 :
580 0 : static PyObject *py_dcerpc_bind_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
581 : {
582 0 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
583 0 : PyObject *ret = NULL;
584 0 : DATA_BLOB blob;
585 0 : enum ndr_err_code err;
586 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
587 0 : if (tmp_ctx == NULL) {
588 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
589 0 : return NULL;
590 : }
591 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_bind);
592 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
593 0 : TALLOC_FREE(tmp_ctx);
594 0 : PyErr_SetNdrError(err);
595 0 : return NULL;
596 : }
597 :
598 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
599 0 : TALLOC_FREE(tmp_ctx);
600 0 : return ret;
601 : }
602 :
603 0 : static PyObject *py_dcerpc_bind_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
604 : {
605 0 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
606 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
607 0 : Py_ssize_t blob_length = 0;
608 0 : enum ndr_err_code err;
609 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
610 0 : PyObject *allow_remaining_obj = NULL;
611 0 : bool allow_remaining = false;
612 :
613 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
614 : discard_const_p(char *, kwnames),
615 : &blob.data, &blob_length,
616 : &allow_remaining_obj)) {
617 0 : return NULL;
618 : }
619 0 : blob.length = blob_length;
620 :
621 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
622 0 : allow_remaining = true;
623 : }
624 :
625 0 : if (allow_remaining) {
626 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind);
627 : } else {
628 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind);
629 : }
630 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
631 0 : PyErr_SetNdrError(err);
632 0 : return NULL;
633 : }
634 :
635 0 : Py_RETURN_NONE;
636 : }
637 :
638 0 : static PyObject *py_dcerpc_bind_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
639 : {
640 0 : struct dcerpc_bind *object = pytalloc_get_ptr(py_obj);
641 0 : PyObject *ret;
642 0 : char *retstr;
643 :
644 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_bind, "dcerpc_bind", object);
645 0 : ret = PyUnicode_FromString(retstr);
646 0 : talloc_free(retstr);
647 :
648 0 : return ret;
649 : }
650 :
651 : static PyMethodDef py_dcerpc_bind_methods[] = {
652 : { "__ndr_pack__", (PyCFunction)py_dcerpc_bind_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
653 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_bind_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
654 : { "__ndr_print__", (PyCFunction)py_dcerpc_bind_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
655 : { NULL, NULL, 0, NULL }
656 : };
657 :
658 :
659 : static PyTypeObject dcerpc_bind_Type = {
660 : PyVarObject_HEAD_INIT(NULL, 0)
661 : .tp_name = "dcerpc.bind",
662 : .tp_getset = py_dcerpc_bind_getsetters,
663 : .tp_methods = py_dcerpc_bind_methods,
664 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
665 : .tp_new = py_dcerpc_bind_new,
666 : };
667 :
668 :
669 0 : static PyObject *py_dcerpc_empty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
670 : {
671 0 : return pytalloc_new(struct dcerpc_empty, type);
672 : }
673 :
674 :
675 : static PyTypeObject dcerpc_empty_Type = {
676 : PyVarObject_HEAD_INIT(NULL, 0)
677 : .tp_name = "dcerpc.empty",
678 : .tp_getset = NULL,
679 : .tp_methods = NULL,
680 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
681 : .tp_new = py_dcerpc_empty_new,
682 : };
683 :
684 0 : static PyObject *py_import_dcerpc_object(TALLOC_CTX *mem_ctx, int level, union dcerpc_object *in)
685 : {
686 0 : PyObject *ret;
687 :
688 0 : switch (level) {
689 0 : default:
690 0 : ret = pytalloc_reference_ex(GUID_Type, mem_ctx, &in->object);
691 0 : return ret;
692 :
693 0 : case false:
694 0 : ret = pytalloc_reference_ex(&dcerpc_empty_Type, mem_ctx, &in->empty);
695 0 : return ret;
696 :
697 : }
698 : PyErr_SetString(PyExc_TypeError, "unknown union level");
699 : return NULL;
700 : }
701 :
702 0 : static union dcerpc_object *py_export_dcerpc_object(TALLOC_CTX *mem_ctx, int level, PyObject *in)
703 : {
704 0 : union dcerpc_object *ret = talloc_zero(mem_ctx, union dcerpc_object);
705 0 : switch (level) {
706 0 : default:
707 0 : if (in == NULL) {
708 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->object");
709 0 : talloc_free(ret); return NULL;
710 : }
711 0 : PY_CHECK_TYPE(GUID_Type, in, talloc_free(ret); return NULL;);
712 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
713 0 : PyErr_NoMemory();
714 0 : talloc_free(ret); return NULL;
715 : }
716 0 : ret->object = *(struct GUID *)pytalloc_get_ptr(in);
717 0 : break;
718 :
719 0 : case false:
720 0 : if (in == NULL) {
721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->empty");
722 0 : talloc_free(ret); return NULL;
723 : }
724 0 : PY_CHECK_TYPE(&dcerpc_empty_Type, in, talloc_free(ret); return NULL;);
725 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
726 0 : PyErr_NoMemory();
727 0 : talloc_free(ret); return NULL;
728 : }
729 0 : ret->empty = *(struct dcerpc_empty *)pytalloc_get_ptr(in);
730 0 : break;
731 :
732 : }
733 :
734 0 : return ret;
735 : }
736 :
737 0 : static PyObject *py_dcerpc_object_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
738 : {
739 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
740 0 : PyObject *mem_ctx_obj = NULL;
741 0 : TALLOC_CTX *mem_ctx = NULL;
742 0 : int level = 0;
743 0 : PyObject *in_obj = NULL;
744 0 : union dcerpc_object *in = NULL;
745 :
746 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
747 : discard_const_p(char *, kwnames),
748 : &mem_ctx_obj,
749 : &level,
750 : &in_obj)) {
751 0 : return NULL;
752 : }
753 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
754 0 : if (mem_ctx == NULL) {
755 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
756 0 : return NULL;
757 : }
758 0 : in = (union dcerpc_object *)pytalloc_get_ptr(in_obj);
759 0 : if (in == NULL) {
760 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dcerpc_object!");
761 0 : return NULL;
762 : }
763 :
764 0 : return py_import_dcerpc_object(mem_ctx, level, in);
765 : }
766 :
767 0 : static PyObject *py_dcerpc_object_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
768 : {
769 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
770 0 : PyObject *mem_ctx_obj = NULL;
771 0 : TALLOC_CTX *mem_ctx = NULL;
772 0 : int level = 0;
773 0 : PyObject *in = NULL;
774 0 : union dcerpc_object *out = NULL;
775 :
776 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
777 : discard_const_p(char *, kwnames),
778 : &mem_ctx_obj,
779 : &level,
780 : &in)) {
781 0 : return NULL;
782 : }
783 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
784 0 : if (mem_ctx == NULL) {
785 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
786 0 : return NULL;
787 : }
788 :
789 0 : out = py_export_dcerpc_object(mem_ctx, level, in);
790 0 : if (out == NULL) {
791 0 : return NULL;
792 : }
793 :
794 0 : return pytalloc_GenericObject_reference(out);
795 : }
796 :
797 : static PyMethodDef py_dcerpc_object_methods[] = {
798 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_object_import),
799 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
800 : "T.__import__(mem_ctx, level, in) => ret." },
801 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_object_export),
802 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
803 : "T.__export__(mem_ctx, level, in) => ret." },
804 : { NULL, NULL, 0, NULL }
805 : };
806 :
807 0 : static PyObject *py_dcerpc_object_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
808 : {
809 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
810 0 : return NULL;
811 : }
812 :
813 :
814 : static PyTypeObject dcerpc_object_Type = {
815 : PyVarObject_HEAD_INIT(NULL, 0)
816 : .tp_name = "dcerpc.object",
817 : .tp_getset = NULL,
818 : .tp_methods = py_dcerpc_object_methods,
819 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
820 : .tp_new = py_dcerpc_object_new,
821 : };
822 :
823 :
824 0 : static PyObject *py_dcerpc_request_get_alloc_hint(PyObject *obj, void *closure)
825 : {
826 0 : struct dcerpc_request *object = pytalloc_get_ptr(obj);
827 0 : PyObject *py_alloc_hint;
828 0 : py_alloc_hint = PyLong_FromUnsignedLongLong((uint32_t)(object->alloc_hint));
829 0 : return py_alloc_hint;
830 : }
831 :
832 4193 : static int py_dcerpc_request_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
833 : {
834 4193 : struct dcerpc_request *object = pytalloc_get_ptr(py_obj);
835 4193 : if (value == NULL) {
836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->alloc_hint");
837 0 : return -1;
838 : }
839 : {
840 4193 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_hint));
841 4193 : if (PyLong_Check(value)) {
842 0 : unsigned long long test_var;
843 4193 : test_var = PyLong_AsUnsignedLongLong(value);
844 4193 : if (PyErr_Occurred() != NULL) {
845 0 : return -1;
846 : }
847 4193 : if (test_var > uint_max) {
848 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
849 : PyLong_Type.tp_name, uint_max, test_var);
850 0 : return -1;
851 : }
852 4193 : object->alloc_hint = test_var;
853 : } else {
854 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
855 : PyLong_Type.tp_name);
856 0 : return -1;
857 : }
858 : }
859 4193 : return 0;
860 : }
861 :
862 376 : static PyObject *py_dcerpc_request_get_context_id(PyObject *obj, void *closure)
863 : {
864 376 : struct dcerpc_request *object = pytalloc_get_ptr(obj);
865 0 : PyObject *py_context_id;
866 376 : py_context_id = PyLong_FromLong((uint16_t)(object->context_id));
867 376 : return py_context_id;
868 : }
869 :
870 4193 : static int py_dcerpc_request_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
871 : {
872 4193 : struct dcerpc_request *object = pytalloc_get_ptr(py_obj);
873 4193 : if (value == NULL) {
874 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->context_id");
875 0 : return -1;
876 : }
877 : {
878 4193 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
879 4193 : if (PyLong_Check(value)) {
880 0 : unsigned long long test_var;
881 4193 : test_var = PyLong_AsUnsignedLongLong(value);
882 4193 : if (PyErr_Occurred() != NULL) {
883 0 : return -1;
884 : }
885 4193 : if (test_var > uint_max) {
886 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
887 : PyLong_Type.tp_name, uint_max, test_var);
888 0 : return -1;
889 : }
890 4193 : object->context_id = test_var;
891 : } else {
892 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
893 : PyLong_Type.tp_name);
894 0 : return -1;
895 : }
896 : }
897 4193 : return 0;
898 : }
899 :
900 0 : static PyObject *py_dcerpc_request_get_opnum(PyObject *obj, void *closure)
901 : {
902 0 : struct dcerpc_request *object = pytalloc_get_ptr(obj);
903 0 : PyObject *py_opnum;
904 0 : py_opnum = PyLong_FromLong((uint16_t)(object->opnum));
905 0 : return py_opnum;
906 : }
907 :
908 4193 : static int py_dcerpc_request_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
909 : {
910 4193 : struct dcerpc_request *object = pytalloc_get_ptr(py_obj);
911 4193 : if (value == NULL) {
912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->opnum");
913 0 : return -1;
914 : }
915 : {
916 4193 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opnum));
917 4193 : if (PyLong_Check(value)) {
918 0 : unsigned long long test_var;
919 4193 : test_var = PyLong_AsUnsignedLongLong(value);
920 4193 : if (PyErr_Occurred() != NULL) {
921 0 : return -1;
922 : }
923 4193 : if (test_var > uint_max) {
924 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
925 : PyLong_Type.tp_name, uint_max, test_var);
926 0 : return -1;
927 : }
928 4193 : object->opnum = test_var;
929 : } else {
930 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
931 : PyLong_Type.tp_name);
932 0 : return -1;
933 : }
934 : }
935 4193 : return 0;
936 : }
937 :
938 0 : static PyObject *py_dcerpc_request_get_object(PyObject *obj, void *closure)
939 : {
940 0 : struct dcerpc_request *object = pytalloc_get_ptr(obj);
941 0 : PyObject *py_object;
942 0 : py_object = pyrpc_import_union(&dcerpc_object_Type, pytalloc_get_mem_ctx(obj), NDR_DCERPC_REQUEST_OBJECT_PRESENT, &object->object, "union dcerpc_object");
943 0 : if (py_object == NULL) {
944 0 : return NULL;
945 : }
946 0 : return py_object;
947 : }
948 :
949 0 : static int py_dcerpc_request_set_object(PyObject *py_obj, PyObject *value, void *closure)
950 : {
951 0 : struct dcerpc_request *object = pytalloc_get_ptr(py_obj);
952 0 : if (value == NULL) {
953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->object");
954 0 : return -1;
955 : }
956 : {
957 0 : union dcerpc_object *object_switch_0;
958 0 : object_switch_0 = (union dcerpc_object *)pyrpc_export_union(&dcerpc_object_Type, pytalloc_get_mem_ctx(py_obj), NDR_DCERPC_REQUEST_OBJECT_PRESENT, value, "union dcerpc_object");
959 0 : if (object_switch_0 == NULL) {
960 0 : return -1;
961 : }
962 0 : object->object = *object_switch_0;
963 : }
964 0 : return 0;
965 : }
966 :
967 648 : static PyObject *py_dcerpc_request_get_stub_and_verifier(PyObject *obj, void *closure)
968 : {
969 648 : struct dcerpc_request *object = pytalloc_get_ptr(obj);
970 0 : PyObject *py_stub_and_verifier;
971 648 : py_stub_and_verifier = PyBytes_FromStringAndSize((char *)(object->stub_and_verifier).data, (object->stub_and_verifier).length);
972 648 : return py_stub_and_verifier;
973 : }
974 :
975 4517 : static int py_dcerpc_request_set_stub_and_verifier(PyObject *py_obj, PyObject *value, void *closure)
976 : {
977 4517 : struct dcerpc_request *object = pytalloc_get_ptr(py_obj);
978 4517 : if (value == NULL) {
979 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->stub_and_verifier");
980 0 : return -1;
981 : }
982 4517 : object->stub_and_verifier = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
983 4517 : return 0;
984 : }
985 :
986 : static PyGetSetDef py_dcerpc_request_getsetters[] = {
987 : {
988 : .name = discard_const_p(char, "alloc_hint"),
989 : .get = py_dcerpc_request_get_alloc_hint,
990 : .set = py_dcerpc_request_set_alloc_hint,
991 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
992 : },
993 : {
994 : .name = discard_const_p(char, "context_id"),
995 : .get = py_dcerpc_request_get_context_id,
996 : .set = py_dcerpc_request_set_context_id,
997 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
998 : },
999 : {
1000 : .name = discard_const_p(char, "opnum"),
1001 : .get = py_dcerpc_request_get_opnum,
1002 : .set = py_dcerpc_request_set_opnum,
1003 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1004 : },
1005 : {
1006 : .name = discard_const_p(char, "object"),
1007 : .get = py_dcerpc_request_get_object,
1008 : .set = py_dcerpc_request_set_object,
1009 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_object")
1010 : },
1011 : {
1012 : .name = discard_const_p(char, "stub_and_verifier"),
1013 : .get = py_dcerpc_request_get_stub_and_verifier,
1014 : .set = py_dcerpc_request_set_stub_and_verifier,
1015 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
1016 : },
1017 : { .name = NULL }
1018 : };
1019 :
1020 4193 : static PyObject *py_dcerpc_request_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1021 : {
1022 4193 : return pytalloc_new(struct dcerpc_request, type);
1023 : }
1024 :
1025 :
1026 : static PyTypeObject dcerpc_request_Type = {
1027 : PyVarObject_HEAD_INIT(NULL, 0)
1028 : .tp_name = "dcerpc.request",
1029 : .tp_getset = py_dcerpc_request_getsetters,
1030 : .tp_methods = NULL,
1031 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1032 : .tp_new = py_dcerpc_request_new,
1033 : };
1034 :
1035 1222 : static PyObject *py_import_dcerpc_bind_ack_reason(TALLOC_CTX *mem_ctx, int level, union dcerpc_bind_ack_reason *in)
1036 : {
1037 0 : PyObject *ret;
1038 :
1039 1222 : switch (level) {
1040 15 : case DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK:
1041 15 : ret = PyLong_FromLong((uint16_t)(in->negotiate));
1042 15 : return ret;
1043 :
1044 1207 : default:
1045 1207 : ret = PyLong_FromLong((uint16_t)(in->value));
1046 1207 : return ret;
1047 :
1048 : }
1049 : PyErr_SetString(PyExc_TypeError, "unknown union level");
1050 : return NULL;
1051 : }
1052 :
1053 0 : static union dcerpc_bind_ack_reason *py_export_dcerpc_bind_ack_reason(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1054 : {
1055 0 : union dcerpc_bind_ack_reason *ret = talloc_zero(mem_ctx, union dcerpc_bind_ack_reason);
1056 0 : switch (level) {
1057 0 : case DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK:
1058 0 : if (in == NULL) {
1059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->negotiate");
1060 0 : talloc_free(ret); return NULL;
1061 : }
1062 : {
1063 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->negotiate));
1064 0 : if (PyLong_Check(in)) {
1065 0 : unsigned long long test_var;
1066 0 : test_var = PyLong_AsUnsignedLongLong(in);
1067 0 : if (PyErr_Occurred() != NULL) {
1068 0 : talloc_free(ret); return NULL;
1069 : }
1070 0 : if (test_var > uint_max) {
1071 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1072 : PyLong_Type.tp_name, uint_max, test_var);
1073 0 : talloc_free(ret); return NULL;
1074 : }
1075 0 : ret->negotiate = test_var;
1076 : } else {
1077 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1078 : PyLong_Type.tp_name);
1079 0 : talloc_free(ret); return NULL;
1080 : }
1081 : }
1082 0 : break;
1083 :
1084 0 : default:
1085 0 : if (in == NULL) {
1086 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->value");
1087 0 : talloc_free(ret); return NULL;
1088 : }
1089 : {
1090 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->value));
1091 0 : if (PyLong_Check(in)) {
1092 0 : unsigned long long test_var;
1093 0 : test_var = PyLong_AsUnsignedLongLong(in);
1094 0 : if (PyErr_Occurred() != NULL) {
1095 0 : talloc_free(ret); return NULL;
1096 : }
1097 0 : if (test_var > uint_max) {
1098 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1099 : PyLong_Type.tp_name, uint_max, test_var);
1100 0 : talloc_free(ret); return NULL;
1101 : }
1102 0 : ret->value = test_var;
1103 : } else {
1104 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1105 : PyLong_Type.tp_name);
1106 0 : talloc_free(ret); return NULL;
1107 : }
1108 : }
1109 0 : break;
1110 :
1111 : }
1112 :
1113 0 : return ret;
1114 : }
1115 :
1116 1222 : static PyObject *py_dcerpc_bind_ack_reason_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1117 : {
1118 1222 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1119 1222 : PyObject *mem_ctx_obj = NULL;
1120 1222 : TALLOC_CTX *mem_ctx = NULL;
1121 1222 : int level = 0;
1122 1222 : PyObject *in_obj = NULL;
1123 1222 : union dcerpc_bind_ack_reason *in = NULL;
1124 :
1125 1222 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
1126 : discard_const_p(char *, kwnames),
1127 : &mem_ctx_obj,
1128 : &level,
1129 : &in_obj)) {
1130 0 : return NULL;
1131 : }
1132 1222 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1133 1222 : if (mem_ctx == NULL) {
1134 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1135 0 : return NULL;
1136 : }
1137 1222 : in = (union dcerpc_bind_ack_reason *)pytalloc_get_ptr(in_obj);
1138 1222 : if (in == NULL) {
1139 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dcerpc_bind_ack_reason!");
1140 0 : return NULL;
1141 : }
1142 :
1143 1222 : return py_import_dcerpc_bind_ack_reason(mem_ctx, level, in);
1144 : }
1145 :
1146 0 : static PyObject *py_dcerpc_bind_ack_reason_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1147 : {
1148 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
1149 0 : PyObject *mem_ctx_obj = NULL;
1150 0 : TALLOC_CTX *mem_ctx = NULL;
1151 0 : int level = 0;
1152 0 : PyObject *in = NULL;
1153 0 : union dcerpc_bind_ack_reason *out = NULL;
1154 :
1155 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
1156 : discard_const_p(char *, kwnames),
1157 : &mem_ctx_obj,
1158 : &level,
1159 : &in)) {
1160 0 : return NULL;
1161 : }
1162 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
1163 0 : if (mem_ctx == NULL) {
1164 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
1165 0 : return NULL;
1166 : }
1167 :
1168 0 : out = py_export_dcerpc_bind_ack_reason(mem_ctx, level, in);
1169 0 : if (out == NULL) {
1170 0 : return NULL;
1171 : }
1172 :
1173 0 : return pytalloc_GenericObject_reference(out);
1174 : }
1175 :
1176 : static PyMethodDef py_dcerpc_bind_ack_reason_methods[] = {
1177 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_bind_ack_reason_import),
1178 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1179 : "T.__import__(mem_ctx, level, in) => ret." },
1180 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_bind_ack_reason_export),
1181 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
1182 : "T.__export__(mem_ctx, level, in) => ret." },
1183 : { NULL, NULL, 0, NULL }
1184 : };
1185 :
1186 0 : static PyObject *py_dcerpc_bind_ack_reason_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1187 : {
1188 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
1189 0 : return NULL;
1190 : }
1191 :
1192 :
1193 : static PyTypeObject dcerpc_bind_ack_reason_Type = {
1194 : PyVarObject_HEAD_INIT(NULL, 0)
1195 : .tp_name = "dcerpc.bind_ack_reason",
1196 : .tp_getset = NULL,
1197 : .tp_methods = py_dcerpc_bind_ack_reason_methods,
1198 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1199 : .tp_new = py_dcerpc_bind_ack_reason_new,
1200 : };
1201 :
1202 :
1203 1222 : static PyObject *py_dcerpc_ack_ctx_get_result(PyObject *obj, void *closure)
1204 : {
1205 1222 : struct dcerpc_ack_ctx *object = pytalloc_get_ptr(obj);
1206 0 : PyObject *py_result;
1207 1222 : py_result = PyLong_FromLong((uint16_t)(object->result));
1208 1222 : return py_result;
1209 : }
1210 :
1211 0 : static int py_dcerpc_ack_ctx_set_result(PyObject *py_obj, PyObject *value, void *closure)
1212 : {
1213 0 : struct dcerpc_ack_ctx *object = pytalloc_get_ptr(py_obj);
1214 0 : if (value == NULL) {
1215 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->result");
1216 0 : return -1;
1217 : }
1218 : {
1219 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->result));
1220 0 : if (PyLong_Check(value)) {
1221 0 : unsigned long long test_var;
1222 0 : test_var = PyLong_AsUnsignedLongLong(value);
1223 0 : if (PyErr_Occurred() != NULL) {
1224 0 : return -1;
1225 : }
1226 0 : if (test_var > uint_max) {
1227 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1228 : PyLong_Type.tp_name, uint_max, test_var);
1229 0 : return -1;
1230 : }
1231 0 : object->result = test_var;
1232 : } else {
1233 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1234 : PyLong_Type.tp_name);
1235 0 : return -1;
1236 : }
1237 : }
1238 0 : return 0;
1239 : }
1240 :
1241 1222 : static PyObject *py_dcerpc_ack_ctx_get_reason(PyObject *obj, void *closure)
1242 : {
1243 1222 : struct dcerpc_ack_ctx *object = pytalloc_get_ptr(obj);
1244 0 : PyObject *py_reason;
1245 1222 : py_reason = pyrpc_import_union(&dcerpc_bind_ack_reason_Type, pytalloc_get_mem_ctx(obj), object->result, &object->reason, "union dcerpc_bind_ack_reason");
1246 1222 : if (py_reason == NULL) {
1247 0 : return NULL;
1248 : }
1249 1222 : return py_reason;
1250 : }
1251 :
1252 0 : static int py_dcerpc_ack_ctx_set_reason(PyObject *py_obj, PyObject *value, void *closure)
1253 : {
1254 0 : struct dcerpc_ack_ctx *object = pytalloc_get_ptr(py_obj);
1255 0 : if (value == NULL) {
1256 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reason");
1257 0 : return -1;
1258 : }
1259 : {
1260 0 : union dcerpc_bind_ack_reason *reason_switch_0;
1261 0 : reason_switch_0 = (union dcerpc_bind_ack_reason *)pyrpc_export_union(&dcerpc_bind_ack_reason_Type, pytalloc_get_mem_ctx(py_obj), object->result, value, "union dcerpc_bind_ack_reason");
1262 0 : if (reason_switch_0 == NULL) {
1263 0 : return -1;
1264 : }
1265 0 : object->reason = *reason_switch_0;
1266 : }
1267 0 : return 0;
1268 : }
1269 :
1270 1222 : static PyObject *py_dcerpc_ack_ctx_get_syntax(PyObject *obj, void *closure)
1271 : {
1272 1222 : struct dcerpc_ack_ctx *object = pytalloc_get_ptr(obj);
1273 0 : PyObject *py_syntax;
1274 1222 : py_syntax = pytalloc_reference_ex(ndr_syntax_id_Type, pytalloc_get_mem_ctx(obj), &object->syntax);
1275 1222 : return py_syntax;
1276 : }
1277 :
1278 0 : static int py_dcerpc_ack_ctx_set_syntax(PyObject *py_obj, PyObject *value, void *closure)
1279 : {
1280 0 : struct dcerpc_ack_ctx *object = pytalloc_get_ptr(py_obj);
1281 0 : if (value == NULL) {
1282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->syntax");
1283 0 : return -1;
1284 : }
1285 0 : PY_CHECK_TYPE(ndr_syntax_id_Type, value, return -1;);
1286 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1287 0 : PyErr_NoMemory();
1288 0 : return -1;
1289 : }
1290 0 : object->syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
1291 0 : return 0;
1292 : }
1293 :
1294 : static PyGetSetDef py_dcerpc_ack_ctx_getsetters[] = {
1295 : {
1296 : .name = discard_const_p(char, "result"),
1297 : .get = py_dcerpc_ack_ctx_get_result,
1298 : .set = py_dcerpc_ack_ctx_set_result,
1299 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_bind_ack_result")
1300 : },
1301 : {
1302 : .name = discard_const_p(char, "reason"),
1303 : .get = py_dcerpc_ack_ctx_get_reason,
1304 : .set = py_dcerpc_ack_ctx_set_reason,
1305 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_bind_ack_reason")
1306 : },
1307 : {
1308 : .name = discard_const_p(char, "syntax"),
1309 : .get = py_dcerpc_ack_ctx_get_syntax,
1310 : .set = py_dcerpc_ack_ctx_set_syntax,
1311 : .doc = discard_const_p(char, "PIDL-generated element of base type ndr_syntax_id")
1312 : },
1313 : { .name = NULL }
1314 : };
1315 :
1316 0 : static PyObject *py_dcerpc_ack_ctx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1317 : {
1318 0 : return pytalloc_new(struct dcerpc_ack_ctx, type);
1319 : }
1320 :
1321 :
1322 : static PyTypeObject dcerpc_ack_ctx_Type = {
1323 : PyVarObject_HEAD_INIT(NULL, 0)
1324 : .tp_name = "dcerpc.ack_ctx",
1325 : .tp_getset = py_dcerpc_ack_ctx_getsetters,
1326 : .tp_methods = NULL,
1327 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1328 : .tp_new = py_dcerpc_ack_ctx_new,
1329 : };
1330 :
1331 :
1332 1207 : static PyObject *py_dcerpc_bind_ack_get_max_xmit_frag(PyObject *obj, void *closure)
1333 : {
1334 1207 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1335 0 : PyObject *py_max_xmit_frag;
1336 1207 : py_max_xmit_frag = PyLong_FromLong((uint16_t)(object->max_xmit_frag));
1337 1207 : return py_max_xmit_frag;
1338 : }
1339 :
1340 0 : static int py_dcerpc_bind_ack_set_max_xmit_frag(PyObject *py_obj, PyObject *value, void *closure)
1341 : {
1342 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1343 0 : if (value == NULL) {
1344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_xmit_frag");
1345 0 : return -1;
1346 : }
1347 : {
1348 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_xmit_frag));
1349 0 : if (PyLong_Check(value)) {
1350 0 : unsigned long long test_var;
1351 0 : test_var = PyLong_AsUnsignedLongLong(value);
1352 0 : if (PyErr_Occurred() != NULL) {
1353 0 : return -1;
1354 : }
1355 0 : if (test_var > uint_max) {
1356 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1357 : PyLong_Type.tp_name, uint_max, test_var);
1358 0 : return -1;
1359 : }
1360 0 : object->max_xmit_frag = test_var;
1361 : } else {
1362 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1363 : PyLong_Type.tp_name);
1364 0 : return -1;
1365 : }
1366 : }
1367 0 : return 0;
1368 : }
1369 :
1370 1212 : static PyObject *py_dcerpc_bind_ack_get_max_recv_frag(PyObject *obj, void *closure)
1371 : {
1372 1212 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1373 0 : PyObject *py_max_recv_frag;
1374 1212 : py_max_recv_frag = PyLong_FromLong((uint16_t)(object->max_recv_frag));
1375 1212 : return py_max_recv_frag;
1376 : }
1377 :
1378 0 : static int py_dcerpc_bind_ack_set_max_recv_frag(PyObject *py_obj, PyObject *value, void *closure)
1379 : {
1380 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1381 0 : if (value == NULL) {
1382 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_recv_frag");
1383 0 : return -1;
1384 : }
1385 : {
1386 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_recv_frag));
1387 0 : if (PyLong_Check(value)) {
1388 0 : unsigned long long test_var;
1389 0 : test_var = PyLong_AsUnsignedLongLong(value);
1390 0 : if (PyErr_Occurred() != NULL) {
1391 0 : return -1;
1392 : }
1393 0 : if (test_var > uint_max) {
1394 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1395 : PyLong_Type.tp_name, uint_max, test_var);
1396 0 : return -1;
1397 : }
1398 0 : object->max_recv_frag = test_var;
1399 : } else {
1400 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1401 : PyLong_Type.tp_name);
1402 0 : return -1;
1403 : }
1404 : }
1405 0 : return 0;
1406 : }
1407 :
1408 1931 : static PyObject *py_dcerpc_bind_ack_get_assoc_group_id(PyObject *obj, void *closure)
1409 : {
1410 1931 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1411 0 : PyObject *py_assoc_group_id;
1412 1931 : py_assoc_group_id = PyLong_FromUnsignedLongLong((uint32_t)(object->assoc_group_id));
1413 1931 : return py_assoc_group_id;
1414 : }
1415 :
1416 0 : static int py_dcerpc_bind_ack_set_assoc_group_id(PyObject *py_obj, PyObject *value, void *closure)
1417 : {
1418 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1419 0 : if (value == NULL) {
1420 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->assoc_group_id");
1421 0 : return -1;
1422 : }
1423 : {
1424 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->assoc_group_id));
1425 0 : if (PyLong_Check(value)) {
1426 0 : unsigned long long test_var;
1427 0 : test_var = PyLong_AsUnsignedLongLong(value);
1428 0 : if (PyErr_Occurred() != NULL) {
1429 0 : return -1;
1430 : }
1431 0 : if (test_var > uint_max) {
1432 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1433 : PyLong_Type.tp_name, uint_max, test_var);
1434 0 : return -1;
1435 : }
1436 0 : object->assoc_group_id = test_var;
1437 : } else {
1438 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1439 : PyLong_Type.tp_name);
1440 0 : return -1;
1441 : }
1442 : }
1443 0 : return 0;
1444 : }
1445 :
1446 1207 : static PyObject *py_dcerpc_bind_ack_get_secondary_address_size(PyObject *obj, void *closure)
1447 : {
1448 1207 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1449 0 : PyObject *py_secondary_address_size;
1450 1207 : py_secondary_address_size = PyLong_FromLong((uint16_t)(object->secondary_address_size));
1451 1207 : return py_secondary_address_size;
1452 : }
1453 :
1454 0 : static int py_dcerpc_bind_ack_set_secondary_address_size(PyObject *py_obj, PyObject *value, void *closure)
1455 : {
1456 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1457 0 : if (value == NULL) {
1458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->secondary_address_size");
1459 0 : return -1;
1460 : }
1461 : {
1462 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->secondary_address_size));
1463 0 : if (PyLong_Check(value)) {
1464 0 : unsigned long long test_var;
1465 0 : test_var = PyLong_AsUnsignedLongLong(value);
1466 0 : if (PyErr_Occurred() != NULL) {
1467 0 : return -1;
1468 : }
1469 0 : if (test_var > uint_max) {
1470 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1471 : PyLong_Type.tp_name, uint_max, test_var);
1472 0 : return -1;
1473 : }
1474 0 : object->secondary_address_size = test_var;
1475 : } else {
1476 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1477 : PyLong_Type.tp_name);
1478 0 : return -1;
1479 : }
1480 : }
1481 0 : return 0;
1482 : }
1483 :
1484 1126 : static PyObject *py_dcerpc_bind_ack_get_secondary_address(PyObject *obj, void *closure)
1485 : {
1486 1126 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1487 0 : PyObject *py_secondary_address;
1488 1126 : if (object->secondary_address == NULL) {
1489 0 : py_secondary_address = Py_None;
1490 0 : Py_INCREF(py_secondary_address);
1491 : } else {
1492 1126 : py_secondary_address = PyUnicode_Decode(object->secondary_address, strlen(object->secondary_address), "utf-8", "ignore");
1493 : }
1494 1126 : return py_secondary_address;
1495 : }
1496 :
1497 0 : static int py_dcerpc_bind_ack_set_secondary_address(PyObject *py_obj, PyObject *value, void *closure)
1498 : {
1499 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1500 0 : if (value == NULL) {
1501 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->secondary_address");
1502 0 : return -1;
1503 : }
1504 : {
1505 0 : const char *test_str;
1506 0 : const char *talloc_str;
1507 0 : PyObject *unicode = NULL;
1508 0 : if (PyUnicode_Check(value)) {
1509 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1510 0 : if (unicode == NULL) {
1511 0 : return -1;
1512 : }
1513 0 : test_str = PyBytes_AS_STRING(unicode);
1514 0 : } else if (PyBytes_Check(value)) {
1515 0 : test_str = PyBytes_AS_STRING(value);
1516 : } else {
1517 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1518 0 : return -1;
1519 : }
1520 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1521 0 : if (unicode != NULL) {
1522 0 : Py_DECREF(unicode);
1523 : }
1524 0 : if (talloc_str == NULL) {
1525 0 : PyErr_NoMemory();
1526 0 : return -1;
1527 : }
1528 0 : object->secondary_address = talloc_str;
1529 : }
1530 0 : return 0;
1531 : }
1532 :
1533 1207 : static PyObject *py_dcerpc_bind_ack_get__pad1(PyObject *obj, void *closure)
1534 : {
1535 1207 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1536 0 : PyObject *py__pad1;
1537 1207 : py__pad1 = PyBytes_FromStringAndSize((char *)(object->_pad1).data, (object->_pad1).length);
1538 1207 : return py__pad1;
1539 : }
1540 :
1541 0 : static int py_dcerpc_bind_ack_set__pad1(PyObject *py_obj, PyObject *value, void *closure)
1542 : {
1543 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1544 0 : if (value == NULL) {
1545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad1");
1546 0 : return -1;
1547 : }
1548 0 : object->_pad1 = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
1549 0 : return 0;
1550 : }
1551 :
1552 1207 : static PyObject *py_dcerpc_bind_ack_get_num_results(PyObject *obj, void *closure)
1553 : {
1554 1207 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1555 0 : PyObject *py_num_results;
1556 1207 : py_num_results = PyLong_FromLong((uint16_t)(object->num_results));
1557 1207 : return py_num_results;
1558 : }
1559 :
1560 0 : static int py_dcerpc_bind_ack_set_num_results(PyObject *py_obj, PyObject *value, void *closure)
1561 : {
1562 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1563 0 : if (value == NULL) {
1564 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_results");
1565 0 : return -1;
1566 : }
1567 : {
1568 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_results));
1569 0 : if (PyLong_Check(value)) {
1570 0 : unsigned long long test_var;
1571 0 : test_var = PyLong_AsUnsignedLongLong(value);
1572 0 : if (PyErr_Occurred() != NULL) {
1573 0 : return -1;
1574 : }
1575 0 : if (test_var > uint_max) {
1576 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1577 : PyLong_Type.tp_name, uint_max, test_var);
1578 0 : return -1;
1579 : }
1580 0 : object->num_results = test_var;
1581 : } else {
1582 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1583 : PyLong_Type.tp_name);
1584 0 : return -1;
1585 : }
1586 : }
1587 0 : return 0;
1588 : }
1589 :
1590 3666 : static PyObject *py_dcerpc_bind_ack_get_ctx_list(PyObject *obj, void *closure)
1591 : {
1592 3666 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1593 0 : PyObject *py_ctx_list;
1594 3666 : py_ctx_list = PyList_New(object->num_results);
1595 3666 : if (py_ctx_list == NULL) {
1596 0 : return NULL;
1597 : }
1598 : {
1599 : int ctx_list_cntr_0;
1600 7422 : for (ctx_list_cntr_0 = 0; ctx_list_cntr_0 < (object->num_results); ctx_list_cntr_0++) {
1601 0 : PyObject *py_ctx_list_0;
1602 3756 : py_ctx_list_0 = pytalloc_reference_ex(&dcerpc_ack_ctx_Type, object->ctx_list, &(object->ctx_list)[ctx_list_cntr_0]);
1603 3756 : PyList_SetItem(py_ctx_list, ctx_list_cntr_0, py_ctx_list_0);
1604 : }
1605 : }
1606 3666 : return py_ctx_list;
1607 : }
1608 :
1609 0 : static int py_dcerpc_bind_ack_set_ctx_list(PyObject *py_obj, PyObject *value, void *closure)
1610 : {
1611 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1612 0 : if (value == NULL) {
1613 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ctx_list");
1614 0 : return -1;
1615 : }
1616 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1617 : {
1618 0 : int ctx_list_cntr_0;
1619 0 : object->ctx_list = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ctx_list, PyList_GET_SIZE(value));
1620 0 : if (!object->ctx_list) { return -1; }
1621 0 : talloc_set_name_const(object->ctx_list, "ARRAY: object->ctx_list");
1622 0 : for (ctx_list_cntr_0 = 0; ctx_list_cntr_0 < PyList_GET_SIZE(value); ctx_list_cntr_0++) {
1623 0 : if (PyList_GET_ITEM(value, ctx_list_cntr_0) == NULL) {
1624 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->ctx_list)[ctx_list_cntr_0]");
1625 0 : return -1;
1626 : }
1627 0 : PY_CHECK_TYPE(&dcerpc_ack_ctx_Type, PyList_GET_ITEM(value, ctx_list_cntr_0), return -1;);
1628 0 : if (talloc_reference(object->ctx_list, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ctx_list_cntr_0))) == NULL) {
1629 0 : PyErr_NoMemory();
1630 0 : return -1;
1631 : }
1632 0 : (object->ctx_list)[ctx_list_cntr_0] = *(struct dcerpc_ack_ctx *)pytalloc_get_ptr(PyList_GET_ITEM(value, ctx_list_cntr_0));
1633 : }
1634 : }
1635 0 : return 0;
1636 : }
1637 :
1638 4484 : static PyObject *py_dcerpc_bind_ack_get_auth_info(PyObject *obj, void *closure)
1639 : {
1640 4484 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(obj);
1641 0 : PyObject *py_auth_info;
1642 4484 : py_auth_info = PyBytes_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
1643 4484 : return py_auth_info;
1644 : }
1645 :
1646 0 : static int py_dcerpc_bind_ack_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
1647 : {
1648 0 : struct dcerpc_bind_ack *object = pytalloc_get_ptr(py_obj);
1649 0 : if (value == NULL) {
1650 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
1651 0 : return -1;
1652 : }
1653 0 : object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
1654 0 : return 0;
1655 : }
1656 :
1657 : static PyGetSetDef py_dcerpc_bind_ack_getsetters[] = {
1658 : {
1659 : .name = discard_const_p(char, "max_xmit_frag"),
1660 : .get = py_dcerpc_bind_ack_get_max_xmit_frag,
1661 : .set = py_dcerpc_bind_ack_set_max_xmit_frag,
1662 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1663 : },
1664 : {
1665 : .name = discard_const_p(char, "max_recv_frag"),
1666 : .get = py_dcerpc_bind_ack_get_max_recv_frag,
1667 : .set = py_dcerpc_bind_ack_set_max_recv_frag,
1668 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1669 : },
1670 : {
1671 : .name = discard_const_p(char, "assoc_group_id"),
1672 : .get = py_dcerpc_bind_ack_get_assoc_group_id,
1673 : .set = py_dcerpc_bind_ack_set_assoc_group_id,
1674 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1675 : },
1676 : {
1677 : .name = discard_const_p(char, "secondary_address_size"),
1678 : .get = py_dcerpc_bind_ack_get_secondary_address_size,
1679 : .set = py_dcerpc_bind_ack_set_secondary_address_size,
1680 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1681 : },
1682 : {
1683 : .name = discard_const_p(char, "secondary_address"),
1684 : .get = py_dcerpc_bind_ack_get_secondary_address,
1685 : .set = py_dcerpc_bind_ack_set_secondary_address,
1686 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1687 : },
1688 : {
1689 : .name = discard_const_p(char, "_pad1"),
1690 : .get = py_dcerpc_bind_ack_get__pad1,
1691 : .set = py_dcerpc_bind_ack_set__pad1,
1692 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
1693 : },
1694 : {
1695 : .name = discard_const_p(char, "num_results"),
1696 : .get = py_dcerpc_bind_ack_get_num_results,
1697 : .set = py_dcerpc_bind_ack_set_num_results,
1698 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1699 : },
1700 : {
1701 : .name = discard_const_p(char, "ctx_list"),
1702 : .get = py_dcerpc_bind_ack_get_ctx_list,
1703 : .set = py_dcerpc_bind_ack_set_ctx_list,
1704 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_ack_ctx")
1705 : },
1706 : {
1707 : .name = discard_const_p(char, "auth_info"),
1708 : .get = py_dcerpc_bind_ack_get_auth_info,
1709 : .set = py_dcerpc_bind_ack_set_auth_info,
1710 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
1711 : },
1712 : { .name = NULL }
1713 : };
1714 :
1715 0 : static PyObject *py_dcerpc_bind_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1716 : {
1717 0 : return pytalloc_new(struct dcerpc_bind_ack, type);
1718 : }
1719 :
1720 :
1721 : static PyTypeObject dcerpc_bind_ack_Type = {
1722 : PyVarObject_HEAD_INIT(NULL, 0)
1723 : .tp_name = "dcerpc.bind_ack",
1724 : .tp_getset = py_dcerpc_bind_ack_getsetters,
1725 : .tp_methods = NULL,
1726 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1727 : .tp_new = py_dcerpc_bind_ack_new,
1728 : };
1729 :
1730 :
1731 72 : static PyObject *py_dcerpc_bind_nak_version_get_rpc_vers(PyObject *obj, void *closure)
1732 : {
1733 72 : struct dcerpc_bind_nak_version *object = pytalloc_get_ptr(obj);
1734 0 : PyObject *py_rpc_vers;
1735 72 : py_rpc_vers = PyLong_FromLong((uint16_t)(object->rpc_vers));
1736 72 : return py_rpc_vers;
1737 : }
1738 :
1739 0 : static int py_dcerpc_bind_nak_version_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
1740 : {
1741 0 : struct dcerpc_bind_nak_version *object = pytalloc_get_ptr(py_obj);
1742 0 : if (value == NULL) {
1743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rpc_vers");
1744 0 : return -1;
1745 : }
1746 : {
1747 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers));
1748 0 : if (PyLong_Check(value)) {
1749 0 : unsigned long long test_var;
1750 0 : test_var = PyLong_AsUnsignedLongLong(value);
1751 0 : if (PyErr_Occurred() != NULL) {
1752 0 : return -1;
1753 : }
1754 0 : if (test_var > uint_max) {
1755 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1756 : PyLong_Type.tp_name, uint_max, test_var);
1757 0 : return -1;
1758 : }
1759 0 : object->rpc_vers = test_var;
1760 : } else {
1761 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1762 : PyLong_Type.tp_name);
1763 0 : return -1;
1764 : }
1765 : }
1766 0 : return 0;
1767 : }
1768 :
1769 72 : static PyObject *py_dcerpc_bind_nak_version_get_rpc_vers_minor(PyObject *obj, void *closure)
1770 : {
1771 72 : struct dcerpc_bind_nak_version *object = pytalloc_get_ptr(obj);
1772 0 : PyObject *py_rpc_vers_minor;
1773 72 : py_rpc_vers_minor = PyLong_FromLong((uint16_t)(object->rpc_vers_minor));
1774 72 : return py_rpc_vers_minor;
1775 : }
1776 :
1777 0 : static int py_dcerpc_bind_nak_version_set_rpc_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
1778 : {
1779 0 : struct dcerpc_bind_nak_version *object = pytalloc_get_ptr(py_obj);
1780 0 : if (value == NULL) {
1781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rpc_vers_minor");
1782 0 : return -1;
1783 : }
1784 : {
1785 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers_minor));
1786 0 : if (PyLong_Check(value)) {
1787 0 : unsigned long long test_var;
1788 0 : test_var = PyLong_AsUnsignedLongLong(value);
1789 0 : if (PyErr_Occurred() != NULL) {
1790 0 : return -1;
1791 : }
1792 0 : if (test_var > uint_max) {
1793 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1794 : PyLong_Type.tp_name, uint_max, test_var);
1795 0 : return -1;
1796 : }
1797 0 : object->rpc_vers_minor = test_var;
1798 : } else {
1799 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1800 : PyLong_Type.tp_name);
1801 0 : return -1;
1802 : }
1803 : }
1804 0 : return 0;
1805 : }
1806 :
1807 : static PyGetSetDef py_dcerpc_bind_nak_version_getsetters[] = {
1808 : {
1809 : .name = discard_const_p(char, "rpc_vers"),
1810 : .get = py_dcerpc_bind_nak_version_get_rpc_vers,
1811 : .set = py_dcerpc_bind_nak_version_set_rpc_vers,
1812 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1813 : },
1814 : {
1815 : .name = discard_const_p(char, "rpc_vers_minor"),
1816 : .get = py_dcerpc_bind_nak_version_get_rpc_vers_minor,
1817 : .set = py_dcerpc_bind_nak_version_set_rpc_vers_minor,
1818 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1819 : },
1820 : { .name = NULL }
1821 : };
1822 :
1823 0 : static PyObject *py_dcerpc_bind_nak_version_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1824 : {
1825 0 : return pytalloc_new(struct dcerpc_bind_nak_version, type);
1826 : }
1827 :
1828 0 : static PyObject *py_dcerpc_bind_nak_version_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1829 : {
1830 0 : struct dcerpc_bind_nak_version *object = pytalloc_get_ptr(py_obj);
1831 0 : PyObject *ret = NULL;
1832 0 : DATA_BLOB blob;
1833 0 : enum ndr_err_code err;
1834 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1835 0 : if (tmp_ctx == NULL) {
1836 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1837 0 : return NULL;
1838 : }
1839 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_bind_nak_version);
1840 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1841 0 : TALLOC_FREE(tmp_ctx);
1842 0 : PyErr_SetNdrError(err);
1843 0 : return NULL;
1844 : }
1845 :
1846 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1847 0 : TALLOC_FREE(tmp_ctx);
1848 0 : return ret;
1849 : }
1850 :
1851 0 : static PyObject *py_dcerpc_bind_nak_version_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1852 : {
1853 0 : struct dcerpc_bind_nak_version *object = pytalloc_get_ptr(py_obj);
1854 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1855 0 : Py_ssize_t blob_length = 0;
1856 0 : enum ndr_err_code err;
1857 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1858 0 : PyObject *allow_remaining_obj = NULL;
1859 0 : bool allow_remaining = false;
1860 :
1861 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1862 : discard_const_p(char *, kwnames),
1863 : &blob.data, &blob_length,
1864 : &allow_remaining_obj)) {
1865 0 : return NULL;
1866 : }
1867 0 : blob.length = blob_length;
1868 :
1869 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1870 0 : allow_remaining = true;
1871 : }
1872 :
1873 0 : if (allow_remaining) {
1874 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind_nak_version);
1875 : } else {
1876 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind_nak_version);
1877 : }
1878 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1879 0 : PyErr_SetNdrError(err);
1880 0 : return NULL;
1881 : }
1882 :
1883 0 : Py_RETURN_NONE;
1884 : }
1885 :
1886 0 : static PyObject *py_dcerpc_bind_nak_version_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1887 : {
1888 0 : struct dcerpc_bind_nak_version *object = pytalloc_get_ptr(py_obj);
1889 0 : PyObject *ret;
1890 0 : char *retstr;
1891 :
1892 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_bind_nak_version, "dcerpc_bind_nak_version", object);
1893 0 : ret = PyUnicode_FromString(retstr);
1894 0 : talloc_free(retstr);
1895 :
1896 0 : return ret;
1897 : }
1898 :
1899 : static PyMethodDef py_dcerpc_bind_nak_version_methods[] = {
1900 : { "__ndr_pack__", (PyCFunction)py_dcerpc_bind_nak_version_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1901 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_bind_nak_version_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1902 : { "__ndr_print__", (PyCFunction)py_dcerpc_bind_nak_version_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1903 : { NULL, NULL, 0, NULL }
1904 : };
1905 :
1906 :
1907 : static PyTypeObject dcerpc_bind_nak_version_Type = {
1908 : PyVarObject_HEAD_INIT(NULL, 0)
1909 : .tp_name = "dcerpc.bind_nak_version",
1910 : .tp_getset = py_dcerpc_bind_nak_version_getsetters,
1911 : .tp_methods = py_dcerpc_bind_nak_version_methods,
1912 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1913 : .tp_new = py_dcerpc_bind_nak_version_new,
1914 : };
1915 :
1916 :
1917 72 : static PyObject *py_dcerpc_bind_nak_get_reject_reason(PyObject *obj, void *closure)
1918 : {
1919 72 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(obj);
1920 0 : PyObject *py_reject_reason;
1921 72 : py_reject_reason = PyLong_FromLong((uint16_t)(object->reject_reason));
1922 72 : return py_reject_reason;
1923 : }
1924 :
1925 0 : static int py_dcerpc_bind_nak_set_reject_reason(PyObject *py_obj, PyObject *value, void *closure)
1926 : {
1927 0 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(py_obj);
1928 0 : if (value == NULL) {
1929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reject_reason");
1930 0 : return -1;
1931 : }
1932 : {
1933 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reject_reason));
1934 0 : if (PyLong_Check(value)) {
1935 0 : unsigned long long test_var;
1936 0 : test_var = PyLong_AsUnsignedLongLong(value);
1937 0 : if (PyErr_Occurred() != NULL) {
1938 0 : return -1;
1939 : }
1940 0 : if (test_var > uint_max) {
1941 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1942 : PyLong_Type.tp_name, uint_max, test_var);
1943 0 : return -1;
1944 : }
1945 0 : object->reject_reason = test_var;
1946 : } else {
1947 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1948 : PyLong_Type.tp_name);
1949 0 : return -1;
1950 : }
1951 : }
1952 0 : return 0;
1953 : }
1954 :
1955 72 : static PyObject *py_dcerpc_bind_nak_get_num_versions(PyObject *obj, void *closure)
1956 : {
1957 72 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(obj);
1958 0 : PyObject *py_num_versions;
1959 72 : py_num_versions = PyLong_FromLong((uint16_t)(object->num_versions));
1960 72 : return py_num_versions;
1961 : }
1962 :
1963 0 : static int py_dcerpc_bind_nak_set_num_versions(PyObject *py_obj, PyObject *value, void *closure)
1964 : {
1965 0 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(py_obj);
1966 0 : if (value == NULL) {
1967 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_versions");
1968 0 : return -1;
1969 : }
1970 : {
1971 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_versions));
1972 0 : if (PyLong_Check(value)) {
1973 0 : unsigned long long test_var;
1974 0 : test_var = PyLong_AsUnsignedLongLong(value);
1975 0 : if (PyErr_Occurred() != NULL) {
1976 0 : return -1;
1977 : }
1978 0 : if (test_var > uint_max) {
1979 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1980 : PyLong_Type.tp_name, uint_max, test_var);
1981 0 : return -1;
1982 : }
1983 0 : object->num_versions = test_var;
1984 : } else {
1985 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1986 : PyLong_Type.tp_name);
1987 0 : return -1;
1988 : }
1989 : }
1990 0 : return 0;
1991 : }
1992 :
1993 144 : static PyObject *py_dcerpc_bind_nak_get_versions(PyObject *obj, void *closure)
1994 : {
1995 144 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(obj);
1996 0 : PyObject *py_versions;
1997 144 : py_versions = PyList_New(object->num_versions);
1998 144 : if (py_versions == NULL) {
1999 0 : return NULL;
2000 : }
2001 : {
2002 : int versions_cntr_0;
2003 288 : for (versions_cntr_0 = 0; versions_cntr_0 < (object->num_versions); versions_cntr_0++) {
2004 0 : PyObject *py_versions_0;
2005 144 : py_versions_0 = pytalloc_reference_ex(&dcerpc_bind_nak_version_Type, object->versions, &(object->versions)[versions_cntr_0]);
2006 144 : PyList_SetItem(py_versions, versions_cntr_0, py_versions_0);
2007 : }
2008 : }
2009 144 : return py_versions;
2010 : }
2011 :
2012 0 : static int py_dcerpc_bind_nak_set_versions(PyObject *py_obj, PyObject *value, void *closure)
2013 : {
2014 0 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(py_obj);
2015 0 : if (value == NULL) {
2016 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->versions");
2017 0 : return -1;
2018 : }
2019 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2020 : {
2021 0 : int versions_cntr_0;
2022 0 : object->versions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->versions, PyList_GET_SIZE(value));
2023 0 : if (!object->versions) { return -1; }
2024 0 : talloc_set_name_const(object->versions, "ARRAY: object->versions");
2025 0 : for (versions_cntr_0 = 0; versions_cntr_0 < PyList_GET_SIZE(value); versions_cntr_0++) {
2026 0 : if (PyList_GET_ITEM(value, versions_cntr_0) == NULL) {
2027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->versions)[versions_cntr_0]");
2028 0 : return -1;
2029 : }
2030 0 : PY_CHECK_TYPE(&dcerpc_bind_nak_version_Type, PyList_GET_ITEM(value, versions_cntr_0), return -1;);
2031 0 : if (talloc_reference(object->versions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, versions_cntr_0))) == NULL) {
2032 0 : PyErr_NoMemory();
2033 0 : return -1;
2034 : }
2035 0 : (object->versions)[versions_cntr_0] = *(struct dcerpc_bind_nak_version *)pytalloc_get_ptr(PyList_GET_ITEM(value, versions_cntr_0));
2036 : }
2037 : }
2038 0 : return 0;
2039 : }
2040 :
2041 75 : static PyObject *py_dcerpc_bind_nak_get__pad(PyObject *obj, void *closure)
2042 : {
2043 75 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(obj);
2044 0 : PyObject *py__pad;
2045 75 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
2046 75 : return py__pad;
2047 : }
2048 :
2049 0 : static int py_dcerpc_bind_nak_set__pad(PyObject *py_obj, PyObject *value, void *closure)
2050 : {
2051 0 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(py_obj);
2052 0 : if (value == NULL) {
2053 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad");
2054 0 : return -1;
2055 : }
2056 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2057 0 : return 0;
2058 : }
2059 :
2060 : static PyGetSetDef py_dcerpc_bind_nak_getsetters[] = {
2061 : {
2062 : .name = discard_const_p(char, "reject_reason"),
2063 : .get = py_dcerpc_bind_nak_get_reject_reason,
2064 : .set = py_dcerpc_bind_nak_set_reject_reason,
2065 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_bind_nak_reason")
2066 : },
2067 : {
2068 : .name = discard_const_p(char, "num_versions"),
2069 : .get = py_dcerpc_bind_nak_get_num_versions,
2070 : .set = py_dcerpc_bind_nak_set_num_versions,
2071 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2072 : },
2073 : {
2074 : .name = discard_const_p(char, "versions"),
2075 : .get = py_dcerpc_bind_nak_get_versions,
2076 : .set = py_dcerpc_bind_nak_set_versions,
2077 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_bind_nak_version")
2078 : },
2079 : {
2080 : .name = discard_const_p(char, "_pad"),
2081 : .get = py_dcerpc_bind_nak_get__pad,
2082 : .set = py_dcerpc_bind_nak_set__pad,
2083 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2084 : },
2085 : { .name = NULL }
2086 : };
2087 :
2088 0 : static PyObject *py_dcerpc_bind_nak_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2089 : {
2090 0 : return pytalloc_new(struct dcerpc_bind_nak, type);
2091 : }
2092 :
2093 0 : static PyObject *py_dcerpc_bind_nak_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2094 : {
2095 0 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(py_obj);
2096 0 : PyObject *ret = NULL;
2097 0 : DATA_BLOB blob;
2098 0 : enum ndr_err_code err;
2099 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2100 0 : if (tmp_ctx == NULL) {
2101 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2102 0 : return NULL;
2103 : }
2104 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_bind_nak);
2105 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2106 0 : TALLOC_FREE(tmp_ctx);
2107 0 : PyErr_SetNdrError(err);
2108 0 : return NULL;
2109 : }
2110 :
2111 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2112 0 : TALLOC_FREE(tmp_ctx);
2113 0 : return ret;
2114 : }
2115 :
2116 0 : static PyObject *py_dcerpc_bind_nak_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2117 : {
2118 0 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(py_obj);
2119 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
2120 0 : Py_ssize_t blob_length = 0;
2121 0 : enum ndr_err_code err;
2122 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2123 0 : PyObject *allow_remaining_obj = NULL;
2124 0 : bool allow_remaining = false;
2125 :
2126 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
2127 : discard_const_p(char *, kwnames),
2128 : &blob.data, &blob_length,
2129 : &allow_remaining_obj)) {
2130 0 : return NULL;
2131 : }
2132 0 : blob.length = blob_length;
2133 :
2134 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2135 0 : allow_remaining = true;
2136 : }
2137 :
2138 0 : if (allow_remaining) {
2139 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind_nak);
2140 : } else {
2141 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_bind_nak);
2142 : }
2143 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2144 0 : PyErr_SetNdrError(err);
2145 0 : return NULL;
2146 : }
2147 :
2148 0 : Py_RETURN_NONE;
2149 : }
2150 :
2151 0 : static PyObject *py_dcerpc_bind_nak_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2152 : {
2153 0 : struct dcerpc_bind_nak *object = pytalloc_get_ptr(py_obj);
2154 0 : PyObject *ret;
2155 0 : char *retstr;
2156 :
2157 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_bind_nak, "dcerpc_bind_nak", object);
2158 0 : ret = PyUnicode_FromString(retstr);
2159 0 : talloc_free(retstr);
2160 :
2161 0 : return ret;
2162 : }
2163 :
2164 : static PyMethodDef py_dcerpc_bind_nak_methods[] = {
2165 : { "__ndr_pack__", (PyCFunction)py_dcerpc_bind_nak_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2166 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_bind_nak_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2167 : { "__ndr_print__", (PyCFunction)py_dcerpc_bind_nak_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
2168 : { NULL, NULL, 0, NULL }
2169 : };
2170 :
2171 :
2172 : static PyTypeObject dcerpc_bind_nak_Type = {
2173 : PyVarObject_HEAD_INIT(NULL, 0)
2174 : .tp_name = "dcerpc.bind_nak",
2175 : .tp_getset = py_dcerpc_bind_nak_getsetters,
2176 : .tp_methods = py_dcerpc_bind_nak_methods,
2177 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2178 : .tp_new = py_dcerpc_bind_nak_new,
2179 : };
2180 :
2181 :
2182 1999 : static PyObject *py_dcerpc_response_get_alloc_hint(PyObject *obj, void *closure)
2183 : {
2184 1999 : struct dcerpc_response *object = pytalloc_get_ptr(obj);
2185 0 : PyObject *py_alloc_hint;
2186 1999 : py_alloc_hint = PyLong_FromUnsignedLongLong((uint32_t)(object->alloc_hint));
2187 1999 : return py_alloc_hint;
2188 : }
2189 :
2190 0 : static int py_dcerpc_response_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
2191 : {
2192 0 : struct dcerpc_response *object = pytalloc_get_ptr(py_obj);
2193 0 : if (value == NULL) {
2194 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->alloc_hint");
2195 0 : return -1;
2196 : }
2197 : {
2198 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_hint));
2199 0 : if (PyLong_Check(value)) {
2200 0 : unsigned long long test_var;
2201 0 : test_var = PyLong_AsUnsignedLongLong(value);
2202 0 : if (PyErr_Occurred() != NULL) {
2203 0 : return -1;
2204 : }
2205 0 : if (test_var > uint_max) {
2206 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2207 : PyLong_Type.tp_name, uint_max, test_var);
2208 0 : return -1;
2209 : }
2210 0 : object->alloc_hint = test_var;
2211 : } else {
2212 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2213 : PyLong_Type.tp_name);
2214 0 : return -1;
2215 : }
2216 : }
2217 0 : return 0;
2218 : }
2219 :
2220 779 : static PyObject *py_dcerpc_response_get_context_id(PyObject *obj, void *closure)
2221 : {
2222 779 : struct dcerpc_response *object = pytalloc_get_ptr(obj);
2223 0 : PyObject *py_context_id;
2224 779 : py_context_id = PyLong_FromLong((uint16_t)(object->context_id));
2225 779 : return py_context_id;
2226 : }
2227 :
2228 0 : static int py_dcerpc_response_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
2229 : {
2230 0 : struct dcerpc_response *object = pytalloc_get_ptr(py_obj);
2231 0 : if (value == NULL) {
2232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->context_id");
2233 0 : return -1;
2234 : }
2235 : {
2236 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
2237 0 : if (PyLong_Check(value)) {
2238 0 : unsigned long long test_var;
2239 0 : test_var = PyLong_AsUnsignedLongLong(value);
2240 0 : if (PyErr_Occurred() != NULL) {
2241 0 : return -1;
2242 : }
2243 0 : if (test_var > uint_max) {
2244 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2245 : PyLong_Type.tp_name, uint_max, test_var);
2246 0 : return -1;
2247 : }
2248 0 : object->context_id = test_var;
2249 : } else {
2250 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2251 : PyLong_Type.tp_name);
2252 0 : return -1;
2253 : }
2254 : }
2255 0 : return 0;
2256 : }
2257 :
2258 779 : static PyObject *py_dcerpc_response_get_cancel_count(PyObject *obj, void *closure)
2259 : {
2260 779 : struct dcerpc_response *object = pytalloc_get_ptr(obj);
2261 0 : PyObject *py_cancel_count;
2262 779 : py_cancel_count = PyLong_FromLong((uint16_t)(object->cancel_count));
2263 779 : return py_cancel_count;
2264 : }
2265 :
2266 0 : static int py_dcerpc_response_set_cancel_count(PyObject *py_obj, PyObject *value, void *closure)
2267 : {
2268 0 : struct dcerpc_response *object = pytalloc_get_ptr(py_obj);
2269 0 : if (value == NULL) {
2270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cancel_count");
2271 0 : return -1;
2272 : }
2273 : {
2274 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cancel_count));
2275 0 : if (PyLong_Check(value)) {
2276 0 : unsigned long long test_var;
2277 0 : test_var = PyLong_AsUnsignedLongLong(value);
2278 0 : if (PyErr_Occurred() != NULL) {
2279 0 : return -1;
2280 : }
2281 0 : if (test_var > uint_max) {
2282 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2283 : PyLong_Type.tp_name, uint_max, test_var);
2284 0 : return -1;
2285 : }
2286 0 : object->cancel_count = test_var;
2287 : } else {
2288 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2289 : PyLong_Type.tp_name);
2290 0 : return -1;
2291 : }
2292 : }
2293 0 : return 0;
2294 : }
2295 :
2296 0 : static PyObject *py_dcerpc_response_get_reserved(PyObject *obj, void *closure)
2297 : {
2298 0 : struct dcerpc_response *object = pytalloc_get_ptr(obj);
2299 0 : PyObject *py_reserved;
2300 0 : py_reserved = PyLong_FromLong((uint16_t)(object->reserved));
2301 0 : return py_reserved;
2302 : }
2303 :
2304 0 : static int py_dcerpc_response_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
2305 : {
2306 0 : struct dcerpc_response *object = pytalloc_get_ptr(py_obj);
2307 0 : if (value == NULL) {
2308 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
2309 0 : return -1;
2310 : }
2311 : {
2312 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
2313 0 : if (PyLong_Check(value)) {
2314 0 : unsigned long long test_var;
2315 0 : test_var = PyLong_AsUnsignedLongLong(value);
2316 0 : if (PyErr_Occurred() != NULL) {
2317 0 : return -1;
2318 : }
2319 0 : if (test_var > uint_max) {
2320 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2321 : PyLong_Type.tp_name, uint_max, test_var);
2322 0 : return -1;
2323 : }
2324 0 : object->reserved = test_var;
2325 : } else {
2326 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2327 : PyLong_Type.tp_name);
2328 0 : return -1;
2329 : }
2330 : }
2331 0 : return 0;
2332 : }
2333 :
2334 1154 : static PyObject *py_dcerpc_response_get_stub_and_verifier(PyObject *obj, void *closure)
2335 : {
2336 1154 : struct dcerpc_response *object = pytalloc_get_ptr(obj);
2337 0 : PyObject *py_stub_and_verifier;
2338 1154 : py_stub_and_verifier = PyBytes_FromStringAndSize((char *)(object->stub_and_verifier).data, (object->stub_and_verifier).length);
2339 1154 : return py_stub_and_verifier;
2340 : }
2341 :
2342 0 : static int py_dcerpc_response_set_stub_and_verifier(PyObject *py_obj, PyObject *value, void *closure)
2343 : {
2344 0 : struct dcerpc_response *object = pytalloc_get_ptr(py_obj);
2345 0 : if (value == NULL) {
2346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->stub_and_verifier");
2347 0 : return -1;
2348 : }
2349 0 : object->stub_and_verifier = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2350 0 : return 0;
2351 : }
2352 :
2353 : static PyGetSetDef py_dcerpc_response_getsetters[] = {
2354 : {
2355 : .name = discard_const_p(char, "alloc_hint"),
2356 : .get = py_dcerpc_response_get_alloc_hint,
2357 : .set = py_dcerpc_response_set_alloc_hint,
2358 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2359 : },
2360 : {
2361 : .name = discard_const_p(char, "context_id"),
2362 : .get = py_dcerpc_response_get_context_id,
2363 : .set = py_dcerpc_response_set_context_id,
2364 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2365 : },
2366 : {
2367 : .name = discard_const_p(char, "cancel_count"),
2368 : .get = py_dcerpc_response_get_cancel_count,
2369 : .set = py_dcerpc_response_set_cancel_count,
2370 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2371 : },
2372 : {
2373 : .name = discard_const_p(char, "reserved"),
2374 : .get = py_dcerpc_response_get_reserved,
2375 : .set = py_dcerpc_response_set_reserved,
2376 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2377 : },
2378 : {
2379 : .name = discard_const_p(char, "stub_and_verifier"),
2380 : .get = py_dcerpc_response_get_stub_and_verifier,
2381 : .set = py_dcerpc_response_set_stub_and_verifier,
2382 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2383 : },
2384 : { .name = NULL }
2385 : };
2386 :
2387 0 : static PyObject *py_dcerpc_response_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2388 : {
2389 0 : return pytalloc_new(struct dcerpc_response, type);
2390 : }
2391 :
2392 :
2393 : static PyTypeObject dcerpc_response_Type = {
2394 : PyVarObject_HEAD_INIT(NULL, 0)
2395 : .tp_name = "dcerpc.response",
2396 : .tp_getset = py_dcerpc_response_getsetters,
2397 : .tp_methods = NULL,
2398 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2399 : .tp_new = py_dcerpc_response_new,
2400 : };
2401 :
2402 :
2403 314 : static PyObject *py_dcerpc_fault_get_alloc_hint(PyObject *obj, void *closure)
2404 : {
2405 314 : struct dcerpc_fault *object = pytalloc_get_ptr(obj);
2406 0 : PyObject *py_alloc_hint;
2407 314 : py_alloc_hint = PyLong_FromUnsignedLongLong((uint32_t)(object->alloc_hint));
2408 314 : return py_alloc_hint;
2409 : }
2410 :
2411 0 : static int py_dcerpc_fault_set_alloc_hint(PyObject *py_obj, PyObject *value, void *closure)
2412 : {
2413 0 : struct dcerpc_fault *object = pytalloc_get_ptr(py_obj);
2414 0 : if (value == NULL) {
2415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->alloc_hint");
2416 0 : return -1;
2417 : }
2418 : {
2419 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->alloc_hint));
2420 0 : if (PyLong_Check(value)) {
2421 0 : unsigned long long test_var;
2422 0 : test_var = PyLong_AsUnsignedLongLong(value);
2423 0 : if (PyErr_Occurred() != NULL) {
2424 0 : return -1;
2425 : }
2426 0 : if (test_var > uint_max) {
2427 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2428 : PyLong_Type.tp_name, uint_max, test_var);
2429 0 : return -1;
2430 : }
2431 0 : object->alloc_hint = test_var;
2432 : } else {
2433 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2434 : PyLong_Type.tp_name);
2435 0 : return -1;
2436 : }
2437 : }
2438 0 : return 0;
2439 : }
2440 :
2441 314 : static PyObject *py_dcerpc_fault_get_context_id(PyObject *obj, void *closure)
2442 : {
2443 314 : struct dcerpc_fault *object = pytalloc_get_ptr(obj);
2444 0 : PyObject *py_context_id;
2445 314 : py_context_id = PyLong_FromLong((uint16_t)(object->context_id));
2446 314 : return py_context_id;
2447 : }
2448 :
2449 0 : static int py_dcerpc_fault_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
2450 : {
2451 0 : struct dcerpc_fault *object = pytalloc_get_ptr(py_obj);
2452 0 : if (value == NULL) {
2453 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->context_id");
2454 0 : return -1;
2455 : }
2456 : {
2457 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
2458 0 : if (PyLong_Check(value)) {
2459 0 : unsigned long long test_var;
2460 0 : test_var = PyLong_AsUnsignedLongLong(value);
2461 0 : if (PyErr_Occurred() != NULL) {
2462 0 : return -1;
2463 : }
2464 0 : if (test_var > uint_max) {
2465 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2466 : PyLong_Type.tp_name, uint_max, test_var);
2467 0 : return -1;
2468 : }
2469 0 : object->context_id = test_var;
2470 : } else {
2471 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2472 : PyLong_Type.tp_name);
2473 0 : return -1;
2474 : }
2475 : }
2476 0 : return 0;
2477 : }
2478 :
2479 314 : static PyObject *py_dcerpc_fault_get_cancel_count(PyObject *obj, void *closure)
2480 : {
2481 314 : struct dcerpc_fault *object = pytalloc_get_ptr(obj);
2482 0 : PyObject *py_cancel_count;
2483 314 : py_cancel_count = PyLong_FromLong((uint16_t)(object->cancel_count));
2484 314 : return py_cancel_count;
2485 : }
2486 :
2487 0 : static int py_dcerpc_fault_set_cancel_count(PyObject *py_obj, PyObject *value, void *closure)
2488 : {
2489 0 : struct dcerpc_fault *object = pytalloc_get_ptr(py_obj);
2490 0 : if (value == NULL) {
2491 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cancel_count");
2492 0 : return -1;
2493 : }
2494 : {
2495 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cancel_count));
2496 0 : if (PyLong_Check(value)) {
2497 0 : unsigned long long test_var;
2498 0 : test_var = PyLong_AsUnsignedLongLong(value);
2499 0 : if (PyErr_Occurred() != NULL) {
2500 0 : return -1;
2501 : }
2502 0 : if (test_var > uint_max) {
2503 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2504 : PyLong_Type.tp_name, uint_max, test_var);
2505 0 : return -1;
2506 : }
2507 0 : object->cancel_count = test_var;
2508 : } else {
2509 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2510 : PyLong_Type.tp_name);
2511 0 : return -1;
2512 : }
2513 : }
2514 0 : return 0;
2515 : }
2516 :
2517 314 : static PyObject *py_dcerpc_fault_get_flags(PyObject *obj, void *closure)
2518 : {
2519 314 : struct dcerpc_fault *object = pytalloc_get_ptr(obj);
2520 0 : PyObject *py_flags;
2521 314 : py_flags = PyLong_FromLong((uint16_t)(object->flags));
2522 314 : return py_flags;
2523 : }
2524 :
2525 0 : static int py_dcerpc_fault_set_flags(PyObject *py_obj, PyObject *value, void *closure)
2526 : {
2527 0 : struct dcerpc_fault *object = pytalloc_get_ptr(py_obj);
2528 0 : if (value == NULL) {
2529 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
2530 0 : return -1;
2531 : }
2532 : {
2533 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
2534 0 : if (PyLong_Check(value)) {
2535 0 : unsigned long long test_var;
2536 0 : test_var = PyLong_AsUnsignedLongLong(value);
2537 0 : if (PyErr_Occurred() != NULL) {
2538 0 : return -1;
2539 : }
2540 0 : if (test_var > uint_max) {
2541 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2542 : PyLong_Type.tp_name, uint_max, test_var);
2543 0 : return -1;
2544 : }
2545 0 : object->flags = test_var;
2546 : } else {
2547 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2548 : PyLong_Type.tp_name);
2549 0 : return -1;
2550 : }
2551 : }
2552 0 : return 0;
2553 : }
2554 :
2555 314 : static PyObject *py_dcerpc_fault_get_status(PyObject *obj, void *closure)
2556 : {
2557 314 : struct dcerpc_fault *object = pytalloc_get_ptr(obj);
2558 0 : PyObject *py_status;
2559 314 : py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
2560 314 : return py_status;
2561 : }
2562 :
2563 0 : static int py_dcerpc_fault_set_status(PyObject *py_obj, PyObject *value, void *closure)
2564 : {
2565 0 : struct dcerpc_fault *object = pytalloc_get_ptr(py_obj);
2566 0 : if (value == NULL) {
2567 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
2568 0 : return -1;
2569 : }
2570 : {
2571 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
2572 0 : if (PyLong_Check(value)) {
2573 0 : unsigned long long test_var;
2574 0 : test_var = PyLong_AsUnsignedLongLong(value);
2575 0 : if (PyErr_Occurred() != NULL) {
2576 0 : return -1;
2577 : }
2578 0 : if (test_var > uint_max) {
2579 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2580 : PyLong_Type.tp_name, uint_max, test_var);
2581 0 : return -1;
2582 : }
2583 0 : object->status = test_var;
2584 : } else {
2585 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2586 : PyLong_Type.tp_name);
2587 0 : return -1;
2588 : }
2589 : }
2590 0 : return 0;
2591 : }
2592 :
2593 308 : static PyObject *py_dcerpc_fault_get_reserved(PyObject *obj, void *closure)
2594 : {
2595 308 : struct dcerpc_fault *object = pytalloc_get_ptr(obj);
2596 0 : PyObject *py_reserved;
2597 308 : py_reserved = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved));
2598 308 : return py_reserved;
2599 : }
2600 :
2601 0 : static int py_dcerpc_fault_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
2602 : {
2603 0 : struct dcerpc_fault *object = pytalloc_get_ptr(py_obj);
2604 0 : if (value == NULL) {
2605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
2606 0 : return -1;
2607 : }
2608 : {
2609 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
2610 0 : if (PyLong_Check(value)) {
2611 0 : unsigned long long test_var;
2612 0 : test_var = PyLong_AsUnsignedLongLong(value);
2613 0 : if (PyErr_Occurred() != NULL) {
2614 0 : return -1;
2615 : }
2616 0 : if (test_var > uint_max) {
2617 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2618 : PyLong_Type.tp_name, uint_max, test_var);
2619 0 : return -1;
2620 : }
2621 0 : object->reserved = test_var;
2622 : } else {
2623 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2624 : PyLong_Type.tp_name);
2625 0 : return -1;
2626 : }
2627 : }
2628 0 : return 0;
2629 : }
2630 :
2631 308 : static PyObject *py_dcerpc_fault_get_error_and_verifier(PyObject *obj, void *closure)
2632 : {
2633 308 : struct dcerpc_fault *object = pytalloc_get_ptr(obj);
2634 0 : PyObject *py_error_and_verifier;
2635 308 : py_error_and_verifier = PyBytes_FromStringAndSize((char *)(object->error_and_verifier).data, (object->error_and_verifier).length);
2636 308 : return py_error_and_verifier;
2637 : }
2638 :
2639 0 : static int py_dcerpc_fault_set_error_and_verifier(PyObject *py_obj, PyObject *value, void *closure)
2640 : {
2641 0 : struct dcerpc_fault *object = pytalloc_get_ptr(py_obj);
2642 0 : if (value == NULL) {
2643 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->error_and_verifier");
2644 0 : return -1;
2645 : }
2646 0 : object->error_and_verifier = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2647 0 : return 0;
2648 : }
2649 :
2650 : static PyGetSetDef py_dcerpc_fault_getsetters[] = {
2651 : {
2652 : .name = discard_const_p(char, "alloc_hint"),
2653 : .get = py_dcerpc_fault_get_alloc_hint,
2654 : .set = py_dcerpc_fault_set_alloc_hint,
2655 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2656 : },
2657 : {
2658 : .name = discard_const_p(char, "context_id"),
2659 : .get = py_dcerpc_fault_get_context_id,
2660 : .set = py_dcerpc_fault_set_context_id,
2661 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2662 : },
2663 : {
2664 : .name = discard_const_p(char, "cancel_count"),
2665 : .get = py_dcerpc_fault_get_cancel_count,
2666 : .set = py_dcerpc_fault_set_cancel_count,
2667 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2668 : },
2669 : {
2670 : .name = discard_const_p(char, "flags"),
2671 : .get = py_dcerpc_fault_get_flags,
2672 : .set = py_dcerpc_fault_set_flags,
2673 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_fault_flags")
2674 : },
2675 : {
2676 : .name = discard_const_p(char, "status"),
2677 : .get = py_dcerpc_fault_get_status,
2678 : .set = py_dcerpc_fault_set_status,
2679 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_nca_status")
2680 : },
2681 : {
2682 : .name = discard_const_p(char, "reserved"),
2683 : .get = py_dcerpc_fault_get_reserved,
2684 : .set = py_dcerpc_fault_set_reserved,
2685 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2686 : },
2687 : {
2688 : .name = discard_const_p(char, "error_and_verifier"),
2689 : .get = py_dcerpc_fault_get_error_and_verifier,
2690 : .set = py_dcerpc_fault_set_error_and_verifier,
2691 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2692 : },
2693 : { .name = NULL }
2694 : };
2695 :
2696 0 : static PyObject *py_dcerpc_fault_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2697 : {
2698 0 : return pytalloc_new(struct dcerpc_fault, type);
2699 : }
2700 :
2701 :
2702 : static PyTypeObject dcerpc_fault_Type = {
2703 : PyVarObject_HEAD_INIT(NULL, 0)
2704 : .tp_name = "dcerpc.fault",
2705 : .tp_getset = py_dcerpc_fault_getsetters,
2706 : .tp_methods = NULL,
2707 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2708 : .tp_new = py_dcerpc_fault_new,
2709 : };
2710 :
2711 :
2712 585 : static PyObject *py_dcerpc_auth_get_auth_type(PyObject *obj, void *closure)
2713 : {
2714 585 : struct dcerpc_auth *object = pytalloc_get_ptr(obj);
2715 0 : PyObject *py_auth_type;
2716 585 : py_auth_type = PyLong_FromLong((uint16_t)(object->auth_type));
2717 585 : return py_auth_type;
2718 : }
2719 :
2720 1518 : static int py_dcerpc_auth_set_auth_type(PyObject *py_obj, PyObject *value, void *closure)
2721 : {
2722 1518 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
2723 1518 : if (value == NULL) {
2724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_type");
2725 0 : return -1;
2726 : }
2727 : {
2728 1518 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_type));
2729 1518 : if (PyLong_Check(value)) {
2730 0 : unsigned long long test_var;
2731 1518 : test_var = PyLong_AsUnsignedLongLong(value);
2732 1518 : if (PyErr_Occurred() != NULL) {
2733 0 : return -1;
2734 : }
2735 1518 : if (test_var > uint_max) {
2736 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2737 : PyLong_Type.tp_name, uint_max, test_var);
2738 0 : return -1;
2739 : }
2740 1518 : object->auth_type = test_var;
2741 : } else {
2742 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2743 : PyLong_Type.tp_name);
2744 0 : return -1;
2745 : }
2746 : }
2747 1518 : return 0;
2748 : }
2749 :
2750 585 : static PyObject *py_dcerpc_auth_get_auth_level(PyObject *obj, void *closure)
2751 : {
2752 585 : struct dcerpc_auth *object = pytalloc_get_ptr(obj);
2753 0 : PyObject *py_auth_level;
2754 585 : py_auth_level = PyLong_FromLong((uint16_t)(object->auth_level));
2755 585 : return py_auth_level;
2756 : }
2757 :
2758 1518 : static int py_dcerpc_auth_set_auth_level(PyObject *py_obj, PyObject *value, void *closure)
2759 : {
2760 1518 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
2761 1518 : if (value == NULL) {
2762 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_level");
2763 0 : return -1;
2764 : }
2765 : {
2766 1518 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_level));
2767 1518 : if (PyLong_Check(value)) {
2768 0 : unsigned long long test_var;
2769 1518 : test_var = PyLong_AsUnsignedLongLong(value);
2770 1518 : if (PyErr_Occurred() != NULL) {
2771 0 : return -1;
2772 : }
2773 1518 : if (test_var > uint_max) {
2774 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2775 : PyLong_Type.tp_name, uint_max, test_var);
2776 0 : return -1;
2777 : }
2778 1518 : object->auth_level = test_var;
2779 : } else {
2780 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2781 : PyLong_Type.tp_name);
2782 0 : return -1;
2783 : }
2784 : }
2785 1518 : return 0;
2786 : }
2787 :
2788 1107 : static PyObject *py_dcerpc_auth_get_auth_pad_length(PyObject *obj, void *closure)
2789 : {
2790 1107 : struct dcerpc_auth *object = pytalloc_get_ptr(obj);
2791 0 : PyObject *py_auth_pad_length;
2792 1107 : py_auth_pad_length = PyLong_FromLong((uint16_t)(object->auth_pad_length));
2793 1107 : return py_auth_pad_length;
2794 : }
2795 :
2796 1518 : static int py_dcerpc_auth_set_auth_pad_length(PyObject *py_obj, PyObject *value, void *closure)
2797 : {
2798 1518 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
2799 1518 : if (value == NULL) {
2800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_pad_length");
2801 0 : return -1;
2802 : }
2803 : {
2804 1518 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_pad_length));
2805 1518 : if (PyLong_Check(value)) {
2806 0 : unsigned long long test_var;
2807 1518 : test_var = PyLong_AsUnsignedLongLong(value);
2808 1518 : if (PyErr_Occurred() != NULL) {
2809 0 : return -1;
2810 : }
2811 1518 : if (test_var > uint_max) {
2812 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2813 : PyLong_Type.tp_name, uint_max, test_var);
2814 0 : return -1;
2815 : }
2816 1518 : object->auth_pad_length = test_var;
2817 : } else {
2818 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2819 : PyLong_Type.tp_name);
2820 0 : return -1;
2821 : }
2822 : }
2823 1518 : return 0;
2824 : }
2825 :
2826 585 : static PyObject *py_dcerpc_auth_get_auth_reserved(PyObject *obj, void *closure)
2827 : {
2828 585 : struct dcerpc_auth *object = pytalloc_get_ptr(obj);
2829 0 : PyObject *py_auth_reserved;
2830 585 : py_auth_reserved = PyLong_FromLong((uint16_t)(object->auth_reserved));
2831 585 : return py_auth_reserved;
2832 : }
2833 :
2834 0 : static int py_dcerpc_auth_set_auth_reserved(PyObject *py_obj, PyObject *value, void *closure)
2835 : {
2836 0 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
2837 0 : if (value == NULL) {
2838 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_reserved");
2839 0 : return -1;
2840 : }
2841 : {
2842 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_reserved));
2843 0 : if (PyLong_Check(value)) {
2844 0 : unsigned long long test_var;
2845 0 : test_var = PyLong_AsUnsignedLongLong(value);
2846 0 : if (PyErr_Occurred() != NULL) {
2847 0 : return -1;
2848 : }
2849 0 : if (test_var > uint_max) {
2850 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2851 : PyLong_Type.tp_name, uint_max, test_var);
2852 0 : return -1;
2853 : }
2854 0 : object->auth_reserved = test_var;
2855 : } else {
2856 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2857 : PyLong_Type.tp_name);
2858 0 : return -1;
2859 : }
2860 : }
2861 0 : return 0;
2862 : }
2863 :
2864 585 : static PyObject *py_dcerpc_auth_get_auth_context_id(PyObject *obj, void *closure)
2865 : {
2866 585 : struct dcerpc_auth *object = pytalloc_get_ptr(obj);
2867 0 : PyObject *py_auth_context_id;
2868 585 : py_auth_context_id = PyLong_FromUnsignedLongLong((uint32_t)(object->auth_context_id));
2869 585 : return py_auth_context_id;
2870 : }
2871 :
2872 1518 : static int py_dcerpc_auth_set_auth_context_id(PyObject *py_obj, PyObject *value, void *closure)
2873 : {
2874 1518 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
2875 1518 : if (value == NULL) {
2876 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_context_id");
2877 0 : return -1;
2878 : }
2879 : {
2880 1518 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_context_id));
2881 1518 : if (PyLong_Check(value)) {
2882 0 : unsigned long long test_var;
2883 1518 : test_var = PyLong_AsUnsignedLongLong(value);
2884 1518 : if (PyErr_Occurred() != NULL) {
2885 0 : return -1;
2886 : }
2887 1518 : if (test_var > uint_max) {
2888 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2889 : PyLong_Type.tp_name, uint_max, test_var);
2890 0 : return -1;
2891 : }
2892 1518 : object->auth_context_id = test_var;
2893 : } else {
2894 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2895 : PyLong_Type.tp_name);
2896 0 : return -1;
2897 : }
2898 : }
2899 1518 : return 0;
2900 : }
2901 :
2902 660 : static PyObject *py_dcerpc_auth_get_credentials(PyObject *obj, void *closure)
2903 : {
2904 660 : struct dcerpc_auth *object = pytalloc_get_ptr(obj);
2905 0 : PyObject *py_credentials;
2906 660 : py_credentials = PyBytes_FromStringAndSize((char *)(object->credentials).data, (object->credentials).length);
2907 660 : return py_credentials;
2908 : }
2909 :
2910 1518 : static int py_dcerpc_auth_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
2911 : {
2912 1518 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
2913 1518 : if (value == NULL) {
2914 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->credentials");
2915 0 : return -1;
2916 : }
2917 1518 : object->credentials = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
2918 1518 : return 0;
2919 : }
2920 :
2921 : static PyGetSetDef py_dcerpc_auth_getsetters[] = {
2922 : {
2923 : .name = discard_const_p(char, "auth_type"),
2924 : .get = py_dcerpc_auth_get_auth_type,
2925 : .set = py_dcerpc_auth_set_auth_type,
2926 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_AuthType")
2927 : },
2928 : {
2929 : .name = discard_const_p(char, "auth_level"),
2930 : .get = py_dcerpc_auth_get_auth_level,
2931 : .set = py_dcerpc_auth_set_auth_level,
2932 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_AuthLevel")
2933 : },
2934 : {
2935 : .name = discard_const_p(char, "auth_pad_length"),
2936 : .get = py_dcerpc_auth_get_auth_pad_length,
2937 : .set = py_dcerpc_auth_set_auth_pad_length,
2938 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2939 : },
2940 : {
2941 : .name = discard_const_p(char, "auth_reserved"),
2942 : .get = py_dcerpc_auth_get_auth_reserved,
2943 : .set = py_dcerpc_auth_set_auth_reserved,
2944 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2945 : },
2946 : {
2947 : .name = discard_const_p(char, "auth_context_id"),
2948 : .get = py_dcerpc_auth_get_auth_context_id,
2949 : .set = py_dcerpc_auth_set_auth_context_id,
2950 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2951 : },
2952 : {
2953 : .name = discard_const_p(char, "credentials"),
2954 : .get = py_dcerpc_auth_get_credentials,
2955 : .set = py_dcerpc_auth_set_credentials,
2956 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
2957 : },
2958 : { .name = NULL }
2959 : };
2960 :
2961 2178 : static PyObject *py_dcerpc_auth_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2962 : {
2963 2178 : return pytalloc_new(struct dcerpc_auth, type);
2964 : }
2965 :
2966 1518 : static PyObject *py_dcerpc_auth_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
2967 : {
2968 1518 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
2969 1518 : PyObject *ret = NULL;
2970 0 : DATA_BLOB blob;
2971 0 : enum ndr_err_code err;
2972 1518 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
2973 1518 : if (tmp_ctx == NULL) {
2974 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
2975 0 : return NULL;
2976 : }
2977 1518 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_auth);
2978 1518 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
2979 0 : TALLOC_FREE(tmp_ctx);
2980 0 : PyErr_SetNdrError(err);
2981 0 : return NULL;
2982 : }
2983 :
2984 1518 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
2985 1518 : TALLOC_FREE(tmp_ctx);
2986 1518 : return ret;
2987 : }
2988 :
2989 660 : static PyObject *py_dcerpc_auth_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2990 : {
2991 660 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
2992 660 : DATA_BLOB blob = {.data = NULL, .length = 0};
2993 660 : Py_ssize_t blob_length = 0;
2994 0 : enum ndr_err_code err;
2995 660 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2996 660 : PyObject *allow_remaining_obj = NULL;
2997 660 : bool allow_remaining = false;
2998 :
2999 660 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3000 : discard_const_p(char *, kwnames),
3001 : &blob.data, &blob_length,
3002 : &allow_remaining_obj)) {
3003 0 : return NULL;
3004 : }
3005 660 : blob.length = blob_length;
3006 :
3007 660 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3008 660 : allow_remaining = true;
3009 : }
3010 :
3011 660 : if (allow_remaining) {
3012 660 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth);
3013 : } else {
3014 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth);
3015 : }
3016 660 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3017 0 : PyErr_SetNdrError(err);
3018 0 : return NULL;
3019 : }
3020 :
3021 660 : Py_RETURN_NONE;
3022 : }
3023 :
3024 0 : static PyObject *py_dcerpc_auth_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3025 : {
3026 0 : struct dcerpc_auth *object = pytalloc_get_ptr(py_obj);
3027 0 : PyObject *ret;
3028 0 : char *retstr;
3029 :
3030 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_auth, "dcerpc_auth", object);
3031 0 : ret = PyUnicode_FromString(retstr);
3032 0 : talloc_free(retstr);
3033 :
3034 0 : return ret;
3035 : }
3036 :
3037 : static PyMethodDef py_dcerpc_auth_methods[] = {
3038 : { "__ndr_pack__", (PyCFunction)py_dcerpc_auth_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3039 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_auth_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3040 : { "__ndr_print__", (PyCFunction)py_dcerpc_auth_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3041 : { NULL, NULL, 0, NULL }
3042 : };
3043 :
3044 :
3045 : static PyTypeObject dcerpc_auth_Type = {
3046 : PyVarObject_HEAD_INIT(NULL, 0)
3047 : .tp_name = "dcerpc.auth",
3048 : .tp_getset = py_dcerpc_auth_getsetters,
3049 : .tp_methods = py_dcerpc_auth_methods,
3050 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3051 : .tp_new = py_dcerpc_auth_new,
3052 : };
3053 :
3054 :
3055 0 : static PyObject *py_dcerpc_auth3_get__pad(PyObject *obj, void *closure)
3056 : {
3057 0 : struct dcerpc_auth3 *object = pytalloc_get_ptr(obj);
3058 0 : PyObject *py__pad;
3059 0 : py__pad = PyLong_FromUnsignedLongLong((uint32_t)(object->_pad));
3060 0 : return py__pad;
3061 : }
3062 :
3063 0 : static int py_dcerpc_auth3_set__pad(PyObject *py_obj, PyObject *value, void *closure)
3064 : {
3065 0 : struct dcerpc_auth3 *object = pytalloc_get_ptr(py_obj);
3066 0 : if (value == NULL) {
3067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad");
3068 0 : return -1;
3069 : }
3070 : {
3071 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad));
3072 0 : if (PyLong_Check(value)) {
3073 0 : unsigned long long test_var;
3074 0 : test_var = PyLong_AsUnsignedLongLong(value);
3075 0 : if (PyErr_Occurred() != NULL) {
3076 0 : return -1;
3077 : }
3078 0 : if (test_var > uint_max) {
3079 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3080 : PyLong_Type.tp_name, uint_max, test_var);
3081 0 : return -1;
3082 : }
3083 0 : object->_pad = test_var;
3084 : } else {
3085 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3086 : PyLong_Type.tp_name);
3087 0 : return -1;
3088 : }
3089 : }
3090 0 : return 0;
3091 : }
3092 :
3093 30 : static PyObject *py_dcerpc_auth3_get_auth_info(PyObject *obj, void *closure)
3094 : {
3095 30 : struct dcerpc_auth3 *object = pytalloc_get_ptr(obj);
3096 0 : PyObject *py_auth_info;
3097 30 : py_auth_info = PyBytes_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
3098 30 : return py_auth_info;
3099 : }
3100 :
3101 15 : static int py_dcerpc_auth3_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
3102 : {
3103 15 : struct dcerpc_auth3 *object = pytalloc_get_ptr(py_obj);
3104 15 : if (value == NULL) {
3105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
3106 0 : return -1;
3107 : }
3108 15 : object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
3109 15 : return 0;
3110 : }
3111 :
3112 : static PyGetSetDef py_dcerpc_auth3_getsetters[] = {
3113 : {
3114 : .name = discard_const_p(char, "_pad"),
3115 : .get = py_dcerpc_auth3_get__pad,
3116 : .set = py_dcerpc_auth3_set__pad,
3117 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3118 : },
3119 : {
3120 : .name = discard_const_p(char, "auth_info"),
3121 : .get = py_dcerpc_auth3_get_auth_info,
3122 : .set = py_dcerpc_auth3_set_auth_info,
3123 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
3124 : },
3125 : { .name = NULL }
3126 : };
3127 :
3128 15 : static PyObject *py_dcerpc_auth3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3129 : {
3130 15 : return pytalloc_new(struct dcerpc_auth3, type);
3131 : }
3132 :
3133 0 : static PyObject *py_dcerpc_auth3_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3134 : {
3135 0 : struct dcerpc_auth3 *object = pytalloc_get_ptr(py_obj);
3136 0 : PyObject *ret = NULL;
3137 0 : DATA_BLOB blob;
3138 0 : enum ndr_err_code err;
3139 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3140 0 : if (tmp_ctx == NULL) {
3141 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3142 0 : return NULL;
3143 : }
3144 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_auth3);
3145 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3146 0 : TALLOC_FREE(tmp_ctx);
3147 0 : PyErr_SetNdrError(err);
3148 0 : return NULL;
3149 : }
3150 :
3151 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3152 0 : TALLOC_FREE(tmp_ctx);
3153 0 : return ret;
3154 : }
3155 :
3156 0 : static PyObject *py_dcerpc_auth3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3157 : {
3158 0 : struct dcerpc_auth3 *object = pytalloc_get_ptr(py_obj);
3159 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3160 0 : Py_ssize_t blob_length = 0;
3161 0 : enum ndr_err_code err;
3162 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3163 0 : PyObject *allow_remaining_obj = NULL;
3164 0 : bool allow_remaining = false;
3165 :
3166 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3167 : discard_const_p(char *, kwnames),
3168 : &blob.data, &blob_length,
3169 : &allow_remaining_obj)) {
3170 0 : return NULL;
3171 : }
3172 0 : blob.length = blob_length;
3173 :
3174 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3175 0 : allow_remaining = true;
3176 : }
3177 :
3178 0 : if (allow_remaining) {
3179 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth3);
3180 : } else {
3181 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_auth3);
3182 : }
3183 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3184 0 : PyErr_SetNdrError(err);
3185 0 : return NULL;
3186 : }
3187 :
3188 0 : Py_RETURN_NONE;
3189 : }
3190 :
3191 0 : static PyObject *py_dcerpc_auth3_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3192 : {
3193 0 : struct dcerpc_auth3 *object = pytalloc_get_ptr(py_obj);
3194 0 : PyObject *ret;
3195 0 : char *retstr;
3196 :
3197 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_auth3, "dcerpc_auth3", object);
3198 0 : ret = PyUnicode_FromString(retstr);
3199 0 : talloc_free(retstr);
3200 :
3201 0 : return ret;
3202 : }
3203 :
3204 : static PyMethodDef py_dcerpc_auth3_methods[] = {
3205 : { "__ndr_pack__", (PyCFunction)py_dcerpc_auth3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3206 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_auth3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3207 : { "__ndr_print__", (PyCFunction)py_dcerpc_auth3_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3208 : { NULL, NULL, 0, NULL }
3209 : };
3210 :
3211 :
3212 : static PyTypeObject dcerpc_auth3_Type = {
3213 : PyVarObject_HEAD_INIT(NULL, 0)
3214 : .tp_name = "dcerpc.auth3",
3215 : .tp_getset = py_dcerpc_auth3_getsetters,
3216 : .tp_methods = py_dcerpc_auth3_methods,
3217 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3218 : .tp_new = py_dcerpc_auth3_new,
3219 : };
3220 :
3221 :
3222 15 : static PyObject *py_dcerpc_orphaned_get_auth_info(PyObject *obj, void *closure)
3223 : {
3224 15 : struct dcerpc_orphaned *object = pytalloc_get_ptr(obj);
3225 0 : PyObject *py_auth_info;
3226 15 : py_auth_info = PyBytes_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
3227 15 : return py_auth_info;
3228 : }
3229 :
3230 15 : static int py_dcerpc_orphaned_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
3231 : {
3232 15 : struct dcerpc_orphaned *object = pytalloc_get_ptr(py_obj);
3233 15 : if (value == NULL) {
3234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
3235 0 : return -1;
3236 : }
3237 15 : object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
3238 15 : return 0;
3239 : }
3240 :
3241 : static PyGetSetDef py_dcerpc_orphaned_getsetters[] = {
3242 : {
3243 : .name = discard_const_p(char, "auth_info"),
3244 : .get = py_dcerpc_orphaned_get_auth_info,
3245 : .set = py_dcerpc_orphaned_set_auth_info,
3246 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
3247 : },
3248 : { .name = NULL }
3249 : };
3250 :
3251 15 : static PyObject *py_dcerpc_orphaned_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3252 : {
3253 15 : return pytalloc_new(struct dcerpc_orphaned, type);
3254 : }
3255 :
3256 0 : static PyObject *py_dcerpc_orphaned_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3257 : {
3258 0 : struct dcerpc_orphaned *object = pytalloc_get_ptr(py_obj);
3259 0 : PyObject *ret = NULL;
3260 0 : DATA_BLOB blob;
3261 0 : enum ndr_err_code err;
3262 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3263 0 : if (tmp_ctx == NULL) {
3264 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3265 0 : return NULL;
3266 : }
3267 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_orphaned);
3268 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3269 0 : TALLOC_FREE(tmp_ctx);
3270 0 : PyErr_SetNdrError(err);
3271 0 : return NULL;
3272 : }
3273 :
3274 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3275 0 : TALLOC_FREE(tmp_ctx);
3276 0 : return ret;
3277 : }
3278 :
3279 0 : static PyObject *py_dcerpc_orphaned_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3280 : {
3281 0 : struct dcerpc_orphaned *object = pytalloc_get_ptr(py_obj);
3282 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3283 0 : Py_ssize_t blob_length = 0;
3284 0 : enum ndr_err_code err;
3285 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3286 0 : PyObject *allow_remaining_obj = NULL;
3287 0 : bool allow_remaining = false;
3288 :
3289 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3290 : discard_const_p(char *, kwnames),
3291 : &blob.data, &blob_length,
3292 : &allow_remaining_obj)) {
3293 0 : return NULL;
3294 : }
3295 0 : blob.length = blob_length;
3296 :
3297 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3298 0 : allow_remaining = true;
3299 : }
3300 :
3301 0 : if (allow_remaining) {
3302 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_orphaned);
3303 : } else {
3304 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_orphaned);
3305 : }
3306 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3307 0 : PyErr_SetNdrError(err);
3308 0 : return NULL;
3309 : }
3310 :
3311 0 : Py_RETURN_NONE;
3312 : }
3313 :
3314 0 : static PyObject *py_dcerpc_orphaned_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3315 : {
3316 0 : struct dcerpc_orphaned *object = pytalloc_get_ptr(py_obj);
3317 0 : PyObject *ret;
3318 0 : char *retstr;
3319 :
3320 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_orphaned, "dcerpc_orphaned", object);
3321 0 : ret = PyUnicode_FromString(retstr);
3322 0 : talloc_free(retstr);
3323 :
3324 0 : return ret;
3325 : }
3326 :
3327 : static PyMethodDef py_dcerpc_orphaned_methods[] = {
3328 : { "__ndr_pack__", (PyCFunction)py_dcerpc_orphaned_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3329 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_orphaned_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3330 : { "__ndr_print__", (PyCFunction)py_dcerpc_orphaned_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3331 : { NULL, NULL, 0, NULL }
3332 : };
3333 :
3334 :
3335 : static PyTypeObject dcerpc_orphaned_Type = {
3336 : PyVarObject_HEAD_INIT(NULL, 0)
3337 : .tp_name = "dcerpc.orphaned",
3338 : .tp_getset = py_dcerpc_orphaned_getsetters,
3339 : .tp_methods = py_dcerpc_orphaned_methods,
3340 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3341 : .tp_new = py_dcerpc_orphaned_new,
3342 : };
3343 :
3344 :
3345 6 : static PyObject *py_dcerpc_co_cancel_get_auth_info(PyObject *obj, void *closure)
3346 : {
3347 6 : struct dcerpc_co_cancel *object = pytalloc_get_ptr(obj);
3348 0 : PyObject *py_auth_info;
3349 6 : py_auth_info = PyBytes_FromStringAndSize((char *)(object->auth_info).data, (object->auth_info).length);
3350 6 : return py_auth_info;
3351 : }
3352 :
3353 6 : static int py_dcerpc_co_cancel_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
3354 : {
3355 6 : struct dcerpc_co_cancel *object = pytalloc_get_ptr(py_obj);
3356 6 : if (value == NULL) {
3357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
3358 0 : return -1;
3359 : }
3360 6 : object->auth_info = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
3361 6 : return 0;
3362 : }
3363 :
3364 : static PyGetSetDef py_dcerpc_co_cancel_getsetters[] = {
3365 : {
3366 : .name = discard_const_p(char, "auth_info"),
3367 : .get = py_dcerpc_co_cancel_get_auth_info,
3368 : .set = py_dcerpc_co_cancel_set_auth_info,
3369 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
3370 : },
3371 : { .name = NULL }
3372 : };
3373 :
3374 6 : static PyObject *py_dcerpc_co_cancel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3375 : {
3376 6 : return pytalloc_new(struct dcerpc_co_cancel, type);
3377 : }
3378 :
3379 0 : static PyObject *py_dcerpc_co_cancel_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3380 : {
3381 0 : struct dcerpc_co_cancel *object = pytalloc_get_ptr(py_obj);
3382 0 : PyObject *ret = NULL;
3383 0 : DATA_BLOB blob;
3384 0 : enum ndr_err_code err;
3385 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3386 0 : if (tmp_ctx == NULL) {
3387 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3388 0 : return NULL;
3389 : }
3390 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_co_cancel);
3391 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3392 0 : TALLOC_FREE(tmp_ctx);
3393 0 : PyErr_SetNdrError(err);
3394 0 : return NULL;
3395 : }
3396 :
3397 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3398 0 : TALLOC_FREE(tmp_ctx);
3399 0 : return ret;
3400 : }
3401 :
3402 0 : static PyObject *py_dcerpc_co_cancel_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3403 : {
3404 0 : struct dcerpc_co_cancel *object = pytalloc_get_ptr(py_obj);
3405 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3406 0 : Py_ssize_t blob_length = 0;
3407 0 : enum ndr_err_code err;
3408 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3409 0 : PyObject *allow_remaining_obj = NULL;
3410 0 : bool allow_remaining = false;
3411 :
3412 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3413 : discard_const_p(char *, kwnames),
3414 : &blob.data, &blob_length,
3415 : &allow_remaining_obj)) {
3416 0 : return NULL;
3417 : }
3418 0 : blob.length = blob_length;
3419 :
3420 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3421 0 : allow_remaining = true;
3422 : }
3423 :
3424 0 : if (allow_remaining) {
3425 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_co_cancel);
3426 : } else {
3427 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_co_cancel);
3428 : }
3429 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3430 0 : PyErr_SetNdrError(err);
3431 0 : return NULL;
3432 : }
3433 :
3434 0 : Py_RETURN_NONE;
3435 : }
3436 :
3437 0 : static PyObject *py_dcerpc_co_cancel_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3438 : {
3439 0 : struct dcerpc_co_cancel *object = pytalloc_get_ptr(py_obj);
3440 0 : PyObject *ret;
3441 0 : char *retstr;
3442 :
3443 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_co_cancel, "dcerpc_co_cancel", object);
3444 0 : ret = PyUnicode_FromString(retstr);
3445 0 : talloc_free(retstr);
3446 :
3447 0 : return ret;
3448 : }
3449 :
3450 : static PyMethodDef py_dcerpc_co_cancel_methods[] = {
3451 : { "__ndr_pack__", (PyCFunction)py_dcerpc_co_cancel_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3452 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_co_cancel_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3453 : { "__ndr_print__", (PyCFunction)py_dcerpc_co_cancel_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3454 : { NULL, NULL, 0, NULL }
3455 : };
3456 :
3457 :
3458 : static PyTypeObject dcerpc_co_cancel_Type = {
3459 : PyVarObject_HEAD_INIT(NULL, 0)
3460 : .tp_name = "dcerpc.co_cancel",
3461 : .tp_getset = py_dcerpc_co_cancel_getsetters,
3462 : .tp_methods = py_dcerpc_co_cancel_methods,
3463 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3464 : .tp_new = py_dcerpc_co_cancel_new,
3465 : };
3466 :
3467 :
3468 0 : static PyObject *py_dcerpc_cl_cancel_get_version(PyObject *obj, void *closure)
3469 : {
3470 0 : struct dcerpc_cl_cancel *object = pytalloc_get_ptr(obj);
3471 0 : PyObject *py_version;
3472 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
3473 0 : return py_version;
3474 : }
3475 :
3476 0 : static int py_dcerpc_cl_cancel_set_version(PyObject *py_obj, PyObject *value, void *closure)
3477 : {
3478 0 : struct dcerpc_cl_cancel *object = pytalloc_get_ptr(py_obj);
3479 0 : if (value == NULL) {
3480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
3481 0 : return -1;
3482 : }
3483 : {
3484 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
3485 0 : if (PyLong_Check(value)) {
3486 0 : unsigned long long test_var;
3487 0 : test_var = PyLong_AsUnsignedLongLong(value);
3488 0 : if (PyErr_Occurred() != NULL) {
3489 0 : return -1;
3490 : }
3491 0 : if (test_var > uint_max) {
3492 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3493 : PyLong_Type.tp_name, uint_max, test_var);
3494 0 : return -1;
3495 : }
3496 0 : object->version = test_var;
3497 : } else {
3498 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3499 : PyLong_Type.tp_name);
3500 0 : return -1;
3501 : }
3502 : }
3503 0 : return 0;
3504 : }
3505 :
3506 0 : static PyObject *py_dcerpc_cl_cancel_get_id(PyObject *obj, void *closure)
3507 : {
3508 0 : struct dcerpc_cl_cancel *object = pytalloc_get_ptr(obj);
3509 0 : PyObject *py_id;
3510 0 : py_id = PyLong_FromUnsignedLongLong((uint32_t)(object->id));
3511 0 : return py_id;
3512 : }
3513 :
3514 0 : static int py_dcerpc_cl_cancel_set_id(PyObject *py_obj, PyObject *value, void *closure)
3515 : {
3516 0 : struct dcerpc_cl_cancel *object = pytalloc_get_ptr(py_obj);
3517 0 : if (value == NULL) {
3518 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->id");
3519 0 : return -1;
3520 : }
3521 : {
3522 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->id));
3523 0 : if (PyLong_Check(value)) {
3524 0 : unsigned long long test_var;
3525 0 : test_var = PyLong_AsUnsignedLongLong(value);
3526 0 : if (PyErr_Occurred() != NULL) {
3527 0 : return -1;
3528 : }
3529 0 : if (test_var > uint_max) {
3530 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3531 : PyLong_Type.tp_name, uint_max, test_var);
3532 0 : return -1;
3533 : }
3534 0 : object->id = test_var;
3535 : } else {
3536 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3537 : PyLong_Type.tp_name);
3538 0 : return -1;
3539 : }
3540 : }
3541 0 : return 0;
3542 : }
3543 :
3544 : static PyGetSetDef py_dcerpc_cl_cancel_getsetters[] = {
3545 : {
3546 : .name = discard_const_p(char, "version"),
3547 : .get = py_dcerpc_cl_cancel_get_version,
3548 : .set = py_dcerpc_cl_cancel_set_version,
3549 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3550 : },
3551 : {
3552 : .name = discard_const_p(char, "id"),
3553 : .get = py_dcerpc_cl_cancel_get_id,
3554 : .set = py_dcerpc_cl_cancel_set_id,
3555 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3556 : },
3557 : { .name = NULL }
3558 : };
3559 :
3560 0 : static PyObject *py_dcerpc_cl_cancel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3561 : {
3562 0 : return pytalloc_new(struct dcerpc_cl_cancel, type);
3563 : }
3564 :
3565 0 : static PyObject *py_dcerpc_cl_cancel_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3566 : {
3567 0 : struct dcerpc_cl_cancel *object = pytalloc_get_ptr(py_obj);
3568 0 : PyObject *ret = NULL;
3569 0 : DATA_BLOB blob;
3570 0 : enum ndr_err_code err;
3571 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3572 0 : if (tmp_ctx == NULL) {
3573 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3574 0 : return NULL;
3575 : }
3576 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_cl_cancel);
3577 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3578 0 : TALLOC_FREE(tmp_ctx);
3579 0 : PyErr_SetNdrError(err);
3580 0 : return NULL;
3581 : }
3582 :
3583 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3584 0 : TALLOC_FREE(tmp_ctx);
3585 0 : return ret;
3586 : }
3587 :
3588 0 : static PyObject *py_dcerpc_cl_cancel_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3589 : {
3590 0 : struct dcerpc_cl_cancel *object = pytalloc_get_ptr(py_obj);
3591 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3592 0 : Py_ssize_t blob_length = 0;
3593 0 : enum ndr_err_code err;
3594 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3595 0 : PyObject *allow_remaining_obj = NULL;
3596 0 : bool allow_remaining = false;
3597 :
3598 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3599 : discard_const_p(char *, kwnames),
3600 : &blob.data, &blob_length,
3601 : &allow_remaining_obj)) {
3602 0 : return NULL;
3603 : }
3604 0 : blob.length = blob_length;
3605 :
3606 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3607 0 : allow_remaining = true;
3608 : }
3609 :
3610 0 : if (allow_remaining) {
3611 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_cl_cancel);
3612 : } else {
3613 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_cl_cancel);
3614 : }
3615 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3616 0 : PyErr_SetNdrError(err);
3617 0 : return NULL;
3618 : }
3619 :
3620 0 : Py_RETURN_NONE;
3621 : }
3622 :
3623 0 : static PyObject *py_dcerpc_cl_cancel_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3624 : {
3625 0 : struct dcerpc_cl_cancel *object = pytalloc_get_ptr(py_obj);
3626 0 : PyObject *ret;
3627 0 : char *retstr;
3628 :
3629 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_cl_cancel, "dcerpc_cl_cancel", object);
3630 0 : ret = PyUnicode_FromString(retstr);
3631 0 : talloc_free(retstr);
3632 :
3633 0 : return ret;
3634 : }
3635 :
3636 : static PyMethodDef py_dcerpc_cl_cancel_methods[] = {
3637 : { "__ndr_pack__", (PyCFunction)py_dcerpc_cl_cancel_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3638 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_cl_cancel_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3639 : { "__ndr_print__", (PyCFunction)py_dcerpc_cl_cancel_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3640 : { NULL, NULL, 0, NULL }
3641 : };
3642 :
3643 :
3644 : static PyTypeObject dcerpc_cl_cancel_Type = {
3645 : PyVarObject_HEAD_INIT(NULL, 0)
3646 : .tp_name = "dcerpc.cl_cancel",
3647 : .tp_getset = py_dcerpc_cl_cancel_getsetters,
3648 : .tp_methods = py_dcerpc_cl_cancel_methods,
3649 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3650 : .tp_new = py_dcerpc_cl_cancel_new,
3651 : };
3652 :
3653 :
3654 0 : static PyObject *py_dcerpc_cancel_ack_get_version(PyObject *obj, void *closure)
3655 : {
3656 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(obj);
3657 0 : PyObject *py_version;
3658 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
3659 0 : return py_version;
3660 : }
3661 :
3662 0 : static int py_dcerpc_cancel_ack_set_version(PyObject *py_obj, PyObject *value, void *closure)
3663 : {
3664 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(py_obj);
3665 0 : if (value == NULL) {
3666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
3667 0 : return -1;
3668 : }
3669 : {
3670 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
3671 0 : if (PyLong_Check(value)) {
3672 0 : unsigned long long test_var;
3673 0 : test_var = PyLong_AsUnsignedLongLong(value);
3674 0 : if (PyErr_Occurred() != NULL) {
3675 0 : return -1;
3676 : }
3677 0 : if (test_var > uint_max) {
3678 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3679 : PyLong_Type.tp_name, uint_max, test_var);
3680 0 : return -1;
3681 : }
3682 0 : object->version = test_var;
3683 : } else {
3684 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3685 : PyLong_Type.tp_name);
3686 0 : return -1;
3687 : }
3688 : }
3689 0 : return 0;
3690 : }
3691 :
3692 0 : static PyObject *py_dcerpc_cancel_ack_get_id(PyObject *obj, void *closure)
3693 : {
3694 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(obj);
3695 0 : PyObject *py_id;
3696 0 : py_id = PyLong_FromUnsignedLongLong((uint32_t)(object->id));
3697 0 : return py_id;
3698 : }
3699 :
3700 0 : static int py_dcerpc_cancel_ack_set_id(PyObject *py_obj, PyObject *value, void *closure)
3701 : {
3702 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(py_obj);
3703 0 : if (value == NULL) {
3704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->id");
3705 0 : return -1;
3706 : }
3707 : {
3708 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->id));
3709 0 : if (PyLong_Check(value)) {
3710 0 : unsigned long long test_var;
3711 0 : test_var = PyLong_AsUnsignedLongLong(value);
3712 0 : if (PyErr_Occurred() != NULL) {
3713 0 : return -1;
3714 : }
3715 0 : if (test_var > uint_max) {
3716 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3717 : PyLong_Type.tp_name, uint_max, test_var);
3718 0 : return -1;
3719 : }
3720 0 : object->id = test_var;
3721 : } else {
3722 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3723 : PyLong_Type.tp_name);
3724 0 : return -1;
3725 : }
3726 : }
3727 0 : return 0;
3728 : }
3729 :
3730 0 : static PyObject *py_dcerpc_cancel_ack_get_server_is_accepting(PyObject *obj, void *closure)
3731 : {
3732 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(obj);
3733 0 : PyObject *py_server_is_accepting;
3734 0 : py_server_is_accepting = PyLong_FromUnsignedLongLong((uint32_t)(object->server_is_accepting));
3735 0 : return py_server_is_accepting;
3736 : }
3737 :
3738 0 : static int py_dcerpc_cancel_ack_set_server_is_accepting(PyObject *py_obj, PyObject *value, void *closure)
3739 : {
3740 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(py_obj);
3741 0 : if (value == NULL) {
3742 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_is_accepting");
3743 0 : return -1;
3744 : }
3745 : {
3746 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_is_accepting));
3747 0 : if (PyLong_Check(value)) {
3748 0 : unsigned long long test_var;
3749 0 : test_var = PyLong_AsUnsignedLongLong(value);
3750 0 : if (PyErr_Occurred() != NULL) {
3751 0 : return -1;
3752 : }
3753 0 : if (test_var > uint_max) {
3754 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3755 : PyLong_Type.tp_name, uint_max, test_var);
3756 0 : return -1;
3757 : }
3758 0 : object->server_is_accepting = test_var;
3759 : } else {
3760 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3761 : PyLong_Type.tp_name);
3762 0 : return -1;
3763 : }
3764 : }
3765 0 : return 0;
3766 : }
3767 :
3768 : static PyGetSetDef py_dcerpc_cancel_ack_getsetters[] = {
3769 : {
3770 : .name = discard_const_p(char, "version"),
3771 : .get = py_dcerpc_cancel_ack_get_version,
3772 : .set = py_dcerpc_cancel_ack_set_version,
3773 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3774 : },
3775 : {
3776 : .name = discard_const_p(char, "id"),
3777 : .get = py_dcerpc_cancel_ack_get_id,
3778 : .set = py_dcerpc_cancel_ack_set_id,
3779 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3780 : },
3781 : {
3782 : .name = discard_const_p(char, "server_is_accepting"),
3783 : .get = py_dcerpc_cancel_ack_get_server_is_accepting,
3784 : .set = py_dcerpc_cancel_ack_set_server_is_accepting,
3785 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3786 : },
3787 : { .name = NULL }
3788 : };
3789 :
3790 0 : static PyObject *py_dcerpc_cancel_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3791 : {
3792 0 : return pytalloc_new(struct dcerpc_cancel_ack, type);
3793 : }
3794 :
3795 0 : static PyObject *py_dcerpc_cancel_ack_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3796 : {
3797 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(py_obj);
3798 0 : PyObject *ret = NULL;
3799 0 : DATA_BLOB blob;
3800 0 : enum ndr_err_code err;
3801 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
3802 0 : if (tmp_ctx == NULL) {
3803 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
3804 0 : return NULL;
3805 : }
3806 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_cancel_ack);
3807 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3808 0 : TALLOC_FREE(tmp_ctx);
3809 0 : PyErr_SetNdrError(err);
3810 0 : return NULL;
3811 : }
3812 :
3813 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
3814 0 : TALLOC_FREE(tmp_ctx);
3815 0 : return ret;
3816 : }
3817 :
3818 0 : static PyObject *py_dcerpc_cancel_ack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3819 : {
3820 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(py_obj);
3821 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
3822 0 : Py_ssize_t blob_length = 0;
3823 0 : enum ndr_err_code err;
3824 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3825 0 : PyObject *allow_remaining_obj = NULL;
3826 0 : bool allow_remaining = false;
3827 :
3828 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
3829 : discard_const_p(char *, kwnames),
3830 : &blob.data, &blob_length,
3831 : &allow_remaining_obj)) {
3832 0 : return NULL;
3833 : }
3834 0 : blob.length = blob_length;
3835 :
3836 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3837 0 : allow_remaining = true;
3838 : }
3839 :
3840 0 : if (allow_remaining) {
3841 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_cancel_ack);
3842 : } else {
3843 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_cancel_ack);
3844 : }
3845 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
3846 0 : PyErr_SetNdrError(err);
3847 0 : return NULL;
3848 : }
3849 :
3850 0 : Py_RETURN_NONE;
3851 : }
3852 :
3853 0 : static PyObject *py_dcerpc_cancel_ack_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
3854 : {
3855 0 : struct dcerpc_cancel_ack *object = pytalloc_get_ptr(py_obj);
3856 0 : PyObject *ret;
3857 0 : char *retstr;
3858 :
3859 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_cancel_ack, "dcerpc_cancel_ack", object);
3860 0 : ret = PyUnicode_FromString(retstr);
3861 0 : talloc_free(retstr);
3862 :
3863 0 : return ret;
3864 : }
3865 :
3866 : static PyMethodDef py_dcerpc_cancel_ack_methods[] = {
3867 : { "__ndr_pack__", (PyCFunction)py_dcerpc_cancel_ack_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3868 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_cancel_ack_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3869 : { "__ndr_print__", (PyCFunction)py_dcerpc_cancel_ack_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
3870 : { NULL, NULL, 0, NULL }
3871 : };
3872 :
3873 :
3874 : static PyTypeObject dcerpc_cancel_ack_Type = {
3875 : PyVarObject_HEAD_INIT(NULL, 0)
3876 : .tp_name = "dcerpc.cancel_ack",
3877 : .tp_getset = py_dcerpc_cancel_ack_getsetters,
3878 : .tp_methods = py_dcerpc_cancel_ack_methods,
3879 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3880 : .tp_new = py_dcerpc_cancel_ack_new,
3881 : };
3882 :
3883 :
3884 0 : static PyObject *py_dcerpc_fack_get_version(PyObject *obj, void *closure)
3885 : {
3886 0 : struct dcerpc_fack *object = pytalloc_get_ptr(obj);
3887 0 : PyObject *py_version;
3888 0 : py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
3889 0 : return py_version;
3890 : }
3891 :
3892 0 : static int py_dcerpc_fack_set_version(PyObject *py_obj, PyObject *value, void *closure)
3893 : {
3894 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
3895 0 : if (value == NULL) {
3896 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
3897 0 : return -1;
3898 : }
3899 : {
3900 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
3901 0 : if (PyLong_Check(value)) {
3902 0 : unsigned long long test_var;
3903 0 : test_var = PyLong_AsUnsignedLongLong(value);
3904 0 : if (PyErr_Occurred() != NULL) {
3905 0 : return -1;
3906 : }
3907 0 : if (test_var > uint_max) {
3908 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3909 : PyLong_Type.tp_name, uint_max, test_var);
3910 0 : return -1;
3911 : }
3912 0 : object->version = test_var;
3913 : } else {
3914 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3915 : PyLong_Type.tp_name);
3916 0 : return -1;
3917 : }
3918 : }
3919 0 : return 0;
3920 : }
3921 :
3922 0 : static PyObject *py_dcerpc_fack_get__pad1(PyObject *obj, void *closure)
3923 : {
3924 0 : struct dcerpc_fack *object = pytalloc_get_ptr(obj);
3925 0 : PyObject *py__pad1;
3926 0 : py__pad1 = PyLong_FromLong((uint16_t)(object->_pad1));
3927 0 : return py__pad1;
3928 : }
3929 :
3930 0 : static int py_dcerpc_fack_set__pad1(PyObject *py_obj, PyObject *value, void *closure)
3931 : {
3932 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
3933 0 : if (value == NULL) {
3934 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad1");
3935 0 : return -1;
3936 : }
3937 : {
3938 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad1));
3939 0 : if (PyLong_Check(value)) {
3940 0 : unsigned long long test_var;
3941 0 : test_var = PyLong_AsUnsignedLongLong(value);
3942 0 : if (PyErr_Occurred() != NULL) {
3943 0 : return -1;
3944 : }
3945 0 : if (test_var > uint_max) {
3946 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3947 : PyLong_Type.tp_name, uint_max, test_var);
3948 0 : return -1;
3949 : }
3950 0 : object->_pad1 = test_var;
3951 : } else {
3952 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3953 : PyLong_Type.tp_name);
3954 0 : return -1;
3955 : }
3956 : }
3957 0 : return 0;
3958 : }
3959 :
3960 0 : static PyObject *py_dcerpc_fack_get_window_size(PyObject *obj, void *closure)
3961 : {
3962 0 : struct dcerpc_fack *object = pytalloc_get_ptr(obj);
3963 0 : PyObject *py_window_size;
3964 0 : py_window_size = PyLong_FromLong((uint16_t)(object->window_size));
3965 0 : return py_window_size;
3966 : }
3967 :
3968 0 : static int py_dcerpc_fack_set_window_size(PyObject *py_obj, PyObject *value, void *closure)
3969 : {
3970 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
3971 0 : if (value == NULL) {
3972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->window_size");
3973 0 : return -1;
3974 : }
3975 : {
3976 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->window_size));
3977 0 : if (PyLong_Check(value)) {
3978 0 : unsigned long long test_var;
3979 0 : test_var = PyLong_AsUnsignedLongLong(value);
3980 0 : if (PyErr_Occurred() != NULL) {
3981 0 : return -1;
3982 : }
3983 0 : if (test_var > uint_max) {
3984 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3985 : PyLong_Type.tp_name, uint_max, test_var);
3986 0 : return -1;
3987 : }
3988 0 : object->window_size = test_var;
3989 : } else {
3990 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3991 : PyLong_Type.tp_name);
3992 0 : return -1;
3993 : }
3994 : }
3995 0 : return 0;
3996 : }
3997 :
3998 0 : static PyObject *py_dcerpc_fack_get_max_tdsu(PyObject *obj, void *closure)
3999 : {
4000 0 : struct dcerpc_fack *object = pytalloc_get_ptr(obj);
4001 0 : PyObject *py_max_tdsu;
4002 0 : py_max_tdsu = PyLong_FromUnsignedLongLong((uint32_t)(object->max_tdsu));
4003 0 : return py_max_tdsu;
4004 : }
4005 :
4006 0 : static int py_dcerpc_fack_set_max_tdsu(PyObject *py_obj, PyObject *value, void *closure)
4007 : {
4008 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
4009 0 : if (value == NULL) {
4010 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_tdsu");
4011 0 : return -1;
4012 : }
4013 : {
4014 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_tdsu));
4015 0 : if (PyLong_Check(value)) {
4016 0 : unsigned long long test_var;
4017 0 : test_var = PyLong_AsUnsignedLongLong(value);
4018 0 : if (PyErr_Occurred() != NULL) {
4019 0 : return -1;
4020 : }
4021 0 : if (test_var > uint_max) {
4022 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4023 : PyLong_Type.tp_name, uint_max, test_var);
4024 0 : return -1;
4025 : }
4026 0 : object->max_tdsu = test_var;
4027 : } else {
4028 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4029 : PyLong_Type.tp_name);
4030 0 : return -1;
4031 : }
4032 : }
4033 0 : return 0;
4034 : }
4035 :
4036 0 : static PyObject *py_dcerpc_fack_get_max_frag_size(PyObject *obj, void *closure)
4037 : {
4038 0 : struct dcerpc_fack *object = pytalloc_get_ptr(obj);
4039 0 : PyObject *py_max_frag_size;
4040 0 : py_max_frag_size = PyLong_FromUnsignedLongLong((uint32_t)(object->max_frag_size));
4041 0 : return py_max_frag_size;
4042 : }
4043 :
4044 0 : static int py_dcerpc_fack_set_max_frag_size(PyObject *py_obj, PyObject *value, void *closure)
4045 : {
4046 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
4047 0 : if (value == NULL) {
4048 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_frag_size");
4049 0 : return -1;
4050 : }
4051 : {
4052 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_frag_size));
4053 0 : if (PyLong_Check(value)) {
4054 0 : unsigned long long test_var;
4055 0 : test_var = PyLong_AsUnsignedLongLong(value);
4056 0 : if (PyErr_Occurred() != NULL) {
4057 0 : return -1;
4058 : }
4059 0 : if (test_var > uint_max) {
4060 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4061 : PyLong_Type.tp_name, uint_max, test_var);
4062 0 : return -1;
4063 : }
4064 0 : object->max_frag_size = test_var;
4065 : } else {
4066 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4067 : PyLong_Type.tp_name);
4068 0 : return -1;
4069 : }
4070 : }
4071 0 : return 0;
4072 : }
4073 :
4074 0 : static PyObject *py_dcerpc_fack_get_serial_no(PyObject *obj, void *closure)
4075 : {
4076 0 : struct dcerpc_fack *object = pytalloc_get_ptr(obj);
4077 0 : PyObject *py_serial_no;
4078 0 : py_serial_no = PyLong_FromLong((uint16_t)(object->serial_no));
4079 0 : return py_serial_no;
4080 : }
4081 :
4082 0 : static int py_dcerpc_fack_set_serial_no(PyObject *py_obj, PyObject *value, void *closure)
4083 : {
4084 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
4085 0 : if (value == NULL) {
4086 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->serial_no");
4087 0 : return -1;
4088 : }
4089 : {
4090 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_no));
4091 0 : if (PyLong_Check(value)) {
4092 0 : unsigned long long test_var;
4093 0 : test_var = PyLong_AsUnsignedLongLong(value);
4094 0 : if (PyErr_Occurred() != NULL) {
4095 0 : return -1;
4096 : }
4097 0 : if (test_var > uint_max) {
4098 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4099 : PyLong_Type.tp_name, uint_max, test_var);
4100 0 : return -1;
4101 : }
4102 0 : object->serial_no = test_var;
4103 : } else {
4104 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4105 : PyLong_Type.tp_name);
4106 0 : return -1;
4107 : }
4108 : }
4109 0 : return 0;
4110 : }
4111 :
4112 0 : static PyObject *py_dcerpc_fack_get_selack_size(PyObject *obj, void *closure)
4113 : {
4114 0 : struct dcerpc_fack *object = pytalloc_get_ptr(obj);
4115 0 : PyObject *py_selack_size;
4116 0 : py_selack_size = PyLong_FromLong((uint16_t)(object->selack_size));
4117 0 : return py_selack_size;
4118 : }
4119 :
4120 0 : static int py_dcerpc_fack_set_selack_size(PyObject *py_obj, PyObject *value, void *closure)
4121 : {
4122 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
4123 0 : if (value == NULL) {
4124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->selack_size");
4125 0 : return -1;
4126 : }
4127 : {
4128 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->selack_size));
4129 0 : if (PyLong_Check(value)) {
4130 0 : unsigned long long test_var;
4131 0 : test_var = PyLong_AsUnsignedLongLong(value);
4132 0 : if (PyErr_Occurred() != NULL) {
4133 0 : return -1;
4134 : }
4135 0 : if (test_var > uint_max) {
4136 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4137 : PyLong_Type.tp_name, uint_max, test_var);
4138 0 : return -1;
4139 : }
4140 0 : object->selack_size = test_var;
4141 : } else {
4142 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4143 : PyLong_Type.tp_name);
4144 0 : return -1;
4145 : }
4146 : }
4147 0 : return 0;
4148 : }
4149 :
4150 0 : static PyObject *py_dcerpc_fack_get_selack(PyObject *obj, void *closure)
4151 : {
4152 0 : struct dcerpc_fack *object = pytalloc_get_ptr(obj);
4153 0 : PyObject *py_selack;
4154 0 : py_selack = PyList_New(object->selack_size);
4155 0 : if (py_selack == NULL) {
4156 0 : return NULL;
4157 : }
4158 : {
4159 : int selack_cntr_0;
4160 0 : for (selack_cntr_0 = 0; selack_cntr_0 < (object->selack_size); selack_cntr_0++) {
4161 0 : PyObject *py_selack_0;
4162 0 : py_selack_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->selack)[selack_cntr_0]));
4163 0 : PyList_SetItem(py_selack, selack_cntr_0, py_selack_0);
4164 : }
4165 : }
4166 0 : return py_selack;
4167 : }
4168 :
4169 0 : static int py_dcerpc_fack_set_selack(PyObject *py_obj, PyObject *value, void *closure)
4170 : {
4171 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
4172 0 : if (value == NULL) {
4173 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->selack");
4174 0 : return -1;
4175 : }
4176 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4177 : {
4178 0 : int selack_cntr_0;
4179 0 : object->selack = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->selack, PyList_GET_SIZE(value));
4180 0 : if (!object->selack) { return -1; }
4181 0 : talloc_set_name_const(object->selack, "ARRAY: object->selack");
4182 0 : for (selack_cntr_0 = 0; selack_cntr_0 < PyList_GET_SIZE(value); selack_cntr_0++) {
4183 0 : if (PyList_GET_ITEM(value, selack_cntr_0) == NULL) {
4184 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->selack)[selack_cntr_0]");
4185 0 : return -1;
4186 : }
4187 : {
4188 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->selack)[selack_cntr_0]));
4189 0 : if (PyLong_Check(PyList_GET_ITEM(value, selack_cntr_0))) {
4190 0 : unsigned long long test_var;
4191 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, selack_cntr_0));
4192 0 : if (PyErr_Occurred() != NULL) {
4193 0 : return -1;
4194 : }
4195 0 : if (test_var > uint_max) {
4196 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4197 : PyLong_Type.tp_name, uint_max, test_var);
4198 0 : return -1;
4199 : }
4200 0 : (object->selack)[selack_cntr_0] = test_var;
4201 : } else {
4202 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4203 : PyLong_Type.tp_name);
4204 0 : return -1;
4205 : }
4206 : }
4207 : }
4208 : }
4209 0 : return 0;
4210 : }
4211 :
4212 : static PyGetSetDef py_dcerpc_fack_getsetters[] = {
4213 : {
4214 : .name = discard_const_p(char, "version"),
4215 : .get = py_dcerpc_fack_get_version,
4216 : .set = py_dcerpc_fack_set_version,
4217 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4218 : },
4219 : {
4220 : .name = discard_const_p(char, "_pad1"),
4221 : .get = py_dcerpc_fack_get__pad1,
4222 : .set = py_dcerpc_fack_set__pad1,
4223 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4224 : },
4225 : {
4226 : .name = discard_const_p(char, "window_size"),
4227 : .get = py_dcerpc_fack_get_window_size,
4228 : .set = py_dcerpc_fack_set_window_size,
4229 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4230 : },
4231 : {
4232 : .name = discard_const_p(char, "max_tdsu"),
4233 : .get = py_dcerpc_fack_get_max_tdsu,
4234 : .set = py_dcerpc_fack_set_max_tdsu,
4235 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4236 : },
4237 : {
4238 : .name = discard_const_p(char, "max_frag_size"),
4239 : .get = py_dcerpc_fack_get_max_frag_size,
4240 : .set = py_dcerpc_fack_set_max_frag_size,
4241 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4242 : },
4243 : {
4244 : .name = discard_const_p(char, "serial_no"),
4245 : .get = py_dcerpc_fack_get_serial_no,
4246 : .set = py_dcerpc_fack_set_serial_no,
4247 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4248 : },
4249 : {
4250 : .name = discard_const_p(char, "selack_size"),
4251 : .get = py_dcerpc_fack_get_selack_size,
4252 : .set = py_dcerpc_fack_set_selack_size,
4253 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4254 : },
4255 : {
4256 : .name = discard_const_p(char, "selack"),
4257 : .get = py_dcerpc_fack_get_selack,
4258 : .set = py_dcerpc_fack_set_selack,
4259 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4260 : },
4261 : { .name = NULL }
4262 : };
4263 :
4264 0 : static PyObject *py_dcerpc_fack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4265 : {
4266 0 : return pytalloc_new(struct dcerpc_fack, type);
4267 : }
4268 :
4269 0 : static PyObject *py_dcerpc_fack_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4270 : {
4271 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
4272 0 : PyObject *ret = NULL;
4273 0 : DATA_BLOB blob;
4274 0 : enum ndr_err_code err;
4275 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4276 0 : if (tmp_ctx == NULL) {
4277 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4278 0 : return NULL;
4279 : }
4280 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_fack);
4281 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4282 0 : TALLOC_FREE(tmp_ctx);
4283 0 : PyErr_SetNdrError(err);
4284 0 : return NULL;
4285 : }
4286 :
4287 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4288 0 : TALLOC_FREE(tmp_ctx);
4289 0 : return ret;
4290 : }
4291 :
4292 0 : static PyObject *py_dcerpc_fack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4293 : {
4294 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
4295 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4296 0 : Py_ssize_t blob_length = 0;
4297 0 : enum ndr_err_code err;
4298 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4299 0 : PyObject *allow_remaining_obj = NULL;
4300 0 : bool allow_remaining = false;
4301 :
4302 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4303 : discard_const_p(char *, kwnames),
4304 : &blob.data, &blob_length,
4305 : &allow_remaining_obj)) {
4306 0 : return NULL;
4307 : }
4308 0 : blob.length = blob_length;
4309 :
4310 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4311 0 : allow_remaining = true;
4312 : }
4313 :
4314 0 : if (allow_remaining) {
4315 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_fack);
4316 : } else {
4317 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_fack);
4318 : }
4319 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4320 0 : PyErr_SetNdrError(err);
4321 0 : return NULL;
4322 : }
4323 :
4324 0 : Py_RETURN_NONE;
4325 : }
4326 :
4327 0 : static PyObject *py_dcerpc_fack_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4328 : {
4329 0 : struct dcerpc_fack *object = pytalloc_get_ptr(py_obj);
4330 0 : PyObject *ret;
4331 0 : char *retstr;
4332 :
4333 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_fack, "dcerpc_fack", object);
4334 0 : ret = PyUnicode_FromString(retstr);
4335 0 : talloc_free(retstr);
4336 :
4337 0 : return ret;
4338 : }
4339 :
4340 : static PyMethodDef py_dcerpc_fack_methods[] = {
4341 : { "__ndr_pack__", (PyCFunction)py_dcerpc_fack_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4342 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_fack_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4343 : { "__ndr_print__", (PyCFunction)py_dcerpc_fack_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4344 : { NULL, NULL, 0, NULL }
4345 : };
4346 :
4347 :
4348 : static PyTypeObject dcerpc_fack_Type = {
4349 : PyVarObject_HEAD_INIT(NULL, 0)
4350 : .tp_name = "dcerpc.fack",
4351 : .tp_getset = py_dcerpc_fack_getsetters,
4352 : .tp_methods = py_dcerpc_fack_methods,
4353 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4354 : .tp_new = py_dcerpc_fack_new,
4355 : };
4356 :
4357 :
4358 0 : static PyObject *py_dcerpc_ack_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4359 : {
4360 0 : return pytalloc_new(struct dcerpc_ack, type);
4361 : }
4362 :
4363 0 : static PyObject *py_dcerpc_ack_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4364 : {
4365 0 : struct dcerpc_ack *object = pytalloc_get_ptr(py_obj);
4366 0 : PyObject *ret = NULL;
4367 0 : DATA_BLOB blob;
4368 0 : enum ndr_err_code err;
4369 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4370 0 : if (tmp_ctx == NULL) {
4371 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4372 0 : return NULL;
4373 : }
4374 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_ack);
4375 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4376 0 : TALLOC_FREE(tmp_ctx);
4377 0 : PyErr_SetNdrError(err);
4378 0 : return NULL;
4379 : }
4380 :
4381 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4382 0 : TALLOC_FREE(tmp_ctx);
4383 0 : return ret;
4384 : }
4385 :
4386 0 : static PyObject *py_dcerpc_ack_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4387 : {
4388 0 : struct dcerpc_ack *object = pytalloc_get_ptr(py_obj);
4389 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4390 0 : Py_ssize_t blob_length = 0;
4391 0 : enum ndr_err_code err;
4392 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4393 0 : PyObject *allow_remaining_obj = NULL;
4394 0 : bool allow_remaining = false;
4395 :
4396 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4397 : discard_const_p(char *, kwnames),
4398 : &blob.data, &blob_length,
4399 : &allow_remaining_obj)) {
4400 0 : return NULL;
4401 : }
4402 0 : blob.length = blob_length;
4403 :
4404 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4405 0 : allow_remaining = true;
4406 : }
4407 :
4408 0 : if (allow_remaining) {
4409 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ack);
4410 : } else {
4411 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ack);
4412 : }
4413 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4414 0 : PyErr_SetNdrError(err);
4415 0 : return NULL;
4416 : }
4417 :
4418 0 : Py_RETURN_NONE;
4419 : }
4420 :
4421 0 : static PyObject *py_dcerpc_ack_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4422 : {
4423 0 : struct dcerpc_ack *object = pytalloc_get_ptr(py_obj);
4424 0 : PyObject *ret;
4425 0 : char *retstr;
4426 :
4427 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_ack, "dcerpc_ack", object);
4428 0 : ret = PyUnicode_FromString(retstr);
4429 0 : talloc_free(retstr);
4430 :
4431 0 : return ret;
4432 : }
4433 :
4434 : static PyMethodDef py_dcerpc_ack_methods[] = {
4435 : { "__ndr_pack__", (PyCFunction)py_dcerpc_ack_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4436 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_ack_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4437 : { "__ndr_print__", (PyCFunction)py_dcerpc_ack_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4438 : { NULL, NULL, 0, NULL }
4439 : };
4440 :
4441 :
4442 : static PyTypeObject dcerpc_ack_Type = {
4443 : PyVarObject_HEAD_INIT(NULL, 0)
4444 : .tp_name = "dcerpc.ack",
4445 : .tp_getset = NULL,
4446 : .tp_methods = py_dcerpc_ack_methods,
4447 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4448 : .tp_new = py_dcerpc_ack_new,
4449 : };
4450 :
4451 :
4452 0 : static PyObject *py_dcerpc_ping_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4453 : {
4454 0 : return pytalloc_new(struct dcerpc_ping, type);
4455 : }
4456 :
4457 0 : static PyObject *py_dcerpc_ping_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4458 : {
4459 0 : struct dcerpc_ping *object = pytalloc_get_ptr(py_obj);
4460 0 : PyObject *ret = NULL;
4461 0 : DATA_BLOB blob;
4462 0 : enum ndr_err_code err;
4463 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4464 0 : if (tmp_ctx == NULL) {
4465 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4466 0 : return NULL;
4467 : }
4468 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_ping);
4469 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4470 0 : TALLOC_FREE(tmp_ctx);
4471 0 : PyErr_SetNdrError(err);
4472 0 : return NULL;
4473 : }
4474 :
4475 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4476 0 : TALLOC_FREE(tmp_ctx);
4477 0 : return ret;
4478 : }
4479 :
4480 0 : static PyObject *py_dcerpc_ping_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4481 : {
4482 0 : struct dcerpc_ping *object = pytalloc_get_ptr(py_obj);
4483 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4484 0 : Py_ssize_t blob_length = 0;
4485 0 : enum ndr_err_code err;
4486 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4487 0 : PyObject *allow_remaining_obj = NULL;
4488 0 : bool allow_remaining = false;
4489 :
4490 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4491 : discard_const_p(char *, kwnames),
4492 : &blob.data, &blob_length,
4493 : &allow_remaining_obj)) {
4494 0 : return NULL;
4495 : }
4496 0 : blob.length = blob_length;
4497 :
4498 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4499 0 : allow_remaining = true;
4500 : }
4501 :
4502 0 : if (allow_remaining) {
4503 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ping);
4504 : } else {
4505 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_ping);
4506 : }
4507 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4508 0 : PyErr_SetNdrError(err);
4509 0 : return NULL;
4510 : }
4511 :
4512 0 : Py_RETURN_NONE;
4513 : }
4514 :
4515 0 : static PyObject *py_dcerpc_ping_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4516 : {
4517 0 : struct dcerpc_ping *object = pytalloc_get_ptr(py_obj);
4518 0 : PyObject *ret;
4519 0 : char *retstr;
4520 :
4521 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_ping, "dcerpc_ping", object);
4522 0 : ret = PyUnicode_FromString(retstr);
4523 0 : talloc_free(retstr);
4524 :
4525 0 : return ret;
4526 : }
4527 :
4528 : static PyMethodDef py_dcerpc_ping_methods[] = {
4529 : { "__ndr_pack__", (PyCFunction)py_dcerpc_ping_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4530 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_ping_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4531 : { "__ndr_print__", (PyCFunction)py_dcerpc_ping_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4532 : { NULL, NULL, 0, NULL }
4533 : };
4534 :
4535 :
4536 : static PyTypeObject dcerpc_ping_Type = {
4537 : PyVarObject_HEAD_INIT(NULL, 0)
4538 : .tp_name = "dcerpc.ping",
4539 : .tp_getset = NULL,
4540 : .tp_methods = py_dcerpc_ping_methods,
4541 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4542 : .tp_new = py_dcerpc_ping_new,
4543 : };
4544 :
4545 :
4546 0 : static PyObject *py_dcerpc_shutdown_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4547 : {
4548 0 : return pytalloc_new(struct dcerpc_shutdown, type);
4549 : }
4550 :
4551 0 : static PyObject *py_dcerpc_shutdown_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4552 : {
4553 0 : struct dcerpc_shutdown *object = pytalloc_get_ptr(py_obj);
4554 0 : PyObject *ret = NULL;
4555 0 : DATA_BLOB blob;
4556 0 : enum ndr_err_code err;
4557 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4558 0 : if (tmp_ctx == NULL) {
4559 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4560 0 : return NULL;
4561 : }
4562 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_shutdown);
4563 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4564 0 : TALLOC_FREE(tmp_ctx);
4565 0 : PyErr_SetNdrError(err);
4566 0 : return NULL;
4567 : }
4568 :
4569 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4570 0 : TALLOC_FREE(tmp_ctx);
4571 0 : return ret;
4572 : }
4573 :
4574 0 : static PyObject *py_dcerpc_shutdown_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4575 : {
4576 0 : struct dcerpc_shutdown *object = pytalloc_get_ptr(py_obj);
4577 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4578 0 : Py_ssize_t blob_length = 0;
4579 0 : enum ndr_err_code err;
4580 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4581 0 : PyObject *allow_remaining_obj = NULL;
4582 0 : bool allow_remaining = false;
4583 :
4584 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4585 : discard_const_p(char *, kwnames),
4586 : &blob.data, &blob_length,
4587 : &allow_remaining_obj)) {
4588 0 : return NULL;
4589 : }
4590 0 : blob.length = blob_length;
4591 :
4592 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4593 0 : allow_remaining = true;
4594 : }
4595 :
4596 0 : if (allow_remaining) {
4597 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_shutdown);
4598 : } else {
4599 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_shutdown);
4600 : }
4601 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4602 0 : PyErr_SetNdrError(err);
4603 0 : return NULL;
4604 : }
4605 :
4606 0 : Py_RETURN_NONE;
4607 : }
4608 :
4609 0 : static PyObject *py_dcerpc_shutdown_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4610 : {
4611 0 : struct dcerpc_shutdown *object = pytalloc_get_ptr(py_obj);
4612 0 : PyObject *ret;
4613 0 : char *retstr;
4614 :
4615 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_shutdown, "dcerpc_shutdown", object);
4616 0 : ret = PyUnicode_FromString(retstr);
4617 0 : talloc_free(retstr);
4618 :
4619 0 : return ret;
4620 : }
4621 :
4622 : static PyMethodDef py_dcerpc_shutdown_methods[] = {
4623 : { "__ndr_pack__", (PyCFunction)py_dcerpc_shutdown_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4624 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_shutdown_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4625 : { "__ndr_print__", (PyCFunction)py_dcerpc_shutdown_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4626 : { NULL, NULL, 0, NULL }
4627 : };
4628 :
4629 :
4630 : static PyTypeObject dcerpc_shutdown_Type = {
4631 : PyVarObject_HEAD_INIT(NULL, 0)
4632 : .tp_name = "dcerpc.shutdown",
4633 : .tp_getset = NULL,
4634 : .tp_methods = py_dcerpc_shutdown_methods,
4635 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4636 : .tp_new = py_dcerpc_shutdown_new,
4637 : };
4638 :
4639 :
4640 0 : static PyObject *py_dcerpc_working_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4641 : {
4642 0 : return pytalloc_new(struct dcerpc_working, type);
4643 : }
4644 :
4645 0 : static PyObject *py_dcerpc_working_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4646 : {
4647 0 : struct dcerpc_working *object = pytalloc_get_ptr(py_obj);
4648 0 : PyObject *ret = NULL;
4649 0 : DATA_BLOB blob;
4650 0 : enum ndr_err_code err;
4651 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4652 0 : if (tmp_ctx == NULL) {
4653 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4654 0 : return NULL;
4655 : }
4656 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_working);
4657 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4658 0 : TALLOC_FREE(tmp_ctx);
4659 0 : PyErr_SetNdrError(err);
4660 0 : return NULL;
4661 : }
4662 :
4663 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4664 0 : TALLOC_FREE(tmp_ctx);
4665 0 : return ret;
4666 : }
4667 :
4668 0 : static PyObject *py_dcerpc_working_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4669 : {
4670 0 : struct dcerpc_working *object = pytalloc_get_ptr(py_obj);
4671 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4672 0 : Py_ssize_t blob_length = 0;
4673 0 : enum ndr_err_code err;
4674 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4675 0 : PyObject *allow_remaining_obj = NULL;
4676 0 : bool allow_remaining = false;
4677 :
4678 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4679 : discard_const_p(char *, kwnames),
4680 : &blob.data, &blob_length,
4681 : &allow_remaining_obj)) {
4682 0 : return NULL;
4683 : }
4684 0 : blob.length = blob_length;
4685 :
4686 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4687 0 : allow_remaining = true;
4688 : }
4689 :
4690 0 : if (allow_remaining) {
4691 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_working);
4692 : } else {
4693 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_working);
4694 : }
4695 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4696 0 : PyErr_SetNdrError(err);
4697 0 : return NULL;
4698 : }
4699 :
4700 0 : Py_RETURN_NONE;
4701 : }
4702 :
4703 0 : static PyObject *py_dcerpc_working_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4704 : {
4705 0 : struct dcerpc_working *object = pytalloc_get_ptr(py_obj);
4706 0 : PyObject *ret;
4707 0 : char *retstr;
4708 :
4709 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_working, "dcerpc_working", object);
4710 0 : ret = PyUnicode_FromString(retstr);
4711 0 : talloc_free(retstr);
4712 :
4713 0 : return ret;
4714 : }
4715 :
4716 : static PyMethodDef py_dcerpc_working_methods[] = {
4717 : { "__ndr_pack__", (PyCFunction)py_dcerpc_working_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4718 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_working_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4719 : { "__ndr_print__", (PyCFunction)py_dcerpc_working_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4720 : { NULL, NULL, 0, NULL }
4721 : };
4722 :
4723 :
4724 : static PyTypeObject dcerpc_working_Type = {
4725 : PyVarObject_HEAD_INIT(NULL, 0)
4726 : .tp_name = "dcerpc.working",
4727 : .tp_getset = NULL,
4728 : .tp_methods = py_dcerpc_working_methods,
4729 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4730 : .tp_new = py_dcerpc_working_new,
4731 : };
4732 :
4733 :
4734 0 : static PyObject *py_RTSCookie_get_Cookie(PyObject *obj, void *closure)
4735 : {
4736 0 : struct RTSCookie *object = pytalloc_get_ptr(obj);
4737 0 : PyObject *py_Cookie;
4738 0 : py_Cookie = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->Cookie);
4739 0 : return py_Cookie;
4740 : }
4741 :
4742 0 : static int py_RTSCookie_set_Cookie(PyObject *py_obj, PyObject *value, void *closure)
4743 : {
4744 0 : struct RTSCookie *object = pytalloc_get_ptr(py_obj);
4745 0 : if (value == NULL) {
4746 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Cookie");
4747 0 : return -1;
4748 : }
4749 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
4750 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4751 0 : PyErr_NoMemory();
4752 0 : return -1;
4753 : }
4754 0 : object->Cookie = *(struct GUID *)pytalloc_get_ptr(value);
4755 0 : return 0;
4756 : }
4757 :
4758 : static PyGetSetDef py_RTSCookie_getsetters[] = {
4759 : {
4760 : .name = discard_const_p(char, "Cookie"),
4761 : .get = py_RTSCookie_get_Cookie,
4762 : .set = py_RTSCookie_set_Cookie,
4763 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
4764 : },
4765 : { .name = NULL }
4766 : };
4767 :
4768 0 : static PyObject *py_RTSCookie_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4769 : {
4770 0 : return pytalloc_new(struct RTSCookie, type);
4771 : }
4772 :
4773 0 : static PyObject *py_RTSCookie_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4774 : {
4775 0 : struct RTSCookie *object = pytalloc_get_ptr(py_obj);
4776 0 : PyObject *ret = NULL;
4777 0 : DATA_BLOB blob;
4778 0 : enum ndr_err_code err;
4779 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4780 0 : if (tmp_ctx == NULL) {
4781 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4782 0 : return NULL;
4783 : }
4784 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_RTSCookie);
4785 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4786 0 : TALLOC_FREE(tmp_ctx);
4787 0 : PyErr_SetNdrError(err);
4788 0 : return NULL;
4789 : }
4790 :
4791 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4792 0 : TALLOC_FREE(tmp_ctx);
4793 0 : return ret;
4794 : }
4795 :
4796 0 : static PyObject *py_RTSCookie_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4797 : {
4798 0 : struct RTSCookie *object = pytalloc_get_ptr(py_obj);
4799 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4800 0 : Py_ssize_t blob_length = 0;
4801 0 : enum ndr_err_code err;
4802 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4803 0 : PyObject *allow_remaining_obj = NULL;
4804 0 : bool allow_remaining = false;
4805 :
4806 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4807 : discard_const_p(char *, kwnames),
4808 : &blob.data, &blob_length,
4809 : &allow_remaining_obj)) {
4810 0 : return NULL;
4811 : }
4812 0 : blob.length = blob_length;
4813 :
4814 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4815 0 : allow_remaining = true;
4816 : }
4817 :
4818 0 : if (allow_remaining) {
4819 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RTSCookie);
4820 : } else {
4821 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RTSCookie);
4822 : }
4823 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4824 0 : PyErr_SetNdrError(err);
4825 0 : return NULL;
4826 : }
4827 :
4828 0 : Py_RETURN_NONE;
4829 : }
4830 :
4831 0 : static PyObject *py_RTSCookie_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4832 : {
4833 0 : struct RTSCookie *object = pytalloc_get_ptr(py_obj);
4834 0 : PyObject *ret;
4835 0 : char *retstr;
4836 :
4837 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_RTSCookie, "RTSCookie", object);
4838 0 : ret = PyUnicode_FromString(retstr);
4839 0 : talloc_free(retstr);
4840 :
4841 0 : return ret;
4842 : }
4843 :
4844 : static PyMethodDef py_RTSCookie_methods[] = {
4845 : { "__ndr_pack__", (PyCFunction)py_RTSCookie_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4846 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_RTSCookie_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4847 : { "__ndr_print__", (PyCFunction)py_RTSCookie_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4848 : { NULL, NULL, 0, NULL }
4849 : };
4850 :
4851 :
4852 : static PyTypeObject RTSCookie_Type = {
4853 : PyVarObject_HEAD_INIT(NULL, 0)
4854 : .tp_name = "dcerpc.RTSCookie",
4855 : .tp_getset = py_RTSCookie_getsetters,
4856 : .tp_methods = py_RTSCookie_methods,
4857 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4858 : .tp_new = py_RTSCookie_new,
4859 : };
4860 :
4861 0 : static PyObject *py_import_ClientAddressType(TALLOC_CTX *mem_ctx, int level, union ClientAddressType *in)
4862 : {
4863 0 : PyObject *ret;
4864 :
4865 0 : switch (level) {
4866 0 : case RTS_IPV4:
4867 0 : ret = PyString_FromStringOrNULL(in->ClientAddressIPV4);
4868 0 : return ret;
4869 :
4870 0 : case RTS_IPV6:
4871 0 : ret = PyString_FromStringOrNULL(in->ClientAddressIPV6);
4872 0 : return ret;
4873 :
4874 : }
4875 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4876 0 : return NULL;
4877 : }
4878 :
4879 0 : static union ClientAddressType *py_export_ClientAddressType(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4880 : {
4881 0 : union ClientAddressType *ret = talloc_zero(mem_ctx, union ClientAddressType);
4882 0 : switch (level) {
4883 0 : case RTS_IPV4:
4884 0 : if (in == NULL) {
4885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ClientAddressIPV4");
4886 0 : talloc_free(ret); return NULL;
4887 : }
4888 : {
4889 0 : const char *test_str;
4890 0 : const char *talloc_str;
4891 0 : PyObject *unicode = NULL;
4892 0 : if (PyUnicode_Check(in)) {
4893 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
4894 0 : if (unicode == NULL) {
4895 0 : talloc_free(ret); return NULL;
4896 : }
4897 0 : test_str = PyBytes_AS_STRING(unicode);
4898 0 : } else if (PyBytes_Check(in)) {
4899 0 : test_str = PyBytes_AS_STRING(in);
4900 : } else {
4901 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
4902 0 : talloc_free(ret); return NULL;
4903 : }
4904 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
4905 0 : if (unicode != NULL) {
4906 0 : Py_DECREF(unicode);
4907 : }
4908 0 : if (talloc_str == NULL) {
4909 0 : PyErr_NoMemory();
4910 0 : talloc_free(ret); return NULL;
4911 : }
4912 0 : ret->ClientAddressIPV4 = talloc_str;
4913 : }
4914 0 : break;
4915 :
4916 0 : case RTS_IPV6:
4917 0 : if (in == NULL) {
4918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ClientAddressIPV6");
4919 0 : talloc_free(ret); return NULL;
4920 : }
4921 : {
4922 0 : const char *test_str;
4923 0 : const char *talloc_str;
4924 0 : PyObject *unicode = NULL;
4925 0 : if (PyUnicode_Check(in)) {
4926 0 : unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
4927 0 : if (unicode == NULL) {
4928 0 : talloc_free(ret); return NULL;
4929 : }
4930 0 : test_str = PyBytes_AS_STRING(unicode);
4931 0 : } else if (PyBytes_Check(in)) {
4932 0 : test_str = PyBytes_AS_STRING(in);
4933 : } else {
4934 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
4935 0 : talloc_free(ret); return NULL;
4936 : }
4937 0 : talloc_str = talloc_strdup(mem_ctx, test_str);
4938 0 : if (unicode != NULL) {
4939 0 : Py_DECREF(unicode);
4940 : }
4941 0 : if (talloc_str == NULL) {
4942 0 : PyErr_NoMemory();
4943 0 : talloc_free(ret); return NULL;
4944 : }
4945 0 : ret->ClientAddressIPV6 = talloc_str;
4946 : }
4947 0 : break;
4948 :
4949 0 : default:
4950 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4951 0 : talloc_free(ret);
4952 0 : ret = NULL;
4953 : }
4954 :
4955 0 : return ret;
4956 : }
4957 :
4958 0 : static PyObject *py_ClientAddressType_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4959 : {
4960 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4961 0 : PyObject *mem_ctx_obj = NULL;
4962 0 : TALLOC_CTX *mem_ctx = NULL;
4963 0 : int level = 0;
4964 0 : PyObject *in_obj = NULL;
4965 0 : union ClientAddressType *in = NULL;
4966 :
4967 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4968 : discard_const_p(char *, kwnames),
4969 : &mem_ctx_obj,
4970 : &level,
4971 : &in_obj)) {
4972 0 : return NULL;
4973 : }
4974 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4975 0 : if (mem_ctx == NULL) {
4976 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4977 0 : return NULL;
4978 : }
4979 0 : in = (union ClientAddressType *)pytalloc_get_ptr(in_obj);
4980 0 : if (in == NULL) {
4981 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union ClientAddressType!");
4982 0 : return NULL;
4983 : }
4984 :
4985 0 : return py_import_ClientAddressType(mem_ctx, level, in);
4986 : }
4987 :
4988 0 : static PyObject *py_ClientAddressType_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4989 : {
4990 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4991 0 : PyObject *mem_ctx_obj = NULL;
4992 0 : TALLOC_CTX *mem_ctx = NULL;
4993 0 : int level = 0;
4994 0 : PyObject *in = NULL;
4995 0 : union ClientAddressType *out = NULL;
4996 :
4997 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4998 : discard_const_p(char *, kwnames),
4999 : &mem_ctx_obj,
5000 : &level,
5001 : &in)) {
5002 0 : return NULL;
5003 : }
5004 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
5005 0 : if (mem_ctx == NULL) {
5006 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
5007 0 : return NULL;
5008 : }
5009 :
5010 0 : out = py_export_ClientAddressType(mem_ctx, level, in);
5011 0 : if (out == NULL) {
5012 0 : return NULL;
5013 : }
5014 :
5015 0 : return pytalloc_GenericObject_reference(out);
5016 : }
5017 :
5018 : static PyMethodDef py_ClientAddressType_methods[] = {
5019 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ClientAddressType_import),
5020 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5021 : "T.__import__(mem_ctx, level, in) => ret." },
5022 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ClientAddressType_export),
5023 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
5024 : "T.__export__(mem_ctx, level, in) => ret." },
5025 : { NULL, NULL, 0, NULL }
5026 : };
5027 :
5028 0 : static PyObject *py_ClientAddressType_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5029 : {
5030 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
5031 0 : return NULL;
5032 : }
5033 :
5034 :
5035 : static PyTypeObject ClientAddressType_Type = {
5036 : PyVarObject_HEAD_INIT(NULL, 0)
5037 : .tp_name = "dcerpc.ClientAddressType",
5038 : .tp_getset = NULL,
5039 : .tp_methods = py_ClientAddressType_methods,
5040 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5041 : .tp_new = py_ClientAddressType_new,
5042 : };
5043 :
5044 :
5045 0 : static PyObject *py_ClientAddress_get_AddressType(PyObject *obj, void *closure)
5046 : {
5047 0 : struct ClientAddress *object = pytalloc_get_ptr(obj);
5048 0 : PyObject *py_AddressType;
5049 0 : py_AddressType = PyLong_FromUnsignedLongLong((uint32_t)(object->AddressType));
5050 0 : return py_AddressType;
5051 : }
5052 :
5053 0 : static int py_ClientAddress_set_AddressType(PyObject *py_obj, PyObject *value, void *closure)
5054 : {
5055 0 : struct ClientAddress *object = pytalloc_get_ptr(py_obj);
5056 0 : if (value == NULL) {
5057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->AddressType");
5058 0 : return -1;
5059 : }
5060 : {
5061 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AddressType));
5062 0 : if (PyLong_Check(value)) {
5063 0 : unsigned long long test_var;
5064 0 : test_var = PyLong_AsUnsignedLongLong(value);
5065 0 : if (PyErr_Occurred() != NULL) {
5066 0 : return -1;
5067 : }
5068 0 : if (test_var > uint_max) {
5069 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5070 : PyLong_Type.tp_name, uint_max, test_var);
5071 0 : return -1;
5072 : }
5073 0 : object->AddressType = test_var;
5074 : } else {
5075 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5076 : PyLong_Type.tp_name);
5077 0 : return -1;
5078 : }
5079 : }
5080 0 : return 0;
5081 : }
5082 :
5083 0 : static PyObject *py_ClientAddress_get_ClientAddress(PyObject *obj, void *closure)
5084 : {
5085 0 : struct ClientAddress *object = pytalloc_get_ptr(obj);
5086 0 : PyObject *py_ClientAddress;
5087 0 : py_ClientAddress = pyrpc_import_union(&ClientAddressType_Type, pytalloc_get_mem_ctx(obj), object->AddressType, &object->ClientAddress, "union ClientAddressType");
5088 0 : if (py_ClientAddress == NULL) {
5089 0 : return NULL;
5090 : }
5091 0 : return py_ClientAddress;
5092 : }
5093 :
5094 0 : static int py_ClientAddress_set_ClientAddress(PyObject *py_obj, PyObject *value, void *closure)
5095 : {
5096 0 : struct ClientAddress *object = pytalloc_get_ptr(py_obj);
5097 0 : if (value == NULL) {
5098 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ClientAddress");
5099 0 : return -1;
5100 : }
5101 : {
5102 0 : union ClientAddressType *ClientAddress_switch_0;
5103 0 : ClientAddress_switch_0 = (union ClientAddressType *)pyrpc_export_union(&ClientAddressType_Type, pytalloc_get_mem_ctx(py_obj), object->AddressType, value, "union ClientAddressType");
5104 0 : if (ClientAddress_switch_0 == NULL) {
5105 0 : return -1;
5106 : }
5107 0 : object->ClientAddress = *ClientAddress_switch_0;
5108 : }
5109 0 : return 0;
5110 : }
5111 :
5112 0 : static PyObject *py_ClientAddress_get_Padding(PyObject *obj, void *closure)
5113 : {
5114 0 : struct ClientAddress *object = pytalloc_get_ptr(obj);
5115 0 : PyObject *py_Padding;
5116 0 : py_Padding = PyList_New(12);
5117 0 : if (py_Padding == NULL) {
5118 0 : return NULL;
5119 : }
5120 : {
5121 : int Padding_cntr_0;
5122 0 : for (Padding_cntr_0 = 0; Padding_cntr_0 < (12); Padding_cntr_0++) {
5123 0 : PyObject *py_Padding_0;
5124 0 : py_Padding_0 = PyLong_FromLong((uint16_t)((object->Padding)[Padding_cntr_0]));
5125 0 : PyList_SetItem(py_Padding, Padding_cntr_0, py_Padding_0);
5126 : }
5127 : }
5128 0 : return py_Padding;
5129 : }
5130 :
5131 0 : static int py_ClientAddress_set_Padding(PyObject *py_obj, PyObject *value, void *closure)
5132 : {
5133 0 : struct ClientAddress *object = pytalloc_get_ptr(py_obj);
5134 0 : if (value == NULL) {
5135 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Padding");
5136 0 : return -1;
5137 : }
5138 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5139 : {
5140 0 : int Padding_cntr_0;
5141 0 : if (ARRAY_SIZE(object->Padding) != PyList_GET_SIZE(value)) {
5142 0 : 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));
5143 0 : return -1;
5144 : }
5145 0 : for (Padding_cntr_0 = 0; Padding_cntr_0 < PyList_GET_SIZE(value); Padding_cntr_0++) {
5146 0 : if (PyList_GET_ITEM(value, Padding_cntr_0) == NULL) {
5147 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->Padding)[Padding_cntr_0]");
5148 0 : return -1;
5149 : }
5150 : {
5151 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->Padding)[Padding_cntr_0]));
5152 0 : if (PyLong_Check(PyList_GET_ITEM(value, Padding_cntr_0))) {
5153 0 : unsigned long long test_var;
5154 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, Padding_cntr_0));
5155 0 : if (PyErr_Occurred() != NULL) {
5156 0 : return -1;
5157 : }
5158 0 : if (test_var > uint_max) {
5159 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5160 : PyLong_Type.tp_name, uint_max, test_var);
5161 0 : return -1;
5162 : }
5163 0 : (object->Padding)[Padding_cntr_0] = test_var;
5164 : } else {
5165 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5166 : PyLong_Type.tp_name);
5167 0 : return -1;
5168 : }
5169 : }
5170 : }
5171 : }
5172 0 : return 0;
5173 : }
5174 :
5175 : static PyGetSetDef py_ClientAddress_getsetters[] = {
5176 : {
5177 : .name = discard_const_p(char, "AddressType"),
5178 : .get = py_ClientAddress_get_AddressType,
5179 : .set = py_ClientAddress_set_AddressType,
5180 : .doc = discard_const_p(char, "PIDL-generated element of base type AddressType")
5181 : },
5182 : {
5183 : .name = discard_const_p(char, "ClientAddress"),
5184 : .get = py_ClientAddress_get_ClientAddress,
5185 : .set = py_ClientAddress_set_ClientAddress,
5186 : .doc = discard_const_p(char, "PIDL-generated element of base type ClientAddressType")
5187 : },
5188 : {
5189 : .name = discard_const_p(char, "Padding"),
5190 : .get = py_ClientAddress_get_Padding,
5191 : .set = py_ClientAddress_set_Padding,
5192 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
5193 : },
5194 : { .name = NULL }
5195 : };
5196 :
5197 0 : static PyObject *py_ClientAddress_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5198 : {
5199 0 : return pytalloc_new(struct ClientAddress, type);
5200 : }
5201 :
5202 0 : static PyObject *py_ClientAddress_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5203 : {
5204 0 : struct ClientAddress *object = pytalloc_get_ptr(py_obj);
5205 0 : PyObject *ret = NULL;
5206 0 : DATA_BLOB blob;
5207 0 : enum ndr_err_code err;
5208 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5209 0 : if (tmp_ctx == NULL) {
5210 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5211 0 : return NULL;
5212 : }
5213 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ClientAddress);
5214 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5215 0 : TALLOC_FREE(tmp_ctx);
5216 0 : PyErr_SetNdrError(err);
5217 0 : return NULL;
5218 : }
5219 :
5220 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5221 0 : TALLOC_FREE(tmp_ctx);
5222 0 : return ret;
5223 : }
5224 :
5225 0 : static PyObject *py_ClientAddress_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5226 : {
5227 0 : struct ClientAddress *object = pytalloc_get_ptr(py_obj);
5228 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5229 0 : Py_ssize_t blob_length = 0;
5230 0 : enum ndr_err_code err;
5231 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5232 0 : PyObject *allow_remaining_obj = NULL;
5233 0 : bool allow_remaining = false;
5234 :
5235 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5236 : discard_const_p(char *, kwnames),
5237 : &blob.data, &blob_length,
5238 : &allow_remaining_obj)) {
5239 0 : return NULL;
5240 : }
5241 0 : blob.length = blob_length;
5242 :
5243 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5244 0 : allow_remaining = true;
5245 : }
5246 :
5247 0 : if (allow_remaining) {
5248 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ClientAddress);
5249 : } else {
5250 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ClientAddress);
5251 : }
5252 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5253 0 : PyErr_SetNdrError(err);
5254 0 : return NULL;
5255 : }
5256 :
5257 0 : Py_RETURN_NONE;
5258 : }
5259 :
5260 0 : static PyObject *py_ClientAddress_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5261 : {
5262 0 : struct ClientAddress *object = pytalloc_get_ptr(py_obj);
5263 0 : PyObject *ret;
5264 0 : char *retstr;
5265 :
5266 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ClientAddress, "ClientAddress", object);
5267 0 : ret = PyUnicode_FromString(retstr);
5268 0 : talloc_free(retstr);
5269 :
5270 0 : return ret;
5271 : }
5272 :
5273 : static PyMethodDef py_ClientAddress_methods[] = {
5274 : { "__ndr_pack__", (PyCFunction)py_ClientAddress_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5275 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ClientAddress_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5276 : { "__ndr_print__", (PyCFunction)py_ClientAddress_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5277 : { NULL, NULL, 0, NULL }
5278 : };
5279 :
5280 :
5281 : static PyTypeObject ClientAddress_Type = {
5282 : PyVarObject_HEAD_INIT(NULL, 0)
5283 : .tp_name = "dcerpc.ClientAddress",
5284 : .tp_getset = py_ClientAddress_getsetters,
5285 : .tp_methods = py_ClientAddress_methods,
5286 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5287 : .tp_new = py_ClientAddress_new,
5288 : };
5289 :
5290 :
5291 0 : static PyObject *py_FlowControlAcknowledgment_get_BytesReceived(PyObject *obj, void *closure)
5292 : {
5293 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(obj);
5294 0 : PyObject *py_BytesReceived;
5295 0 : py_BytesReceived = PyLong_FromUnsignedLongLong((uint32_t)(object->BytesReceived));
5296 0 : return py_BytesReceived;
5297 : }
5298 :
5299 0 : static int py_FlowControlAcknowledgment_set_BytesReceived(PyObject *py_obj, PyObject *value, void *closure)
5300 : {
5301 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(py_obj);
5302 0 : if (value == NULL) {
5303 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->BytesReceived");
5304 0 : return -1;
5305 : }
5306 : {
5307 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->BytesReceived));
5308 0 : if (PyLong_Check(value)) {
5309 0 : unsigned long long test_var;
5310 0 : test_var = PyLong_AsUnsignedLongLong(value);
5311 0 : if (PyErr_Occurred() != NULL) {
5312 0 : return -1;
5313 : }
5314 0 : if (test_var > uint_max) {
5315 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5316 : PyLong_Type.tp_name, uint_max, test_var);
5317 0 : return -1;
5318 : }
5319 0 : object->BytesReceived = test_var;
5320 : } else {
5321 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5322 : PyLong_Type.tp_name);
5323 0 : return -1;
5324 : }
5325 : }
5326 0 : return 0;
5327 : }
5328 :
5329 0 : static PyObject *py_FlowControlAcknowledgment_get_AvailableWindow(PyObject *obj, void *closure)
5330 : {
5331 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(obj);
5332 0 : PyObject *py_AvailableWindow;
5333 0 : py_AvailableWindow = PyLong_FromUnsignedLongLong((uint32_t)(object->AvailableWindow));
5334 0 : return py_AvailableWindow;
5335 : }
5336 :
5337 0 : static int py_FlowControlAcknowledgment_set_AvailableWindow(PyObject *py_obj, PyObject *value, void *closure)
5338 : {
5339 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(py_obj);
5340 0 : if (value == NULL) {
5341 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->AvailableWindow");
5342 0 : return -1;
5343 : }
5344 : {
5345 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AvailableWindow));
5346 0 : if (PyLong_Check(value)) {
5347 0 : unsigned long long test_var;
5348 0 : test_var = PyLong_AsUnsignedLongLong(value);
5349 0 : if (PyErr_Occurred() != NULL) {
5350 0 : return -1;
5351 : }
5352 0 : if (test_var > uint_max) {
5353 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5354 : PyLong_Type.tp_name, uint_max, test_var);
5355 0 : return -1;
5356 : }
5357 0 : object->AvailableWindow = test_var;
5358 : } else {
5359 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5360 : PyLong_Type.tp_name);
5361 0 : return -1;
5362 : }
5363 : }
5364 0 : return 0;
5365 : }
5366 :
5367 0 : static PyObject *py_FlowControlAcknowledgment_get_ChannelCookie(PyObject *obj, void *closure)
5368 : {
5369 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(obj);
5370 0 : PyObject *py_ChannelCookie;
5371 0 : py_ChannelCookie = pytalloc_reference_ex(&RTSCookie_Type, pytalloc_get_mem_ctx(obj), &object->ChannelCookie);
5372 0 : return py_ChannelCookie;
5373 : }
5374 :
5375 0 : static int py_FlowControlAcknowledgment_set_ChannelCookie(PyObject *py_obj, PyObject *value, void *closure)
5376 : {
5377 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(py_obj);
5378 0 : if (value == NULL) {
5379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ChannelCookie");
5380 0 : return -1;
5381 : }
5382 0 : PY_CHECK_TYPE(&RTSCookie_Type, value, return -1;);
5383 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5384 0 : PyErr_NoMemory();
5385 0 : return -1;
5386 : }
5387 0 : object->ChannelCookie = *(struct RTSCookie *)pytalloc_get_ptr(value);
5388 0 : return 0;
5389 : }
5390 :
5391 : static PyGetSetDef py_FlowControlAcknowledgment_getsetters[] = {
5392 : {
5393 : .name = discard_const_p(char, "BytesReceived"),
5394 : .get = py_FlowControlAcknowledgment_get_BytesReceived,
5395 : .set = py_FlowControlAcknowledgment_set_BytesReceived,
5396 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5397 : },
5398 : {
5399 : .name = discard_const_p(char, "AvailableWindow"),
5400 : .get = py_FlowControlAcknowledgment_get_AvailableWindow,
5401 : .set = py_FlowControlAcknowledgment_set_AvailableWindow,
5402 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5403 : },
5404 : {
5405 : .name = discard_const_p(char, "ChannelCookie"),
5406 : .get = py_FlowControlAcknowledgment_get_ChannelCookie,
5407 : .set = py_FlowControlAcknowledgment_set_ChannelCookie,
5408 : .doc = discard_const_p(char, "PIDL-generated element of base type RTSCookie")
5409 : },
5410 : { .name = NULL }
5411 : };
5412 :
5413 0 : static PyObject *py_FlowControlAcknowledgment_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5414 : {
5415 0 : return pytalloc_new(struct FlowControlAcknowledgment, type);
5416 : }
5417 :
5418 0 : static PyObject *py_FlowControlAcknowledgment_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5419 : {
5420 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(py_obj);
5421 0 : PyObject *ret = NULL;
5422 0 : DATA_BLOB blob;
5423 0 : enum ndr_err_code err;
5424 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5425 0 : if (tmp_ctx == NULL) {
5426 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5427 0 : return NULL;
5428 : }
5429 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_FlowControlAcknowledgment);
5430 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5431 0 : TALLOC_FREE(tmp_ctx);
5432 0 : PyErr_SetNdrError(err);
5433 0 : return NULL;
5434 : }
5435 :
5436 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5437 0 : TALLOC_FREE(tmp_ctx);
5438 0 : return ret;
5439 : }
5440 :
5441 0 : static PyObject *py_FlowControlAcknowledgment_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5442 : {
5443 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(py_obj);
5444 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5445 0 : Py_ssize_t blob_length = 0;
5446 0 : enum ndr_err_code err;
5447 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5448 0 : PyObject *allow_remaining_obj = NULL;
5449 0 : bool allow_remaining = false;
5450 :
5451 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5452 : discard_const_p(char *, kwnames),
5453 : &blob.data, &blob_length,
5454 : &allow_remaining_obj)) {
5455 0 : return NULL;
5456 : }
5457 0 : blob.length = blob_length;
5458 :
5459 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5460 0 : allow_remaining = true;
5461 : }
5462 :
5463 0 : if (allow_remaining) {
5464 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_FlowControlAcknowledgment);
5465 : } else {
5466 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_FlowControlAcknowledgment);
5467 : }
5468 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5469 0 : PyErr_SetNdrError(err);
5470 0 : return NULL;
5471 : }
5472 :
5473 0 : Py_RETURN_NONE;
5474 : }
5475 :
5476 0 : static PyObject *py_FlowControlAcknowledgment_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5477 : {
5478 0 : struct FlowControlAcknowledgment *object = pytalloc_get_ptr(py_obj);
5479 0 : PyObject *ret;
5480 0 : char *retstr;
5481 :
5482 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_FlowControlAcknowledgment, "FlowControlAcknowledgment", object);
5483 0 : ret = PyUnicode_FromString(retstr);
5484 0 : talloc_free(retstr);
5485 :
5486 0 : return ret;
5487 : }
5488 :
5489 : static PyMethodDef py_FlowControlAcknowledgment_methods[] = {
5490 : { "__ndr_pack__", (PyCFunction)py_FlowControlAcknowledgment_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5491 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_FlowControlAcknowledgment_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5492 : { "__ndr_print__", (PyCFunction)py_FlowControlAcknowledgment_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5493 : { NULL, NULL, 0, NULL }
5494 : };
5495 :
5496 :
5497 : static PyTypeObject FlowControlAcknowledgment_Type = {
5498 : PyVarObject_HEAD_INIT(NULL, 0)
5499 : .tp_name = "dcerpc.FlowControlAcknowledgment",
5500 : .tp_getset = py_FlowControlAcknowledgment_getsetters,
5501 : .tp_methods = py_FlowControlAcknowledgment_methods,
5502 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5503 : .tp_new = py_FlowControlAcknowledgment_new,
5504 : };
5505 :
5506 :
5507 0 : static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_get_ReceiveWindowSize(PyObject *obj, void *closure)
5508 : {
5509 0 : struct dcerpc_rts_cmd_ReceiveWindowSize *object = pytalloc_get_ptr(obj);
5510 0 : PyObject *py_ReceiveWindowSize;
5511 0 : py_ReceiveWindowSize = PyLong_FromUnsignedLongLong((uint32_t)(object->ReceiveWindowSize));
5512 0 : return py_ReceiveWindowSize;
5513 : }
5514 :
5515 0 : static int py_dcerpc_rts_cmd_ReceiveWindowSize_set_ReceiveWindowSize(PyObject *py_obj, PyObject *value, void *closure)
5516 : {
5517 0 : struct dcerpc_rts_cmd_ReceiveWindowSize *object = pytalloc_get_ptr(py_obj);
5518 0 : if (value == NULL) {
5519 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ReceiveWindowSize");
5520 0 : return -1;
5521 : }
5522 : {
5523 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ReceiveWindowSize));
5524 0 : if (PyLong_Check(value)) {
5525 0 : unsigned long long test_var;
5526 0 : test_var = PyLong_AsUnsignedLongLong(value);
5527 0 : if (PyErr_Occurred() != NULL) {
5528 0 : return -1;
5529 : }
5530 0 : if (test_var > uint_max) {
5531 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5532 : PyLong_Type.tp_name, uint_max, test_var);
5533 0 : return -1;
5534 : }
5535 0 : object->ReceiveWindowSize = test_var;
5536 : } else {
5537 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5538 : PyLong_Type.tp_name);
5539 0 : return -1;
5540 : }
5541 : }
5542 0 : return 0;
5543 : }
5544 :
5545 : static PyGetSetDef py_dcerpc_rts_cmd_ReceiveWindowSize_getsetters[] = {
5546 : {
5547 : .name = discard_const_p(char, "ReceiveWindowSize"),
5548 : .get = py_dcerpc_rts_cmd_ReceiveWindowSize_get_ReceiveWindowSize,
5549 : .set = py_dcerpc_rts_cmd_ReceiveWindowSize_set_ReceiveWindowSize,
5550 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5551 : },
5552 : { .name = NULL }
5553 : };
5554 :
5555 0 : static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5556 : {
5557 0 : return pytalloc_new(struct dcerpc_rts_cmd_ReceiveWindowSize, type);
5558 : }
5559 :
5560 0 : static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5561 : {
5562 0 : struct dcerpc_rts_cmd_ReceiveWindowSize *object = pytalloc_get_ptr(py_obj);
5563 0 : PyObject *ret = NULL;
5564 0 : DATA_BLOB blob;
5565 0 : enum ndr_err_code err;
5566 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5567 0 : if (tmp_ctx == NULL) {
5568 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5569 0 : return NULL;
5570 : }
5571 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ReceiveWindowSize);
5572 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5573 0 : TALLOC_FREE(tmp_ctx);
5574 0 : PyErr_SetNdrError(err);
5575 0 : return NULL;
5576 : }
5577 :
5578 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5579 0 : TALLOC_FREE(tmp_ctx);
5580 0 : return ret;
5581 : }
5582 :
5583 0 : static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5584 : {
5585 0 : struct dcerpc_rts_cmd_ReceiveWindowSize *object = pytalloc_get_ptr(py_obj);
5586 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5587 0 : Py_ssize_t blob_length = 0;
5588 0 : enum ndr_err_code err;
5589 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5590 0 : PyObject *allow_remaining_obj = NULL;
5591 0 : bool allow_remaining = false;
5592 :
5593 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5594 : discard_const_p(char *, kwnames),
5595 : &blob.data, &blob_length,
5596 : &allow_remaining_obj)) {
5597 0 : return NULL;
5598 : }
5599 0 : blob.length = blob_length;
5600 :
5601 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5602 0 : allow_remaining = true;
5603 : }
5604 :
5605 0 : if (allow_remaining) {
5606 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ReceiveWindowSize);
5607 : } else {
5608 0 : 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);
5609 : }
5610 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5611 0 : PyErr_SetNdrError(err);
5612 0 : return NULL;
5613 : }
5614 :
5615 0 : Py_RETURN_NONE;
5616 : }
5617 :
5618 0 : static PyObject *py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5619 : {
5620 0 : struct dcerpc_rts_cmd_ReceiveWindowSize *object = pytalloc_get_ptr(py_obj);
5621 0 : PyObject *ret;
5622 0 : char *retstr;
5623 :
5624 0 : 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);
5625 0 : ret = PyUnicode_FromString(retstr);
5626 0 : talloc_free(retstr);
5627 :
5628 0 : return ret;
5629 : }
5630 :
5631 : static PyMethodDef py_dcerpc_rts_cmd_ReceiveWindowSize_methods[] = {
5632 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5633 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5634 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ReceiveWindowSize_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5635 : { NULL, NULL, 0, NULL }
5636 : };
5637 :
5638 :
5639 : static PyTypeObject dcerpc_rts_cmd_ReceiveWindowSize_Type = {
5640 : PyVarObject_HEAD_INIT(NULL, 0)
5641 : .tp_name = "dcerpc.rts_cmd_ReceiveWindowSize",
5642 : .tp_getset = py_dcerpc_rts_cmd_ReceiveWindowSize_getsetters,
5643 : .tp_methods = py_dcerpc_rts_cmd_ReceiveWindowSize_methods,
5644 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5645 : .tp_new = py_dcerpc_rts_cmd_ReceiveWindowSize_new,
5646 : };
5647 :
5648 :
5649 0 : static PyObject *py_dcerpc_rts_cmd_FlowControlAck_get_Ack(PyObject *obj, void *closure)
5650 : {
5651 0 : struct dcerpc_rts_cmd_FlowControlAck *object = pytalloc_get_ptr(obj);
5652 0 : PyObject *py_Ack;
5653 0 : py_Ack = pytalloc_reference_ex(&FlowControlAcknowledgment_Type, pytalloc_get_mem_ctx(obj), &object->Ack);
5654 0 : return py_Ack;
5655 : }
5656 :
5657 0 : static int py_dcerpc_rts_cmd_FlowControlAck_set_Ack(PyObject *py_obj, PyObject *value, void *closure)
5658 : {
5659 0 : struct dcerpc_rts_cmd_FlowControlAck *object = pytalloc_get_ptr(py_obj);
5660 0 : if (value == NULL) {
5661 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Ack");
5662 0 : return -1;
5663 : }
5664 0 : PY_CHECK_TYPE(&FlowControlAcknowledgment_Type, value, return -1;);
5665 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5666 0 : PyErr_NoMemory();
5667 0 : return -1;
5668 : }
5669 0 : object->Ack = *(struct FlowControlAcknowledgment *)pytalloc_get_ptr(value);
5670 0 : return 0;
5671 : }
5672 :
5673 : static PyGetSetDef py_dcerpc_rts_cmd_FlowControlAck_getsetters[] = {
5674 : {
5675 : .name = discard_const_p(char, "Ack"),
5676 : .get = py_dcerpc_rts_cmd_FlowControlAck_get_Ack,
5677 : .set = py_dcerpc_rts_cmd_FlowControlAck_set_Ack,
5678 : .doc = discard_const_p(char, "PIDL-generated element of base type FlowControlAcknowledgment")
5679 : },
5680 : { .name = NULL }
5681 : };
5682 :
5683 0 : static PyObject *py_dcerpc_rts_cmd_FlowControlAck_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5684 : {
5685 0 : return pytalloc_new(struct dcerpc_rts_cmd_FlowControlAck, type);
5686 : }
5687 :
5688 0 : static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5689 : {
5690 0 : struct dcerpc_rts_cmd_FlowControlAck *object = pytalloc_get_ptr(py_obj);
5691 0 : PyObject *ret = NULL;
5692 0 : DATA_BLOB blob;
5693 0 : enum ndr_err_code err;
5694 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5695 0 : if (tmp_ctx == NULL) {
5696 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5697 0 : return NULL;
5698 : }
5699 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_FlowControlAck);
5700 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5701 0 : TALLOC_FREE(tmp_ctx);
5702 0 : PyErr_SetNdrError(err);
5703 0 : return NULL;
5704 : }
5705 :
5706 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5707 0 : TALLOC_FREE(tmp_ctx);
5708 0 : return ret;
5709 : }
5710 :
5711 0 : static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5712 : {
5713 0 : struct dcerpc_rts_cmd_FlowControlAck *object = pytalloc_get_ptr(py_obj);
5714 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5715 0 : Py_ssize_t blob_length = 0;
5716 0 : enum ndr_err_code err;
5717 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5718 0 : PyObject *allow_remaining_obj = NULL;
5719 0 : bool allow_remaining = false;
5720 :
5721 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5722 : discard_const_p(char *, kwnames),
5723 : &blob.data, &blob_length,
5724 : &allow_remaining_obj)) {
5725 0 : return NULL;
5726 : }
5727 0 : blob.length = blob_length;
5728 :
5729 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5730 0 : allow_remaining = true;
5731 : }
5732 :
5733 0 : if (allow_remaining) {
5734 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_FlowControlAck);
5735 : } else {
5736 0 : 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);
5737 : }
5738 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5739 0 : PyErr_SetNdrError(err);
5740 0 : return NULL;
5741 : }
5742 :
5743 0 : Py_RETURN_NONE;
5744 : }
5745 :
5746 0 : static PyObject *py_dcerpc_rts_cmd_FlowControlAck_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5747 : {
5748 0 : struct dcerpc_rts_cmd_FlowControlAck *object = pytalloc_get_ptr(py_obj);
5749 0 : PyObject *ret;
5750 0 : char *retstr;
5751 :
5752 0 : 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);
5753 0 : ret = PyUnicode_FromString(retstr);
5754 0 : talloc_free(retstr);
5755 :
5756 0 : return ret;
5757 : }
5758 :
5759 : static PyMethodDef py_dcerpc_rts_cmd_FlowControlAck_methods[] = {
5760 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_FlowControlAck_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5761 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_FlowControlAck_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5762 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_FlowControlAck_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5763 : { NULL, NULL, 0, NULL }
5764 : };
5765 :
5766 :
5767 : static PyTypeObject dcerpc_rts_cmd_FlowControlAck_Type = {
5768 : PyVarObject_HEAD_INIT(NULL, 0)
5769 : .tp_name = "dcerpc.rts_cmd_FlowControlAck",
5770 : .tp_getset = py_dcerpc_rts_cmd_FlowControlAck_getsetters,
5771 : .tp_methods = py_dcerpc_rts_cmd_FlowControlAck_methods,
5772 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5773 : .tp_new = py_dcerpc_rts_cmd_FlowControlAck_new,
5774 : };
5775 :
5776 :
5777 0 : static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_get_ConnectionTimeout(PyObject *obj, void *closure)
5778 : {
5779 0 : struct dcerpc_rts_cmd_ConnectionTimeout *object = pytalloc_get_ptr(obj);
5780 0 : PyObject *py_ConnectionTimeout;
5781 0 : py_ConnectionTimeout = PyLong_FromUnsignedLongLong((uint32_t)(object->ConnectionTimeout));
5782 0 : return py_ConnectionTimeout;
5783 : }
5784 :
5785 0 : static int py_dcerpc_rts_cmd_ConnectionTimeout_set_ConnectionTimeout(PyObject *py_obj, PyObject *value, void *closure)
5786 : {
5787 0 : struct dcerpc_rts_cmd_ConnectionTimeout *object = pytalloc_get_ptr(py_obj);
5788 0 : if (value == NULL) {
5789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ConnectionTimeout");
5790 0 : return -1;
5791 : }
5792 : {
5793 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ConnectionTimeout));
5794 0 : if (PyLong_Check(value)) {
5795 0 : unsigned long long test_var;
5796 0 : test_var = PyLong_AsUnsignedLongLong(value);
5797 0 : if (PyErr_Occurred() != NULL) {
5798 0 : return -1;
5799 : }
5800 0 : if (test_var > uint_max) {
5801 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5802 : PyLong_Type.tp_name, uint_max, test_var);
5803 0 : return -1;
5804 : }
5805 0 : object->ConnectionTimeout = test_var;
5806 : } else {
5807 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5808 : PyLong_Type.tp_name);
5809 0 : return -1;
5810 : }
5811 : }
5812 0 : return 0;
5813 : }
5814 :
5815 : static PyGetSetDef py_dcerpc_rts_cmd_ConnectionTimeout_getsetters[] = {
5816 : {
5817 : .name = discard_const_p(char, "ConnectionTimeout"),
5818 : .get = py_dcerpc_rts_cmd_ConnectionTimeout_get_ConnectionTimeout,
5819 : .set = py_dcerpc_rts_cmd_ConnectionTimeout_set_ConnectionTimeout,
5820 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5821 : },
5822 : { .name = NULL }
5823 : };
5824 :
5825 0 : static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5826 : {
5827 0 : return pytalloc_new(struct dcerpc_rts_cmd_ConnectionTimeout, type);
5828 : }
5829 :
5830 0 : static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5831 : {
5832 0 : struct dcerpc_rts_cmd_ConnectionTimeout *object = pytalloc_get_ptr(py_obj);
5833 0 : PyObject *ret = NULL;
5834 0 : DATA_BLOB blob;
5835 0 : enum ndr_err_code err;
5836 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5837 0 : if (tmp_ctx == NULL) {
5838 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5839 0 : return NULL;
5840 : }
5841 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ConnectionTimeout);
5842 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5843 0 : TALLOC_FREE(tmp_ctx);
5844 0 : PyErr_SetNdrError(err);
5845 0 : return NULL;
5846 : }
5847 :
5848 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5849 0 : TALLOC_FREE(tmp_ctx);
5850 0 : return ret;
5851 : }
5852 :
5853 0 : static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5854 : {
5855 0 : struct dcerpc_rts_cmd_ConnectionTimeout *object = pytalloc_get_ptr(py_obj);
5856 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5857 0 : Py_ssize_t blob_length = 0;
5858 0 : enum ndr_err_code err;
5859 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5860 0 : PyObject *allow_remaining_obj = NULL;
5861 0 : bool allow_remaining = false;
5862 :
5863 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5864 : discard_const_p(char *, kwnames),
5865 : &blob.data, &blob_length,
5866 : &allow_remaining_obj)) {
5867 0 : return NULL;
5868 : }
5869 0 : blob.length = blob_length;
5870 :
5871 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5872 0 : allow_remaining = true;
5873 : }
5874 :
5875 0 : if (allow_remaining) {
5876 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ConnectionTimeout);
5877 : } else {
5878 0 : 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);
5879 : }
5880 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5881 0 : PyErr_SetNdrError(err);
5882 0 : return NULL;
5883 : }
5884 :
5885 0 : Py_RETURN_NONE;
5886 : }
5887 :
5888 0 : static PyObject *py_dcerpc_rts_cmd_ConnectionTimeout_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5889 : {
5890 0 : struct dcerpc_rts_cmd_ConnectionTimeout *object = pytalloc_get_ptr(py_obj);
5891 0 : PyObject *ret;
5892 0 : char *retstr;
5893 :
5894 0 : 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);
5895 0 : ret = PyUnicode_FromString(retstr);
5896 0 : talloc_free(retstr);
5897 :
5898 0 : return ret;
5899 : }
5900 :
5901 : static PyMethodDef py_dcerpc_rts_cmd_ConnectionTimeout_methods[] = {
5902 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ConnectionTimeout_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5903 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_ConnectionTimeout_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5904 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ConnectionTimeout_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5905 : { NULL, NULL, 0, NULL }
5906 : };
5907 :
5908 :
5909 : static PyTypeObject dcerpc_rts_cmd_ConnectionTimeout_Type = {
5910 : PyVarObject_HEAD_INIT(NULL, 0)
5911 : .tp_name = "dcerpc.rts_cmd_ConnectionTimeout",
5912 : .tp_getset = py_dcerpc_rts_cmd_ConnectionTimeout_getsetters,
5913 : .tp_methods = py_dcerpc_rts_cmd_ConnectionTimeout_methods,
5914 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5915 : .tp_new = py_dcerpc_rts_cmd_ConnectionTimeout_new,
5916 : };
5917 :
5918 :
5919 0 : static PyObject *py_dcerpc_rts_cmd_Cookie_get_Cookie(PyObject *obj, void *closure)
5920 : {
5921 0 : struct dcerpc_rts_cmd_Cookie *object = pytalloc_get_ptr(obj);
5922 0 : PyObject *py_Cookie;
5923 0 : py_Cookie = pytalloc_reference_ex(&RTSCookie_Type, pytalloc_get_mem_ctx(obj), &object->Cookie);
5924 0 : return py_Cookie;
5925 : }
5926 :
5927 0 : static int py_dcerpc_rts_cmd_Cookie_set_Cookie(PyObject *py_obj, PyObject *value, void *closure)
5928 : {
5929 0 : struct dcerpc_rts_cmd_Cookie *object = pytalloc_get_ptr(py_obj);
5930 0 : if (value == NULL) {
5931 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Cookie");
5932 0 : return -1;
5933 : }
5934 0 : PY_CHECK_TYPE(&RTSCookie_Type, value, return -1;);
5935 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5936 0 : PyErr_NoMemory();
5937 0 : return -1;
5938 : }
5939 0 : object->Cookie = *(struct RTSCookie *)pytalloc_get_ptr(value);
5940 0 : return 0;
5941 : }
5942 :
5943 : static PyGetSetDef py_dcerpc_rts_cmd_Cookie_getsetters[] = {
5944 : {
5945 : .name = discard_const_p(char, "Cookie"),
5946 : .get = py_dcerpc_rts_cmd_Cookie_get_Cookie,
5947 : .set = py_dcerpc_rts_cmd_Cookie_set_Cookie,
5948 : .doc = discard_const_p(char, "PIDL-generated element of base type RTSCookie")
5949 : },
5950 : { .name = NULL }
5951 : };
5952 :
5953 0 : static PyObject *py_dcerpc_rts_cmd_Cookie_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5954 : {
5955 0 : return pytalloc_new(struct dcerpc_rts_cmd_Cookie, type);
5956 : }
5957 :
5958 0 : static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5959 : {
5960 0 : struct dcerpc_rts_cmd_Cookie *object = pytalloc_get_ptr(py_obj);
5961 0 : PyObject *ret = NULL;
5962 0 : DATA_BLOB blob;
5963 0 : enum ndr_err_code err;
5964 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5965 0 : if (tmp_ctx == NULL) {
5966 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5967 0 : return NULL;
5968 : }
5969 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Cookie);
5970 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5971 0 : TALLOC_FREE(tmp_ctx);
5972 0 : PyErr_SetNdrError(err);
5973 0 : return NULL;
5974 : }
5975 :
5976 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5977 0 : TALLOC_FREE(tmp_ctx);
5978 0 : return ret;
5979 : }
5980 :
5981 0 : static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5982 : {
5983 0 : struct dcerpc_rts_cmd_Cookie *object = pytalloc_get_ptr(py_obj);
5984 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5985 0 : Py_ssize_t blob_length = 0;
5986 0 : enum ndr_err_code err;
5987 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5988 0 : PyObject *allow_remaining_obj = NULL;
5989 0 : bool allow_remaining = false;
5990 :
5991 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5992 : discard_const_p(char *, kwnames),
5993 : &blob.data, &blob_length,
5994 : &allow_remaining_obj)) {
5995 0 : return NULL;
5996 : }
5997 0 : blob.length = blob_length;
5998 :
5999 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6000 0 : allow_remaining = true;
6001 : }
6002 :
6003 0 : if (allow_remaining) {
6004 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Cookie);
6005 : } else {
6006 0 : 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);
6007 : }
6008 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6009 0 : PyErr_SetNdrError(err);
6010 0 : return NULL;
6011 : }
6012 :
6013 0 : Py_RETURN_NONE;
6014 : }
6015 :
6016 0 : static PyObject *py_dcerpc_rts_cmd_Cookie_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6017 : {
6018 0 : struct dcerpc_rts_cmd_Cookie *object = pytalloc_get_ptr(py_obj);
6019 0 : PyObject *ret;
6020 0 : char *retstr;
6021 :
6022 0 : 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);
6023 0 : ret = PyUnicode_FromString(retstr);
6024 0 : talloc_free(retstr);
6025 :
6026 0 : return ret;
6027 : }
6028 :
6029 : static PyMethodDef py_dcerpc_rts_cmd_Cookie_methods[] = {
6030 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Cookie_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6031 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_Cookie_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6032 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Cookie_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6033 : { NULL, NULL, 0, NULL }
6034 : };
6035 :
6036 :
6037 : static PyTypeObject dcerpc_rts_cmd_Cookie_Type = {
6038 : PyVarObject_HEAD_INIT(NULL, 0)
6039 : .tp_name = "dcerpc.rts_cmd_Cookie",
6040 : .tp_getset = py_dcerpc_rts_cmd_Cookie_getsetters,
6041 : .tp_methods = py_dcerpc_rts_cmd_Cookie_methods,
6042 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6043 : .tp_new = py_dcerpc_rts_cmd_Cookie_new,
6044 : };
6045 :
6046 :
6047 0 : static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_get_ChannelLifetime(PyObject *obj, void *closure)
6048 : {
6049 0 : struct dcerpc_rts_cmd_ChannelLifetime *object = pytalloc_get_ptr(obj);
6050 0 : PyObject *py_ChannelLifetime;
6051 0 : py_ChannelLifetime = PyLong_FromUnsignedLongLong((uint32_t)(object->ChannelLifetime));
6052 0 : return py_ChannelLifetime;
6053 : }
6054 :
6055 0 : static int py_dcerpc_rts_cmd_ChannelLifetime_set_ChannelLifetime(PyObject *py_obj, PyObject *value, void *closure)
6056 : {
6057 0 : struct dcerpc_rts_cmd_ChannelLifetime *object = pytalloc_get_ptr(py_obj);
6058 0 : if (value == NULL) {
6059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ChannelLifetime");
6060 0 : return -1;
6061 : }
6062 : {
6063 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ChannelLifetime));
6064 0 : if (PyLong_Check(value)) {
6065 0 : unsigned long long test_var;
6066 0 : test_var = PyLong_AsUnsignedLongLong(value);
6067 0 : if (PyErr_Occurred() != NULL) {
6068 0 : return -1;
6069 : }
6070 0 : if (test_var > uint_max) {
6071 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6072 : PyLong_Type.tp_name, uint_max, test_var);
6073 0 : return -1;
6074 : }
6075 0 : object->ChannelLifetime = test_var;
6076 : } else {
6077 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6078 : PyLong_Type.tp_name);
6079 0 : return -1;
6080 : }
6081 : }
6082 0 : return 0;
6083 : }
6084 :
6085 : static PyGetSetDef py_dcerpc_rts_cmd_ChannelLifetime_getsetters[] = {
6086 : {
6087 : .name = discard_const_p(char, "ChannelLifetime"),
6088 : .get = py_dcerpc_rts_cmd_ChannelLifetime_get_ChannelLifetime,
6089 : .set = py_dcerpc_rts_cmd_ChannelLifetime_set_ChannelLifetime,
6090 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6091 : },
6092 : { .name = NULL }
6093 : };
6094 :
6095 0 : static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6096 : {
6097 0 : return pytalloc_new(struct dcerpc_rts_cmd_ChannelLifetime, type);
6098 : }
6099 :
6100 0 : static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6101 : {
6102 0 : struct dcerpc_rts_cmd_ChannelLifetime *object = pytalloc_get_ptr(py_obj);
6103 0 : PyObject *ret = NULL;
6104 0 : DATA_BLOB blob;
6105 0 : enum ndr_err_code err;
6106 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6107 0 : if (tmp_ctx == NULL) {
6108 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6109 0 : return NULL;
6110 : }
6111 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ChannelLifetime);
6112 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6113 0 : TALLOC_FREE(tmp_ctx);
6114 0 : PyErr_SetNdrError(err);
6115 0 : return NULL;
6116 : }
6117 :
6118 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6119 0 : TALLOC_FREE(tmp_ctx);
6120 0 : return ret;
6121 : }
6122 :
6123 0 : static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6124 : {
6125 0 : struct dcerpc_rts_cmd_ChannelLifetime *object = pytalloc_get_ptr(py_obj);
6126 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6127 0 : Py_ssize_t blob_length = 0;
6128 0 : enum ndr_err_code err;
6129 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6130 0 : PyObject *allow_remaining_obj = NULL;
6131 0 : bool allow_remaining = false;
6132 :
6133 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6134 : discard_const_p(char *, kwnames),
6135 : &blob.data, &blob_length,
6136 : &allow_remaining_obj)) {
6137 0 : return NULL;
6138 : }
6139 0 : blob.length = blob_length;
6140 :
6141 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6142 0 : allow_remaining = true;
6143 : }
6144 :
6145 0 : if (allow_remaining) {
6146 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ChannelLifetime);
6147 : } else {
6148 0 : 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);
6149 : }
6150 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6151 0 : PyErr_SetNdrError(err);
6152 0 : return NULL;
6153 : }
6154 :
6155 0 : Py_RETURN_NONE;
6156 : }
6157 :
6158 0 : static PyObject *py_dcerpc_rts_cmd_ChannelLifetime_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6159 : {
6160 0 : struct dcerpc_rts_cmd_ChannelLifetime *object = pytalloc_get_ptr(py_obj);
6161 0 : PyObject *ret;
6162 0 : char *retstr;
6163 :
6164 0 : 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);
6165 0 : ret = PyUnicode_FromString(retstr);
6166 0 : talloc_free(retstr);
6167 :
6168 0 : return ret;
6169 : }
6170 :
6171 : static PyMethodDef py_dcerpc_rts_cmd_ChannelLifetime_methods[] = {
6172 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ChannelLifetime_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6173 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_ChannelLifetime_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6174 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ChannelLifetime_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6175 : { NULL, NULL, 0, NULL }
6176 : };
6177 :
6178 :
6179 : static PyTypeObject dcerpc_rts_cmd_ChannelLifetime_Type = {
6180 : PyVarObject_HEAD_INIT(NULL, 0)
6181 : .tp_name = "dcerpc.rts_cmd_ChannelLifetime",
6182 : .tp_getset = py_dcerpc_rts_cmd_ChannelLifetime_getsetters,
6183 : .tp_methods = py_dcerpc_rts_cmd_ChannelLifetime_methods,
6184 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6185 : .tp_new = py_dcerpc_rts_cmd_ChannelLifetime_new,
6186 : };
6187 :
6188 :
6189 0 : static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_get_ClientKeepalive(PyObject *obj, void *closure)
6190 : {
6191 0 : struct dcerpc_rts_cmd_ClientKeepalive *object = pytalloc_get_ptr(obj);
6192 0 : PyObject *py_ClientKeepalive;
6193 0 : py_ClientKeepalive = PyLong_FromUnsignedLongLong((uint32_t)(object->ClientKeepalive));
6194 0 : return py_ClientKeepalive;
6195 : }
6196 :
6197 0 : static int py_dcerpc_rts_cmd_ClientKeepalive_set_ClientKeepalive(PyObject *py_obj, PyObject *value, void *closure)
6198 : {
6199 0 : struct dcerpc_rts_cmd_ClientKeepalive *object = pytalloc_get_ptr(py_obj);
6200 0 : if (value == NULL) {
6201 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ClientKeepalive");
6202 0 : return -1;
6203 : }
6204 : {
6205 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ClientKeepalive));
6206 0 : if (PyLong_Check(value)) {
6207 0 : unsigned long long test_var;
6208 0 : test_var = PyLong_AsUnsignedLongLong(value);
6209 0 : if (PyErr_Occurred() != NULL) {
6210 0 : return -1;
6211 : }
6212 0 : if (test_var > uint_max) {
6213 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6214 : PyLong_Type.tp_name, uint_max, test_var);
6215 0 : return -1;
6216 : }
6217 0 : object->ClientKeepalive = test_var;
6218 : } else {
6219 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6220 : PyLong_Type.tp_name);
6221 0 : return -1;
6222 : }
6223 : }
6224 0 : return 0;
6225 : }
6226 :
6227 : static PyGetSetDef py_dcerpc_rts_cmd_ClientKeepalive_getsetters[] = {
6228 : {
6229 : .name = discard_const_p(char, "ClientKeepalive"),
6230 : .get = py_dcerpc_rts_cmd_ClientKeepalive_get_ClientKeepalive,
6231 : .set = py_dcerpc_rts_cmd_ClientKeepalive_set_ClientKeepalive,
6232 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6233 : },
6234 : { .name = NULL }
6235 : };
6236 :
6237 0 : static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6238 : {
6239 0 : return pytalloc_new(struct dcerpc_rts_cmd_ClientKeepalive, type);
6240 : }
6241 :
6242 0 : static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6243 : {
6244 0 : struct dcerpc_rts_cmd_ClientKeepalive *object = pytalloc_get_ptr(py_obj);
6245 0 : PyObject *ret = NULL;
6246 0 : DATA_BLOB blob;
6247 0 : enum ndr_err_code err;
6248 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6249 0 : if (tmp_ctx == NULL) {
6250 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6251 0 : return NULL;
6252 : }
6253 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ClientKeepalive);
6254 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6255 0 : TALLOC_FREE(tmp_ctx);
6256 0 : PyErr_SetNdrError(err);
6257 0 : return NULL;
6258 : }
6259 :
6260 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6261 0 : TALLOC_FREE(tmp_ctx);
6262 0 : return ret;
6263 : }
6264 :
6265 0 : static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6266 : {
6267 0 : struct dcerpc_rts_cmd_ClientKeepalive *object = pytalloc_get_ptr(py_obj);
6268 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6269 0 : Py_ssize_t blob_length = 0;
6270 0 : enum ndr_err_code err;
6271 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6272 0 : PyObject *allow_remaining_obj = NULL;
6273 0 : bool allow_remaining = false;
6274 :
6275 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6276 : discard_const_p(char *, kwnames),
6277 : &blob.data, &blob_length,
6278 : &allow_remaining_obj)) {
6279 0 : return NULL;
6280 : }
6281 0 : blob.length = blob_length;
6282 :
6283 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6284 0 : allow_remaining = true;
6285 : }
6286 :
6287 0 : if (allow_remaining) {
6288 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ClientKeepalive);
6289 : } else {
6290 0 : 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);
6291 : }
6292 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6293 0 : PyErr_SetNdrError(err);
6294 0 : return NULL;
6295 : }
6296 :
6297 0 : Py_RETURN_NONE;
6298 : }
6299 :
6300 0 : static PyObject *py_dcerpc_rts_cmd_ClientKeepalive_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6301 : {
6302 0 : struct dcerpc_rts_cmd_ClientKeepalive *object = pytalloc_get_ptr(py_obj);
6303 0 : PyObject *ret;
6304 0 : char *retstr;
6305 :
6306 0 : 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);
6307 0 : ret = PyUnicode_FromString(retstr);
6308 0 : talloc_free(retstr);
6309 :
6310 0 : return ret;
6311 : }
6312 :
6313 : static PyMethodDef py_dcerpc_rts_cmd_ClientKeepalive_methods[] = {
6314 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ClientKeepalive_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6315 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_ClientKeepalive_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6316 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ClientKeepalive_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6317 : { NULL, NULL, 0, NULL }
6318 : };
6319 :
6320 :
6321 : static PyTypeObject dcerpc_rts_cmd_ClientKeepalive_Type = {
6322 : PyVarObject_HEAD_INIT(NULL, 0)
6323 : .tp_name = "dcerpc.rts_cmd_ClientKeepalive",
6324 : .tp_getset = py_dcerpc_rts_cmd_ClientKeepalive_getsetters,
6325 : .tp_methods = py_dcerpc_rts_cmd_ClientKeepalive_methods,
6326 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6327 : .tp_new = py_dcerpc_rts_cmd_ClientKeepalive_new,
6328 : };
6329 :
6330 :
6331 0 : static PyObject *py_dcerpc_rts_cmd_Version_get_Version(PyObject *obj, void *closure)
6332 : {
6333 0 : struct dcerpc_rts_cmd_Version *object = pytalloc_get_ptr(obj);
6334 0 : PyObject *py_Version;
6335 0 : py_Version = PyLong_FromUnsignedLongLong((uint32_t)(object->Version));
6336 0 : return py_Version;
6337 : }
6338 :
6339 0 : static int py_dcerpc_rts_cmd_Version_set_Version(PyObject *py_obj, PyObject *value, void *closure)
6340 : {
6341 0 : struct dcerpc_rts_cmd_Version *object = pytalloc_get_ptr(py_obj);
6342 0 : if (value == NULL) {
6343 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Version");
6344 0 : return -1;
6345 : }
6346 : {
6347 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Version));
6348 0 : if (PyLong_Check(value)) {
6349 0 : unsigned long long test_var;
6350 0 : test_var = PyLong_AsUnsignedLongLong(value);
6351 0 : if (PyErr_Occurred() != NULL) {
6352 0 : return -1;
6353 : }
6354 0 : if (test_var > uint_max) {
6355 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6356 : PyLong_Type.tp_name, uint_max, test_var);
6357 0 : return -1;
6358 : }
6359 0 : object->Version = test_var;
6360 : } else {
6361 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6362 : PyLong_Type.tp_name);
6363 0 : return -1;
6364 : }
6365 : }
6366 0 : return 0;
6367 : }
6368 :
6369 : static PyGetSetDef py_dcerpc_rts_cmd_Version_getsetters[] = {
6370 : {
6371 : .name = discard_const_p(char, "Version"),
6372 : .get = py_dcerpc_rts_cmd_Version_get_Version,
6373 : .set = py_dcerpc_rts_cmd_Version_set_Version,
6374 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6375 : },
6376 : { .name = NULL }
6377 : };
6378 :
6379 0 : static PyObject *py_dcerpc_rts_cmd_Version_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6380 : {
6381 0 : return pytalloc_new(struct dcerpc_rts_cmd_Version, type);
6382 : }
6383 :
6384 0 : static PyObject *py_dcerpc_rts_cmd_Version_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6385 : {
6386 0 : struct dcerpc_rts_cmd_Version *object = pytalloc_get_ptr(py_obj);
6387 0 : PyObject *ret = NULL;
6388 0 : DATA_BLOB blob;
6389 0 : enum ndr_err_code err;
6390 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6391 0 : if (tmp_ctx == NULL) {
6392 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6393 0 : return NULL;
6394 : }
6395 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Version);
6396 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6397 0 : TALLOC_FREE(tmp_ctx);
6398 0 : PyErr_SetNdrError(err);
6399 0 : return NULL;
6400 : }
6401 :
6402 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6403 0 : TALLOC_FREE(tmp_ctx);
6404 0 : return ret;
6405 : }
6406 :
6407 0 : static PyObject *py_dcerpc_rts_cmd_Version_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6408 : {
6409 0 : struct dcerpc_rts_cmd_Version *object = pytalloc_get_ptr(py_obj);
6410 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6411 0 : Py_ssize_t blob_length = 0;
6412 0 : enum ndr_err_code err;
6413 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6414 0 : PyObject *allow_remaining_obj = NULL;
6415 0 : bool allow_remaining = false;
6416 :
6417 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6418 : discard_const_p(char *, kwnames),
6419 : &blob.data, &blob_length,
6420 : &allow_remaining_obj)) {
6421 0 : return NULL;
6422 : }
6423 0 : blob.length = blob_length;
6424 :
6425 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6426 0 : allow_remaining = true;
6427 : }
6428 :
6429 0 : if (allow_remaining) {
6430 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Version);
6431 : } else {
6432 0 : 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);
6433 : }
6434 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6435 0 : PyErr_SetNdrError(err);
6436 0 : return NULL;
6437 : }
6438 :
6439 0 : Py_RETURN_NONE;
6440 : }
6441 :
6442 0 : static PyObject *py_dcerpc_rts_cmd_Version_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6443 : {
6444 0 : struct dcerpc_rts_cmd_Version *object = pytalloc_get_ptr(py_obj);
6445 0 : PyObject *ret;
6446 0 : char *retstr;
6447 :
6448 0 : 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);
6449 0 : ret = PyUnicode_FromString(retstr);
6450 0 : talloc_free(retstr);
6451 :
6452 0 : return ret;
6453 : }
6454 :
6455 : static PyMethodDef py_dcerpc_rts_cmd_Version_methods[] = {
6456 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Version_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6457 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_Version_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6458 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Version_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6459 : { NULL, NULL, 0, NULL }
6460 : };
6461 :
6462 :
6463 : static PyTypeObject dcerpc_rts_cmd_Version_Type = {
6464 : PyVarObject_HEAD_INIT(NULL, 0)
6465 : .tp_name = "dcerpc.rts_cmd_Version",
6466 : .tp_getset = py_dcerpc_rts_cmd_Version_getsetters,
6467 : .tp_methods = py_dcerpc_rts_cmd_Version_methods,
6468 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6469 : .tp_new = py_dcerpc_rts_cmd_Version_new,
6470 : };
6471 :
6472 :
6473 0 : static PyObject *py_dcerpc_rts_cmd_Empty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6474 : {
6475 0 : return pytalloc_new(struct dcerpc_rts_cmd_Empty, type);
6476 : }
6477 :
6478 0 : static PyObject *py_dcerpc_rts_cmd_Empty_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6479 : {
6480 0 : struct dcerpc_rts_cmd_Empty *object = pytalloc_get_ptr(py_obj);
6481 0 : PyObject *ret = NULL;
6482 0 : DATA_BLOB blob;
6483 0 : enum ndr_err_code err;
6484 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6485 0 : if (tmp_ctx == NULL) {
6486 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6487 0 : return NULL;
6488 : }
6489 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Empty);
6490 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6491 0 : TALLOC_FREE(tmp_ctx);
6492 0 : PyErr_SetNdrError(err);
6493 0 : return NULL;
6494 : }
6495 :
6496 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6497 0 : TALLOC_FREE(tmp_ctx);
6498 0 : return ret;
6499 : }
6500 :
6501 0 : static PyObject *py_dcerpc_rts_cmd_Empty_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6502 : {
6503 0 : struct dcerpc_rts_cmd_Empty *object = pytalloc_get_ptr(py_obj);
6504 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6505 0 : Py_ssize_t blob_length = 0;
6506 0 : enum ndr_err_code err;
6507 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6508 0 : PyObject *allow_remaining_obj = NULL;
6509 0 : bool allow_remaining = false;
6510 :
6511 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6512 : discard_const_p(char *, kwnames),
6513 : &blob.data, &blob_length,
6514 : &allow_remaining_obj)) {
6515 0 : return NULL;
6516 : }
6517 0 : blob.length = blob_length;
6518 :
6519 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6520 0 : allow_remaining = true;
6521 : }
6522 :
6523 0 : if (allow_remaining) {
6524 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Empty);
6525 : } else {
6526 0 : 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);
6527 : }
6528 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6529 0 : PyErr_SetNdrError(err);
6530 0 : return NULL;
6531 : }
6532 :
6533 0 : Py_RETURN_NONE;
6534 : }
6535 :
6536 0 : static PyObject *py_dcerpc_rts_cmd_Empty_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6537 : {
6538 0 : struct dcerpc_rts_cmd_Empty *object = pytalloc_get_ptr(py_obj);
6539 0 : PyObject *ret;
6540 0 : char *retstr;
6541 :
6542 0 : 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);
6543 0 : ret = PyUnicode_FromString(retstr);
6544 0 : talloc_free(retstr);
6545 :
6546 0 : return ret;
6547 : }
6548 :
6549 : static PyMethodDef py_dcerpc_rts_cmd_Empty_methods[] = {
6550 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Empty_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6551 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_Empty_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6552 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Empty_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6553 : { NULL, NULL, 0, NULL }
6554 : };
6555 :
6556 :
6557 : static PyTypeObject dcerpc_rts_cmd_Empty_Type = {
6558 : PyVarObject_HEAD_INIT(NULL, 0)
6559 : .tp_name = "dcerpc.rts_cmd_Empty",
6560 : .tp_getset = NULL,
6561 : .tp_methods = py_dcerpc_rts_cmd_Empty_methods,
6562 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6563 : .tp_new = py_dcerpc_rts_cmd_Empty_new,
6564 : };
6565 :
6566 :
6567 0 : static PyObject *py_dcerpc_rts_cmd_Padding_get_ConformanceCount(PyObject *obj, void *closure)
6568 : {
6569 0 : struct dcerpc_rts_cmd_Padding *object = pytalloc_get_ptr(obj);
6570 0 : PyObject *py_ConformanceCount;
6571 0 : py_ConformanceCount = PyLong_FromUnsignedLongLong((uint32_t)(object->ConformanceCount));
6572 0 : return py_ConformanceCount;
6573 : }
6574 :
6575 0 : static int py_dcerpc_rts_cmd_Padding_set_ConformanceCount(PyObject *py_obj, PyObject *value, void *closure)
6576 : {
6577 0 : struct dcerpc_rts_cmd_Padding *object = pytalloc_get_ptr(py_obj);
6578 0 : if (value == NULL) {
6579 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ConformanceCount");
6580 0 : return -1;
6581 : }
6582 : {
6583 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ConformanceCount));
6584 0 : if (PyLong_Check(value)) {
6585 0 : unsigned long long test_var;
6586 0 : test_var = PyLong_AsUnsignedLongLong(value);
6587 0 : if (PyErr_Occurred() != NULL) {
6588 0 : return -1;
6589 : }
6590 0 : if (test_var > uint_max) {
6591 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6592 : PyLong_Type.tp_name, uint_max, test_var);
6593 0 : return -1;
6594 : }
6595 0 : object->ConformanceCount = test_var;
6596 : } else {
6597 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6598 : PyLong_Type.tp_name);
6599 0 : return -1;
6600 : }
6601 : }
6602 0 : return 0;
6603 : }
6604 :
6605 0 : static PyObject *py_dcerpc_rts_cmd_Padding_get_Padding(PyObject *obj, void *closure)
6606 : {
6607 0 : struct dcerpc_rts_cmd_Padding *object = pytalloc_get_ptr(obj);
6608 0 : PyObject *py_Padding;
6609 0 : py_Padding = PyList_New(object->ConformanceCount);
6610 0 : if (py_Padding == NULL) {
6611 0 : return NULL;
6612 : }
6613 : {
6614 : int Padding_cntr_0;
6615 0 : for (Padding_cntr_0 = 0; Padding_cntr_0 < (object->ConformanceCount); Padding_cntr_0++) {
6616 0 : PyObject *py_Padding_0;
6617 0 : py_Padding_0 = PyLong_FromLong((uint16_t)((object->Padding)[Padding_cntr_0]));
6618 0 : PyList_SetItem(py_Padding, Padding_cntr_0, py_Padding_0);
6619 : }
6620 : }
6621 0 : return py_Padding;
6622 : }
6623 :
6624 0 : static int py_dcerpc_rts_cmd_Padding_set_Padding(PyObject *py_obj, PyObject *value, void *closure)
6625 : {
6626 0 : struct dcerpc_rts_cmd_Padding *object = pytalloc_get_ptr(py_obj);
6627 0 : if (value == NULL) {
6628 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Padding");
6629 0 : return -1;
6630 : }
6631 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6632 : {
6633 0 : int Padding_cntr_0;
6634 0 : object->Padding = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->Padding, PyList_GET_SIZE(value));
6635 0 : if (!object->Padding) { return -1; }
6636 0 : talloc_set_name_const(object->Padding, "ARRAY: object->Padding");
6637 0 : for (Padding_cntr_0 = 0; Padding_cntr_0 < PyList_GET_SIZE(value); Padding_cntr_0++) {
6638 0 : if (PyList_GET_ITEM(value, Padding_cntr_0) == NULL) {
6639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->Padding)[Padding_cntr_0]");
6640 0 : return -1;
6641 : }
6642 : {
6643 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->Padding)[Padding_cntr_0]));
6644 0 : if (PyLong_Check(PyList_GET_ITEM(value, Padding_cntr_0))) {
6645 0 : unsigned long long test_var;
6646 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, Padding_cntr_0));
6647 0 : if (PyErr_Occurred() != NULL) {
6648 0 : return -1;
6649 : }
6650 0 : if (test_var > uint_max) {
6651 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6652 : PyLong_Type.tp_name, uint_max, test_var);
6653 0 : return -1;
6654 : }
6655 0 : (object->Padding)[Padding_cntr_0] = test_var;
6656 : } else {
6657 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6658 : PyLong_Type.tp_name);
6659 0 : return -1;
6660 : }
6661 : }
6662 : }
6663 : }
6664 0 : return 0;
6665 : }
6666 :
6667 : static PyGetSetDef py_dcerpc_rts_cmd_Padding_getsetters[] = {
6668 : {
6669 : .name = discard_const_p(char, "ConformanceCount"),
6670 : .get = py_dcerpc_rts_cmd_Padding_get_ConformanceCount,
6671 : .set = py_dcerpc_rts_cmd_Padding_set_ConformanceCount,
6672 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6673 : },
6674 : {
6675 : .name = discard_const_p(char, "Padding"),
6676 : .get = py_dcerpc_rts_cmd_Padding_get_Padding,
6677 : .set = py_dcerpc_rts_cmd_Padding_set_Padding,
6678 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6679 : },
6680 : { .name = NULL }
6681 : };
6682 :
6683 0 : static PyObject *py_dcerpc_rts_cmd_Padding_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6684 : {
6685 0 : return pytalloc_new(struct dcerpc_rts_cmd_Padding, type);
6686 : }
6687 :
6688 0 : static PyObject *py_dcerpc_rts_cmd_Padding_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6689 : {
6690 0 : struct dcerpc_rts_cmd_Padding *object = pytalloc_get_ptr(py_obj);
6691 0 : PyObject *ret = NULL;
6692 0 : DATA_BLOB blob;
6693 0 : enum ndr_err_code err;
6694 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6695 0 : if (tmp_ctx == NULL) {
6696 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6697 0 : return NULL;
6698 : }
6699 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Padding);
6700 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6701 0 : TALLOC_FREE(tmp_ctx);
6702 0 : PyErr_SetNdrError(err);
6703 0 : return NULL;
6704 : }
6705 :
6706 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6707 0 : TALLOC_FREE(tmp_ctx);
6708 0 : return ret;
6709 : }
6710 :
6711 0 : static PyObject *py_dcerpc_rts_cmd_Padding_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6712 : {
6713 0 : struct dcerpc_rts_cmd_Padding *object = pytalloc_get_ptr(py_obj);
6714 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6715 0 : Py_ssize_t blob_length = 0;
6716 0 : enum ndr_err_code err;
6717 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6718 0 : PyObject *allow_remaining_obj = NULL;
6719 0 : bool allow_remaining = false;
6720 :
6721 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6722 : discard_const_p(char *, kwnames),
6723 : &blob.data, &blob_length,
6724 : &allow_remaining_obj)) {
6725 0 : return NULL;
6726 : }
6727 0 : blob.length = blob_length;
6728 :
6729 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6730 0 : allow_remaining = true;
6731 : }
6732 :
6733 0 : if (allow_remaining) {
6734 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Padding);
6735 : } else {
6736 0 : 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);
6737 : }
6738 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6739 0 : PyErr_SetNdrError(err);
6740 0 : return NULL;
6741 : }
6742 :
6743 0 : Py_RETURN_NONE;
6744 : }
6745 :
6746 0 : static PyObject *py_dcerpc_rts_cmd_Padding_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6747 : {
6748 0 : struct dcerpc_rts_cmd_Padding *object = pytalloc_get_ptr(py_obj);
6749 0 : PyObject *ret;
6750 0 : char *retstr;
6751 :
6752 0 : 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);
6753 0 : ret = PyUnicode_FromString(retstr);
6754 0 : talloc_free(retstr);
6755 :
6756 0 : return ret;
6757 : }
6758 :
6759 : static PyMethodDef py_dcerpc_rts_cmd_Padding_methods[] = {
6760 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Padding_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6761 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_Padding_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6762 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Padding_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6763 : { NULL, NULL, 0, NULL }
6764 : };
6765 :
6766 :
6767 : static PyTypeObject dcerpc_rts_cmd_Padding_Type = {
6768 : PyVarObject_HEAD_INIT(NULL, 0)
6769 : .tp_name = "dcerpc.rts_cmd_Padding",
6770 : .tp_getset = py_dcerpc_rts_cmd_Padding_getsetters,
6771 : .tp_methods = py_dcerpc_rts_cmd_Padding_methods,
6772 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6773 : .tp_new = py_dcerpc_rts_cmd_Padding_new,
6774 : };
6775 :
6776 :
6777 0 : static PyObject *py_dcerpc_rts_cmd_NegativeANCE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6778 : {
6779 0 : return pytalloc_new(struct dcerpc_rts_cmd_NegativeANCE, type);
6780 : }
6781 :
6782 0 : static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6783 : {
6784 0 : struct dcerpc_rts_cmd_NegativeANCE *object = pytalloc_get_ptr(py_obj);
6785 0 : PyObject *ret = NULL;
6786 0 : DATA_BLOB blob;
6787 0 : enum ndr_err_code err;
6788 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6789 0 : if (tmp_ctx == NULL) {
6790 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6791 0 : return NULL;
6792 : }
6793 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_NegativeANCE);
6794 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6795 0 : TALLOC_FREE(tmp_ctx);
6796 0 : PyErr_SetNdrError(err);
6797 0 : return NULL;
6798 : }
6799 :
6800 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6801 0 : TALLOC_FREE(tmp_ctx);
6802 0 : return ret;
6803 : }
6804 :
6805 0 : static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6806 : {
6807 0 : struct dcerpc_rts_cmd_NegativeANCE *object = pytalloc_get_ptr(py_obj);
6808 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6809 0 : Py_ssize_t blob_length = 0;
6810 0 : enum ndr_err_code err;
6811 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6812 0 : PyObject *allow_remaining_obj = NULL;
6813 0 : bool allow_remaining = false;
6814 :
6815 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6816 : discard_const_p(char *, kwnames),
6817 : &blob.data, &blob_length,
6818 : &allow_remaining_obj)) {
6819 0 : return NULL;
6820 : }
6821 0 : blob.length = blob_length;
6822 :
6823 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6824 0 : allow_remaining = true;
6825 : }
6826 :
6827 0 : if (allow_remaining) {
6828 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_NegativeANCE);
6829 : } else {
6830 0 : 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);
6831 : }
6832 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6833 0 : PyErr_SetNdrError(err);
6834 0 : return NULL;
6835 : }
6836 :
6837 0 : Py_RETURN_NONE;
6838 : }
6839 :
6840 0 : static PyObject *py_dcerpc_rts_cmd_NegativeANCE_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6841 : {
6842 0 : struct dcerpc_rts_cmd_NegativeANCE *object = pytalloc_get_ptr(py_obj);
6843 0 : PyObject *ret;
6844 0 : char *retstr;
6845 :
6846 0 : 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);
6847 0 : ret = PyUnicode_FromString(retstr);
6848 0 : talloc_free(retstr);
6849 :
6850 0 : return ret;
6851 : }
6852 :
6853 : static PyMethodDef py_dcerpc_rts_cmd_NegativeANCE_methods[] = {
6854 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_NegativeANCE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6855 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_NegativeANCE_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6856 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_NegativeANCE_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6857 : { NULL, NULL, 0, NULL }
6858 : };
6859 :
6860 :
6861 : static PyTypeObject dcerpc_rts_cmd_NegativeANCE_Type = {
6862 : PyVarObject_HEAD_INIT(NULL, 0)
6863 : .tp_name = "dcerpc.rts_cmd_NegativeANCE",
6864 : .tp_getset = NULL,
6865 : .tp_methods = py_dcerpc_rts_cmd_NegativeANCE_methods,
6866 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6867 : .tp_new = py_dcerpc_rts_cmd_NegativeANCE_new,
6868 : };
6869 :
6870 :
6871 0 : static PyObject *py_dcerpc_rts_cmd_ANCE_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6872 : {
6873 0 : return pytalloc_new(struct dcerpc_rts_cmd_ANCE, type);
6874 : }
6875 :
6876 0 : static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6877 : {
6878 0 : struct dcerpc_rts_cmd_ANCE *object = pytalloc_get_ptr(py_obj);
6879 0 : PyObject *ret = NULL;
6880 0 : DATA_BLOB blob;
6881 0 : enum ndr_err_code err;
6882 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6883 0 : if (tmp_ctx == NULL) {
6884 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6885 0 : return NULL;
6886 : }
6887 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ANCE);
6888 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6889 0 : TALLOC_FREE(tmp_ctx);
6890 0 : PyErr_SetNdrError(err);
6891 0 : return NULL;
6892 : }
6893 :
6894 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6895 0 : TALLOC_FREE(tmp_ctx);
6896 0 : return ret;
6897 : }
6898 :
6899 0 : static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6900 : {
6901 0 : struct dcerpc_rts_cmd_ANCE *object = pytalloc_get_ptr(py_obj);
6902 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6903 0 : Py_ssize_t blob_length = 0;
6904 0 : enum ndr_err_code err;
6905 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6906 0 : PyObject *allow_remaining_obj = NULL;
6907 0 : bool allow_remaining = false;
6908 :
6909 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6910 : discard_const_p(char *, kwnames),
6911 : &blob.data, &blob_length,
6912 : &allow_remaining_obj)) {
6913 0 : return NULL;
6914 : }
6915 0 : blob.length = blob_length;
6916 :
6917 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6918 0 : allow_remaining = true;
6919 : }
6920 :
6921 0 : if (allow_remaining) {
6922 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ANCE);
6923 : } else {
6924 0 : 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);
6925 : }
6926 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6927 0 : PyErr_SetNdrError(err);
6928 0 : return NULL;
6929 : }
6930 :
6931 0 : Py_RETURN_NONE;
6932 : }
6933 :
6934 0 : static PyObject *py_dcerpc_rts_cmd_ANCE_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6935 : {
6936 0 : struct dcerpc_rts_cmd_ANCE *object = pytalloc_get_ptr(py_obj);
6937 0 : PyObject *ret;
6938 0 : char *retstr;
6939 :
6940 0 : 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);
6941 0 : ret = PyUnicode_FromString(retstr);
6942 0 : talloc_free(retstr);
6943 :
6944 0 : return ret;
6945 : }
6946 :
6947 : static PyMethodDef py_dcerpc_rts_cmd_ANCE_methods[] = {
6948 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ANCE_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6949 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_ANCE_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6950 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ANCE_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6951 : { NULL, NULL, 0, NULL }
6952 : };
6953 :
6954 :
6955 : static PyTypeObject dcerpc_rts_cmd_ANCE_Type = {
6956 : PyVarObject_HEAD_INIT(NULL, 0)
6957 : .tp_name = "dcerpc.rts_cmd_ANCE",
6958 : .tp_getset = NULL,
6959 : .tp_methods = py_dcerpc_rts_cmd_ANCE_methods,
6960 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6961 : .tp_new = py_dcerpc_rts_cmd_ANCE_new,
6962 : };
6963 :
6964 :
6965 0 : static PyObject *py_dcerpc_rts_cmd_ClientAddress_get_ClientAddress(PyObject *obj, void *closure)
6966 : {
6967 0 : struct dcerpc_rts_cmd_ClientAddress *object = pytalloc_get_ptr(obj);
6968 0 : PyObject *py_ClientAddress;
6969 0 : py_ClientAddress = pytalloc_reference_ex(&ClientAddress_Type, pytalloc_get_mem_ctx(obj), &object->ClientAddress);
6970 0 : return py_ClientAddress;
6971 : }
6972 :
6973 0 : static int py_dcerpc_rts_cmd_ClientAddress_set_ClientAddress(PyObject *py_obj, PyObject *value, void *closure)
6974 : {
6975 0 : struct dcerpc_rts_cmd_ClientAddress *object = pytalloc_get_ptr(py_obj);
6976 0 : if (value == NULL) {
6977 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ClientAddress");
6978 0 : return -1;
6979 : }
6980 0 : PY_CHECK_TYPE(&ClientAddress_Type, value, return -1;);
6981 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6982 0 : PyErr_NoMemory();
6983 0 : return -1;
6984 : }
6985 0 : object->ClientAddress = *(struct ClientAddress *)pytalloc_get_ptr(value);
6986 0 : return 0;
6987 : }
6988 :
6989 : static PyGetSetDef py_dcerpc_rts_cmd_ClientAddress_getsetters[] = {
6990 : {
6991 : .name = discard_const_p(char, "ClientAddress"),
6992 : .get = py_dcerpc_rts_cmd_ClientAddress_get_ClientAddress,
6993 : .set = py_dcerpc_rts_cmd_ClientAddress_set_ClientAddress,
6994 : .doc = discard_const_p(char, "PIDL-generated element of base type ClientAddress")
6995 : },
6996 : { .name = NULL }
6997 : };
6998 :
6999 0 : static PyObject *py_dcerpc_rts_cmd_ClientAddress_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7000 : {
7001 0 : return pytalloc_new(struct dcerpc_rts_cmd_ClientAddress, type);
7002 : }
7003 :
7004 0 : static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7005 : {
7006 0 : struct dcerpc_rts_cmd_ClientAddress *object = pytalloc_get_ptr(py_obj);
7007 0 : PyObject *ret = NULL;
7008 0 : DATA_BLOB blob;
7009 0 : enum ndr_err_code err;
7010 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7011 0 : if (tmp_ctx == NULL) {
7012 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7013 0 : return NULL;
7014 : }
7015 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_ClientAddress);
7016 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7017 0 : TALLOC_FREE(tmp_ctx);
7018 0 : PyErr_SetNdrError(err);
7019 0 : return NULL;
7020 : }
7021 :
7022 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7023 0 : TALLOC_FREE(tmp_ctx);
7024 0 : return ret;
7025 : }
7026 :
7027 0 : static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7028 : {
7029 0 : struct dcerpc_rts_cmd_ClientAddress *object = pytalloc_get_ptr(py_obj);
7030 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7031 0 : Py_ssize_t blob_length = 0;
7032 0 : enum ndr_err_code err;
7033 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7034 0 : PyObject *allow_remaining_obj = NULL;
7035 0 : bool allow_remaining = false;
7036 :
7037 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7038 : discard_const_p(char *, kwnames),
7039 : &blob.data, &blob_length,
7040 : &allow_remaining_obj)) {
7041 0 : return NULL;
7042 : }
7043 0 : blob.length = blob_length;
7044 :
7045 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7046 0 : allow_remaining = true;
7047 : }
7048 :
7049 0 : if (allow_remaining) {
7050 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_ClientAddress);
7051 : } else {
7052 0 : 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);
7053 : }
7054 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7055 0 : PyErr_SetNdrError(err);
7056 0 : return NULL;
7057 : }
7058 :
7059 0 : Py_RETURN_NONE;
7060 : }
7061 :
7062 0 : static PyObject *py_dcerpc_rts_cmd_ClientAddress_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7063 : {
7064 0 : struct dcerpc_rts_cmd_ClientAddress *object = pytalloc_get_ptr(py_obj);
7065 0 : PyObject *ret;
7066 0 : char *retstr;
7067 :
7068 0 : 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);
7069 0 : ret = PyUnicode_FromString(retstr);
7070 0 : talloc_free(retstr);
7071 :
7072 0 : return ret;
7073 : }
7074 :
7075 : static PyMethodDef py_dcerpc_rts_cmd_ClientAddress_methods[] = {
7076 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ClientAddress_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7077 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_ClientAddress_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7078 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ClientAddress_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7079 : { NULL, NULL, 0, NULL }
7080 : };
7081 :
7082 :
7083 : static PyTypeObject dcerpc_rts_cmd_ClientAddress_Type = {
7084 : PyVarObject_HEAD_INIT(NULL, 0)
7085 : .tp_name = "dcerpc.rts_cmd_ClientAddress",
7086 : .tp_getset = py_dcerpc_rts_cmd_ClientAddress_getsetters,
7087 : .tp_methods = py_dcerpc_rts_cmd_ClientAddress_methods,
7088 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7089 : .tp_new = py_dcerpc_rts_cmd_ClientAddress_new,
7090 : };
7091 :
7092 :
7093 0 : static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_get_AssociationGroupId(PyObject *obj, void *closure)
7094 : {
7095 0 : struct dcerpc_rts_cmd_AssociationGroupId *object = pytalloc_get_ptr(obj);
7096 0 : PyObject *py_AssociationGroupId;
7097 0 : py_AssociationGroupId = pytalloc_reference_ex(&RTSCookie_Type, pytalloc_get_mem_ctx(obj), &object->AssociationGroupId);
7098 0 : return py_AssociationGroupId;
7099 : }
7100 :
7101 0 : static int py_dcerpc_rts_cmd_AssociationGroupId_set_AssociationGroupId(PyObject *py_obj, PyObject *value, void *closure)
7102 : {
7103 0 : struct dcerpc_rts_cmd_AssociationGroupId *object = pytalloc_get_ptr(py_obj);
7104 0 : if (value == NULL) {
7105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->AssociationGroupId");
7106 0 : return -1;
7107 : }
7108 0 : PY_CHECK_TYPE(&RTSCookie_Type, value, return -1;);
7109 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7110 0 : PyErr_NoMemory();
7111 0 : return -1;
7112 : }
7113 0 : object->AssociationGroupId = *(struct RTSCookie *)pytalloc_get_ptr(value);
7114 0 : return 0;
7115 : }
7116 :
7117 : static PyGetSetDef py_dcerpc_rts_cmd_AssociationGroupId_getsetters[] = {
7118 : {
7119 : .name = discard_const_p(char, "AssociationGroupId"),
7120 : .get = py_dcerpc_rts_cmd_AssociationGroupId_get_AssociationGroupId,
7121 : .set = py_dcerpc_rts_cmd_AssociationGroupId_set_AssociationGroupId,
7122 : .doc = discard_const_p(char, "PIDL-generated element of base type RTSCookie")
7123 : },
7124 : { .name = NULL }
7125 : };
7126 :
7127 0 : static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7128 : {
7129 0 : return pytalloc_new(struct dcerpc_rts_cmd_AssociationGroupId, type);
7130 : }
7131 :
7132 0 : static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7133 : {
7134 0 : struct dcerpc_rts_cmd_AssociationGroupId *object = pytalloc_get_ptr(py_obj);
7135 0 : PyObject *ret = NULL;
7136 0 : DATA_BLOB blob;
7137 0 : enum ndr_err_code err;
7138 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7139 0 : if (tmp_ctx == NULL) {
7140 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7141 0 : return NULL;
7142 : }
7143 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_AssociationGroupId);
7144 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7145 0 : TALLOC_FREE(tmp_ctx);
7146 0 : PyErr_SetNdrError(err);
7147 0 : return NULL;
7148 : }
7149 :
7150 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7151 0 : TALLOC_FREE(tmp_ctx);
7152 0 : return ret;
7153 : }
7154 :
7155 0 : static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7156 : {
7157 0 : struct dcerpc_rts_cmd_AssociationGroupId *object = pytalloc_get_ptr(py_obj);
7158 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7159 0 : Py_ssize_t blob_length = 0;
7160 0 : enum ndr_err_code err;
7161 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7162 0 : PyObject *allow_remaining_obj = NULL;
7163 0 : bool allow_remaining = false;
7164 :
7165 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7166 : discard_const_p(char *, kwnames),
7167 : &blob.data, &blob_length,
7168 : &allow_remaining_obj)) {
7169 0 : return NULL;
7170 : }
7171 0 : blob.length = blob_length;
7172 :
7173 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7174 0 : allow_remaining = true;
7175 : }
7176 :
7177 0 : if (allow_remaining) {
7178 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_AssociationGroupId);
7179 : } else {
7180 0 : 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);
7181 : }
7182 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7183 0 : PyErr_SetNdrError(err);
7184 0 : return NULL;
7185 : }
7186 :
7187 0 : Py_RETURN_NONE;
7188 : }
7189 :
7190 0 : static PyObject *py_dcerpc_rts_cmd_AssociationGroupId_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7191 : {
7192 0 : struct dcerpc_rts_cmd_AssociationGroupId *object = pytalloc_get_ptr(py_obj);
7193 0 : PyObject *ret;
7194 0 : char *retstr;
7195 :
7196 0 : 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);
7197 0 : ret = PyUnicode_FromString(retstr);
7198 0 : talloc_free(retstr);
7199 :
7200 0 : return ret;
7201 : }
7202 :
7203 : static PyMethodDef py_dcerpc_rts_cmd_AssociationGroupId_methods[] = {
7204 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_AssociationGroupId_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7205 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_AssociationGroupId_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7206 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_AssociationGroupId_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7207 : { NULL, NULL, 0, NULL }
7208 : };
7209 :
7210 :
7211 : static PyTypeObject dcerpc_rts_cmd_AssociationGroupId_Type = {
7212 : PyVarObject_HEAD_INIT(NULL, 0)
7213 : .tp_name = "dcerpc.rts_cmd_AssociationGroupId",
7214 : .tp_getset = py_dcerpc_rts_cmd_AssociationGroupId_getsetters,
7215 : .tp_methods = py_dcerpc_rts_cmd_AssociationGroupId_methods,
7216 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7217 : .tp_new = py_dcerpc_rts_cmd_AssociationGroupId_new,
7218 : };
7219 :
7220 :
7221 0 : static PyObject *py_dcerpc_rts_cmd_Destination_get_ForwardDestination(PyObject *obj, void *closure)
7222 : {
7223 0 : struct dcerpc_rts_cmd_Destination *object = pytalloc_get_ptr(obj);
7224 0 : PyObject *py_ForwardDestination;
7225 0 : py_ForwardDestination = PyLong_FromUnsignedLongLong((uint32_t)(object->ForwardDestination));
7226 0 : return py_ForwardDestination;
7227 : }
7228 :
7229 0 : static int py_dcerpc_rts_cmd_Destination_set_ForwardDestination(PyObject *py_obj, PyObject *value, void *closure)
7230 : {
7231 0 : struct dcerpc_rts_cmd_Destination *object = pytalloc_get_ptr(py_obj);
7232 0 : if (value == NULL) {
7233 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ForwardDestination");
7234 0 : return -1;
7235 : }
7236 : {
7237 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ForwardDestination));
7238 0 : if (PyLong_Check(value)) {
7239 0 : unsigned long long test_var;
7240 0 : test_var = PyLong_AsUnsignedLongLong(value);
7241 0 : if (PyErr_Occurred() != NULL) {
7242 0 : return -1;
7243 : }
7244 0 : if (test_var > uint_max) {
7245 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7246 : PyLong_Type.tp_name, uint_max, test_var);
7247 0 : return -1;
7248 : }
7249 0 : object->ForwardDestination = test_var;
7250 : } else {
7251 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7252 : PyLong_Type.tp_name);
7253 0 : return -1;
7254 : }
7255 : }
7256 0 : return 0;
7257 : }
7258 :
7259 : static PyGetSetDef py_dcerpc_rts_cmd_Destination_getsetters[] = {
7260 : {
7261 : .name = discard_const_p(char, "ForwardDestination"),
7262 : .get = py_dcerpc_rts_cmd_Destination_get_ForwardDestination,
7263 : .set = py_dcerpc_rts_cmd_Destination_set_ForwardDestination,
7264 : .doc = discard_const_p(char, "PIDL-generated element of base type ForwardDestination")
7265 : },
7266 : { .name = NULL }
7267 : };
7268 :
7269 0 : static PyObject *py_dcerpc_rts_cmd_Destination_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7270 : {
7271 0 : return pytalloc_new(struct dcerpc_rts_cmd_Destination, type);
7272 : }
7273 :
7274 0 : static PyObject *py_dcerpc_rts_cmd_Destination_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7275 : {
7276 0 : struct dcerpc_rts_cmd_Destination *object = pytalloc_get_ptr(py_obj);
7277 0 : PyObject *ret = NULL;
7278 0 : DATA_BLOB blob;
7279 0 : enum ndr_err_code err;
7280 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7281 0 : if (tmp_ctx == NULL) {
7282 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7283 0 : return NULL;
7284 : }
7285 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_Destination);
7286 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7287 0 : TALLOC_FREE(tmp_ctx);
7288 0 : PyErr_SetNdrError(err);
7289 0 : return NULL;
7290 : }
7291 :
7292 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7293 0 : TALLOC_FREE(tmp_ctx);
7294 0 : return ret;
7295 : }
7296 :
7297 0 : static PyObject *py_dcerpc_rts_cmd_Destination_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7298 : {
7299 0 : struct dcerpc_rts_cmd_Destination *object = pytalloc_get_ptr(py_obj);
7300 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7301 0 : Py_ssize_t blob_length = 0;
7302 0 : enum ndr_err_code err;
7303 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7304 0 : PyObject *allow_remaining_obj = NULL;
7305 0 : bool allow_remaining = false;
7306 :
7307 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7308 : discard_const_p(char *, kwnames),
7309 : &blob.data, &blob_length,
7310 : &allow_remaining_obj)) {
7311 0 : return NULL;
7312 : }
7313 0 : blob.length = blob_length;
7314 :
7315 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7316 0 : allow_remaining = true;
7317 : }
7318 :
7319 0 : if (allow_remaining) {
7320 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_Destination);
7321 : } else {
7322 0 : 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);
7323 : }
7324 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7325 0 : PyErr_SetNdrError(err);
7326 0 : return NULL;
7327 : }
7328 :
7329 0 : Py_RETURN_NONE;
7330 : }
7331 :
7332 0 : static PyObject *py_dcerpc_rts_cmd_Destination_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7333 : {
7334 0 : struct dcerpc_rts_cmd_Destination *object = pytalloc_get_ptr(py_obj);
7335 0 : PyObject *ret;
7336 0 : char *retstr;
7337 :
7338 0 : 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);
7339 0 : ret = PyUnicode_FromString(retstr);
7340 0 : talloc_free(retstr);
7341 :
7342 0 : return ret;
7343 : }
7344 :
7345 : static PyMethodDef py_dcerpc_rts_cmd_Destination_methods[] = {
7346 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_Destination_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7347 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_Destination_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7348 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_Destination_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7349 : { NULL, NULL, 0, NULL }
7350 : };
7351 :
7352 :
7353 : static PyTypeObject dcerpc_rts_cmd_Destination_Type = {
7354 : PyVarObject_HEAD_INIT(NULL, 0)
7355 : .tp_name = "dcerpc.rts_cmd_Destination",
7356 : .tp_getset = py_dcerpc_rts_cmd_Destination_getsetters,
7357 : .tp_methods = py_dcerpc_rts_cmd_Destination_methods,
7358 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7359 : .tp_new = py_dcerpc_rts_cmd_Destination_new,
7360 : };
7361 :
7362 :
7363 0 : static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_get_PingTrafficSent(PyObject *obj, void *closure)
7364 : {
7365 0 : struct dcerpc_rts_cmd_PingTrafficSentNotify *object = pytalloc_get_ptr(obj);
7366 0 : PyObject *py_PingTrafficSent;
7367 0 : py_PingTrafficSent = PyLong_FromUnsignedLongLong((uint32_t)(object->PingTrafficSent));
7368 0 : return py_PingTrafficSent;
7369 : }
7370 :
7371 0 : static int py_dcerpc_rts_cmd_PingTrafficSentNotify_set_PingTrafficSent(PyObject *py_obj, PyObject *value, void *closure)
7372 : {
7373 0 : struct dcerpc_rts_cmd_PingTrafficSentNotify *object = pytalloc_get_ptr(py_obj);
7374 0 : if (value == NULL) {
7375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->PingTrafficSent");
7376 0 : return -1;
7377 : }
7378 : {
7379 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PingTrafficSent));
7380 0 : if (PyLong_Check(value)) {
7381 0 : unsigned long long test_var;
7382 0 : test_var = PyLong_AsUnsignedLongLong(value);
7383 0 : if (PyErr_Occurred() != NULL) {
7384 0 : return -1;
7385 : }
7386 0 : if (test_var > uint_max) {
7387 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7388 : PyLong_Type.tp_name, uint_max, test_var);
7389 0 : return -1;
7390 : }
7391 0 : object->PingTrafficSent = test_var;
7392 : } else {
7393 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7394 : PyLong_Type.tp_name);
7395 0 : return -1;
7396 : }
7397 : }
7398 0 : return 0;
7399 : }
7400 :
7401 : static PyGetSetDef py_dcerpc_rts_cmd_PingTrafficSentNotify_getsetters[] = {
7402 : {
7403 : .name = discard_const_p(char, "PingTrafficSent"),
7404 : .get = py_dcerpc_rts_cmd_PingTrafficSentNotify_get_PingTrafficSent,
7405 : .set = py_dcerpc_rts_cmd_PingTrafficSentNotify_set_PingTrafficSent,
7406 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7407 : },
7408 : { .name = NULL }
7409 : };
7410 :
7411 0 : static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7412 : {
7413 0 : return pytalloc_new(struct dcerpc_rts_cmd_PingTrafficSentNotify, type);
7414 : }
7415 :
7416 0 : static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7417 : {
7418 0 : struct dcerpc_rts_cmd_PingTrafficSentNotify *object = pytalloc_get_ptr(py_obj);
7419 0 : PyObject *ret = NULL;
7420 0 : DATA_BLOB blob;
7421 0 : enum ndr_err_code err;
7422 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7423 0 : if (tmp_ctx == NULL) {
7424 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7425 0 : return NULL;
7426 : }
7427 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd_PingTrafficSentNotify);
7428 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7429 0 : TALLOC_FREE(tmp_ctx);
7430 0 : PyErr_SetNdrError(err);
7431 0 : return NULL;
7432 : }
7433 :
7434 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7435 0 : TALLOC_FREE(tmp_ctx);
7436 0 : return ret;
7437 : }
7438 :
7439 0 : static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7440 : {
7441 0 : struct dcerpc_rts_cmd_PingTrafficSentNotify *object = pytalloc_get_ptr(py_obj);
7442 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7443 0 : Py_ssize_t blob_length = 0;
7444 0 : enum ndr_err_code err;
7445 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7446 0 : PyObject *allow_remaining_obj = NULL;
7447 0 : bool allow_remaining = false;
7448 :
7449 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7450 : discard_const_p(char *, kwnames),
7451 : &blob.data, &blob_length,
7452 : &allow_remaining_obj)) {
7453 0 : return NULL;
7454 : }
7455 0 : blob.length = blob_length;
7456 :
7457 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7458 0 : allow_remaining = true;
7459 : }
7460 :
7461 0 : if (allow_remaining) {
7462 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd_PingTrafficSentNotify);
7463 : } else {
7464 0 : 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);
7465 : }
7466 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7467 0 : PyErr_SetNdrError(err);
7468 0 : return NULL;
7469 : }
7470 :
7471 0 : Py_RETURN_NONE;
7472 : }
7473 :
7474 0 : static PyObject *py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7475 : {
7476 0 : struct dcerpc_rts_cmd_PingTrafficSentNotify *object = pytalloc_get_ptr(py_obj);
7477 0 : PyObject *ret;
7478 0 : char *retstr;
7479 :
7480 0 : 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);
7481 0 : ret = PyUnicode_FromString(retstr);
7482 0 : talloc_free(retstr);
7483 :
7484 0 : return ret;
7485 : }
7486 :
7487 : static PyMethodDef py_dcerpc_rts_cmd_PingTrafficSentNotify_methods[] = {
7488 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7489 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
7490 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_PingTrafficSentNotify_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7491 : { NULL, NULL, 0, NULL }
7492 : };
7493 :
7494 :
7495 : static PyTypeObject dcerpc_rts_cmd_PingTrafficSentNotify_Type = {
7496 : PyVarObject_HEAD_INIT(NULL, 0)
7497 : .tp_name = "dcerpc.rts_cmd_PingTrafficSentNotify",
7498 : .tp_getset = py_dcerpc_rts_cmd_PingTrafficSentNotify_getsetters,
7499 : .tp_methods = py_dcerpc_rts_cmd_PingTrafficSentNotify_methods,
7500 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7501 : .tp_new = py_dcerpc_rts_cmd_PingTrafficSentNotify_new,
7502 : };
7503 :
7504 0 : static PyObject *py_import_dcerpc_rts_cmds(TALLOC_CTX *mem_ctx, int level, union dcerpc_rts_cmds *in)
7505 : {
7506 0 : PyObject *ret;
7507 :
7508 0 : switch (level) {
7509 0 : case 0x0:
7510 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ReceiveWindowSize_Type, mem_ctx, &in->ReceiveWindowSize);
7511 0 : return ret;
7512 :
7513 0 : case 0x1:
7514 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_FlowControlAck_Type, mem_ctx, &in->FlowControlAck);
7515 0 : return ret;
7516 :
7517 0 : case 0x2:
7518 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ConnectionTimeout_Type, mem_ctx, &in->ConnectionTimeout);
7519 0 : return ret;
7520 :
7521 0 : case 0x3:
7522 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Cookie_Type, mem_ctx, &in->Cookie);
7523 0 : return ret;
7524 :
7525 0 : case 0x4:
7526 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ChannelLifetime_Type, mem_ctx, &in->ChannelLifetime);
7527 0 : return ret;
7528 :
7529 0 : case 0x5:
7530 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ClientKeepalive_Type, mem_ctx, &in->ClientKeepalive);
7531 0 : return ret;
7532 :
7533 0 : case 0x6:
7534 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Version_Type, mem_ctx, &in->Version);
7535 0 : return ret;
7536 :
7537 0 : case 0x7:
7538 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Empty_Type, mem_ctx, &in->Empty);
7539 0 : return ret;
7540 :
7541 0 : case 0x8:
7542 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Padding_Type, mem_ctx, &in->Padding);
7543 0 : return ret;
7544 :
7545 0 : case 0x9:
7546 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_NegativeANCE_Type, mem_ctx, &in->NegativeANCE);
7547 0 : return ret;
7548 :
7549 0 : case 0xA:
7550 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ANCE_Type, mem_ctx, &in->ANCE);
7551 0 : return ret;
7552 :
7553 0 : case 0xB:
7554 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_ClientAddress_Type, mem_ctx, &in->ClientAddress);
7555 0 : return ret;
7556 :
7557 0 : case 0xC:
7558 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_AssociationGroupId_Type, mem_ctx, &in->AssociationGroupId);
7559 0 : return ret;
7560 :
7561 0 : case 0xD:
7562 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_Destination_Type, mem_ctx, &in->Destination);
7563 0 : return ret;
7564 :
7565 0 : case 0xE:
7566 0 : ret = pytalloc_reference_ex(&dcerpc_rts_cmd_PingTrafficSentNotify_Type, mem_ctx, &in->PingTrafficSentNotify);
7567 0 : return ret;
7568 :
7569 : }
7570 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
7571 0 : return NULL;
7572 : }
7573 :
7574 0 : static union dcerpc_rts_cmds *py_export_dcerpc_rts_cmds(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7575 : {
7576 0 : union dcerpc_rts_cmds *ret = talloc_zero(mem_ctx, union dcerpc_rts_cmds);
7577 0 : switch (level) {
7578 0 : case 0x0:
7579 0 : if (in == NULL) {
7580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ReceiveWindowSize");
7581 0 : talloc_free(ret); return NULL;
7582 : }
7583 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_ReceiveWindowSize_Type, in, talloc_free(ret); return NULL;);
7584 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7585 0 : PyErr_NoMemory();
7586 0 : talloc_free(ret); return NULL;
7587 : }
7588 0 : ret->ReceiveWindowSize = *(struct dcerpc_rts_cmd_ReceiveWindowSize *)pytalloc_get_ptr(in);
7589 0 : break;
7590 :
7591 0 : case 0x1:
7592 0 : if (in == NULL) {
7593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->FlowControlAck");
7594 0 : talloc_free(ret); return NULL;
7595 : }
7596 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_FlowControlAck_Type, in, talloc_free(ret); return NULL;);
7597 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7598 0 : PyErr_NoMemory();
7599 0 : talloc_free(ret); return NULL;
7600 : }
7601 0 : ret->FlowControlAck = *(struct dcerpc_rts_cmd_FlowControlAck *)pytalloc_get_ptr(in);
7602 0 : break;
7603 :
7604 0 : case 0x2:
7605 0 : if (in == NULL) {
7606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ConnectionTimeout");
7607 0 : talloc_free(ret); return NULL;
7608 : }
7609 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_ConnectionTimeout_Type, in, talloc_free(ret); return NULL;);
7610 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7611 0 : PyErr_NoMemory();
7612 0 : talloc_free(ret); return NULL;
7613 : }
7614 0 : ret->ConnectionTimeout = *(struct dcerpc_rts_cmd_ConnectionTimeout *)pytalloc_get_ptr(in);
7615 0 : break;
7616 :
7617 0 : case 0x3:
7618 0 : if (in == NULL) {
7619 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->Cookie");
7620 0 : talloc_free(ret); return NULL;
7621 : }
7622 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_Cookie_Type, in, talloc_free(ret); return NULL;);
7623 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7624 0 : PyErr_NoMemory();
7625 0 : talloc_free(ret); return NULL;
7626 : }
7627 0 : ret->Cookie = *(struct dcerpc_rts_cmd_Cookie *)pytalloc_get_ptr(in);
7628 0 : break;
7629 :
7630 0 : case 0x4:
7631 0 : if (in == NULL) {
7632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ChannelLifetime");
7633 0 : talloc_free(ret); return NULL;
7634 : }
7635 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_ChannelLifetime_Type, in, talloc_free(ret); return NULL;);
7636 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7637 0 : PyErr_NoMemory();
7638 0 : talloc_free(ret); return NULL;
7639 : }
7640 0 : ret->ChannelLifetime = *(struct dcerpc_rts_cmd_ChannelLifetime *)pytalloc_get_ptr(in);
7641 0 : break;
7642 :
7643 0 : case 0x5:
7644 0 : if (in == NULL) {
7645 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ClientKeepalive");
7646 0 : talloc_free(ret); return NULL;
7647 : }
7648 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_ClientKeepalive_Type, in, talloc_free(ret); return NULL;);
7649 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7650 0 : PyErr_NoMemory();
7651 0 : talloc_free(ret); return NULL;
7652 : }
7653 0 : ret->ClientKeepalive = *(struct dcerpc_rts_cmd_ClientKeepalive *)pytalloc_get_ptr(in);
7654 0 : break;
7655 :
7656 0 : case 0x6:
7657 0 : if (in == NULL) {
7658 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->Version");
7659 0 : talloc_free(ret); return NULL;
7660 : }
7661 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_Version_Type, in, talloc_free(ret); return NULL;);
7662 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7663 0 : PyErr_NoMemory();
7664 0 : talloc_free(ret); return NULL;
7665 : }
7666 0 : ret->Version = *(struct dcerpc_rts_cmd_Version *)pytalloc_get_ptr(in);
7667 0 : break;
7668 :
7669 0 : case 0x7:
7670 0 : if (in == NULL) {
7671 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->Empty");
7672 0 : talloc_free(ret); return NULL;
7673 : }
7674 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_Empty_Type, in, talloc_free(ret); return NULL;);
7675 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7676 0 : PyErr_NoMemory();
7677 0 : talloc_free(ret); return NULL;
7678 : }
7679 0 : ret->Empty = *(struct dcerpc_rts_cmd_Empty *)pytalloc_get_ptr(in);
7680 0 : break;
7681 :
7682 0 : case 0x8:
7683 0 : if (in == NULL) {
7684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->Padding");
7685 0 : talloc_free(ret); return NULL;
7686 : }
7687 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_Padding_Type, in, talloc_free(ret); return NULL;);
7688 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7689 0 : PyErr_NoMemory();
7690 0 : talloc_free(ret); return NULL;
7691 : }
7692 0 : ret->Padding = *(struct dcerpc_rts_cmd_Padding *)pytalloc_get_ptr(in);
7693 0 : break;
7694 :
7695 0 : case 0x9:
7696 0 : if (in == NULL) {
7697 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->NegativeANCE");
7698 0 : talloc_free(ret); return NULL;
7699 : }
7700 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_NegativeANCE_Type, in, talloc_free(ret); return NULL;);
7701 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7702 0 : PyErr_NoMemory();
7703 0 : talloc_free(ret); return NULL;
7704 : }
7705 0 : ret->NegativeANCE = *(struct dcerpc_rts_cmd_NegativeANCE *)pytalloc_get_ptr(in);
7706 0 : break;
7707 :
7708 0 : case 0xA:
7709 0 : if (in == NULL) {
7710 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ANCE");
7711 0 : talloc_free(ret); return NULL;
7712 : }
7713 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_ANCE_Type, in, talloc_free(ret); return NULL;);
7714 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7715 0 : PyErr_NoMemory();
7716 0 : talloc_free(ret); return NULL;
7717 : }
7718 0 : ret->ANCE = *(struct dcerpc_rts_cmd_ANCE *)pytalloc_get_ptr(in);
7719 0 : break;
7720 :
7721 0 : case 0xB:
7722 0 : if (in == NULL) {
7723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ClientAddress");
7724 0 : talloc_free(ret); return NULL;
7725 : }
7726 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_ClientAddress_Type, in, talloc_free(ret); return NULL;);
7727 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7728 0 : PyErr_NoMemory();
7729 0 : talloc_free(ret); return NULL;
7730 : }
7731 0 : ret->ClientAddress = *(struct dcerpc_rts_cmd_ClientAddress *)pytalloc_get_ptr(in);
7732 0 : break;
7733 :
7734 0 : case 0xC:
7735 0 : if (in == NULL) {
7736 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->AssociationGroupId");
7737 0 : talloc_free(ret); return NULL;
7738 : }
7739 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_AssociationGroupId_Type, in, talloc_free(ret); return NULL;);
7740 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7741 0 : PyErr_NoMemory();
7742 0 : talloc_free(ret); return NULL;
7743 : }
7744 0 : ret->AssociationGroupId = *(struct dcerpc_rts_cmd_AssociationGroupId *)pytalloc_get_ptr(in);
7745 0 : break;
7746 :
7747 0 : case 0xD:
7748 0 : if (in == NULL) {
7749 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->Destination");
7750 0 : talloc_free(ret); return NULL;
7751 : }
7752 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_Destination_Type, in, talloc_free(ret); return NULL;);
7753 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7754 0 : PyErr_NoMemory();
7755 0 : talloc_free(ret); return NULL;
7756 : }
7757 0 : ret->Destination = *(struct dcerpc_rts_cmd_Destination *)pytalloc_get_ptr(in);
7758 0 : break;
7759 :
7760 0 : case 0xE:
7761 0 : if (in == NULL) {
7762 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->PingTrafficSentNotify");
7763 0 : talloc_free(ret); return NULL;
7764 : }
7765 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_PingTrafficSentNotify_Type, in, talloc_free(ret); return NULL;);
7766 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7767 0 : PyErr_NoMemory();
7768 0 : talloc_free(ret); return NULL;
7769 : }
7770 0 : ret->PingTrafficSentNotify = *(struct dcerpc_rts_cmd_PingTrafficSentNotify *)pytalloc_get_ptr(in);
7771 0 : break;
7772 :
7773 0 : default:
7774 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
7775 0 : talloc_free(ret);
7776 0 : ret = NULL;
7777 : }
7778 :
7779 0 : return ret;
7780 : }
7781 :
7782 0 : static PyObject *py_dcerpc_rts_cmds_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7783 : {
7784 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
7785 0 : PyObject *mem_ctx_obj = NULL;
7786 0 : TALLOC_CTX *mem_ctx = NULL;
7787 0 : int level = 0;
7788 0 : PyObject *in_obj = NULL;
7789 0 : union dcerpc_rts_cmds *in = NULL;
7790 :
7791 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
7792 : discard_const_p(char *, kwnames),
7793 : &mem_ctx_obj,
7794 : &level,
7795 : &in_obj)) {
7796 0 : return NULL;
7797 : }
7798 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
7799 0 : if (mem_ctx == NULL) {
7800 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
7801 0 : return NULL;
7802 : }
7803 0 : in = (union dcerpc_rts_cmds *)pytalloc_get_ptr(in_obj);
7804 0 : if (in == NULL) {
7805 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dcerpc_rts_cmds!");
7806 0 : return NULL;
7807 : }
7808 :
7809 0 : return py_import_dcerpc_rts_cmds(mem_ctx, level, in);
7810 : }
7811 :
7812 0 : static PyObject *py_dcerpc_rts_cmds_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7813 : {
7814 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
7815 0 : PyObject *mem_ctx_obj = NULL;
7816 0 : TALLOC_CTX *mem_ctx = NULL;
7817 0 : int level = 0;
7818 0 : PyObject *in = NULL;
7819 0 : union dcerpc_rts_cmds *out = NULL;
7820 :
7821 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
7822 : discard_const_p(char *, kwnames),
7823 : &mem_ctx_obj,
7824 : &level,
7825 : &in)) {
7826 0 : return NULL;
7827 : }
7828 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
7829 0 : if (mem_ctx == NULL) {
7830 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
7831 0 : return NULL;
7832 : }
7833 :
7834 0 : out = py_export_dcerpc_rts_cmds(mem_ctx, level, in);
7835 0 : if (out == NULL) {
7836 0 : return NULL;
7837 : }
7838 :
7839 0 : return pytalloc_GenericObject_reference(out);
7840 : }
7841 :
7842 : static PyMethodDef py_dcerpc_rts_cmds_methods[] = {
7843 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmds_import),
7844 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
7845 : "T.__import__(mem_ctx, level, in) => ret." },
7846 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmds_export),
7847 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
7848 : "T.__export__(mem_ctx, level, in) => ret." },
7849 : { NULL, NULL, 0, NULL }
7850 : };
7851 :
7852 0 : static PyObject *py_dcerpc_rts_cmds_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7853 : {
7854 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
7855 0 : return NULL;
7856 : }
7857 :
7858 :
7859 : static PyTypeObject dcerpc_rts_cmds_Type = {
7860 : PyVarObject_HEAD_INIT(NULL, 0)
7861 : .tp_name = "dcerpc.rts_cmds",
7862 : .tp_getset = NULL,
7863 : .tp_methods = py_dcerpc_rts_cmds_methods,
7864 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7865 : .tp_new = py_dcerpc_rts_cmds_new,
7866 : };
7867 :
7868 :
7869 0 : static PyObject *py_dcerpc_rts_cmd_get_CommandType(PyObject *obj, void *closure)
7870 : {
7871 0 : struct dcerpc_rts_cmd *object = pytalloc_get_ptr(obj);
7872 0 : PyObject *py_CommandType;
7873 0 : py_CommandType = PyLong_FromUnsignedLongLong((uint32_t)(object->CommandType));
7874 0 : return py_CommandType;
7875 : }
7876 :
7877 0 : static int py_dcerpc_rts_cmd_set_CommandType(PyObject *py_obj, PyObject *value, void *closure)
7878 : {
7879 0 : struct dcerpc_rts_cmd *object = pytalloc_get_ptr(py_obj);
7880 0 : if (value == NULL) {
7881 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->CommandType");
7882 0 : return -1;
7883 : }
7884 : {
7885 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->CommandType));
7886 0 : if (PyLong_Check(value)) {
7887 0 : unsigned long long test_var;
7888 0 : test_var = PyLong_AsUnsignedLongLong(value);
7889 0 : if (PyErr_Occurred() != NULL) {
7890 0 : return -1;
7891 : }
7892 0 : if (test_var > uint_max) {
7893 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7894 : PyLong_Type.tp_name, uint_max, test_var);
7895 0 : return -1;
7896 : }
7897 0 : object->CommandType = test_var;
7898 : } else {
7899 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7900 : PyLong_Type.tp_name);
7901 0 : return -1;
7902 : }
7903 : }
7904 0 : return 0;
7905 : }
7906 :
7907 0 : static PyObject *py_dcerpc_rts_cmd_get_Command(PyObject *obj, void *closure)
7908 : {
7909 0 : struct dcerpc_rts_cmd *object = pytalloc_get_ptr(obj);
7910 0 : PyObject *py_Command;
7911 0 : py_Command = pyrpc_import_union(&dcerpc_rts_cmds_Type, pytalloc_get_mem_ctx(obj), object->CommandType, &object->Command, "union dcerpc_rts_cmds");
7912 0 : if (py_Command == NULL) {
7913 0 : return NULL;
7914 : }
7915 0 : return py_Command;
7916 : }
7917 :
7918 0 : static int py_dcerpc_rts_cmd_set_Command(PyObject *py_obj, PyObject *value, void *closure)
7919 : {
7920 0 : struct dcerpc_rts_cmd *object = pytalloc_get_ptr(py_obj);
7921 0 : if (value == NULL) {
7922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Command");
7923 0 : return -1;
7924 : }
7925 : {
7926 0 : union dcerpc_rts_cmds *Command_switch_0;
7927 0 : Command_switch_0 = (union dcerpc_rts_cmds *)pyrpc_export_union(&dcerpc_rts_cmds_Type, pytalloc_get_mem_ctx(py_obj), object->CommandType, value, "union dcerpc_rts_cmds");
7928 0 : if (Command_switch_0 == NULL) {
7929 0 : return -1;
7930 : }
7931 0 : object->Command = *Command_switch_0;
7932 : }
7933 0 : return 0;
7934 : }
7935 :
7936 : static PyGetSetDef py_dcerpc_rts_cmd_getsetters[] = {
7937 : {
7938 : .name = discard_const_p(char, "CommandType"),
7939 : .get = py_dcerpc_rts_cmd_get_CommandType,
7940 : .set = py_dcerpc_rts_cmd_set_CommandType,
7941 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7942 : },
7943 : {
7944 : .name = discard_const_p(char, "Command"),
7945 : .get = py_dcerpc_rts_cmd_get_Command,
7946 : .set = py_dcerpc_rts_cmd_set_Command,
7947 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_rts_cmds")
7948 : },
7949 : { .name = NULL }
7950 : };
7951 :
7952 0 : static PyObject *py_dcerpc_rts_cmd_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7953 : {
7954 0 : return pytalloc_new(struct dcerpc_rts_cmd, type);
7955 : }
7956 :
7957 0 : static PyObject *py_dcerpc_rts_cmd_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7958 : {
7959 0 : struct dcerpc_rts_cmd *object = pytalloc_get_ptr(py_obj);
7960 0 : PyObject *ret = NULL;
7961 0 : DATA_BLOB blob;
7962 0 : enum ndr_err_code err;
7963 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7964 0 : if (tmp_ctx == NULL) {
7965 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7966 0 : return NULL;
7967 : }
7968 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts_cmd);
7969 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7970 0 : TALLOC_FREE(tmp_ctx);
7971 0 : PyErr_SetNdrError(err);
7972 0 : return NULL;
7973 : }
7974 :
7975 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7976 0 : TALLOC_FREE(tmp_ctx);
7977 0 : return ret;
7978 : }
7979 :
7980 0 : static PyObject *py_dcerpc_rts_cmd_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7981 : {
7982 0 : struct dcerpc_rts_cmd *object = pytalloc_get_ptr(py_obj);
7983 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7984 0 : Py_ssize_t blob_length = 0;
7985 0 : enum ndr_err_code err;
7986 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7987 0 : PyObject *allow_remaining_obj = NULL;
7988 0 : bool allow_remaining = false;
7989 :
7990 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7991 : discard_const_p(char *, kwnames),
7992 : &blob.data, &blob_length,
7993 : &allow_remaining_obj)) {
7994 0 : return NULL;
7995 : }
7996 0 : blob.length = blob_length;
7997 :
7998 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7999 0 : allow_remaining = true;
8000 : }
8001 :
8002 0 : if (allow_remaining) {
8003 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd);
8004 : } else {
8005 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts_cmd);
8006 : }
8007 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8008 0 : PyErr_SetNdrError(err);
8009 0 : return NULL;
8010 : }
8011 :
8012 0 : Py_RETURN_NONE;
8013 : }
8014 :
8015 0 : static PyObject *py_dcerpc_rts_cmd_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8016 : {
8017 0 : struct dcerpc_rts_cmd *object = pytalloc_get_ptr(py_obj);
8018 0 : PyObject *ret;
8019 0 : char *retstr;
8020 :
8021 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts_cmd, "dcerpc_rts_cmd", object);
8022 0 : ret = PyUnicode_FromString(retstr);
8023 0 : talloc_free(retstr);
8024 :
8025 0 : return ret;
8026 : }
8027 :
8028 : static PyMethodDef py_dcerpc_rts_cmd_methods[] = {
8029 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_cmd_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8030 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_cmd_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
8031 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_cmd_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
8032 : { NULL, NULL, 0, NULL }
8033 : };
8034 :
8035 :
8036 : static PyTypeObject dcerpc_rts_cmd_Type = {
8037 : PyVarObject_HEAD_INIT(NULL, 0)
8038 : .tp_name = "dcerpc.rts_cmd",
8039 : .tp_getset = py_dcerpc_rts_cmd_getsetters,
8040 : .tp_methods = py_dcerpc_rts_cmd_methods,
8041 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8042 : .tp_new = py_dcerpc_rts_cmd_new,
8043 : };
8044 :
8045 :
8046 0 : static PyObject *py_dcerpc_rts_get_Flags(PyObject *obj, void *closure)
8047 : {
8048 0 : struct dcerpc_rts *object = pytalloc_get_ptr(obj);
8049 0 : PyObject *py_Flags;
8050 0 : py_Flags = PyLong_FromLong((uint16_t)(object->Flags));
8051 0 : return py_Flags;
8052 : }
8053 :
8054 0 : static int py_dcerpc_rts_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
8055 : {
8056 0 : struct dcerpc_rts *object = pytalloc_get_ptr(py_obj);
8057 0 : if (value == NULL) {
8058 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Flags");
8059 0 : return -1;
8060 : }
8061 : {
8062 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Flags));
8063 0 : if (PyLong_Check(value)) {
8064 0 : unsigned long long test_var;
8065 0 : test_var = PyLong_AsUnsignedLongLong(value);
8066 0 : if (PyErr_Occurred() != NULL) {
8067 0 : return -1;
8068 : }
8069 0 : if (test_var > uint_max) {
8070 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8071 : PyLong_Type.tp_name, uint_max, test_var);
8072 0 : return -1;
8073 : }
8074 0 : object->Flags = test_var;
8075 : } else {
8076 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8077 : PyLong_Type.tp_name);
8078 0 : return -1;
8079 : }
8080 : }
8081 0 : return 0;
8082 : }
8083 :
8084 0 : static PyObject *py_dcerpc_rts_get_NumberOfCommands(PyObject *obj, void *closure)
8085 : {
8086 0 : struct dcerpc_rts *object = pytalloc_get_ptr(obj);
8087 0 : PyObject *py_NumberOfCommands;
8088 0 : py_NumberOfCommands = PyLong_FromLong((uint16_t)(object->NumberOfCommands));
8089 0 : return py_NumberOfCommands;
8090 : }
8091 :
8092 0 : static int py_dcerpc_rts_set_NumberOfCommands(PyObject *py_obj, PyObject *value, void *closure)
8093 : {
8094 0 : struct dcerpc_rts *object = pytalloc_get_ptr(py_obj);
8095 0 : if (value == NULL) {
8096 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->NumberOfCommands");
8097 0 : return -1;
8098 : }
8099 : {
8100 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->NumberOfCommands));
8101 0 : if (PyLong_Check(value)) {
8102 0 : unsigned long long test_var;
8103 0 : test_var = PyLong_AsUnsignedLongLong(value);
8104 0 : if (PyErr_Occurred() != NULL) {
8105 0 : return -1;
8106 : }
8107 0 : if (test_var > uint_max) {
8108 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8109 : PyLong_Type.tp_name, uint_max, test_var);
8110 0 : return -1;
8111 : }
8112 0 : object->NumberOfCommands = test_var;
8113 : } else {
8114 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8115 : PyLong_Type.tp_name);
8116 0 : return -1;
8117 : }
8118 : }
8119 0 : return 0;
8120 : }
8121 :
8122 0 : static PyObject *py_dcerpc_rts_get_Commands(PyObject *obj, void *closure)
8123 : {
8124 0 : struct dcerpc_rts *object = pytalloc_get_ptr(obj);
8125 0 : PyObject *py_Commands;
8126 0 : py_Commands = PyList_New(object->NumberOfCommands);
8127 0 : if (py_Commands == NULL) {
8128 0 : return NULL;
8129 : }
8130 : {
8131 : int Commands_cntr_0;
8132 0 : for (Commands_cntr_0 = 0; Commands_cntr_0 < (object->NumberOfCommands); Commands_cntr_0++) {
8133 0 : PyObject *py_Commands_0;
8134 0 : py_Commands_0 = pytalloc_reference_ex(&dcerpc_rts_cmd_Type, object->Commands, &(object->Commands)[Commands_cntr_0]);
8135 0 : PyList_SetItem(py_Commands, Commands_cntr_0, py_Commands_0);
8136 : }
8137 : }
8138 0 : return py_Commands;
8139 : }
8140 :
8141 0 : static int py_dcerpc_rts_set_Commands(PyObject *py_obj, PyObject *value, void *closure)
8142 : {
8143 0 : struct dcerpc_rts *object = pytalloc_get_ptr(py_obj);
8144 0 : if (value == NULL) {
8145 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Commands");
8146 0 : return -1;
8147 : }
8148 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8149 : {
8150 0 : int Commands_cntr_0;
8151 0 : object->Commands = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->Commands, PyList_GET_SIZE(value));
8152 0 : if (!object->Commands) { return -1; }
8153 0 : talloc_set_name_const(object->Commands, "ARRAY: object->Commands");
8154 0 : for (Commands_cntr_0 = 0; Commands_cntr_0 < PyList_GET_SIZE(value); Commands_cntr_0++) {
8155 0 : if (PyList_GET_ITEM(value, Commands_cntr_0) == NULL) {
8156 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->Commands)[Commands_cntr_0]");
8157 0 : return -1;
8158 : }
8159 0 : PY_CHECK_TYPE(&dcerpc_rts_cmd_Type, PyList_GET_ITEM(value, Commands_cntr_0), return -1;);
8160 0 : if (talloc_reference(object->Commands, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, Commands_cntr_0))) == NULL) {
8161 0 : PyErr_NoMemory();
8162 0 : return -1;
8163 : }
8164 0 : (object->Commands)[Commands_cntr_0] = *(struct dcerpc_rts_cmd *)pytalloc_get_ptr(PyList_GET_ITEM(value, Commands_cntr_0));
8165 : }
8166 : }
8167 0 : return 0;
8168 : }
8169 :
8170 : static PyGetSetDef py_dcerpc_rts_getsetters[] = {
8171 : {
8172 : .name = discard_const_p(char, "Flags"),
8173 : .get = py_dcerpc_rts_get_Flags,
8174 : .set = py_dcerpc_rts_set_Flags,
8175 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_rts_flags")
8176 : },
8177 : {
8178 : .name = discard_const_p(char, "NumberOfCommands"),
8179 : .get = py_dcerpc_rts_get_NumberOfCommands,
8180 : .set = py_dcerpc_rts_set_NumberOfCommands,
8181 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8182 : },
8183 : {
8184 : .name = discard_const_p(char, "Commands"),
8185 : .get = py_dcerpc_rts_get_Commands,
8186 : .set = py_dcerpc_rts_set_Commands,
8187 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_rts_cmd")
8188 : },
8189 : { .name = NULL }
8190 : };
8191 :
8192 0 : static PyObject *py_dcerpc_rts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8193 : {
8194 0 : return pytalloc_new(struct dcerpc_rts, type);
8195 : }
8196 :
8197 0 : static PyObject *py_dcerpc_rts_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8198 : {
8199 0 : struct dcerpc_rts *object = pytalloc_get_ptr(py_obj);
8200 0 : PyObject *ret = NULL;
8201 0 : DATA_BLOB blob;
8202 0 : enum ndr_err_code err;
8203 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
8204 0 : if (tmp_ctx == NULL) {
8205 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8206 0 : return NULL;
8207 : }
8208 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_rts);
8209 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8210 0 : TALLOC_FREE(tmp_ctx);
8211 0 : PyErr_SetNdrError(err);
8212 0 : return NULL;
8213 : }
8214 :
8215 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8216 0 : TALLOC_FREE(tmp_ctx);
8217 0 : return ret;
8218 : }
8219 :
8220 0 : static PyObject *py_dcerpc_rts_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8221 : {
8222 0 : struct dcerpc_rts *object = pytalloc_get_ptr(py_obj);
8223 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
8224 0 : Py_ssize_t blob_length = 0;
8225 0 : enum ndr_err_code err;
8226 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8227 0 : PyObject *allow_remaining_obj = NULL;
8228 0 : bool allow_remaining = false;
8229 :
8230 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
8231 : discard_const_p(char *, kwnames),
8232 : &blob.data, &blob_length,
8233 : &allow_remaining_obj)) {
8234 0 : return NULL;
8235 : }
8236 0 : blob.length = blob_length;
8237 :
8238 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8239 0 : allow_remaining = true;
8240 : }
8241 :
8242 0 : if (allow_remaining) {
8243 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts);
8244 : } else {
8245 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_rts);
8246 : }
8247 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8248 0 : PyErr_SetNdrError(err);
8249 0 : return NULL;
8250 : }
8251 :
8252 0 : Py_RETURN_NONE;
8253 : }
8254 :
8255 0 : static PyObject *py_dcerpc_rts_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8256 : {
8257 0 : struct dcerpc_rts *object = pytalloc_get_ptr(py_obj);
8258 0 : PyObject *ret;
8259 0 : char *retstr;
8260 :
8261 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_dcerpc_rts, "dcerpc_rts", object);
8262 0 : ret = PyUnicode_FromString(retstr);
8263 0 : talloc_free(retstr);
8264 :
8265 0 : return ret;
8266 : }
8267 :
8268 : static PyMethodDef py_dcerpc_rts_methods[] = {
8269 : { "__ndr_pack__", (PyCFunction)py_dcerpc_rts_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8270 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_rts_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
8271 : { "__ndr_print__", (PyCFunction)py_dcerpc_rts_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
8272 : { NULL, NULL, 0, NULL }
8273 : };
8274 :
8275 :
8276 : static PyTypeObject dcerpc_rts_Type = {
8277 : PyVarObject_HEAD_INIT(NULL, 0)
8278 : .tp_name = "dcerpc.rts",
8279 : .tp_getset = py_dcerpc_rts_getsetters,
8280 : .tp_methods = py_dcerpc_rts_methods,
8281 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8282 : .tp_new = py_dcerpc_rts_new,
8283 : };
8284 :
8285 29620 : static PyObject *py_import_dcerpc_payload(TALLOC_CTX *mem_ctx, int level, union dcerpc_payload *in)
8286 : {
8287 0 : PyObject *ret;
8288 :
8289 29620 : switch (level) {
8290 1348 : case DCERPC_PKT_REQUEST:
8291 1348 : ret = pytalloc_reference_ex(&dcerpc_request_Type, mem_ctx, &in->request);
8292 1348 : return ret;
8293 :
8294 0 : case DCERPC_PKT_PING:
8295 0 : ret = pytalloc_reference_ex(&dcerpc_ping_Type, mem_ctx, &in->ping);
8296 0 : return ret;
8297 :
8298 5490 : case DCERPC_PKT_RESPONSE:
8299 5490 : ret = pytalloc_reference_ex(&dcerpc_response_Type, mem_ctx, &in->response);
8300 5490 : return ret;
8301 :
8302 2500 : case DCERPC_PKT_FAULT:
8303 2500 : ret = pytalloc_reference_ex(&dcerpc_fault_Type, mem_ctx, &in->fault);
8304 2500 : return ret;
8305 :
8306 0 : case DCERPC_PKT_WORKING:
8307 0 : ret = pytalloc_reference_ex(&dcerpc_working_Type, mem_ctx, &in->working);
8308 0 : return ret;
8309 :
8310 0 : case DCERPC_PKT_NOCALL:
8311 0 : ret = pytalloc_reference_ex(&dcerpc_fack_Type, mem_ctx, &in->nocall);
8312 0 : return ret;
8313 :
8314 0 : case DCERPC_PKT_REJECT:
8315 0 : ret = pytalloc_reference_ex(&dcerpc_fault_Type, mem_ctx, &in->reject);
8316 0 : return ret;
8317 :
8318 0 : case DCERPC_PKT_ACK:
8319 0 : ret = pytalloc_reference_ex(&dcerpc_ack_Type, mem_ctx, &in->ack);
8320 0 : return ret;
8321 :
8322 0 : case DCERPC_PKT_CL_CANCEL:
8323 0 : ret = pytalloc_reference_ex(&dcerpc_cl_cancel_Type, mem_ctx, &in->cl_cancel);
8324 0 : return ret;
8325 :
8326 0 : case DCERPC_PKT_FACK:
8327 0 : ret = pytalloc_reference_ex(&dcerpc_fack_Type, mem_ctx, &in->fack);
8328 0 : return ret;
8329 :
8330 0 : case DCERPC_PKT_CANCEL_ACK:
8331 0 : ret = pytalloc_reference_ex(&dcerpc_cancel_ack_Type, mem_ctx, &in->cancel_ack);
8332 0 : return ret;
8333 :
8334 1241 : case DCERPC_PKT_BIND:
8335 1241 : ret = pytalloc_reference_ex(&dcerpc_bind_Type, mem_ctx, &in->bind);
8336 1241 : return ret;
8337 :
8338 7674 : case DCERPC_PKT_BIND_ACK:
8339 7674 : ret = pytalloc_reference_ex(&dcerpc_bind_ack_Type, mem_ctx, &in->bind_ack);
8340 7674 : return ret;
8341 :
8342 435 : case DCERPC_PKT_BIND_NAK:
8343 435 : ret = pytalloc_reference_ex(&dcerpc_bind_nak_Type, mem_ctx, &in->bind_nak);
8344 435 : return ret;
8345 :
8346 1359 : case DCERPC_PKT_ALTER:
8347 1359 : ret = pytalloc_reference_ex(&dcerpc_bind_Type, mem_ctx, &in->alter);
8348 1359 : return ret;
8349 :
8350 9573 : case DCERPC_PKT_ALTER_RESP:
8351 9573 : ret = pytalloc_reference_ex(&dcerpc_bind_ack_Type, mem_ctx, &in->alter_resp);
8352 9573 : return ret;
8353 :
8354 0 : case DCERPC_PKT_SHUTDOWN:
8355 0 : ret = pytalloc_reference_ex(&dcerpc_shutdown_Type, mem_ctx, &in->shutdown);
8356 0 : return ret;
8357 :
8358 0 : case DCERPC_PKT_CO_CANCEL:
8359 0 : ret = pytalloc_reference_ex(&dcerpc_co_cancel_Type, mem_ctx, &in->co_cancel);
8360 0 : return ret;
8361 :
8362 0 : case DCERPC_PKT_ORPHANED:
8363 0 : ret = pytalloc_reference_ex(&dcerpc_orphaned_Type, mem_ctx, &in->orphaned);
8364 0 : return ret;
8365 :
8366 0 : case DCERPC_PKT_AUTH3:
8367 0 : ret = pytalloc_reference_ex(&dcerpc_auth3_Type, mem_ctx, &in->auth3);
8368 0 : return ret;
8369 :
8370 0 : case DCERPC_PKT_RTS:
8371 0 : ret = pytalloc_reference_ex(&dcerpc_rts_Type, mem_ctx, &in->rts);
8372 0 : return ret;
8373 :
8374 : }
8375 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
8376 0 : return NULL;
8377 : }
8378 :
8379 5571 : static union dcerpc_payload *py_export_dcerpc_payload(TALLOC_CTX *mem_ctx, int level, PyObject *in)
8380 : {
8381 5571 : union dcerpc_payload *ret = talloc_zero(mem_ctx, union dcerpc_payload);
8382 5571 : switch (level) {
8383 4193 : case DCERPC_PKT_REQUEST:
8384 4193 : if (in == NULL) {
8385 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->request");
8386 0 : talloc_free(ret); return NULL;
8387 : }
8388 4193 : PY_CHECK_TYPE(&dcerpc_request_Type, in, talloc_free(ret); return NULL;);
8389 4193 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8390 0 : PyErr_NoMemory();
8391 0 : talloc_free(ret); return NULL;
8392 : }
8393 4193 : ret->request = *(struct dcerpc_request *)pytalloc_get_ptr(in);
8394 4193 : break;
8395 :
8396 0 : case DCERPC_PKT_PING:
8397 0 : if (in == NULL) {
8398 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ping");
8399 0 : talloc_free(ret); return NULL;
8400 : }
8401 0 : PY_CHECK_TYPE(&dcerpc_ping_Type, in, talloc_free(ret); return NULL;);
8402 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8403 0 : PyErr_NoMemory();
8404 0 : talloc_free(ret); return NULL;
8405 : }
8406 0 : ret->ping = *(struct dcerpc_ping *)pytalloc_get_ptr(in);
8407 0 : break;
8408 :
8409 0 : case DCERPC_PKT_RESPONSE:
8410 0 : if (in == NULL) {
8411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->response");
8412 0 : talloc_free(ret); return NULL;
8413 : }
8414 0 : PY_CHECK_TYPE(&dcerpc_response_Type, in, talloc_free(ret); return NULL;);
8415 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8416 0 : PyErr_NoMemory();
8417 0 : talloc_free(ret); return NULL;
8418 : }
8419 0 : ret->response = *(struct dcerpc_response *)pytalloc_get_ptr(in);
8420 0 : break;
8421 :
8422 0 : case DCERPC_PKT_FAULT:
8423 0 : if (in == NULL) {
8424 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->fault");
8425 0 : talloc_free(ret); return NULL;
8426 : }
8427 0 : PY_CHECK_TYPE(&dcerpc_fault_Type, in, talloc_free(ret); return NULL;);
8428 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8429 0 : PyErr_NoMemory();
8430 0 : talloc_free(ret); return NULL;
8431 : }
8432 0 : ret->fault = *(struct dcerpc_fault *)pytalloc_get_ptr(in);
8433 0 : break;
8434 :
8435 0 : case DCERPC_PKT_WORKING:
8436 0 : if (in == NULL) {
8437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->working");
8438 0 : talloc_free(ret); return NULL;
8439 : }
8440 0 : PY_CHECK_TYPE(&dcerpc_working_Type, in, talloc_free(ret); return NULL;);
8441 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8442 0 : PyErr_NoMemory();
8443 0 : talloc_free(ret); return NULL;
8444 : }
8445 0 : ret->working = *(struct dcerpc_working *)pytalloc_get_ptr(in);
8446 0 : break;
8447 :
8448 0 : case DCERPC_PKT_NOCALL:
8449 0 : if (in == NULL) {
8450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->nocall");
8451 0 : talloc_free(ret); return NULL;
8452 : }
8453 0 : PY_CHECK_TYPE(&dcerpc_fack_Type, in, talloc_free(ret); return NULL;);
8454 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8455 0 : PyErr_NoMemory();
8456 0 : talloc_free(ret); return NULL;
8457 : }
8458 0 : ret->nocall = *(struct dcerpc_fack *)pytalloc_get_ptr(in);
8459 0 : break;
8460 :
8461 0 : case DCERPC_PKT_REJECT:
8462 0 : if (in == NULL) {
8463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->reject");
8464 0 : talloc_free(ret); return NULL;
8465 : }
8466 0 : PY_CHECK_TYPE(&dcerpc_fault_Type, in, talloc_free(ret); return NULL;);
8467 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8468 0 : PyErr_NoMemory();
8469 0 : talloc_free(ret); return NULL;
8470 : }
8471 0 : ret->reject = *(struct dcerpc_fault *)pytalloc_get_ptr(in);
8472 0 : break;
8473 :
8474 0 : case DCERPC_PKT_ACK:
8475 0 : if (in == NULL) {
8476 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->ack");
8477 0 : talloc_free(ret); return NULL;
8478 : }
8479 0 : PY_CHECK_TYPE(&dcerpc_ack_Type, in, talloc_free(ret); return NULL;);
8480 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8481 0 : PyErr_NoMemory();
8482 0 : talloc_free(ret); return NULL;
8483 : }
8484 0 : ret->ack = *(struct dcerpc_ack *)pytalloc_get_ptr(in);
8485 0 : break;
8486 :
8487 0 : case DCERPC_PKT_CL_CANCEL:
8488 0 : if (in == NULL) {
8489 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->cl_cancel");
8490 0 : talloc_free(ret); return NULL;
8491 : }
8492 0 : PY_CHECK_TYPE(&dcerpc_cl_cancel_Type, in, talloc_free(ret); return NULL;);
8493 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8494 0 : PyErr_NoMemory();
8495 0 : talloc_free(ret); return NULL;
8496 : }
8497 0 : ret->cl_cancel = *(struct dcerpc_cl_cancel *)pytalloc_get_ptr(in);
8498 0 : break;
8499 :
8500 0 : case DCERPC_PKT_FACK:
8501 0 : if (in == NULL) {
8502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->fack");
8503 0 : talloc_free(ret); return NULL;
8504 : }
8505 0 : PY_CHECK_TYPE(&dcerpc_fack_Type, in, talloc_free(ret); return NULL;);
8506 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8507 0 : PyErr_NoMemory();
8508 0 : talloc_free(ret); return NULL;
8509 : }
8510 0 : ret->fack = *(struct dcerpc_fack *)pytalloc_get_ptr(in);
8511 0 : break;
8512 :
8513 0 : case DCERPC_PKT_CANCEL_ACK:
8514 0 : if (in == NULL) {
8515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->cancel_ack");
8516 0 : talloc_free(ret); return NULL;
8517 : }
8518 0 : PY_CHECK_TYPE(&dcerpc_cancel_ack_Type, in, talloc_free(ret); return NULL;);
8519 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8520 0 : PyErr_NoMemory();
8521 0 : talloc_free(ret); return NULL;
8522 : }
8523 0 : ret->cancel_ack = *(struct dcerpc_cancel_ack *)pytalloc_get_ptr(in);
8524 0 : break;
8525 :
8526 634 : case DCERPC_PKT_BIND:
8527 634 : if (in == NULL) {
8528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->bind");
8529 0 : talloc_free(ret); return NULL;
8530 : }
8531 634 : PY_CHECK_TYPE(&dcerpc_bind_Type, in, talloc_free(ret); return NULL;);
8532 634 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8533 0 : PyErr_NoMemory();
8534 0 : talloc_free(ret); return NULL;
8535 : }
8536 634 : ret->bind = *(struct dcerpc_bind *)pytalloc_get_ptr(in);
8537 634 : break;
8538 :
8539 0 : case DCERPC_PKT_BIND_ACK:
8540 0 : if (in == NULL) {
8541 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->bind_ack");
8542 0 : talloc_free(ret); return NULL;
8543 : }
8544 0 : PY_CHECK_TYPE(&dcerpc_bind_ack_Type, in, talloc_free(ret); return NULL;);
8545 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8546 0 : PyErr_NoMemory();
8547 0 : talloc_free(ret); return NULL;
8548 : }
8549 0 : ret->bind_ack = *(struct dcerpc_bind_ack *)pytalloc_get_ptr(in);
8550 0 : break;
8551 :
8552 0 : case DCERPC_PKT_BIND_NAK:
8553 0 : if (in == NULL) {
8554 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->bind_nak");
8555 0 : talloc_free(ret); return NULL;
8556 : }
8557 0 : PY_CHECK_TYPE(&dcerpc_bind_nak_Type, in, talloc_free(ret); return NULL;);
8558 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8559 0 : PyErr_NoMemory();
8560 0 : talloc_free(ret); return NULL;
8561 : }
8562 0 : ret->bind_nak = *(struct dcerpc_bind_nak *)pytalloc_get_ptr(in);
8563 0 : break;
8564 :
8565 708 : case DCERPC_PKT_ALTER:
8566 708 : if (in == NULL) {
8567 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->alter");
8568 0 : talloc_free(ret); return NULL;
8569 : }
8570 708 : PY_CHECK_TYPE(&dcerpc_bind_Type, in, talloc_free(ret); return NULL;);
8571 708 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8572 0 : PyErr_NoMemory();
8573 0 : talloc_free(ret); return NULL;
8574 : }
8575 708 : ret->alter = *(struct dcerpc_bind *)pytalloc_get_ptr(in);
8576 708 : break;
8577 :
8578 0 : case DCERPC_PKT_ALTER_RESP:
8579 0 : if (in == NULL) {
8580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->alter_resp");
8581 0 : talloc_free(ret); return NULL;
8582 : }
8583 0 : PY_CHECK_TYPE(&dcerpc_bind_ack_Type, in, talloc_free(ret); return NULL;);
8584 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8585 0 : PyErr_NoMemory();
8586 0 : talloc_free(ret); return NULL;
8587 : }
8588 0 : ret->alter_resp = *(struct dcerpc_bind_ack *)pytalloc_get_ptr(in);
8589 0 : break;
8590 :
8591 0 : case DCERPC_PKT_SHUTDOWN:
8592 0 : if (in == NULL) {
8593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->shutdown");
8594 0 : talloc_free(ret); return NULL;
8595 : }
8596 0 : PY_CHECK_TYPE(&dcerpc_shutdown_Type, in, talloc_free(ret); return NULL;);
8597 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8598 0 : PyErr_NoMemory();
8599 0 : talloc_free(ret); return NULL;
8600 : }
8601 0 : ret->shutdown = *(struct dcerpc_shutdown *)pytalloc_get_ptr(in);
8602 0 : break;
8603 :
8604 6 : case DCERPC_PKT_CO_CANCEL:
8605 6 : if (in == NULL) {
8606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->co_cancel");
8607 0 : talloc_free(ret); return NULL;
8608 : }
8609 6 : PY_CHECK_TYPE(&dcerpc_co_cancel_Type, in, talloc_free(ret); return NULL;);
8610 6 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8611 0 : PyErr_NoMemory();
8612 0 : talloc_free(ret); return NULL;
8613 : }
8614 6 : ret->co_cancel = *(struct dcerpc_co_cancel *)pytalloc_get_ptr(in);
8615 6 : break;
8616 :
8617 15 : case DCERPC_PKT_ORPHANED:
8618 15 : if (in == NULL) {
8619 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->orphaned");
8620 0 : talloc_free(ret); return NULL;
8621 : }
8622 15 : PY_CHECK_TYPE(&dcerpc_orphaned_Type, in, talloc_free(ret); return NULL;);
8623 15 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8624 0 : PyErr_NoMemory();
8625 0 : talloc_free(ret); return NULL;
8626 : }
8627 15 : ret->orphaned = *(struct dcerpc_orphaned *)pytalloc_get_ptr(in);
8628 15 : break;
8629 :
8630 15 : case DCERPC_PKT_AUTH3:
8631 15 : if (in == NULL) {
8632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->auth3");
8633 0 : talloc_free(ret); return NULL;
8634 : }
8635 15 : PY_CHECK_TYPE(&dcerpc_auth3_Type, in, talloc_free(ret); return NULL;);
8636 15 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8637 0 : PyErr_NoMemory();
8638 0 : talloc_free(ret); return NULL;
8639 : }
8640 15 : ret->auth3 = *(struct dcerpc_auth3 *)pytalloc_get_ptr(in);
8641 15 : break;
8642 :
8643 0 : case DCERPC_PKT_RTS:
8644 0 : if (in == NULL) {
8645 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->rts");
8646 0 : talloc_free(ret); return NULL;
8647 : }
8648 0 : PY_CHECK_TYPE(&dcerpc_rts_Type, in, talloc_free(ret); return NULL;);
8649 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8650 0 : PyErr_NoMemory();
8651 0 : talloc_free(ret); return NULL;
8652 : }
8653 0 : ret->rts = *(struct dcerpc_rts *)pytalloc_get_ptr(in);
8654 0 : break;
8655 :
8656 0 : default:
8657 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
8658 0 : talloc_free(ret);
8659 0 : ret = NULL;
8660 : }
8661 :
8662 5571 : return ret;
8663 : }
8664 :
8665 29620 : static PyObject *py_dcerpc_payload_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8666 : {
8667 29620 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
8668 29620 : PyObject *mem_ctx_obj = NULL;
8669 29620 : TALLOC_CTX *mem_ctx = NULL;
8670 29620 : int level = 0;
8671 29620 : PyObject *in_obj = NULL;
8672 29620 : union dcerpc_payload *in = NULL;
8673 :
8674 29620 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
8675 : discard_const_p(char *, kwnames),
8676 : &mem_ctx_obj,
8677 : &level,
8678 : &in_obj)) {
8679 0 : return NULL;
8680 : }
8681 29620 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
8682 29620 : if (mem_ctx == NULL) {
8683 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
8684 0 : return NULL;
8685 : }
8686 29620 : in = (union dcerpc_payload *)pytalloc_get_ptr(in_obj);
8687 29620 : if (in == NULL) {
8688 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dcerpc_payload!");
8689 0 : return NULL;
8690 : }
8691 :
8692 29620 : return py_import_dcerpc_payload(mem_ctx, level, in);
8693 : }
8694 :
8695 5571 : static PyObject *py_dcerpc_payload_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8696 : {
8697 5571 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
8698 5571 : PyObject *mem_ctx_obj = NULL;
8699 5571 : TALLOC_CTX *mem_ctx = NULL;
8700 5571 : int level = 0;
8701 5571 : PyObject *in = NULL;
8702 5571 : union dcerpc_payload *out = NULL;
8703 :
8704 5571 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
8705 : discard_const_p(char *, kwnames),
8706 : &mem_ctx_obj,
8707 : &level,
8708 : &in)) {
8709 0 : return NULL;
8710 : }
8711 5571 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
8712 5571 : if (mem_ctx == NULL) {
8713 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
8714 0 : return NULL;
8715 : }
8716 :
8717 5571 : out = py_export_dcerpc_payload(mem_ctx, level, in);
8718 5571 : if (out == NULL) {
8719 0 : return NULL;
8720 : }
8721 :
8722 5571 : return pytalloc_GenericObject_reference(out);
8723 : }
8724 :
8725 : static PyMethodDef py_dcerpc_payload_methods[] = {
8726 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_payload_import),
8727 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
8728 : "T.__import__(mem_ctx, level, in) => ret." },
8729 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_payload_export),
8730 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
8731 : "T.__export__(mem_ctx, level, in) => ret." },
8732 : { NULL, NULL, 0, NULL }
8733 : };
8734 :
8735 0 : static PyObject *py_dcerpc_payload_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8736 : {
8737 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
8738 0 : return NULL;
8739 : }
8740 :
8741 :
8742 : static PyTypeObject dcerpc_payload_Type = {
8743 : PyVarObject_HEAD_INIT(NULL, 0)
8744 : .tp_name = "dcerpc.payload",
8745 : .tp_getset = NULL,
8746 : .tp_methods = py_dcerpc_payload_methods,
8747 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8748 : .tp_new = py_dcerpc_payload_new,
8749 : };
8750 :
8751 :
8752 2447 : static PyObject *py_ncacn_packet_get_rpc_vers(PyObject *obj, void *closure)
8753 : {
8754 2447 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
8755 0 : PyObject *py_rpc_vers;
8756 2447 : py_rpc_vers = PyLong_FromLong((uint16_t)(object->rpc_vers));
8757 2447 : return py_rpc_vers;
8758 : }
8759 :
8760 5571 : static int py_ncacn_packet_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
8761 : {
8762 5571 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
8763 5571 : if (value == NULL) {
8764 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rpc_vers");
8765 0 : return -1;
8766 : }
8767 : {
8768 5571 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers));
8769 5571 : if (PyLong_Check(value)) {
8770 0 : unsigned long long test_var;
8771 5571 : test_var = PyLong_AsUnsignedLongLong(value);
8772 5571 : if (PyErr_Occurred() != NULL) {
8773 0 : return -1;
8774 : }
8775 5571 : if (test_var > uint_max) {
8776 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8777 : PyLong_Type.tp_name, uint_max, test_var);
8778 0 : return -1;
8779 : }
8780 5571 : object->rpc_vers = test_var;
8781 : } else {
8782 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8783 : PyLong_Type.tp_name);
8784 0 : return -1;
8785 : }
8786 : }
8787 5571 : return 0;
8788 : }
8789 :
8790 2447 : static PyObject *py_ncacn_packet_get_rpc_vers_minor(PyObject *obj, void *closure)
8791 : {
8792 2447 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
8793 0 : PyObject *py_rpc_vers_minor;
8794 2447 : py_rpc_vers_minor = PyLong_FromLong((uint16_t)(object->rpc_vers_minor));
8795 2447 : return py_rpc_vers_minor;
8796 : }
8797 :
8798 5571 : static int py_ncacn_packet_set_rpc_vers_minor(PyObject *py_obj, PyObject *value, void *closure)
8799 : {
8800 5571 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
8801 5571 : if (value == NULL) {
8802 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rpc_vers_minor");
8803 0 : return -1;
8804 : }
8805 : {
8806 5571 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers_minor));
8807 5571 : if (PyLong_Check(value)) {
8808 0 : unsigned long long test_var;
8809 5571 : test_var = PyLong_AsUnsignedLongLong(value);
8810 5571 : if (PyErr_Occurred() != NULL) {
8811 0 : return -1;
8812 : }
8813 5571 : if (test_var > uint_max) {
8814 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8815 : PyLong_Type.tp_name, uint_max, test_var);
8816 0 : return -1;
8817 : }
8818 5571 : object->rpc_vers_minor = test_var;
8819 : } else {
8820 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8821 : PyLong_Type.tp_name);
8822 0 : return -1;
8823 : }
8824 : }
8825 5571 : return 0;
8826 : }
8827 :
8828 2375 : static PyObject *py_ncacn_packet_get_ptype(PyObject *obj, void *closure)
8829 : {
8830 2375 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
8831 0 : PyObject *py_ptype;
8832 2375 : py_ptype = PyLong_FromLong((uint16_t)(object->ptype));
8833 2375 : return py_ptype;
8834 : }
8835 :
8836 5571 : static int py_ncacn_packet_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
8837 : {
8838 5571 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
8839 5571 : if (value == NULL) {
8840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ptype");
8841 0 : return -1;
8842 : }
8843 : {
8844 5571 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ptype));
8845 5571 : if (PyLong_Check(value)) {
8846 0 : unsigned long long test_var;
8847 5571 : test_var = PyLong_AsUnsignedLongLong(value);
8848 5571 : if (PyErr_Occurred() != NULL) {
8849 0 : return -1;
8850 : }
8851 5571 : if (test_var > uint_max) {
8852 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8853 : PyLong_Type.tp_name, uint_max, test_var);
8854 0 : return -1;
8855 : }
8856 5571 : object->ptype = test_var;
8857 : } else {
8858 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8859 : PyLong_Type.tp_name);
8860 0 : return -1;
8861 : }
8862 : }
8863 5571 : return 0;
8864 : }
8865 :
8866 3035 : static PyObject *py_ncacn_packet_get_pfc_flags(PyObject *obj, void *closure)
8867 : {
8868 3035 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
8869 0 : PyObject *py_pfc_flags;
8870 3035 : py_pfc_flags = PyLong_FromLong((uint16_t)(object->pfc_flags));
8871 3035 : return py_pfc_flags;
8872 : }
8873 :
8874 5571 : static int py_ncacn_packet_set_pfc_flags(PyObject *py_obj, PyObject *value, void *closure)
8875 : {
8876 5571 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
8877 5571 : if (value == NULL) {
8878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pfc_flags");
8879 0 : return -1;
8880 : }
8881 : {
8882 5571 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pfc_flags));
8883 5571 : if (PyLong_Check(value)) {
8884 0 : unsigned long long test_var;
8885 5571 : test_var = PyLong_AsUnsignedLongLong(value);
8886 5571 : if (PyErr_Occurred() != NULL) {
8887 0 : return -1;
8888 : }
8889 5571 : if (test_var > uint_max) {
8890 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8891 : PyLong_Type.tp_name, uint_max, test_var);
8892 0 : return -1;
8893 : }
8894 5571 : object->pfc_flags = test_var;
8895 : } else {
8896 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8897 : PyLong_Type.tp_name);
8898 0 : return -1;
8899 : }
8900 : }
8901 5571 : return 0;
8902 : }
8903 :
8904 2372 : static PyObject *py_ncacn_packet_get_drep(PyObject *obj, void *closure)
8905 : {
8906 2372 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
8907 0 : PyObject *py_drep;
8908 2372 : py_drep = PyList_New(4);
8909 2372 : if (py_drep == NULL) {
8910 0 : return NULL;
8911 : }
8912 : {
8913 : int drep_cntr_0;
8914 11860 : for (drep_cntr_0 = 0; drep_cntr_0 < (4); drep_cntr_0++) {
8915 0 : PyObject *py_drep_0;
8916 9488 : py_drep_0 = PyLong_FromLong((uint16_t)((object->drep)[drep_cntr_0]));
8917 9488 : PyList_SetItem(py_drep, drep_cntr_0, py_drep_0);
8918 : }
8919 : }
8920 2372 : return py_drep;
8921 : }
8922 :
8923 5571 : static int py_ncacn_packet_set_drep(PyObject *py_obj, PyObject *value, void *closure)
8924 : {
8925 5571 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
8926 5571 : if (value == NULL) {
8927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->drep");
8928 0 : return -1;
8929 : }
8930 5571 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8931 : {
8932 0 : int drep_cntr_0;
8933 5571 : if (ARRAY_SIZE(object->drep) != PyList_GET_SIZE(value)) {
8934 0 : 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));
8935 0 : return -1;
8936 : }
8937 27855 : for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
8938 22284 : if (PyList_GET_ITEM(value, drep_cntr_0) == NULL) {
8939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->drep)[drep_cntr_0]");
8940 0 : return -1;
8941 : }
8942 : {
8943 22284 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->drep)[drep_cntr_0]));
8944 22284 : if (PyLong_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
8945 0 : unsigned long long test_var;
8946 22284 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, drep_cntr_0));
8947 22284 : if (PyErr_Occurred() != NULL) {
8948 0 : return -1;
8949 : }
8950 22284 : if (test_var > uint_max) {
8951 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8952 : PyLong_Type.tp_name, uint_max, test_var);
8953 0 : return -1;
8954 : }
8955 22284 : (object->drep)[drep_cntr_0] = test_var;
8956 : } else {
8957 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8958 : PyLong_Type.tp_name);
8959 0 : return -1;
8960 : }
8961 : }
8962 : }
8963 : }
8964 5571 : return 0;
8965 : }
8966 :
8967 4936 : static PyObject *py_ncacn_packet_get_frag_length(PyObject *obj, void *closure)
8968 : {
8969 4936 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
8970 0 : PyObject *py_frag_length;
8971 4936 : py_frag_length = PyLong_FromLong((uint16_t)(object->frag_length));
8972 4936 : return py_frag_length;
8973 : }
8974 :
8975 11142 : static int py_ncacn_packet_set_frag_length(PyObject *py_obj, PyObject *value, void *closure)
8976 : {
8977 11142 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
8978 11142 : if (value == NULL) {
8979 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->frag_length");
8980 0 : return -1;
8981 : }
8982 : {
8983 11142 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->frag_length));
8984 11142 : if (PyLong_Check(value)) {
8985 0 : unsigned long long test_var;
8986 11142 : test_var = PyLong_AsUnsignedLongLong(value);
8987 11142 : if (PyErr_Occurred() != NULL) {
8988 0 : return -1;
8989 : }
8990 11142 : if (test_var > uint_max) {
8991 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8992 : PyLong_Type.tp_name, uint_max, test_var);
8993 0 : return -1;
8994 : }
8995 11142 : object->frag_length = test_var;
8996 : } else {
8997 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8998 : PyLong_Type.tp_name);
8999 0 : return -1;
9000 : }
9001 : }
9002 11142 : return 0;
9003 : }
9004 :
9005 5535 : static PyObject *py_ncacn_packet_get_auth_length(PyObject *obj, void *closure)
9006 : {
9007 5535 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
9008 0 : PyObject *py_auth_length;
9009 5535 : py_auth_length = PyLong_FromLong((uint16_t)(object->auth_length));
9010 5535 : return py_auth_length;
9011 : }
9012 :
9013 6264 : static int py_ncacn_packet_set_auth_length(PyObject *py_obj, PyObject *value, void *closure)
9014 : {
9015 6264 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
9016 6264 : if (value == NULL) {
9017 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_length");
9018 0 : return -1;
9019 : }
9020 : {
9021 6264 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_length));
9022 6264 : if (PyLong_Check(value)) {
9023 0 : unsigned long long test_var;
9024 6264 : test_var = PyLong_AsUnsignedLongLong(value);
9025 6264 : if (PyErr_Occurred() != NULL) {
9026 0 : return -1;
9027 : }
9028 6264 : if (test_var > uint_max) {
9029 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9030 : PyLong_Type.tp_name, uint_max, test_var);
9031 0 : return -1;
9032 : }
9033 6264 : object->auth_length = test_var;
9034 : } else {
9035 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9036 : PyLong_Type.tp_name);
9037 0 : return -1;
9038 : }
9039 : }
9040 6264 : return 0;
9041 : }
9042 :
9043 4170 : static PyObject *py_ncacn_packet_get_call_id(PyObject *obj, void *closure)
9044 : {
9045 4170 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
9046 0 : PyObject *py_call_id;
9047 4170 : py_call_id = PyLong_FromUnsignedLongLong((uint32_t)(object->call_id));
9048 4170 : return py_call_id;
9049 : }
9050 :
9051 5571 : static int py_ncacn_packet_set_call_id(PyObject *py_obj, PyObject *value, void *closure)
9052 : {
9053 5571 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
9054 5571 : if (value == NULL) {
9055 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->call_id");
9056 0 : return -1;
9057 : }
9058 : {
9059 5571 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->call_id));
9060 5571 : if (PyLong_Check(value)) {
9061 0 : unsigned long long test_var;
9062 5571 : test_var = PyLong_AsUnsignedLongLong(value);
9063 5571 : if (PyErr_Occurred() != NULL) {
9064 0 : return -1;
9065 : }
9066 5571 : if (test_var > uint_max) {
9067 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9068 : PyLong_Type.tp_name, uint_max, test_var);
9069 0 : return -1;
9070 : }
9071 5571 : object->call_id = test_var;
9072 : } else {
9073 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9074 : PyLong_Type.tp_name);
9075 0 : return -1;
9076 : }
9077 : }
9078 5571 : return 0;
9079 : }
9080 :
9081 29620 : static PyObject *py_ncacn_packet_get_u(PyObject *obj, void *closure)
9082 : {
9083 29620 : struct ncacn_packet *object = pytalloc_get_ptr(obj);
9084 0 : PyObject *py_u;
9085 29620 : py_u = pyrpc_import_union(&dcerpc_payload_Type, pytalloc_get_mem_ctx(obj), object->ptype, &object->u, "union dcerpc_payload");
9086 29620 : if (py_u == NULL) {
9087 0 : return NULL;
9088 : }
9089 29620 : return py_u;
9090 : }
9091 :
9092 5571 : static int py_ncacn_packet_set_u(PyObject *py_obj, PyObject *value, void *closure)
9093 : {
9094 5571 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
9095 5571 : if (value == NULL) {
9096 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->u");
9097 0 : return -1;
9098 : }
9099 : {
9100 0 : union dcerpc_payload *u_switch_0;
9101 5571 : u_switch_0 = (union dcerpc_payload *)pyrpc_export_union(&dcerpc_payload_Type, pytalloc_get_mem_ctx(py_obj), object->ptype, value, "union dcerpc_payload");
9102 5571 : if (u_switch_0 == NULL) {
9103 0 : return -1;
9104 : }
9105 5571 : object->u = *u_switch_0;
9106 : }
9107 5571 : return 0;
9108 : }
9109 :
9110 : static PyGetSetDef py_ncacn_packet_getsetters[] = {
9111 : {
9112 : .name = discard_const_p(char, "rpc_vers"),
9113 : .get = py_ncacn_packet_get_rpc_vers,
9114 : .set = py_ncacn_packet_set_rpc_vers,
9115 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9116 : },
9117 : {
9118 : .name = discard_const_p(char, "rpc_vers_minor"),
9119 : .get = py_ncacn_packet_get_rpc_vers_minor,
9120 : .set = py_ncacn_packet_set_rpc_vers_minor,
9121 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9122 : },
9123 : {
9124 : .name = discard_const_p(char, "ptype"),
9125 : .get = py_ncacn_packet_get_ptype,
9126 : .set = py_ncacn_packet_set_ptype,
9127 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_pkt_type")
9128 : },
9129 : {
9130 : .name = discard_const_p(char, "pfc_flags"),
9131 : .get = py_ncacn_packet_get_pfc_flags,
9132 : .set = py_ncacn_packet_set_pfc_flags,
9133 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_pfc_flags")
9134 : },
9135 : {
9136 : .name = discard_const_p(char, "drep"),
9137 : .get = py_ncacn_packet_get_drep,
9138 : .set = py_ncacn_packet_set_drep,
9139 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9140 : },
9141 : {
9142 : .name = discard_const_p(char, "frag_length"),
9143 : .get = py_ncacn_packet_get_frag_length,
9144 : .set = py_ncacn_packet_set_frag_length,
9145 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9146 : },
9147 : {
9148 : .name = discard_const_p(char, "auth_length"),
9149 : .get = py_ncacn_packet_get_auth_length,
9150 : .set = py_ncacn_packet_set_auth_length,
9151 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9152 : },
9153 : {
9154 : .name = discard_const_p(char, "call_id"),
9155 : .get = py_ncacn_packet_get_call_id,
9156 : .set = py_ncacn_packet_set_call_id,
9157 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9158 : },
9159 : {
9160 : .name = discard_const_p(char, "u"),
9161 : .get = py_ncacn_packet_get_u,
9162 : .set = py_ncacn_packet_set_u,
9163 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_payload")
9164 : },
9165 : { .name = NULL }
9166 : };
9167 :
9168 7946 : static PyObject *py_ncacn_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9169 : {
9170 7946 : return pytalloc_new(struct ncacn_packet, type);
9171 : }
9172 :
9173 11466 : static PyObject *py_ncacn_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9174 : {
9175 11466 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
9176 11466 : PyObject *ret = NULL;
9177 0 : DATA_BLOB blob;
9178 0 : enum ndr_err_code err;
9179 11466 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
9180 11466 : if (tmp_ctx == NULL) {
9181 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9182 0 : return NULL;
9183 : }
9184 11466 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ncacn_packet);
9185 11466 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9186 0 : TALLOC_FREE(tmp_ctx);
9187 0 : PyErr_SetNdrError(err);
9188 0 : return NULL;
9189 : }
9190 :
9191 11466 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9192 11466 : TALLOC_FREE(tmp_ctx);
9193 11466 : return ret;
9194 : }
9195 :
9196 2375 : static PyObject *py_ncacn_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9197 : {
9198 2375 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
9199 2375 : DATA_BLOB blob = {.data = NULL, .length = 0};
9200 2375 : Py_ssize_t blob_length = 0;
9201 0 : enum ndr_err_code err;
9202 2375 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9203 2375 : PyObject *allow_remaining_obj = NULL;
9204 2375 : bool allow_remaining = false;
9205 :
9206 2375 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
9207 : discard_const_p(char *, kwnames),
9208 : &blob.data, &blob_length,
9209 : &allow_remaining_obj)) {
9210 0 : return NULL;
9211 : }
9212 2375 : blob.length = blob_length;
9213 :
9214 2375 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9215 2375 : allow_remaining = true;
9216 : }
9217 :
9218 2375 : if (allow_remaining) {
9219 2375 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncacn_packet);
9220 : } else {
9221 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncacn_packet);
9222 : }
9223 2375 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9224 0 : PyErr_SetNdrError(err);
9225 0 : return NULL;
9226 : }
9227 :
9228 2375 : Py_RETURN_NONE;
9229 : }
9230 :
9231 48 : static PyObject *py_ncacn_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9232 : {
9233 48 : struct ncacn_packet *object = pytalloc_get_ptr(py_obj);
9234 0 : PyObject *ret;
9235 0 : char *retstr;
9236 :
9237 48 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ncacn_packet, "ncacn_packet", object);
9238 48 : ret = PyUnicode_FromString(retstr);
9239 48 : talloc_free(retstr);
9240 :
9241 48 : return ret;
9242 : }
9243 :
9244 : static PyMethodDef py_ncacn_packet_methods[] = {
9245 : { "__ndr_pack__", (PyCFunction)py_ncacn_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9246 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ncacn_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
9247 : { "__ndr_print__", (PyCFunction)py_ncacn_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
9248 : { NULL, NULL, 0, NULL }
9249 : };
9250 :
9251 :
9252 : static PyTypeObject ncacn_packet_Type = {
9253 : PyVarObject_HEAD_INIT(NULL, 0)
9254 : .tp_name = "dcerpc.ncacn_packet",
9255 : .tp_getset = py_ncacn_packet_getsetters,
9256 : .tp_methods = py_ncacn_packet_methods,
9257 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9258 : .tp_new = py_ncacn_packet_new,
9259 : };
9260 :
9261 :
9262 0 : static PyObject *py_ncadg_packet_get_rpc_vers(PyObject *obj, void *closure)
9263 : {
9264 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9265 0 : PyObject *py_rpc_vers;
9266 0 : py_rpc_vers = PyLong_FromLong((uint16_t)(object->rpc_vers));
9267 0 : return py_rpc_vers;
9268 : }
9269 :
9270 0 : static int py_ncadg_packet_set_rpc_vers(PyObject *py_obj, PyObject *value, void *closure)
9271 : {
9272 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9273 0 : if (value == NULL) {
9274 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rpc_vers");
9275 0 : return -1;
9276 : }
9277 : {
9278 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rpc_vers));
9279 0 : if (PyLong_Check(value)) {
9280 0 : unsigned long long test_var;
9281 0 : test_var = PyLong_AsUnsignedLongLong(value);
9282 0 : if (PyErr_Occurred() != NULL) {
9283 0 : return -1;
9284 : }
9285 0 : if (test_var > uint_max) {
9286 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9287 : PyLong_Type.tp_name, uint_max, test_var);
9288 0 : return -1;
9289 : }
9290 0 : object->rpc_vers = test_var;
9291 : } else {
9292 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9293 : PyLong_Type.tp_name);
9294 0 : return -1;
9295 : }
9296 : }
9297 0 : return 0;
9298 : }
9299 :
9300 0 : static PyObject *py_ncadg_packet_get_ptype(PyObject *obj, void *closure)
9301 : {
9302 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9303 0 : PyObject *py_ptype;
9304 0 : py_ptype = PyLong_FromLong((uint16_t)(object->ptype));
9305 0 : return py_ptype;
9306 : }
9307 :
9308 0 : static int py_ncadg_packet_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
9309 : {
9310 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9311 0 : if (value == NULL) {
9312 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ptype");
9313 0 : return -1;
9314 : }
9315 : {
9316 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ptype));
9317 0 : if (PyLong_Check(value)) {
9318 0 : unsigned long long test_var;
9319 0 : test_var = PyLong_AsUnsignedLongLong(value);
9320 0 : if (PyErr_Occurred() != NULL) {
9321 0 : return -1;
9322 : }
9323 0 : if (test_var > uint_max) {
9324 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9325 : PyLong_Type.tp_name, uint_max, test_var);
9326 0 : return -1;
9327 : }
9328 0 : object->ptype = test_var;
9329 : } else {
9330 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9331 : PyLong_Type.tp_name);
9332 0 : return -1;
9333 : }
9334 : }
9335 0 : return 0;
9336 : }
9337 :
9338 0 : static PyObject *py_ncadg_packet_get_pfc_flags(PyObject *obj, void *closure)
9339 : {
9340 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9341 0 : PyObject *py_pfc_flags;
9342 0 : py_pfc_flags = PyLong_FromLong((uint16_t)(object->pfc_flags));
9343 0 : return py_pfc_flags;
9344 : }
9345 :
9346 0 : static int py_ncadg_packet_set_pfc_flags(PyObject *py_obj, PyObject *value, void *closure)
9347 : {
9348 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9349 0 : if (value == NULL) {
9350 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pfc_flags");
9351 0 : return -1;
9352 : }
9353 : {
9354 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pfc_flags));
9355 0 : if (PyLong_Check(value)) {
9356 0 : unsigned long long test_var;
9357 0 : test_var = PyLong_AsUnsignedLongLong(value);
9358 0 : if (PyErr_Occurred() != NULL) {
9359 0 : return -1;
9360 : }
9361 0 : if (test_var > uint_max) {
9362 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9363 : PyLong_Type.tp_name, uint_max, test_var);
9364 0 : return -1;
9365 : }
9366 0 : object->pfc_flags = test_var;
9367 : } else {
9368 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9369 : PyLong_Type.tp_name);
9370 0 : return -1;
9371 : }
9372 : }
9373 0 : return 0;
9374 : }
9375 :
9376 0 : static PyObject *py_ncadg_packet_get_ncadg_flags(PyObject *obj, void *closure)
9377 : {
9378 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9379 0 : PyObject *py_ncadg_flags;
9380 0 : py_ncadg_flags = PyLong_FromLong((uint16_t)(object->ncadg_flags));
9381 0 : return py_ncadg_flags;
9382 : }
9383 :
9384 0 : static int py_ncadg_packet_set_ncadg_flags(PyObject *py_obj, PyObject *value, void *closure)
9385 : {
9386 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9387 0 : if (value == NULL) {
9388 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ncadg_flags");
9389 0 : return -1;
9390 : }
9391 : {
9392 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ncadg_flags));
9393 0 : if (PyLong_Check(value)) {
9394 0 : unsigned long long test_var;
9395 0 : test_var = PyLong_AsUnsignedLongLong(value);
9396 0 : if (PyErr_Occurred() != NULL) {
9397 0 : return -1;
9398 : }
9399 0 : if (test_var > uint_max) {
9400 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9401 : PyLong_Type.tp_name, uint_max, test_var);
9402 0 : return -1;
9403 : }
9404 0 : object->ncadg_flags = test_var;
9405 : } else {
9406 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9407 : PyLong_Type.tp_name);
9408 0 : return -1;
9409 : }
9410 : }
9411 0 : return 0;
9412 : }
9413 :
9414 0 : static PyObject *py_ncadg_packet_get_drep(PyObject *obj, void *closure)
9415 : {
9416 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9417 0 : PyObject *py_drep;
9418 0 : py_drep = PyList_New(3);
9419 0 : if (py_drep == NULL) {
9420 0 : return NULL;
9421 : }
9422 : {
9423 : int drep_cntr_0;
9424 0 : for (drep_cntr_0 = 0; drep_cntr_0 < (3); drep_cntr_0++) {
9425 0 : PyObject *py_drep_0;
9426 0 : py_drep_0 = PyLong_FromLong((uint16_t)((object->drep)[drep_cntr_0]));
9427 0 : PyList_SetItem(py_drep, drep_cntr_0, py_drep_0);
9428 : }
9429 : }
9430 0 : return py_drep;
9431 : }
9432 :
9433 0 : static int py_ncadg_packet_set_drep(PyObject *py_obj, PyObject *value, void *closure)
9434 : {
9435 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9436 0 : if (value == NULL) {
9437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->drep");
9438 0 : return -1;
9439 : }
9440 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9441 : {
9442 0 : int drep_cntr_0;
9443 0 : if (ARRAY_SIZE(object->drep) != PyList_GET_SIZE(value)) {
9444 0 : 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));
9445 0 : return -1;
9446 : }
9447 0 : for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
9448 0 : if (PyList_GET_ITEM(value, drep_cntr_0) == NULL) {
9449 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->drep)[drep_cntr_0]");
9450 0 : return -1;
9451 : }
9452 : {
9453 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->drep)[drep_cntr_0]));
9454 0 : if (PyLong_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
9455 0 : unsigned long long test_var;
9456 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, drep_cntr_0));
9457 0 : if (PyErr_Occurred() != NULL) {
9458 0 : return -1;
9459 : }
9460 0 : if (test_var > uint_max) {
9461 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9462 : PyLong_Type.tp_name, uint_max, test_var);
9463 0 : return -1;
9464 : }
9465 0 : (object->drep)[drep_cntr_0] = test_var;
9466 : } else {
9467 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9468 : PyLong_Type.tp_name);
9469 0 : return -1;
9470 : }
9471 : }
9472 : }
9473 : }
9474 0 : return 0;
9475 : }
9476 :
9477 0 : static PyObject *py_ncadg_packet_get_serial_high(PyObject *obj, void *closure)
9478 : {
9479 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9480 0 : PyObject *py_serial_high;
9481 0 : py_serial_high = PyLong_FromLong((uint16_t)(object->serial_high));
9482 0 : return py_serial_high;
9483 : }
9484 :
9485 0 : static int py_ncadg_packet_set_serial_high(PyObject *py_obj, PyObject *value, void *closure)
9486 : {
9487 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9488 0 : if (value == NULL) {
9489 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->serial_high");
9490 0 : return -1;
9491 : }
9492 : {
9493 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_high));
9494 0 : if (PyLong_Check(value)) {
9495 0 : unsigned long long test_var;
9496 0 : test_var = PyLong_AsUnsignedLongLong(value);
9497 0 : if (PyErr_Occurred() != NULL) {
9498 0 : return -1;
9499 : }
9500 0 : if (test_var > uint_max) {
9501 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9502 : PyLong_Type.tp_name, uint_max, test_var);
9503 0 : return -1;
9504 : }
9505 0 : object->serial_high = test_var;
9506 : } else {
9507 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9508 : PyLong_Type.tp_name);
9509 0 : return -1;
9510 : }
9511 : }
9512 0 : return 0;
9513 : }
9514 :
9515 0 : static PyObject *py_ncadg_packet_get_object(PyObject *obj, void *closure)
9516 : {
9517 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9518 0 : PyObject *py_object;
9519 0 : py_object = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->object);
9520 0 : return py_object;
9521 : }
9522 :
9523 0 : static int py_ncadg_packet_set_object(PyObject *py_obj, PyObject *value, void *closure)
9524 : {
9525 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9526 0 : if (value == NULL) {
9527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->object");
9528 0 : return -1;
9529 : }
9530 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
9531 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9532 0 : PyErr_NoMemory();
9533 0 : return -1;
9534 : }
9535 0 : object->object = *(struct GUID *)pytalloc_get_ptr(value);
9536 0 : return 0;
9537 : }
9538 :
9539 0 : static PyObject *py_ncadg_packet_get_iface(PyObject *obj, void *closure)
9540 : {
9541 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9542 0 : PyObject *py_iface;
9543 0 : py_iface = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->iface);
9544 0 : return py_iface;
9545 : }
9546 :
9547 0 : static int py_ncadg_packet_set_iface(PyObject *py_obj, PyObject *value, void *closure)
9548 : {
9549 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9550 0 : if (value == NULL) {
9551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iface");
9552 0 : return -1;
9553 : }
9554 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
9555 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9556 0 : PyErr_NoMemory();
9557 0 : return -1;
9558 : }
9559 0 : object->iface = *(struct GUID *)pytalloc_get_ptr(value);
9560 0 : return 0;
9561 : }
9562 :
9563 0 : static PyObject *py_ncadg_packet_get_activity(PyObject *obj, void *closure)
9564 : {
9565 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9566 0 : PyObject *py_activity;
9567 0 : py_activity = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->activity);
9568 0 : return py_activity;
9569 : }
9570 :
9571 0 : static int py_ncadg_packet_set_activity(PyObject *py_obj, PyObject *value, void *closure)
9572 : {
9573 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9574 0 : if (value == NULL) {
9575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->activity");
9576 0 : return -1;
9577 : }
9578 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
9579 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9580 0 : PyErr_NoMemory();
9581 0 : return -1;
9582 : }
9583 0 : object->activity = *(struct GUID *)pytalloc_get_ptr(value);
9584 0 : return 0;
9585 : }
9586 :
9587 0 : static PyObject *py_ncadg_packet_get_server_boot(PyObject *obj, void *closure)
9588 : {
9589 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9590 0 : PyObject *py_server_boot;
9591 0 : py_server_boot = PyLong_FromUnsignedLongLong((uint32_t)(object->server_boot));
9592 0 : return py_server_boot;
9593 : }
9594 :
9595 0 : static int py_ncadg_packet_set_server_boot(PyObject *py_obj, PyObject *value, void *closure)
9596 : {
9597 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9598 0 : if (value == NULL) {
9599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_boot");
9600 0 : return -1;
9601 : }
9602 : {
9603 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->server_boot));
9604 0 : if (PyLong_Check(value)) {
9605 0 : unsigned long long test_var;
9606 0 : test_var = PyLong_AsUnsignedLongLong(value);
9607 0 : if (PyErr_Occurred() != NULL) {
9608 0 : return -1;
9609 : }
9610 0 : if (test_var > uint_max) {
9611 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9612 : PyLong_Type.tp_name, uint_max, test_var);
9613 0 : return -1;
9614 : }
9615 0 : object->server_boot = test_var;
9616 : } else {
9617 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9618 : PyLong_Type.tp_name);
9619 0 : return -1;
9620 : }
9621 : }
9622 0 : return 0;
9623 : }
9624 :
9625 0 : static PyObject *py_ncadg_packet_get_iface_version(PyObject *obj, void *closure)
9626 : {
9627 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9628 0 : PyObject *py_iface_version;
9629 0 : py_iface_version = PyLong_FromUnsignedLongLong((uint32_t)(object->iface_version));
9630 0 : return py_iface_version;
9631 : }
9632 :
9633 0 : static int py_ncadg_packet_set_iface_version(PyObject *py_obj, PyObject *value, void *closure)
9634 : {
9635 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9636 0 : if (value == NULL) {
9637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iface_version");
9638 0 : return -1;
9639 : }
9640 : {
9641 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iface_version));
9642 0 : if (PyLong_Check(value)) {
9643 0 : unsigned long long test_var;
9644 0 : test_var = PyLong_AsUnsignedLongLong(value);
9645 0 : if (PyErr_Occurred() != NULL) {
9646 0 : return -1;
9647 : }
9648 0 : if (test_var > uint_max) {
9649 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9650 : PyLong_Type.tp_name, uint_max, test_var);
9651 0 : return -1;
9652 : }
9653 0 : object->iface_version = test_var;
9654 : } else {
9655 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9656 : PyLong_Type.tp_name);
9657 0 : return -1;
9658 : }
9659 : }
9660 0 : return 0;
9661 : }
9662 :
9663 0 : static PyObject *py_ncadg_packet_get_seq_num(PyObject *obj, void *closure)
9664 : {
9665 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9666 0 : PyObject *py_seq_num;
9667 0 : py_seq_num = PyLong_FromUnsignedLongLong((uint32_t)(object->seq_num));
9668 0 : return py_seq_num;
9669 : }
9670 :
9671 0 : static int py_ncadg_packet_set_seq_num(PyObject *py_obj, PyObject *value, void *closure)
9672 : {
9673 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9674 0 : if (value == NULL) {
9675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->seq_num");
9676 0 : return -1;
9677 : }
9678 : {
9679 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->seq_num));
9680 0 : if (PyLong_Check(value)) {
9681 0 : unsigned long long test_var;
9682 0 : test_var = PyLong_AsUnsignedLongLong(value);
9683 0 : if (PyErr_Occurred() != NULL) {
9684 0 : return -1;
9685 : }
9686 0 : if (test_var > uint_max) {
9687 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9688 : PyLong_Type.tp_name, uint_max, test_var);
9689 0 : return -1;
9690 : }
9691 0 : object->seq_num = test_var;
9692 : } else {
9693 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9694 : PyLong_Type.tp_name);
9695 0 : return -1;
9696 : }
9697 : }
9698 0 : return 0;
9699 : }
9700 :
9701 0 : static PyObject *py_ncadg_packet_get_opnum(PyObject *obj, void *closure)
9702 : {
9703 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9704 0 : PyObject *py_opnum;
9705 0 : py_opnum = PyLong_FromLong((uint16_t)(object->opnum));
9706 0 : return py_opnum;
9707 : }
9708 :
9709 0 : static int py_ncadg_packet_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
9710 : {
9711 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9712 0 : if (value == NULL) {
9713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->opnum");
9714 0 : return -1;
9715 : }
9716 : {
9717 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opnum));
9718 0 : if (PyLong_Check(value)) {
9719 0 : unsigned long long test_var;
9720 0 : test_var = PyLong_AsUnsignedLongLong(value);
9721 0 : if (PyErr_Occurred() != NULL) {
9722 0 : return -1;
9723 : }
9724 0 : if (test_var > uint_max) {
9725 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9726 : PyLong_Type.tp_name, uint_max, test_var);
9727 0 : return -1;
9728 : }
9729 0 : object->opnum = test_var;
9730 : } else {
9731 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9732 : PyLong_Type.tp_name);
9733 0 : return -1;
9734 : }
9735 : }
9736 0 : return 0;
9737 : }
9738 :
9739 0 : static PyObject *py_ncadg_packet_get_ihint(PyObject *obj, void *closure)
9740 : {
9741 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9742 0 : PyObject *py_ihint;
9743 0 : py_ihint = PyLong_FromLong((uint16_t)(object->ihint));
9744 0 : return py_ihint;
9745 : }
9746 :
9747 0 : static int py_ncadg_packet_set_ihint(PyObject *py_obj, PyObject *value, void *closure)
9748 : {
9749 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9750 0 : if (value == NULL) {
9751 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ihint");
9752 0 : return -1;
9753 : }
9754 : {
9755 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ihint));
9756 0 : if (PyLong_Check(value)) {
9757 0 : unsigned long long test_var;
9758 0 : test_var = PyLong_AsUnsignedLongLong(value);
9759 0 : if (PyErr_Occurred() != NULL) {
9760 0 : return -1;
9761 : }
9762 0 : if (test_var > uint_max) {
9763 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9764 : PyLong_Type.tp_name, uint_max, test_var);
9765 0 : return -1;
9766 : }
9767 0 : object->ihint = test_var;
9768 : } else {
9769 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9770 : PyLong_Type.tp_name);
9771 0 : return -1;
9772 : }
9773 : }
9774 0 : return 0;
9775 : }
9776 :
9777 0 : static PyObject *py_ncadg_packet_get_ahint(PyObject *obj, void *closure)
9778 : {
9779 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9780 0 : PyObject *py_ahint;
9781 0 : py_ahint = PyLong_FromLong((uint16_t)(object->ahint));
9782 0 : return py_ahint;
9783 : }
9784 :
9785 0 : static int py_ncadg_packet_set_ahint(PyObject *py_obj, PyObject *value, void *closure)
9786 : {
9787 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9788 0 : if (value == NULL) {
9789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ahint");
9790 0 : return -1;
9791 : }
9792 : {
9793 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ahint));
9794 0 : if (PyLong_Check(value)) {
9795 0 : unsigned long long test_var;
9796 0 : test_var = PyLong_AsUnsignedLongLong(value);
9797 0 : if (PyErr_Occurred() != NULL) {
9798 0 : return -1;
9799 : }
9800 0 : if (test_var > uint_max) {
9801 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9802 : PyLong_Type.tp_name, uint_max, test_var);
9803 0 : return -1;
9804 : }
9805 0 : object->ahint = test_var;
9806 : } else {
9807 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9808 : PyLong_Type.tp_name);
9809 0 : return -1;
9810 : }
9811 : }
9812 0 : return 0;
9813 : }
9814 :
9815 0 : static PyObject *py_ncadg_packet_get_len(PyObject *obj, void *closure)
9816 : {
9817 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9818 0 : PyObject *py_len;
9819 0 : py_len = PyLong_FromLong((uint16_t)(object->len));
9820 0 : return py_len;
9821 : }
9822 :
9823 0 : static int py_ncadg_packet_set_len(PyObject *py_obj, PyObject *value, void *closure)
9824 : {
9825 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9826 0 : if (value == NULL) {
9827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->len");
9828 0 : return -1;
9829 : }
9830 : {
9831 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
9832 0 : if (PyLong_Check(value)) {
9833 0 : unsigned long long test_var;
9834 0 : test_var = PyLong_AsUnsignedLongLong(value);
9835 0 : if (PyErr_Occurred() != NULL) {
9836 0 : return -1;
9837 : }
9838 0 : if (test_var > uint_max) {
9839 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9840 : PyLong_Type.tp_name, uint_max, test_var);
9841 0 : return -1;
9842 : }
9843 0 : object->len = test_var;
9844 : } else {
9845 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9846 : PyLong_Type.tp_name);
9847 0 : return -1;
9848 : }
9849 : }
9850 0 : return 0;
9851 : }
9852 :
9853 0 : static PyObject *py_ncadg_packet_get_fragnum(PyObject *obj, void *closure)
9854 : {
9855 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9856 0 : PyObject *py_fragnum;
9857 0 : py_fragnum = PyLong_FromLong((uint16_t)(object->fragnum));
9858 0 : return py_fragnum;
9859 : }
9860 :
9861 0 : static int py_ncadg_packet_set_fragnum(PyObject *py_obj, PyObject *value, void *closure)
9862 : {
9863 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9864 0 : if (value == NULL) {
9865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->fragnum");
9866 0 : return -1;
9867 : }
9868 : {
9869 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fragnum));
9870 0 : if (PyLong_Check(value)) {
9871 0 : unsigned long long test_var;
9872 0 : test_var = PyLong_AsUnsignedLongLong(value);
9873 0 : if (PyErr_Occurred() != NULL) {
9874 0 : return -1;
9875 : }
9876 0 : if (test_var > uint_max) {
9877 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9878 : PyLong_Type.tp_name, uint_max, test_var);
9879 0 : return -1;
9880 : }
9881 0 : object->fragnum = test_var;
9882 : } else {
9883 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9884 : PyLong_Type.tp_name);
9885 0 : return -1;
9886 : }
9887 : }
9888 0 : return 0;
9889 : }
9890 :
9891 0 : static PyObject *py_ncadg_packet_get_auth_proto(PyObject *obj, void *closure)
9892 : {
9893 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9894 0 : PyObject *py_auth_proto;
9895 0 : py_auth_proto = PyLong_FromLong((uint16_t)(object->auth_proto));
9896 0 : return py_auth_proto;
9897 : }
9898 :
9899 0 : static int py_ncadg_packet_set_auth_proto(PyObject *py_obj, PyObject *value, void *closure)
9900 : {
9901 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9902 0 : if (value == NULL) {
9903 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_proto");
9904 0 : return -1;
9905 : }
9906 : {
9907 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_proto));
9908 0 : if (PyLong_Check(value)) {
9909 0 : unsigned long long test_var;
9910 0 : test_var = PyLong_AsUnsignedLongLong(value);
9911 0 : if (PyErr_Occurred() != NULL) {
9912 0 : return -1;
9913 : }
9914 0 : if (test_var > uint_max) {
9915 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9916 : PyLong_Type.tp_name, uint_max, test_var);
9917 0 : return -1;
9918 : }
9919 0 : object->auth_proto = test_var;
9920 : } else {
9921 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9922 : PyLong_Type.tp_name);
9923 0 : return -1;
9924 : }
9925 : }
9926 0 : return 0;
9927 : }
9928 :
9929 0 : static PyObject *py_ncadg_packet_get_serial_low(PyObject *obj, void *closure)
9930 : {
9931 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9932 0 : PyObject *py_serial_low;
9933 0 : py_serial_low = PyLong_FromLong((uint16_t)(object->serial_low));
9934 0 : return py_serial_low;
9935 : }
9936 :
9937 0 : static int py_ncadg_packet_set_serial_low(PyObject *py_obj, PyObject *value, void *closure)
9938 : {
9939 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9940 0 : if (value == NULL) {
9941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->serial_low");
9942 0 : return -1;
9943 : }
9944 : {
9945 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->serial_low));
9946 0 : if (PyLong_Check(value)) {
9947 0 : unsigned long long test_var;
9948 0 : test_var = PyLong_AsUnsignedLongLong(value);
9949 0 : if (PyErr_Occurred() != NULL) {
9950 0 : return -1;
9951 : }
9952 0 : if (test_var > uint_max) {
9953 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9954 : PyLong_Type.tp_name, uint_max, test_var);
9955 0 : return -1;
9956 : }
9957 0 : object->serial_low = test_var;
9958 : } else {
9959 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9960 : PyLong_Type.tp_name);
9961 0 : return -1;
9962 : }
9963 : }
9964 0 : return 0;
9965 : }
9966 :
9967 0 : static PyObject *py_ncadg_packet_get_u(PyObject *obj, void *closure)
9968 : {
9969 0 : struct ncadg_packet *object = pytalloc_get_ptr(obj);
9970 0 : PyObject *py_u;
9971 0 : py_u = pyrpc_import_union(&dcerpc_payload_Type, pytalloc_get_mem_ctx(obj), object->ptype, &object->u, "union dcerpc_payload");
9972 0 : if (py_u == NULL) {
9973 0 : return NULL;
9974 : }
9975 0 : return py_u;
9976 : }
9977 :
9978 0 : static int py_ncadg_packet_set_u(PyObject *py_obj, PyObject *value, void *closure)
9979 : {
9980 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
9981 0 : if (value == NULL) {
9982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->u");
9983 0 : return -1;
9984 : }
9985 : {
9986 0 : union dcerpc_payload *u_switch_0;
9987 0 : u_switch_0 = (union dcerpc_payload *)pyrpc_export_union(&dcerpc_payload_Type, pytalloc_get_mem_ctx(py_obj), object->ptype, value, "union dcerpc_payload");
9988 0 : if (u_switch_0 == NULL) {
9989 0 : return -1;
9990 : }
9991 0 : object->u = *u_switch_0;
9992 : }
9993 0 : return 0;
9994 : }
9995 :
9996 : static PyGetSetDef py_ncadg_packet_getsetters[] = {
9997 : {
9998 : .name = discard_const_p(char, "rpc_vers"),
9999 : .get = py_ncadg_packet_get_rpc_vers,
10000 : .set = py_ncadg_packet_set_rpc_vers,
10001 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10002 : },
10003 : {
10004 : .name = discard_const_p(char, "ptype"),
10005 : .get = py_ncadg_packet_get_ptype,
10006 : .set = py_ncadg_packet_set_ptype,
10007 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10008 : },
10009 : {
10010 : .name = discard_const_p(char, "pfc_flags"),
10011 : .get = py_ncadg_packet_get_pfc_flags,
10012 : .set = py_ncadg_packet_set_pfc_flags,
10013 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10014 : },
10015 : {
10016 : .name = discard_const_p(char, "ncadg_flags"),
10017 : .get = py_ncadg_packet_get_ncadg_flags,
10018 : .set = py_ncadg_packet_set_ncadg_flags,
10019 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10020 : },
10021 : {
10022 : .name = discard_const_p(char, "drep"),
10023 : .get = py_ncadg_packet_get_drep,
10024 : .set = py_ncadg_packet_set_drep,
10025 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10026 : },
10027 : {
10028 : .name = discard_const_p(char, "serial_high"),
10029 : .get = py_ncadg_packet_get_serial_high,
10030 : .set = py_ncadg_packet_set_serial_high,
10031 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10032 : },
10033 : {
10034 : .name = discard_const_p(char, "object"),
10035 : .get = py_ncadg_packet_get_object,
10036 : .set = py_ncadg_packet_set_object,
10037 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
10038 : },
10039 : {
10040 : .name = discard_const_p(char, "iface"),
10041 : .get = py_ncadg_packet_get_iface,
10042 : .set = py_ncadg_packet_set_iface,
10043 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
10044 : },
10045 : {
10046 : .name = discard_const_p(char, "activity"),
10047 : .get = py_ncadg_packet_get_activity,
10048 : .set = py_ncadg_packet_set_activity,
10049 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
10050 : },
10051 : {
10052 : .name = discard_const_p(char, "server_boot"),
10053 : .get = py_ncadg_packet_get_server_boot,
10054 : .set = py_ncadg_packet_set_server_boot,
10055 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10056 : },
10057 : {
10058 : .name = discard_const_p(char, "iface_version"),
10059 : .get = py_ncadg_packet_get_iface_version,
10060 : .set = py_ncadg_packet_set_iface_version,
10061 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10062 : },
10063 : {
10064 : .name = discard_const_p(char, "seq_num"),
10065 : .get = py_ncadg_packet_get_seq_num,
10066 : .set = py_ncadg_packet_set_seq_num,
10067 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10068 : },
10069 : {
10070 : .name = discard_const_p(char, "opnum"),
10071 : .get = py_ncadg_packet_get_opnum,
10072 : .set = py_ncadg_packet_set_opnum,
10073 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10074 : },
10075 : {
10076 : .name = discard_const_p(char, "ihint"),
10077 : .get = py_ncadg_packet_get_ihint,
10078 : .set = py_ncadg_packet_set_ihint,
10079 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10080 : },
10081 : {
10082 : .name = discard_const_p(char, "ahint"),
10083 : .get = py_ncadg_packet_get_ahint,
10084 : .set = py_ncadg_packet_set_ahint,
10085 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10086 : },
10087 : {
10088 : .name = discard_const_p(char, "len"),
10089 : .get = py_ncadg_packet_get_len,
10090 : .set = py_ncadg_packet_set_len,
10091 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10092 : },
10093 : {
10094 : .name = discard_const_p(char, "fragnum"),
10095 : .get = py_ncadg_packet_get_fragnum,
10096 : .set = py_ncadg_packet_set_fragnum,
10097 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10098 : },
10099 : {
10100 : .name = discard_const_p(char, "auth_proto"),
10101 : .get = py_ncadg_packet_get_auth_proto,
10102 : .set = py_ncadg_packet_set_auth_proto,
10103 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10104 : },
10105 : {
10106 : .name = discard_const_p(char, "serial_low"),
10107 : .get = py_ncadg_packet_get_serial_low,
10108 : .set = py_ncadg_packet_set_serial_low,
10109 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10110 : },
10111 : {
10112 : .name = discard_const_p(char, "u"),
10113 : .get = py_ncadg_packet_get_u,
10114 : .set = py_ncadg_packet_set_u,
10115 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_payload")
10116 : },
10117 : { .name = NULL }
10118 : };
10119 :
10120 0 : static PyObject *py_ncadg_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10121 : {
10122 0 : return pytalloc_new(struct ncadg_packet, type);
10123 : }
10124 :
10125 0 : static PyObject *py_ncadg_packet_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10126 : {
10127 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
10128 0 : PyObject *ret = NULL;
10129 0 : DATA_BLOB blob;
10130 0 : enum ndr_err_code err;
10131 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10132 0 : if (tmp_ctx == NULL) {
10133 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10134 0 : return NULL;
10135 : }
10136 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_ncadg_packet);
10137 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10138 0 : TALLOC_FREE(tmp_ctx);
10139 0 : PyErr_SetNdrError(err);
10140 0 : return NULL;
10141 : }
10142 :
10143 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10144 0 : TALLOC_FREE(tmp_ctx);
10145 0 : return ret;
10146 : }
10147 :
10148 0 : static PyObject *py_ncadg_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10149 : {
10150 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
10151 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
10152 0 : Py_ssize_t blob_length = 0;
10153 0 : enum ndr_err_code err;
10154 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10155 0 : PyObject *allow_remaining_obj = NULL;
10156 0 : bool allow_remaining = false;
10157 :
10158 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10159 : discard_const_p(char *, kwnames),
10160 : &blob.data, &blob_length,
10161 : &allow_remaining_obj)) {
10162 0 : return NULL;
10163 : }
10164 0 : blob.length = blob_length;
10165 :
10166 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10167 0 : allow_remaining = true;
10168 : }
10169 :
10170 0 : if (allow_remaining) {
10171 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncadg_packet);
10172 : } else {
10173 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ncadg_packet);
10174 : }
10175 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10176 0 : PyErr_SetNdrError(err);
10177 0 : return NULL;
10178 : }
10179 :
10180 0 : Py_RETURN_NONE;
10181 : }
10182 :
10183 0 : static PyObject *py_ncadg_packet_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10184 : {
10185 0 : struct ncadg_packet *object = pytalloc_get_ptr(py_obj);
10186 0 : PyObject *ret;
10187 0 : char *retstr;
10188 :
10189 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ncadg_packet, "ncadg_packet", object);
10190 0 : ret = PyUnicode_FromString(retstr);
10191 0 : talloc_free(retstr);
10192 :
10193 0 : return ret;
10194 : }
10195 :
10196 : static PyMethodDef py_ncadg_packet_methods[] = {
10197 : { "__ndr_pack__", (PyCFunction)py_ncadg_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10198 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_ncadg_packet_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
10199 : { "__ndr_print__", (PyCFunction)py_ncadg_packet_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10200 : { NULL, NULL, 0, NULL }
10201 : };
10202 :
10203 :
10204 : static PyTypeObject ncadg_packet_Type = {
10205 : PyVarObject_HEAD_INIT(NULL, 0)
10206 : .tp_name = "dcerpc.ncadg_packet",
10207 : .tp_getset = py_ncadg_packet_getsetters,
10208 : .tp_methods = py_ncadg_packet_methods,
10209 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10210 : .tp_new = py_ncadg_packet_new,
10211 : };
10212 :
10213 :
10214 0 : static PyObject *py_dcerpc_sec_vt_pcontext_get_abstract_syntax(PyObject *obj, void *closure)
10215 : {
10216 0 : struct dcerpc_sec_vt_pcontext *object = pytalloc_get_ptr(obj);
10217 0 : PyObject *py_abstract_syntax;
10218 0 : py_abstract_syntax = pytalloc_reference_ex(ndr_syntax_id_Type, pytalloc_get_mem_ctx(obj), &object->abstract_syntax);
10219 0 : return py_abstract_syntax;
10220 : }
10221 :
10222 0 : static int py_dcerpc_sec_vt_pcontext_set_abstract_syntax(PyObject *py_obj, PyObject *value, void *closure)
10223 : {
10224 0 : struct dcerpc_sec_vt_pcontext *object = pytalloc_get_ptr(py_obj);
10225 0 : if (value == NULL) {
10226 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->abstract_syntax");
10227 0 : return -1;
10228 : }
10229 0 : PY_CHECK_TYPE(ndr_syntax_id_Type, value, return -1;);
10230 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10231 0 : PyErr_NoMemory();
10232 0 : return -1;
10233 : }
10234 0 : object->abstract_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
10235 0 : return 0;
10236 : }
10237 :
10238 0 : static PyObject *py_dcerpc_sec_vt_pcontext_get_transfer_syntax(PyObject *obj, void *closure)
10239 : {
10240 0 : struct dcerpc_sec_vt_pcontext *object = pytalloc_get_ptr(obj);
10241 0 : PyObject *py_transfer_syntax;
10242 0 : py_transfer_syntax = pytalloc_reference_ex(ndr_syntax_id_Type, pytalloc_get_mem_ctx(obj), &object->transfer_syntax);
10243 0 : return py_transfer_syntax;
10244 : }
10245 :
10246 0 : static int py_dcerpc_sec_vt_pcontext_set_transfer_syntax(PyObject *py_obj, PyObject *value, void *closure)
10247 : {
10248 0 : struct dcerpc_sec_vt_pcontext *object = pytalloc_get_ptr(py_obj);
10249 0 : if (value == NULL) {
10250 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->transfer_syntax");
10251 0 : return -1;
10252 : }
10253 0 : PY_CHECK_TYPE(ndr_syntax_id_Type, value, return -1;);
10254 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10255 0 : PyErr_NoMemory();
10256 0 : return -1;
10257 : }
10258 0 : object->transfer_syntax = *(struct ndr_syntax_id *)pytalloc_get_ptr(value);
10259 0 : return 0;
10260 : }
10261 :
10262 : static PyGetSetDef py_dcerpc_sec_vt_pcontext_getsetters[] = {
10263 : {
10264 : .name = discard_const_p(char, "abstract_syntax"),
10265 : .get = py_dcerpc_sec_vt_pcontext_get_abstract_syntax,
10266 : .set = py_dcerpc_sec_vt_pcontext_set_abstract_syntax,
10267 : .doc = discard_const_p(char, "PIDL-generated element of base type ndr_syntax_id")
10268 : },
10269 : {
10270 : .name = discard_const_p(char, "transfer_syntax"),
10271 : .get = py_dcerpc_sec_vt_pcontext_get_transfer_syntax,
10272 : .set = py_dcerpc_sec_vt_pcontext_set_transfer_syntax,
10273 : .doc = discard_const_p(char, "PIDL-generated element of base type ndr_syntax_id")
10274 : },
10275 : { .name = NULL }
10276 : };
10277 :
10278 0 : static PyObject *py_dcerpc_sec_vt_pcontext_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10279 : {
10280 0 : return pytalloc_new(struct dcerpc_sec_vt_pcontext, type);
10281 : }
10282 :
10283 :
10284 : static PyTypeObject dcerpc_sec_vt_pcontext_Type = {
10285 : PyVarObject_HEAD_INIT(NULL, 0)
10286 : .tp_name = "dcerpc.sec_vt_pcontext",
10287 : .tp_getset = py_dcerpc_sec_vt_pcontext_getsetters,
10288 : .tp_methods = NULL,
10289 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10290 : .tp_new = py_dcerpc_sec_vt_pcontext_new,
10291 : };
10292 :
10293 :
10294 0 : static PyObject *py_dcerpc_sec_vt_header2_get_ptype(PyObject *obj, void *closure)
10295 : {
10296 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(obj);
10297 0 : PyObject *py_ptype;
10298 0 : py_ptype = PyLong_FromLong((uint16_t)(object->ptype));
10299 0 : return py_ptype;
10300 : }
10301 :
10302 0 : static int py_dcerpc_sec_vt_header2_set_ptype(PyObject *py_obj, PyObject *value, void *closure)
10303 : {
10304 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(py_obj);
10305 0 : if (value == NULL) {
10306 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ptype");
10307 0 : return -1;
10308 : }
10309 : {
10310 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ptype));
10311 0 : if (PyLong_Check(value)) {
10312 0 : unsigned long long test_var;
10313 0 : test_var = PyLong_AsUnsignedLongLong(value);
10314 0 : if (PyErr_Occurred() != NULL) {
10315 0 : return -1;
10316 : }
10317 0 : if (test_var > uint_max) {
10318 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10319 : PyLong_Type.tp_name, uint_max, test_var);
10320 0 : return -1;
10321 : }
10322 0 : object->ptype = test_var;
10323 : } else {
10324 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10325 : PyLong_Type.tp_name);
10326 0 : return -1;
10327 : }
10328 : }
10329 0 : return 0;
10330 : }
10331 :
10332 0 : static PyObject *py_dcerpc_sec_vt_header2_get_reserved1(PyObject *obj, void *closure)
10333 : {
10334 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(obj);
10335 0 : PyObject *py_reserved1;
10336 0 : py_reserved1 = PyLong_FromLong((uint16_t)(object->reserved1));
10337 0 : return py_reserved1;
10338 : }
10339 :
10340 0 : static int py_dcerpc_sec_vt_header2_set_reserved1(PyObject *py_obj, PyObject *value, void *closure)
10341 : {
10342 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(py_obj);
10343 0 : if (value == NULL) {
10344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved1");
10345 0 : return -1;
10346 : }
10347 : {
10348 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved1));
10349 0 : if (PyLong_Check(value)) {
10350 0 : unsigned long long test_var;
10351 0 : test_var = PyLong_AsUnsignedLongLong(value);
10352 0 : if (PyErr_Occurred() != NULL) {
10353 0 : return -1;
10354 : }
10355 0 : if (test_var > uint_max) {
10356 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10357 : PyLong_Type.tp_name, uint_max, test_var);
10358 0 : return -1;
10359 : }
10360 0 : object->reserved1 = test_var;
10361 : } else {
10362 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10363 : PyLong_Type.tp_name);
10364 0 : return -1;
10365 : }
10366 : }
10367 0 : return 0;
10368 : }
10369 :
10370 0 : static PyObject *py_dcerpc_sec_vt_header2_get_reserved2(PyObject *obj, void *closure)
10371 : {
10372 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(obj);
10373 0 : PyObject *py_reserved2;
10374 0 : py_reserved2 = PyLong_FromLong((uint16_t)(object->reserved2));
10375 0 : return py_reserved2;
10376 : }
10377 :
10378 0 : static int py_dcerpc_sec_vt_header2_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
10379 : {
10380 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(py_obj);
10381 0 : if (value == NULL) {
10382 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved2");
10383 0 : return -1;
10384 : }
10385 : {
10386 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved2));
10387 0 : if (PyLong_Check(value)) {
10388 0 : unsigned long long test_var;
10389 0 : test_var = PyLong_AsUnsignedLongLong(value);
10390 0 : if (PyErr_Occurred() != NULL) {
10391 0 : return -1;
10392 : }
10393 0 : if (test_var > uint_max) {
10394 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10395 : PyLong_Type.tp_name, uint_max, test_var);
10396 0 : return -1;
10397 : }
10398 0 : object->reserved2 = test_var;
10399 : } else {
10400 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10401 : PyLong_Type.tp_name);
10402 0 : return -1;
10403 : }
10404 : }
10405 0 : return 0;
10406 : }
10407 :
10408 0 : static PyObject *py_dcerpc_sec_vt_header2_get_drep(PyObject *obj, void *closure)
10409 : {
10410 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(obj);
10411 0 : PyObject *py_drep;
10412 0 : py_drep = PyList_New(4);
10413 0 : if (py_drep == NULL) {
10414 0 : return NULL;
10415 : }
10416 : {
10417 : int drep_cntr_0;
10418 0 : for (drep_cntr_0 = 0; drep_cntr_0 < (4); drep_cntr_0++) {
10419 0 : PyObject *py_drep_0;
10420 0 : py_drep_0 = PyLong_FromLong((uint16_t)((object->drep)[drep_cntr_0]));
10421 0 : PyList_SetItem(py_drep, drep_cntr_0, py_drep_0);
10422 : }
10423 : }
10424 0 : return py_drep;
10425 : }
10426 :
10427 0 : static int py_dcerpc_sec_vt_header2_set_drep(PyObject *py_obj, PyObject *value, void *closure)
10428 : {
10429 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(py_obj);
10430 0 : if (value == NULL) {
10431 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->drep");
10432 0 : return -1;
10433 : }
10434 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10435 : {
10436 0 : int drep_cntr_0;
10437 0 : if (ARRAY_SIZE(object->drep) != PyList_GET_SIZE(value)) {
10438 0 : 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));
10439 0 : return -1;
10440 : }
10441 0 : for (drep_cntr_0 = 0; drep_cntr_0 < PyList_GET_SIZE(value); drep_cntr_0++) {
10442 0 : if (PyList_GET_ITEM(value, drep_cntr_0) == NULL) {
10443 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->drep)[drep_cntr_0]");
10444 0 : return -1;
10445 : }
10446 : {
10447 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->drep)[drep_cntr_0]));
10448 0 : if (PyLong_Check(PyList_GET_ITEM(value, drep_cntr_0))) {
10449 0 : unsigned long long test_var;
10450 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, drep_cntr_0));
10451 0 : if (PyErr_Occurred() != NULL) {
10452 0 : return -1;
10453 : }
10454 0 : if (test_var > uint_max) {
10455 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10456 : PyLong_Type.tp_name, uint_max, test_var);
10457 0 : return -1;
10458 : }
10459 0 : (object->drep)[drep_cntr_0] = test_var;
10460 : } else {
10461 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10462 : PyLong_Type.tp_name);
10463 0 : return -1;
10464 : }
10465 : }
10466 : }
10467 : }
10468 0 : return 0;
10469 : }
10470 :
10471 0 : static PyObject *py_dcerpc_sec_vt_header2_get_call_id(PyObject *obj, void *closure)
10472 : {
10473 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(obj);
10474 0 : PyObject *py_call_id;
10475 0 : py_call_id = PyLong_FromUnsignedLongLong((uint32_t)(object->call_id));
10476 0 : return py_call_id;
10477 : }
10478 :
10479 0 : static int py_dcerpc_sec_vt_header2_set_call_id(PyObject *py_obj, PyObject *value, void *closure)
10480 : {
10481 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(py_obj);
10482 0 : if (value == NULL) {
10483 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->call_id");
10484 0 : return -1;
10485 : }
10486 : {
10487 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->call_id));
10488 0 : if (PyLong_Check(value)) {
10489 0 : unsigned long long test_var;
10490 0 : test_var = PyLong_AsUnsignedLongLong(value);
10491 0 : if (PyErr_Occurred() != NULL) {
10492 0 : return -1;
10493 : }
10494 0 : if (test_var > uint_max) {
10495 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10496 : PyLong_Type.tp_name, uint_max, test_var);
10497 0 : return -1;
10498 : }
10499 0 : object->call_id = test_var;
10500 : } else {
10501 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10502 : PyLong_Type.tp_name);
10503 0 : return -1;
10504 : }
10505 : }
10506 0 : return 0;
10507 : }
10508 :
10509 0 : static PyObject *py_dcerpc_sec_vt_header2_get_context_id(PyObject *obj, void *closure)
10510 : {
10511 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(obj);
10512 0 : PyObject *py_context_id;
10513 0 : py_context_id = PyLong_FromLong((uint16_t)(object->context_id));
10514 0 : return py_context_id;
10515 : }
10516 :
10517 0 : static int py_dcerpc_sec_vt_header2_set_context_id(PyObject *py_obj, PyObject *value, void *closure)
10518 : {
10519 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(py_obj);
10520 0 : if (value == NULL) {
10521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->context_id");
10522 0 : return -1;
10523 : }
10524 : {
10525 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_id));
10526 0 : if (PyLong_Check(value)) {
10527 0 : unsigned long long test_var;
10528 0 : test_var = PyLong_AsUnsignedLongLong(value);
10529 0 : if (PyErr_Occurred() != NULL) {
10530 0 : return -1;
10531 : }
10532 0 : if (test_var > uint_max) {
10533 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10534 : PyLong_Type.tp_name, uint_max, test_var);
10535 0 : return -1;
10536 : }
10537 0 : object->context_id = test_var;
10538 : } else {
10539 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10540 : PyLong_Type.tp_name);
10541 0 : return -1;
10542 : }
10543 : }
10544 0 : return 0;
10545 : }
10546 :
10547 0 : static PyObject *py_dcerpc_sec_vt_header2_get_opnum(PyObject *obj, void *closure)
10548 : {
10549 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(obj);
10550 0 : PyObject *py_opnum;
10551 0 : py_opnum = PyLong_FromLong((uint16_t)(object->opnum));
10552 0 : return py_opnum;
10553 : }
10554 :
10555 0 : static int py_dcerpc_sec_vt_header2_set_opnum(PyObject *py_obj, PyObject *value, void *closure)
10556 : {
10557 0 : struct dcerpc_sec_vt_header2 *object = pytalloc_get_ptr(py_obj);
10558 0 : if (value == NULL) {
10559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->opnum");
10560 0 : return -1;
10561 : }
10562 : {
10563 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opnum));
10564 0 : if (PyLong_Check(value)) {
10565 0 : unsigned long long test_var;
10566 0 : test_var = PyLong_AsUnsignedLongLong(value);
10567 0 : if (PyErr_Occurred() != NULL) {
10568 0 : return -1;
10569 : }
10570 0 : if (test_var > uint_max) {
10571 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10572 : PyLong_Type.tp_name, uint_max, test_var);
10573 0 : return -1;
10574 : }
10575 0 : object->opnum = test_var;
10576 : } else {
10577 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10578 : PyLong_Type.tp_name);
10579 0 : return -1;
10580 : }
10581 : }
10582 0 : return 0;
10583 : }
10584 :
10585 : static PyGetSetDef py_dcerpc_sec_vt_header2_getsetters[] = {
10586 : {
10587 : .name = discard_const_p(char, "ptype"),
10588 : .get = py_dcerpc_sec_vt_header2_get_ptype,
10589 : .set = py_dcerpc_sec_vt_header2_set_ptype,
10590 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_pkt_type")
10591 : },
10592 : {
10593 : .name = discard_const_p(char, "reserved1"),
10594 : .get = py_dcerpc_sec_vt_header2_get_reserved1,
10595 : .set = py_dcerpc_sec_vt_header2_set_reserved1,
10596 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10597 : },
10598 : {
10599 : .name = discard_const_p(char, "reserved2"),
10600 : .get = py_dcerpc_sec_vt_header2_get_reserved2,
10601 : .set = py_dcerpc_sec_vt_header2_set_reserved2,
10602 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10603 : },
10604 : {
10605 : .name = discard_const_p(char, "drep"),
10606 : .get = py_dcerpc_sec_vt_header2_get_drep,
10607 : .set = py_dcerpc_sec_vt_header2_set_drep,
10608 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10609 : },
10610 : {
10611 : .name = discard_const_p(char, "call_id"),
10612 : .get = py_dcerpc_sec_vt_header2_get_call_id,
10613 : .set = py_dcerpc_sec_vt_header2_set_call_id,
10614 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10615 : },
10616 : {
10617 : .name = discard_const_p(char, "context_id"),
10618 : .get = py_dcerpc_sec_vt_header2_get_context_id,
10619 : .set = py_dcerpc_sec_vt_header2_set_context_id,
10620 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10621 : },
10622 : {
10623 : .name = discard_const_p(char, "opnum"),
10624 : .get = py_dcerpc_sec_vt_header2_get_opnum,
10625 : .set = py_dcerpc_sec_vt_header2_set_opnum,
10626 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10627 : },
10628 : { .name = NULL }
10629 : };
10630 :
10631 0 : static PyObject *py_dcerpc_sec_vt_header2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10632 : {
10633 0 : return pytalloc_new(struct dcerpc_sec_vt_header2, type);
10634 : }
10635 :
10636 :
10637 : static PyTypeObject dcerpc_sec_vt_header2_Type = {
10638 : PyVarObject_HEAD_INIT(NULL, 0)
10639 : .tp_name = "dcerpc.sec_vt_header2",
10640 : .tp_getset = py_dcerpc_sec_vt_header2_getsetters,
10641 : .tp_methods = NULL,
10642 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10643 : .tp_new = py_dcerpc_sec_vt_header2_new,
10644 : };
10645 :
10646 0 : static PyObject *py_import_dcerpc_sec_vt_union(TALLOC_CTX *mem_ctx, int level, union dcerpc_sec_vt_union *in)
10647 : {
10648 0 : PyObject *ret;
10649 :
10650 0 : switch (level) {
10651 0 : case DCERPC_SEC_VT_COMMAND_BITMASK1:
10652 0 : ret = PyLong_FromUnsignedLongLong((uint32_t)(in->bitmask1));
10653 0 : return ret;
10654 :
10655 0 : case DCERPC_SEC_VT_COMMAND_PCONTEXT:
10656 0 : ret = pytalloc_reference_ex(&dcerpc_sec_vt_pcontext_Type, mem_ctx, &in->pcontext);
10657 0 : return ret;
10658 :
10659 0 : case DCERPC_SEC_VT_COMMAND_HEADER2:
10660 0 : ret = pytalloc_reference_ex(&dcerpc_sec_vt_header2_Type, mem_ctx, &in->header2);
10661 0 : return ret;
10662 :
10663 0 : default:
10664 0 : ret = PyBytes_FromStringAndSize((char *)(in->_unknown).data, (in->_unknown).length);
10665 0 : return ret;
10666 :
10667 : }
10668 : PyErr_SetString(PyExc_TypeError, "unknown union level");
10669 : return NULL;
10670 : }
10671 :
10672 0 : static union dcerpc_sec_vt_union *py_export_dcerpc_sec_vt_union(TALLOC_CTX *mem_ctx, int level, PyObject *in)
10673 : {
10674 0 : union dcerpc_sec_vt_union *ret = talloc_zero(mem_ctx, union dcerpc_sec_vt_union);
10675 0 : switch (level) {
10676 0 : case DCERPC_SEC_VT_COMMAND_BITMASK1:
10677 0 : if (in == NULL) {
10678 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->bitmask1");
10679 0 : talloc_free(ret); return NULL;
10680 : }
10681 : {
10682 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->bitmask1));
10683 0 : if (PyLong_Check(in)) {
10684 0 : unsigned long long test_var;
10685 0 : test_var = PyLong_AsUnsignedLongLong(in);
10686 0 : if (PyErr_Occurred() != NULL) {
10687 0 : talloc_free(ret); return NULL;
10688 : }
10689 0 : if (test_var > uint_max) {
10690 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10691 : PyLong_Type.tp_name, uint_max, test_var);
10692 0 : talloc_free(ret); return NULL;
10693 : }
10694 0 : ret->bitmask1 = test_var;
10695 : } else {
10696 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10697 : PyLong_Type.tp_name);
10698 0 : talloc_free(ret); return NULL;
10699 : }
10700 : }
10701 0 : break;
10702 :
10703 0 : case DCERPC_SEC_VT_COMMAND_PCONTEXT:
10704 0 : if (in == NULL) {
10705 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->pcontext");
10706 0 : talloc_free(ret); return NULL;
10707 : }
10708 0 : PY_CHECK_TYPE(&dcerpc_sec_vt_pcontext_Type, in, talloc_free(ret); return NULL;);
10709 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10710 0 : PyErr_NoMemory();
10711 0 : talloc_free(ret); return NULL;
10712 : }
10713 0 : ret->pcontext = *(struct dcerpc_sec_vt_pcontext *)pytalloc_get_ptr(in);
10714 0 : break;
10715 :
10716 0 : case DCERPC_SEC_VT_COMMAND_HEADER2:
10717 0 : if (in == NULL) {
10718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->header2");
10719 0 : talloc_free(ret); return NULL;
10720 : }
10721 0 : PY_CHECK_TYPE(&dcerpc_sec_vt_header2_Type, in, talloc_free(ret); return NULL;);
10722 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10723 0 : PyErr_NoMemory();
10724 0 : talloc_free(ret); return NULL;
10725 : }
10726 0 : ret->header2 = *(struct dcerpc_sec_vt_header2 *)pytalloc_get_ptr(in);
10727 0 : break;
10728 :
10729 0 : default:
10730 0 : if (in == NULL) {
10731 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->_unknown");
10732 0 : talloc_free(ret); return NULL;
10733 : }
10734 0 : ret->_unknown = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
10735 0 : break;
10736 :
10737 : }
10738 :
10739 0 : return ret;
10740 : }
10741 :
10742 0 : static PyObject *py_dcerpc_sec_vt_union_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10743 : {
10744 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
10745 0 : PyObject *mem_ctx_obj = NULL;
10746 0 : TALLOC_CTX *mem_ctx = NULL;
10747 0 : int level = 0;
10748 0 : PyObject *in_obj = NULL;
10749 0 : union dcerpc_sec_vt_union *in = NULL;
10750 :
10751 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
10752 : discard_const_p(char *, kwnames),
10753 : &mem_ctx_obj,
10754 : &level,
10755 : &in_obj)) {
10756 0 : return NULL;
10757 : }
10758 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
10759 0 : if (mem_ctx == NULL) {
10760 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
10761 0 : return NULL;
10762 : }
10763 0 : in = (union dcerpc_sec_vt_union *)pytalloc_get_ptr(in_obj);
10764 0 : if (in == NULL) {
10765 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union dcerpc_sec_vt_union!");
10766 0 : return NULL;
10767 : }
10768 :
10769 0 : return py_import_dcerpc_sec_vt_union(mem_ctx, level, in);
10770 : }
10771 :
10772 0 : static PyObject *py_dcerpc_sec_vt_union_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10773 : {
10774 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
10775 0 : PyObject *mem_ctx_obj = NULL;
10776 0 : TALLOC_CTX *mem_ctx = NULL;
10777 0 : int level = 0;
10778 0 : PyObject *in = NULL;
10779 0 : union dcerpc_sec_vt_union *out = NULL;
10780 :
10781 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
10782 : discard_const_p(char *, kwnames),
10783 : &mem_ctx_obj,
10784 : &level,
10785 : &in)) {
10786 0 : return NULL;
10787 : }
10788 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
10789 0 : if (mem_ctx == NULL) {
10790 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
10791 0 : return NULL;
10792 : }
10793 :
10794 0 : out = py_export_dcerpc_sec_vt_union(mem_ctx, level, in);
10795 0 : if (out == NULL) {
10796 0 : return NULL;
10797 : }
10798 :
10799 0 : return pytalloc_GenericObject_reference(out);
10800 : }
10801 :
10802 : static PyMethodDef py_dcerpc_sec_vt_union_methods[] = {
10803 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_sec_vt_union_import),
10804 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
10805 : "T.__import__(mem_ctx, level, in) => ret." },
10806 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_sec_vt_union_export),
10807 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
10808 : "T.__export__(mem_ctx, level, in) => ret." },
10809 : { NULL, NULL, 0, NULL }
10810 : };
10811 :
10812 0 : static PyObject *py_dcerpc_sec_vt_union_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10813 : {
10814 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
10815 0 : return NULL;
10816 : }
10817 :
10818 :
10819 : static PyTypeObject dcerpc_sec_vt_union_Type = {
10820 : PyVarObject_HEAD_INIT(NULL, 0)
10821 : .tp_name = "dcerpc.sec_vt_union",
10822 : .tp_getset = NULL,
10823 : .tp_methods = py_dcerpc_sec_vt_union_methods,
10824 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10825 : .tp_new = py_dcerpc_sec_vt_union_new,
10826 : };
10827 :
10828 :
10829 0 : static PyObject *py_dcerpc_sec_vt_get_command(PyObject *obj, void *closure)
10830 : {
10831 0 : struct dcerpc_sec_vt *object = pytalloc_get_ptr(obj);
10832 0 : PyObject *py_command;
10833 0 : py_command = PyLong_FromLong((uint16_t)(object->command));
10834 0 : return py_command;
10835 : }
10836 :
10837 0 : static int py_dcerpc_sec_vt_set_command(PyObject *py_obj, PyObject *value, void *closure)
10838 : {
10839 0 : struct dcerpc_sec_vt *object = pytalloc_get_ptr(py_obj);
10840 0 : if (value == NULL) {
10841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->command");
10842 0 : return -1;
10843 : }
10844 : {
10845 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->command));
10846 0 : if (PyLong_Check(value)) {
10847 0 : unsigned long long test_var;
10848 0 : test_var = PyLong_AsUnsignedLongLong(value);
10849 0 : if (PyErr_Occurred() != NULL) {
10850 0 : return -1;
10851 : }
10852 0 : if (test_var > uint_max) {
10853 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10854 : PyLong_Type.tp_name, uint_max, test_var);
10855 0 : return -1;
10856 : }
10857 0 : object->command = test_var;
10858 : } else {
10859 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10860 : PyLong_Type.tp_name);
10861 0 : return -1;
10862 : }
10863 : }
10864 0 : return 0;
10865 : }
10866 :
10867 0 : static PyObject *py_dcerpc_sec_vt_get_u(PyObject *obj, void *closure)
10868 : {
10869 0 : struct dcerpc_sec_vt *object = pytalloc_get_ptr(obj);
10870 0 : PyObject *py_u;
10871 0 : py_u = pyrpc_import_union(&dcerpc_sec_vt_union_Type, pytalloc_get_mem_ctx(obj), object->command & DCERPC_SEC_VT_COMMAND_ENUM, &object->u, "union dcerpc_sec_vt_union");
10872 0 : if (py_u == NULL) {
10873 0 : return NULL;
10874 : }
10875 0 : return py_u;
10876 : }
10877 :
10878 0 : static int py_dcerpc_sec_vt_set_u(PyObject *py_obj, PyObject *value, void *closure)
10879 : {
10880 0 : struct dcerpc_sec_vt *object = pytalloc_get_ptr(py_obj);
10881 0 : if (value == NULL) {
10882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->u");
10883 0 : return -1;
10884 : }
10885 : {
10886 0 : union dcerpc_sec_vt_union *u_switch_1;
10887 0 : u_switch_1 = (union dcerpc_sec_vt_union *)pyrpc_export_union(&dcerpc_sec_vt_union_Type, pytalloc_get_mem_ctx(py_obj), object->command & DCERPC_SEC_VT_COMMAND_ENUM, value, "union dcerpc_sec_vt_union");
10888 0 : if (u_switch_1 == NULL) {
10889 0 : return -1;
10890 : }
10891 0 : object->u = *u_switch_1;
10892 : }
10893 0 : return 0;
10894 : }
10895 :
10896 : static PyGetSetDef py_dcerpc_sec_vt_getsetters[] = {
10897 : {
10898 : .name = discard_const_p(char, "command"),
10899 : .get = py_dcerpc_sec_vt_get_command,
10900 : .set = py_dcerpc_sec_vt_set_command,
10901 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_sec_vt_command")
10902 : },
10903 : {
10904 : .name = discard_const_p(char, "u"),
10905 : .get = py_dcerpc_sec_vt_get_u,
10906 : .set = py_dcerpc_sec_vt_set_u,
10907 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_sec_vt_union")
10908 : },
10909 : { .name = NULL }
10910 : };
10911 :
10912 0 : static PyObject *py_dcerpc_sec_vt_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10913 : {
10914 0 : return pytalloc_new(struct dcerpc_sec_vt, type);
10915 : }
10916 :
10917 :
10918 : static PyTypeObject dcerpc_sec_vt_Type = {
10919 : PyVarObject_HEAD_INIT(NULL, 0)
10920 : .tp_name = "dcerpc.sec_vt",
10921 : .tp_getset = py_dcerpc_sec_vt_getsetters,
10922 : .tp_methods = NULL,
10923 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10924 : .tp_new = py_dcerpc_sec_vt_new,
10925 : };
10926 :
10927 :
10928 0 : static PyObject *py_dcerpc_sec_vt_count_get_count(PyObject *obj, void *closure)
10929 : {
10930 0 : struct dcerpc_sec_vt_count *object = pytalloc_get_ptr(obj);
10931 0 : PyObject *py_count;
10932 0 : py_count = PyLong_FromLong((uint16_t)(object->count));
10933 0 : return py_count;
10934 : }
10935 :
10936 0 : static int py_dcerpc_sec_vt_count_set_count(PyObject *py_obj, PyObject *value, void *closure)
10937 : {
10938 0 : struct dcerpc_sec_vt_count *object = pytalloc_get_ptr(py_obj);
10939 0 : if (value == NULL) {
10940 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
10941 0 : return -1;
10942 : }
10943 : {
10944 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10945 0 : if (PyLong_Check(value)) {
10946 0 : unsigned long long test_var;
10947 0 : test_var = PyLong_AsUnsignedLongLong(value);
10948 0 : if (PyErr_Occurred() != NULL) {
10949 0 : return -1;
10950 : }
10951 0 : if (test_var > uint_max) {
10952 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10953 : PyLong_Type.tp_name, uint_max, test_var);
10954 0 : return -1;
10955 : }
10956 0 : object->count = test_var;
10957 : } else {
10958 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10959 : PyLong_Type.tp_name);
10960 0 : return -1;
10961 : }
10962 : }
10963 0 : return 0;
10964 : }
10965 :
10966 : static PyGetSetDef py_dcerpc_sec_vt_count_getsetters[] = {
10967 : {
10968 : .name = discard_const_p(char, "count"),
10969 : .get = py_dcerpc_sec_vt_count_get_count,
10970 : .set = py_dcerpc_sec_vt_count_set_count,
10971 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
10972 : },
10973 : { .name = NULL }
10974 : };
10975 :
10976 0 : static PyObject *py_dcerpc_sec_vt_count_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10977 : {
10978 0 : return pytalloc_new(struct dcerpc_sec_vt_count, type);
10979 : }
10980 :
10981 0 : static PyObject *py_dcerpc_sec_vt_count_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10982 : {
10983 0 : struct dcerpc_sec_vt_count *object = pytalloc_get_ptr(py_obj);
10984 0 : PyObject *ret = NULL;
10985 0 : DATA_BLOB blob;
10986 0 : enum ndr_err_code err;
10987 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10988 0 : if (tmp_ctx == NULL) {
10989 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10990 0 : return NULL;
10991 : }
10992 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_sec_vt_count);
10993 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10994 0 : TALLOC_FREE(tmp_ctx);
10995 0 : PyErr_SetNdrError(err);
10996 0 : return NULL;
10997 : }
10998 :
10999 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11000 0 : TALLOC_FREE(tmp_ctx);
11001 0 : return ret;
11002 : }
11003 :
11004 0 : static PyObject *py_dcerpc_sec_vt_count_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11005 : {
11006 0 : struct dcerpc_sec_vt_count *object = pytalloc_get_ptr(py_obj);
11007 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11008 0 : Py_ssize_t blob_length = 0;
11009 0 : enum ndr_err_code err;
11010 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11011 0 : PyObject *allow_remaining_obj = NULL;
11012 0 : bool allow_remaining = false;
11013 :
11014 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11015 : discard_const_p(char *, kwnames),
11016 : &blob.data, &blob_length,
11017 : &allow_remaining_obj)) {
11018 0 : return NULL;
11019 : }
11020 0 : blob.length = blob_length;
11021 :
11022 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11023 0 : allow_remaining = true;
11024 : }
11025 :
11026 0 : if (allow_remaining) {
11027 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_sec_vt_count);
11028 : } else {
11029 0 : 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);
11030 : }
11031 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11032 0 : PyErr_SetNdrError(err);
11033 0 : return NULL;
11034 : }
11035 :
11036 0 : Py_RETURN_NONE;
11037 : }
11038 :
11039 0 : static PyObject *py_dcerpc_sec_vt_count_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11040 : {
11041 0 : struct dcerpc_sec_vt_count *object = pytalloc_get_ptr(py_obj);
11042 0 : PyObject *ret;
11043 0 : char *retstr;
11044 :
11045 0 : 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);
11046 0 : ret = PyUnicode_FromString(retstr);
11047 0 : talloc_free(retstr);
11048 :
11049 0 : return ret;
11050 : }
11051 :
11052 : static PyMethodDef py_dcerpc_sec_vt_count_methods[] = {
11053 : { "__ndr_pack__", (PyCFunction)py_dcerpc_sec_vt_count_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11054 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_sec_vt_count_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
11055 : { "__ndr_print__", (PyCFunction)py_dcerpc_sec_vt_count_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11056 : { NULL, NULL, 0, NULL }
11057 : };
11058 :
11059 :
11060 : static PyTypeObject dcerpc_sec_vt_count_Type = {
11061 : PyVarObject_HEAD_INIT(NULL, 0)
11062 : .tp_name = "dcerpc.sec_vt_count",
11063 : .tp_getset = py_dcerpc_sec_vt_count_getsetters,
11064 : .tp_methods = py_dcerpc_sec_vt_count_methods,
11065 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11066 : .tp_new = py_dcerpc_sec_vt_count_new,
11067 : };
11068 :
11069 :
11070 0 : static PyObject *py_dcerpc_sec_verification_trailer_get__pad(PyObject *obj, void *closure)
11071 : {
11072 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(obj);
11073 0 : PyObject *py__pad;
11074 0 : py__pad = PyBytes_FromStringAndSize((char *)(object->_pad).data, (object->_pad).length);
11075 0 : return py__pad;
11076 : }
11077 :
11078 0 : static int py_dcerpc_sec_verification_trailer_set__pad(PyObject *py_obj, PyObject *value, void *closure)
11079 : {
11080 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(py_obj);
11081 0 : if (value == NULL) {
11082 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_pad");
11083 0 : return -1;
11084 : }
11085 0 : object->_pad = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
11086 0 : return 0;
11087 : }
11088 :
11089 0 : static PyObject *py_dcerpc_sec_verification_trailer_get_magic(PyObject *obj, void *closure)
11090 : {
11091 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(obj);
11092 0 : PyObject *py_magic;
11093 0 : py_magic = PyList_New(8);
11094 0 : if (py_magic == NULL) {
11095 0 : return NULL;
11096 : }
11097 : {
11098 : int magic_cntr_0;
11099 0 : for (magic_cntr_0 = 0; magic_cntr_0 < (8); magic_cntr_0++) {
11100 0 : PyObject *py_magic_0;
11101 0 : py_magic_0 = PyLong_FromLong((uint16_t)((object->magic)[magic_cntr_0]));
11102 0 : PyList_SetItem(py_magic, magic_cntr_0, py_magic_0);
11103 : }
11104 : }
11105 0 : return py_magic;
11106 : }
11107 :
11108 0 : static int py_dcerpc_sec_verification_trailer_set_magic(PyObject *py_obj, PyObject *value, void *closure)
11109 : {
11110 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(py_obj);
11111 0 : if (value == NULL) {
11112 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->magic");
11113 0 : return -1;
11114 : }
11115 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11116 : {
11117 0 : int magic_cntr_0;
11118 0 : if (ARRAY_SIZE(object->magic) != PyList_GET_SIZE(value)) {
11119 0 : 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));
11120 0 : return -1;
11121 : }
11122 0 : for (magic_cntr_0 = 0; magic_cntr_0 < PyList_GET_SIZE(value); magic_cntr_0++) {
11123 0 : if (PyList_GET_ITEM(value, magic_cntr_0) == NULL) {
11124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->magic)[magic_cntr_0]");
11125 0 : return -1;
11126 : }
11127 : {
11128 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->magic)[magic_cntr_0]));
11129 0 : if (PyLong_Check(PyList_GET_ITEM(value, magic_cntr_0))) {
11130 0 : unsigned long long test_var;
11131 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, magic_cntr_0));
11132 0 : if (PyErr_Occurred() != NULL) {
11133 0 : return -1;
11134 : }
11135 0 : if (test_var > uint_max) {
11136 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11137 : PyLong_Type.tp_name, uint_max, test_var);
11138 0 : return -1;
11139 : }
11140 0 : (object->magic)[magic_cntr_0] = test_var;
11141 : } else {
11142 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11143 : PyLong_Type.tp_name);
11144 0 : return -1;
11145 : }
11146 : }
11147 : }
11148 : }
11149 0 : return 0;
11150 : }
11151 :
11152 0 : static PyObject *py_dcerpc_sec_verification_trailer_get_count(PyObject *obj, void *closure)
11153 : {
11154 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(obj);
11155 0 : PyObject *py_count;
11156 0 : py_count = pytalloc_reference_ex(&dcerpc_sec_vt_count_Type, pytalloc_get_mem_ctx(obj), &object->count);
11157 0 : return py_count;
11158 : }
11159 :
11160 0 : static int py_dcerpc_sec_verification_trailer_set_count(PyObject *py_obj, PyObject *value, void *closure)
11161 : {
11162 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(py_obj);
11163 0 : if (value == NULL) {
11164 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
11165 0 : return -1;
11166 : }
11167 0 : PY_CHECK_TYPE(&dcerpc_sec_vt_count_Type, value, return -1;);
11168 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11169 0 : PyErr_NoMemory();
11170 0 : return -1;
11171 : }
11172 0 : object->count = *(struct dcerpc_sec_vt_count *)pytalloc_get_ptr(value);
11173 0 : return 0;
11174 : }
11175 :
11176 0 : static PyObject *py_dcerpc_sec_verification_trailer_get_commands(PyObject *obj, void *closure)
11177 : {
11178 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(obj);
11179 0 : PyObject *py_commands;
11180 0 : py_commands = PyList_New(object->count.count);
11181 0 : if (py_commands == NULL) {
11182 0 : return NULL;
11183 : }
11184 : {
11185 : int commands_cntr_0;
11186 0 : for (commands_cntr_0 = 0; commands_cntr_0 < (object->count.count); commands_cntr_0++) {
11187 0 : PyObject *py_commands_0;
11188 0 : py_commands_0 = pytalloc_reference_ex(&dcerpc_sec_vt_Type, object->commands, &(object->commands)[commands_cntr_0]);
11189 0 : PyList_SetItem(py_commands, commands_cntr_0, py_commands_0);
11190 : }
11191 : }
11192 0 : return py_commands;
11193 : }
11194 :
11195 0 : static int py_dcerpc_sec_verification_trailer_set_commands(PyObject *py_obj, PyObject *value, void *closure)
11196 : {
11197 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(py_obj);
11198 0 : if (value == NULL) {
11199 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->commands");
11200 0 : return -1;
11201 : }
11202 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11203 : {
11204 0 : int commands_cntr_0;
11205 0 : object->commands = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->commands, PyList_GET_SIZE(value));
11206 0 : if (!object->commands) { return -1; }
11207 0 : talloc_set_name_const(object->commands, "ARRAY: object->commands");
11208 0 : for (commands_cntr_0 = 0; commands_cntr_0 < PyList_GET_SIZE(value); commands_cntr_0++) {
11209 0 : if (PyList_GET_ITEM(value, commands_cntr_0) == NULL) {
11210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->commands)[commands_cntr_0]");
11211 0 : return -1;
11212 : }
11213 0 : PY_CHECK_TYPE(&dcerpc_sec_vt_Type, PyList_GET_ITEM(value, commands_cntr_0), return -1;);
11214 0 : if (talloc_reference(object->commands, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, commands_cntr_0))) == NULL) {
11215 0 : PyErr_NoMemory();
11216 0 : return -1;
11217 : }
11218 0 : (object->commands)[commands_cntr_0] = *(struct dcerpc_sec_vt *)pytalloc_get_ptr(PyList_GET_ITEM(value, commands_cntr_0));
11219 : }
11220 : }
11221 0 : return 0;
11222 : }
11223 :
11224 : static PyGetSetDef py_dcerpc_sec_verification_trailer_getsetters[] = {
11225 : {
11226 : .name = discard_const_p(char, "_pad"),
11227 : .get = py_dcerpc_sec_verification_trailer_get__pad,
11228 : .set = py_dcerpc_sec_verification_trailer_set__pad,
11229 : .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
11230 : },
11231 : {
11232 : .name = discard_const_p(char, "magic"),
11233 : .get = py_dcerpc_sec_verification_trailer_get_magic,
11234 : .set = py_dcerpc_sec_verification_trailer_set_magic,
11235 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11236 : },
11237 : {
11238 : .name = discard_const_p(char, "count"),
11239 : .get = py_dcerpc_sec_verification_trailer_get_count,
11240 : .set = py_dcerpc_sec_verification_trailer_set_count,
11241 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_sec_vt_count")
11242 : },
11243 : {
11244 : .name = discard_const_p(char, "commands"),
11245 : .get = py_dcerpc_sec_verification_trailer_get_commands,
11246 : .set = py_dcerpc_sec_verification_trailer_set_commands,
11247 : .doc = discard_const_p(char, "PIDL-generated element of base type dcerpc_sec_vt")
11248 : },
11249 : { .name = NULL }
11250 : };
11251 :
11252 0 : static PyObject *py_dcerpc_sec_verification_trailer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11253 : {
11254 0 : return pytalloc_new(struct dcerpc_sec_verification_trailer, type);
11255 : }
11256 :
11257 0 : static PyObject *py_dcerpc_sec_verification_trailer_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11258 : {
11259 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(py_obj);
11260 0 : PyObject *ret = NULL;
11261 0 : DATA_BLOB blob;
11262 0 : enum ndr_err_code err;
11263 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11264 0 : if (tmp_ctx == NULL) {
11265 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11266 0 : return NULL;
11267 : }
11268 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_dcerpc_sec_verification_trailer);
11269 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11270 0 : TALLOC_FREE(tmp_ctx);
11271 0 : PyErr_SetNdrError(err);
11272 0 : return NULL;
11273 : }
11274 :
11275 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11276 0 : TALLOC_FREE(tmp_ctx);
11277 0 : return ret;
11278 : }
11279 :
11280 0 : static PyObject *py_dcerpc_sec_verification_trailer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11281 : {
11282 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(py_obj);
11283 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11284 0 : Py_ssize_t blob_length = 0;
11285 0 : enum ndr_err_code err;
11286 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11287 0 : PyObject *allow_remaining_obj = NULL;
11288 0 : bool allow_remaining = false;
11289 :
11290 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11291 : discard_const_p(char *, kwnames),
11292 : &blob.data, &blob_length,
11293 : &allow_remaining_obj)) {
11294 0 : return NULL;
11295 : }
11296 0 : blob.length = blob_length;
11297 :
11298 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11299 0 : allow_remaining = true;
11300 : }
11301 :
11302 0 : if (allow_remaining) {
11303 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dcerpc_sec_verification_trailer);
11304 : } else {
11305 0 : 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);
11306 : }
11307 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11308 0 : PyErr_SetNdrError(err);
11309 0 : return NULL;
11310 : }
11311 :
11312 0 : Py_RETURN_NONE;
11313 : }
11314 :
11315 0 : static PyObject *py_dcerpc_sec_verification_trailer_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11316 : {
11317 0 : struct dcerpc_sec_verification_trailer *object = pytalloc_get_ptr(py_obj);
11318 0 : PyObject *ret;
11319 0 : char *retstr;
11320 :
11321 0 : 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);
11322 0 : ret = PyUnicode_FromString(retstr);
11323 0 : talloc_free(retstr);
11324 :
11325 0 : return ret;
11326 : }
11327 :
11328 : static PyMethodDef py_dcerpc_sec_verification_trailer_methods[] = {
11329 : { "__ndr_pack__", (PyCFunction)py_dcerpc_sec_verification_trailer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11330 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_dcerpc_sec_verification_trailer_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
11331 : { "__ndr_print__", (PyCFunction)py_dcerpc_sec_verification_trailer_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11332 : { NULL, NULL, 0, NULL }
11333 : };
11334 :
11335 :
11336 : static PyTypeObject dcerpc_sec_verification_trailer_Type = {
11337 : PyVarObject_HEAD_INIT(NULL, 0)
11338 : .tp_name = "dcerpc.sec_verification_trailer",
11339 : .tp_getset = py_dcerpc_sec_verification_trailer_getsetters,
11340 : .tp_methods = py_dcerpc_sec_verification_trailer_methods,
11341 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11342 : .tp_new = py_dcerpc_sec_verification_trailer_new,
11343 : };
11344 :
11345 : static PyMethodDef dcerpc_methods[] = {
11346 : { NULL, NULL, 0, NULL }
11347 : };
11348 :
11349 : static struct PyModuleDef moduledef = {
11350 : PyModuleDef_HEAD_INIT,
11351 : .m_name = "dcerpc",
11352 : .m_doc = "dcerpc DCE/RPC",
11353 : .m_size = -1,
11354 : .m_methods = dcerpc_methods,
11355 : };
11356 698 : MODULE_INIT_FUNC(dcerpc)
11357 : {
11358 698 : PyObject *m = NULL;
11359 698 : PyObject *dep_samba_dcerpc_misc = NULL;
11360 698 : PyObject *dep_talloc = NULL;
11361 :
11362 698 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
11363 698 : if (dep_samba_dcerpc_misc == NULL)
11364 0 : goto out;
11365 :
11366 698 : dep_talloc = PyImport_ImportModule("talloc");
11367 698 : if (dep_talloc == NULL)
11368 0 : goto out;
11369 :
11370 698 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
11371 698 : if (ndr_syntax_id_Type == NULL)
11372 0 : goto out;
11373 :
11374 698 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
11375 698 : if (BaseObject_Type == NULL)
11376 0 : goto out;
11377 :
11378 698 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
11379 698 : if (GUID_Type == NULL)
11380 0 : goto out;
11381 :
11382 698 : dcerpc_ctx_list_Type.tp_base = BaseObject_Type;
11383 698 : dcerpc_ctx_list_Type.tp_basicsize = pytalloc_BaseObject_size();
11384 :
11385 698 : dcerpc_bind_Type.tp_base = BaseObject_Type;
11386 698 : dcerpc_bind_Type.tp_basicsize = pytalloc_BaseObject_size();
11387 :
11388 698 : dcerpc_empty_Type.tp_base = BaseObject_Type;
11389 698 : dcerpc_empty_Type.tp_basicsize = pytalloc_BaseObject_size();
11390 :
11391 698 : dcerpc_object_Type.tp_base = BaseObject_Type;
11392 698 : dcerpc_object_Type.tp_basicsize = pytalloc_BaseObject_size();
11393 :
11394 698 : dcerpc_request_Type.tp_base = BaseObject_Type;
11395 698 : dcerpc_request_Type.tp_basicsize = pytalloc_BaseObject_size();
11396 :
11397 698 : dcerpc_bind_ack_reason_Type.tp_base = BaseObject_Type;
11398 698 : dcerpc_bind_ack_reason_Type.tp_basicsize = pytalloc_BaseObject_size();
11399 :
11400 698 : dcerpc_ack_ctx_Type.tp_base = BaseObject_Type;
11401 698 : dcerpc_ack_ctx_Type.tp_basicsize = pytalloc_BaseObject_size();
11402 :
11403 698 : dcerpc_bind_ack_Type.tp_base = BaseObject_Type;
11404 698 : dcerpc_bind_ack_Type.tp_basicsize = pytalloc_BaseObject_size();
11405 :
11406 698 : dcerpc_bind_nak_version_Type.tp_base = BaseObject_Type;
11407 698 : dcerpc_bind_nak_version_Type.tp_basicsize = pytalloc_BaseObject_size();
11408 :
11409 698 : dcerpc_bind_nak_Type.tp_base = BaseObject_Type;
11410 698 : dcerpc_bind_nak_Type.tp_basicsize = pytalloc_BaseObject_size();
11411 :
11412 698 : dcerpc_response_Type.tp_base = BaseObject_Type;
11413 698 : dcerpc_response_Type.tp_basicsize = pytalloc_BaseObject_size();
11414 :
11415 698 : dcerpc_fault_Type.tp_base = BaseObject_Type;
11416 698 : dcerpc_fault_Type.tp_basicsize = pytalloc_BaseObject_size();
11417 :
11418 698 : dcerpc_auth_Type.tp_base = BaseObject_Type;
11419 698 : dcerpc_auth_Type.tp_basicsize = pytalloc_BaseObject_size();
11420 :
11421 698 : dcerpc_auth3_Type.tp_base = BaseObject_Type;
11422 698 : dcerpc_auth3_Type.tp_basicsize = pytalloc_BaseObject_size();
11423 :
11424 698 : dcerpc_orphaned_Type.tp_base = BaseObject_Type;
11425 698 : dcerpc_orphaned_Type.tp_basicsize = pytalloc_BaseObject_size();
11426 :
11427 698 : dcerpc_co_cancel_Type.tp_base = BaseObject_Type;
11428 698 : dcerpc_co_cancel_Type.tp_basicsize = pytalloc_BaseObject_size();
11429 :
11430 698 : dcerpc_cl_cancel_Type.tp_base = BaseObject_Type;
11431 698 : dcerpc_cl_cancel_Type.tp_basicsize = pytalloc_BaseObject_size();
11432 :
11433 698 : dcerpc_cancel_ack_Type.tp_base = BaseObject_Type;
11434 698 : dcerpc_cancel_ack_Type.tp_basicsize = pytalloc_BaseObject_size();
11435 :
11436 698 : dcerpc_fack_Type.tp_base = BaseObject_Type;
11437 698 : dcerpc_fack_Type.tp_basicsize = pytalloc_BaseObject_size();
11438 :
11439 698 : dcerpc_ack_Type.tp_base = BaseObject_Type;
11440 698 : dcerpc_ack_Type.tp_basicsize = pytalloc_BaseObject_size();
11441 :
11442 698 : dcerpc_ping_Type.tp_base = BaseObject_Type;
11443 698 : dcerpc_ping_Type.tp_basicsize = pytalloc_BaseObject_size();
11444 :
11445 698 : dcerpc_shutdown_Type.tp_base = BaseObject_Type;
11446 698 : dcerpc_shutdown_Type.tp_basicsize = pytalloc_BaseObject_size();
11447 :
11448 698 : dcerpc_working_Type.tp_base = BaseObject_Type;
11449 698 : dcerpc_working_Type.tp_basicsize = pytalloc_BaseObject_size();
11450 :
11451 698 : RTSCookie_Type.tp_base = BaseObject_Type;
11452 698 : RTSCookie_Type.tp_basicsize = pytalloc_BaseObject_size();
11453 :
11454 698 : ClientAddressType_Type.tp_base = BaseObject_Type;
11455 698 : ClientAddressType_Type.tp_basicsize = pytalloc_BaseObject_size();
11456 :
11457 698 : ClientAddress_Type.tp_base = BaseObject_Type;
11458 698 : ClientAddress_Type.tp_basicsize = pytalloc_BaseObject_size();
11459 :
11460 698 : FlowControlAcknowledgment_Type.tp_base = BaseObject_Type;
11461 698 : FlowControlAcknowledgment_Type.tp_basicsize = pytalloc_BaseObject_size();
11462 :
11463 698 : dcerpc_rts_cmd_ReceiveWindowSize_Type.tp_base = BaseObject_Type;
11464 698 : dcerpc_rts_cmd_ReceiveWindowSize_Type.tp_basicsize = pytalloc_BaseObject_size();
11465 :
11466 698 : dcerpc_rts_cmd_FlowControlAck_Type.tp_base = BaseObject_Type;
11467 698 : dcerpc_rts_cmd_FlowControlAck_Type.tp_basicsize = pytalloc_BaseObject_size();
11468 :
11469 698 : dcerpc_rts_cmd_ConnectionTimeout_Type.tp_base = BaseObject_Type;
11470 698 : dcerpc_rts_cmd_ConnectionTimeout_Type.tp_basicsize = pytalloc_BaseObject_size();
11471 :
11472 698 : dcerpc_rts_cmd_Cookie_Type.tp_base = BaseObject_Type;
11473 698 : dcerpc_rts_cmd_Cookie_Type.tp_basicsize = pytalloc_BaseObject_size();
11474 :
11475 698 : dcerpc_rts_cmd_ChannelLifetime_Type.tp_base = BaseObject_Type;
11476 698 : dcerpc_rts_cmd_ChannelLifetime_Type.tp_basicsize = pytalloc_BaseObject_size();
11477 :
11478 698 : dcerpc_rts_cmd_ClientKeepalive_Type.tp_base = BaseObject_Type;
11479 698 : dcerpc_rts_cmd_ClientKeepalive_Type.tp_basicsize = pytalloc_BaseObject_size();
11480 :
11481 698 : dcerpc_rts_cmd_Version_Type.tp_base = BaseObject_Type;
11482 698 : dcerpc_rts_cmd_Version_Type.tp_basicsize = pytalloc_BaseObject_size();
11483 :
11484 698 : dcerpc_rts_cmd_Empty_Type.tp_base = BaseObject_Type;
11485 698 : dcerpc_rts_cmd_Empty_Type.tp_basicsize = pytalloc_BaseObject_size();
11486 :
11487 698 : dcerpc_rts_cmd_Padding_Type.tp_base = BaseObject_Type;
11488 698 : dcerpc_rts_cmd_Padding_Type.tp_basicsize = pytalloc_BaseObject_size();
11489 :
11490 698 : dcerpc_rts_cmd_NegativeANCE_Type.tp_base = BaseObject_Type;
11491 698 : dcerpc_rts_cmd_NegativeANCE_Type.tp_basicsize = pytalloc_BaseObject_size();
11492 :
11493 698 : dcerpc_rts_cmd_ANCE_Type.tp_base = BaseObject_Type;
11494 698 : dcerpc_rts_cmd_ANCE_Type.tp_basicsize = pytalloc_BaseObject_size();
11495 :
11496 698 : dcerpc_rts_cmd_ClientAddress_Type.tp_base = BaseObject_Type;
11497 698 : dcerpc_rts_cmd_ClientAddress_Type.tp_basicsize = pytalloc_BaseObject_size();
11498 :
11499 698 : dcerpc_rts_cmd_AssociationGroupId_Type.tp_base = BaseObject_Type;
11500 698 : dcerpc_rts_cmd_AssociationGroupId_Type.tp_basicsize = pytalloc_BaseObject_size();
11501 :
11502 698 : dcerpc_rts_cmd_Destination_Type.tp_base = BaseObject_Type;
11503 698 : dcerpc_rts_cmd_Destination_Type.tp_basicsize = pytalloc_BaseObject_size();
11504 :
11505 698 : dcerpc_rts_cmd_PingTrafficSentNotify_Type.tp_base = BaseObject_Type;
11506 698 : dcerpc_rts_cmd_PingTrafficSentNotify_Type.tp_basicsize = pytalloc_BaseObject_size();
11507 :
11508 698 : dcerpc_rts_cmds_Type.tp_base = BaseObject_Type;
11509 698 : dcerpc_rts_cmds_Type.tp_basicsize = pytalloc_BaseObject_size();
11510 :
11511 698 : dcerpc_rts_cmd_Type.tp_base = BaseObject_Type;
11512 698 : dcerpc_rts_cmd_Type.tp_basicsize = pytalloc_BaseObject_size();
11513 :
11514 698 : dcerpc_rts_Type.tp_base = BaseObject_Type;
11515 698 : dcerpc_rts_Type.tp_basicsize = pytalloc_BaseObject_size();
11516 :
11517 698 : dcerpc_payload_Type.tp_base = BaseObject_Type;
11518 698 : dcerpc_payload_Type.tp_basicsize = pytalloc_BaseObject_size();
11519 :
11520 698 : ncacn_packet_Type.tp_base = BaseObject_Type;
11521 698 : ncacn_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
11522 :
11523 698 : ncadg_packet_Type.tp_base = BaseObject_Type;
11524 698 : ncadg_packet_Type.tp_basicsize = pytalloc_BaseObject_size();
11525 :
11526 698 : dcerpc_sec_vt_pcontext_Type.tp_base = BaseObject_Type;
11527 698 : dcerpc_sec_vt_pcontext_Type.tp_basicsize = pytalloc_BaseObject_size();
11528 :
11529 698 : dcerpc_sec_vt_header2_Type.tp_base = BaseObject_Type;
11530 698 : dcerpc_sec_vt_header2_Type.tp_basicsize = pytalloc_BaseObject_size();
11531 :
11532 698 : dcerpc_sec_vt_union_Type.tp_base = BaseObject_Type;
11533 698 : dcerpc_sec_vt_union_Type.tp_basicsize = pytalloc_BaseObject_size();
11534 :
11535 698 : dcerpc_sec_vt_Type.tp_base = BaseObject_Type;
11536 698 : dcerpc_sec_vt_Type.tp_basicsize = pytalloc_BaseObject_size();
11537 :
11538 698 : dcerpc_sec_vt_count_Type.tp_base = BaseObject_Type;
11539 698 : dcerpc_sec_vt_count_Type.tp_basicsize = pytalloc_BaseObject_size();
11540 :
11541 698 : dcerpc_sec_verification_trailer_Type.tp_base = BaseObject_Type;
11542 698 : dcerpc_sec_verification_trailer_Type.tp_basicsize = pytalloc_BaseObject_size();
11543 :
11544 698 : if (PyType_Ready(&dcerpc_ctx_list_Type) < 0)
11545 0 : goto out;
11546 698 : if (PyType_Ready(&dcerpc_bind_Type) < 0)
11547 0 : goto out;
11548 698 : if (PyType_Ready(&dcerpc_empty_Type) < 0)
11549 0 : goto out;
11550 698 : if (PyType_Ready(&dcerpc_object_Type) < 0)
11551 0 : goto out;
11552 698 : if (PyType_Ready(&dcerpc_request_Type) < 0)
11553 0 : goto out;
11554 698 : if (PyType_Ready(&dcerpc_bind_ack_reason_Type) < 0)
11555 0 : goto out;
11556 698 : if (PyType_Ready(&dcerpc_ack_ctx_Type) < 0)
11557 0 : goto out;
11558 698 : if (PyType_Ready(&dcerpc_bind_ack_Type) < 0)
11559 0 : goto out;
11560 698 : if (PyType_Ready(&dcerpc_bind_nak_version_Type) < 0)
11561 0 : goto out;
11562 698 : if (PyType_Ready(&dcerpc_bind_nak_Type) < 0)
11563 0 : goto out;
11564 698 : if (PyType_Ready(&dcerpc_response_Type) < 0)
11565 0 : goto out;
11566 698 : if (PyType_Ready(&dcerpc_fault_Type) < 0)
11567 0 : goto out;
11568 698 : if (PyType_Ready(&dcerpc_auth_Type) < 0)
11569 0 : goto out;
11570 698 : if (PyType_Ready(&dcerpc_auth3_Type) < 0)
11571 0 : goto out;
11572 698 : if (PyType_Ready(&dcerpc_orphaned_Type) < 0)
11573 0 : goto out;
11574 698 : if (PyType_Ready(&dcerpc_co_cancel_Type) < 0)
11575 0 : goto out;
11576 698 : if (PyType_Ready(&dcerpc_cl_cancel_Type) < 0)
11577 0 : goto out;
11578 698 : if (PyType_Ready(&dcerpc_cancel_ack_Type) < 0)
11579 0 : goto out;
11580 698 : if (PyType_Ready(&dcerpc_fack_Type) < 0)
11581 0 : goto out;
11582 698 : if (PyType_Ready(&dcerpc_ack_Type) < 0)
11583 0 : goto out;
11584 698 : if (PyType_Ready(&dcerpc_ping_Type) < 0)
11585 0 : goto out;
11586 698 : if (PyType_Ready(&dcerpc_shutdown_Type) < 0)
11587 0 : goto out;
11588 698 : if (PyType_Ready(&dcerpc_working_Type) < 0)
11589 0 : goto out;
11590 698 : if (PyType_Ready(&RTSCookie_Type) < 0)
11591 0 : goto out;
11592 698 : if (PyType_Ready(&ClientAddressType_Type) < 0)
11593 0 : goto out;
11594 698 : if (PyType_Ready(&ClientAddress_Type) < 0)
11595 0 : goto out;
11596 698 : if (PyType_Ready(&FlowControlAcknowledgment_Type) < 0)
11597 0 : goto out;
11598 698 : if (PyType_Ready(&dcerpc_rts_cmd_ReceiveWindowSize_Type) < 0)
11599 0 : goto out;
11600 698 : if (PyType_Ready(&dcerpc_rts_cmd_FlowControlAck_Type) < 0)
11601 0 : goto out;
11602 698 : if (PyType_Ready(&dcerpc_rts_cmd_ConnectionTimeout_Type) < 0)
11603 0 : goto out;
11604 698 : if (PyType_Ready(&dcerpc_rts_cmd_Cookie_Type) < 0)
11605 0 : goto out;
11606 698 : if (PyType_Ready(&dcerpc_rts_cmd_ChannelLifetime_Type) < 0)
11607 0 : goto out;
11608 698 : if (PyType_Ready(&dcerpc_rts_cmd_ClientKeepalive_Type) < 0)
11609 0 : goto out;
11610 698 : if (PyType_Ready(&dcerpc_rts_cmd_Version_Type) < 0)
11611 0 : goto out;
11612 698 : if (PyType_Ready(&dcerpc_rts_cmd_Empty_Type) < 0)
11613 0 : goto out;
11614 698 : if (PyType_Ready(&dcerpc_rts_cmd_Padding_Type) < 0)
11615 0 : goto out;
11616 698 : if (PyType_Ready(&dcerpc_rts_cmd_NegativeANCE_Type) < 0)
11617 0 : goto out;
11618 698 : if (PyType_Ready(&dcerpc_rts_cmd_ANCE_Type) < 0)
11619 0 : goto out;
11620 698 : if (PyType_Ready(&dcerpc_rts_cmd_ClientAddress_Type) < 0)
11621 0 : goto out;
11622 698 : if (PyType_Ready(&dcerpc_rts_cmd_AssociationGroupId_Type) < 0)
11623 0 : goto out;
11624 698 : if (PyType_Ready(&dcerpc_rts_cmd_Destination_Type) < 0)
11625 0 : goto out;
11626 698 : if (PyType_Ready(&dcerpc_rts_cmd_PingTrafficSentNotify_Type) < 0)
11627 0 : goto out;
11628 698 : if (PyType_Ready(&dcerpc_rts_cmds_Type) < 0)
11629 0 : goto out;
11630 698 : if (PyType_Ready(&dcerpc_rts_cmd_Type) < 0)
11631 0 : goto out;
11632 698 : if (PyType_Ready(&dcerpc_rts_Type) < 0)
11633 0 : goto out;
11634 698 : if (PyType_Ready(&dcerpc_payload_Type) < 0)
11635 0 : goto out;
11636 698 : if (PyType_Ready(&ncacn_packet_Type) < 0)
11637 0 : goto out;
11638 698 : if (PyType_Ready(&ncadg_packet_Type) < 0)
11639 0 : goto out;
11640 698 : if (PyType_Ready(&dcerpc_sec_vt_pcontext_Type) < 0)
11641 0 : goto out;
11642 698 : if (PyType_Ready(&dcerpc_sec_vt_header2_Type) < 0)
11643 0 : goto out;
11644 698 : if (PyType_Ready(&dcerpc_sec_vt_union_Type) < 0)
11645 0 : goto out;
11646 698 : if (PyType_Ready(&dcerpc_sec_vt_Type) < 0)
11647 0 : goto out;
11648 698 : if (PyType_Ready(&dcerpc_sec_vt_count_Type) < 0)
11649 0 : goto out;
11650 698 : if (PyType_Ready(&dcerpc_sec_verification_trailer_Type) < 0)
11651 0 : goto out;
11652 : #ifdef PY_CTX_LIST_PATCH
11653 : PY_CTX_LIST_PATCH(&dcerpc_ctx_list_Type);
11654 : #endif
11655 : #ifdef PY_BIND_PATCH
11656 : PY_BIND_PATCH(&dcerpc_bind_Type);
11657 : #endif
11658 : #ifdef PY_EMPTY_PATCH
11659 : PY_EMPTY_PATCH(&dcerpc_empty_Type);
11660 : #endif
11661 : #ifdef PY_OBJECT_PATCH
11662 : PY_OBJECT_PATCH(&dcerpc_object_Type);
11663 : #endif
11664 : #ifdef PY_REQUEST_PATCH
11665 : PY_REQUEST_PATCH(&dcerpc_request_Type);
11666 : #endif
11667 : #ifdef PY_BIND_ACK_REASON_PATCH
11668 : PY_BIND_ACK_REASON_PATCH(&dcerpc_bind_ack_reason_Type);
11669 : #endif
11670 : #ifdef PY_ACK_CTX_PATCH
11671 : PY_ACK_CTX_PATCH(&dcerpc_ack_ctx_Type);
11672 : #endif
11673 : #ifdef PY_BIND_ACK_PATCH
11674 : PY_BIND_ACK_PATCH(&dcerpc_bind_ack_Type);
11675 : #endif
11676 : #ifdef PY_BIND_NAK_VERSION_PATCH
11677 : PY_BIND_NAK_VERSION_PATCH(&dcerpc_bind_nak_version_Type);
11678 : #endif
11679 : #ifdef PY_BIND_NAK_PATCH
11680 : PY_BIND_NAK_PATCH(&dcerpc_bind_nak_Type);
11681 : #endif
11682 : #ifdef PY_RESPONSE_PATCH
11683 : PY_RESPONSE_PATCH(&dcerpc_response_Type);
11684 : #endif
11685 : #ifdef PY_FAULT_PATCH
11686 : PY_FAULT_PATCH(&dcerpc_fault_Type);
11687 : #endif
11688 : #ifdef PY_AUTH_PATCH
11689 : PY_AUTH_PATCH(&dcerpc_auth_Type);
11690 : #endif
11691 : #ifdef PY_AUTH3_PATCH
11692 : PY_AUTH3_PATCH(&dcerpc_auth3_Type);
11693 : #endif
11694 : #ifdef PY_ORPHANED_PATCH
11695 : PY_ORPHANED_PATCH(&dcerpc_orphaned_Type);
11696 : #endif
11697 : #ifdef PY_CO_CANCEL_PATCH
11698 : PY_CO_CANCEL_PATCH(&dcerpc_co_cancel_Type);
11699 : #endif
11700 : #ifdef PY_CL_CANCEL_PATCH
11701 : PY_CL_CANCEL_PATCH(&dcerpc_cl_cancel_Type);
11702 : #endif
11703 : #ifdef PY_CANCEL_ACK_PATCH
11704 : PY_CANCEL_ACK_PATCH(&dcerpc_cancel_ack_Type);
11705 : #endif
11706 : #ifdef PY_FACK_PATCH
11707 : PY_FACK_PATCH(&dcerpc_fack_Type);
11708 : #endif
11709 : #ifdef PY_ACK_PATCH
11710 : PY_ACK_PATCH(&dcerpc_ack_Type);
11711 : #endif
11712 : #ifdef PY_PING_PATCH
11713 : PY_PING_PATCH(&dcerpc_ping_Type);
11714 : #endif
11715 : #ifdef PY_SHUTDOWN_PATCH
11716 : PY_SHUTDOWN_PATCH(&dcerpc_shutdown_Type);
11717 : #endif
11718 : #ifdef PY_WORKING_PATCH
11719 : PY_WORKING_PATCH(&dcerpc_working_Type);
11720 : #endif
11721 : #ifdef PY_RTSCOOKIE_PATCH
11722 : PY_RTSCOOKIE_PATCH(&RTSCookie_Type);
11723 : #endif
11724 : #ifdef PY_CLIENTADDRESSTYPE_PATCH
11725 : PY_CLIENTADDRESSTYPE_PATCH(&ClientAddressType_Type);
11726 : #endif
11727 : #ifdef PY_CLIENTADDRESS_PATCH
11728 : PY_CLIENTADDRESS_PATCH(&ClientAddress_Type);
11729 : #endif
11730 : #ifdef PY_FLOWCONTROLACKNOWLEDGMENT_PATCH
11731 : PY_FLOWCONTROLACKNOWLEDGMENT_PATCH(&FlowControlAcknowledgment_Type);
11732 : #endif
11733 : #ifdef PY_RTS_CMD_RECEIVEWINDOWSIZE_PATCH
11734 : PY_RTS_CMD_RECEIVEWINDOWSIZE_PATCH(&dcerpc_rts_cmd_ReceiveWindowSize_Type);
11735 : #endif
11736 : #ifdef PY_RTS_CMD_FLOWCONTROLACK_PATCH
11737 : PY_RTS_CMD_FLOWCONTROLACK_PATCH(&dcerpc_rts_cmd_FlowControlAck_Type);
11738 : #endif
11739 : #ifdef PY_RTS_CMD_CONNECTIONTIMEOUT_PATCH
11740 : PY_RTS_CMD_CONNECTIONTIMEOUT_PATCH(&dcerpc_rts_cmd_ConnectionTimeout_Type);
11741 : #endif
11742 : #ifdef PY_RTS_CMD_COOKIE_PATCH
11743 : PY_RTS_CMD_COOKIE_PATCH(&dcerpc_rts_cmd_Cookie_Type);
11744 : #endif
11745 : #ifdef PY_RTS_CMD_CHANNELLIFETIME_PATCH
11746 : PY_RTS_CMD_CHANNELLIFETIME_PATCH(&dcerpc_rts_cmd_ChannelLifetime_Type);
11747 : #endif
11748 : #ifdef PY_RTS_CMD_CLIENTKEEPALIVE_PATCH
11749 : PY_RTS_CMD_CLIENTKEEPALIVE_PATCH(&dcerpc_rts_cmd_ClientKeepalive_Type);
11750 : #endif
11751 : #ifdef PY_RTS_CMD_VERSION_PATCH
11752 : PY_RTS_CMD_VERSION_PATCH(&dcerpc_rts_cmd_Version_Type);
11753 : #endif
11754 : #ifdef PY_RTS_CMD_EMPTY_PATCH
11755 : PY_RTS_CMD_EMPTY_PATCH(&dcerpc_rts_cmd_Empty_Type);
11756 : #endif
11757 : #ifdef PY_RTS_CMD_PADDING_PATCH
11758 : PY_RTS_CMD_PADDING_PATCH(&dcerpc_rts_cmd_Padding_Type);
11759 : #endif
11760 : #ifdef PY_RTS_CMD_NEGATIVEANCE_PATCH
11761 : PY_RTS_CMD_NEGATIVEANCE_PATCH(&dcerpc_rts_cmd_NegativeANCE_Type);
11762 : #endif
11763 : #ifdef PY_RTS_CMD_ANCE_PATCH
11764 : PY_RTS_CMD_ANCE_PATCH(&dcerpc_rts_cmd_ANCE_Type);
11765 : #endif
11766 : #ifdef PY_RTS_CMD_CLIENTADDRESS_PATCH
11767 : PY_RTS_CMD_CLIENTADDRESS_PATCH(&dcerpc_rts_cmd_ClientAddress_Type);
11768 : #endif
11769 : #ifdef PY_RTS_CMD_ASSOCIATIONGROUPID_PATCH
11770 : PY_RTS_CMD_ASSOCIATIONGROUPID_PATCH(&dcerpc_rts_cmd_AssociationGroupId_Type);
11771 : #endif
11772 : #ifdef PY_RTS_CMD_DESTINATION_PATCH
11773 : PY_RTS_CMD_DESTINATION_PATCH(&dcerpc_rts_cmd_Destination_Type);
11774 : #endif
11775 : #ifdef PY_RTS_CMD_PINGTRAFFICSENTNOTIFY_PATCH
11776 : PY_RTS_CMD_PINGTRAFFICSENTNOTIFY_PATCH(&dcerpc_rts_cmd_PingTrafficSentNotify_Type);
11777 : #endif
11778 : #ifdef PY_RTS_CMDS_PATCH
11779 : PY_RTS_CMDS_PATCH(&dcerpc_rts_cmds_Type);
11780 : #endif
11781 : #ifdef PY_RTS_CMD_PATCH
11782 : PY_RTS_CMD_PATCH(&dcerpc_rts_cmd_Type);
11783 : #endif
11784 : #ifdef PY_RTS_PATCH
11785 : PY_RTS_PATCH(&dcerpc_rts_Type);
11786 : #endif
11787 : #ifdef PY_PAYLOAD_PATCH
11788 : PY_PAYLOAD_PATCH(&dcerpc_payload_Type);
11789 : #endif
11790 : #ifdef PY_NCACN_PACKET_PATCH
11791 : PY_NCACN_PACKET_PATCH(&ncacn_packet_Type);
11792 : #endif
11793 : #ifdef PY_NCADG_PACKET_PATCH
11794 : PY_NCADG_PACKET_PATCH(&ncadg_packet_Type);
11795 : #endif
11796 : #ifdef PY_SEC_VT_PCONTEXT_PATCH
11797 : PY_SEC_VT_PCONTEXT_PATCH(&dcerpc_sec_vt_pcontext_Type);
11798 : #endif
11799 : #ifdef PY_SEC_VT_HEADER2_PATCH
11800 : PY_SEC_VT_HEADER2_PATCH(&dcerpc_sec_vt_header2_Type);
11801 : #endif
11802 : #ifdef PY_SEC_VT_UNION_PATCH
11803 : PY_SEC_VT_UNION_PATCH(&dcerpc_sec_vt_union_Type);
11804 : #endif
11805 : #ifdef PY_SEC_VT_PATCH
11806 : PY_SEC_VT_PATCH(&dcerpc_sec_vt_Type);
11807 : #endif
11808 : #ifdef PY_SEC_VT_COUNT_PATCH
11809 : PY_SEC_VT_COUNT_PATCH(&dcerpc_sec_vt_count_Type);
11810 : #endif
11811 : #ifdef PY_SEC_VERIFICATION_TRAILER_PATCH
11812 : PY_SEC_VERIFICATION_TRAILER_PATCH(&dcerpc_sec_verification_trailer_Type);
11813 : #endif
11814 :
11815 698 : m = PyModule_Create(&moduledef);
11816 698 : if (m == NULL)
11817 0 : goto out;
11818 :
11819 698 : PyModule_AddObject(m, "DCERPC_REQUEST_LENGTH", PyLong_FromUnsignedLongLong(24));
11820 698 : PyModule_AddObject(m, "DCERPC_BIND_PROVIDER_REJECT", PyLong_FromLong(DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION));
11821 698 : PyModule_AddObject(m, "DCERPC_BIND_REASON_ASYNTAX", PyLong_FromLong(DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED));
11822 698 : PyModule_AddObject(m, "DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED", PyLong_FromLong(DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED));
11823 698 : PyModule_AddObject(m, "DCERPC_BIND_REASON_INVALID_AUTH_TYPE", PyLong_FromLong(DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE));
11824 698 : PyModule_AddObject(m, "DCERPC_RESPONSE_LENGTH", PyLong_FromUnsignedLongLong(24));
11825 698 : PyModule_AddObject(m, "DCERPC_FAULT_OP_RNG_ERROR", PyLong_FromLong(DCERPC_NCA_S_OP_RNG_ERROR));
11826 698 : PyModule_AddObject(m, "DCERPC_FAULT_NDR", PyLong_FromLong(DCERPC_FAULT_BAD_STUB_DATA));
11827 698 : PyModule_AddObject(m, "DCERPC_FAULT_INVALID_TAG", PyLong_FromLong(DCERPC_NCA_S_FAULT_INVALID_TAG));
11828 698 : PyModule_AddObject(m, "DCERPC_FAULT_CONTEXT_MISMATCH", PyLong_FromLong(DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH));
11829 698 : PyModule_AddObject(m, "DCERPC_FAULT_OTHER", PyLong_FromUnsignedLongLong(0x00000001));
11830 698 : PyModule_AddObject(m, "DCERPC_FAULT_TODO", PyLong_FromUnsignedLongLong(0x00000042));
11831 698 : PyModule_AddObject(m, "DCERPC_FAULT_LENGTH", PyLong_FromUnsignedLongLong(32));
11832 698 : PyModule_AddObject(m, "AS_SYSTEM_MAGIC_PATH_TOKEN", PyUnicode_FromString("/root/ncalrpc_as_system"));
11833 698 : PyModule_AddObject(m, "DCERPC_AUTH_TRAILER_LENGTH", PyLong_FromUnsignedLongLong(8));
11834 698 : PyModule_AddObject(m, "DCERPC_AUTH_PAD_ALIGNMENT", PyLong_FromUnsignedLongLong(16));
11835 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_PENDING_CANCEL", PyLong_FromLong(DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING));
11836 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN", PyLong_FromLong(DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING));
11837 698 : PyModule_AddObject(m, "DCERPC_PFC_OFFSET", PyLong_FromUnsignedLongLong(3));
11838 698 : PyModule_AddObject(m, "DCERPC_DREP_OFFSET", PyLong_FromUnsignedLongLong(4));
11839 698 : PyModule_AddObject(m, "DCERPC_FRAG_LEN_OFFSET", PyLong_FromUnsignedLongLong(8));
11840 698 : PyModule_AddObject(m, "DCERPC_FRAG_MAX_SIZE", PyLong_FromUnsignedLongLong(5840));
11841 698 : PyModule_AddObject(m, "DCERPC_AUTH_LEN_OFFSET", PyLong_FromUnsignedLongLong(10));
11842 698 : PyModule_AddObject(m, "DCERPC_NCACN_PAYLOAD_OFFSET", PyLong_FromUnsignedLongLong(16));
11843 698 : PyModule_AddObject(m, "DCERPC_NCACN_REQUEST_DEFAULT_MAX_SIZE", PyLong_FromUnsignedLongLong(0x400000));
11844 698 : PyModule_AddObject(m, "DCERPC_NCACN_RESPONSE_DEFAULT_MAX_SIZE", PyLong_FromUnsignedLongLong(0xf000000));
11845 698 : PyModule_AddObject(m, "DCERPC_DREP_LE", PyLong_FromUnsignedLongLong(0x10));
11846 698 : PyModule_AddObject(m, "DCERPC_SEC_VT_MAX_SIZE", PyLong_FromUnsignedLongLong(1024));
11847 698 : PyModule_AddObject(m, "DCERPC_BIND_ACK_RESULT_ACCEPTANCE", PyLong_FromLong((uint16_t)(DCERPC_BIND_ACK_RESULT_ACCEPTANCE)));
11848 698 : PyModule_AddObject(m, "DCERPC_BIND_ACK_RESULT_USER_REJECTION", PyLong_FromLong((uint16_t)(DCERPC_BIND_ACK_RESULT_USER_REJECTION)));
11849 698 : PyModule_AddObject(m, "DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION", PyLong_FromLong((uint16_t)(DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION)));
11850 698 : PyModule_AddObject(m, "DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK", PyLong_FromLong((uint16_t)(DCERPC_BIND_ACK_RESULT_NEGOTIATE_ACK)));
11851 698 : PyModule_AddObject(m, "DCERPC_BIND_ACK_REASON_NOT_SPECIFIED", PyLong_FromLong((uint16_t)(DCERPC_BIND_ACK_REASON_NOT_SPECIFIED)));
11852 698 : PyModule_AddObject(m, "DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED", PyLong_FromLong((uint16_t)(DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED)));
11853 698 : PyModule_AddObject(m, "DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED", PyLong_FromLong((uint16_t)(DCERPC_BIND_ACK_REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED)));
11854 698 : PyModule_AddObject(m, "DCERPC_BIND_ACK_REASON_LOCAL_LIMIT_EXCEEDED", PyLong_FromLong((uint16_t)(DCERPC_BIND_ACK_REASON_LOCAL_LIMIT_EXCEEDED)));
11855 698 : PyModule_AddObject(m, "DCERPC_BIND_TIME_SECURITY_CONTEXT_MULTIPLEXING", PyLong_FromLong((uint16_t)(DCERPC_BIND_TIME_SECURITY_CONTEXT_MULTIPLEXING)));
11856 698 : PyModule_AddObject(m, "DCERPC_BIND_TIME_KEEP_CONNECTION_ON_ORPHAN", PyLong_FromLong((uint16_t)(DCERPC_BIND_TIME_KEEP_CONNECTION_ON_ORPHAN)));
11857 698 : PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_NOT_SPECIFIED", PyLong_FromLong((uint16_t)(DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)));
11858 698 : PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_TEMPORARY_CONGESTION", PyLong_FromLong((uint16_t)(DCERPC_BIND_NAK_REASON_TEMPORARY_CONGESTION)));
11859 698 : PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_LOCAL_LIMIT_EXCEEDED", PyLong_FromLong((uint16_t)(DCERPC_BIND_NAK_REASON_LOCAL_LIMIT_EXCEEDED)));
11860 698 : PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED", PyLong_FromLong((uint16_t)(DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED)));
11861 698 : PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE", PyLong_FromLong((uint16_t)(DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE)));
11862 698 : PyModule_AddObject(m, "DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM", PyLong_FromLong((uint16_t)(DCERPC_BIND_NAK_REASON_INVALID_CHECKSUM)));
11863 698 : PyModule_AddObject(m, "DCERPC_NCA_S_COMM_FAILURE", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_COMM_FAILURE)));
11864 698 : PyModule_AddObject(m, "DCERPC_NCA_S_OP_RNG_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_OP_RNG_ERROR)));
11865 698 : PyModule_AddObject(m, "DCERPC_NCA_S_UNKNOWN_IF", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_UNKNOWN_IF)));
11866 698 : PyModule_AddObject(m, "DCERPC_NCA_S_WRONG_BOOT_TIME", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_WRONG_BOOT_TIME)));
11867 698 : PyModule_AddObject(m, "DCERPC_NCA_S_YOU_CRASHED", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_YOU_CRASHED)));
11868 698 : PyModule_AddObject(m, "DCERPC_NCA_S_PROTO_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_PROTO_ERROR)));
11869 698 : PyModule_AddObject(m, "DCERPC_NCA_S_OUT_ARGS_TOO_BIG", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_OUT_ARGS_TOO_BIG)));
11870 698 : PyModule_AddObject(m, "DCERPC_NCA_S_SERVER_TOO_BUSY", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_SERVER_TOO_BUSY)));
11871 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_STRING_TOO_LARGE", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_STRING_TOO_LARGE)));
11872 698 : PyModule_AddObject(m, "DCERPC_NCA_S_UNSUPPORTED_TYPE", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_UNSUPPORTED_TYPE)));
11873 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_INT_DIV_BY_ZERO", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_INT_DIV_BY_ZERO)));
11874 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_ADDR_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_ADDR_ERROR)));
11875 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_FP_DIV_BY_ZERO", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_FP_DIV_BY_ZERO)));
11876 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_FP_UNDERFLOW", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_FP_UNDERFLOW)));
11877 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_FP_OVERRFLOW", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_FP_OVERRFLOW)));
11878 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_INVALID_TAG", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_INVALID_TAG)));
11879 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_INVALID_BOUND", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_INVALID_BOUND)));
11880 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH)));
11881 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_UNSPEC_REJECT", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_UNSPEC_REJECT)));
11882 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_BAD_ACTID", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_BAD_ACTID)));
11883 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED)));
11884 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED)));
11885 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_CANCEL", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_CANCEL)));
11886 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_ILL_INST", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_ILL_INST)));
11887 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_FP_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_FP_ERROR)));
11888 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_INT_OVERFLOW", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_INT_OVERFLOW)));
11889 698 : PyModule_AddObject(m, "DCERPC_NCA_S_UNUSED_1C000011", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_UNUSED_1C000011)));
11890 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_UNSPEC", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_UNSPEC)));
11891 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE)));
11892 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_EMPTY", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_PIPE_EMPTY)));
11893 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_CLOSED", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_PIPE_CLOSED)));
11894 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_ORDER", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_PIPE_ORDER)));
11895 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_DISCIPLINE", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_PIPE_DISCIPLINE)));
11896 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_COMM_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_PIPE_COMM_ERROR)));
11897 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_PIPE_MEMORY", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_PIPE_MEMORY)));
11898 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH)));
11899 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY)));
11900 698 : PyModule_AddObject(m, "DCERPC_NCA_S_INVALID_PRES_CONTEXT_ID", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_INVALID_PRES_CONTEXT_ID)));
11901 698 : PyModule_AddObject(m, "DCERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL)));
11902 698 : PyModule_AddObject(m, "DCERPC_NCA_S_UNUSED_1C00001E", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_UNUSED_1C00001E)));
11903 698 : PyModule_AddObject(m, "DCERPC_NCA_S_INVALID_CHECKSUM", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_INVALID_CHECKSUM)));
11904 698 : PyModule_AddObject(m, "DCERPC_NCA_S_INVALID_CRC", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_INVALID_CRC)));
11905 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_USER_DEFINED", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_USER_DEFINED)));
11906 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_TX_OPEN_FAILED", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_TX_OPEN_FAILED)));
11907 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR)));
11908 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND)));
11909 698 : PyModule_AddObject(m, "DCERPC_NCA_S_FAULT_NO_CLIENT_STUB", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_NCA_S_FAULT_NO_CLIENT_STUB)));
11910 698 : PyModule_AddObject(m, "DCERPC_FAULT_ACCESS_DENIED", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_FAULT_ACCESS_DENIED)));
11911 698 : PyModule_AddObject(m, "DCERPC_FAULT_SERVER_UNAVAILABLE", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_FAULT_SERVER_UNAVAILABLE)));
11912 698 : PyModule_AddObject(m, "DCERPC_FAULT_NO_CALL_ACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_FAULT_NO_CALL_ACTIVE)));
11913 698 : PyModule_AddObject(m, "DCERPC_FAULT_CANT_PERFORM", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_FAULT_CANT_PERFORM)));
11914 698 : PyModule_AddObject(m, "DCERPC_FAULT_OUT_OF_RESOURCES", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_FAULT_OUT_OF_RESOURCES)));
11915 698 : PyModule_AddObject(m, "DCERPC_FAULT_BAD_STUB_DATA", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_FAULT_BAD_STUB_DATA)));
11916 698 : PyModule_AddObject(m, "DCERPC_FAULT_SEC_PKG_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_FAULT_SEC_PKG_ERROR)));
11917 698 : PyModule_AddObject(m, "DCERPC_FAULT_FLAG_EXTENDED_ERROR_INFORMATION", PyLong_FromLong((uint16_t)(DCERPC_FAULT_FLAG_EXTENDED_ERROR_INFORMATION)));
11918 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_NONE", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_NONE)));
11919 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_KRB5_1", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_KRB5_1)));
11920 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_SPNEGO", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_SPNEGO)));
11921 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_NTLMSSP", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_NTLMSSP)));
11922 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_KRB5", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_KRB5)));
11923 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_DPA", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_DPA)));
11924 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_MSN", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_MSN)));
11925 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_DIGEST", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_DIGEST)));
11926 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_SCHANNEL", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_SCHANNEL)));
11927 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_MSMQ", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_MSMQ)));
11928 698 : PyModule_AddObject(m, "DCERPC_AUTH_TYPE_NCALRPC_AS_SYSTEM", PyLong_FromLong((uint16_t)(DCERPC_AUTH_TYPE_NCALRPC_AS_SYSTEM)));
11929 698 : PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_NONE", PyLong_FromLong((uint16_t)(DCERPC_AUTH_LEVEL_NONE)));
11930 698 : PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_CONNECT", PyLong_FromLong((uint16_t)(DCERPC_AUTH_LEVEL_CONNECT)));
11931 698 : PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_CALL", PyLong_FromLong((uint16_t)(DCERPC_AUTH_LEVEL_CALL)));
11932 698 : PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_PACKET", PyLong_FromLong((uint16_t)(DCERPC_AUTH_LEVEL_PACKET)));
11933 698 : PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_INTEGRITY", PyLong_FromLong((uint16_t)(DCERPC_AUTH_LEVEL_INTEGRITY)));
11934 698 : PyModule_AddObject(m, "DCERPC_AUTH_LEVEL_PRIVACY", PyLong_FromLong((uint16_t)(DCERPC_AUTH_LEVEL_PRIVACY)));
11935 698 : PyModule_AddObject(m, "RTS_IPV4", PyLong_FromUnsignedLongLong((uint32_t)(RTS_IPV4)));
11936 698 : PyModule_AddObject(m, "RTS_IPV6", PyLong_FromUnsignedLongLong((uint32_t)(RTS_IPV6)));
11937 698 : PyModule_AddObject(m, "FDClient", PyLong_FromUnsignedLongLong((uint32_t)(FDClient)));
11938 698 : PyModule_AddObject(m, "FDInProxy", PyLong_FromUnsignedLongLong((uint32_t)(FDInProxy)));
11939 698 : PyModule_AddObject(m, "FDServer", PyLong_FromUnsignedLongLong((uint32_t)(FDServer)));
11940 698 : PyModule_AddObject(m, "FDOutProxy", PyLong_FromUnsignedLongLong((uint32_t)(FDOutProxy)));
11941 698 : PyModule_AddObject(m, "RTS_FLAG_NONE", PyLong_FromLong((uint16_t)(RTS_FLAG_NONE)));
11942 698 : PyModule_AddObject(m, "RTS_FLAG_PING", PyLong_FromLong((uint16_t)(RTS_FLAG_PING)));
11943 698 : PyModule_AddObject(m, "RTS_FLAG_OTHER_CMD", PyLong_FromLong((uint16_t)(RTS_FLAG_OTHER_CMD)));
11944 698 : PyModule_AddObject(m, "RTS_FLAG_RECYCLE_CHANNEL", PyLong_FromLong((uint16_t)(RTS_FLAG_RECYCLE_CHANNEL)));
11945 698 : PyModule_AddObject(m, "RTS_FLAG_IN_CHANNEL", PyLong_FromLong((uint16_t)(RTS_FLAG_IN_CHANNEL)));
11946 698 : PyModule_AddObject(m, "RTS_FLAG_OUT_CHANNEL", PyLong_FromLong((uint16_t)(RTS_FLAG_OUT_CHANNEL)));
11947 698 : PyModule_AddObject(m, "RTS_FLAG_EOF", PyLong_FromLong((uint16_t)(RTS_FLAG_EOF)));
11948 698 : PyModule_AddObject(m, "RTS_FLAG_ECHO", PyLong_FromLong((uint16_t)(RTS_FLAG_ECHO)));
11949 698 : PyModule_AddObject(m, "DCERPC_PKT_REQUEST", PyLong_FromLong((uint16_t)(DCERPC_PKT_REQUEST)));
11950 698 : PyModule_AddObject(m, "DCERPC_PKT_PING", PyLong_FromLong((uint16_t)(DCERPC_PKT_PING)));
11951 698 : PyModule_AddObject(m, "DCERPC_PKT_RESPONSE", PyLong_FromLong((uint16_t)(DCERPC_PKT_RESPONSE)));
11952 698 : PyModule_AddObject(m, "DCERPC_PKT_FAULT", PyLong_FromLong((uint16_t)(DCERPC_PKT_FAULT)));
11953 698 : PyModule_AddObject(m, "DCERPC_PKT_WORKING", PyLong_FromLong((uint16_t)(DCERPC_PKT_WORKING)));
11954 698 : PyModule_AddObject(m, "DCERPC_PKT_NOCALL", PyLong_FromLong((uint16_t)(DCERPC_PKT_NOCALL)));
11955 698 : PyModule_AddObject(m, "DCERPC_PKT_REJECT", PyLong_FromLong((uint16_t)(DCERPC_PKT_REJECT)));
11956 698 : PyModule_AddObject(m, "DCERPC_PKT_ACK", PyLong_FromLong((uint16_t)(DCERPC_PKT_ACK)));
11957 698 : PyModule_AddObject(m, "DCERPC_PKT_CL_CANCEL", PyLong_FromLong((uint16_t)(DCERPC_PKT_CL_CANCEL)));
11958 698 : PyModule_AddObject(m, "DCERPC_PKT_FACK", PyLong_FromLong((uint16_t)(DCERPC_PKT_FACK)));
11959 698 : PyModule_AddObject(m, "DCERPC_PKT_CANCEL_ACK", PyLong_FromLong((uint16_t)(DCERPC_PKT_CANCEL_ACK)));
11960 698 : PyModule_AddObject(m, "DCERPC_PKT_BIND", PyLong_FromLong((uint16_t)(DCERPC_PKT_BIND)));
11961 698 : PyModule_AddObject(m, "DCERPC_PKT_BIND_ACK", PyLong_FromLong((uint16_t)(DCERPC_PKT_BIND_ACK)));
11962 698 : PyModule_AddObject(m, "DCERPC_PKT_BIND_NAK", PyLong_FromLong((uint16_t)(DCERPC_PKT_BIND_NAK)));
11963 698 : PyModule_AddObject(m, "DCERPC_PKT_ALTER", PyLong_FromLong((uint16_t)(DCERPC_PKT_ALTER)));
11964 698 : PyModule_AddObject(m, "DCERPC_PKT_ALTER_RESP", PyLong_FromLong((uint16_t)(DCERPC_PKT_ALTER_RESP)));
11965 698 : PyModule_AddObject(m, "DCERPC_PKT_AUTH3", PyLong_FromLong((uint16_t)(DCERPC_PKT_AUTH3)));
11966 698 : PyModule_AddObject(m, "DCERPC_PKT_SHUTDOWN", PyLong_FromLong((uint16_t)(DCERPC_PKT_SHUTDOWN)));
11967 698 : PyModule_AddObject(m, "DCERPC_PKT_CO_CANCEL", PyLong_FromLong((uint16_t)(DCERPC_PKT_CO_CANCEL)));
11968 698 : PyModule_AddObject(m, "DCERPC_PKT_ORPHANED", PyLong_FromLong((uint16_t)(DCERPC_PKT_ORPHANED)));
11969 698 : PyModule_AddObject(m, "DCERPC_PKT_RTS", PyLong_FromLong((uint16_t)(DCERPC_PKT_RTS)));
11970 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_FIRST", PyLong_FromLong((uint16_t)(DCERPC_PFC_FLAG_FIRST)));
11971 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_LAST", PyLong_FromLong((uint16_t)(DCERPC_PFC_FLAG_LAST)));
11972 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING", PyLong_FromLong((uint16_t)(DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING)));
11973 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_CONC_MPX", PyLong_FromLong((uint16_t)(DCERPC_PFC_FLAG_CONC_MPX)));
11974 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_DID_NOT_EXECUTE", PyLong_FromLong((uint16_t)(DCERPC_PFC_FLAG_DID_NOT_EXECUTE)));
11975 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_MAYBE", PyLong_FromLong((uint16_t)(DCERPC_PFC_FLAG_MAYBE)));
11976 698 : PyModule_AddObject(m, "DCERPC_PFC_FLAG_OBJECT_UUID", PyLong_FromLong((uint16_t)(DCERPC_PFC_FLAG_OBJECT_UUID)));
11977 698 : PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_ENUM", PyLong_FromLong((uint16_t)(DCERPC_SEC_VT_COMMAND_ENUM)));
11978 698 : PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_END", PyLong_FromLong((uint16_t)(DCERPC_SEC_VT_COMMAND_END)));
11979 698 : PyModule_AddObject(m, "DCERPC_SEC_VT_MUST_PROCESS", PyLong_FromLong((uint16_t)(DCERPC_SEC_VT_MUST_PROCESS)));
11980 698 : PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_BITMASK1", PyLong_FromLong((uint16_t)(DCERPC_SEC_VT_COMMAND_BITMASK1)));
11981 698 : PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_PCONTEXT", PyLong_FromLong((uint16_t)(DCERPC_SEC_VT_COMMAND_PCONTEXT)));
11982 698 : PyModule_AddObject(m, "DCERPC_SEC_VT_COMMAND_HEADER2", PyLong_FromLong((uint16_t)(DCERPC_SEC_VT_COMMAND_HEADER2)));
11983 698 : PyModule_AddObject(m, "DCERPC_SEC_VT_CLIENT_SUPPORTS_HEADER_SIGNING", PyLong_FromUnsignedLongLong((uint32_t)(DCERPC_SEC_VT_CLIENT_SUPPORTS_HEADER_SIGNING)));
11984 522 : Py_INCREF((PyObject *)(void *)&dcerpc_ctx_list_Type);
11985 698 : PyModule_AddObject(m, "ctx_list", (PyObject *)(void *)&dcerpc_ctx_list_Type);
11986 522 : Py_INCREF((PyObject *)(void *)&dcerpc_bind_Type);
11987 698 : PyModule_AddObject(m, "bind", (PyObject *)(void *)&dcerpc_bind_Type);
11988 522 : Py_INCREF((PyObject *)(void *)&dcerpc_empty_Type);
11989 698 : PyModule_AddObject(m, "empty", (PyObject *)(void *)&dcerpc_empty_Type);
11990 522 : Py_INCREF((PyObject *)(void *)&dcerpc_object_Type);
11991 698 : PyModule_AddObject(m, "object", (PyObject *)(void *)&dcerpc_object_Type);
11992 522 : Py_INCREF((PyObject *)(void *)&dcerpc_request_Type);
11993 698 : PyModule_AddObject(m, "request", (PyObject *)(void *)&dcerpc_request_Type);
11994 522 : Py_INCREF((PyObject *)(void *)&dcerpc_bind_ack_reason_Type);
11995 698 : PyModule_AddObject(m, "bind_ack_reason", (PyObject *)(void *)&dcerpc_bind_ack_reason_Type);
11996 522 : Py_INCREF((PyObject *)(void *)&dcerpc_ack_ctx_Type);
11997 698 : PyModule_AddObject(m, "ack_ctx", (PyObject *)(void *)&dcerpc_ack_ctx_Type);
11998 522 : Py_INCREF((PyObject *)(void *)&dcerpc_bind_ack_Type);
11999 698 : PyModule_AddObject(m, "bind_ack", (PyObject *)(void *)&dcerpc_bind_ack_Type);
12000 522 : Py_INCREF((PyObject *)(void *)&dcerpc_bind_nak_version_Type);
12001 698 : PyModule_AddObject(m, "bind_nak_version", (PyObject *)(void *)&dcerpc_bind_nak_version_Type);
12002 522 : Py_INCREF((PyObject *)(void *)&dcerpc_bind_nak_Type);
12003 698 : PyModule_AddObject(m, "bind_nak", (PyObject *)(void *)&dcerpc_bind_nak_Type);
12004 522 : Py_INCREF((PyObject *)(void *)&dcerpc_response_Type);
12005 698 : PyModule_AddObject(m, "response", (PyObject *)(void *)&dcerpc_response_Type);
12006 522 : Py_INCREF((PyObject *)(void *)&dcerpc_fault_Type);
12007 698 : PyModule_AddObject(m, "fault", (PyObject *)(void *)&dcerpc_fault_Type);
12008 522 : Py_INCREF((PyObject *)(void *)&dcerpc_auth_Type);
12009 698 : PyModule_AddObject(m, "auth", (PyObject *)(void *)&dcerpc_auth_Type);
12010 522 : Py_INCREF((PyObject *)(void *)&dcerpc_auth3_Type);
12011 698 : PyModule_AddObject(m, "auth3", (PyObject *)(void *)&dcerpc_auth3_Type);
12012 522 : Py_INCREF((PyObject *)(void *)&dcerpc_orphaned_Type);
12013 698 : PyModule_AddObject(m, "orphaned", (PyObject *)(void *)&dcerpc_orphaned_Type);
12014 522 : Py_INCREF((PyObject *)(void *)&dcerpc_co_cancel_Type);
12015 698 : PyModule_AddObject(m, "co_cancel", (PyObject *)(void *)&dcerpc_co_cancel_Type);
12016 522 : Py_INCREF((PyObject *)(void *)&dcerpc_cl_cancel_Type);
12017 698 : PyModule_AddObject(m, "cl_cancel", (PyObject *)(void *)&dcerpc_cl_cancel_Type);
12018 522 : Py_INCREF((PyObject *)(void *)&dcerpc_cancel_ack_Type);
12019 698 : PyModule_AddObject(m, "cancel_ack", (PyObject *)(void *)&dcerpc_cancel_ack_Type);
12020 522 : Py_INCREF((PyObject *)(void *)&dcerpc_fack_Type);
12021 698 : PyModule_AddObject(m, "fack", (PyObject *)(void *)&dcerpc_fack_Type);
12022 522 : Py_INCREF((PyObject *)(void *)&dcerpc_ack_Type);
12023 698 : PyModule_AddObject(m, "ack", (PyObject *)(void *)&dcerpc_ack_Type);
12024 522 : Py_INCREF((PyObject *)(void *)&dcerpc_ping_Type);
12025 698 : PyModule_AddObject(m, "ping", (PyObject *)(void *)&dcerpc_ping_Type);
12026 522 : Py_INCREF((PyObject *)(void *)&dcerpc_shutdown_Type);
12027 698 : PyModule_AddObject(m, "shutdown", (PyObject *)(void *)&dcerpc_shutdown_Type);
12028 522 : Py_INCREF((PyObject *)(void *)&dcerpc_working_Type);
12029 698 : PyModule_AddObject(m, "working", (PyObject *)(void *)&dcerpc_working_Type);
12030 522 : Py_INCREF((PyObject *)(void *)&RTSCookie_Type);
12031 698 : PyModule_AddObject(m, "RTSCookie", (PyObject *)(void *)&RTSCookie_Type);
12032 522 : Py_INCREF((PyObject *)(void *)&ClientAddressType_Type);
12033 698 : PyModule_AddObject(m, "ClientAddressType", (PyObject *)(void *)&ClientAddressType_Type);
12034 522 : Py_INCREF((PyObject *)(void *)&ClientAddress_Type);
12035 698 : PyModule_AddObject(m, "ClientAddress", (PyObject *)(void *)&ClientAddress_Type);
12036 522 : Py_INCREF((PyObject *)(void *)&FlowControlAcknowledgment_Type);
12037 698 : PyModule_AddObject(m, "FlowControlAcknowledgment", (PyObject *)(void *)&FlowControlAcknowledgment_Type);
12038 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ReceiveWindowSize_Type);
12039 698 : PyModule_AddObject(m, "rts_cmd_ReceiveWindowSize", (PyObject *)(void *)&dcerpc_rts_cmd_ReceiveWindowSize_Type);
12040 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_FlowControlAck_Type);
12041 698 : PyModule_AddObject(m, "rts_cmd_FlowControlAck", (PyObject *)(void *)&dcerpc_rts_cmd_FlowControlAck_Type);
12042 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ConnectionTimeout_Type);
12043 698 : PyModule_AddObject(m, "rts_cmd_ConnectionTimeout", (PyObject *)(void *)&dcerpc_rts_cmd_ConnectionTimeout_Type);
12044 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Cookie_Type);
12045 698 : PyModule_AddObject(m, "rts_cmd_Cookie", (PyObject *)(void *)&dcerpc_rts_cmd_Cookie_Type);
12046 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ChannelLifetime_Type);
12047 698 : PyModule_AddObject(m, "rts_cmd_ChannelLifetime", (PyObject *)(void *)&dcerpc_rts_cmd_ChannelLifetime_Type);
12048 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ClientKeepalive_Type);
12049 698 : PyModule_AddObject(m, "rts_cmd_ClientKeepalive", (PyObject *)(void *)&dcerpc_rts_cmd_ClientKeepalive_Type);
12050 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Version_Type);
12051 698 : PyModule_AddObject(m, "rts_cmd_Version", (PyObject *)(void *)&dcerpc_rts_cmd_Version_Type);
12052 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Empty_Type);
12053 698 : PyModule_AddObject(m, "rts_cmd_Empty", (PyObject *)(void *)&dcerpc_rts_cmd_Empty_Type);
12054 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Padding_Type);
12055 698 : PyModule_AddObject(m, "rts_cmd_Padding", (PyObject *)(void *)&dcerpc_rts_cmd_Padding_Type);
12056 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_NegativeANCE_Type);
12057 698 : PyModule_AddObject(m, "rts_cmd_NegativeANCE", (PyObject *)(void *)&dcerpc_rts_cmd_NegativeANCE_Type);
12058 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ANCE_Type);
12059 698 : PyModule_AddObject(m, "rts_cmd_ANCE", (PyObject *)(void *)&dcerpc_rts_cmd_ANCE_Type);
12060 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_ClientAddress_Type);
12061 698 : PyModule_AddObject(m, "rts_cmd_ClientAddress", (PyObject *)(void *)&dcerpc_rts_cmd_ClientAddress_Type);
12062 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_AssociationGroupId_Type);
12063 698 : PyModule_AddObject(m, "rts_cmd_AssociationGroupId", (PyObject *)(void *)&dcerpc_rts_cmd_AssociationGroupId_Type);
12064 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Destination_Type);
12065 698 : PyModule_AddObject(m, "rts_cmd_Destination", (PyObject *)(void *)&dcerpc_rts_cmd_Destination_Type);
12066 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_PingTrafficSentNotify_Type);
12067 698 : PyModule_AddObject(m, "rts_cmd_PingTrafficSentNotify", (PyObject *)(void *)&dcerpc_rts_cmd_PingTrafficSentNotify_Type);
12068 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmds_Type);
12069 698 : PyModule_AddObject(m, "rts_cmds", (PyObject *)(void *)&dcerpc_rts_cmds_Type);
12070 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_cmd_Type);
12071 698 : PyModule_AddObject(m, "rts_cmd", (PyObject *)(void *)&dcerpc_rts_cmd_Type);
12072 522 : Py_INCREF((PyObject *)(void *)&dcerpc_rts_Type);
12073 698 : PyModule_AddObject(m, "rts", (PyObject *)(void *)&dcerpc_rts_Type);
12074 522 : Py_INCREF((PyObject *)(void *)&dcerpc_payload_Type);
12075 698 : PyModule_AddObject(m, "payload", (PyObject *)(void *)&dcerpc_payload_Type);
12076 522 : Py_INCREF((PyObject *)(void *)&ncacn_packet_Type);
12077 698 : PyModule_AddObject(m, "ncacn_packet", (PyObject *)(void *)&ncacn_packet_Type);
12078 522 : Py_INCREF((PyObject *)(void *)&ncadg_packet_Type);
12079 698 : PyModule_AddObject(m, "ncadg_packet", (PyObject *)(void *)&ncadg_packet_Type);
12080 522 : Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_pcontext_Type);
12081 698 : PyModule_AddObject(m, "sec_vt_pcontext", (PyObject *)(void *)&dcerpc_sec_vt_pcontext_Type);
12082 522 : Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_header2_Type);
12083 698 : PyModule_AddObject(m, "sec_vt_header2", (PyObject *)(void *)&dcerpc_sec_vt_header2_Type);
12084 522 : Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_union_Type);
12085 698 : PyModule_AddObject(m, "sec_vt_union", (PyObject *)(void *)&dcerpc_sec_vt_union_Type);
12086 522 : Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_Type);
12087 698 : PyModule_AddObject(m, "sec_vt", (PyObject *)(void *)&dcerpc_sec_vt_Type);
12088 522 : Py_INCREF((PyObject *)(void *)&dcerpc_sec_vt_count_Type);
12089 698 : PyModule_AddObject(m, "sec_vt_count", (PyObject *)(void *)&dcerpc_sec_vt_count_Type);
12090 522 : Py_INCREF((PyObject *)(void *)&dcerpc_sec_verification_trailer_Type);
12091 698 : PyModule_AddObject(m, "sec_verification_trailer", (PyObject *)(void *)&dcerpc_sec_verification_trailer_Type);
12092 : #ifdef PY_MOD_DCERPC_PATCH
12093 : PY_MOD_DCERPC_PATCH(m);
12094 : #endif
12095 698 : out:
12096 698 : Py_XDECREF(dep_samba_dcerpc_misc);
12097 698 : Py_XDECREF(dep_talloc);
12098 698 : return m;
12099 :
12100 : }
|