2 /* Python wrapper functions auto-generated by pidl */
6 #include "librpc/rpc/pyrpc.h"
7 #include "librpc/rpc/pyrpc_util.h"
8 #include "bin/default/librpc/gen_ndr/ndr_witness.h"
9 #include "bin/default/librpc/gen_ndr/ndr_witness_c.h"
12 * These functions are here to ensure they can be optomised out by
13 * the compiler based on the constant input values
16 static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
32 static inline long long ndr_sizeof2intmax(size_t var_size)
48 static inline PyObject *ndr_PyLong_FromLongLong(long long v)
50 if (v > LONG_MAX || v < LONG_MIN) {
51 return PyLong_FromLongLong(v);
53 return PyInt_FromLong(v);
57 static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)
60 return PyLong_FromUnsignedLongLong(v);
62 return PyInt_FromLong(v);
66 #include "librpc/gen_ndr/misc.h"
67 static PyTypeObject witness_interfaceInfo_Type;
68 static PyTypeObject witness_interfaceList_Type;
69 static PyTypeObject witness_ResourceChange_Type;
70 static PyTypeObject witness_IPaddrInfo_Type;
71 static PyTypeObject witness_IPaddrInfoList_Type;
72 PyObject *py_import_witness_notifyResponse_message(TALLOC_CTX *mem_ctx, int level, union witness_notifyResponse_message *in);
73 union witness_notifyResponse_message *py_export_witness_notifyResponse_message(TALLOC_CTX *mem_ctx, int level, PyObject *in);
74 static PyTypeObject witness_notifyResponse_Type;
75 static PyTypeObject witness_InterfaceType;
77 void initwitness(void);static PyTypeObject *Object_Type;
78 static PyTypeObject *policy_handle_Type;
79 static PyTypeObject *ClientConnection_Type;
80 static PyTypeObject *ndr_syntax_id_Type;
82 static PyObject *py_witness_interfaceInfo_get_group_name(PyObject *obj, void *closure)
84 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
85 PyObject *py_group_name;
86 if (object->group_name == NULL) {
87 py_group_name = Py_None;
88 Py_INCREF(py_group_name);
90 py_group_name = PyUnicode_Decode(object->group_name, strlen(object->group_name), "utf-8", "ignore");
95 static int py_witness_interfaceInfo_set_group_name(PyObject *py_obj, PyObject *value, void *closure)
97 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
98 if (PyUnicode_Check(value)) {
99 object->group_name = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
100 } else if (PyString_Check(value)) {
101 object->group_name = PyString_AS_STRING(value);
103 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
109 static PyObject *py_witness_interfaceInfo_get_version(PyObject *obj, void *closure)
111 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
112 PyObject *py_version;
113 py_version = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version);
117 static int py_witness_interfaceInfo_set_version(PyObject *py_obj, PyObject *value, void *closure)
119 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
121 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
122 if (PyLong_Check(value)) {
123 unsigned long long test_var;
124 test_var = PyLong_AsUnsignedLongLong(value);
125 if (PyErr_Occurred() != NULL) {
128 if (test_var > uint_max) {
129 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
130 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
133 object->version = test_var;
134 } else if (PyInt_Check(value)) {
136 test_var = PyInt_AsLong(value);
137 if (test_var < 0 || test_var > uint_max) {
138 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
139 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
142 object->version = test_var;
144 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
145 PyInt_Type.tp_name, PyLong_Type.tp_name);
152 static PyObject *py_witness_interfaceInfo_get_state(PyObject *obj, void *closure)
154 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
156 py_state = PyInt_FromLong((uint16_t)object->state);
160 static int py_witness_interfaceInfo_set_state(PyObject *py_obj, PyObject *value, void *closure)
162 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
164 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->state));
165 if (PyLong_Check(value)) {
166 unsigned long long test_var;
167 test_var = PyLong_AsUnsignedLongLong(value);
168 if (PyErr_Occurred() != NULL) {
171 if (test_var > uint_max) {
172 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
173 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
176 object->state = test_var;
177 } else if (PyInt_Check(value)) {
179 test_var = PyInt_AsLong(value);
180 if (test_var < 0 || test_var > uint_max) {
181 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
182 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
185 object->state = test_var;
187 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
188 PyInt_Type.tp_name, PyLong_Type.tp_name);
195 static PyObject *py_witness_interfaceInfo_get_ipv4(PyObject *obj, void *closure)
197 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
199 py_ipv4 = PyString_FromStringOrNULL(object->ipv4);
203 static int py_witness_interfaceInfo_set_ipv4(PyObject *py_obj, PyObject *value, void *closure)
205 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
206 object->ipv4 = PyString_AS_STRING(value);
210 static PyObject *py_witness_interfaceInfo_get_ipv6(PyObject *obj, void *closure)
212 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
214 py_ipv6 = PyString_FromStringOrNULL(object->ipv6);
218 static int py_witness_interfaceInfo_set_ipv6(PyObject *py_obj, PyObject *value, void *closure)
220 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
221 object->ipv6 = PyString_AsString(value);
225 static PyObject *py_witness_interfaceInfo_get_flags(PyObject *obj, void *closure)
227 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
229 py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
233 static int py_witness_interfaceInfo_set_flags(PyObject *py_obj, PyObject *value, void *closure)
235 struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
237 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
238 if (PyLong_Check(value)) {
239 unsigned long long test_var;
240 test_var = PyLong_AsUnsignedLongLong(value);
241 if (PyErr_Occurred() != NULL) {
244 if (test_var > uint_max) {
245 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
246 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
249 object->flags = test_var;
250 } else if (PyInt_Check(value)) {
252 test_var = PyInt_AsLong(value);
253 if (test_var < 0 || test_var > uint_max) {
254 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
255 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
258 object->flags = test_var;
260 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
261 PyInt_Type.tp_name, PyLong_Type.tp_name);
268 static PyGetSetDef py_witness_interfaceInfo_getsetters[] = {
269 { discard_const_p(char, "group_name"), py_witness_interfaceInfo_get_group_name, py_witness_interfaceInfo_set_group_name },
270 { discard_const_p(char, "version"), py_witness_interfaceInfo_get_version, py_witness_interfaceInfo_set_version },
271 { discard_const_p(char, "state"), py_witness_interfaceInfo_get_state, py_witness_interfaceInfo_set_state },
272 { discard_const_p(char, "ipv4"), py_witness_interfaceInfo_get_ipv4, py_witness_interfaceInfo_set_ipv4 },
273 { discard_const_p(char, "ipv6"), py_witness_interfaceInfo_get_ipv6, py_witness_interfaceInfo_set_ipv6 },
274 { discard_const_p(char, "flags"), py_witness_interfaceInfo_get_flags, py_witness_interfaceInfo_set_flags },
278 static PyObject *py_witness_interfaceInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
280 return pytalloc_new(struct witness_interfaceInfo, type);
284 static PyTypeObject witness_interfaceInfo_Type = {
285 PyObject_HEAD_INIT(NULL) 0,
286 .tp_name = "witness.interfaceInfo",
287 .tp_getset = py_witness_interfaceInfo_getsetters,
289 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
290 .tp_basicsize = sizeof(pytalloc_Object),
291 .tp_new = py_witness_interfaceInfo_new,
295 static PyObject *py_witness_interfaceList_get_num_interfaces(PyObject *obj, void *closure)
297 struct witness_interfaceList *object = (struct witness_interfaceList *)pytalloc_get_ptr(obj);
298 PyObject *py_num_interfaces;
299 py_num_interfaces = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_interfaces);
300 return py_num_interfaces;
303 static int py_witness_interfaceList_set_num_interfaces(PyObject *py_obj, PyObject *value, void *closure)
305 struct witness_interfaceList *object = (struct witness_interfaceList *)pytalloc_get_ptr(py_obj);
307 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_interfaces));
308 if (PyLong_Check(value)) {
309 unsigned long long test_var;
310 test_var = PyLong_AsUnsignedLongLong(value);
311 if (PyErr_Occurred() != NULL) {
314 if (test_var > uint_max) {
315 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
316 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
319 object->num_interfaces = test_var;
320 } else if (PyInt_Check(value)) {
322 test_var = PyInt_AsLong(value);
323 if (test_var < 0 || test_var > uint_max) {
324 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
325 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
328 object->num_interfaces = test_var;
330 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
331 PyInt_Type.tp_name, PyLong_Type.tp_name);
338 static PyObject *py_witness_interfaceList_get_interfaces(PyObject *obj, void *closure)
340 struct witness_interfaceList *object = (struct witness_interfaceList *)pytalloc_get_ptr(obj);
341 PyObject *py_interfaces;
342 if (object->interfaces == NULL) {
343 py_interfaces = Py_None;
344 Py_INCREF(py_interfaces);
346 py_interfaces = PyList_New(object->num_interfaces);
347 if (py_interfaces == NULL) {
351 int interfaces_cntr_1;
352 for (interfaces_cntr_1 = 0; interfaces_cntr_1 < (object->num_interfaces); interfaces_cntr_1++) {
353 PyObject *py_interfaces_1;
354 py_interfaces_1 = pytalloc_reference_ex(&witness_interfaceInfo_Type, object->interfaces, &object->interfaces[interfaces_cntr_1]);
355 PyList_SetItem(py_interfaces, interfaces_cntr_1, py_interfaces_1);
359 return py_interfaces;
362 static int py_witness_interfaceList_set_interfaces(PyObject *py_obj, PyObject *value, void *closure)
364 struct witness_interfaceList *object = (struct witness_interfaceList *)pytalloc_get_ptr(py_obj);
365 talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->interfaces));
366 if (value == Py_None) {
367 object->interfaces = NULL;
369 object->interfaces = NULL;
370 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
372 int interfaces_cntr_1;
373 object->interfaces = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->interfaces, PyList_GET_SIZE(value));
374 if (!object->interfaces) { return -1;; }
375 talloc_set_name_const(object->interfaces, "ARRAY: object->interfaces");
376 for (interfaces_cntr_1 = 0; interfaces_cntr_1 < PyList_GET_SIZE(value); interfaces_cntr_1++) {
377 PY_CHECK_TYPE(&witness_interfaceInfo_Type, PyList_GET_ITEM(value, interfaces_cntr_1), return -1;);
378 if (talloc_reference(object->interfaces, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, interfaces_cntr_1))) == NULL) {
382 object->interfaces[interfaces_cntr_1] = *(struct witness_interfaceInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, interfaces_cntr_1));
389 static PyGetSetDef py_witness_interfaceList_getsetters[] = {
390 { discard_const_p(char, "num_interfaces"), py_witness_interfaceList_get_num_interfaces, py_witness_interfaceList_set_num_interfaces },
391 { discard_const_p(char, "interfaces"), py_witness_interfaceList_get_interfaces, py_witness_interfaceList_set_interfaces },
395 static PyObject *py_witness_interfaceList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
397 return pytalloc_new(struct witness_interfaceList, type);
401 static PyTypeObject witness_interfaceList_Type = {
402 PyObject_HEAD_INIT(NULL) 0,
403 .tp_name = "witness.interfaceList",
404 .tp_getset = py_witness_interfaceList_getsetters,
406 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
407 .tp_basicsize = sizeof(pytalloc_Object),
408 .tp_new = py_witness_interfaceList_new,
412 static PyObject *py_witness_ResourceChange_get_length(PyObject *obj, void *closure)
414 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(obj);
416 py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
420 static int py_witness_ResourceChange_set_length(PyObject *py_obj, PyObject *value, void *closure)
422 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
424 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
425 if (PyLong_Check(value)) {
426 unsigned long long test_var;
427 test_var = PyLong_AsUnsignedLongLong(value);
428 if (PyErr_Occurred() != NULL) {
431 if (test_var > uint_max) {
432 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
433 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
436 object->length = test_var;
437 } else if (PyInt_Check(value)) {
439 test_var = PyInt_AsLong(value);
440 if (test_var < 0 || test_var > uint_max) {
441 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
442 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
445 object->length = test_var;
447 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
448 PyInt_Type.tp_name, PyLong_Type.tp_name);
455 static PyObject *py_witness_ResourceChange_get_type(PyObject *obj, void *closure)
457 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(obj);
459 py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type);
463 static int py_witness_ResourceChange_set_type(PyObject *py_obj, PyObject *value, void *closure)
465 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
467 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
468 if (PyLong_Check(value)) {
469 unsigned long long test_var;
470 test_var = PyLong_AsUnsignedLongLong(value);
471 if (PyErr_Occurred() != NULL) {
474 if (test_var > uint_max) {
475 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
476 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
479 object->type = test_var;
480 } else if (PyInt_Check(value)) {
482 test_var = PyInt_AsLong(value);
483 if (test_var < 0 || test_var > uint_max) {
484 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
485 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
488 object->type = test_var;
490 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
491 PyInt_Type.tp_name, PyLong_Type.tp_name);
498 static PyObject *py_witness_ResourceChange_get_name(PyObject *obj, void *closure)
500 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(obj);
502 py_name = PyString_FromStringOrNULL(object->name);
506 static int py_witness_ResourceChange_set_name(PyObject *py_obj, PyObject *value, void *closure)
508 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
509 object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
513 static PyGetSetDef py_witness_ResourceChange_getsetters[] = {
514 { discard_const_p(char, "length"), py_witness_ResourceChange_get_length, py_witness_ResourceChange_set_length },
515 { discard_const_p(char, "type"), py_witness_ResourceChange_get_type, py_witness_ResourceChange_set_type },
516 { discard_const_p(char, "name"), py_witness_ResourceChange_get_name, py_witness_ResourceChange_set_name },
520 static PyObject *py_witness_ResourceChange_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
522 return pytalloc_new(struct witness_ResourceChange, type);
525 static PyObject *py_witness_ResourceChange_ndr_pack(PyObject *py_obj)
527 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
529 enum ndr_err_code err;
530 err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_witness_ResourceChange);
531 if (err != NDR_ERR_SUCCESS) {
532 PyErr_SetNdrError(err);
536 return PyString_FromStringAndSize((char *)blob.data, blob.length);
539 static PyObject *py_witness_ResourceChange_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
541 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
544 enum ndr_err_code err;
545 const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
546 PyObject *allow_remaining_obj = NULL;
547 bool allow_remaining = false;
549 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
550 discard_const_p(char *, kwnames),
551 &blob.data, &blob_length,
552 &allow_remaining_obj)) {
555 blob.length = blob_length;
557 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
558 allow_remaining = true;
561 if (allow_remaining) {
562 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_witness_ResourceChange);
564 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_witness_ResourceChange);
566 if (err != NDR_ERR_SUCCESS) {
567 PyErr_SetNdrError(err);
574 static PyObject *py_witness_ResourceChange_ndr_print(PyObject *py_obj)
576 struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
580 retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_witness_ResourceChange, "witness_ResourceChange", object);
581 ret = PyString_FromString(retstr);
587 static PyMethodDef py_witness_ResourceChange_methods[] = {
588 { "__ndr_pack__", (PyCFunction)py_witness_ResourceChange_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
589 { "__ndr_unpack__", (PyCFunction)py_witness_ResourceChange_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
590 { "__ndr_print__", (PyCFunction)py_witness_ResourceChange_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
591 { NULL, NULL, 0, NULL }
595 static PyTypeObject witness_ResourceChange_Type = {
596 PyObject_HEAD_INIT(NULL) 0,
597 .tp_name = "witness.ResourceChange",
598 .tp_getset = py_witness_ResourceChange_getsetters,
599 .tp_methods = py_witness_ResourceChange_methods,
600 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
601 .tp_basicsize = sizeof(pytalloc_Object),
602 .tp_new = py_witness_ResourceChange_new,
606 static PyObject *py_witness_IPaddrInfo_get_flags(PyObject *obj, void *closure)
608 struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(obj);
610 py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
614 static int py_witness_IPaddrInfo_set_flags(PyObject *py_obj, PyObject *value, void *closure)
616 struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(py_obj);
618 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
619 if (PyLong_Check(value)) {
620 unsigned long long test_var;
621 test_var = PyLong_AsUnsignedLongLong(value);
622 if (PyErr_Occurred() != NULL) {
625 if (test_var > uint_max) {
626 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
627 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
630 object->flags = test_var;
631 } else if (PyInt_Check(value)) {
633 test_var = PyInt_AsLong(value);
634 if (test_var < 0 || test_var > uint_max) {
635 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
636 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
639 object->flags = test_var;
641 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
642 PyInt_Type.tp_name, PyLong_Type.tp_name);
649 static PyObject *py_witness_IPaddrInfo_get_ipv4(PyObject *obj, void *closure)
651 struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(obj);
653 py_ipv4 = PyString_FromStringOrNULL(object->ipv4);
657 static int py_witness_IPaddrInfo_set_ipv4(PyObject *py_obj, PyObject *value, void *closure)
659 struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(py_obj);
660 object->ipv4 = PyString_AS_STRING(value);
664 static PyObject *py_witness_IPaddrInfo_get_ipv6(PyObject *obj, void *closure)
666 struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(obj);
668 py_ipv6 = PyString_FromStringOrNULL(object->ipv6);
672 static int py_witness_IPaddrInfo_set_ipv6(PyObject *py_obj, PyObject *value, void *closure)
674 struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(py_obj);
675 object->ipv6 = PyString_AsString(value);
679 static PyGetSetDef py_witness_IPaddrInfo_getsetters[] = {
680 { discard_const_p(char, "flags"), py_witness_IPaddrInfo_get_flags, py_witness_IPaddrInfo_set_flags },
681 { discard_const_p(char, "ipv4"), py_witness_IPaddrInfo_get_ipv4, py_witness_IPaddrInfo_set_ipv4 },
682 { discard_const_p(char, "ipv6"), py_witness_IPaddrInfo_get_ipv6, py_witness_IPaddrInfo_set_ipv6 },
686 static PyObject *py_witness_IPaddrInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
688 return pytalloc_new(struct witness_IPaddrInfo, type);
692 static PyTypeObject witness_IPaddrInfo_Type = {
693 PyObject_HEAD_INIT(NULL) 0,
694 .tp_name = "witness.IPaddrInfo",
695 .tp_getset = py_witness_IPaddrInfo_getsetters,
697 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
698 .tp_basicsize = sizeof(pytalloc_Object),
699 .tp_new = py_witness_IPaddrInfo_new,
703 static PyObject *py_witness_IPaddrInfoList_get_length(PyObject *obj, void *closure)
705 struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(obj);
707 py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
711 static int py_witness_IPaddrInfoList_set_length(PyObject *py_obj, PyObject *value, void *closure)
713 struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(py_obj);
715 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
716 if (PyLong_Check(value)) {
717 unsigned long long test_var;
718 test_var = PyLong_AsUnsignedLongLong(value);
719 if (PyErr_Occurred() != NULL) {
722 if (test_var > uint_max) {
723 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
724 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
727 object->length = test_var;
728 } else if (PyInt_Check(value)) {
730 test_var = PyInt_AsLong(value);
731 if (test_var < 0 || test_var > uint_max) {
732 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
733 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
736 object->length = test_var;
738 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
739 PyInt_Type.tp_name, PyLong_Type.tp_name);
746 static PyObject *py_witness_IPaddrInfoList_get_reserved(PyObject *obj, void *closure)
748 struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(obj);
749 PyObject *py_reserved;
750 py_reserved = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
754 static int py_witness_IPaddrInfoList_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
756 struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(py_obj);
758 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
759 if (PyLong_Check(value)) {
760 unsigned long long test_var;
761 test_var = PyLong_AsUnsignedLongLong(value);
762 if (PyErr_Occurred() != NULL) {
765 if (test_var > uint_max) {
766 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
767 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
770 object->reserved = test_var;
771 } else if (PyInt_Check(value)) {
773 test_var = PyInt_AsLong(value);
774 if (test_var < 0 || test_var > uint_max) {
775 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
776 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
779 object->reserved = test_var;
781 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
782 PyInt_Type.tp_name, PyLong_Type.tp_name);
789 static PyObject *py_witness_IPaddrInfoList_get_num(PyObject *obj, void *closure)
791 struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(obj);
793 py_num = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num);
797 static int py_witness_IPaddrInfoList_set_num(PyObject *py_obj, PyObject *value, void *closure)
799 struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(py_obj);
801 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num));
802 if (PyLong_Check(value)) {
803 unsigned long long test_var;
804 test_var = PyLong_AsUnsignedLongLong(value);
805 if (PyErr_Occurred() != NULL) {
808 if (test_var > uint_max) {
809 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
810 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
813 object->num = test_var;
814 } else if (PyInt_Check(value)) {
816 test_var = PyInt_AsLong(value);
817 if (test_var < 0 || test_var > uint_max) {
818 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
819 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
822 object->num = test_var;
824 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
825 PyInt_Type.tp_name, PyLong_Type.tp_name);
832 static PyObject *py_witness_IPaddrInfoList_get_addr(PyObject *obj, void *closure)
834 struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(obj);
836 py_addr = PyList_New(object->num);
837 if (py_addr == NULL) {
842 for (addr_cntr_0 = 0; addr_cntr_0 < (object->num); addr_cntr_0++) {
844 py_addr_0 = pytalloc_reference_ex(&witness_IPaddrInfo_Type, object->addr, &object->addr[addr_cntr_0]);
845 PyList_SetItem(py_addr, addr_cntr_0, py_addr_0);
851 static int py_witness_IPaddrInfoList_set_addr(PyObject *py_obj, PyObject *value, void *closure)
853 struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(py_obj);
854 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
857 object->addr = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->addr, PyList_GET_SIZE(value));
858 if (!object->addr) { return -1;; }
859 talloc_set_name_const(object->addr, "ARRAY: object->addr");
860 for (addr_cntr_0 = 0; addr_cntr_0 < PyList_GET_SIZE(value); addr_cntr_0++) {
861 PY_CHECK_TYPE(&witness_IPaddrInfo_Type, PyList_GET_ITEM(value, addr_cntr_0), return -1;);
862 if (talloc_reference(object->addr, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addr_cntr_0))) == NULL) {
866 object->addr[addr_cntr_0] = *(struct witness_IPaddrInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, addr_cntr_0));
872 static PyGetSetDef py_witness_IPaddrInfoList_getsetters[] = {
873 { discard_const_p(char, "length"), py_witness_IPaddrInfoList_get_length, py_witness_IPaddrInfoList_set_length },
874 { discard_const_p(char, "reserved"), py_witness_IPaddrInfoList_get_reserved, py_witness_IPaddrInfoList_set_reserved },
875 { discard_const_p(char, "num"), py_witness_IPaddrInfoList_get_num, py_witness_IPaddrInfoList_set_num },
876 { discard_const_p(char, "addr"), py_witness_IPaddrInfoList_get_addr, py_witness_IPaddrInfoList_set_addr },
880 static PyObject *py_witness_IPaddrInfoList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
882 return pytalloc_new(struct witness_IPaddrInfoList, type);
886 static PyTypeObject witness_IPaddrInfoList_Type = {
887 PyObject_HEAD_INIT(NULL) 0,
888 .tp_name = "witness.IPaddrInfoList",
889 .tp_getset = py_witness_IPaddrInfoList_getsetters,
891 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
892 .tp_basicsize = sizeof(pytalloc_Object),
893 .tp_new = py_witness_IPaddrInfoList_new,
896 PyObject *py_import_witness_notifyResponse_message(TALLOC_CTX *mem_ctx, int level, union witness_notifyResponse_message *in)
901 case WITNESS_NOTIFY_RESOURCE_CHANGE:
902 ret = pytalloc_reference_ex(&witness_ResourceChange_Type, mem_ctx, &in->resource_change);
905 case WITNESS_NOTIFY_CLIENT_MOVE:
906 ret = pytalloc_reference_ex(&witness_IPaddrInfoList_Type, mem_ctx, &in->client_move);
909 case WITNESS_NOTIFY_SHARE_MOVE:
910 ret = pytalloc_reference_ex(&witness_IPaddrInfoList_Type, mem_ctx, &in->share_move);
913 case WITNESS_NOTIFY_IP_CHANGE:
914 ret = pytalloc_reference_ex(&witness_IPaddrInfoList_Type, mem_ctx, &in->ip_change);
918 ret = PyString_FromStringAndSize((char *)(in->data).data, (in->data).length);
922 PyErr_SetString(PyExc_TypeError, "unknown union level");
926 union witness_notifyResponse_message *py_export_witness_notifyResponse_message(TALLOC_CTX *mem_ctx, int level, PyObject *in)
928 union witness_notifyResponse_message *ret = talloc_zero(mem_ctx, union witness_notifyResponse_message);
930 case WITNESS_NOTIFY_RESOURCE_CHANGE:
931 PY_CHECK_TYPE(&witness_ResourceChange_Type, in, talloc_free(ret); return NULL;);
932 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
934 talloc_free(ret); return NULL;
936 ret->resource_change = *(struct witness_ResourceChange *)pytalloc_get_ptr(in);
939 case WITNESS_NOTIFY_CLIENT_MOVE:
940 PY_CHECK_TYPE(&witness_IPaddrInfoList_Type, in, talloc_free(ret); return NULL;);
941 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
943 talloc_free(ret); return NULL;
945 ret->client_move = *(struct witness_IPaddrInfoList *)pytalloc_get_ptr(in);
948 case WITNESS_NOTIFY_SHARE_MOVE:
949 PY_CHECK_TYPE(&witness_IPaddrInfoList_Type, in, talloc_free(ret); return NULL;);
950 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
952 talloc_free(ret); return NULL;
954 ret->share_move = *(struct witness_IPaddrInfoList *)pytalloc_get_ptr(in);
957 case WITNESS_NOTIFY_IP_CHANGE:
958 PY_CHECK_TYPE(&witness_IPaddrInfoList_Type, in, talloc_free(ret); return NULL;);
959 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
961 talloc_free(ret); return NULL;
963 ret->ip_change = *(struct witness_IPaddrInfoList *)pytalloc_get_ptr(in);
967 ret->data = data_blob_talloc(mem_ctx, PyString_AS_STRING(in), PyString_GET_SIZE(in));
976 static PyObject *py_witness_notifyResponse_get_type(PyObject *obj, void *closure)
978 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(obj);
980 py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type);
984 static int py_witness_notifyResponse_set_type(PyObject *py_obj, PyObject *value, void *closure)
986 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
988 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
989 if (PyLong_Check(value)) {
990 unsigned long long test_var;
991 test_var = PyLong_AsUnsignedLongLong(value);
992 if (PyErr_Occurred() != NULL) {
995 if (test_var > uint_max) {
996 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
997 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1000 object->type = test_var;
1001 } else if (PyInt_Check(value)) {
1003 test_var = PyInt_AsLong(value);
1004 if (test_var < 0 || test_var > uint_max) {
1005 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1006 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1009 object->type = test_var;
1011 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1012 PyInt_Type.tp_name, PyLong_Type.tp_name);
1019 static PyObject *py_witness_notifyResponse_get_length(PyObject *obj, void *closure)
1021 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(obj);
1022 PyObject *py_length;
1023 py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
1027 static int py_witness_notifyResponse_set_length(PyObject *py_obj, PyObject *value, void *closure)
1029 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
1031 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1032 if (PyLong_Check(value)) {
1033 unsigned long long test_var;
1034 test_var = PyLong_AsUnsignedLongLong(value);
1035 if (PyErr_Occurred() != NULL) {
1038 if (test_var > uint_max) {
1039 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1040 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1043 object->length = test_var;
1044 } else if (PyInt_Check(value)) {
1046 test_var = PyInt_AsLong(value);
1047 if (test_var < 0 || test_var > uint_max) {
1048 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1049 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1052 object->length = test_var;
1054 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1055 PyInt_Type.tp_name, PyLong_Type.tp_name);
1062 static PyObject *py_witness_notifyResponse_get_num(PyObject *obj, void *closure)
1064 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(obj);
1066 py_num = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num);
1070 static int py_witness_notifyResponse_set_num(PyObject *py_obj, PyObject *value, void *closure)
1072 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
1074 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num));
1075 if (PyLong_Check(value)) {
1076 unsigned long long test_var;
1077 test_var = PyLong_AsUnsignedLongLong(value);
1078 if (PyErr_Occurred() != NULL) {
1081 if (test_var > uint_max) {
1082 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1083 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1086 object->num = test_var;
1087 } else if (PyInt_Check(value)) {
1089 test_var = PyInt_AsLong(value);
1090 if (test_var < 0 || test_var > uint_max) {
1091 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1092 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1095 object->num = test_var;
1097 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1098 PyInt_Type.tp_name, PyLong_Type.tp_name);
1105 static PyObject *py_witness_notifyResponse_get_messages(PyObject *obj, void *closure)
1107 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(obj);
1108 PyObject *py_messages;
1109 py_messages = PyList_New(object->num);
1110 if (py_messages == NULL) {
1114 int messages_cntr_0;
1115 for (messages_cntr_0 = 0; messages_cntr_0 < (object->num); messages_cntr_0++) {
1116 PyObject *py_messages_0;
1117 py_messages_0 = py_import_witness_notifyResponse_message(object->messages, object->type, &object->messages[messages_cntr_0]);
1118 if (py_messages_0 == NULL) {
1121 PyList_SetItem(py_messages, messages_cntr_0, py_messages_0);
1127 static int py_witness_notifyResponse_set_messages(PyObject *py_obj, PyObject *value, void *closure)
1129 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
1130 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1132 int messages_cntr_0;
1133 object->messages = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->messages, PyList_GET_SIZE(value));
1134 if (!object->messages) { return -1;; }
1135 talloc_set_name_const(object->messages, "ARRAY: object->messages");
1136 for (messages_cntr_0 = 0; messages_cntr_0 < PyList_GET_SIZE(value); messages_cntr_0++) {
1138 union witness_notifyResponse_message *messages_switch_2;
1139 messages_switch_2 = py_export_witness_notifyResponse_message(object->messages, object->type, PyList_GET_ITEM(value, messages_cntr_0));
1140 if (messages_switch_2 == NULL) {
1143 object->messages[messages_cntr_0] = *messages_switch_2;
1150 static PyGetSetDef py_witness_notifyResponse_getsetters[] = {
1151 { discard_const_p(char, "type"), py_witness_notifyResponse_get_type, py_witness_notifyResponse_set_type },
1152 { discard_const_p(char, "length"), py_witness_notifyResponse_get_length, py_witness_notifyResponse_set_length },
1153 { discard_const_p(char, "num"), py_witness_notifyResponse_get_num, py_witness_notifyResponse_set_num },
1154 { discard_const_p(char, "messages"), py_witness_notifyResponse_get_messages, py_witness_notifyResponse_set_messages },
1158 static PyObject *py_witness_notifyResponse_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1160 return pytalloc_new(struct witness_notifyResponse, type);
1163 static PyObject *py_witness_notifyResponse_ndr_pack(PyObject *py_obj)
1165 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
1167 enum ndr_err_code err;
1168 err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_witness_notifyResponse);
1169 if (err != NDR_ERR_SUCCESS) {
1170 PyErr_SetNdrError(err);
1174 return PyString_FromStringAndSize((char *)blob.data, blob.length);
1177 static PyObject *py_witness_notifyResponse_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1179 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
1181 int blob_length = 0;
1182 enum ndr_err_code err;
1183 const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1184 PyObject *allow_remaining_obj = NULL;
1185 bool allow_remaining = false;
1187 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
1188 discard_const_p(char *, kwnames),
1189 &blob.data, &blob_length,
1190 &allow_remaining_obj)) {
1193 blob.length = blob_length;
1195 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1196 allow_remaining = true;
1199 if (allow_remaining) {
1200 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_witness_notifyResponse);
1202 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_witness_notifyResponse);
1204 if (err != NDR_ERR_SUCCESS) {
1205 PyErr_SetNdrError(err);
1212 static PyObject *py_witness_notifyResponse_ndr_print(PyObject *py_obj)
1214 struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
1218 retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_witness_notifyResponse, "witness_notifyResponse", object);
1219 ret = PyString_FromString(retstr);
1220 talloc_free(retstr);
1225 static PyMethodDef py_witness_notifyResponse_methods[] = {
1226 { "__ndr_pack__", (PyCFunction)py_witness_notifyResponse_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1227 { "__ndr_unpack__", (PyCFunction)py_witness_notifyResponse_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
1228 { "__ndr_print__", (PyCFunction)py_witness_notifyResponse_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
1229 { NULL, NULL, 0, NULL }
1233 static PyTypeObject witness_notifyResponse_Type = {
1234 PyObject_HEAD_INIT(NULL) 0,
1235 .tp_name = "witness.notifyResponse",
1236 .tp_getset = py_witness_notifyResponse_getsetters,
1237 .tp_methods = py_witness_notifyResponse_methods,
1238 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1239 .tp_basicsize = sizeof(pytalloc_Object),
1240 .tp_new = py_witness_notifyResponse_new,
1244 static bool pack_py_witness_GetInterfaceList_args_in(PyObject *args, PyObject *kwargs, struct witness_GetInterfaceList *r)
1246 const char *kwnames[] = {
1250 if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":witness_GetInterfaceList", discard_const_p(char *, kwnames))) {
1257 static PyObject *unpack_py_witness_GetInterfaceList_args_out(struct witness_GetInterfaceList *r)
1260 PyObject *py_interface_list;
1261 if (*r->out.interface_list == NULL) {
1262 py_interface_list = Py_None;
1263 Py_INCREF(py_interface_list);
1265 py_interface_list = pytalloc_reference_ex(&witness_interfaceList_Type, *r->out.interface_list, *r->out.interface_list);
1267 result = py_interface_list;
1268 if (!W_ERROR_IS_OK(r->out.result)) {
1269 PyErr_SetWERROR(r->out.result);
1276 static bool pack_py_witness_Register_args_in(PyObject *args, PyObject *kwargs, struct witness_Register *r)
1278 PyObject *py_version;
1279 PyObject *py_net_name;
1280 PyObject *py_ip_address;
1281 PyObject *py_client_computer_name;
1282 const char *kwnames[] = {
1283 "version", "net_name", "ip_address", "client_computer_name", NULL
1286 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:witness_Register", discard_const_p(char *, kwnames), &py_version, &py_net_name, &py_ip_address, &py_client_computer_name)) {
1291 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.version));
1292 if (PyLong_Check(py_version)) {
1293 unsigned long long test_var;
1294 test_var = PyLong_AsUnsignedLongLong(py_version);
1295 if (PyErr_Occurred() != NULL) {
1298 if (test_var > uint_max) {
1299 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1300 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1303 r->in.version = test_var;
1304 } else if (PyInt_Check(py_version)) {
1306 test_var = PyInt_AsLong(py_version);
1307 if (test_var < 0 || test_var > uint_max) {
1308 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1309 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1312 r->in.version = test_var;
1314 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1315 PyInt_Type.tp_name, PyLong_Type.tp_name);
1319 if (py_net_name == Py_None) {
1320 r->in.net_name = NULL;
1322 r->in.net_name = NULL;
1323 if (PyUnicode_Check(py_net_name)) {
1324 r->in.net_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_net_name, "utf-8", "ignore"));
1325 } else if (PyString_Check(py_net_name)) {
1326 r->in.net_name = PyString_AS_STRING(py_net_name);
1328 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_net_name)->tp_name);
1332 if (py_ip_address == Py_None) {
1333 r->in.ip_address = NULL;
1335 r->in.ip_address = NULL;
1336 if (PyUnicode_Check(py_ip_address)) {
1337 r->in.ip_address = PyString_AS_STRING(PyUnicode_AsEncodedString(py_ip_address, "utf-8", "ignore"));
1338 } else if (PyString_Check(py_ip_address)) {
1339 r->in.ip_address = PyString_AS_STRING(py_ip_address);
1341 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ip_address)->tp_name);
1345 if (py_client_computer_name == Py_None) {
1346 r->in.client_computer_name = NULL;
1348 r->in.client_computer_name = NULL;
1349 if (PyUnicode_Check(py_client_computer_name)) {
1350 r->in.client_computer_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_client_computer_name, "utf-8", "ignore"));
1351 } else if (PyString_Check(py_client_computer_name)) {
1352 r->in.client_computer_name = PyString_AS_STRING(py_client_computer_name);
1354 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_computer_name)->tp_name);
1361 static PyObject *unpack_py_witness_Register_args_out(struct witness_Register *r)
1364 PyObject *py_context_handle;
1365 py_context_handle = pytalloc_reference_ex(policy_handle_Type, r->out.context_handle, r->out.context_handle);
1366 result = py_context_handle;
1367 if (!W_ERROR_IS_OK(r->out.result)) {
1368 PyErr_SetWERROR(r->out.result);
1375 static bool pack_py_witness_UnRegister_args_in(PyObject *args, PyObject *kwargs, struct witness_UnRegister *r)
1377 PyObject *py_context_handle;
1378 const char *kwnames[] = {
1379 "context_handle", NULL
1382 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:witness_UnRegister", discard_const_p(char *, kwnames), &py_context_handle)) {
1386 PY_CHECK_TYPE(policy_handle_Type, py_context_handle, return false;);
1387 if (talloc_reference(r, pytalloc_get_mem_ctx(py_context_handle)) == NULL) {
1391 r->in.context_handle = *(struct policy_handle *)pytalloc_get_ptr(py_context_handle);
1395 static PyObject *unpack_py_witness_UnRegister_args_out(struct witness_UnRegister *r)
1400 if (!W_ERROR_IS_OK(r->out.result)) {
1401 PyErr_SetWERROR(r->out.result);
1408 static bool pack_py_witness_AsyncNotify_args_in(PyObject *args, PyObject *kwargs, struct witness_AsyncNotify *r)
1410 PyObject *py_context_handle;
1411 const char *kwnames[] = {
1412 "context_handle", NULL
1415 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:witness_AsyncNotify", discard_const_p(char *, kwnames), &py_context_handle)) {
1419 PY_CHECK_TYPE(policy_handle_Type, py_context_handle, return false;);
1420 if (talloc_reference(r, pytalloc_get_mem_ctx(py_context_handle)) == NULL) {
1424 r->in.context_handle = *(struct policy_handle *)pytalloc_get_ptr(py_context_handle);
1428 static PyObject *unpack_py_witness_AsyncNotify_args_out(struct witness_AsyncNotify *r)
1431 PyObject *py_response;
1432 if (*r->out.response == NULL) {
1433 py_response = Py_None;
1434 Py_INCREF(py_response);
1436 py_response = pytalloc_reference_ex(&witness_notifyResponse_Type, *r->out.response, *r->out.response);
1438 result = py_response;
1439 if (!W_ERROR_IS_OK(r->out.result)) {
1440 PyErr_SetWERROR(r->out.result);
1447 static bool pack_py_witness_RegisterEx_args_in(PyObject *args, PyObject *kwargs, struct witness_RegisterEx *r)
1449 PyObject *py_version;
1450 PyObject *py_net_name;
1451 PyObject *py_share_name;
1452 PyObject *py_ip_address;
1453 PyObject *py_client_computer_name;
1455 PyObject *py_timeout;
1456 const char *kwnames[] = {
1457 "version", "net_name", "share_name", "ip_address", "client_computer_name", "flags", "timeout", NULL
1460 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:witness_RegisterEx", discard_const_p(char *, kwnames), &py_version, &py_net_name, &py_share_name, &py_ip_address, &py_client_computer_name, &py_flags, &py_timeout)) {
1465 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.version));
1466 if (PyLong_Check(py_version)) {
1467 unsigned long long test_var;
1468 test_var = PyLong_AsUnsignedLongLong(py_version);
1469 if (PyErr_Occurred() != NULL) {
1472 if (test_var > uint_max) {
1473 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1474 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1477 r->in.version = test_var;
1478 } else if (PyInt_Check(py_version)) {
1480 test_var = PyInt_AsLong(py_version);
1481 if (test_var < 0 || test_var > uint_max) {
1482 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1483 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1486 r->in.version = test_var;
1488 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1489 PyInt_Type.tp_name, PyLong_Type.tp_name);
1493 if (py_net_name == Py_None) {
1494 r->in.net_name = NULL;
1496 r->in.net_name = NULL;
1497 if (PyUnicode_Check(py_net_name)) {
1498 r->in.net_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_net_name, "utf-8", "ignore"));
1499 } else if (PyString_Check(py_net_name)) {
1500 r->in.net_name = PyString_AS_STRING(py_net_name);
1502 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_net_name)->tp_name);
1506 if (py_share_name == Py_None) {
1507 r->in.share_name = NULL;
1509 r->in.share_name = NULL;
1510 if (PyUnicode_Check(py_share_name)) {
1511 r->in.share_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_share_name, "utf-8", "ignore"));
1512 } else if (PyString_Check(py_share_name)) {
1513 r->in.share_name = PyString_AS_STRING(py_share_name);
1515 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_name)->tp_name);
1519 if (py_ip_address == Py_None) {
1520 r->in.ip_address = NULL;
1522 r->in.ip_address = NULL;
1523 if (PyUnicode_Check(py_ip_address)) {
1524 r->in.ip_address = PyString_AS_STRING(PyUnicode_AsEncodedString(py_ip_address, "utf-8", "ignore"));
1525 } else if (PyString_Check(py_ip_address)) {
1526 r->in.ip_address = PyString_AS_STRING(py_ip_address);
1528 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ip_address)->tp_name);
1532 if (py_client_computer_name == Py_None) {
1533 r->in.client_computer_name = NULL;
1535 r->in.client_computer_name = NULL;
1536 if (PyUnicode_Check(py_client_computer_name)) {
1537 r->in.client_computer_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_client_computer_name, "utf-8", "ignore"));
1538 } else if (PyString_Check(py_client_computer_name)) {
1539 r->in.client_computer_name = PyString_AS_STRING(py_client_computer_name);
1541 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_computer_name)->tp_name);
1546 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
1547 if (PyLong_Check(py_flags)) {
1548 unsigned long long test_var;
1549 test_var = PyLong_AsUnsignedLongLong(py_flags);
1550 if (PyErr_Occurred() != NULL) {
1553 if (test_var > uint_max) {
1554 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1555 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1558 r->in.flags = test_var;
1559 } else if (PyInt_Check(py_flags)) {
1561 test_var = PyInt_AsLong(py_flags);
1562 if (test_var < 0 || test_var > uint_max) {
1563 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1564 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1567 r->in.flags = test_var;
1569 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1570 PyInt_Type.tp_name, PyLong_Type.tp_name);
1575 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.timeout));
1576 if (PyLong_Check(py_timeout)) {
1577 unsigned long long test_var;
1578 test_var = PyLong_AsUnsignedLongLong(py_timeout);
1579 if (PyErr_Occurred() != NULL) {
1582 if (test_var > uint_max) {
1583 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1584 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1587 r->in.timeout = test_var;
1588 } else if (PyInt_Check(py_timeout)) {
1590 test_var = PyInt_AsLong(py_timeout);
1591 if (test_var < 0 || test_var > uint_max) {
1592 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1593 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1596 r->in.timeout = test_var;
1598 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1599 PyInt_Type.tp_name, PyLong_Type.tp_name);
1606 static PyObject *unpack_py_witness_RegisterEx_args_out(struct witness_RegisterEx *r)
1609 PyObject *py_context_handle;
1610 py_context_handle = pytalloc_reference_ex(policy_handle_Type, r->out.context_handle, r->out.context_handle);
1611 result = py_context_handle;
1612 if (!W_ERROR_IS_OK(r->out.result)) {
1613 PyErr_SetWERROR(r->out.result);
1620 const struct PyNdrRpcMethodDef py_ndr_witness_methods[] = {
1621 { "GetInterfaceList", "S.GetInterfaceList() -> interface_list", (py_dcerpc_call_fn)dcerpc_witness_GetInterfaceList_r, (py_data_pack_fn)pack_py_witness_GetInterfaceList_args_in, (py_data_unpack_fn)unpack_py_witness_GetInterfaceList_args_out, 0, &ndr_table_witness },
1622 { "Register", "S.Register(version, net_name, ip_address, client_computer_name) -> context_handle", (py_dcerpc_call_fn)dcerpc_witness_Register_r, (py_data_pack_fn)pack_py_witness_Register_args_in, (py_data_unpack_fn)unpack_py_witness_Register_args_out, 1, &ndr_table_witness },
1623 { "UnRegister", "S.UnRegister(context_handle) -> None", (py_dcerpc_call_fn)dcerpc_witness_UnRegister_r, (py_data_pack_fn)pack_py_witness_UnRegister_args_in, (py_data_unpack_fn)unpack_py_witness_UnRegister_args_out, 2, &ndr_table_witness },
1624 { "AsyncNotify", "S.AsyncNotify(context_handle) -> response", (py_dcerpc_call_fn)dcerpc_witness_AsyncNotify_r, (py_data_pack_fn)pack_py_witness_AsyncNotify_args_in, (py_data_unpack_fn)unpack_py_witness_AsyncNotify_args_out, 3, &ndr_table_witness },
1625 { "RegisterEx", "S.RegisterEx(version, net_name, share_name, ip_address, client_computer_name, flags, timeout) -> context_handle", (py_dcerpc_call_fn)dcerpc_witness_RegisterEx_r, (py_data_pack_fn)pack_py_witness_RegisterEx_args_in, (py_data_unpack_fn)unpack_py_witness_RegisterEx_args_out, 4, &ndr_table_witness },
1629 static PyObject *interface_witness_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1631 return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_witness);
1634 #define PY_DOC_WITNESS "SMB Witness Service"
1635 static PyTypeObject witness_InterfaceType = {
1636 PyObject_HEAD_INIT(NULL) 0,
1637 .tp_name = "witness.witness",
1638 .tp_basicsize = sizeof(dcerpc_InterfaceObject),
1639 .tp_doc = "witness(binding, lp_ctx=None, credentials=None) -> connection\n"
1641 "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
1642 "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
1643 "credentials should be a credentials.Credentials object.\n\n"PY_DOC_WITNESS,
1644 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1645 .tp_new = interface_witness_new,
1648 static PyObject *syntax_witness_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1650 return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_witness.syntax_id);
1653 #define PY_DOC_WITNESS_SYNTAX "SMB Witness Service"
1654 static PyTypeObject witness_SyntaxType = {
1655 PyObject_HEAD_INIT(NULL) 0,
1656 .tp_name = "witness.witness",
1657 .tp_basicsize = sizeof(pytalloc_Object),
1658 .tp_doc = "abstract_syntax()\n"PY_DOC_WITNESS_SYNTAX,
1659 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1660 .tp_new = syntax_witness_new,
1663 static PyMethodDef witness_methods[] = {
1664 { NULL, NULL, 0, NULL }
1667 void initwitness(void)
1670 PyObject *dep_samba_dcerpc_misc;
1671 PyObject *dep_talloc;
1672 PyObject *dep_samba_dcerpc_base;
1674 dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
1675 if (dep_samba_dcerpc_misc == NULL)
1678 dep_talloc = PyImport_ImportModule("talloc");
1679 if (dep_talloc == NULL)
1682 dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
1683 if (dep_samba_dcerpc_base == NULL)
1686 Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
1687 if (Object_Type == NULL)
1690 policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
1691 if (policy_handle_Type == NULL)
1694 ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
1695 if (ClientConnection_Type == NULL)
1698 ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
1699 if (ndr_syntax_id_Type == NULL)
1702 witness_interfaceInfo_Type.tp_base = Object_Type;
1704 witness_interfaceList_Type.tp_base = Object_Type;
1706 witness_ResourceChange_Type.tp_base = Object_Type;
1708 witness_IPaddrInfo_Type.tp_base = Object_Type;
1710 witness_IPaddrInfoList_Type.tp_base = Object_Type;
1712 witness_notifyResponse_Type.tp_base = Object_Type;
1714 witness_InterfaceType.tp_base = ClientConnection_Type;
1716 witness_SyntaxType.tp_base = ndr_syntax_id_Type;
1718 if (PyType_Ready(&witness_interfaceInfo_Type) < 0)
1720 if (PyType_Ready(&witness_interfaceList_Type) < 0)
1722 if (PyType_Ready(&witness_ResourceChange_Type) < 0)
1724 if (PyType_Ready(&witness_IPaddrInfo_Type) < 0)
1726 if (PyType_Ready(&witness_IPaddrInfoList_Type) < 0)
1728 if (PyType_Ready(&witness_notifyResponse_Type) < 0)
1730 if (PyType_Ready(&witness_InterfaceType) < 0)
1732 if (PyType_Ready(&witness_SyntaxType) < 0)
1734 if (!PyInterface_AddNdrRpcMethods(&witness_InterfaceType, py_ndr_witness_methods))
1737 #ifdef PY_INTERFACEINFO_PATCH
1738 PY_INTERFACEINFO_PATCH(&witness_interfaceInfo_Type);
1740 #ifdef PY_INTERFACELIST_PATCH
1741 PY_INTERFACELIST_PATCH(&witness_interfaceList_Type);
1743 #ifdef PY_RESOURCECHANGE_PATCH
1744 PY_RESOURCECHANGE_PATCH(&witness_ResourceChange_Type);
1746 #ifdef PY_IPADDRINFO_PATCH
1747 PY_IPADDRINFO_PATCH(&witness_IPaddrInfo_Type);
1749 #ifdef PY_IPADDRINFOLIST_PATCH
1750 PY_IPADDRINFOLIST_PATCH(&witness_IPaddrInfoList_Type);
1752 #ifdef PY_NOTIFYRESPONSE_PATCH
1753 PY_NOTIFYRESPONSE_PATCH(&witness_notifyResponse_Type);
1755 #ifdef PY_WITNESS_PATCH
1756 PY_WITNESS_PATCH(&witness_InterfaceType);
1758 #ifdef PY_ABSTRACT_SYNTAX_PATCH
1759 PY_ABSTRACT_SYNTAX_PATCH(&witness_SyntaxType);
1762 m = Py_InitModule3("witness", witness_methods, "witness DCE/RPC");
1766 PyModule_AddObject(m, "WITNESS_V1", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_V1));
1767 PyModule_AddObject(m, "WITNESS_V2", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_V2));
1768 PyModule_AddObject(m, "WITNESS_UNSPECIFIED_VERSION", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_UNSPECIFIED_VERSION));
1769 PyModule_AddObject(m, "WITNESS_STATE_UNKNOWN", PyInt_FromLong((uint16_t)WITNESS_STATE_UNKNOWN));
1770 PyModule_AddObject(m, "WITNESS_STATE_AVAILABLE", PyInt_FromLong((uint16_t)WITNESS_STATE_AVAILABLE));
1771 PyModule_AddObject(m, "WITNESS_STATE_UNAVAILABLE", PyInt_FromLong((uint16_t)WITNESS_STATE_UNAVAILABLE));
1772 PyModule_AddObject(m, "WITNESS_INFO_IPv4_VALID", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_INFO_IPv4_VALID));
1773 PyModule_AddObject(m, "WITNESS_INFO_IPv6_VALID", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_INFO_IPv6_VALID));
1774 PyModule_AddObject(m, "WITNESS_INFO_WITNESS_IF", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_INFO_WITNESS_IF));
1775 PyModule_AddObject(m, "WITNESS_NOTIFY_RESOURCE_CHANGE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_NOTIFY_RESOURCE_CHANGE));
1776 PyModule_AddObject(m, "WITNESS_NOTIFY_CLIENT_MOVE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_NOTIFY_CLIENT_MOVE));
1777 PyModule_AddObject(m, "WITNESS_NOTIFY_SHARE_MOVE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_NOTIFY_SHARE_MOVE));
1778 PyModule_AddObject(m, "WITNESS_NOTIFY_IP_CHANGE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_NOTIFY_IP_CHANGE));
1779 PyModule_AddObject(m, "WITNESS_RESOURCE_STATE_UNKNOWN", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_RESOURCE_STATE_UNKNOWN));
1780 PyModule_AddObject(m, "WITNESS_RESOURCE_STATE_AVAILABLE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_RESOURCE_STATE_AVAILABLE));
1781 PyModule_AddObject(m, "WITNESS_RESOURCE_STATE_UNAVAILABLE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_RESOURCE_STATE_UNAVAILABLE));
1782 PyModule_AddObject(m, "WITNESS_IPADDR_V4", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_IPADDR_V4));
1783 PyModule_AddObject(m, "WITNESS_IPADDR_V6", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_IPADDR_V6));
1784 PyModule_AddObject(m, "WITNESS_IPADDR_ONLINE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_IPADDR_ONLINE));
1785 PyModule_AddObject(m, "WITNESS_IPADDR_OFFLINE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_IPADDR_OFFLINE));
1786 PyModule_AddObject(m, "WITNESS_REGISTER_NONE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_REGISTER_NONE));
1787 PyModule_AddObject(m, "WITNESS_REGISTER_IP_NOTIFICATION", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_REGISTER_IP_NOTIFICATION));
1788 Py_INCREF((PyObject *)(void *)&witness_interfaceInfo_Type);
1789 PyModule_AddObject(m, "interfaceInfo", (PyObject *)(void *)&witness_interfaceInfo_Type);
1790 Py_INCREF((PyObject *)(void *)&witness_interfaceList_Type);
1791 PyModule_AddObject(m, "interfaceList", (PyObject *)(void *)&witness_interfaceList_Type);
1792 Py_INCREF((PyObject *)(void *)&witness_ResourceChange_Type);
1793 PyModule_AddObject(m, "ResourceChange", (PyObject *)(void *)&witness_ResourceChange_Type);
1794 Py_INCREF((PyObject *)(void *)&witness_IPaddrInfo_Type);
1795 PyModule_AddObject(m, "IPaddrInfo", (PyObject *)(void *)&witness_IPaddrInfo_Type);
1796 Py_INCREF((PyObject *)(void *)&witness_IPaddrInfoList_Type);
1797 PyModule_AddObject(m, "IPaddrInfoList", (PyObject *)(void *)&witness_IPaddrInfoList_Type);
1798 Py_INCREF((PyObject *)(void *)&witness_notifyResponse_Type);
1799 PyModule_AddObject(m, "notifyResponse", (PyObject *)(void *)&witness_notifyResponse_Type);
1800 Py_INCREF((PyObject *)(void *)&witness_InterfaceType);
1801 PyModule_AddObject(m, "witness", (PyObject *)(void *)&witness_InterfaceType);
1802 Py_INCREF((PyObject *)(void *)&witness_SyntaxType);
1803 PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&witness_SyntaxType);
1804 #ifdef PY_MOD_WITNESS_PATCH
1805 PY_MOD_WITNESS_PATCH(m);