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/source4/librpc/gen_ndr/ndr_winsif.h"
9 #include "bin/default/source4/librpc/gen_ndr/ndr_winsif_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/nbt.h"
67 static PyTypeObject winsif_Address_Type;
68 static PyTypeObject winsif_RecordAction_Type;
69 static PyTypeObject winsif_AddressVersionMap_Type;
70 static PyTypeObject winsif_ReplCounter_Type;
71 static PyTypeObject winsif_StatCounters_Type;
72 static PyTypeObject winsif_StatTimeStamps_Type;
73 static PyTypeObject winsif_Stat_Type;
74 static PyTypeObject winsif_Results_Type;
75 static PyTypeObject winsif_Records_Type;
76 static PyTypeObject winsif_BrowserInfo_Type;
77 static PyTypeObject winsif_BrowserNames_Type;
78 static PyTypeObject winsif_BindData_Type;
79 static PyTypeObject winsif_ResultsNew_Type;
80 static PyTypeObject winsif_ScavengingRequest_Type;
81 static PyTypeObject winsif_InterfaceType;
83 void initwinsif(void);static PyTypeObject *Object_Type;
84 static PyTypeObject *ClientConnection_Type;
85 static PyTypeObject *ndr_syntax_id_Type;
87 static PyObject *py_winsif_Address_get_type(PyObject *obj, void *closure)
89 struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(obj);
91 py_type = PyInt_FromLong((uint16_t)object->type);
95 static int py_winsif_Address_set_type(PyObject *py_obj, PyObject *value, void *closure)
97 struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(py_obj);
99 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
100 if (PyLong_Check(value)) {
101 unsigned long long test_var;
102 test_var = PyLong_AsUnsignedLongLong(value);
103 if (PyErr_Occurred() != NULL) {
106 if (test_var > uint_max) {
107 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
108 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
111 object->type = test_var;
112 } else if (PyInt_Check(value)) {
114 test_var = PyInt_AsLong(value);
115 if (test_var < 0 || test_var > uint_max) {
116 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
117 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
120 object->type = test_var;
122 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
123 PyInt_Type.tp_name, PyLong_Type.tp_name);
130 static PyObject *py_winsif_Address_get_length(PyObject *obj, void *closure)
132 struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(obj);
134 py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
138 static int py_winsif_Address_set_length(PyObject *py_obj, PyObject *value, void *closure)
140 struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(py_obj);
142 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
143 if (PyLong_Check(value)) {
144 unsigned long long test_var;
145 test_var = PyLong_AsUnsignedLongLong(value);
146 if (PyErr_Occurred() != NULL) {
149 if (test_var > uint_max) {
150 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
151 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
154 object->length = test_var;
155 } else if (PyInt_Check(value)) {
157 test_var = PyInt_AsLong(value);
158 if (test_var < 0 || test_var > uint_max) {
159 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
160 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
163 object->length = test_var;
165 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
166 PyInt_Type.tp_name, PyLong_Type.tp_name);
173 static PyObject *py_winsif_Address_get_addr(PyObject *obj, void *closure)
175 struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(obj);
177 py_addr = PyString_FromStringOrNULL(object->addr);
181 static int py_winsif_Address_set_addr(PyObject *py_obj, PyObject *value, void *closure)
183 struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(py_obj);
184 object->addr = PyString_AS_STRING(value);
188 static PyGetSetDef py_winsif_Address_getsetters[] = {
189 { discard_const_p(char, "type"), py_winsif_Address_get_type, py_winsif_Address_set_type },
190 { discard_const_p(char, "length"), py_winsif_Address_get_length, py_winsif_Address_set_length },
191 { discard_const_p(char, "addr"), py_winsif_Address_get_addr, py_winsif_Address_set_addr },
195 static PyObject *py_winsif_Address_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
197 return pytalloc_new(struct winsif_Address, type);
201 static PyTypeObject winsif_Address_Type = {
202 PyObject_HEAD_INIT(NULL) 0,
203 .tp_name = "winsif.Address",
204 .tp_getset = py_winsif_Address_getsetters,
206 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
207 .tp_basicsize = sizeof(pytalloc_Object),
208 .tp_new = py_winsif_Address_new,
212 static PyObject *py_winsif_RecordAction_get_cmd(PyObject *obj, void *closure)
214 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
216 py_cmd = PyInt_FromLong((uint16_t)object->cmd);
220 static int py_winsif_RecordAction_set_cmd(PyObject *py_obj, PyObject *value, void *closure)
222 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
224 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cmd));
225 if (PyLong_Check(value)) {
226 unsigned long long test_var;
227 test_var = PyLong_AsUnsignedLongLong(value);
228 if (PyErr_Occurred() != NULL) {
231 if (test_var > uint_max) {
232 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
233 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
236 object->cmd = test_var;
237 } else if (PyInt_Check(value)) {
239 test_var = PyInt_AsLong(value);
240 if (test_var < 0 || test_var > uint_max) {
241 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
242 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
245 object->cmd = test_var;
247 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
248 PyInt_Type.tp_name, PyLong_Type.tp_name);
255 static PyObject *py_winsif_RecordAction_get_name(PyObject *obj, void *closure)
257 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
259 if (object->name == NULL) {
263 py_name = PyString_FromStringOrNULL(object->name);
268 static int py_winsif_RecordAction_set_name(PyObject *py_obj, PyObject *value, void *closure)
270 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
271 if (value == Py_None) {
275 object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
280 static PyObject *py_winsif_RecordAction_get_name_len(PyObject *obj, void *closure)
282 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
283 PyObject *py_name_len;
284 py_name_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->name_len);
288 static int py_winsif_RecordAction_set_name_len(PyObject *py_obj, PyObject *value, void *closure)
290 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
292 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name_len));
293 if (PyLong_Check(value)) {
294 unsigned long long test_var;
295 test_var = PyLong_AsUnsignedLongLong(value);
296 if (PyErr_Occurred() != NULL) {
299 if (test_var > uint_max) {
300 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
301 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
304 object->name_len = test_var;
305 } else if (PyInt_Check(value)) {
307 test_var = PyInt_AsLong(value);
308 if (test_var < 0 || test_var > uint_max) {
309 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
310 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
313 object->name_len = test_var;
315 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
316 PyInt_Type.tp_name, PyLong_Type.tp_name);
323 static PyObject *py_winsif_RecordAction_get_record_type(PyObject *obj, void *closure)
325 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
326 PyObject *py_record_type;
327 py_record_type = PyInt_FromLong((uint16_t)object->record_type);
328 return py_record_type;
331 static int py_winsif_RecordAction_set_record_type(PyObject *py_obj, PyObject *value, void *closure)
333 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
335 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->record_type));
336 if (PyLong_Check(value)) {
337 unsigned long long test_var;
338 test_var = PyLong_AsUnsignedLongLong(value);
339 if (PyErr_Occurred() != NULL) {
342 if (test_var > uint_max) {
343 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
344 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
347 object->record_type = test_var;
348 } else if (PyInt_Check(value)) {
350 test_var = PyInt_AsLong(value);
351 if (test_var < 0 || test_var > uint_max) {
352 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
353 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
356 object->record_type = test_var;
358 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
359 PyInt_Type.tp_name, PyLong_Type.tp_name);
366 static PyObject *py_winsif_RecordAction_get_num_of_addresses(PyObject *obj, void *closure)
368 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
369 PyObject *py_num_of_addresses;
370 py_num_of_addresses = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_of_addresses);
371 return py_num_of_addresses;
374 static int py_winsif_RecordAction_set_num_of_addresses(PyObject *py_obj, PyObject *value, void *closure)
376 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
378 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_of_addresses));
379 if (PyLong_Check(value)) {
380 unsigned long long test_var;
381 test_var = PyLong_AsUnsignedLongLong(value);
382 if (PyErr_Occurred() != NULL) {
385 if (test_var > uint_max) {
386 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
387 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
390 object->num_of_addresses = test_var;
391 } else if (PyInt_Check(value)) {
393 test_var = PyInt_AsLong(value);
394 if (test_var < 0 || test_var > uint_max) {
395 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
396 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
399 object->num_of_addresses = test_var;
401 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
402 PyInt_Type.tp_name, PyLong_Type.tp_name);
409 static PyObject *py_winsif_RecordAction_get_addresses(PyObject *obj, void *closure)
411 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
412 PyObject *py_addresses;
413 if (object->addresses == NULL) {
414 py_addresses = Py_None;
415 Py_INCREF(py_addresses);
417 py_addresses = PyList_New(object->num_of_addresses);
418 if (py_addresses == NULL) {
422 int addresses_cntr_1;
423 for (addresses_cntr_1 = 0; addresses_cntr_1 < (object->num_of_addresses); addresses_cntr_1++) {
424 PyObject *py_addresses_1;
425 py_addresses_1 = pytalloc_reference_ex(&winsif_Address_Type, object->addresses, &object->addresses[addresses_cntr_1]);
426 PyList_SetItem(py_addresses, addresses_cntr_1, py_addresses_1);
433 static int py_winsif_RecordAction_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
435 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
436 talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->addresses));
437 if (value == Py_None) {
438 object->addresses = NULL;
440 object->addresses = NULL;
441 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
443 int addresses_cntr_1;
444 object->addresses = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->addresses, PyList_GET_SIZE(value));
445 if (!object->addresses) { return -1;; }
446 talloc_set_name_const(object->addresses, "ARRAY: object->addresses");
447 for (addresses_cntr_1 = 0; addresses_cntr_1 < PyList_GET_SIZE(value); addresses_cntr_1++) {
448 PY_CHECK_TYPE(&winsif_Address_Type, PyList_GET_ITEM(value, addresses_cntr_1), return -1;);
449 if (talloc_reference(object->addresses, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addresses_cntr_1))) == NULL) {
453 object->addresses[addresses_cntr_1] = *(struct winsif_Address *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_1));
460 static PyObject *py_winsif_RecordAction_get_address(PyObject *obj, void *closure)
462 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
463 PyObject *py_address;
464 py_address = pytalloc_reference_ex(&winsif_Address_Type, pytalloc_get_mem_ctx(obj), &object->address);
468 static int py_winsif_RecordAction_set_address(PyObject *py_obj, PyObject *value, void *closure)
470 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
471 PY_CHECK_TYPE(&winsif_Address_Type, value, return -1;);
472 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
476 object->address = *(struct winsif_Address *)pytalloc_get_ptr(value);
480 static PyObject *py_winsif_RecordAction_get_version_number(PyObject *obj, void *closure)
482 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
483 PyObject *py_version_number;
484 py_version_number = ndr_PyLong_FromUnsignedLongLong(object->version_number);
485 return py_version_number;
488 static int py_winsif_RecordAction_set_version_number(PyObject *py_obj, PyObject *value, void *closure)
490 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
492 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_number));
493 if (PyLong_Check(value)) {
494 unsigned long long test_var;
495 test_var = PyLong_AsUnsignedLongLong(value);
496 if (PyErr_Occurred() != NULL) {
499 if (test_var > uint_max) {
500 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
501 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
504 object->version_number = test_var;
505 } else if (PyInt_Check(value)) {
507 test_var = PyInt_AsLong(value);
508 if (test_var < 0 || test_var > uint_max) {
509 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
510 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
513 object->version_number = test_var;
515 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
516 PyInt_Type.tp_name, PyLong_Type.tp_name);
523 static PyObject *py_winsif_RecordAction_get_node_type(PyObject *obj, void *closure)
525 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
526 PyObject *py_node_type;
527 py_node_type = PyInt_FromLong((uint16_t)object->node_type);
531 static int py_winsif_RecordAction_set_node_type(PyObject *py_obj, PyObject *value, void *closure)
533 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
535 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->node_type));
536 if (PyLong_Check(value)) {
537 unsigned long long test_var;
538 test_var = PyLong_AsUnsignedLongLong(value);
539 if (PyErr_Occurred() != NULL) {
542 if (test_var > uint_max) {
543 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
544 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
547 object->node_type = test_var;
548 } else if (PyInt_Check(value)) {
550 test_var = PyInt_AsLong(value);
551 if (test_var < 0 || test_var > uint_max) {
552 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
553 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
556 object->node_type = test_var;
558 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
559 PyInt_Type.tp_name, PyLong_Type.tp_name);
566 static PyObject *py_winsif_RecordAction_get_owner_address(PyObject *obj, void *closure)
568 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
569 PyObject *py_owner_address;
570 py_owner_address = PyString_FromStringOrNULL(object->owner_address);
571 return py_owner_address;
574 static int py_winsif_RecordAction_set_owner_address(PyObject *py_obj, PyObject *value, void *closure)
576 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
577 object->owner_address = PyString_AS_STRING(value);
581 static PyObject *py_winsif_RecordAction_get_record_state(PyObject *obj, void *closure)
583 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
584 PyObject *py_record_state;
585 py_record_state = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->record_state);
586 return py_record_state;
589 static int py_winsif_RecordAction_set_record_state(PyObject *py_obj, PyObject *value, void *closure)
591 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
593 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->record_state));
594 if (PyLong_Check(value)) {
595 unsigned long long test_var;
596 test_var = PyLong_AsUnsignedLongLong(value);
597 if (PyErr_Occurred() != NULL) {
600 if (test_var > uint_max) {
601 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
602 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
605 object->record_state = test_var;
606 } else if (PyInt_Check(value)) {
608 test_var = PyInt_AsLong(value);
609 if (test_var < 0 || test_var > uint_max) {
610 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
611 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
614 object->record_state = test_var;
616 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
617 PyInt_Type.tp_name, PyLong_Type.tp_name);
624 static PyObject *py_winsif_RecordAction_get_is_static(PyObject *obj, void *closure)
626 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
627 PyObject *py_is_static;
628 py_is_static = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->is_static);
632 static int py_winsif_RecordAction_set_is_static(PyObject *py_obj, PyObject *value, void *closure)
634 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
636 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->is_static));
637 if (PyLong_Check(value)) {
638 unsigned long long test_var;
639 test_var = PyLong_AsUnsignedLongLong(value);
640 if (PyErr_Occurred() != NULL) {
643 if (test_var > uint_max) {
644 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
645 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
648 object->is_static = test_var;
649 } else if (PyInt_Check(value)) {
651 test_var = PyInt_AsLong(value);
652 if (test_var < 0 || test_var > uint_max) {
653 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
654 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
657 object->is_static = test_var;
659 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
660 PyInt_Type.tp_name, PyLong_Type.tp_name);
667 static PyObject *py_winsif_RecordAction_get_expire_time(PyObject *obj, void *closure)
669 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
670 PyObject *py_expire_time;
671 py_expire_time = PyInt_FromLong(object->expire_time);
672 return py_expire_time;
675 static int py_winsif_RecordAction_set_expire_time(PyObject *py_obj, PyObject *value, void *closure)
677 struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
679 const long long int_max = ndr_sizeof2intmax(sizeof(object->expire_time));
680 const long long int_min = -int_max - 1;
681 if (PyLong_Check(value)) {
683 test_var = PyLong_AsLongLong(value);
684 if (PyErr_Occurred() != NULL) {
687 if (test_var < int_min || test_var > int_max) {
688 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
689 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
692 object->expire_time = test_var;
693 } else if (PyInt_Check(value)) {
695 test_var = PyInt_AsLong(value);
696 if (test_var < int_min || test_var > int_max) {
697 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
698 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
701 object->expire_time = test_var;
703 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
704 PyInt_Type.tp_name, PyLong_Type.tp_name);
711 static PyGetSetDef py_winsif_RecordAction_getsetters[] = {
712 { discard_const_p(char, "cmd"), py_winsif_RecordAction_get_cmd, py_winsif_RecordAction_set_cmd },
713 { discard_const_p(char, "name"), py_winsif_RecordAction_get_name, py_winsif_RecordAction_set_name },
714 { discard_const_p(char, "name_len"), py_winsif_RecordAction_get_name_len, py_winsif_RecordAction_set_name_len },
715 { discard_const_p(char, "record_type"), py_winsif_RecordAction_get_record_type, py_winsif_RecordAction_set_record_type },
716 { discard_const_p(char, "num_of_addresses"), py_winsif_RecordAction_get_num_of_addresses, py_winsif_RecordAction_set_num_of_addresses },
717 { discard_const_p(char, "addresses"), py_winsif_RecordAction_get_addresses, py_winsif_RecordAction_set_addresses },
718 { discard_const_p(char, "address"), py_winsif_RecordAction_get_address, py_winsif_RecordAction_set_address },
719 { discard_const_p(char, "version_number"), py_winsif_RecordAction_get_version_number, py_winsif_RecordAction_set_version_number },
720 { discard_const_p(char, "node_type"), py_winsif_RecordAction_get_node_type, py_winsif_RecordAction_set_node_type },
721 { discard_const_p(char, "owner_address"), py_winsif_RecordAction_get_owner_address, py_winsif_RecordAction_set_owner_address },
722 { discard_const_p(char, "record_state"), py_winsif_RecordAction_get_record_state, py_winsif_RecordAction_set_record_state },
723 { discard_const_p(char, "is_static"), py_winsif_RecordAction_get_is_static, py_winsif_RecordAction_set_is_static },
724 { discard_const_p(char, "expire_time"), py_winsif_RecordAction_get_expire_time, py_winsif_RecordAction_set_expire_time },
728 static PyObject *py_winsif_RecordAction_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
730 return pytalloc_new(struct winsif_RecordAction, type);
734 static PyTypeObject winsif_RecordAction_Type = {
735 PyObject_HEAD_INIT(NULL) 0,
736 .tp_name = "winsif.RecordAction",
737 .tp_getset = py_winsif_RecordAction_getsetters,
739 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
740 .tp_basicsize = sizeof(pytalloc_Object),
741 .tp_new = py_winsif_RecordAction_new,
745 static PyObject *py_winsif_AddressVersionMap_get_address(PyObject *obj, void *closure)
747 struct winsif_AddressVersionMap *object = (struct winsif_AddressVersionMap *)pytalloc_get_ptr(obj);
748 PyObject *py_address;
749 py_address = pytalloc_reference_ex(&winsif_Address_Type, pytalloc_get_mem_ctx(obj), &object->address);
753 static int py_winsif_AddressVersionMap_set_address(PyObject *py_obj, PyObject *value, void *closure)
755 struct winsif_AddressVersionMap *object = (struct winsif_AddressVersionMap *)pytalloc_get_ptr(py_obj);
756 PY_CHECK_TYPE(&winsif_Address_Type, value, return -1;);
757 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
761 object->address = *(struct winsif_Address *)pytalloc_get_ptr(value);
765 static PyObject *py_winsif_AddressVersionMap_get_version_number(PyObject *obj, void *closure)
767 struct winsif_AddressVersionMap *object = (struct winsif_AddressVersionMap *)pytalloc_get_ptr(obj);
768 PyObject *py_version_number;
769 py_version_number = ndr_PyLong_FromUnsignedLongLong(object->version_number);
770 return py_version_number;
773 static int py_winsif_AddressVersionMap_set_version_number(PyObject *py_obj, PyObject *value, void *closure)
775 struct winsif_AddressVersionMap *object = (struct winsif_AddressVersionMap *)pytalloc_get_ptr(py_obj);
777 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version_number));
778 if (PyLong_Check(value)) {
779 unsigned long long test_var;
780 test_var = PyLong_AsUnsignedLongLong(value);
781 if (PyErr_Occurred() != NULL) {
784 if (test_var > uint_max) {
785 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
786 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
789 object->version_number = test_var;
790 } else if (PyInt_Check(value)) {
792 test_var = PyInt_AsLong(value);
793 if (test_var < 0 || test_var > uint_max) {
794 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
795 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
798 object->version_number = test_var;
800 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
801 PyInt_Type.tp_name, PyLong_Type.tp_name);
808 static PyGetSetDef py_winsif_AddressVersionMap_getsetters[] = {
809 { discard_const_p(char, "address"), py_winsif_AddressVersionMap_get_address, py_winsif_AddressVersionMap_set_address },
810 { discard_const_p(char, "version_number"), py_winsif_AddressVersionMap_get_version_number, py_winsif_AddressVersionMap_set_version_number },
814 static PyObject *py_winsif_AddressVersionMap_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
816 return pytalloc_new(struct winsif_AddressVersionMap, type);
820 static PyTypeObject winsif_AddressVersionMap_Type = {
821 PyObject_HEAD_INIT(NULL) 0,
822 .tp_name = "winsif.AddressVersionMap",
823 .tp_getset = py_winsif_AddressVersionMap_getsetters,
825 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
826 .tp_basicsize = sizeof(pytalloc_Object),
827 .tp_new = py_winsif_AddressVersionMap_new,
831 static PyObject *py_winsif_ReplCounter_get_address(PyObject *obj, void *closure)
833 struct winsif_ReplCounter *object = (struct winsif_ReplCounter *)pytalloc_get_ptr(obj);
834 PyObject *py_address;
835 py_address = pytalloc_reference_ex(&winsif_Address_Type, pytalloc_get_mem_ctx(obj), &object->address);
839 static int py_winsif_ReplCounter_set_address(PyObject *py_obj, PyObject *value, void *closure)
841 struct winsif_ReplCounter *object = (struct winsif_ReplCounter *)pytalloc_get_ptr(py_obj);
842 PY_CHECK_TYPE(&winsif_Address_Type, value, return -1;);
843 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
847 object->address = *(struct winsif_Address *)pytalloc_get_ptr(value);
851 static PyObject *py_winsif_ReplCounter_get_num_replications(PyObject *obj, void *closure)
853 struct winsif_ReplCounter *object = (struct winsif_ReplCounter *)pytalloc_get_ptr(obj);
854 PyObject *py_num_replications;
855 py_num_replications = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_replications);
856 return py_num_replications;
859 static int py_winsif_ReplCounter_set_num_replications(PyObject *py_obj, PyObject *value, void *closure)
861 struct winsif_ReplCounter *object = (struct winsif_ReplCounter *)pytalloc_get_ptr(py_obj);
863 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_replications));
864 if (PyLong_Check(value)) {
865 unsigned long long test_var;
866 test_var = PyLong_AsUnsignedLongLong(value);
867 if (PyErr_Occurred() != NULL) {
870 if (test_var > uint_max) {
871 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
872 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
875 object->num_replications = test_var;
876 } else if (PyInt_Check(value)) {
878 test_var = PyInt_AsLong(value);
879 if (test_var < 0 || test_var > uint_max) {
880 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
881 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
884 object->num_replications = test_var;
886 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
887 PyInt_Type.tp_name, PyLong_Type.tp_name);
894 static PyObject *py_winsif_ReplCounter_get_num_communication_failures(PyObject *obj, void *closure)
896 struct winsif_ReplCounter *object = (struct winsif_ReplCounter *)pytalloc_get_ptr(obj);
897 PyObject *py_num_communication_failures;
898 py_num_communication_failures = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_communication_failures);
899 return py_num_communication_failures;
902 static int py_winsif_ReplCounter_set_num_communication_failures(PyObject *py_obj, PyObject *value, void *closure)
904 struct winsif_ReplCounter *object = (struct winsif_ReplCounter *)pytalloc_get_ptr(py_obj);
906 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_communication_failures));
907 if (PyLong_Check(value)) {
908 unsigned long long test_var;
909 test_var = PyLong_AsUnsignedLongLong(value);
910 if (PyErr_Occurred() != NULL) {
913 if (test_var > uint_max) {
914 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
915 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
918 object->num_communication_failures = test_var;
919 } else if (PyInt_Check(value)) {
921 test_var = PyInt_AsLong(value);
922 if (test_var < 0 || test_var > uint_max) {
923 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
924 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
927 object->num_communication_failures = test_var;
929 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
930 PyInt_Type.tp_name, PyLong_Type.tp_name);
937 static PyGetSetDef py_winsif_ReplCounter_getsetters[] = {
938 { discard_const_p(char, "address"), py_winsif_ReplCounter_get_address, py_winsif_ReplCounter_set_address },
939 { discard_const_p(char, "num_replications"), py_winsif_ReplCounter_get_num_replications, py_winsif_ReplCounter_set_num_replications },
940 { discard_const_p(char, "num_communication_failures"), py_winsif_ReplCounter_get_num_communication_failures, py_winsif_ReplCounter_set_num_communication_failures },
944 static PyObject *py_winsif_ReplCounter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
946 return pytalloc_new(struct winsif_ReplCounter, type);
950 static PyTypeObject winsif_ReplCounter_Type = {
951 PyObject_HEAD_INIT(NULL) 0,
952 .tp_name = "winsif.ReplCounter",
953 .tp_getset = py_winsif_ReplCounter_getsetters,
955 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
956 .tp_basicsize = sizeof(pytalloc_Object),
957 .tp_new = py_winsif_ReplCounter_new,
961 static PyObject *py_winsif_StatCounters_get_num_unique_registrations(PyObject *obj, void *closure)
963 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
964 PyObject *py_num_unique_registrations;
965 py_num_unique_registrations = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_unique_registrations);
966 return py_num_unique_registrations;
969 static int py_winsif_StatCounters_set_num_unique_registrations(PyObject *py_obj, PyObject *value, void *closure)
971 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
973 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_unique_registrations));
974 if (PyLong_Check(value)) {
975 unsigned long long test_var;
976 test_var = PyLong_AsUnsignedLongLong(value);
977 if (PyErr_Occurred() != NULL) {
980 if (test_var > uint_max) {
981 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
982 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
985 object->num_unique_registrations = test_var;
986 } else if (PyInt_Check(value)) {
988 test_var = PyInt_AsLong(value);
989 if (test_var < 0 || test_var > uint_max) {
990 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
991 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
994 object->num_unique_registrations = test_var;
996 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
997 PyInt_Type.tp_name, PyLong_Type.tp_name);
1004 static PyObject *py_winsif_StatCounters_get_num_group_registrations(PyObject *obj, void *closure)
1006 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1007 PyObject *py_num_group_registrations;
1008 py_num_group_registrations = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_group_registrations);
1009 return py_num_group_registrations;
1012 static int py_winsif_StatCounters_set_num_group_registrations(PyObject *py_obj, PyObject *value, void *closure)
1014 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1016 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_group_registrations));
1017 if (PyLong_Check(value)) {
1018 unsigned long long test_var;
1019 test_var = PyLong_AsUnsignedLongLong(value);
1020 if (PyErr_Occurred() != NULL) {
1023 if (test_var > uint_max) {
1024 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1025 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1028 object->num_group_registrations = test_var;
1029 } else if (PyInt_Check(value)) {
1031 test_var = PyInt_AsLong(value);
1032 if (test_var < 0 || test_var > uint_max) {
1033 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1034 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1037 object->num_group_registrations = test_var;
1039 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1040 PyInt_Type.tp_name, PyLong_Type.tp_name);
1047 static PyObject *py_winsif_StatCounters_get_num_queries(PyObject *obj, void *closure)
1049 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1050 PyObject *py_num_queries;
1051 py_num_queries = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_queries);
1052 return py_num_queries;
1055 static int py_winsif_StatCounters_set_num_queries(PyObject *py_obj, PyObject *value, void *closure)
1057 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1059 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_queries));
1060 if (PyLong_Check(value)) {
1061 unsigned long long test_var;
1062 test_var = PyLong_AsUnsignedLongLong(value);
1063 if (PyErr_Occurred() != NULL) {
1066 if (test_var > uint_max) {
1067 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1068 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1071 object->num_queries = test_var;
1072 } else if (PyInt_Check(value)) {
1074 test_var = PyInt_AsLong(value);
1075 if (test_var < 0 || test_var > uint_max) {
1076 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1077 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1080 object->num_queries = test_var;
1082 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1083 PyInt_Type.tp_name, PyLong_Type.tp_name);
1090 static PyObject *py_winsif_StatCounters_get_num_successful_queries(PyObject *obj, void *closure)
1092 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1093 PyObject *py_num_successful_queries;
1094 py_num_successful_queries = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_successful_queries);
1095 return py_num_successful_queries;
1098 static int py_winsif_StatCounters_set_num_successful_queries(PyObject *py_obj, PyObject *value, void *closure)
1100 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1102 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_successful_queries));
1103 if (PyLong_Check(value)) {
1104 unsigned long long test_var;
1105 test_var = PyLong_AsUnsignedLongLong(value);
1106 if (PyErr_Occurred() != NULL) {
1109 if (test_var > uint_max) {
1110 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1111 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1114 object->num_successful_queries = test_var;
1115 } else if (PyInt_Check(value)) {
1117 test_var = PyInt_AsLong(value);
1118 if (test_var < 0 || test_var > uint_max) {
1119 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1120 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1123 object->num_successful_queries = test_var;
1125 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1126 PyInt_Type.tp_name, PyLong_Type.tp_name);
1133 static PyObject *py_winsif_StatCounters_get_num_failed_queries(PyObject *obj, void *closure)
1135 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1136 PyObject *py_num_failed_queries;
1137 py_num_failed_queries = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_failed_queries);
1138 return py_num_failed_queries;
1141 static int py_winsif_StatCounters_set_num_failed_queries(PyObject *py_obj, PyObject *value, void *closure)
1143 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1145 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_failed_queries));
1146 if (PyLong_Check(value)) {
1147 unsigned long long test_var;
1148 test_var = PyLong_AsUnsignedLongLong(value);
1149 if (PyErr_Occurred() != NULL) {
1152 if (test_var > uint_max) {
1153 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1154 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1157 object->num_failed_queries = test_var;
1158 } else if (PyInt_Check(value)) {
1160 test_var = PyInt_AsLong(value);
1161 if (test_var < 0 || test_var > uint_max) {
1162 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1163 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1166 object->num_failed_queries = test_var;
1168 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1169 PyInt_Type.tp_name, PyLong_Type.tp_name);
1176 static PyObject *py_winsif_StatCounters_get_num_unique_refreshes(PyObject *obj, void *closure)
1178 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1179 PyObject *py_num_unique_refreshes;
1180 py_num_unique_refreshes = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_unique_refreshes);
1181 return py_num_unique_refreshes;
1184 static int py_winsif_StatCounters_set_num_unique_refreshes(PyObject *py_obj, PyObject *value, void *closure)
1186 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1188 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_unique_refreshes));
1189 if (PyLong_Check(value)) {
1190 unsigned long long test_var;
1191 test_var = PyLong_AsUnsignedLongLong(value);
1192 if (PyErr_Occurred() != NULL) {
1195 if (test_var > uint_max) {
1196 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1197 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1200 object->num_unique_refreshes = test_var;
1201 } else if (PyInt_Check(value)) {
1203 test_var = PyInt_AsLong(value);
1204 if (test_var < 0 || test_var > uint_max) {
1205 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1206 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1209 object->num_unique_refreshes = test_var;
1211 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1212 PyInt_Type.tp_name, PyLong_Type.tp_name);
1219 static PyObject *py_winsif_StatCounters_get_num_group_refreshes(PyObject *obj, void *closure)
1221 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1222 PyObject *py_num_group_refreshes;
1223 py_num_group_refreshes = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_group_refreshes);
1224 return py_num_group_refreshes;
1227 static int py_winsif_StatCounters_set_num_group_refreshes(PyObject *py_obj, PyObject *value, void *closure)
1229 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1231 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_group_refreshes));
1232 if (PyLong_Check(value)) {
1233 unsigned long long test_var;
1234 test_var = PyLong_AsUnsignedLongLong(value);
1235 if (PyErr_Occurred() != NULL) {
1238 if (test_var > uint_max) {
1239 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1240 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1243 object->num_group_refreshes = test_var;
1244 } else if (PyInt_Check(value)) {
1246 test_var = PyInt_AsLong(value);
1247 if (test_var < 0 || test_var > uint_max) {
1248 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1249 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1252 object->num_group_refreshes = test_var;
1254 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1255 PyInt_Type.tp_name, PyLong_Type.tp_name);
1262 static PyObject *py_winsif_StatCounters_get_num_releases(PyObject *obj, void *closure)
1264 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1265 PyObject *py_num_releases;
1266 py_num_releases = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_releases);
1267 return py_num_releases;
1270 static int py_winsif_StatCounters_set_num_releases(PyObject *py_obj, PyObject *value, void *closure)
1272 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1274 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_releases));
1275 if (PyLong_Check(value)) {
1276 unsigned long long test_var;
1277 test_var = PyLong_AsUnsignedLongLong(value);
1278 if (PyErr_Occurred() != NULL) {
1281 if (test_var > uint_max) {
1282 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1283 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1286 object->num_releases = test_var;
1287 } else if (PyInt_Check(value)) {
1289 test_var = PyInt_AsLong(value);
1290 if (test_var < 0 || test_var > uint_max) {
1291 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1292 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1295 object->num_releases = test_var;
1297 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1298 PyInt_Type.tp_name, PyLong_Type.tp_name);
1305 static PyObject *py_winsif_StatCounters_get_num_successful_releases(PyObject *obj, void *closure)
1307 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1308 PyObject *py_num_successful_releases;
1309 py_num_successful_releases = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_successful_releases);
1310 return py_num_successful_releases;
1313 static int py_winsif_StatCounters_set_num_successful_releases(PyObject *py_obj, PyObject *value, void *closure)
1315 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1317 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_successful_releases));
1318 if (PyLong_Check(value)) {
1319 unsigned long long test_var;
1320 test_var = PyLong_AsUnsignedLongLong(value);
1321 if (PyErr_Occurred() != NULL) {
1324 if (test_var > uint_max) {
1325 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1326 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1329 object->num_successful_releases = test_var;
1330 } else if (PyInt_Check(value)) {
1332 test_var = PyInt_AsLong(value);
1333 if (test_var < 0 || test_var > uint_max) {
1334 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1335 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1338 object->num_successful_releases = test_var;
1340 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1341 PyInt_Type.tp_name, PyLong_Type.tp_name);
1348 static PyObject *py_winsif_StatCounters_get_num_failed_releases(PyObject *obj, void *closure)
1350 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1351 PyObject *py_num_failed_releases;
1352 py_num_failed_releases = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_failed_releases);
1353 return py_num_failed_releases;
1356 static int py_winsif_StatCounters_set_num_failed_releases(PyObject *py_obj, PyObject *value, void *closure)
1358 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1360 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_failed_releases));
1361 if (PyLong_Check(value)) {
1362 unsigned long long test_var;
1363 test_var = PyLong_AsUnsignedLongLong(value);
1364 if (PyErr_Occurred() != NULL) {
1367 if (test_var > uint_max) {
1368 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1369 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1372 object->num_failed_releases = test_var;
1373 } else if (PyInt_Check(value)) {
1375 test_var = PyInt_AsLong(value);
1376 if (test_var < 0 || test_var > uint_max) {
1377 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1378 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1381 object->num_failed_releases = test_var;
1383 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1384 PyInt_Type.tp_name, PyLong_Type.tp_name);
1391 static PyObject *py_winsif_StatCounters_get_num_unique_conflicts(PyObject *obj, void *closure)
1393 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1394 PyObject *py_num_unique_conflicts;
1395 py_num_unique_conflicts = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_unique_conflicts);
1396 return py_num_unique_conflicts;
1399 static int py_winsif_StatCounters_set_num_unique_conflicts(PyObject *py_obj, PyObject *value, void *closure)
1401 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1403 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_unique_conflicts));
1404 if (PyLong_Check(value)) {
1405 unsigned long long test_var;
1406 test_var = PyLong_AsUnsignedLongLong(value);
1407 if (PyErr_Occurred() != NULL) {
1410 if (test_var > uint_max) {
1411 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1412 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1415 object->num_unique_conflicts = test_var;
1416 } else if (PyInt_Check(value)) {
1418 test_var = PyInt_AsLong(value);
1419 if (test_var < 0 || test_var > uint_max) {
1420 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1421 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1424 object->num_unique_conflicts = test_var;
1426 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1427 PyInt_Type.tp_name, PyLong_Type.tp_name);
1434 static PyObject *py_winsif_StatCounters_get_num_group_conflicts(PyObject *obj, void *closure)
1436 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(obj);
1437 PyObject *py_num_group_conflicts;
1438 py_num_group_conflicts = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_group_conflicts);
1439 return py_num_group_conflicts;
1442 static int py_winsif_StatCounters_set_num_group_conflicts(PyObject *py_obj, PyObject *value, void *closure)
1444 struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1446 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_group_conflicts));
1447 if (PyLong_Check(value)) {
1448 unsigned long long test_var;
1449 test_var = PyLong_AsUnsignedLongLong(value);
1450 if (PyErr_Occurred() != NULL) {
1453 if (test_var > uint_max) {
1454 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
1455 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1458 object->num_group_conflicts = test_var;
1459 } else if (PyInt_Check(value)) {
1461 test_var = PyInt_AsLong(value);
1462 if (test_var < 0 || test_var > uint_max) {
1463 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
1464 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
1467 object->num_group_conflicts = test_var;
1469 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1470 PyInt_Type.tp_name, PyLong_Type.tp_name);
1477 static PyGetSetDef py_winsif_StatCounters_getsetters[] = {
1478 { discard_const_p(char, "num_unique_registrations"), py_winsif_StatCounters_get_num_unique_registrations, py_winsif_StatCounters_set_num_unique_registrations },
1479 { discard_const_p(char, "num_group_registrations"), py_winsif_StatCounters_get_num_group_registrations, py_winsif_StatCounters_set_num_group_registrations },
1480 { discard_const_p(char, "num_queries"), py_winsif_StatCounters_get_num_queries, py_winsif_StatCounters_set_num_queries },
1481 { discard_const_p(char, "num_successful_queries"), py_winsif_StatCounters_get_num_successful_queries, py_winsif_StatCounters_set_num_successful_queries },
1482 { discard_const_p(char, "num_failed_queries"), py_winsif_StatCounters_get_num_failed_queries, py_winsif_StatCounters_set_num_failed_queries },
1483 { discard_const_p(char, "num_unique_refreshes"), py_winsif_StatCounters_get_num_unique_refreshes, py_winsif_StatCounters_set_num_unique_refreshes },
1484 { discard_const_p(char, "num_group_refreshes"), py_winsif_StatCounters_get_num_group_refreshes, py_winsif_StatCounters_set_num_group_refreshes },
1485 { discard_const_p(char, "num_releases"), py_winsif_StatCounters_get_num_releases, py_winsif_StatCounters_set_num_releases },
1486 { discard_const_p(char, "num_successful_releases"), py_winsif_StatCounters_get_num_successful_releases, py_winsif_StatCounters_set_num_successful_releases },
1487 { discard_const_p(char, "num_failed_releases"), py_winsif_StatCounters_get_num_failed_releases, py_winsif_StatCounters_set_num_failed_releases },
1488 { discard_const_p(char, "num_unique_conflicts"), py_winsif_StatCounters_get_num_unique_conflicts, py_winsif_StatCounters_set_num_unique_conflicts },
1489 { discard_const_p(char, "num_group_conflicts"), py_winsif_StatCounters_get_num_group_conflicts, py_winsif_StatCounters_set_num_group_conflicts },
1493 static PyObject *py_winsif_StatCounters_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1495 return pytalloc_new(struct winsif_StatCounters, type);
1499 static PyTypeObject winsif_StatCounters_Type = {
1500 PyObject_HEAD_INIT(NULL) 0,
1501 .tp_name = "winsif.StatCounters",
1502 .tp_getset = py_winsif_StatCounters_getsetters,
1504 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1505 .tp_basicsize = sizeof(pytalloc_Object),
1506 .tp_new = py_winsif_StatCounters_new,
1510 static PyObject *py_winsif_StatTimeStamps_get_wins_start_time(PyObject *obj, void *closure)
1512 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1513 PyObject *py_wins_start_time;
1514 py_wins_start_time = PyInt_FromLong(object->wins_start_time);
1515 return py_wins_start_time;
1518 static int py_winsif_StatTimeStamps_set_wins_start_time(PyObject *py_obj, PyObject *value, void *closure)
1520 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1522 const long long int_max = ndr_sizeof2intmax(sizeof(object->wins_start_time));
1523 const long long int_min = -int_max - 1;
1524 if (PyLong_Check(value)) {
1526 test_var = PyLong_AsLongLong(value);
1527 if (PyErr_Occurred() != NULL) {
1530 if (test_var < int_min || test_var > int_max) {
1531 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1532 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1535 object->wins_start_time = test_var;
1536 } else if (PyInt_Check(value)) {
1538 test_var = PyInt_AsLong(value);
1539 if (test_var < int_min || test_var > int_max) {
1540 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1541 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1544 object->wins_start_time = test_var;
1546 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1547 PyInt_Type.tp_name, PyLong_Type.tp_name);
1554 static PyObject *py_winsif_StatTimeStamps_get_last_periodic_scavenging(PyObject *obj, void *closure)
1556 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1557 PyObject *py_last_periodic_scavenging;
1558 py_last_periodic_scavenging = PyInt_FromLong(object->last_periodic_scavenging);
1559 return py_last_periodic_scavenging;
1562 static int py_winsif_StatTimeStamps_set_last_periodic_scavenging(PyObject *py_obj, PyObject *value, void *closure)
1564 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1566 const long long int_max = ndr_sizeof2intmax(sizeof(object->last_periodic_scavenging));
1567 const long long int_min = -int_max - 1;
1568 if (PyLong_Check(value)) {
1570 test_var = PyLong_AsLongLong(value);
1571 if (PyErr_Occurred() != NULL) {
1574 if (test_var < int_min || test_var > int_max) {
1575 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1576 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1579 object->last_periodic_scavenging = test_var;
1580 } else if (PyInt_Check(value)) {
1582 test_var = PyInt_AsLong(value);
1583 if (test_var < int_min || test_var > int_max) {
1584 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1585 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1588 object->last_periodic_scavenging = test_var;
1590 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1591 PyInt_Type.tp_name, PyLong_Type.tp_name);
1598 static PyObject *py_winsif_StatTimeStamps_get_last_triggered_scavenging(PyObject *obj, void *closure)
1600 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1601 PyObject *py_last_triggered_scavenging;
1602 py_last_triggered_scavenging = PyInt_FromLong(object->last_triggered_scavenging);
1603 return py_last_triggered_scavenging;
1606 static int py_winsif_StatTimeStamps_set_last_triggered_scavenging(PyObject *py_obj, PyObject *value, void *closure)
1608 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1610 const long long int_max = ndr_sizeof2intmax(sizeof(object->last_triggered_scavenging));
1611 const long long int_min = -int_max - 1;
1612 if (PyLong_Check(value)) {
1614 test_var = PyLong_AsLongLong(value);
1615 if (PyErr_Occurred() != NULL) {
1618 if (test_var < int_min || test_var > int_max) {
1619 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1620 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1623 object->last_triggered_scavenging = test_var;
1624 } else if (PyInt_Check(value)) {
1626 test_var = PyInt_AsLong(value);
1627 if (test_var < int_min || test_var > int_max) {
1628 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1629 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1632 object->last_triggered_scavenging = test_var;
1634 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1635 PyInt_Type.tp_name, PyLong_Type.tp_name);
1642 static PyObject *py_winsif_StatTimeStamps_get_last_tombstone_scavenging(PyObject *obj, void *closure)
1644 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1645 PyObject *py_last_tombstone_scavenging;
1646 py_last_tombstone_scavenging = PyInt_FromLong(object->last_tombstone_scavenging);
1647 return py_last_tombstone_scavenging;
1650 static int py_winsif_StatTimeStamps_set_last_tombstone_scavenging(PyObject *py_obj, PyObject *value, void *closure)
1652 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1654 const long long int_max = ndr_sizeof2intmax(sizeof(object->last_tombstone_scavenging));
1655 const long long int_min = -int_max - 1;
1656 if (PyLong_Check(value)) {
1658 test_var = PyLong_AsLongLong(value);
1659 if (PyErr_Occurred() != NULL) {
1662 if (test_var < int_min || test_var > int_max) {
1663 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1664 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1667 object->last_tombstone_scavenging = test_var;
1668 } else if (PyInt_Check(value)) {
1670 test_var = PyInt_AsLong(value);
1671 if (test_var < int_min || test_var > int_max) {
1672 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1673 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1676 object->last_tombstone_scavenging = test_var;
1678 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1679 PyInt_Type.tp_name, PyLong_Type.tp_name);
1686 static PyObject *py_winsif_StatTimeStamps_get_last_verification_scavenging(PyObject *obj, void *closure)
1688 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1689 PyObject *py_last_verification_scavenging;
1690 py_last_verification_scavenging = PyInt_FromLong(object->last_verification_scavenging);
1691 return py_last_verification_scavenging;
1694 static int py_winsif_StatTimeStamps_set_last_verification_scavenging(PyObject *py_obj, PyObject *value, void *closure)
1696 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1698 const long long int_max = ndr_sizeof2intmax(sizeof(object->last_verification_scavenging));
1699 const long long int_min = -int_max - 1;
1700 if (PyLong_Check(value)) {
1702 test_var = PyLong_AsLongLong(value);
1703 if (PyErr_Occurred() != NULL) {
1706 if (test_var < int_min || test_var > int_max) {
1707 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1708 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1711 object->last_verification_scavenging = test_var;
1712 } else if (PyInt_Check(value)) {
1714 test_var = PyInt_AsLong(value);
1715 if (test_var < int_min || test_var > int_max) {
1716 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1717 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1720 object->last_verification_scavenging = test_var;
1722 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1723 PyInt_Type.tp_name, PyLong_Type.tp_name);
1730 static PyObject *py_winsif_StatTimeStamps_get_last_periodic_pull_replication(PyObject *obj, void *closure)
1732 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1733 PyObject *py_last_periodic_pull_replication;
1734 py_last_periodic_pull_replication = PyInt_FromLong(object->last_periodic_pull_replication);
1735 return py_last_periodic_pull_replication;
1738 static int py_winsif_StatTimeStamps_set_last_periodic_pull_replication(PyObject *py_obj, PyObject *value, void *closure)
1740 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1742 const long long int_max = ndr_sizeof2intmax(sizeof(object->last_periodic_pull_replication));
1743 const long long int_min = -int_max - 1;
1744 if (PyLong_Check(value)) {
1746 test_var = PyLong_AsLongLong(value);
1747 if (PyErr_Occurred() != NULL) {
1750 if (test_var < int_min || test_var > int_max) {
1751 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1752 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1755 object->last_periodic_pull_replication = test_var;
1756 } else if (PyInt_Check(value)) {
1758 test_var = PyInt_AsLong(value);
1759 if (test_var < int_min || test_var > int_max) {
1760 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1761 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1764 object->last_periodic_pull_replication = test_var;
1766 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1767 PyInt_Type.tp_name, PyLong_Type.tp_name);
1774 static PyObject *py_winsif_StatTimeStamps_get_last_triggered_pull_replication(PyObject *obj, void *closure)
1776 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1777 PyObject *py_last_triggered_pull_replication;
1778 py_last_triggered_pull_replication = PyInt_FromLong(object->last_triggered_pull_replication);
1779 return py_last_triggered_pull_replication;
1782 static int py_winsif_StatTimeStamps_set_last_triggered_pull_replication(PyObject *py_obj, PyObject *value, void *closure)
1784 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1786 const long long int_max = ndr_sizeof2intmax(sizeof(object->last_triggered_pull_replication));
1787 const long long int_min = -int_max - 1;
1788 if (PyLong_Check(value)) {
1790 test_var = PyLong_AsLongLong(value);
1791 if (PyErr_Occurred() != NULL) {
1794 if (test_var < int_min || test_var > int_max) {
1795 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1796 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1799 object->last_triggered_pull_replication = test_var;
1800 } else if (PyInt_Check(value)) {
1802 test_var = PyInt_AsLong(value);
1803 if (test_var < int_min || test_var > int_max) {
1804 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1805 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1808 object->last_triggered_pull_replication = test_var;
1810 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1811 PyInt_Type.tp_name, PyLong_Type.tp_name);
1818 static PyObject *py_winsif_StatTimeStamps_get_ignore_last_ntrepl(PyObject *obj, void *closure)
1820 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1821 PyObject *py_ignore_last_ntrepl;
1822 py_ignore_last_ntrepl = PyInt_FromLong(object->ignore_last_ntrepl);
1823 return py_ignore_last_ntrepl;
1826 static int py_winsif_StatTimeStamps_set_ignore_last_ntrepl(PyObject *py_obj, PyObject *value, void *closure)
1828 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1830 const long long int_max = ndr_sizeof2intmax(sizeof(object->ignore_last_ntrepl));
1831 const long long int_min = -int_max - 1;
1832 if (PyLong_Check(value)) {
1834 test_var = PyLong_AsLongLong(value);
1835 if (PyErr_Occurred() != NULL) {
1838 if (test_var < int_min || test_var > int_max) {
1839 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1840 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1843 object->ignore_last_ntrepl = test_var;
1844 } else if (PyInt_Check(value)) {
1846 test_var = PyInt_AsLong(value);
1847 if (test_var < int_min || test_var > int_max) {
1848 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1849 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1852 object->ignore_last_ntrepl = test_var;
1854 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1855 PyInt_Type.tp_name, PyLong_Type.tp_name);
1862 static PyObject *py_winsif_StatTimeStamps_get_ignore_last_actrepl(PyObject *obj, void *closure)
1864 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1865 PyObject *py_ignore_last_actrepl;
1866 py_ignore_last_actrepl = PyInt_FromLong(object->ignore_last_actrepl);
1867 return py_ignore_last_actrepl;
1870 static int py_winsif_StatTimeStamps_set_ignore_last_actrepl(PyObject *py_obj, PyObject *value, void *closure)
1872 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1874 const long long int_max = ndr_sizeof2intmax(sizeof(object->ignore_last_actrepl));
1875 const long long int_min = -int_max - 1;
1876 if (PyLong_Check(value)) {
1878 test_var = PyLong_AsLongLong(value);
1879 if (PyErr_Occurred() != NULL) {
1882 if (test_var < int_min || test_var > int_max) {
1883 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1884 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1887 object->ignore_last_actrepl = test_var;
1888 } else if (PyInt_Check(value)) {
1890 test_var = PyInt_AsLong(value);
1891 if (test_var < int_min || test_var > int_max) {
1892 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1893 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1896 object->ignore_last_actrepl = test_var;
1898 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1899 PyInt_Type.tp_name, PyLong_Type.tp_name);
1906 static PyObject *py_winsif_StatTimeStamps_get_last_init_db(PyObject *obj, void *closure)
1908 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1909 PyObject *py_last_init_db;
1910 py_last_init_db = PyInt_FromLong(object->last_init_db);
1911 return py_last_init_db;
1914 static int py_winsif_StatTimeStamps_set_last_init_db(PyObject *py_obj, PyObject *value, void *closure)
1916 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1918 const long long int_max = ndr_sizeof2intmax(sizeof(object->last_init_db));
1919 const long long int_min = -int_max - 1;
1920 if (PyLong_Check(value)) {
1922 test_var = PyLong_AsLongLong(value);
1923 if (PyErr_Occurred() != NULL) {
1926 if (test_var < int_min || test_var > int_max) {
1927 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1928 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1931 object->last_init_db = test_var;
1932 } else if (PyInt_Check(value)) {
1934 test_var = PyInt_AsLong(value);
1935 if (test_var < int_min || test_var > int_max) {
1936 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1937 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1940 object->last_init_db = test_var;
1942 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1943 PyInt_Type.tp_name, PyLong_Type.tp_name);
1950 static PyObject *py_winsif_StatTimeStamps_get_counter_reset(PyObject *obj, void *closure)
1952 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(obj);
1953 PyObject *py_counter_reset;
1954 py_counter_reset = PyInt_FromLong(object->counter_reset);
1955 return py_counter_reset;
1958 static int py_winsif_StatTimeStamps_set_counter_reset(PyObject *py_obj, PyObject *value, void *closure)
1960 struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1962 const long long int_max = ndr_sizeof2intmax(sizeof(object->counter_reset));
1963 const long long int_min = -int_max - 1;
1964 if (PyLong_Check(value)) {
1966 test_var = PyLong_AsLongLong(value);
1967 if (PyErr_Occurred() != NULL) {
1970 if (test_var < int_min || test_var > int_max) {
1971 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %lld",\
1972 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1975 object->counter_reset = test_var;
1976 } else if (PyInt_Check(value)) {
1978 test_var = PyInt_AsLong(value);
1979 if (test_var < int_min || test_var > int_max) {
1980 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range %lld - %lld, got %ld",\
1981 PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);
1984 object->counter_reset = test_var;
1986 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1987 PyInt_Type.tp_name, PyLong_Type.tp_name);
1994 static PyGetSetDef py_winsif_StatTimeStamps_getsetters[] = {
1995 { discard_const_p(char, "wins_start_time"), py_winsif_StatTimeStamps_get_wins_start_time, py_winsif_StatTimeStamps_set_wins_start_time },
1996 { discard_const_p(char, "last_periodic_scavenging"), py_winsif_StatTimeStamps_get_last_periodic_scavenging, py_winsif_StatTimeStamps_set_last_periodic_scavenging },
1997 { discard_const_p(char, "last_triggered_scavenging"), py_winsif_StatTimeStamps_get_last_triggered_scavenging, py_winsif_StatTimeStamps_set_last_triggered_scavenging },
1998 { discard_const_p(char, "last_tombstone_scavenging"), py_winsif_StatTimeStamps_get_last_tombstone_scavenging, py_winsif_StatTimeStamps_set_last_tombstone_scavenging },
1999 { discard_const_p(char, "last_verification_scavenging"), py_winsif_StatTimeStamps_get_last_verification_scavenging, py_winsif_StatTimeStamps_set_last_verification_scavenging },
2000 { discard_const_p(char, "last_periodic_pull_replication"), py_winsif_StatTimeStamps_get_last_periodic_pull_replication, py_winsif_StatTimeStamps_set_last_periodic_pull_replication },
2001 { discard_const_p(char, "last_triggered_pull_replication"), py_winsif_StatTimeStamps_get_last_triggered_pull_replication, py_winsif_StatTimeStamps_set_last_triggered_pull_replication },
2002 { discard_const_p(char, "ignore_last_ntrepl"), py_winsif_StatTimeStamps_get_ignore_last_ntrepl, py_winsif_StatTimeStamps_set_ignore_last_ntrepl },
2003 { discard_const_p(char, "ignore_last_actrepl"), py_winsif_StatTimeStamps_get_ignore_last_actrepl, py_winsif_StatTimeStamps_set_ignore_last_actrepl },
2004 { discard_const_p(char, "last_init_db"), py_winsif_StatTimeStamps_get_last_init_db, py_winsif_StatTimeStamps_set_last_init_db },
2005 { discard_const_p(char, "counter_reset"), py_winsif_StatTimeStamps_get_counter_reset, py_winsif_StatTimeStamps_set_counter_reset },
2009 static PyObject *py_winsif_StatTimeStamps_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2011 return pytalloc_new(struct winsif_StatTimeStamps, type);
2015 static PyTypeObject winsif_StatTimeStamps_Type = {
2016 PyObject_HEAD_INIT(NULL) 0,
2017 .tp_name = "winsif.StatTimeStamps",
2018 .tp_getset = py_winsif_StatTimeStamps_getsetters,
2020 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2021 .tp_basicsize = sizeof(pytalloc_Object),
2022 .tp_new = py_winsif_StatTimeStamps_new,
2026 static PyObject *py_winsif_Stat_get_counters(PyObject *obj, void *closure)
2028 struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(obj);
2029 PyObject *py_counters;
2030 py_counters = pytalloc_reference_ex(&winsif_StatCounters_Type, pytalloc_get_mem_ctx(obj), &object->counters);
2034 static int py_winsif_Stat_set_counters(PyObject *py_obj, PyObject *value, void *closure)
2036 struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(py_obj);
2037 PY_CHECK_TYPE(&winsif_StatCounters_Type, value, return -1;);
2038 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2042 object->counters = *(struct winsif_StatCounters *)pytalloc_get_ptr(value);
2046 static PyObject *py_winsif_Stat_get_time_stamps(PyObject *obj, void *closure)
2048 struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(obj);
2049 PyObject *py_time_stamps;
2050 py_time_stamps = pytalloc_reference_ex(&winsif_StatTimeStamps_Type, pytalloc_get_mem_ctx(obj), &object->time_stamps);
2051 return py_time_stamps;
2054 static int py_winsif_Stat_set_time_stamps(PyObject *py_obj, PyObject *value, void *closure)
2056 struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(py_obj);
2057 PY_CHECK_TYPE(&winsif_StatTimeStamps_Type, value, return -1;);
2058 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2062 object->time_stamps = *(struct winsif_StatTimeStamps *)pytalloc_get_ptr(value);
2066 static PyObject *py_winsif_Stat_get_num_partners(PyObject *obj, void *closure)
2068 struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(obj);
2069 PyObject *py_num_partners;
2070 py_num_partners = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_partners);
2071 return py_num_partners;
2074 static int py_winsif_Stat_set_num_partners(PyObject *py_obj, PyObject *value, void *closure)
2076 struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(py_obj);
2078 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_partners));
2079 if (PyLong_Check(value)) {
2080 unsigned long long test_var;
2081 test_var = PyLong_AsUnsignedLongLong(value);
2082 if (PyErr_Occurred() != NULL) {
2085 if (test_var > uint_max) {
2086 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2087 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2090 object->num_partners = test_var;
2091 } else if (PyInt_Check(value)) {
2093 test_var = PyInt_AsLong(value);
2094 if (test_var < 0 || test_var > uint_max) {
2095 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2096 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2099 object->num_partners = test_var;
2101 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2102 PyInt_Type.tp_name, PyLong_Type.tp_name);
2109 static PyObject *py_winsif_Stat_get_partners(PyObject *obj, void *closure)
2111 struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(obj);
2112 PyObject *py_partners;
2113 if (object->partners == NULL) {
2114 py_partners = Py_None;
2115 Py_INCREF(py_partners);
2117 py_partners = PyList_New(object->num_partners);
2118 if (py_partners == NULL) {
2122 int partners_cntr_1;
2123 for (partners_cntr_1 = 0; partners_cntr_1 < (object->num_partners); partners_cntr_1++) {
2124 PyObject *py_partners_1;
2125 py_partners_1 = pytalloc_reference_ex(&winsif_ReplCounter_Type, object->partners, &object->partners[partners_cntr_1]);
2126 PyList_SetItem(py_partners, partners_cntr_1, py_partners_1);
2133 static int py_winsif_Stat_set_partners(PyObject *py_obj, PyObject *value, void *closure)
2135 struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(py_obj);
2136 talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->partners));
2137 if (value == Py_None) {
2138 object->partners = NULL;
2140 object->partners = NULL;
2141 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2143 int partners_cntr_1;
2144 object->partners = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->partners, PyList_GET_SIZE(value));
2145 if (!object->partners) { return -1;; }
2146 talloc_set_name_const(object->partners, "ARRAY: object->partners");
2147 for (partners_cntr_1 = 0; partners_cntr_1 < PyList_GET_SIZE(value); partners_cntr_1++) {
2148 PY_CHECK_TYPE(&winsif_ReplCounter_Type, PyList_GET_ITEM(value, partners_cntr_1), return -1;);
2149 if (talloc_reference(object->partners, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, partners_cntr_1))) == NULL) {
2153 object->partners[partners_cntr_1] = *(struct winsif_ReplCounter *)pytalloc_get_ptr(PyList_GET_ITEM(value, partners_cntr_1));
2160 static PyGetSetDef py_winsif_Stat_getsetters[] = {
2161 { discard_const_p(char, "counters"), py_winsif_Stat_get_counters, py_winsif_Stat_set_counters },
2162 { discard_const_p(char, "time_stamps"), py_winsif_Stat_get_time_stamps, py_winsif_Stat_set_time_stamps },
2163 { discard_const_p(char, "num_partners"), py_winsif_Stat_get_num_partners, py_winsif_Stat_set_num_partners },
2164 { discard_const_p(char, "partners"), py_winsif_Stat_get_partners, py_winsif_Stat_set_partners },
2168 static PyObject *py_winsif_Stat_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2170 return pytalloc_new(struct winsif_Stat, type);
2174 static PyTypeObject winsif_Stat_Type = {
2175 PyObject_HEAD_INIT(NULL) 0,
2176 .tp_name = "winsif.Stat",
2177 .tp_getset = py_winsif_Stat_getsetters,
2179 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2180 .tp_basicsize = sizeof(pytalloc_Object),
2181 .tp_new = py_winsif_Stat_new,
2185 static PyObject *py_winsif_Results_get_num_owners(PyObject *obj, void *closure)
2187 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2188 PyObject *py_num_owners;
2189 py_num_owners = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_owners);
2190 return py_num_owners;
2193 static int py_winsif_Results_set_num_owners(PyObject *py_obj, PyObject *value, void *closure)
2195 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2197 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_owners));
2198 if (PyLong_Check(value)) {
2199 unsigned long long test_var;
2200 test_var = PyLong_AsUnsignedLongLong(value);
2201 if (PyErr_Occurred() != NULL) {
2204 if (test_var > uint_max) {
2205 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2206 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2209 object->num_owners = test_var;
2210 } else if (PyInt_Check(value)) {
2212 test_var = PyInt_AsLong(value);
2213 if (test_var < 0 || test_var > uint_max) {
2214 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2215 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2218 object->num_owners = test_var;
2220 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2221 PyInt_Type.tp_name, PyLong_Type.tp_name);
2228 static PyObject *py_winsif_Results_get_address_version_maps(PyObject *obj, void *closure)
2230 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2231 PyObject *py_address_version_maps;
2232 py_address_version_maps = PyList_New(25);
2233 if (py_address_version_maps == NULL) {
2237 int address_version_maps_cntr_0;
2238 for (address_version_maps_cntr_0 = 0; address_version_maps_cntr_0 < (25); address_version_maps_cntr_0++) {
2239 PyObject *py_address_version_maps_0;
2240 py_address_version_maps_0 = pytalloc_reference_ex(&winsif_AddressVersionMap_Type, object->address_version_maps, &object->address_version_maps[address_version_maps_cntr_0]);
2241 PyList_SetItem(py_address_version_maps, address_version_maps_cntr_0, py_address_version_maps_0);
2244 return py_address_version_maps;
2247 static int py_winsif_Results_set_address_version_maps(PyObject *py_obj, PyObject *value, void *closure)
2249 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2250 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2252 int address_version_maps_cntr_0;
2253 if (ARRAY_SIZE(object->address_version_maps) != PyList_GET_SIZE(value)) {
2254 PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->address_version_maps), PyList_GET_SIZE(value));
2257 for (address_version_maps_cntr_0 = 0; address_version_maps_cntr_0 < PyList_GET_SIZE(value); address_version_maps_cntr_0++) {
2258 PY_CHECK_TYPE(&winsif_AddressVersionMap_Type, PyList_GET_ITEM(value, address_version_maps_cntr_0), return -1;);
2259 if (talloc_reference(object->address_version_maps, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, address_version_maps_cntr_0))) == NULL) {
2263 object->address_version_maps[address_version_maps_cntr_0] = *(struct winsif_AddressVersionMap *)pytalloc_get_ptr(PyList_GET_ITEM(value, address_version_maps_cntr_0));
2269 static PyObject *py_winsif_Results_get_my_max_version_number(PyObject *obj, void *closure)
2271 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2272 PyObject *py_my_max_version_number;
2273 py_my_max_version_number = ndr_PyLong_FromUnsignedLongLong(object->my_max_version_number);
2274 return py_my_max_version_number;
2277 static int py_winsif_Results_set_my_max_version_number(PyObject *py_obj, PyObject *value, void *closure)
2279 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2281 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->my_max_version_number));
2282 if (PyLong_Check(value)) {
2283 unsigned long long test_var;
2284 test_var = PyLong_AsUnsignedLongLong(value);
2285 if (PyErr_Occurred() != NULL) {
2288 if (test_var > uint_max) {
2289 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2290 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2293 object->my_max_version_number = test_var;
2294 } else if (PyInt_Check(value)) {
2296 test_var = PyInt_AsLong(value);
2297 if (test_var < 0 || test_var > uint_max) {
2298 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2299 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2302 object->my_max_version_number = test_var;
2304 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2305 PyInt_Type.tp_name, PyLong_Type.tp_name);
2312 static PyObject *py_winsif_Results_get_refresh_interval(PyObject *obj, void *closure)
2314 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2315 PyObject *py_refresh_interval;
2316 py_refresh_interval = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->refresh_interval);
2317 return py_refresh_interval;
2320 static int py_winsif_Results_set_refresh_interval(PyObject *py_obj, PyObject *value, void *closure)
2322 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2324 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->refresh_interval));
2325 if (PyLong_Check(value)) {
2326 unsigned long long test_var;
2327 test_var = PyLong_AsUnsignedLongLong(value);
2328 if (PyErr_Occurred() != NULL) {
2331 if (test_var > uint_max) {
2332 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2333 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2336 object->refresh_interval = test_var;
2337 } else if (PyInt_Check(value)) {
2339 test_var = PyInt_AsLong(value);
2340 if (test_var < 0 || test_var > uint_max) {
2341 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2342 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2345 object->refresh_interval = test_var;
2347 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2348 PyInt_Type.tp_name, PyLong_Type.tp_name);
2355 static PyObject *py_winsif_Results_get_tombstone_interval(PyObject *obj, void *closure)
2357 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2358 PyObject *py_tombstone_interval;
2359 py_tombstone_interval = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->tombstone_interval);
2360 return py_tombstone_interval;
2363 static int py_winsif_Results_set_tombstone_interval(PyObject *py_obj, PyObject *value, void *closure)
2365 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2367 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tombstone_interval));
2368 if (PyLong_Check(value)) {
2369 unsigned long long test_var;
2370 test_var = PyLong_AsUnsignedLongLong(value);
2371 if (PyErr_Occurred() != NULL) {
2374 if (test_var > uint_max) {
2375 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2376 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2379 object->tombstone_interval = test_var;
2380 } else if (PyInt_Check(value)) {
2382 test_var = PyInt_AsLong(value);
2383 if (test_var < 0 || test_var > uint_max) {
2384 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2385 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2388 object->tombstone_interval = test_var;
2390 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2391 PyInt_Type.tp_name, PyLong_Type.tp_name);
2398 static PyObject *py_winsif_Results_get_tombstone_timeout(PyObject *obj, void *closure)
2400 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2401 PyObject *py_tombstone_timeout;
2402 py_tombstone_timeout = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->tombstone_timeout);
2403 return py_tombstone_timeout;
2406 static int py_winsif_Results_set_tombstone_timeout(PyObject *py_obj, PyObject *value, void *closure)
2408 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2410 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tombstone_timeout));
2411 if (PyLong_Check(value)) {
2412 unsigned long long test_var;
2413 test_var = PyLong_AsUnsignedLongLong(value);
2414 if (PyErr_Occurred() != NULL) {
2417 if (test_var > uint_max) {
2418 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2419 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2422 object->tombstone_timeout = test_var;
2423 } else if (PyInt_Check(value)) {
2425 test_var = PyInt_AsLong(value);
2426 if (test_var < 0 || test_var > uint_max) {
2427 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2428 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2431 object->tombstone_timeout = test_var;
2433 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2434 PyInt_Type.tp_name, PyLong_Type.tp_name);
2441 static PyObject *py_winsif_Results_get_verify_interval(PyObject *obj, void *closure)
2443 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2444 PyObject *py_verify_interval;
2445 py_verify_interval = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->verify_interval);
2446 return py_verify_interval;
2449 static int py_winsif_Results_set_verify_interval(PyObject *py_obj, PyObject *value, void *closure)
2451 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2453 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->verify_interval));
2454 if (PyLong_Check(value)) {
2455 unsigned long long test_var;
2456 test_var = PyLong_AsUnsignedLongLong(value);
2457 if (PyErr_Occurred() != NULL) {
2460 if (test_var > uint_max) {
2461 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2462 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2465 object->verify_interval = test_var;
2466 } else if (PyInt_Check(value)) {
2468 test_var = PyInt_AsLong(value);
2469 if (test_var < 0 || test_var > uint_max) {
2470 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2471 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2474 object->verify_interval = test_var;
2476 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2477 PyInt_Type.tp_name, PyLong_Type.tp_name);
2484 static PyObject *py_winsif_Results_get_prioritiy_class(PyObject *obj, void *closure)
2486 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2487 PyObject *py_prioritiy_class;
2488 py_prioritiy_class = PyInt_FromLong((uint16_t)object->prioritiy_class);
2489 return py_prioritiy_class;
2492 static int py_winsif_Results_set_prioritiy_class(PyObject *py_obj, PyObject *value, void *closure)
2494 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2496 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->prioritiy_class));
2497 if (PyLong_Check(value)) {
2498 unsigned long long test_var;
2499 test_var = PyLong_AsUnsignedLongLong(value);
2500 if (PyErr_Occurred() != NULL) {
2503 if (test_var > uint_max) {
2504 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2505 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2508 object->prioritiy_class = test_var;
2509 } else if (PyInt_Check(value)) {
2511 test_var = PyInt_AsLong(value);
2512 if (test_var < 0 || test_var > uint_max) {
2513 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2514 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2517 object->prioritiy_class = test_var;
2519 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2520 PyInt_Type.tp_name, PyLong_Type.tp_name);
2527 static PyObject *py_winsif_Results_get_num_worker_threads(PyObject *obj, void *closure)
2529 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2530 PyObject *py_num_worker_threads;
2531 py_num_worker_threads = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_worker_threads);
2532 return py_num_worker_threads;
2535 static int py_winsif_Results_set_num_worker_threads(PyObject *py_obj, PyObject *value, void *closure)
2537 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2539 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_worker_threads));
2540 if (PyLong_Check(value)) {
2541 unsigned long long test_var;
2542 test_var = PyLong_AsUnsignedLongLong(value);
2543 if (PyErr_Occurred() != NULL) {
2546 if (test_var > uint_max) {
2547 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2548 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2551 object->num_worker_threads = test_var;
2552 } else if (PyInt_Check(value)) {
2554 test_var = PyInt_AsLong(value);
2555 if (test_var < 0 || test_var > uint_max) {
2556 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2557 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2560 object->num_worker_threads = test_var;
2562 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2563 PyInt_Type.tp_name, PyLong_Type.tp_name);
2570 static PyObject *py_winsif_Results_get_wstat(PyObject *obj, void *closure)
2572 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2574 py_wstat = pytalloc_reference_ex(&winsif_Stat_Type, pytalloc_get_mem_ctx(obj), &object->wstat);
2578 static int py_winsif_Results_set_wstat(PyObject *py_obj, PyObject *value, void *closure)
2580 struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2581 PY_CHECK_TYPE(&winsif_Stat_Type, value, return -1;);
2582 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2586 object->wstat = *(struct winsif_Stat *)pytalloc_get_ptr(value);
2590 static PyGetSetDef py_winsif_Results_getsetters[] = {
2591 { discard_const_p(char, "num_owners"), py_winsif_Results_get_num_owners, py_winsif_Results_set_num_owners },
2592 { discard_const_p(char, "address_version_maps"), py_winsif_Results_get_address_version_maps, py_winsif_Results_set_address_version_maps },
2593 { discard_const_p(char, "my_max_version_number"), py_winsif_Results_get_my_max_version_number, py_winsif_Results_set_my_max_version_number },
2594 { discard_const_p(char, "refresh_interval"), py_winsif_Results_get_refresh_interval, py_winsif_Results_set_refresh_interval },
2595 { discard_const_p(char, "tombstone_interval"), py_winsif_Results_get_tombstone_interval, py_winsif_Results_set_tombstone_interval },
2596 { discard_const_p(char, "tombstone_timeout"), py_winsif_Results_get_tombstone_timeout, py_winsif_Results_set_tombstone_timeout },
2597 { discard_const_p(char, "verify_interval"), py_winsif_Results_get_verify_interval, py_winsif_Results_set_verify_interval },
2598 { discard_const_p(char, "prioritiy_class"), py_winsif_Results_get_prioritiy_class, py_winsif_Results_set_prioritiy_class },
2599 { discard_const_p(char, "num_worker_threads"), py_winsif_Results_get_num_worker_threads, py_winsif_Results_set_num_worker_threads },
2600 { discard_const_p(char, "wstat"), py_winsif_Results_get_wstat, py_winsif_Results_set_wstat },
2604 static PyObject *py_winsif_Results_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2606 return pytalloc_new(struct winsif_Results, type);
2610 static PyTypeObject winsif_Results_Type = {
2611 PyObject_HEAD_INIT(NULL) 0,
2612 .tp_name = "winsif.Results",
2613 .tp_getset = py_winsif_Results_getsetters,
2615 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2616 .tp_basicsize = sizeof(pytalloc_Object),
2617 .tp_new = py_winsif_Results_new,
2621 static PyObject *py_winsif_Records_get_buffer_size(PyObject *obj, void *closure)
2623 struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(obj);
2624 PyObject *py_buffer_size;
2625 py_buffer_size = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->buffer_size);
2626 return py_buffer_size;
2629 static int py_winsif_Records_set_buffer_size(PyObject *py_obj, PyObject *value, void *closure)
2631 struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(py_obj);
2633 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->buffer_size));
2634 if (PyLong_Check(value)) {
2635 unsigned long long test_var;
2636 test_var = PyLong_AsUnsignedLongLong(value);
2637 if (PyErr_Occurred() != NULL) {
2640 if (test_var > uint_max) {
2641 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2642 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2645 object->buffer_size = test_var;
2646 } else if (PyInt_Check(value)) {
2648 test_var = PyInt_AsLong(value);
2649 if (test_var < 0 || test_var > uint_max) {
2650 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2651 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2654 object->buffer_size = test_var;
2656 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2657 PyInt_Type.tp_name, PyLong_Type.tp_name);
2664 static PyObject *py_winsif_Records_get_row(PyObject *obj, void *closure)
2666 struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(obj);
2668 if (object->row == NULL) {
2672 py_row = PyList_New(object->num_records);
2673 if (py_row == NULL) {
2678 for (row_cntr_1 = 0; row_cntr_1 < (object->num_records); row_cntr_1++) {
2680 py_row_1 = pytalloc_reference_ex(&winsif_RecordAction_Type, object->row, &object->row[row_cntr_1]);
2681 PyList_SetItem(py_row, row_cntr_1, py_row_1);
2688 static int py_winsif_Records_set_row(PyObject *py_obj, PyObject *value, void *closure)
2690 struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(py_obj);
2691 talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->row));
2692 if (value == Py_None) {
2696 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2699 object->row = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->row, PyList_GET_SIZE(value));
2700 if (!object->row) { return -1;; }
2701 talloc_set_name_const(object->row, "ARRAY: object->row");
2702 for (row_cntr_1 = 0; row_cntr_1 < PyList_GET_SIZE(value); row_cntr_1++) {
2703 PY_CHECK_TYPE(&winsif_RecordAction_Type, PyList_GET_ITEM(value, row_cntr_1), return -1;);
2704 if (talloc_reference(object->row, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, row_cntr_1))) == NULL) {
2708 object->row[row_cntr_1] = *(struct winsif_RecordAction *)pytalloc_get_ptr(PyList_GET_ITEM(value, row_cntr_1));
2715 static PyObject *py_winsif_Records_get_num_records(PyObject *obj, void *closure)
2717 struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(obj);
2718 PyObject *py_num_records;
2719 py_num_records = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_records);
2720 return py_num_records;
2723 static int py_winsif_Records_set_num_records(PyObject *py_obj, PyObject *value, void *closure)
2725 struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(py_obj);
2727 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_records));
2728 if (PyLong_Check(value)) {
2729 unsigned long long test_var;
2730 test_var = PyLong_AsUnsignedLongLong(value);
2731 if (PyErr_Occurred() != NULL) {
2734 if (test_var > uint_max) {
2735 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2736 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2739 object->num_records = test_var;
2740 } else if (PyInt_Check(value)) {
2742 test_var = PyInt_AsLong(value);
2743 if (test_var < 0 || test_var > uint_max) {
2744 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2745 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2748 object->num_records = test_var;
2750 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2751 PyInt_Type.tp_name, PyLong_Type.tp_name);
2758 static PyObject *py_winsif_Records_get_total_num_records(PyObject *obj, void *closure)
2760 struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(obj);
2761 PyObject *py_total_num_records;
2762 py_total_num_records = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->total_num_records);
2763 return py_total_num_records;
2766 static int py_winsif_Records_set_total_num_records(PyObject *py_obj, PyObject *value, void *closure)
2768 struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(py_obj);
2770 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_num_records));
2771 if (PyLong_Check(value)) {
2772 unsigned long long test_var;
2773 test_var = PyLong_AsUnsignedLongLong(value);
2774 if (PyErr_Occurred() != NULL) {
2777 if (test_var > uint_max) {
2778 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2779 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2782 object->total_num_records = test_var;
2783 } else if (PyInt_Check(value)) {
2785 test_var = PyInt_AsLong(value);
2786 if (test_var < 0 || test_var > uint_max) {
2787 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2788 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2791 object->total_num_records = test_var;
2793 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2794 PyInt_Type.tp_name, PyLong_Type.tp_name);
2801 static PyGetSetDef py_winsif_Records_getsetters[] = {
2802 { discard_const_p(char, "buffer_size"), py_winsif_Records_get_buffer_size, py_winsif_Records_set_buffer_size },
2803 { discard_const_p(char, "row"), py_winsif_Records_get_row, py_winsif_Records_set_row },
2804 { discard_const_p(char, "num_records"), py_winsif_Records_get_num_records, py_winsif_Records_set_num_records },
2805 { discard_const_p(char, "total_num_records"), py_winsif_Records_get_total_num_records, py_winsif_Records_set_total_num_records },
2809 static PyObject *py_winsif_Records_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2811 return pytalloc_new(struct winsif_Records, type);
2815 static PyTypeObject winsif_Records_Type = {
2816 PyObject_HEAD_INIT(NULL) 0,
2817 .tp_name = "winsif.Records",
2818 .tp_getset = py_winsif_Records_getsetters,
2820 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2821 .tp_basicsize = sizeof(pytalloc_Object),
2822 .tp_new = py_winsif_Records_new,
2826 static PyObject *py_winsif_BrowserInfo_get_name_len(PyObject *obj, void *closure)
2828 struct winsif_BrowserInfo *object = (struct winsif_BrowserInfo *)pytalloc_get_ptr(obj);
2829 PyObject *py_name_len;
2830 py_name_len = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->name_len);
2834 static int py_winsif_BrowserInfo_set_name_len(PyObject *py_obj, PyObject *value, void *closure)
2836 struct winsif_BrowserInfo *object = (struct winsif_BrowserInfo *)pytalloc_get_ptr(py_obj);
2838 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->name_len));
2839 if (PyLong_Check(value)) {
2840 unsigned long long test_var;
2841 test_var = PyLong_AsUnsignedLongLong(value);
2842 if (PyErr_Occurred() != NULL) {
2845 if (test_var > uint_max) {
2846 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2847 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2850 object->name_len = test_var;
2851 } else if (PyInt_Check(value)) {
2853 test_var = PyInt_AsLong(value);
2854 if (test_var < 0 || test_var > uint_max) {
2855 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2856 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2859 object->name_len = test_var;
2861 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2862 PyInt_Type.tp_name, PyLong_Type.tp_name);
2869 static PyObject *py_winsif_BrowserInfo_get_name(PyObject *obj, void *closure)
2871 struct winsif_BrowserInfo *object = (struct winsif_BrowserInfo *)pytalloc_get_ptr(obj);
2873 if (object->name == NULL) {
2877 if (object->name == NULL) {
2881 py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
2887 static int py_winsif_BrowserInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
2889 struct winsif_BrowserInfo *object = (struct winsif_BrowserInfo *)pytalloc_get_ptr(py_obj);
2890 if (value == Py_None) {
2891 object->name = NULL;
2893 object->name = NULL;
2894 if (PyUnicode_Check(value)) {
2895 object->name = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
2896 } else if (PyString_Check(value)) {
2897 object->name = PyString_AS_STRING(value);
2899 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2906 static PyGetSetDef py_winsif_BrowserInfo_getsetters[] = {
2907 { discard_const_p(char, "name_len"), py_winsif_BrowserInfo_get_name_len, py_winsif_BrowserInfo_set_name_len },
2908 { discard_const_p(char, "name"), py_winsif_BrowserInfo_get_name, py_winsif_BrowserInfo_set_name },
2912 static PyObject *py_winsif_BrowserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2914 return pytalloc_new(struct winsif_BrowserInfo, type);
2918 static PyTypeObject winsif_BrowserInfo_Type = {
2919 PyObject_HEAD_INIT(NULL) 0,
2920 .tp_name = "winsif.BrowserInfo",
2921 .tp_getset = py_winsif_BrowserInfo_getsetters,
2923 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2924 .tp_basicsize = sizeof(pytalloc_Object),
2925 .tp_new = py_winsif_BrowserInfo_new,
2929 static PyObject *py_winsif_BrowserNames_get_num_entries(PyObject *obj, void *closure)
2931 struct winsif_BrowserNames *object = (struct winsif_BrowserNames *)pytalloc_get_ptr(obj);
2932 PyObject *py_num_entries;
2933 py_num_entries = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_entries);
2934 return py_num_entries;
2937 static int py_winsif_BrowserNames_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
2939 struct winsif_BrowserNames *object = (struct winsif_BrowserNames *)pytalloc_get_ptr(py_obj);
2941 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_entries));
2942 if (PyLong_Check(value)) {
2943 unsigned long long test_var;
2944 test_var = PyLong_AsUnsignedLongLong(value);
2945 if (PyErr_Occurred() != NULL) {
2948 if (test_var > uint_max) {
2949 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
2950 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2953 object->num_entries = test_var;
2954 } else if (PyInt_Check(value)) {
2956 test_var = PyInt_AsLong(value);
2957 if (test_var < 0 || test_var > uint_max) {
2958 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
2959 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
2962 object->num_entries = test_var;
2964 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2965 PyInt_Type.tp_name, PyLong_Type.tp_name);
2972 static PyObject *py_winsif_BrowserNames_get_info(PyObject *obj, void *closure)
2974 struct winsif_BrowserNames *object = (struct winsif_BrowserNames *)pytalloc_get_ptr(obj);
2976 if (object->info == NULL) {
2980 py_info = PyList_New(object->num_entries);
2981 if (py_info == NULL) {
2986 for (info_cntr_1 = 0; info_cntr_1 < (object->num_entries); info_cntr_1++) {
2987 PyObject *py_info_1;
2988 py_info_1 = pytalloc_reference_ex(&winsif_BrowserInfo_Type, object->info, &object->info[info_cntr_1]);
2989 PyList_SetItem(py_info, info_cntr_1, py_info_1);
2996 static int py_winsif_BrowserNames_set_info(PyObject *py_obj, PyObject *value, void *closure)
2998 struct winsif_BrowserNames *object = (struct winsif_BrowserNames *)pytalloc_get_ptr(py_obj);
2999 talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
3000 if (value == Py_None) {
3001 object->info = NULL;
3003 object->info = NULL;
3004 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3007 object->info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->info, PyList_GET_SIZE(value));
3008 if (!object->info) { return -1;; }
3009 talloc_set_name_const(object->info, "ARRAY: object->info");
3010 for (info_cntr_1 = 0; info_cntr_1 < PyList_GET_SIZE(value); info_cntr_1++) {
3011 PY_CHECK_TYPE(&winsif_BrowserInfo_Type, PyList_GET_ITEM(value, info_cntr_1), return -1;);
3012 if (talloc_reference(object->info, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, info_cntr_1))) == NULL) {
3016 object->info[info_cntr_1] = *(struct winsif_BrowserInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, info_cntr_1));
3023 static PyGetSetDef py_winsif_BrowserNames_getsetters[] = {
3024 { discard_const_p(char, "num_entries"), py_winsif_BrowserNames_get_num_entries, py_winsif_BrowserNames_set_num_entries },
3025 { discard_const_p(char, "info"), py_winsif_BrowserNames_get_info, py_winsif_BrowserNames_set_info },
3029 static PyObject *py_winsif_BrowserNames_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3031 return pytalloc_new(struct winsif_BrowserNames, type);
3035 static PyTypeObject winsif_BrowserNames_Type = {
3036 PyObject_HEAD_INIT(NULL) 0,
3037 .tp_name = "winsif.BrowserNames",
3038 .tp_getset = py_winsif_BrowserNames_getsetters,
3040 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3041 .tp_basicsize = sizeof(pytalloc_Object),
3042 .tp_new = py_winsif_BrowserNames_new,
3046 static PyObject *py_winsif_BindData_get_tcp_ip(PyObject *obj, void *closure)
3048 struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(obj);
3049 PyObject *py_tcp_ip;
3050 py_tcp_ip = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->tcp_ip);
3054 static int py_winsif_BindData_set_tcp_ip(PyObject *py_obj, PyObject *value, void *closure)
3056 struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(py_obj);
3058 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tcp_ip));
3059 if (PyLong_Check(value)) {
3060 unsigned long long test_var;
3061 test_var = PyLong_AsUnsignedLongLong(value);
3062 if (PyErr_Occurred() != NULL) {
3065 if (test_var > uint_max) {
3066 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3067 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3070 object->tcp_ip = test_var;
3071 } else if (PyInt_Check(value)) {
3073 test_var = PyInt_AsLong(value);
3074 if (test_var < 0 || test_var > uint_max) {
3075 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3076 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3079 object->tcp_ip = test_var;
3081 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3082 PyInt_Type.tp_name, PyLong_Type.tp_name);
3089 static PyObject *py_winsif_BindData_get_server_address(PyObject *obj, void *closure)
3091 struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(obj);
3092 PyObject *py_server_address;
3093 if (object->server_address == NULL) {
3094 py_server_address = Py_None;
3095 Py_INCREF(py_server_address);
3097 if (object->server_address == NULL) {
3098 py_server_address = Py_None;
3099 Py_INCREF(py_server_address);
3101 py_server_address = PyUnicode_Decode(object->server_address, strlen(object->server_address), "utf-8", "ignore");
3104 return py_server_address;
3107 static int py_winsif_BindData_set_server_address(PyObject *py_obj, PyObject *value, void *closure)
3109 struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(py_obj);
3110 if (value == Py_None) {
3111 object->server_address = NULL;
3113 object->server_address = NULL;
3114 if (PyUnicode_Check(value)) {
3115 object->server_address = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
3116 } else if (PyString_Check(value)) {
3117 object->server_address = PyString_AS_STRING(value);
3119 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3126 static PyObject *py_winsif_BindData_get_pipe_name(PyObject *obj, void *closure)
3128 struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(obj);
3129 PyObject *py_pipe_name;
3130 if (object->pipe_name == NULL) {
3131 py_pipe_name = Py_None;
3132 Py_INCREF(py_pipe_name);
3134 if (object->pipe_name == NULL) {
3135 py_pipe_name = Py_None;
3136 Py_INCREF(py_pipe_name);
3138 py_pipe_name = PyUnicode_Decode(object->pipe_name, strlen(object->pipe_name), "utf-8", "ignore");
3141 return py_pipe_name;
3144 static int py_winsif_BindData_set_pipe_name(PyObject *py_obj, PyObject *value, void *closure)
3146 struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(py_obj);
3147 if (value == Py_None) {
3148 object->pipe_name = NULL;
3150 object->pipe_name = NULL;
3151 if (PyUnicode_Check(value)) {
3152 object->pipe_name = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
3153 } else if (PyString_Check(value)) {
3154 object->pipe_name = PyString_AS_STRING(value);
3156 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3163 static PyGetSetDef py_winsif_BindData_getsetters[] = {
3164 { discard_const_p(char, "tcp_ip"), py_winsif_BindData_get_tcp_ip, py_winsif_BindData_set_tcp_ip },
3165 { discard_const_p(char, "server_address"), py_winsif_BindData_get_server_address, py_winsif_BindData_set_server_address },
3166 { discard_const_p(char, "pipe_name"), py_winsif_BindData_get_pipe_name, py_winsif_BindData_set_pipe_name },
3170 static PyObject *py_winsif_BindData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3172 return pytalloc_new(struct winsif_BindData, type);
3176 static PyTypeObject winsif_BindData_Type = {
3177 PyObject_HEAD_INIT(NULL) 0,
3178 .tp_name = "winsif.BindData",
3179 .tp_getset = py_winsif_BindData_getsetters,
3181 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3182 .tp_basicsize = sizeof(pytalloc_Object),
3183 .tp_new = py_winsif_BindData_new,
3187 static PyObject *py_winsif_ResultsNew_get_num_owners(PyObject *obj, void *closure)
3189 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3190 PyObject *py_num_owners;
3191 py_num_owners = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_owners);
3192 return py_num_owners;
3195 static int py_winsif_ResultsNew_set_num_owners(PyObject *py_obj, PyObject *value, void *closure)
3197 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3199 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_owners));
3200 if (PyLong_Check(value)) {
3201 unsigned long long test_var;
3202 test_var = PyLong_AsUnsignedLongLong(value);
3203 if (PyErr_Occurred() != NULL) {
3206 if (test_var > uint_max) {
3207 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3208 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3211 object->num_owners = test_var;
3212 } else if (PyInt_Check(value)) {
3214 test_var = PyInt_AsLong(value);
3215 if (test_var < 0 || test_var > uint_max) {
3216 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3217 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3220 object->num_owners = test_var;
3222 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3223 PyInt_Type.tp_name, PyLong_Type.tp_name);
3230 static PyObject *py_winsif_ResultsNew_get_address_version_maps(PyObject *obj, void *closure)
3232 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3233 PyObject *py_address_version_maps;
3234 if (object->address_version_maps == NULL) {
3235 py_address_version_maps = Py_None;
3236 Py_INCREF(py_address_version_maps);
3238 py_address_version_maps = PyList_New(object->num_owners);
3239 if (py_address_version_maps == NULL) {
3243 int address_version_maps_cntr_1;
3244 for (address_version_maps_cntr_1 = 0; address_version_maps_cntr_1 < (object->num_owners); address_version_maps_cntr_1++) {
3245 PyObject *py_address_version_maps_1;
3246 py_address_version_maps_1 = pytalloc_reference_ex(&winsif_AddressVersionMap_Type, object->address_version_maps, &object->address_version_maps[address_version_maps_cntr_1]);
3247 PyList_SetItem(py_address_version_maps, address_version_maps_cntr_1, py_address_version_maps_1);
3251 return py_address_version_maps;
3254 static int py_winsif_ResultsNew_set_address_version_maps(PyObject *py_obj, PyObject *value, void *closure)
3256 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3257 talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->address_version_maps));
3258 if (value == Py_None) {
3259 object->address_version_maps = NULL;
3261 object->address_version_maps = NULL;
3262 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3264 int address_version_maps_cntr_1;
3265 object->address_version_maps = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->address_version_maps, PyList_GET_SIZE(value));
3266 if (!object->address_version_maps) { return -1;; }
3267 talloc_set_name_const(object->address_version_maps, "ARRAY: object->address_version_maps");
3268 for (address_version_maps_cntr_1 = 0; address_version_maps_cntr_1 < PyList_GET_SIZE(value); address_version_maps_cntr_1++) {
3269 PY_CHECK_TYPE(&winsif_AddressVersionMap_Type, PyList_GET_ITEM(value, address_version_maps_cntr_1), return -1;);
3270 if (talloc_reference(object->address_version_maps, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, address_version_maps_cntr_1))) == NULL) {
3274 object->address_version_maps[address_version_maps_cntr_1] = *(struct winsif_AddressVersionMap *)pytalloc_get_ptr(PyList_GET_ITEM(value, address_version_maps_cntr_1));
3281 static PyObject *py_winsif_ResultsNew_get_my_max_version_number(PyObject *obj, void *closure)
3283 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3284 PyObject *py_my_max_version_number;
3285 py_my_max_version_number = ndr_PyLong_FromUnsignedLongLong(object->my_max_version_number);
3286 return py_my_max_version_number;
3289 static int py_winsif_ResultsNew_set_my_max_version_number(PyObject *py_obj, PyObject *value, void *closure)
3291 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3293 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->my_max_version_number));
3294 if (PyLong_Check(value)) {
3295 unsigned long long test_var;
3296 test_var = PyLong_AsUnsignedLongLong(value);
3297 if (PyErr_Occurred() != NULL) {
3300 if (test_var > uint_max) {
3301 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3302 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3305 object->my_max_version_number = test_var;
3306 } else if (PyInt_Check(value)) {
3308 test_var = PyInt_AsLong(value);
3309 if (test_var < 0 || test_var > uint_max) {
3310 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3311 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3314 object->my_max_version_number = test_var;
3316 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3317 PyInt_Type.tp_name, PyLong_Type.tp_name);
3324 static PyObject *py_winsif_ResultsNew_get_refresh_interval(PyObject *obj, void *closure)
3326 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3327 PyObject *py_refresh_interval;
3328 py_refresh_interval = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->refresh_interval);
3329 return py_refresh_interval;
3332 static int py_winsif_ResultsNew_set_refresh_interval(PyObject *py_obj, PyObject *value, void *closure)
3334 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3336 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->refresh_interval));
3337 if (PyLong_Check(value)) {
3338 unsigned long long test_var;
3339 test_var = PyLong_AsUnsignedLongLong(value);
3340 if (PyErr_Occurred() != NULL) {
3343 if (test_var > uint_max) {
3344 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3345 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3348 object->refresh_interval = test_var;
3349 } else if (PyInt_Check(value)) {
3351 test_var = PyInt_AsLong(value);
3352 if (test_var < 0 || test_var > uint_max) {
3353 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3354 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3357 object->refresh_interval = test_var;
3359 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3360 PyInt_Type.tp_name, PyLong_Type.tp_name);
3367 static PyObject *py_winsif_ResultsNew_get_tombstone_interval(PyObject *obj, void *closure)
3369 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3370 PyObject *py_tombstone_interval;
3371 py_tombstone_interval = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->tombstone_interval);
3372 return py_tombstone_interval;
3375 static int py_winsif_ResultsNew_set_tombstone_interval(PyObject *py_obj, PyObject *value, void *closure)
3377 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3379 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tombstone_interval));
3380 if (PyLong_Check(value)) {
3381 unsigned long long test_var;
3382 test_var = PyLong_AsUnsignedLongLong(value);
3383 if (PyErr_Occurred() != NULL) {
3386 if (test_var > uint_max) {
3387 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3388 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3391 object->tombstone_interval = test_var;
3392 } else if (PyInt_Check(value)) {
3394 test_var = PyInt_AsLong(value);
3395 if (test_var < 0 || test_var > uint_max) {
3396 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3397 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3400 object->tombstone_interval = test_var;
3402 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3403 PyInt_Type.tp_name, PyLong_Type.tp_name);
3410 static PyObject *py_winsif_ResultsNew_get_tombstone_timeout(PyObject *obj, void *closure)
3412 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3413 PyObject *py_tombstone_timeout;
3414 py_tombstone_timeout = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->tombstone_timeout);
3415 return py_tombstone_timeout;
3418 static int py_winsif_ResultsNew_set_tombstone_timeout(PyObject *py_obj, PyObject *value, void *closure)
3420 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3422 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->tombstone_timeout));
3423 if (PyLong_Check(value)) {
3424 unsigned long long test_var;
3425 test_var = PyLong_AsUnsignedLongLong(value);
3426 if (PyErr_Occurred() != NULL) {
3429 if (test_var > uint_max) {
3430 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3431 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3434 object->tombstone_timeout = test_var;
3435 } else if (PyInt_Check(value)) {
3437 test_var = PyInt_AsLong(value);
3438 if (test_var < 0 || test_var > uint_max) {
3439 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3440 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3443 object->tombstone_timeout = test_var;
3445 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3446 PyInt_Type.tp_name, PyLong_Type.tp_name);
3453 static PyObject *py_winsif_ResultsNew_get_verify_interval(PyObject *obj, void *closure)
3455 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3456 PyObject *py_verify_interval;
3457 py_verify_interval = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->verify_interval);
3458 return py_verify_interval;
3461 static int py_winsif_ResultsNew_set_verify_interval(PyObject *py_obj, PyObject *value, void *closure)
3463 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3465 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->verify_interval));
3466 if (PyLong_Check(value)) {
3467 unsigned long long test_var;
3468 test_var = PyLong_AsUnsignedLongLong(value);
3469 if (PyErr_Occurred() != NULL) {
3472 if (test_var > uint_max) {
3473 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3474 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3477 object->verify_interval = test_var;
3478 } else if (PyInt_Check(value)) {
3480 test_var = PyInt_AsLong(value);
3481 if (test_var < 0 || test_var > uint_max) {
3482 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3483 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3486 object->verify_interval = test_var;
3488 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3489 PyInt_Type.tp_name, PyLong_Type.tp_name);
3496 static PyObject *py_winsif_ResultsNew_get_prioritiy_class(PyObject *obj, void *closure)
3498 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3499 PyObject *py_prioritiy_class;
3500 py_prioritiy_class = PyInt_FromLong((uint16_t)object->prioritiy_class);
3501 return py_prioritiy_class;
3504 static int py_winsif_ResultsNew_set_prioritiy_class(PyObject *py_obj, PyObject *value, void *closure)
3506 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3508 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->prioritiy_class));
3509 if (PyLong_Check(value)) {
3510 unsigned long long test_var;
3511 test_var = PyLong_AsUnsignedLongLong(value);
3512 if (PyErr_Occurred() != NULL) {
3515 if (test_var > uint_max) {
3516 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3517 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3520 object->prioritiy_class = test_var;
3521 } else if (PyInt_Check(value)) {
3523 test_var = PyInt_AsLong(value);
3524 if (test_var < 0 || test_var > uint_max) {
3525 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3526 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3529 object->prioritiy_class = test_var;
3531 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3532 PyInt_Type.tp_name, PyLong_Type.tp_name);
3539 static PyObject *py_winsif_ResultsNew_get_num_worker_threads(PyObject *obj, void *closure)
3541 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3542 PyObject *py_num_worker_threads;
3543 py_num_worker_threads = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_worker_threads);
3544 return py_num_worker_threads;
3547 static int py_winsif_ResultsNew_set_num_worker_threads(PyObject *py_obj, PyObject *value, void *closure)
3549 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3551 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_worker_threads));
3552 if (PyLong_Check(value)) {
3553 unsigned long long test_var;
3554 test_var = PyLong_AsUnsignedLongLong(value);
3555 if (PyErr_Occurred() != NULL) {
3558 if (test_var > uint_max) {
3559 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3560 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3563 object->num_worker_threads = test_var;
3564 } else if (PyInt_Check(value)) {
3566 test_var = PyInt_AsLong(value);
3567 if (test_var < 0 || test_var > uint_max) {
3568 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3569 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3572 object->num_worker_threads = test_var;
3574 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3575 PyInt_Type.tp_name, PyLong_Type.tp_name);
3582 static PyObject *py_winsif_ResultsNew_get_wstat(PyObject *obj, void *closure)
3584 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3586 py_wstat = pytalloc_reference_ex(&winsif_Stat_Type, pytalloc_get_mem_ctx(obj), &object->wstat);
3590 static int py_winsif_ResultsNew_set_wstat(PyObject *py_obj, PyObject *value, void *closure)
3592 struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3593 PY_CHECK_TYPE(&winsif_Stat_Type, value, return -1;);
3594 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3598 object->wstat = *(struct winsif_Stat *)pytalloc_get_ptr(value);
3602 static PyGetSetDef py_winsif_ResultsNew_getsetters[] = {
3603 { discard_const_p(char, "num_owners"), py_winsif_ResultsNew_get_num_owners, py_winsif_ResultsNew_set_num_owners },
3604 { discard_const_p(char, "address_version_maps"), py_winsif_ResultsNew_get_address_version_maps, py_winsif_ResultsNew_set_address_version_maps },
3605 { discard_const_p(char, "my_max_version_number"), py_winsif_ResultsNew_get_my_max_version_number, py_winsif_ResultsNew_set_my_max_version_number },
3606 { discard_const_p(char, "refresh_interval"), py_winsif_ResultsNew_get_refresh_interval, py_winsif_ResultsNew_set_refresh_interval },
3607 { discard_const_p(char, "tombstone_interval"), py_winsif_ResultsNew_get_tombstone_interval, py_winsif_ResultsNew_set_tombstone_interval },
3608 { discard_const_p(char, "tombstone_timeout"), py_winsif_ResultsNew_get_tombstone_timeout, py_winsif_ResultsNew_set_tombstone_timeout },
3609 { discard_const_p(char, "verify_interval"), py_winsif_ResultsNew_get_verify_interval, py_winsif_ResultsNew_set_verify_interval },
3610 { discard_const_p(char, "prioritiy_class"), py_winsif_ResultsNew_get_prioritiy_class, py_winsif_ResultsNew_set_prioritiy_class },
3611 { discard_const_p(char, "num_worker_threads"), py_winsif_ResultsNew_get_num_worker_threads, py_winsif_ResultsNew_set_num_worker_threads },
3612 { discard_const_p(char, "wstat"), py_winsif_ResultsNew_get_wstat, py_winsif_ResultsNew_set_wstat },
3616 static PyObject *py_winsif_ResultsNew_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3618 return pytalloc_new(struct winsif_ResultsNew, type);
3622 static PyTypeObject winsif_ResultsNew_Type = {
3623 PyObject_HEAD_INIT(NULL) 0,
3624 .tp_name = "winsif.ResultsNew",
3625 .tp_getset = py_winsif_ResultsNew_getsetters,
3627 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3628 .tp_basicsize = sizeof(pytalloc_Object),
3629 .tp_new = py_winsif_ResultsNew_new,
3633 static PyObject *py_winsif_ScavengingRequest_get_opcode(PyObject *obj, void *closure)
3635 struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(obj);
3636 PyObject *py_opcode;
3637 py_opcode = PyInt_FromLong((uint16_t)object->opcode);
3641 static int py_winsif_ScavengingRequest_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
3643 struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(py_obj);
3645 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->opcode));
3646 if (PyLong_Check(value)) {
3647 unsigned long long test_var;
3648 test_var = PyLong_AsUnsignedLongLong(value);
3649 if (PyErr_Occurred() != NULL) {
3652 if (test_var > uint_max) {
3653 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3654 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3657 object->opcode = test_var;
3658 } else if (PyInt_Check(value)) {
3660 test_var = PyInt_AsLong(value);
3661 if (test_var < 0 || test_var > uint_max) {
3662 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3663 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3666 object->opcode = test_var;
3668 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3669 PyInt_Type.tp_name, PyLong_Type.tp_name);
3676 static PyObject *py_winsif_ScavengingRequest_get_age(PyObject *obj, void *closure)
3678 struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(obj);
3680 py_age = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->age);
3684 static int py_winsif_ScavengingRequest_set_age(PyObject *py_obj, PyObject *value, void *closure)
3686 struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(py_obj);
3688 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->age));
3689 if (PyLong_Check(value)) {
3690 unsigned long long test_var;
3691 test_var = PyLong_AsUnsignedLongLong(value);
3692 if (PyErr_Occurred() != NULL) {
3695 if (test_var > uint_max) {
3696 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3697 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3700 object->age = test_var;
3701 } else if (PyInt_Check(value)) {
3703 test_var = PyInt_AsLong(value);
3704 if (test_var < 0 || test_var > uint_max) {
3705 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3706 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3709 object->age = test_var;
3711 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3712 PyInt_Type.tp_name, PyLong_Type.tp_name);
3719 static PyObject *py_winsif_ScavengingRequest_get_force(PyObject *obj, void *closure)
3721 struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(obj);
3723 py_force = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->force);
3727 static int py_winsif_ScavengingRequest_set_force(PyObject *py_obj, PyObject *value, void *closure)
3729 struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(py_obj);
3731 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force));
3732 if (PyLong_Check(value)) {
3733 unsigned long long test_var;
3734 test_var = PyLong_AsUnsignedLongLong(value);
3735 if (PyErr_Occurred() != NULL) {
3738 if (test_var > uint_max) {
3739 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3740 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3743 object->force = test_var;
3744 } else if (PyInt_Check(value)) {
3746 test_var = PyInt_AsLong(value);
3747 if (test_var < 0 || test_var > uint_max) {
3748 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3749 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3752 object->force = test_var;
3754 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3755 PyInt_Type.tp_name, PyLong_Type.tp_name);
3762 static PyGetSetDef py_winsif_ScavengingRequest_getsetters[] = {
3763 { discard_const_p(char, "opcode"), py_winsif_ScavengingRequest_get_opcode, py_winsif_ScavengingRequest_set_opcode },
3764 { discard_const_p(char, "age"), py_winsif_ScavengingRequest_get_age, py_winsif_ScavengingRequest_set_age },
3765 { discard_const_p(char, "force"), py_winsif_ScavengingRequest_get_force, py_winsif_ScavengingRequest_set_force },
3769 static PyObject *py_winsif_ScavengingRequest_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3771 return pytalloc_new(struct winsif_ScavengingRequest, type);
3775 static PyTypeObject winsif_ScavengingRequest_Type = {
3776 PyObject_HEAD_INIT(NULL) 0,
3777 .tp_name = "winsif.ScavengingRequest",
3778 .tp_getset = py_winsif_ScavengingRequest_getsetters,
3780 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3781 .tp_basicsize = sizeof(pytalloc_Object),
3782 .tp_new = py_winsif_ScavengingRequest_new,
3786 static bool pack_py_winsif_WinsRecordAction_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsRecordAction *r)
3788 PyObject *py_record_action;
3789 const char *kwnames[] = {
3790 "record_action", NULL
3793 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsRecordAction", discard_const_p(char *, kwnames), &py_record_action)) {
3797 r->in.record_action = talloc_ptrtype(r, r->in.record_action);
3798 if (py_record_action == Py_None) {
3799 *r->in.record_action = NULL;
3801 *r->in.record_action = NULL;
3802 PY_CHECK_TYPE(&winsif_RecordAction_Type, py_record_action, return false;);
3803 if (talloc_reference(r, pytalloc_get_mem_ctx(py_record_action)) == NULL) {
3807 *r->in.record_action = (struct winsif_RecordAction *)pytalloc_get_ptr(py_record_action);
3812 static PyObject *unpack_py_winsif_WinsRecordAction_args_out(struct winsif_WinsRecordAction *r)
3815 PyObject *py_record_action;
3816 if (*r->out.record_action == NULL) {
3817 py_record_action = Py_None;
3818 Py_INCREF(py_record_action);
3820 py_record_action = pytalloc_reference_ex(&winsif_RecordAction_Type, *r->out.record_action, *r->out.record_action);
3822 result = py_record_action;
3823 if (!W_ERROR_IS_OK(r->out.result)) {
3824 PyErr_SetWERROR(r->out.result);
3831 static bool pack_py_winsif_WinsStatus_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsStatus *r)
3834 PyObject *py_results;
3835 const char *kwnames[] = {
3836 "cmd", "results", NULL
3839 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winsif_WinsStatus", discard_const_p(char *, kwnames), &py_cmd, &py_results)) {
3844 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.cmd));
3845 if (PyLong_Check(py_cmd)) {
3846 unsigned long long test_var;
3847 test_var = PyLong_AsUnsignedLongLong(py_cmd);
3848 if (PyErr_Occurred() != NULL) {
3851 if (test_var > uint_max) {
3852 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3853 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3856 r->in.cmd = test_var;
3857 } else if (PyInt_Check(py_cmd)) {
3859 test_var = PyInt_AsLong(py_cmd);
3860 if (test_var < 0 || test_var > uint_max) {
3861 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3862 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3865 r->in.cmd = test_var;
3867 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3868 PyInt_Type.tp_name, PyLong_Type.tp_name);
3872 r->in.results = talloc_ptrtype(r, r->in.results);
3873 PY_CHECK_TYPE(&winsif_Results_Type, py_results, return false;);
3874 if (talloc_reference(r, pytalloc_get_mem_ctx(py_results)) == NULL) {
3878 r->in.results = (struct winsif_Results *)pytalloc_get_ptr(py_results);
3882 static PyObject *unpack_py_winsif_WinsStatus_args_out(struct winsif_WinsStatus *r)
3885 PyObject *py_results;
3886 py_results = pytalloc_reference_ex(&winsif_Results_Type, r->out.results, r->out.results);
3887 result = py_results;
3888 if (!W_ERROR_IS_OK(r->out.result)) {
3889 PyErr_SetWERROR(r->out.result);
3896 static bool pack_py_winsif_WinsTrigger_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsTrigger *r)
3898 PyObject *py_owner_address;
3899 PyObject *py_trigger_type;
3900 const char *kwnames[] = {
3901 "owner_address", "trigger_type", NULL
3904 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winsif_WinsTrigger", discard_const_p(char *, kwnames), &py_owner_address, &py_trigger_type)) {
3908 r->in.owner_address = talloc_ptrtype(r, r->in.owner_address);
3909 PY_CHECK_TYPE(&winsif_Address_Type, py_owner_address, return false;);
3910 if (talloc_reference(r, pytalloc_get_mem_ctx(py_owner_address)) == NULL) {
3914 r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
3916 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.trigger_type));
3917 if (PyLong_Check(py_trigger_type)) {
3918 unsigned long long test_var;
3919 test_var = PyLong_AsUnsignedLongLong(py_trigger_type);
3920 if (PyErr_Occurred() != NULL) {
3923 if (test_var > uint_max) {
3924 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3925 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3928 r->in.trigger_type = test_var;
3929 } else if (PyInt_Check(py_trigger_type)) {
3931 test_var = PyInt_AsLong(py_trigger_type);
3932 if (test_var < 0 || test_var > uint_max) {
3933 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
3934 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3937 r->in.trigger_type = test_var;
3939 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3940 PyInt_Type.tp_name, PyLong_Type.tp_name);
3947 static PyObject *unpack_py_winsif_WinsTrigger_args_out(struct winsif_WinsTrigger *r)
3952 if (!W_ERROR_IS_OK(r->out.result)) {
3953 PyErr_SetWERROR(r->out.result);
3960 static bool pack_py_winsif_WinsDoStaticInit_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDoStaticInit *r)
3962 PyObject *py_data_file_path;
3963 PyObject *py_delete_file;
3964 const char *kwnames[] = {
3965 "data_file_path", "delete_file", NULL
3968 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winsif_WinsDoStaticInit", discard_const_p(char *, kwnames), &py_data_file_path, &py_delete_file)) {
3972 if (py_data_file_path == Py_None) {
3973 r->in.data_file_path = NULL;
3975 r->in.data_file_path = NULL;
3976 if (PyUnicode_Check(py_data_file_path)) {
3977 r->in.data_file_path = PyString_AS_STRING(PyUnicode_AsEncodedString(py_data_file_path, "utf-8", "ignore"));
3978 } else if (PyString_Check(py_data_file_path)) {
3979 r->in.data_file_path = PyString_AS_STRING(py_data_file_path);
3981 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_data_file_path)->tp_name);
3986 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.delete_file));
3987 if (PyLong_Check(py_delete_file)) {
3988 unsigned long long test_var;
3989 test_var = PyLong_AsUnsignedLongLong(py_delete_file);
3990 if (PyErr_Occurred() != NULL) {
3993 if (test_var > uint_max) {
3994 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
3995 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
3998 r->in.delete_file = test_var;
3999 } else if (PyInt_Check(py_delete_file)) {
4001 test_var = PyInt_AsLong(py_delete_file);
4002 if (test_var < 0 || test_var > uint_max) {
4003 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4004 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4007 r->in.delete_file = test_var;
4009 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4010 PyInt_Type.tp_name, PyLong_Type.tp_name);
4017 static PyObject *unpack_py_winsif_WinsDoStaticInit_args_out(struct winsif_WinsDoStaticInit *r)
4022 if (!W_ERROR_IS_OK(r->out.result)) {
4023 PyErr_SetWERROR(r->out.result);
4030 static bool pack_py_winsif_WinsDoScavenging_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDoScavenging *r)
4032 const char *kwnames[] = {
4036 if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":winsif_WinsDoScavenging", discard_const_p(char *, kwnames))) {
4043 static PyObject *unpack_py_winsif_WinsDoScavenging_args_out(struct winsif_WinsDoScavenging *r)
4048 if (!W_ERROR_IS_OK(r->out.result)) {
4049 PyErr_SetWERROR(r->out.result);
4056 static bool pack_py_winsif_WinsGetDbRecs_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetDbRecs *r)
4058 PyObject *py_owner_address;
4059 PyObject *py_min_version_number;
4060 PyObject *py_max_version_number;
4061 const char *kwnames[] = {
4062 "owner_address", "min_version_number", "max_version_number", NULL
4065 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winsif_WinsGetDbRecs", discard_const_p(char *, kwnames), &py_owner_address, &py_min_version_number, &py_max_version_number)) {
4069 if (py_owner_address == Py_None) {
4070 r->in.owner_address = NULL;
4072 r->in.owner_address = NULL;
4073 PY_CHECK_TYPE(&winsif_Address_Type, py_owner_address, return false;);
4074 if (talloc_reference(r, pytalloc_get_mem_ctx(py_owner_address)) == NULL) {
4078 r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4081 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.min_version_number));
4082 if (PyLong_Check(py_min_version_number)) {
4083 unsigned long long test_var;
4084 test_var = PyLong_AsUnsignedLongLong(py_min_version_number);
4085 if (PyErr_Occurred() != NULL) {
4088 if (test_var > uint_max) {
4089 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4090 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4093 r->in.min_version_number = test_var;
4094 } else if (PyInt_Check(py_min_version_number)) {
4096 test_var = PyInt_AsLong(py_min_version_number);
4097 if (test_var < 0 || test_var > uint_max) {
4098 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4099 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4102 r->in.min_version_number = test_var;
4104 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4105 PyInt_Type.tp_name, PyLong_Type.tp_name);
4110 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_version_number));
4111 if (PyLong_Check(py_max_version_number)) {
4112 unsigned long long test_var;
4113 test_var = PyLong_AsUnsignedLongLong(py_max_version_number);
4114 if (PyErr_Occurred() != NULL) {
4117 if (test_var > uint_max) {
4118 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4119 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4122 r->in.max_version_number = test_var;
4123 } else if (PyInt_Check(py_max_version_number)) {
4125 test_var = PyInt_AsLong(py_max_version_number);
4126 if (test_var < 0 || test_var > uint_max) {
4127 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4128 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4131 r->in.max_version_number = test_var;
4133 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4134 PyInt_Type.tp_name, PyLong_Type.tp_name);
4141 static PyObject *unpack_py_winsif_WinsGetDbRecs_args_out(struct winsif_WinsGetDbRecs *r)
4144 PyObject *py_records;
4145 py_records = pytalloc_reference_ex(&winsif_Records_Type, r->out.records, r->out.records);
4146 result = py_records;
4147 if (!W_ERROR_IS_OK(r->out.result)) {
4148 PyErr_SetWERROR(r->out.result);
4155 static bool pack_py_winsif_WinsTerm_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsTerm *r)
4157 PyObject *py_abrupt_termination;
4158 const char *kwnames[] = {
4159 "abrupt_termination", NULL
4162 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsTerm", discard_const_p(char *, kwnames), &py_abrupt_termination)) {
4167 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.abrupt_termination));
4168 if (PyLong_Check(py_abrupt_termination)) {
4169 unsigned long long test_var;
4170 test_var = PyLong_AsUnsignedLongLong(py_abrupt_termination);
4171 if (PyErr_Occurred() != NULL) {
4174 if (test_var > uint_max) {
4175 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4176 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4179 r->in.abrupt_termination = test_var;
4180 } else if (PyInt_Check(py_abrupt_termination)) {
4182 test_var = PyInt_AsLong(py_abrupt_termination);
4183 if (test_var < 0 || test_var > uint_max) {
4184 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4185 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4188 r->in.abrupt_termination = test_var;
4190 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4191 PyInt_Type.tp_name, PyLong_Type.tp_name);
4198 static PyObject *unpack_py_winsif_WinsTerm_args_out(struct winsif_WinsTerm *r)
4203 if (!W_ERROR_IS_OK(r->out.result)) {
4204 PyErr_SetWERROR(r->out.result);
4211 static bool pack_py_winsif_WinsBackup_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsBackup *r)
4213 PyObject *py_backup_path;
4214 PyObject *py_incremental;
4215 const char *kwnames[] = {
4216 "backup_path", "incremental", NULL
4219 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winsif_WinsBackup", discard_const_p(char *, kwnames), &py_backup_path, &py_incremental)) {
4223 r->in.backup_path = talloc_ptrtype(r, r->in.backup_path);
4224 if (PyUnicode_Check(py_backup_path)) {
4225 r->in.backup_path = PyString_AS_STRING(PyUnicode_AsEncodedString(py_backup_path, "utf-8", "ignore"));
4226 } else if (PyString_Check(py_backup_path)) {
4227 r->in.backup_path = PyString_AS_STRING(py_backup_path);
4229 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_backup_path)->tp_name);
4233 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.incremental));
4234 if (PyLong_Check(py_incremental)) {
4235 unsigned long long test_var;
4236 test_var = PyLong_AsUnsignedLongLong(py_incremental);
4237 if (PyErr_Occurred() != NULL) {
4240 if (test_var > uint_max) {
4241 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4242 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4245 r->in.incremental = test_var;
4246 } else if (PyInt_Check(py_incremental)) {
4248 test_var = PyInt_AsLong(py_incremental);
4249 if (test_var < 0 || test_var > uint_max) {
4250 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4251 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4254 r->in.incremental = test_var;
4256 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4257 PyInt_Type.tp_name, PyLong_Type.tp_name);
4264 static PyObject *unpack_py_winsif_WinsBackup_args_out(struct winsif_WinsBackup *r)
4269 if (!W_ERROR_IS_OK(r->out.result)) {
4270 PyErr_SetWERROR(r->out.result);
4277 static bool pack_py_winsif_WinsDelDbRecs_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDelDbRecs *r)
4279 PyObject *py_owner_address;
4280 PyObject *py_min_version_number;
4281 PyObject *py_max_version_number;
4282 const char *kwnames[] = {
4283 "owner_address", "min_version_number", "max_version_number", NULL
4286 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winsif_WinsDelDbRecs", discard_const_p(char *, kwnames), &py_owner_address, &py_min_version_number, &py_max_version_number)) {
4290 r->in.owner_address = talloc_ptrtype(r, r->in.owner_address);
4291 PY_CHECK_TYPE(&winsif_Address_Type, py_owner_address, return false;);
4292 if (talloc_reference(r, pytalloc_get_mem_ctx(py_owner_address)) == NULL) {
4296 r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4298 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.min_version_number));
4299 if (PyLong_Check(py_min_version_number)) {
4300 unsigned long long test_var;
4301 test_var = PyLong_AsUnsignedLongLong(py_min_version_number);
4302 if (PyErr_Occurred() != NULL) {
4305 if (test_var > uint_max) {
4306 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4307 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4310 r->in.min_version_number = test_var;
4311 } else if (PyInt_Check(py_min_version_number)) {
4313 test_var = PyInt_AsLong(py_min_version_number);
4314 if (test_var < 0 || test_var > uint_max) {
4315 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4316 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4319 r->in.min_version_number = test_var;
4321 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4322 PyInt_Type.tp_name, PyLong_Type.tp_name);
4327 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_version_number));
4328 if (PyLong_Check(py_max_version_number)) {
4329 unsigned long long test_var;
4330 test_var = PyLong_AsUnsignedLongLong(py_max_version_number);
4331 if (PyErr_Occurred() != NULL) {
4334 if (test_var > uint_max) {
4335 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4336 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4339 r->in.max_version_number = test_var;
4340 } else if (PyInt_Check(py_max_version_number)) {
4342 test_var = PyInt_AsLong(py_max_version_number);
4343 if (test_var < 0 || test_var > uint_max) {
4344 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4345 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4348 r->in.max_version_number = test_var;
4350 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4351 PyInt_Type.tp_name, PyLong_Type.tp_name);
4358 static PyObject *unpack_py_winsif_WinsDelDbRecs_args_out(struct winsif_WinsDelDbRecs *r)
4363 if (!W_ERROR_IS_OK(r->out.result)) {
4364 PyErr_SetWERROR(r->out.result);
4371 static bool pack_py_winsif_WinsPullRange_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsPullRange *r)
4373 PyObject *py_server_address;
4374 PyObject *py_owner_address;
4375 PyObject *py_min_version_number;
4376 PyObject *py_max_version_number;
4377 const char *kwnames[] = {
4378 "server_address", "owner_address", "min_version_number", "max_version_number", NULL
4381 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:winsif_WinsPullRange", discard_const_p(char *, kwnames), &py_server_address, &py_owner_address, &py_min_version_number, &py_max_version_number)) {
4385 r->in.server_address = talloc_ptrtype(r, r->in.server_address);
4386 PY_CHECK_TYPE(&winsif_Address_Type, py_server_address, return false;);
4387 if (talloc_reference(r, pytalloc_get_mem_ctx(py_server_address)) == NULL) {
4391 r->in.server_address = (struct winsif_Address *)pytalloc_get_ptr(py_server_address);
4392 r->in.owner_address = talloc_ptrtype(r, r->in.owner_address);
4393 PY_CHECK_TYPE(&winsif_Address_Type, py_owner_address, return false;);
4394 if (talloc_reference(r, pytalloc_get_mem_ctx(py_owner_address)) == NULL) {
4398 r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4400 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.min_version_number));
4401 if (PyLong_Check(py_min_version_number)) {
4402 unsigned long long test_var;
4403 test_var = PyLong_AsUnsignedLongLong(py_min_version_number);
4404 if (PyErr_Occurred() != NULL) {
4407 if (test_var > uint_max) {
4408 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4409 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4412 r->in.min_version_number = test_var;
4413 } else if (PyInt_Check(py_min_version_number)) {
4415 test_var = PyInt_AsLong(py_min_version_number);
4416 if (test_var < 0 || test_var > uint_max) {
4417 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4418 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4421 r->in.min_version_number = test_var;
4423 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4424 PyInt_Type.tp_name, PyLong_Type.tp_name);
4429 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_version_number));
4430 if (PyLong_Check(py_max_version_number)) {
4431 unsigned long long test_var;
4432 test_var = PyLong_AsUnsignedLongLong(py_max_version_number);
4433 if (PyErr_Occurred() != NULL) {
4436 if (test_var > uint_max) {
4437 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4438 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4441 r->in.max_version_number = test_var;
4442 } else if (PyInt_Check(py_max_version_number)) {
4444 test_var = PyInt_AsLong(py_max_version_number);
4445 if (test_var < 0 || test_var > uint_max) {
4446 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4447 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4450 r->in.max_version_number = test_var;
4452 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4453 PyInt_Type.tp_name, PyLong_Type.tp_name);
4460 static PyObject *unpack_py_winsif_WinsPullRange_args_out(struct winsif_WinsPullRange *r)
4465 if (!W_ERROR_IS_OK(r->out.result)) {
4466 PyErr_SetWERROR(r->out.result);
4473 static bool pack_py_winsif_WinsSetPriorityClass_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsSetPriorityClass *r)
4475 PyObject *py_prioritiy_class;
4476 const char *kwnames[] = {
4477 "prioritiy_class", NULL
4480 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsSetPriorityClass", discard_const_p(char *, kwnames), &py_prioritiy_class)) {
4485 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.prioritiy_class));
4486 if (PyLong_Check(py_prioritiy_class)) {
4487 unsigned long long test_var;
4488 test_var = PyLong_AsUnsignedLongLong(py_prioritiy_class);
4489 if (PyErr_Occurred() != NULL) {
4492 if (test_var > uint_max) {
4493 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4494 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4497 r->in.prioritiy_class = test_var;
4498 } else if (PyInt_Check(py_prioritiy_class)) {
4500 test_var = PyInt_AsLong(py_prioritiy_class);
4501 if (test_var < 0 || test_var > uint_max) {
4502 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4503 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4506 r->in.prioritiy_class = test_var;
4508 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4509 PyInt_Type.tp_name, PyLong_Type.tp_name);
4516 static PyObject *unpack_py_winsif_WinsSetPriorityClass_args_out(struct winsif_WinsSetPriorityClass *r)
4521 if (!W_ERROR_IS_OK(r->out.result)) {
4522 PyErr_SetWERROR(r->out.result);
4529 static bool pack_py_winsif_WinsResetCounters_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsResetCounters *r)
4531 const char *kwnames[] = {
4535 if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":winsif_WinsResetCounters", discard_const_p(char *, kwnames))) {
4542 static PyObject *unpack_py_winsif_WinsResetCounters_args_out(struct winsif_WinsResetCounters *r)
4547 if (!W_ERROR_IS_OK(r->out.result)) {
4548 PyErr_SetWERROR(r->out.result);
4555 static bool pack_py_winsif_WinsWorkerThreadUpdate_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsWorkerThreadUpdate *r)
4557 PyObject *py_num_of_threads;
4558 const char *kwnames[] = {
4559 "num_of_threads", NULL
4562 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsWorkerThreadUpdate", discard_const_p(char *, kwnames), &py_num_of_threads)) {
4567 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_of_threads));
4568 if (PyLong_Check(py_num_of_threads)) {
4569 unsigned long long test_var;
4570 test_var = PyLong_AsUnsignedLongLong(py_num_of_threads);
4571 if (PyErr_Occurred() != NULL) {
4574 if (test_var > uint_max) {
4575 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4576 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4579 r->in.num_of_threads = test_var;
4580 } else if (PyInt_Check(py_num_of_threads)) {
4582 test_var = PyInt_AsLong(py_num_of_threads);
4583 if (test_var < 0 || test_var > uint_max) {
4584 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4585 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4588 r->in.num_of_threads = test_var;
4590 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4591 PyInt_Type.tp_name, PyLong_Type.tp_name);
4598 static PyObject *unpack_py_winsif_WinsWorkerThreadUpdate_args_out(struct winsif_WinsWorkerThreadUpdate *r)
4603 if (!W_ERROR_IS_OK(r->out.result)) {
4604 PyErr_SetWERROR(r->out.result);
4611 static bool pack_py_winsif_WinsGetNameAndAdd_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetNameAndAdd *r)
4613 const char *kwnames[] = {
4617 if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":winsif_WinsGetNameAndAdd", discard_const_p(char *, kwnames))) {
4624 static PyObject *unpack_py_winsif_WinsGetNameAndAdd_args_out(struct winsif_WinsGetNameAndAdd *r)
4627 PyObject *py_server_address;
4628 PyObject *py_unc_name;
4629 result = PyTuple_New(2);
4630 py_server_address = pytalloc_reference_ex(&winsif_Address_Type, r->out.server_address, r->out.server_address);
4631 PyTuple_SetItem(result, 0, py_server_address);
4632 if (r->out.unc_name == NULL) {
4633 py_unc_name = Py_None;
4634 Py_INCREF(py_unc_name);
4636 py_unc_name = PyUnicode_Decode(r->out.unc_name, strlen(r->out.unc_name), "utf-8", "ignore");
4638 PyTuple_SetItem(result, 1, py_unc_name);
4639 if (!W_ERROR_IS_OK(r->out.result)) {
4640 PyErr_SetWERROR(r->out.result);
4647 static bool pack_py_winsif_WinsGetBrowserNames_Old_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetBrowserNames_Old *r)
4649 const char *kwnames[] = {
4653 if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":winsif_WinsGetBrowserNames_Old", discard_const_p(char *, kwnames))) {
4660 static PyObject *unpack_py_winsif_WinsGetBrowserNames_Old_args_out(struct winsif_WinsGetBrowserNames_Old *r)
4664 py_names = pytalloc_reference_ex(&winsif_BrowserNames_Type, r->out.names, r->out.names);
4666 if (!W_ERROR_IS_OK(r->out.result)) {
4667 PyErr_SetWERROR(r->out.result);
4674 static bool pack_py_winsif_WinsDeleteWins_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDeleteWins *r)
4676 PyObject *py_owner_address;
4677 const char *kwnames[] = {
4678 "owner_address", NULL
4681 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsDeleteWins", discard_const_p(char *, kwnames), &py_owner_address)) {
4685 r->in.owner_address = talloc_ptrtype(r, r->in.owner_address);
4686 PY_CHECK_TYPE(&winsif_Address_Type, py_owner_address, return false;);
4687 if (talloc_reference(r, pytalloc_get_mem_ctx(py_owner_address)) == NULL) {
4691 r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4695 static PyObject *unpack_py_winsif_WinsDeleteWins_args_out(struct winsif_WinsDeleteWins *r)
4700 if (!W_ERROR_IS_OK(r->out.result)) {
4701 PyErr_SetWERROR(r->out.result);
4708 static bool pack_py_winsif_WinsSetFlags_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsSetFlags *r)
4711 const char *kwnames[] = {
4715 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsSetFlags", discard_const_p(char *, kwnames), &py_flags)) {
4720 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
4721 if (PyLong_Check(py_flags)) {
4722 unsigned long long test_var;
4723 test_var = PyLong_AsUnsignedLongLong(py_flags);
4724 if (PyErr_Occurred() != NULL) {
4727 if (test_var > uint_max) {
4728 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4729 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4732 r->in.flags = test_var;
4733 } else if (PyInt_Check(py_flags)) {
4735 test_var = PyInt_AsLong(py_flags);
4736 if (test_var < 0 || test_var > uint_max) {
4737 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4738 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4741 r->in.flags = test_var;
4743 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4744 PyInt_Type.tp_name, PyLong_Type.tp_name);
4751 static PyObject *unpack_py_winsif_WinsSetFlags_args_out(struct winsif_WinsSetFlags *r)
4756 if (!W_ERROR_IS_OK(r->out.result)) {
4757 PyErr_SetWERROR(r->out.result);
4764 static bool pack_py_winsif_WinsGetBrowserNames_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetBrowserNames *r)
4766 PyObject *py_server_handle;
4767 const char *kwnames[] = {
4768 "server_handle", NULL
4771 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsGetBrowserNames", discard_const_p(char *, kwnames), &py_server_handle)) {
4775 r->in.server_handle = talloc_ptrtype(r, r->in.server_handle);
4776 PY_CHECK_TYPE(&winsif_BindData_Type, py_server_handle, return false;);
4777 if (talloc_reference(r, pytalloc_get_mem_ctx(py_server_handle)) == NULL) {
4781 r->in.server_handle = (struct winsif_BindData *)pytalloc_get_ptr(py_server_handle);
4785 static PyObject *unpack_py_winsif_WinsGetBrowserNames_args_out(struct winsif_WinsGetBrowserNames *r)
4789 py_names = pytalloc_reference_ex(&winsif_BrowserNames_Type, r->out.names, r->out.names);
4791 if (!W_ERROR_IS_OK(r->out.result)) {
4792 PyErr_SetWERROR(r->out.result);
4799 static bool pack_py_winsif_WinsGetDbRecsByName_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetDbRecsByName *r)
4801 PyObject *py_owner_address;
4802 PyObject *py_search_backward;
4804 PyObject *py_name_len;
4805 PyObject *py_num_records_desired;
4806 PyObject *py_only_statics;
4807 const char *kwnames[] = {
4808 "owner_address", "search_backward", "name", "name_len", "num_records_desired", "only_statics", NULL
4811 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:winsif_WinsGetDbRecsByName", discard_const_p(char *, kwnames), &py_owner_address, &py_search_backward, &py_name, &py_name_len, &py_num_records_desired, &py_only_statics)) {
4815 if (py_owner_address == Py_None) {
4816 r->in.owner_address = NULL;
4818 r->in.owner_address = NULL;
4819 PY_CHECK_TYPE(&winsif_Address_Type, py_owner_address, return false;);
4820 if (talloc_reference(r, pytalloc_get_mem_ctx(py_owner_address)) == NULL) {
4824 r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4827 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.search_backward));
4828 if (PyLong_Check(py_search_backward)) {
4829 unsigned long long test_var;
4830 test_var = PyLong_AsUnsignedLongLong(py_search_backward);
4831 if (PyErr_Occurred() != NULL) {
4834 if (test_var > uint_max) {
4835 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4836 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4839 r->in.search_backward = test_var;
4840 } else if (PyInt_Check(py_search_backward)) {
4842 test_var = PyInt_AsLong(py_search_backward);
4843 if (test_var < 0 || test_var > uint_max) {
4844 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4845 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4848 r->in.search_backward = test_var;
4850 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4851 PyInt_Type.tp_name, PyLong_Type.tp_name);
4855 if (py_name == Py_None) {
4859 r->in.name = talloc_strdup(r, PyString_AS_STRING(py_name));
4862 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.name_len));
4863 if (PyLong_Check(py_name_len)) {
4864 unsigned long long test_var;
4865 test_var = PyLong_AsUnsignedLongLong(py_name_len);
4866 if (PyErr_Occurred() != NULL) {
4869 if (test_var > uint_max) {
4870 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4871 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4874 r->in.name_len = test_var;
4875 } else if (PyInt_Check(py_name_len)) {
4877 test_var = PyInt_AsLong(py_name_len);
4878 if (test_var < 0 || test_var > uint_max) {
4879 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4880 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4883 r->in.name_len = test_var;
4885 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4886 PyInt_Type.tp_name, PyLong_Type.tp_name);
4891 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_records_desired));
4892 if (PyLong_Check(py_num_records_desired)) {
4893 unsigned long long test_var;
4894 test_var = PyLong_AsUnsignedLongLong(py_num_records_desired);
4895 if (PyErr_Occurred() != NULL) {
4898 if (test_var > uint_max) {
4899 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4900 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4903 r->in.num_records_desired = test_var;
4904 } else if (PyInt_Check(py_num_records_desired)) {
4906 test_var = PyInt_AsLong(py_num_records_desired);
4907 if (test_var < 0 || test_var > uint_max) {
4908 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4909 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4912 r->in.num_records_desired = test_var;
4914 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4915 PyInt_Type.tp_name, PyLong_Type.tp_name);
4920 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.only_statics));
4921 if (PyLong_Check(py_only_statics)) {
4922 unsigned long long test_var;
4923 test_var = PyLong_AsUnsignedLongLong(py_only_statics);
4924 if (PyErr_Occurred() != NULL) {
4927 if (test_var > uint_max) {
4928 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4929 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4932 r->in.only_statics = test_var;
4933 } else if (PyInt_Check(py_only_statics)) {
4935 test_var = PyInt_AsLong(py_only_statics);
4936 if (test_var < 0 || test_var > uint_max) {
4937 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4938 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4941 r->in.only_statics = test_var;
4943 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4944 PyInt_Type.tp_name, PyLong_Type.tp_name);
4951 static PyObject *unpack_py_winsif_WinsGetDbRecsByName_args_out(struct winsif_WinsGetDbRecsByName *r)
4954 PyObject *py_records;
4955 py_records = pytalloc_reference_ex(&winsif_Records_Type, r->out.records, r->out.records);
4956 result = py_records;
4957 if (!W_ERROR_IS_OK(r->out.result)) {
4958 PyErr_SetWERROR(r->out.result);
4965 static bool pack_py_winsif_WinsStatusNew_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsStatusNew *r)
4968 const char *kwnames[] = {
4972 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsStatusNew", discard_const_p(char *, kwnames), &py_cmd)) {
4977 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.cmd));
4978 if (PyLong_Check(py_cmd)) {
4979 unsigned long long test_var;
4980 test_var = PyLong_AsUnsignedLongLong(py_cmd);
4981 if (PyErr_Occurred() != NULL) {
4984 if (test_var > uint_max) {
4985 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
4986 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4989 r->in.cmd = test_var;
4990 } else if (PyInt_Check(py_cmd)) {
4992 test_var = PyInt_AsLong(py_cmd);
4993 if (test_var < 0 || test_var > uint_max) {
4994 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
4995 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
4998 r->in.cmd = test_var;
5000 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5001 PyInt_Type.tp_name, PyLong_Type.tp_name);
5008 static PyObject *unpack_py_winsif_WinsStatusNew_args_out(struct winsif_WinsStatusNew *r)
5011 PyObject *py_results;
5012 py_results = pytalloc_reference_ex(&winsif_ResultsNew_Type, r->out.results, r->out.results);
5013 result = py_results;
5014 if (!W_ERROR_IS_OK(r->out.result)) {
5015 PyErr_SetWERROR(r->out.result);
5022 static bool pack_py_winsif_WinsStatusWHdl_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsStatusWHdl *r)
5024 PyObject *py_server_handle;
5026 PyObject *py_results;
5027 const char *kwnames[] = {
5028 "server_handle", "cmd", "results", NULL
5031 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winsif_WinsStatusWHdl", discard_const_p(char *, kwnames), &py_server_handle, &py_cmd, &py_results)) {
5035 r->in.server_handle = talloc_ptrtype(r, r->in.server_handle);
5036 PY_CHECK_TYPE(&winsif_BindData_Type, py_server_handle, return false;);
5037 if (talloc_reference(r, pytalloc_get_mem_ctx(py_server_handle)) == NULL) {
5041 r->in.server_handle = (struct winsif_BindData *)pytalloc_get_ptr(py_server_handle);
5043 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.cmd));
5044 if (PyLong_Check(py_cmd)) {
5045 unsigned long long test_var;
5046 test_var = PyLong_AsUnsignedLongLong(py_cmd);
5047 if (PyErr_Occurred() != NULL) {
5050 if (test_var > uint_max) {
5051 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
5052 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5055 r->in.cmd = test_var;
5056 } else if (PyInt_Check(py_cmd)) {
5058 test_var = PyInt_AsLong(py_cmd);
5059 if (test_var < 0 || test_var > uint_max) {
5060 PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
5061 PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
5064 r->in.cmd = test_var;
5066 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5067 PyInt_Type.tp_name, PyLong_Type.tp_name);
5071 r->in.results = talloc_ptrtype(r, r->in.results);
5072 PY_CHECK_TYPE(&winsif_ResultsNew_Type, py_results, return false;);
5073 if (talloc_reference(r, pytalloc_get_mem_ctx(py_results)) == NULL) {
5077 r->in.results = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_results);
5081 static PyObject *unpack_py_winsif_WinsStatusWHdl_args_out(struct winsif_WinsStatusWHdl *r)
5084 PyObject *py_results;
5085 py_results = pytalloc_reference_ex(&winsif_ResultsNew_Type, r->out.results, r->out.results);
5086 result = py_results;
5087 if (!W_ERROR_IS_OK(r->out.result)) {
5088 PyErr_SetWERROR(r->out.result);
5095 static bool pack_py_winsif_WinsDoScanvengingNew_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDoScanvengingNew *r)
5097 PyObject *py_request;
5098 const char *kwnames[] = {
5102 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsDoScanvengingNew", discard_const_p(char *, kwnames), &py_request)) {
5106 r->in.request = talloc_ptrtype(r, r->in.request);
5107 PY_CHECK_TYPE(&winsif_ScavengingRequest_Type, py_request, return false;);
5108 if (talloc_reference(r, pytalloc_get_mem_ctx(py_request)) == NULL) {
5112 r->in.request = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(py_request);
5116 static PyObject *unpack_py_winsif_WinsDoScanvengingNew_args_out(struct winsif_WinsDoScanvengingNew *r)
5121 if (!W_ERROR_IS_OK(r->out.result)) {
5122 PyErr_SetWERROR(r->out.result);
5129 const struct PyNdrRpcMethodDef py_ndr_winsif_methods[] = {
5130 { "WinsRecordAction", "S.WinsRecordAction(record_action) -> record_action", (py_dcerpc_call_fn)dcerpc_winsif_WinsRecordAction_r, (py_data_pack_fn)pack_py_winsif_WinsRecordAction_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsRecordAction_args_out, 0, &ndr_table_winsif },
5131 { "WinsStatus", "S.WinsStatus(cmd, results) -> results", (py_dcerpc_call_fn)dcerpc_winsif_WinsStatus_r, (py_data_pack_fn)pack_py_winsif_WinsStatus_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsStatus_args_out, 1, &ndr_table_winsif },
5132 { "WinsTrigger", "S.WinsTrigger(owner_address, trigger_type) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsTrigger_r, (py_data_pack_fn)pack_py_winsif_WinsTrigger_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsTrigger_args_out, 2, &ndr_table_winsif },
5133 { "WinsDoStaticInit", "S.WinsDoStaticInit(data_file_path, delete_file) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsDoStaticInit_r, (py_data_pack_fn)pack_py_winsif_WinsDoStaticInit_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsDoStaticInit_args_out, 3, &ndr_table_winsif },
5134 { "WinsDoScavenging", "S.WinsDoScavenging() -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsDoScavenging_r, (py_data_pack_fn)pack_py_winsif_WinsDoScavenging_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsDoScavenging_args_out, 4, &ndr_table_winsif },
5135 { "WinsGetDbRecs", "S.WinsGetDbRecs(owner_address, min_version_number, max_version_number) -> records", (py_dcerpc_call_fn)dcerpc_winsif_WinsGetDbRecs_r, (py_data_pack_fn)pack_py_winsif_WinsGetDbRecs_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsGetDbRecs_args_out, 5, &ndr_table_winsif },
5136 { "WinsTerm", "S.WinsTerm(abrupt_termination) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsTerm_r, (py_data_pack_fn)pack_py_winsif_WinsTerm_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsTerm_args_out, 6, &ndr_table_winsif },
5137 { "WinsBackup", "S.WinsBackup(backup_path, incremental) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsBackup_r, (py_data_pack_fn)pack_py_winsif_WinsBackup_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsBackup_args_out, 7, &ndr_table_winsif },
5138 { "WinsDelDbRecs", "S.WinsDelDbRecs(owner_address, min_version_number, max_version_number) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsDelDbRecs_r, (py_data_pack_fn)pack_py_winsif_WinsDelDbRecs_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsDelDbRecs_args_out, 8, &ndr_table_winsif },
5139 { "WinsPullRange", "S.WinsPullRange(server_address, owner_address, min_version_number, max_version_number) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsPullRange_r, (py_data_pack_fn)pack_py_winsif_WinsPullRange_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsPullRange_args_out, 9, &ndr_table_winsif },
5140 { "WinsSetPriorityClass", "S.WinsSetPriorityClass(prioritiy_class) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsSetPriorityClass_r, (py_data_pack_fn)pack_py_winsif_WinsSetPriorityClass_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsSetPriorityClass_args_out, 10, &ndr_table_winsif },
5141 { "WinsResetCounters", "S.WinsResetCounters() -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsResetCounters_r, (py_data_pack_fn)pack_py_winsif_WinsResetCounters_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsResetCounters_args_out, 11, &ndr_table_winsif },
5142 { "WinsWorkerThreadUpdate", "S.WinsWorkerThreadUpdate(num_of_threads) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsWorkerThreadUpdate_r, (py_data_pack_fn)pack_py_winsif_WinsWorkerThreadUpdate_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsWorkerThreadUpdate_args_out, 12, &ndr_table_winsif },
5143 { "WinsGetNameAndAdd", "S.WinsGetNameAndAdd() -> (server_address, unc_name)", (py_dcerpc_call_fn)dcerpc_winsif_WinsGetNameAndAdd_r, (py_data_pack_fn)pack_py_winsif_WinsGetNameAndAdd_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsGetNameAndAdd_args_out, 13, &ndr_table_winsif },
5144 { "WinsGetBrowserNames_Old", "S.WinsGetBrowserNames_Old() -> names", (py_dcerpc_call_fn)dcerpc_winsif_WinsGetBrowserNames_Old_r, (py_data_pack_fn)pack_py_winsif_WinsGetBrowserNames_Old_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsGetBrowserNames_Old_args_out, 14, &ndr_table_winsif },
5145 { "WinsDeleteWins", "S.WinsDeleteWins(owner_address) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsDeleteWins_r, (py_data_pack_fn)pack_py_winsif_WinsDeleteWins_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsDeleteWins_args_out, 15, &ndr_table_winsif },
5146 { "WinsSetFlags", "S.WinsSetFlags(flags) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsSetFlags_r, (py_data_pack_fn)pack_py_winsif_WinsSetFlags_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsSetFlags_args_out, 16, &ndr_table_winsif },
5147 { "WinsGetBrowserNames", "S.WinsGetBrowserNames(server_handle) -> names", (py_dcerpc_call_fn)dcerpc_winsif_WinsGetBrowserNames_r, (py_data_pack_fn)pack_py_winsif_WinsGetBrowserNames_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsGetBrowserNames_args_out, 17, &ndr_table_winsif },
5148 { "WinsGetDbRecsByName", "S.WinsGetDbRecsByName(owner_address, search_backward, name, name_len, num_records_desired, only_statics) -> records", (py_dcerpc_call_fn)dcerpc_winsif_WinsGetDbRecsByName_r, (py_data_pack_fn)pack_py_winsif_WinsGetDbRecsByName_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsGetDbRecsByName_args_out, 18, &ndr_table_winsif },
5149 { "WinsStatusNew", "S.WinsStatusNew(cmd) -> results", (py_dcerpc_call_fn)dcerpc_winsif_WinsStatusNew_r, (py_data_pack_fn)pack_py_winsif_WinsStatusNew_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsStatusNew_args_out, 19, &ndr_table_winsif },
5150 { "WinsStatusWHdl", "S.WinsStatusWHdl(server_handle, cmd, results) -> results", (py_dcerpc_call_fn)dcerpc_winsif_WinsStatusWHdl_r, (py_data_pack_fn)pack_py_winsif_WinsStatusWHdl_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsStatusWHdl_args_out, 20, &ndr_table_winsif },
5151 { "WinsDoScanvengingNew", "S.WinsDoScanvengingNew(request) -> None", (py_dcerpc_call_fn)dcerpc_winsif_WinsDoScanvengingNew_r, (py_data_pack_fn)pack_py_winsif_WinsDoScanvengingNew_args_in, (py_data_unpack_fn)unpack_py_winsif_WinsDoScanvengingNew_args_out, 21, &ndr_table_winsif },
5155 static PyObject *interface_winsif_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5157 return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_winsif);
5160 #define PY_DOC_WINSIF "WINS Administration Interface1"
5161 static PyTypeObject winsif_InterfaceType = {
5162 PyObject_HEAD_INIT(NULL) 0,
5163 .tp_name = "winsif.winsif",
5164 .tp_basicsize = sizeof(dcerpc_InterfaceObject),
5165 .tp_doc = "winsif(binding, lp_ctx=None, credentials=None) -> connection\n"
5167 "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
5168 "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
5169 "credentials should be a credentials.Credentials object.\n\n"PY_DOC_WINSIF,
5170 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5171 .tp_new = interface_winsif_new,
5174 static PyObject *syntax_winsif_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5176 return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_winsif.syntax_id);
5179 #define PY_DOC_WINSIF_SYNTAX "WINS Administration Interface1"
5180 static PyTypeObject winsif_SyntaxType = {
5181 PyObject_HEAD_INIT(NULL) 0,
5182 .tp_name = "winsif.winsif",
5183 .tp_basicsize = sizeof(pytalloc_Object),
5184 .tp_doc = "abstract_syntax()\n"PY_DOC_WINSIF_SYNTAX,
5185 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5186 .tp_new = syntax_winsif_new,
5189 static PyMethodDef winsif_methods[] = {
5190 { NULL, NULL, 0, NULL }
5193 void initwinsif(void)
5196 PyObject *dep_samba_dcerpc_nbt;
5197 PyObject *dep_talloc;
5198 PyObject *dep_samba_dcerpc_base;
5199 PyObject *dep_samba_dcerpc_misc;
5201 dep_samba_dcerpc_nbt = PyImport_ImportModule("samba.dcerpc.nbt");
5202 if (dep_samba_dcerpc_nbt == NULL)
5205 dep_talloc = PyImport_ImportModule("talloc");
5206 if (dep_talloc == NULL)
5209 dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
5210 if (dep_samba_dcerpc_base == NULL)
5213 dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
5214 if (dep_samba_dcerpc_misc == NULL)
5217 Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
5218 if (Object_Type == NULL)
5221 ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
5222 if (ClientConnection_Type == NULL)
5225 ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
5226 if (ndr_syntax_id_Type == NULL)
5229 winsif_Address_Type.tp_base = Object_Type;
5231 winsif_RecordAction_Type.tp_base = Object_Type;
5233 winsif_AddressVersionMap_Type.tp_base = Object_Type;
5235 winsif_ReplCounter_Type.tp_base = Object_Type;
5237 winsif_StatCounters_Type.tp_base = Object_Type;
5239 winsif_StatTimeStamps_Type.tp_base = Object_Type;
5241 winsif_Stat_Type.tp_base = Object_Type;
5243 winsif_Results_Type.tp_base = Object_Type;
5245 winsif_Records_Type.tp_base = Object_Type;
5247 winsif_BrowserInfo_Type.tp_base = Object_Type;
5249 winsif_BrowserNames_Type.tp_base = Object_Type;
5251 winsif_BindData_Type.tp_base = Object_Type;
5253 winsif_ResultsNew_Type.tp_base = Object_Type;
5255 winsif_ScavengingRequest_Type.tp_base = Object_Type;
5257 winsif_InterfaceType.tp_base = ClientConnection_Type;
5259 winsif_SyntaxType.tp_base = ndr_syntax_id_Type;
5261 if (PyType_Ready(&winsif_Address_Type) < 0)
5263 if (PyType_Ready(&winsif_RecordAction_Type) < 0)
5265 if (PyType_Ready(&winsif_AddressVersionMap_Type) < 0)
5267 if (PyType_Ready(&winsif_ReplCounter_Type) < 0)
5269 if (PyType_Ready(&winsif_StatCounters_Type) < 0)
5271 if (PyType_Ready(&winsif_StatTimeStamps_Type) < 0)
5273 if (PyType_Ready(&winsif_Stat_Type) < 0)
5275 if (PyType_Ready(&winsif_Results_Type) < 0)
5277 if (PyType_Ready(&winsif_Records_Type) < 0)
5279 if (PyType_Ready(&winsif_BrowserInfo_Type) < 0)
5281 if (PyType_Ready(&winsif_BrowserNames_Type) < 0)
5283 if (PyType_Ready(&winsif_BindData_Type) < 0)
5285 if (PyType_Ready(&winsif_ResultsNew_Type) < 0)
5287 if (PyType_Ready(&winsif_ScavengingRequest_Type) < 0)
5289 if (PyType_Ready(&winsif_InterfaceType) < 0)
5291 if (PyType_Ready(&winsif_SyntaxType) < 0)
5293 if (!PyInterface_AddNdrRpcMethods(&winsif_InterfaceType, py_ndr_winsif_methods))
5296 #ifdef PY_ADDRESS_PATCH
5297 PY_ADDRESS_PATCH(&winsif_Address_Type);
5299 #ifdef PY_RECORDACTION_PATCH
5300 PY_RECORDACTION_PATCH(&winsif_RecordAction_Type);
5302 #ifdef PY_ADDRESSVERSIONMAP_PATCH
5303 PY_ADDRESSVERSIONMAP_PATCH(&winsif_AddressVersionMap_Type);
5305 #ifdef PY_REPLCOUNTER_PATCH
5306 PY_REPLCOUNTER_PATCH(&winsif_ReplCounter_Type);
5308 #ifdef PY_STATCOUNTERS_PATCH
5309 PY_STATCOUNTERS_PATCH(&winsif_StatCounters_Type);
5311 #ifdef PY_STATTIMESTAMPS_PATCH
5312 PY_STATTIMESTAMPS_PATCH(&winsif_StatTimeStamps_Type);
5314 #ifdef PY_STAT_PATCH
5315 PY_STAT_PATCH(&winsif_Stat_Type);
5317 #ifdef PY_RESULTS_PATCH
5318 PY_RESULTS_PATCH(&winsif_Results_Type);
5320 #ifdef PY_RECORDS_PATCH
5321 PY_RECORDS_PATCH(&winsif_Records_Type);
5323 #ifdef PY_BROWSERINFO_PATCH
5324 PY_BROWSERINFO_PATCH(&winsif_BrowserInfo_Type);
5326 #ifdef PY_BROWSERNAMES_PATCH
5327 PY_BROWSERNAMES_PATCH(&winsif_BrowserNames_Type);
5329 #ifdef PY_BINDDATA_PATCH
5330 PY_BINDDATA_PATCH(&winsif_BindData_Type);
5332 #ifdef PY_RESULTSNEW_PATCH
5333 PY_RESULTSNEW_PATCH(&winsif_ResultsNew_Type);
5335 #ifdef PY_SCAVENGINGREQUEST_PATCH
5336 PY_SCAVENGINGREQUEST_PATCH(&winsif_ScavengingRequest_Type);
5338 #ifdef PY_WINSIF_PATCH
5339 PY_WINSIF_PATCH(&winsif_InterfaceType);
5341 #ifdef PY_ABSTRACT_SYNTAX_PATCH
5342 PY_ABSTRACT_SYNTAX_PATCH(&winsif_SyntaxType);
5345 m = Py_InitModule3("winsif", winsif_methods, "winsif DCE/RPC");
5349 PyModule_AddObject(m, "WINSIF_ACTION_INSERT", PyInt_FromLong((uint16_t)WINSIF_ACTION_INSERT));
5350 PyModule_AddObject(m, "WINSIF_ACTION_DELETE", PyInt_FromLong((uint16_t)WINSIF_ACTION_DELETE));
5351 PyModule_AddObject(m, "WINSIF_ACTION_RELEASE", PyInt_FromLong((uint16_t)WINSIF_ACTION_RELEASE));
5352 PyModule_AddObject(m, "WINSIF_ACTION_MODIFY", PyInt_FromLong((uint16_t)WINSIF_ACTION_MODIFY));
5353 PyModule_AddObject(m, "WINSIF_ACTION_QUERY", PyInt_FromLong((uint16_t)WINSIF_ACTION_QUERY));
5354 PyModule_AddObject(m, "WINSIF_RECORD_UNIQUE_NAME", PyInt_FromLong((uint16_t)WINSIF_RECORD_UNIQUE_NAME));
5355 PyModule_AddObject(m, "WINSIF_RECORD_GROUP_NAME", PyInt_FromLong((uint16_t)WINSIF_RECORD_GROUP_NAME));
5356 PyModule_AddObject(m, "WINSIF_RECORD_SGROUP_NAME", PyInt_FromLong((uint16_t)WINSIF_RECORD_SGROUP_NAME));
5357 PyModule_AddObject(m, "WINSIF_RECORD_MHOMED_NAME", PyInt_FromLong((uint16_t)WINSIF_RECORD_MHOMED_NAME));
5358 PyModule_AddObject(m, "WINSIF_NODE_B", PyInt_FromLong((uint16_t)WINSIF_NODE_B));
5359 PyModule_AddObject(m, "WINSIF_NODE_P", PyInt_FromLong((uint16_t)WINSIF_NODE_P));
5360 PyModule_AddObject(m, "WINSIF_NODE_H", PyInt_FromLong((uint16_t)WINSIF_NODE_H));
5361 PyModule_AddObject(m, "WINSIF_RECORD_ACTIVE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WINSIF_RECORD_ACTIVE));
5362 PyModule_AddObject(m, "WINSIF_RECORD_RELEASED", ndr_PyLong_FromUnsignedLongLong((uint32_t)WINSIF_RECORD_RELEASED));
5363 PyModule_AddObject(m, "WINSIF_RECORD_TOMBSTONE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WINSIF_RECORD_TOMBSTONE));
5364 PyModule_AddObject(m, "WINSIF_RECORD_DELETED", ndr_PyLong_FromUnsignedLongLong((uint32_t)WINSIF_RECORD_DELETED));
5365 PyModule_AddObject(m, "WINSIF_PRIORITY_NORMAL", PyInt_FromLong((uint16_t)WINSIF_PRIORITY_NORMAL));
5366 PyModule_AddObject(m, "WINSIF_PRIORITY_HIGH", PyInt_FromLong((uint16_t)WINSIF_PRIORITY_HIGH));
5367 PyModule_AddObject(m, "WINSIF_STATUS_CMD_ADDRESS_VERSION_MAP", PyInt_FromLong((uint16_t)WINSIF_STATUS_CMD_ADDRESS_VERSION_MAP));
5368 PyModule_AddObject(m, "WINSIF_STATUS_CMD_CONFIG", PyInt_FromLong((uint16_t)WINSIF_STATUS_CMD_CONFIG));
5369 PyModule_AddObject(m, "WINSIF_STATUS_CMD_STAT", PyInt_FromLong((uint16_t)WINSIF_STATUS_CMD_STAT));
5370 PyModule_AddObject(m, "WINSIF_STATUS_CMD_ALL_MAPS", PyInt_FromLong((uint16_t)WINSIF_STATUS_CMD_ALL_MAPS));
5371 PyModule_AddObject(m, "WINSIF_TRIGGER_PULL", PyInt_FromLong((uint16_t)WINSIF_TRIGGER_PULL));
5372 PyModule_AddObject(m, "WINSIF_TRIGGER_PUSH", PyInt_FromLong((uint16_t)WINSIF_TRIGGER_PUSH));
5373 PyModule_AddObject(m, "WINSIF_TRIGGER_PUSH_PROP", PyInt_FromLong((uint16_t)WINSIF_TRIGGER_PUSH_PROP));
5374 PyModule_AddObject(m, "WINSIF_SCAVENGING_GENERAL", PyInt_FromLong((uint16_t)WINSIF_SCAVENGING_GENERAL));
5375 PyModule_AddObject(m, "WINSIF_SCAVENGING_VERIFY", PyInt_FromLong((uint16_t)WINSIF_SCAVENGING_VERIFY));
5376 Py_INCREF((PyObject *)(void *)&winsif_Address_Type);
5377 PyModule_AddObject(m, "Address", (PyObject *)(void *)&winsif_Address_Type);
5378 Py_INCREF((PyObject *)(void *)&winsif_RecordAction_Type);
5379 PyModule_AddObject(m, "RecordAction", (PyObject *)(void *)&winsif_RecordAction_Type);
5380 Py_INCREF((PyObject *)(void *)&winsif_AddressVersionMap_Type);
5381 PyModule_AddObject(m, "AddressVersionMap", (PyObject *)(void *)&winsif_AddressVersionMap_Type);
5382 Py_INCREF((PyObject *)(void *)&winsif_ReplCounter_Type);
5383 PyModule_AddObject(m, "ReplCounter", (PyObject *)(void *)&winsif_ReplCounter_Type);
5384 Py_INCREF((PyObject *)(void *)&winsif_StatCounters_Type);
5385 PyModule_AddObject(m, "StatCounters", (PyObject *)(void *)&winsif_StatCounters_Type);
5386 Py_INCREF((PyObject *)(void *)&winsif_StatTimeStamps_Type);
5387 PyModule_AddObject(m, "StatTimeStamps", (PyObject *)(void *)&winsif_StatTimeStamps_Type);
5388 Py_INCREF((PyObject *)(void *)&winsif_Stat_Type);
5389 PyModule_AddObject(m, "Stat", (PyObject *)(void *)&winsif_Stat_Type);
5390 Py_INCREF((PyObject *)(void *)&winsif_Results_Type);
5391 PyModule_AddObject(m, "Results", (PyObject *)(void *)&winsif_Results_Type);
5392 Py_INCREF((PyObject *)(void *)&winsif_Records_Type);
5393 PyModule_AddObject(m, "Records", (PyObject *)(void *)&winsif_Records_Type);
5394 Py_INCREF((PyObject *)(void *)&winsif_BrowserInfo_Type);
5395 PyModule_AddObject(m, "BrowserInfo", (PyObject *)(void *)&winsif_BrowserInfo_Type);
5396 Py_INCREF((PyObject *)(void *)&winsif_BrowserNames_Type);
5397 PyModule_AddObject(m, "BrowserNames", (PyObject *)(void *)&winsif_BrowserNames_Type);
5398 Py_INCREF((PyObject *)(void *)&winsif_BindData_Type);
5399 PyModule_AddObject(m, "BindData", (PyObject *)(void *)&winsif_BindData_Type);
5400 Py_INCREF((PyObject *)(void *)&winsif_ResultsNew_Type);
5401 PyModule_AddObject(m, "ResultsNew", (PyObject *)(void *)&winsif_ResultsNew_Type);
5402 Py_INCREF((PyObject *)(void *)&winsif_ScavengingRequest_Type);
5403 PyModule_AddObject(m, "ScavengingRequest", (PyObject *)(void *)&winsif_ScavengingRequest_Type);
5404 Py_INCREF((PyObject *)(void *)&winsif_InterfaceType);
5405 PyModule_AddObject(m, "winsif", (PyObject *)(void *)&winsif_InterfaceType);
5406 Py_INCREF((PyObject *)(void *)&winsif_SyntaxType);
5407 PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&winsif_SyntaxType);
5408 #ifdef PY_MOD_WINSIF_PATCH
5409 PY_MOD_WINSIF_PATCH(m);