git add -f bin/default/librpc/gen_ndr/*.{c,h,ndr,pidl} bin/default/source*/librpc...
[metze/samba/wip.git] / bin / default / source4 / librpc / gen_ndr / py_winsif.c
1
2 /* Python wrapper functions auto-generated by pidl */
3 #include <Python.h>
4 #include "includes.h"
5 #include <pytalloc.h>
6 #include "librpc/rpc/pyrpc.h"
7 #include "librpc/rpc/pyrpc_util.h"
8 #include "bin/default/source4/librpc/gen_ndr/ndr_winsif.h"
9 #include "bin/default/source4/librpc/gen_ndr/ndr_winsif_c.h"
10
11 /*
12  * These functions are here to ensure they can be optomised out by
13  * the compiler based on the constant input values
14  */
15
16 static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
17 {
18         switch (var_size) {
19         case 8:
20                 return UINT64_MAX;
21         case 4:
22                 return UINT32_MAX;
23         case 2:
24                 return UINT16_MAX;
25         case 1:
26                 return UINT8_MAX;
27         }
28
29         return 0;
30 }
31
32 static inline long long ndr_sizeof2intmax(size_t var_size)
33 {
34         switch (var_size) {
35         case 8:
36                 return INT64_MAX;
37         case 4:
38                 return INT32_MAX;
39         case 2:
40                 return INT16_MAX;
41         case 1:
42                 return INT8_MAX;
43         }
44
45         return 0;
46 }
47
48 static inline PyObject *ndr_PyLong_FromLongLong(long long v)
49 {
50         if (v > LONG_MAX || v < LONG_MIN) {
51                 return PyLong_FromLongLong(v);
52         } else {
53                 return PyInt_FromLong(v);
54         }
55 }
56
57 static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)
58 {
59         if (v > LONG_MAX) {
60                 return PyLong_FromUnsignedLongLong(v);
61         } else {
62                 return PyInt_FromLong(v);
63         }
64 }
65
66 #include "librpc/gen_ndr/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;
82
83 void initwinsif(void);static PyTypeObject *Object_Type;
84 static PyTypeObject *ClientConnection_Type;
85 static PyTypeObject *ndr_syntax_id_Type;
86
87 static PyObject *py_winsif_Address_get_type(PyObject *obj, void *closure)
88 {
89         struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(obj);
90         PyObject *py_type;
91         py_type = PyInt_FromLong((uint16_t)object->type);
92         return py_type;
93 }
94
95 static int py_winsif_Address_set_type(PyObject *py_obj, PyObject *value, void *closure)
96 {
97         struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(py_obj);
98         {
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) {
104                                 return -1;
105                         }
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);
109                                 return -1;
110                         }
111                         object->type = test_var;
112                 } else if (PyInt_Check(value)) {
113                         long test_var;
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);
118                                 return -1;
119                         }
120                         object->type = test_var;
121                 } else {
122                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
123                           PyInt_Type.tp_name, PyLong_Type.tp_name);
124                         return -1;
125                 }
126         }
127         return 0;
128 }
129
130 static PyObject *py_winsif_Address_get_length(PyObject *obj, void *closure)
131 {
132         struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(obj);
133         PyObject *py_length;
134         py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
135         return py_length;
136 }
137
138 static int py_winsif_Address_set_length(PyObject *py_obj, PyObject *value, void *closure)
139 {
140         struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(py_obj);
141         {
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) {
147                                 return -1;
148                         }
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);
152                                 return -1;
153                         }
154                         object->length = test_var;
155                 } else if (PyInt_Check(value)) {
156                         long test_var;
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);
161                                 return -1;
162                         }
163                         object->length = test_var;
164                 } else {
165                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
166                           PyInt_Type.tp_name, PyLong_Type.tp_name);
167                         return -1;
168                 }
169         }
170         return 0;
171 }
172
173 static PyObject *py_winsif_Address_get_addr(PyObject *obj, void *closure)
174 {
175         struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(obj);
176         PyObject *py_addr;
177         py_addr = PyString_FromStringOrNULL(object->addr);
178         return py_addr;
179 }
180
181 static int py_winsif_Address_set_addr(PyObject *py_obj, PyObject *value, void *closure)
182 {
183         struct winsif_Address *object = (struct winsif_Address *)pytalloc_get_ptr(py_obj);
184         object->addr = PyString_AS_STRING(value);
185         return 0;
186 }
187
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 },
192         { NULL }
193 };
194
195 static PyObject *py_winsif_Address_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
196 {
197         return pytalloc_new(struct winsif_Address, type);
198 }
199
200
201 static PyTypeObject winsif_Address_Type = {
202         PyObject_HEAD_INIT(NULL) 0,
203         .tp_name = "winsif.Address",
204         .tp_getset = py_winsif_Address_getsetters,
205         .tp_methods = NULL,
206         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
207         .tp_basicsize = sizeof(pytalloc_Object),
208         .tp_new = py_winsif_Address_new,
209 };
210
211
212 static PyObject *py_winsif_RecordAction_get_cmd(PyObject *obj, void *closure)
213 {
214         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
215         PyObject *py_cmd;
216         py_cmd = PyInt_FromLong((uint16_t)object->cmd);
217         return py_cmd;
218 }
219
220 static int py_winsif_RecordAction_set_cmd(PyObject *py_obj, PyObject *value, void *closure)
221 {
222         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
223         {
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) {
229                                 return -1;
230                         }
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);
234                                 return -1;
235                         }
236                         object->cmd = test_var;
237                 } else if (PyInt_Check(value)) {
238                         long test_var;
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);
243                                 return -1;
244                         }
245                         object->cmd = test_var;
246                 } else {
247                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
248                           PyInt_Type.tp_name, PyLong_Type.tp_name);
249                         return -1;
250                 }
251         }
252         return 0;
253 }
254
255 static PyObject *py_winsif_RecordAction_get_name(PyObject *obj, void *closure)
256 {
257         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(obj);
258         PyObject *py_name;
259         if (object->name == NULL) {
260                 py_name = Py_None;
261                 Py_INCREF(py_name);
262         } else {
263                 py_name = PyString_FromStringOrNULL(object->name);
264         }
265         return py_name;
266 }
267
268 static int py_winsif_RecordAction_set_name(PyObject *py_obj, PyObject *value, void *closure)
269 {
270         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
271         if (value == Py_None) {
272                 object->name = NULL;
273         } else {
274                 object->name = NULL;
275                 object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
276         }
277         return 0;
278 }
279
280 static PyObject *py_winsif_RecordAction_get_name_len(PyObject *obj, void *closure)
281 {
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);
285         return py_name_len;
286 }
287
288 static int py_winsif_RecordAction_set_name_len(PyObject *py_obj, PyObject *value, void *closure)
289 {
290         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
291         {
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) {
297                                 return -1;
298                         }
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);
302                                 return -1;
303                         }
304                         object->name_len = test_var;
305                 } else if (PyInt_Check(value)) {
306                         long test_var;
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);
311                                 return -1;
312                         }
313                         object->name_len = test_var;
314                 } else {
315                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
316                           PyInt_Type.tp_name, PyLong_Type.tp_name);
317                         return -1;
318                 }
319         }
320         return 0;
321 }
322
323 static PyObject *py_winsif_RecordAction_get_record_type(PyObject *obj, void *closure)
324 {
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;
329 }
330
331 static int py_winsif_RecordAction_set_record_type(PyObject *py_obj, PyObject *value, void *closure)
332 {
333         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
334         {
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) {
340                                 return -1;
341                         }
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);
345                                 return -1;
346                         }
347                         object->record_type = test_var;
348                 } else if (PyInt_Check(value)) {
349                         long test_var;
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);
354                                 return -1;
355                         }
356                         object->record_type = test_var;
357                 } else {
358                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
359                           PyInt_Type.tp_name, PyLong_Type.tp_name);
360                         return -1;
361                 }
362         }
363         return 0;
364 }
365
366 static PyObject *py_winsif_RecordAction_get_num_of_addresses(PyObject *obj, void *closure)
367 {
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;
372 }
373
374 static int py_winsif_RecordAction_set_num_of_addresses(PyObject *py_obj, PyObject *value, void *closure)
375 {
376         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
377         {
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) {
383                                 return -1;
384                         }
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);
388                                 return -1;
389                         }
390                         object->num_of_addresses = test_var;
391                 } else if (PyInt_Check(value)) {
392                         long test_var;
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);
397                                 return -1;
398                         }
399                         object->num_of_addresses = test_var;
400                 } else {
401                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
402                           PyInt_Type.tp_name, PyLong_Type.tp_name);
403                         return -1;
404                 }
405         }
406         return 0;
407 }
408
409 static PyObject *py_winsif_RecordAction_get_addresses(PyObject *obj, void *closure)
410 {
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);
416         } else {
417                 py_addresses = PyList_New(object->num_of_addresses);
418                 if (py_addresses == NULL) {
419                         return NULL;
420                 }
421                 {
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);
427                         }
428                 }
429         }
430         return py_addresses;
431 }
432
433 static int py_winsif_RecordAction_set_addresses(PyObject *py_obj, PyObject *value, void *closure)
434 {
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;
439         } else {
440                 object->addresses = NULL;
441                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
442                 {
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) {
450                                         PyErr_NoMemory();
451                                         return -1;
452                                 }
453                                 object->addresses[addresses_cntr_1] = *(struct winsif_Address *)pytalloc_get_ptr(PyList_GET_ITEM(value, addresses_cntr_1));
454                         }
455                 }
456         }
457         return 0;
458 }
459
460 static PyObject *py_winsif_RecordAction_get_address(PyObject *obj, void *closure)
461 {
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);
465         return py_address;
466 }
467
468 static int py_winsif_RecordAction_set_address(PyObject *py_obj, PyObject *value, void *closure)
469 {
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) {
473                 PyErr_NoMemory();
474                 return -1;
475         }
476         object->address = *(struct winsif_Address *)pytalloc_get_ptr(value);
477         return 0;
478 }
479
480 static PyObject *py_winsif_RecordAction_get_version_number(PyObject *obj, void *closure)
481 {
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;
486 }
487
488 static int py_winsif_RecordAction_set_version_number(PyObject *py_obj, PyObject *value, void *closure)
489 {
490         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
491         {
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) {
497                                 return -1;
498                         }
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);
502                                 return -1;
503                         }
504                         object->version_number = test_var;
505                 } else if (PyInt_Check(value)) {
506                         long test_var;
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);
511                                 return -1;
512                         }
513                         object->version_number = test_var;
514                 } else {
515                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
516                           PyInt_Type.tp_name, PyLong_Type.tp_name);
517                         return -1;
518                 }
519         }
520         return 0;
521 }
522
523 static PyObject *py_winsif_RecordAction_get_node_type(PyObject *obj, void *closure)
524 {
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);
528         return py_node_type;
529 }
530
531 static int py_winsif_RecordAction_set_node_type(PyObject *py_obj, PyObject *value, void *closure)
532 {
533         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
534         {
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) {
540                                 return -1;
541                         }
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);
545                                 return -1;
546                         }
547                         object->node_type = test_var;
548                 } else if (PyInt_Check(value)) {
549                         long test_var;
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);
554                                 return -1;
555                         }
556                         object->node_type = test_var;
557                 } else {
558                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
559                           PyInt_Type.tp_name, PyLong_Type.tp_name);
560                         return -1;
561                 }
562         }
563         return 0;
564 }
565
566 static PyObject *py_winsif_RecordAction_get_owner_address(PyObject *obj, void *closure)
567 {
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;
572 }
573
574 static int py_winsif_RecordAction_set_owner_address(PyObject *py_obj, PyObject *value, void *closure)
575 {
576         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
577         object->owner_address = PyString_AS_STRING(value);
578         return 0;
579 }
580
581 static PyObject *py_winsif_RecordAction_get_record_state(PyObject *obj, void *closure)
582 {
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;
587 }
588
589 static int py_winsif_RecordAction_set_record_state(PyObject *py_obj, PyObject *value, void *closure)
590 {
591         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
592         {
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) {
598                                 return -1;
599                         }
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);
603                                 return -1;
604                         }
605                         object->record_state = test_var;
606                 } else if (PyInt_Check(value)) {
607                         long test_var;
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);
612                                 return -1;
613                         }
614                         object->record_state = test_var;
615                 } else {
616                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
617                           PyInt_Type.tp_name, PyLong_Type.tp_name);
618                         return -1;
619                 }
620         }
621         return 0;
622 }
623
624 static PyObject *py_winsif_RecordAction_get_is_static(PyObject *obj, void *closure)
625 {
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);
629         return py_is_static;
630 }
631
632 static int py_winsif_RecordAction_set_is_static(PyObject *py_obj, PyObject *value, void *closure)
633 {
634         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
635         {
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) {
641                                 return -1;
642                         }
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);
646                                 return -1;
647                         }
648                         object->is_static = test_var;
649                 } else if (PyInt_Check(value)) {
650                         long test_var;
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);
655                                 return -1;
656                         }
657                         object->is_static = test_var;
658                 } else {
659                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
660                           PyInt_Type.tp_name, PyLong_Type.tp_name);
661                         return -1;
662                 }
663         }
664         return 0;
665 }
666
667 static PyObject *py_winsif_RecordAction_get_expire_time(PyObject *obj, void *closure)
668 {
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;
673 }
674
675 static int py_winsif_RecordAction_set_expire_time(PyObject *py_obj, PyObject *value, void *closure)
676 {
677         struct winsif_RecordAction *object = (struct winsif_RecordAction *)pytalloc_get_ptr(py_obj);
678         {
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)) {
682                         long long test_var;
683                         test_var = PyLong_AsLongLong(value);
684                         if (PyErr_Occurred() != NULL) {
685                                 return -1;
686                         }
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);
690                                 return -1;
691                         }
692                         object->expire_time = test_var;
693                 } else if (PyInt_Check(value)) {
694                         long test_var;
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);
699                                 return -1;
700                         }
701                         object->expire_time = test_var;
702                 } else {
703                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
704                           PyInt_Type.tp_name, PyLong_Type.tp_name);
705                         return -1;
706                 }
707         }
708         return 0;
709 }
710
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 },
725         { NULL }
726 };
727
728 static PyObject *py_winsif_RecordAction_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
729 {
730         return pytalloc_new(struct winsif_RecordAction, type);
731 }
732
733
734 static PyTypeObject winsif_RecordAction_Type = {
735         PyObject_HEAD_INIT(NULL) 0,
736         .tp_name = "winsif.RecordAction",
737         .tp_getset = py_winsif_RecordAction_getsetters,
738         .tp_methods = NULL,
739         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
740         .tp_basicsize = sizeof(pytalloc_Object),
741         .tp_new = py_winsif_RecordAction_new,
742 };
743
744
745 static PyObject *py_winsif_AddressVersionMap_get_address(PyObject *obj, void *closure)
746 {
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);
750         return py_address;
751 }
752
753 static int py_winsif_AddressVersionMap_set_address(PyObject *py_obj, PyObject *value, void *closure)
754 {
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) {
758                 PyErr_NoMemory();
759                 return -1;
760         }
761         object->address = *(struct winsif_Address *)pytalloc_get_ptr(value);
762         return 0;
763 }
764
765 static PyObject *py_winsif_AddressVersionMap_get_version_number(PyObject *obj, void *closure)
766 {
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;
771 }
772
773 static int py_winsif_AddressVersionMap_set_version_number(PyObject *py_obj, PyObject *value, void *closure)
774 {
775         struct winsif_AddressVersionMap *object = (struct winsif_AddressVersionMap *)pytalloc_get_ptr(py_obj);
776         {
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) {
782                                 return -1;
783                         }
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);
787                                 return -1;
788                         }
789                         object->version_number = test_var;
790                 } else if (PyInt_Check(value)) {
791                         long test_var;
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);
796                                 return -1;
797                         }
798                         object->version_number = test_var;
799                 } else {
800                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
801                           PyInt_Type.tp_name, PyLong_Type.tp_name);
802                         return -1;
803                 }
804         }
805         return 0;
806 }
807
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 },
811         { NULL }
812 };
813
814 static PyObject *py_winsif_AddressVersionMap_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
815 {
816         return pytalloc_new(struct winsif_AddressVersionMap, type);
817 }
818
819
820 static PyTypeObject winsif_AddressVersionMap_Type = {
821         PyObject_HEAD_INIT(NULL) 0,
822         .tp_name = "winsif.AddressVersionMap",
823         .tp_getset = py_winsif_AddressVersionMap_getsetters,
824         .tp_methods = NULL,
825         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
826         .tp_basicsize = sizeof(pytalloc_Object),
827         .tp_new = py_winsif_AddressVersionMap_new,
828 };
829
830
831 static PyObject *py_winsif_ReplCounter_get_address(PyObject *obj, void *closure)
832 {
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);
836         return py_address;
837 }
838
839 static int py_winsif_ReplCounter_set_address(PyObject *py_obj, PyObject *value, void *closure)
840 {
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) {
844                 PyErr_NoMemory();
845                 return -1;
846         }
847         object->address = *(struct winsif_Address *)pytalloc_get_ptr(value);
848         return 0;
849 }
850
851 static PyObject *py_winsif_ReplCounter_get_num_replications(PyObject *obj, void *closure)
852 {
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;
857 }
858
859 static int py_winsif_ReplCounter_set_num_replications(PyObject *py_obj, PyObject *value, void *closure)
860 {
861         struct winsif_ReplCounter *object = (struct winsif_ReplCounter *)pytalloc_get_ptr(py_obj);
862         {
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) {
868                                 return -1;
869                         }
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);
873                                 return -1;
874                         }
875                         object->num_replications = test_var;
876                 } else if (PyInt_Check(value)) {
877                         long test_var;
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);
882                                 return -1;
883                         }
884                         object->num_replications = test_var;
885                 } else {
886                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
887                           PyInt_Type.tp_name, PyLong_Type.tp_name);
888                         return -1;
889                 }
890         }
891         return 0;
892 }
893
894 static PyObject *py_winsif_ReplCounter_get_num_communication_failures(PyObject *obj, void *closure)
895 {
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;
900 }
901
902 static int py_winsif_ReplCounter_set_num_communication_failures(PyObject *py_obj, PyObject *value, void *closure)
903 {
904         struct winsif_ReplCounter *object = (struct winsif_ReplCounter *)pytalloc_get_ptr(py_obj);
905         {
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) {
911                                 return -1;
912                         }
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);
916                                 return -1;
917                         }
918                         object->num_communication_failures = test_var;
919                 } else if (PyInt_Check(value)) {
920                         long test_var;
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);
925                                 return -1;
926                         }
927                         object->num_communication_failures = test_var;
928                 } else {
929                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
930                           PyInt_Type.tp_name, PyLong_Type.tp_name);
931                         return -1;
932                 }
933         }
934         return 0;
935 }
936
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 },
941         { NULL }
942 };
943
944 static PyObject *py_winsif_ReplCounter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
945 {
946         return pytalloc_new(struct winsif_ReplCounter, type);
947 }
948
949
950 static PyTypeObject winsif_ReplCounter_Type = {
951         PyObject_HEAD_INIT(NULL) 0,
952         .tp_name = "winsif.ReplCounter",
953         .tp_getset = py_winsif_ReplCounter_getsetters,
954         .tp_methods = NULL,
955         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
956         .tp_basicsize = sizeof(pytalloc_Object),
957         .tp_new = py_winsif_ReplCounter_new,
958 };
959
960
961 static PyObject *py_winsif_StatCounters_get_num_unique_registrations(PyObject *obj, void *closure)
962 {
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;
967 }
968
969 static int py_winsif_StatCounters_set_num_unique_registrations(PyObject *py_obj, PyObject *value, void *closure)
970 {
971         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
972         {
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) {
978                                 return -1;
979                         }
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);
983                                 return -1;
984                         }
985                         object->num_unique_registrations = test_var;
986                 } else if (PyInt_Check(value)) {
987                         long test_var;
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);
992                                 return -1;
993                         }
994                         object->num_unique_registrations = test_var;
995                 } else {
996                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
997                           PyInt_Type.tp_name, PyLong_Type.tp_name);
998                         return -1;
999                 }
1000         }
1001         return 0;
1002 }
1003
1004 static PyObject *py_winsif_StatCounters_get_num_group_registrations(PyObject *obj, void *closure)
1005 {
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;
1010 }
1011
1012 static int py_winsif_StatCounters_set_num_group_registrations(PyObject *py_obj, PyObject *value, void *closure)
1013 {
1014         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1015         {
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) {
1021                                 return -1;
1022                         }
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);
1026                                 return -1;
1027                         }
1028                         object->num_group_registrations = test_var;
1029                 } else if (PyInt_Check(value)) {
1030                         long test_var;
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);
1035                                 return -1;
1036                         }
1037                         object->num_group_registrations = test_var;
1038                 } else {
1039                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1040                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1041                         return -1;
1042                 }
1043         }
1044         return 0;
1045 }
1046
1047 static PyObject *py_winsif_StatCounters_get_num_queries(PyObject *obj, void *closure)
1048 {
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;
1053 }
1054
1055 static int py_winsif_StatCounters_set_num_queries(PyObject *py_obj, PyObject *value, void *closure)
1056 {
1057         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1058         {
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) {
1064                                 return -1;
1065                         }
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);
1069                                 return -1;
1070                         }
1071                         object->num_queries = test_var;
1072                 } else if (PyInt_Check(value)) {
1073                         long test_var;
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);
1078                                 return -1;
1079                         }
1080                         object->num_queries = test_var;
1081                 } else {
1082                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1083                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1084                         return -1;
1085                 }
1086         }
1087         return 0;
1088 }
1089
1090 static PyObject *py_winsif_StatCounters_get_num_successful_queries(PyObject *obj, void *closure)
1091 {
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;
1096 }
1097
1098 static int py_winsif_StatCounters_set_num_successful_queries(PyObject *py_obj, PyObject *value, void *closure)
1099 {
1100         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1101         {
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) {
1107                                 return -1;
1108                         }
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);
1112                                 return -1;
1113                         }
1114                         object->num_successful_queries = test_var;
1115                 } else if (PyInt_Check(value)) {
1116                         long test_var;
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);
1121                                 return -1;
1122                         }
1123                         object->num_successful_queries = test_var;
1124                 } else {
1125                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1126                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1127                         return -1;
1128                 }
1129         }
1130         return 0;
1131 }
1132
1133 static PyObject *py_winsif_StatCounters_get_num_failed_queries(PyObject *obj, void *closure)
1134 {
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;
1139 }
1140
1141 static int py_winsif_StatCounters_set_num_failed_queries(PyObject *py_obj, PyObject *value, void *closure)
1142 {
1143         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1144         {
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) {
1150                                 return -1;
1151                         }
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);
1155                                 return -1;
1156                         }
1157                         object->num_failed_queries = test_var;
1158                 } else if (PyInt_Check(value)) {
1159                         long test_var;
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);
1164                                 return -1;
1165                         }
1166                         object->num_failed_queries = test_var;
1167                 } else {
1168                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1169                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1170                         return -1;
1171                 }
1172         }
1173         return 0;
1174 }
1175
1176 static PyObject *py_winsif_StatCounters_get_num_unique_refreshes(PyObject *obj, void *closure)
1177 {
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;
1182 }
1183
1184 static int py_winsif_StatCounters_set_num_unique_refreshes(PyObject *py_obj, PyObject *value, void *closure)
1185 {
1186         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1187         {
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) {
1193                                 return -1;
1194                         }
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);
1198                                 return -1;
1199                         }
1200                         object->num_unique_refreshes = test_var;
1201                 } else if (PyInt_Check(value)) {
1202                         long test_var;
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);
1207                                 return -1;
1208                         }
1209                         object->num_unique_refreshes = test_var;
1210                 } else {
1211                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1212                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1213                         return -1;
1214                 }
1215         }
1216         return 0;
1217 }
1218
1219 static PyObject *py_winsif_StatCounters_get_num_group_refreshes(PyObject *obj, void *closure)
1220 {
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;
1225 }
1226
1227 static int py_winsif_StatCounters_set_num_group_refreshes(PyObject *py_obj, PyObject *value, void *closure)
1228 {
1229         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1230         {
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) {
1236                                 return -1;
1237                         }
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);
1241                                 return -1;
1242                         }
1243                         object->num_group_refreshes = test_var;
1244                 } else if (PyInt_Check(value)) {
1245                         long test_var;
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);
1250                                 return -1;
1251                         }
1252                         object->num_group_refreshes = test_var;
1253                 } else {
1254                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1255                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1256                         return -1;
1257                 }
1258         }
1259         return 0;
1260 }
1261
1262 static PyObject *py_winsif_StatCounters_get_num_releases(PyObject *obj, void *closure)
1263 {
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;
1268 }
1269
1270 static int py_winsif_StatCounters_set_num_releases(PyObject *py_obj, PyObject *value, void *closure)
1271 {
1272         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1273         {
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) {
1279                                 return -1;
1280                         }
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);
1284                                 return -1;
1285                         }
1286                         object->num_releases = test_var;
1287                 } else if (PyInt_Check(value)) {
1288                         long test_var;
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);
1293                                 return -1;
1294                         }
1295                         object->num_releases = test_var;
1296                 } else {
1297                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1298                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1299                         return -1;
1300                 }
1301         }
1302         return 0;
1303 }
1304
1305 static PyObject *py_winsif_StatCounters_get_num_successful_releases(PyObject *obj, void *closure)
1306 {
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;
1311 }
1312
1313 static int py_winsif_StatCounters_set_num_successful_releases(PyObject *py_obj, PyObject *value, void *closure)
1314 {
1315         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1316         {
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) {
1322                                 return -1;
1323                         }
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);
1327                                 return -1;
1328                         }
1329                         object->num_successful_releases = test_var;
1330                 } else if (PyInt_Check(value)) {
1331                         long test_var;
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);
1336                                 return -1;
1337                         }
1338                         object->num_successful_releases = test_var;
1339                 } else {
1340                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1341                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1342                         return -1;
1343                 }
1344         }
1345         return 0;
1346 }
1347
1348 static PyObject *py_winsif_StatCounters_get_num_failed_releases(PyObject *obj, void *closure)
1349 {
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;
1354 }
1355
1356 static int py_winsif_StatCounters_set_num_failed_releases(PyObject *py_obj, PyObject *value, void *closure)
1357 {
1358         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1359         {
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) {
1365                                 return -1;
1366                         }
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);
1370                                 return -1;
1371                         }
1372                         object->num_failed_releases = test_var;
1373                 } else if (PyInt_Check(value)) {
1374                         long test_var;
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);
1379                                 return -1;
1380                         }
1381                         object->num_failed_releases = test_var;
1382                 } else {
1383                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1384                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1385                         return -1;
1386                 }
1387         }
1388         return 0;
1389 }
1390
1391 static PyObject *py_winsif_StatCounters_get_num_unique_conflicts(PyObject *obj, void *closure)
1392 {
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;
1397 }
1398
1399 static int py_winsif_StatCounters_set_num_unique_conflicts(PyObject *py_obj, PyObject *value, void *closure)
1400 {
1401         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1402         {
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) {
1408                                 return -1;
1409                         }
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);
1413                                 return -1;
1414                         }
1415                         object->num_unique_conflicts = test_var;
1416                 } else if (PyInt_Check(value)) {
1417                         long test_var;
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);
1422                                 return -1;
1423                         }
1424                         object->num_unique_conflicts = test_var;
1425                 } else {
1426                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1427                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1428                         return -1;
1429                 }
1430         }
1431         return 0;
1432 }
1433
1434 static PyObject *py_winsif_StatCounters_get_num_group_conflicts(PyObject *obj, void *closure)
1435 {
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;
1440 }
1441
1442 static int py_winsif_StatCounters_set_num_group_conflicts(PyObject *py_obj, PyObject *value, void *closure)
1443 {
1444         struct winsif_StatCounters *object = (struct winsif_StatCounters *)pytalloc_get_ptr(py_obj);
1445         {
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) {
1451                                 return -1;
1452                         }
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);
1456                                 return -1;
1457                         }
1458                         object->num_group_conflicts = test_var;
1459                 } else if (PyInt_Check(value)) {
1460                         long test_var;
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);
1465                                 return -1;
1466                         }
1467                         object->num_group_conflicts = test_var;
1468                 } else {
1469                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1470                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1471                         return -1;
1472                 }
1473         }
1474         return 0;
1475 }
1476
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 },
1490         { NULL }
1491 };
1492
1493 static PyObject *py_winsif_StatCounters_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1494 {
1495         return pytalloc_new(struct winsif_StatCounters, type);
1496 }
1497
1498
1499 static PyTypeObject winsif_StatCounters_Type = {
1500         PyObject_HEAD_INIT(NULL) 0,
1501         .tp_name = "winsif.StatCounters",
1502         .tp_getset = py_winsif_StatCounters_getsetters,
1503         .tp_methods = NULL,
1504         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1505         .tp_basicsize = sizeof(pytalloc_Object),
1506         .tp_new = py_winsif_StatCounters_new,
1507 };
1508
1509
1510 static PyObject *py_winsif_StatTimeStamps_get_wins_start_time(PyObject *obj, void *closure)
1511 {
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;
1516 }
1517
1518 static int py_winsif_StatTimeStamps_set_wins_start_time(PyObject *py_obj, PyObject *value, void *closure)
1519 {
1520         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1521         {
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)) {
1525                         long long test_var;
1526                         test_var = PyLong_AsLongLong(value);
1527                         if (PyErr_Occurred() != NULL) {
1528                                 return -1;
1529                         }
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);
1533                                 return -1;
1534                         }
1535                         object->wins_start_time = test_var;
1536                 } else if (PyInt_Check(value)) {
1537                         long test_var;
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);
1542                                 return -1;
1543                         }
1544                         object->wins_start_time = test_var;
1545                 } else {
1546                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1547                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1548                         return -1;
1549                 }
1550         }
1551         return 0;
1552 }
1553
1554 static PyObject *py_winsif_StatTimeStamps_get_last_periodic_scavenging(PyObject *obj, void *closure)
1555 {
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;
1560 }
1561
1562 static int py_winsif_StatTimeStamps_set_last_periodic_scavenging(PyObject *py_obj, PyObject *value, void *closure)
1563 {
1564         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1565         {
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)) {
1569                         long long test_var;
1570                         test_var = PyLong_AsLongLong(value);
1571                         if (PyErr_Occurred() != NULL) {
1572                                 return -1;
1573                         }
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);
1577                                 return -1;
1578                         }
1579                         object->last_periodic_scavenging = test_var;
1580                 } else if (PyInt_Check(value)) {
1581                         long test_var;
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);
1586                                 return -1;
1587                         }
1588                         object->last_periodic_scavenging = test_var;
1589                 } else {
1590                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1591                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1592                         return -1;
1593                 }
1594         }
1595         return 0;
1596 }
1597
1598 static PyObject *py_winsif_StatTimeStamps_get_last_triggered_scavenging(PyObject *obj, void *closure)
1599 {
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;
1604 }
1605
1606 static int py_winsif_StatTimeStamps_set_last_triggered_scavenging(PyObject *py_obj, PyObject *value, void *closure)
1607 {
1608         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1609         {
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)) {
1613                         long long test_var;
1614                         test_var = PyLong_AsLongLong(value);
1615                         if (PyErr_Occurred() != NULL) {
1616                                 return -1;
1617                         }
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);
1621                                 return -1;
1622                         }
1623                         object->last_triggered_scavenging = test_var;
1624                 } else if (PyInt_Check(value)) {
1625                         long test_var;
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);
1630                                 return -1;
1631                         }
1632                         object->last_triggered_scavenging = test_var;
1633                 } else {
1634                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1635                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1636                         return -1;
1637                 }
1638         }
1639         return 0;
1640 }
1641
1642 static PyObject *py_winsif_StatTimeStamps_get_last_tombstone_scavenging(PyObject *obj, void *closure)
1643 {
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;
1648 }
1649
1650 static int py_winsif_StatTimeStamps_set_last_tombstone_scavenging(PyObject *py_obj, PyObject *value, void *closure)
1651 {
1652         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1653         {
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)) {
1657                         long long test_var;
1658                         test_var = PyLong_AsLongLong(value);
1659                         if (PyErr_Occurred() != NULL) {
1660                                 return -1;
1661                         }
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);
1665                                 return -1;
1666                         }
1667                         object->last_tombstone_scavenging = test_var;
1668                 } else if (PyInt_Check(value)) {
1669                         long test_var;
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);
1674                                 return -1;
1675                         }
1676                         object->last_tombstone_scavenging = test_var;
1677                 } else {
1678                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1679                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1680                         return -1;
1681                 }
1682         }
1683         return 0;
1684 }
1685
1686 static PyObject *py_winsif_StatTimeStamps_get_last_verification_scavenging(PyObject *obj, void *closure)
1687 {
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;
1692 }
1693
1694 static int py_winsif_StatTimeStamps_set_last_verification_scavenging(PyObject *py_obj, PyObject *value, void *closure)
1695 {
1696         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1697         {
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)) {
1701                         long long test_var;
1702                         test_var = PyLong_AsLongLong(value);
1703                         if (PyErr_Occurred() != NULL) {
1704                                 return -1;
1705                         }
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);
1709                                 return -1;
1710                         }
1711                         object->last_verification_scavenging = test_var;
1712                 } else if (PyInt_Check(value)) {
1713                         long test_var;
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);
1718                                 return -1;
1719                         }
1720                         object->last_verification_scavenging = test_var;
1721                 } else {
1722                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1723                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1724                         return -1;
1725                 }
1726         }
1727         return 0;
1728 }
1729
1730 static PyObject *py_winsif_StatTimeStamps_get_last_periodic_pull_replication(PyObject *obj, void *closure)
1731 {
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;
1736 }
1737
1738 static int py_winsif_StatTimeStamps_set_last_periodic_pull_replication(PyObject *py_obj, PyObject *value, void *closure)
1739 {
1740         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1741         {
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)) {
1745                         long long test_var;
1746                         test_var = PyLong_AsLongLong(value);
1747                         if (PyErr_Occurred() != NULL) {
1748                                 return -1;
1749                         }
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);
1753                                 return -1;
1754                         }
1755                         object->last_periodic_pull_replication = test_var;
1756                 } else if (PyInt_Check(value)) {
1757                         long test_var;
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);
1762                                 return -1;
1763                         }
1764                         object->last_periodic_pull_replication = test_var;
1765                 } else {
1766                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1767                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1768                         return -1;
1769                 }
1770         }
1771         return 0;
1772 }
1773
1774 static PyObject *py_winsif_StatTimeStamps_get_last_triggered_pull_replication(PyObject *obj, void *closure)
1775 {
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;
1780 }
1781
1782 static int py_winsif_StatTimeStamps_set_last_triggered_pull_replication(PyObject *py_obj, PyObject *value, void *closure)
1783 {
1784         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1785         {
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)) {
1789                         long long test_var;
1790                         test_var = PyLong_AsLongLong(value);
1791                         if (PyErr_Occurred() != NULL) {
1792                                 return -1;
1793                         }
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);
1797                                 return -1;
1798                         }
1799                         object->last_triggered_pull_replication = test_var;
1800                 } else if (PyInt_Check(value)) {
1801                         long test_var;
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);
1806                                 return -1;
1807                         }
1808                         object->last_triggered_pull_replication = test_var;
1809                 } else {
1810                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1811                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1812                         return -1;
1813                 }
1814         }
1815         return 0;
1816 }
1817
1818 static PyObject *py_winsif_StatTimeStamps_get_ignore_last_ntrepl(PyObject *obj, void *closure)
1819 {
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;
1824 }
1825
1826 static int py_winsif_StatTimeStamps_set_ignore_last_ntrepl(PyObject *py_obj, PyObject *value, void *closure)
1827 {
1828         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1829         {
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)) {
1833                         long long test_var;
1834                         test_var = PyLong_AsLongLong(value);
1835                         if (PyErr_Occurred() != NULL) {
1836                                 return -1;
1837                         }
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);
1841                                 return -1;
1842                         }
1843                         object->ignore_last_ntrepl = test_var;
1844                 } else if (PyInt_Check(value)) {
1845                         long test_var;
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);
1850                                 return -1;
1851                         }
1852                         object->ignore_last_ntrepl = test_var;
1853                 } else {
1854                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1855                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1856                         return -1;
1857                 }
1858         }
1859         return 0;
1860 }
1861
1862 static PyObject *py_winsif_StatTimeStamps_get_ignore_last_actrepl(PyObject *obj, void *closure)
1863 {
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;
1868 }
1869
1870 static int py_winsif_StatTimeStamps_set_ignore_last_actrepl(PyObject *py_obj, PyObject *value, void *closure)
1871 {
1872         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1873         {
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)) {
1877                         long long test_var;
1878                         test_var = PyLong_AsLongLong(value);
1879                         if (PyErr_Occurred() != NULL) {
1880                                 return -1;
1881                         }
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);
1885                                 return -1;
1886                         }
1887                         object->ignore_last_actrepl = test_var;
1888                 } else if (PyInt_Check(value)) {
1889                         long test_var;
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);
1894                                 return -1;
1895                         }
1896                         object->ignore_last_actrepl = test_var;
1897                 } else {
1898                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1899                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1900                         return -1;
1901                 }
1902         }
1903         return 0;
1904 }
1905
1906 static PyObject *py_winsif_StatTimeStamps_get_last_init_db(PyObject *obj, void *closure)
1907 {
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;
1912 }
1913
1914 static int py_winsif_StatTimeStamps_set_last_init_db(PyObject *py_obj, PyObject *value, void *closure)
1915 {
1916         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1917         {
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)) {
1921                         long long test_var;
1922                         test_var = PyLong_AsLongLong(value);
1923                         if (PyErr_Occurred() != NULL) {
1924                                 return -1;
1925                         }
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);
1929                                 return -1;
1930                         }
1931                         object->last_init_db = test_var;
1932                 } else if (PyInt_Check(value)) {
1933                         long test_var;
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);
1938                                 return -1;
1939                         }
1940                         object->last_init_db = test_var;
1941                 } else {
1942                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1943                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1944                         return -1;
1945                 }
1946         }
1947         return 0;
1948 }
1949
1950 static PyObject *py_winsif_StatTimeStamps_get_counter_reset(PyObject *obj, void *closure)
1951 {
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;
1956 }
1957
1958 static int py_winsif_StatTimeStamps_set_counter_reset(PyObject *py_obj, PyObject *value, void *closure)
1959 {
1960         struct winsif_StatTimeStamps *object = (struct winsif_StatTimeStamps *)pytalloc_get_ptr(py_obj);
1961         {
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)) {
1965                         long long test_var;
1966                         test_var = PyLong_AsLongLong(value);
1967                         if (PyErr_Occurred() != NULL) {
1968                                 return -1;
1969                         }
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);
1973                                 return -1;
1974                         }
1975                         object->counter_reset = test_var;
1976                 } else if (PyInt_Check(value)) {
1977                         long test_var;
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);
1982                                 return -1;
1983                         }
1984                         object->counter_reset = test_var;
1985                 } else {
1986                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1987                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1988                         return -1;
1989                 }
1990         }
1991         return 0;
1992 }
1993
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 },
2006         { NULL }
2007 };
2008
2009 static PyObject *py_winsif_StatTimeStamps_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2010 {
2011         return pytalloc_new(struct winsif_StatTimeStamps, type);
2012 }
2013
2014
2015 static PyTypeObject winsif_StatTimeStamps_Type = {
2016         PyObject_HEAD_INIT(NULL) 0,
2017         .tp_name = "winsif.StatTimeStamps",
2018         .tp_getset = py_winsif_StatTimeStamps_getsetters,
2019         .tp_methods = NULL,
2020         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2021         .tp_basicsize = sizeof(pytalloc_Object),
2022         .tp_new = py_winsif_StatTimeStamps_new,
2023 };
2024
2025
2026 static PyObject *py_winsif_Stat_get_counters(PyObject *obj, void *closure)
2027 {
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);
2031         return py_counters;
2032 }
2033
2034 static int py_winsif_Stat_set_counters(PyObject *py_obj, PyObject *value, void *closure)
2035 {
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) {
2039                 PyErr_NoMemory();
2040                 return -1;
2041         }
2042         object->counters = *(struct winsif_StatCounters *)pytalloc_get_ptr(value);
2043         return 0;
2044 }
2045
2046 static PyObject *py_winsif_Stat_get_time_stamps(PyObject *obj, void *closure)
2047 {
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;
2052 }
2053
2054 static int py_winsif_Stat_set_time_stamps(PyObject *py_obj, PyObject *value, void *closure)
2055 {
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) {
2059                 PyErr_NoMemory();
2060                 return -1;
2061         }
2062         object->time_stamps = *(struct winsif_StatTimeStamps *)pytalloc_get_ptr(value);
2063         return 0;
2064 }
2065
2066 static PyObject *py_winsif_Stat_get_num_partners(PyObject *obj, void *closure)
2067 {
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;
2072 }
2073
2074 static int py_winsif_Stat_set_num_partners(PyObject *py_obj, PyObject *value, void *closure)
2075 {
2076         struct winsif_Stat *object = (struct winsif_Stat *)pytalloc_get_ptr(py_obj);
2077         {
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) {
2083                                 return -1;
2084                         }
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);
2088                                 return -1;
2089                         }
2090                         object->num_partners = test_var;
2091                 } else if (PyInt_Check(value)) {
2092                         long test_var;
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);
2097                                 return -1;
2098                         }
2099                         object->num_partners = test_var;
2100                 } else {
2101                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2102                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2103                         return -1;
2104                 }
2105         }
2106         return 0;
2107 }
2108
2109 static PyObject *py_winsif_Stat_get_partners(PyObject *obj, void *closure)
2110 {
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);
2116         } else {
2117                 py_partners = PyList_New(object->num_partners);
2118                 if (py_partners == NULL) {
2119                         return NULL;
2120                 }
2121                 {
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);
2127                         }
2128                 }
2129         }
2130         return py_partners;
2131 }
2132
2133 static int py_winsif_Stat_set_partners(PyObject *py_obj, PyObject *value, void *closure)
2134 {
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;
2139         } else {
2140                 object->partners = NULL;
2141                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2142                 {
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) {
2150                                         PyErr_NoMemory();
2151                                         return -1;
2152                                 }
2153                                 object->partners[partners_cntr_1] = *(struct winsif_ReplCounter *)pytalloc_get_ptr(PyList_GET_ITEM(value, partners_cntr_1));
2154                         }
2155                 }
2156         }
2157         return 0;
2158 }
2159
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 },
2165         { NULL }
2166 };
2167
2168 static PyObject *py_winsif_Stat_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2169 {
2170         return pytalloc_new(struct winsif_Stat, type);
2171 }
2172
2173
2174 static PyTypeObject winsif_Stat_Type = {
2175         PyObject_HEAD_INIT(NULL) 0,
2176         .tp_name = "winsif.Stat",
2177         .tp_getset = py_winsif_Stat_getsetters,
2178         .tp_methods = NULL,
2179         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2180         .tp_basicsize = sizeof(pytalloc_Object),
2181         .tp_new = py_winsif_Stat_new,
2182 };
2183
2184
2185 static PyObject *py_winsif_Results_get_num_owners(PyObject *obj, void *closure)
2186 {
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;
2191 }
2192
2193 static int py_winsif_Results_set_num_owners(PyObject *py_obj, PyObject *value, void *closure)
2194 {
2195         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2196         {
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) {
2202                                 return -1;
2203                         }
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);
2207                                 return -1;
2208                         }
2209                         object->num_owners = test_var;
2210                 } else if (PyInt_Check(value)) {
2211                         long test_var;
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);
2216                                 return -1;
2217                         }
2218                         object->num_owners = test_var;
2219                 } else {
2220                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2221                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2222                         return -1;
2223                 }
2224         }
2225         return 0;
2226 }
2227
2228 static PyObject *py_winsif_Results_get_address_version_maps(PyObject *obj, void *closure)
2229 {
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) {
2234                 return NULL;
2235         }
2236         {
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);
2242                 }
2243         }
2244         return py_address_version_maps;
2245 }
2246
2247 static int py_winsif_Results_set_address_version_maps(PyObject *py_obj, PyObject *value, void *closure)
2248 {
2249         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2250         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2251         {
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));
2255                         return -1;
2256                 }
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) {
2260                                 PyErr_NoMemory();
2261                                 return -1;
2262                         }
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));
2264                 }
2265         }
2266         return 0;
2267 }
2268
2269 static PyObject *py_winsif_Results_get_my_max_version_number(PyObject *obj, void *closure)
2270 {
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;
2275 }
2276
2277 static int py_winsif_Results_set_my_max_version_number(PyObject *py_obj, PyObject *value, void *closure)
2278 {
2279         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2280         {
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) {
2286                                 return -1;
2287                         }
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);
2291                                 return -1;
2292                         }
2293                         object->my_max_version_number = test_var;
2294                 } else if (PyInt_Check(value)) {
2295                         long test_var;
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);
2300                                 return -1;
2301                         }
2302                         object->my_max_version_number = test_var;
2303                 } else {
2304                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2305                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2306                         return -1;
2307                 }
2308         }
2309         return 0;
2310 }
2311
2312 static PyObject *py_winsif_Results_get_refresh_interval(PyObject *obj, void *closure)
2313 {
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;
2318 }
2319
2320 static int py_winsif_Results_set_refresh_interval(PyObject *py_obj, PyObject *value, void *closure)
2321 {
2322         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2323         {
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) {
2329                                 return -1;
2330                         }
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);
2334                                 return -1;
2335                         }
2336                         object->refresh_interval = test_var;
2337                 } else if (PyInt_Check(value)) {
2338                         long test_var;
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);
2343                                 return -1;
2344                         }
2345                         object->refresh_interval = test_var;
2346                 } else {
2347                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2348                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2349                         return -1;
2350                 }
2351         }
2352         return 0;
2353 }
2354
2355 static PyObject *py_winsif_Results_get_tombstone_interval(PyObject *obj, void *closure)
2356 {
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;
2361 }
2362
2363 static int py_winsif_Results_set_tombstone_interval(PyObject *py_obj, PyObject *value, void *closure)
2364 {
2365         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2366         {
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) {
2372                                 return -1;
2373                         }
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);
2377                                 return -1;
2378                         }
2379                         object->tombstone_interval = test_var;
2380                 } else if (PyInt_Check(value)) {
2381                         long test_var;
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);
2386                                 return -1;
2387                         }
2388                         object->tombstone_interval = test_var;
2389                 } else {
2390                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2391                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2392                         return -1;
2393                 }
2394         }
2395         return 0;
2396 }
2397
2398 static PyObject *py_winsif_Results_get_tombstone_timeout(PyObject *obj, void *closure)
2399 {
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;
2404 }
2405
2406 static int py_winsif_Results_set_tombstone_timeout(PyObject *py_obj, PyObject *value, void *closure)
2407 {
2408         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2409         {
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) {
2415                                 return -1;
2416                         }
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);
2420                                 return -1;
2421                         }
2422                         object->tombstone_timeout = test_var;
2423                 } else if (PyInt_Check(value)) {
2424                         long test_var;
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);
2429                                 return -1;
2430                         }
2431                         object->tombstone_timeout = test_var;
2432                 } else {
2433                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2434                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2435                         return -1;
2436                 }
2437         }
2438         return 0;
2439 }
2440
2441 static PyObject *py_winsif_Results_get_verify_interval(PyObject *obj, void *closure)
2442 {
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;
2447 }
2448
2449 static int py_winsif_Results_set_verify_interval(PyObject *py_obj, PyObject *value, void *closure)
2450 {
2451         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2452         {
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) {
2458                                 return -1;
2459                         }
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);
2463                                 return -1;
2464                         }
2465                         object->verify_interval = test_var;
2466                 } else if (PyInt_Check(value)) {
2467                         long test_var;
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);
2472                                 return -1;
2473                         }
2474                         object->verify_interval = test_var;
2475                 } else {
2476                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2477                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2478                         return -1;
2479                 }
2480         }
2481         return 0;
2482 }
2483
2484 static PyObject *py_winsif_Results_get_prioritiy_class(PyObject *obj, void *closure)
2485 {
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;
2490 }
2491
2492 static int py_winsif_Results_set_prioritiy_class(PyObject *py_obj, PyObject *value, void *closure)
2493 {
2494         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2495         {
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) {
2501                                 return -1;
2502                         }
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);
2506                                 return -1;
2507                         }
2508                         object->prioritiy_class = test_var;
2509                 } else if (PyInt_Check(value)) {
2510                         long test_var;
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);
2515                                 return -1;
2516                         }
2517                         object->prioritiy_class = test_var;
2518                 } else {
2519                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2520                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2521                         return -1;
2522                 }
2523         }
2524         return 0;
2525 }
2526
2527 static PyObject *py_winsif_Results_get_num_worker_threads(PyObject *obj, void *closure)
2528 {
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;
2533 }
2534
2535 static int py_winsif_Results_set_num_worker_threads(PyObject *py_obj, PyObject *value, void *closure)
2536 {
2537         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(py_obj);
2538         {
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) {
2544                                 return -1;
2545                         }
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);
2549                                 return -1;
2550                         }
2551                         object->num_worker_threads = test_var;
2552                 } else if (PyInt_Check(value)) {
2553                         long test_var;
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);
2558                                 return -1;
2559                         }
2560                         object->num_worker_threads = test_var;
2561                 } else {
2562                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2563                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2564                         return -1;
2565                 }
2566         }
2567         return 0;
2568 }
2569
2570 static PyObject *py_winsif_Results_get_wstat(PyObject *obj, void *closure)
2571 {
2572         struct winsif_Results *object = (struct winsif_Results *)pytalloc_get_ptr(obj);
2573         PyObject *py_wstat;
2574         py_wstat = pytalloc_reference_ex(&winsif_Stat_Type, pytalloc_get_mem_ctx(obj), &object->wstat);
2575         return py_wstat;
2576 }
2577
2578 static int py_winsif_Results_set_wstat(PyObject *py_obj, PyObject *value, void *closure)
2579 {
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) {
2583                 PyErr_NoMemory();
2584                 return -1;
2585         }
2586         object->wstat = *(struct winsif_Stat *)pytalloc_get_ptr(value);
2587         return 0;
2588 }
2589
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 },
2601         { NULL }
2602 };
2603
2604 static PyObject *py_winsif_Results_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2605 {
2606         return pytalloc_new(struct winsif_Results, type);
2607 }
2608
2609
2610 static PyTypeObject winsif_Results_Type = {
2611         PyObject_HEAD_INIT(NULL) 0,
2612         .tp_name = "winsif.Results",
2613         .tp_getset = py_winsif_Results_getsetters,
2614         .tp_methods = NULL,
2615         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2616         .tp_basicsize = sizeof(pytalloc_Object),
2617         .tp_new = py_winsif_Results_new,
2618 };
2619
2620
2621 static PyObject *py_winsif_Records_get_buffer_size(PyObject *obj, void *closure)
2622 {
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;
2627 }
2628
2629 static int py_winsif_Records_set_buffer_size(PyObject *py_obj, PyObject *value, void *closure)
2630 {
2631         struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(py_obj);
2632         {
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) {
2638                                 return -1;
2639                         }
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);
2643                                 return -1;
2644                         }
2645                         object->buffer_size = test_var;
2646                 } else if (PyInt_Check(value)) {
2647                         long test_var;
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);
2652                                 return -1;
2653                         }
2654                         object->buffer_size = test_var;
2655                 } else {
2656                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2657                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2658                         return -1;
2659                 }
2660         }
2661         return 0;
2662 }
2663
2664 static PyObject *py_winsif_Records_get_row(PyObject *obj, void *closure)
2665 {
2666         struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(obj);
2667         PyObject *py_row;
2668         if (object->row == NULL) {
2669                 py_row = Py_None;
2670                 Py_INCREF(py_row);
2671         } else {
2672                 py_row = PyList_New(object->num_records);
2673                 if (py_row == NULL) {
2674                         return NULL;
2675                 }
2676                 {
2677                         int row_cntr_1;
2678                         for (row_cntr_1 = 0; row_cntr_1 < (object->num_records); row_cntr_1++) {
2679                                 PyObject *py_row_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);
2682                         }
2683                 }
2684         }
2685         return py_row;
2686 }
2687
2688 static int py_winsif_Records_set_row(PyObject *py_obj, PyObject *value, void *closure)
2689 {
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) {
2693                 object->row = NULL;
2694         } else {
2695                 object->row = NULL;
2696                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2697                 {
2698                         int row_cntr_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) {
2705                                         PyErr_NoMemory();
2706                                         return -1;
2707                                 }
2708                                 object->row[row_cntr_1] = *(struct winsif_RecordAction *)pytalloc_get_ptr(PyList_GET_ITEM(value, row_cntr_1));
2709                         }
2710                 }
2711         }
2712         return 0;
2713 }
2714
2715 static PyObject *py_winsif_Records_get_num_records(PyObject *obj, void *closure)
2716 {
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;
2721 }
2722
2723 static int py_winsif_Records_set_num_records(PyObject *py_obj, PyObject *value, void *closure)
2724 {
2725         struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(py_obj);
2726         {
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) {
2732                                 return -1;
2733                         }
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);
2737                                 return -1;
2738                         }
2739                         object->num_records = test_var;
2740                 } else if (PyInt_Check(value)) {
2741                         long test_var;
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);
2746                                 return -1;
2747                         }
2748                         object->num_records = test_var;
2749                 } else {
2750                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2751                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2752                         return -1;
2753                 }
2754         }
2755         return 0;
2756 }
2757
2758 static PyObject *py_winsif_Records_get_total_num_records(PyObject *obj, void *closure)
2759 {
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;
2764 }
2765
2766 static int py_winsif_Records_set_total_num_records(PyObject *py_obj, PyObject *value, void *closure)
2767 {
2768         struct winsif_Records *object = (struct winsif_Records *)pytalloc_get_ptr(py_obj);
2769         {
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) {
2775                                 return -1;
2776                         }
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);
2780                                 return -1;
2781                         }
2782                         object->total_num_records = test_var;
2783                 } else if (PyInt_Check(value)) {
2784                         long test_var;
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);
2789                                 return -1;
2790                         }
2791                         object->total_num_records = test_var;
2792                 } else {
2793                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2794                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2795                         return -1;
2796                 }
2797         }
2798         return 0;
2799 }
2800
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 },
2806         { NULL }
2807 };
2808
2809 static PyObject *py_winsif_Records_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2810 {
2811         return pytalloc_new(struct winsif_Records, type);
2812 }
2813
2814
2815 static PyTypeObject winsif_Records_Type = {
2816         PyObject_HEAD_INIT(NULL) 0,
2817         .tp_name = "winsif.Records",
2818         .tp_getset = py_winsif_Records_getsetters,
2819         .tp_methods = NULL,
2820         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2821         .tp_basicsize = sizeof(pytalloc_Object),
2822         .tp_new = py_winsif_Records_new,
2823 };
2824
2825
2826 static PyObject *py_winsif_BrowserInfo_get_name_len(PyObject *obj, void *closure)
2827 {
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);
2831         return py_name_len;
2832 }
2833
2834 static int py_winsif_BrowserInfo_set_name_len(PyObject *py_obj, PyObject *value, void *closure)
2835 {
2836         struct winsif_BrowserInfo *object = (struct winsif_BrowserInfo *)pytalloc_get_ptr(py_obj);
2837         {
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) {
2843                                 return -1;
2844                         }
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);
2848                                 return -1;
2849                         }
2850                         object->name_len = test_var;
2851                 } else if (PyInt_Check(value)) {
2852                         long test_var;
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);
2857                                 return -1;
2858                         }
2859                         object->name_len = test_var;
2860                 } else {
2861                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2862                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2863                         return -1;
2864                 }
2865         }
2866         return 0;
2867 }
2868
2869 static PyObject *py_winsif_BrowserInfo_get_name(PyObject *obj, void *closure)
2870 {
2871         struct winsif_BrowserInfo *object = (struct winsif_BrowserInfo *)pytalloc_get_ptr(obj);
2872         PyObject *py_name;
2873         if (object->name == NULL) {
2874                 py_name = Py_None;
2875                 Py_INCREF(py_name);
2876         } else {
2877                 if (object->name == NULL) {
2878                         py_name = Py_None;
2879                         Py_INCREF(py_name);
2880                 } else {
2881                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
2882                 }
2883         }
2884         return py_name;
2885 }
2886
2887 static int py_winsif_BrowserInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
2888 {
2889         struct winsif_BrowserInfo *object = (struct winsif_BrowserInfo *)pytalloc_get_ptr(py_obj);
2890         if (value == Py_None) {
2891                 object->name = NULL;
2892         } else {
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);
2898                 } else {
2899                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2900                         return -1;
2901                 }
2902         }
2903         return 0;
2904 }
2905
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 },
2909         { NULL }
2910 };
2911
2912 static PyObject *py_winsif_BrowserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2913 {
2914         return pytalloc_new(struct winsif_BrowserInfo, type);
2915 }
2916
2917
2918 static PyTypeObject winsif_BrowserInfo_Type = {
2919         PyObject_HEAD_INIT(NULL) 0,
2920         .tp_name = "winsif.BrowserInfo",
2921         .tp_getset = py_winsif_BrowserInfo_getsetters,
2922         .tp_methods = NULL,
2923         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2924         .tp_basicsize = sizeof(pytalloc_Object),
2925         .tp_new = py_winsif_BrowserInfo_new,
2926 };
2927
2928
2929 static PyObject *py_winsif_BrowserNames_get_num_entries(PyObject *obj, void *closure)
2930 {
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;
2935 }
2936
2937 static int py_winsif_BrowserNames_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
2938 {
2939         struct winsif_BrowserNames *object = (struct winsif_BrowserNames *)pytalloc_get_ptr(py_obj);
2940         {
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) {
2946                                 return -1;
2947                         }
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);
2951                                 return -1;
2952                         }
2953                         object->num_entries = test_var;
2954                 } else if (PyInt_Check(value)) {
2955                         long test_var;
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);
2960                                 return -1;
2961                         }
2962                         object->num_entries = test_var;
2963                 } else {
2964                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2965                           PyInt_Type.tp_name, PyLong_Type.tp_name);
2966                         return -1;
2967                 }
2968         }
2969         return 0;
2970 }
2971
2972 static PyObject *py_winsif_BrowserNames_get_info(PyObject *obj, void *closure)
2973 {
2974         struct winsif_BrowserNames *object = (struct winsif_BrowserNames *)pytalloc_get_ptr(obj);
2975         PyObject *py_info;
2976         if (object->info == NULL) {
2977                 py_info = Py_None;
2978                 Py_INCREF(py_info);
2979         } else {
2980                 py_info = PyList_New(object->num_entries);
2981                 if (py_info == NULL) {
2982                         return NULL;
2983                 }
2984                 {
2985                         int info_cntr_1;
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);
2990                         }
2991                 }
2992         }
2993         return py_info;
2994 }
2995
2996 static int py_winsif_BrowserNames_set_info(PyObject *py_obj, PyObject *value, void *closure)
2997 {
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;
3002         } else {
3003                 object->info = NULL;
3004                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3005                 {
3006                         int info_cntr_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) {
3013                                         PyErr_NoMemory();
3014                                         return -1;
3015                                 }
3016                                 object->info[info_cntr_1] = *(struct winsif_BrowserInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, info_cntr_1));
3017                         }
3018                 }
3019         }
3020         return 0;
3021 }
3022
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 },
3026         { NULL }
3027 };
3028
3029 static PyObject *py_winsif_BrowserNames_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3030 {
3031         return pytalloc_new(struct winsif_BrowserNames, type);
3032 }
3033
3034
3035 static PyTypeObject winsif_BrowserNames_Type = {
3036         PyObject_HEAD_INIT(NULL) 0,
3037         .tp_name = "winsif.BrowserNames",
3038         .tp_getset = py_winsif_BrowserNames_getsetters,
3039         .tp_methods = NULL,
3040         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3041         .tp_basicsize = sizeof(pytalloc_Object),
3042         .tp_new = py_winsif_BrowserNames_new,
3043 };
3044
3045
3046 static PyObject *py_winsif_BindData_get_tcp_ip(PyObject *obj, void *closure)
3047 {
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);
3051         return py_tcp_ip;
3052 }
3053
3054 static int py_winsif_BindData_set_tcp_ip(PyObject *py_obj, PyObject *value, void *closure)
3055 {
3056         struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(py_obj);
3057         {
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) {
3063                                 return -1;
3064                         }
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);
3068                                 return -1;
3069                         }
3070                         object->tcp_ip = test_var;
3071                 } else if (PyInt_Check(value)) {
3072                         long test_var;
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);
3077                                 return -1;
3078                         }
3079                         object->tcp_ip = test_var;
3080                 } else {
3081                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3082                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3083                         return -1;
3084                 }
3085         }
3086         return 0;
3087 }
3088
3089 static PyObject *py_winsif_BindData_get_server_address(PyObject *obj, void *closure)
3090 {
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);
3096         } else {
3097                 if (object->server_address == NULL) {
3098                         py_server_address = Py_None;
3099                         Py_INCREF(py_server_address);
3100                 } else {
3101                         py_server_address = PyUnicode_Decode(object->server_address, strlen(object->server_address), "utf-8", "ignore");
3102                 }
3103         }
3104         return py_server_address;
3105 }
3106
3107 static int py_winsif_BindData_set_server_address(PyObject *py_obj, PyObject *value, void *closure)
3108 {
3109         struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(py_obj);
3110         if (value == Py_None) {
3111                 object->server_address = NULL;
3112         } else {
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);
3118                 } else {
3119                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3120                         return -1;
3121                 }
3122         }
3123         return 0;
3124 }
3125
3126 static PyObject *py_winsif_BindData_get_pipe_name(PyObject *obj, void *closure)
3127 {
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);
3133         } else {
3134                 if (object->pipe_name == NULL) {
3135                         py_pipe_name = Py_None;
3136                         Py_INCREF(py_pipe_name);
3137                 } else {
3138                         py_pipe_name = PyUnicode_Decode(object->pipe_name, strlen(object->pipe_name), "utf-8", "ignore");
3139                 }
3140         }
3141         return py_pipe_name;
3142 }
3143
3144 static int py_winsif_BindData_set_pipe_name(PyObject *py_obj, PyObject *value, void *closure)
3145 {
3146         struct winsif_BindData *object = (struct winsif_BindData *)pytalloc_get_ptr(py_obj);
3147         if (value == Py_None) {
3148                 object->pipe_name = NULL;
3149         } else {
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);
3155                 } else {
3156                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
3157                         return -1;
3158                 }
3159         }
3160         return 0;
3161 }
3162
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 },
3167         { NULL }
3168 };
3169
3170 static PyObject *py_winsif_BindData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3171 {
3172         return pytalloc_new(struct winsif_BindData, type);
3173 }
3174
3175
3176 static PyTypeObject winsif_BindData_Type = {
3177         PyObject_HEAD_INIT(NULL) 0,
3178         .tp_name = "winsif.BindData",
3179         .tp_getset = py_winsif_BindData_getsetters,
3180         .tp_methods = NULL,
3181         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3182         .tp_basicsize = sizeof(pytalloc_Object),
3183         .tp_new = py_winsif_BindData_new,
3184 };
3185
3186
3187 static PyObject *py_winsif_ResultsNew_get_num_owners(PyObject *obj, void *closure)
3188 {
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;
3193 }
3194
3195 static int py_winsif_ResultsNew_set_num_owners(PyObject *py_obj, PyObject *value, void *closure)
3196 {
3197         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3198         {
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) {
3204                                 return -1;
3205                         }
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);
3209                                 return -1;
3210                         }
3211                         object->num_owners = test_var;
3212                 } else if (PyInt_Check(value)) {
3213                         long test_var;
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);
3218                                 return -1;
3219                         }
3220                         object->num_owners = test_var;
3221                 } else {
3222                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3223                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3224                         return -1;
3225                 }
3226         }
3227         return 0;
3228 }
3229
3230 static PyObject *py_winsif_ResultsNew_get_address_version_maps(PyObject *obj, void *closure)
3231 {
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);
3237         } else {
3238                 py_address_version_maps = PyList_New(object->num_owners);
3239                 if (py_address_version_maps == NULL) {
3240                         return NULL;
3241                 }
3242                 {
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);
3248                         }
3249                 }
3250         }
3251         return py_address_version_maps;
3252 }
3253
3254 static int py_winsif_ResultsNew_set_address_version_maps(PyObject *py_obj, PyObject *value, void *closure)
3255 {
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;
3260         } else {
3261                 object->address_version_maps = NULL;
3262                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3263                 {
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) {
3271                                         PyErr_NoMemory();
3272                                         return -1;
3273                                 }
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));
3275                         }
3276                 }
3277         }
3278         return 0;
3279 }
3280
3281 static PyObject *py_winsif_ResultsNew_get_my_max_version_number(PyObject *obj, void *closure)
3282 {
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;
3287 }
3288
3289 static int py_winsif_ResultsNew_set_my_max_version_number(PyObject *py_obj, PyObject *value, void *closure)
3290 {
3291         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3292         {
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) {
3298                                 return -1;
3299                         }
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);
3303                                 return -1;
3304                         }
3305                         object->my_max_version_number = test_var;
3306                 } else if (PyInt_Check(value)) {
3307                         long test_var;
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);
3312                                 return -1;
3313                         }
3314                         object->my_max_version_number = test_var;
3315                 } else {
3316                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3317                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3318                         return -1;
3319                 }
3320         }
3321         return 0;
3322 }
3323
3324 static PyObject *py_winsif_ResultsNew_get_refresh_interval(PyObject *obj, void *closure)
3325 {
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;
3330 }
3331
3332 static int py_winsif_ResultsNew_set_refresh_interval(PyObject *py_obj, PyObject *value, void *closure)
3333 {
3334         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3335         {
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) {
3341                                 return -1;
3342                         }
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);
3346                                 return -1;
3347                         }
3348                         object->refresh_interval = test_var;
3349                 } else if (PyInt_Check(value)) {
3350                         long test_var;
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);
3355                                 return -1;
3356                         }
3357                         object->refresh_interval = test_var;
3358                 } else {
3359                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3360                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3361                         return -1;
3362                 }
3363         }
3364         return 0;
3365 }
3366
3367 static PyObject *py_winsif_ResultsNew_get_tombstone_interval(PyObject *obj, void *closure)
3368 {
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;
3373 }
3374
3375 static int py_winsif_ResultsNew_set_tombstone_interval(PyObject *py_obj, PyObject *value, void *closure)
3376 {
3377         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3378         {
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) {
3384                                 return -1;
3385                         }
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);
3389                                 return -1;
3390                         }
3391                         object->tombstone_interval = test_var;
3392                 } else if (PyInt_Check(value)) {
3393                         long test_var;
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);
3398                                 return -1;
3399                         }
3400                         object->tombstone_interval = test_var;
3401                 } else {
3402                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3403                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3404                         return -1;
3405                 }
3406         }
3407         return 0;
3408 }
3409
3410 static PyObject *py_winsif_ResultsNew_get_tombstone_timeout(PyObject *obj, void *closure)
3411 {
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;
3416 }
3417
3418 static int py_winsif_ResultsNew_set_tombstone_timeout(PyObject *py_obj, PyObject *value, void *closure)
3419 {
3420         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3421         {
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) {
3427                                 return -1;
3428                         }
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);
3432                                 return -1;
3433                         }
3434                         object->tombstone_timeout = test_var;
3435                 } else if (PyInt_Check(value)) {
3436                         long test_var;
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);
3441                                 return -1;
3442                         }
3443                         object->tombstone_timeout = test_var;
3444                 } else {
3445                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3446                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3447                         return -1;
3448                 }
3449         }
3450         return 0;
3451 }
3452
3453 static PyObject *py_winsif_ResultsNew_get_verify_interval(PyObject *obj, void *closure)
3454 {
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;
3459 }
3460
3461 static int py_winsif_ResultsNew_set_verify_interval(PyObject *py_obj, PyObject *value, void *closure)
3462 {
3463         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3464         {
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) {
3470                                 return -1;
3471                         }
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);
3475                                 return -1;
3476                         }
3477                         object->verify_interval = test_var;
3478                 } else if (PyInt_Check(value)) {
3479                         long test_var;
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);
3484                                 return -1;
3485                         }
3486                         object->verify_interval = test_var;
3487                 } else {
3488                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3489                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3490                         return -1;
3491                 }
3492         }
3493         return 0;
3494 }
3495
3496 static PyObject *py_winsif_ResultsNew_get_prioritiy_class(PyObject *obj, void *closure)
3497 {
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;
3502 }
3503
3504 static int py_winsif_ResultsNew_set_prioritiy_class(PyObject *py_obj, PyObject *value, void *closure)
3505 {
3506         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3507         {
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) {
3513                                 return -1;
3514                         }
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);
3518                                 return -1;
3519                         }
3520                         object->prioritiy_class = test_var;
3521                 } else if (PyInt_Check(value)) {
3522                         long test_var;
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);
3527                                 return -1;
3528                         }
3529                         object->prioritiy_class = test_var;
3530                 } else {
3531                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3532                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3533                         return -1;
3534                 }
3535         }
3536         return 0;
3537 }
3538
3539 static PyObject *py_winsif_ResultsNew_get_num_worker_threads(PyObject *obj, void *closure)
3540 {
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;
3545 }
3546
3547 static int py_winsif_ResultsNew_set_num_worker_threads(PyObject *py_obj, PyObject *value, void *closure)
3548 {
3549         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_obj);
3550         {
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) {
3556                                 return -1;
3557                         }
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);
3561                                 return -1;
3562                         }
3563                         object->num_worker_threads = test_var;
3564                 } else if (PyInt_Check(value)) {
3565                         long test_var;
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);
3570                                 return -1;
3571                         }
3572                         object->num_worker_threads = test_var;
3573                 } else {
3574                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3575                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3576                         return -1;
3577                 }
3578         }
3579         return 0;
3580 }
3581
3582 static PyObject *py_winsif_ResultsNew_get_wstat(PyObject *obj, void *closure)
3583 {
3584         struct winsif_ResultsNew *object = (struct winsif_ResultsNew *)pytalloc_get_ptr(obj);
3585         PyObject *py_wstat;
3586         py_wstat = pytalloc_reference_ex(&winsif_Stat_Type, pytalloc_get_mem_ctx(obj), &object->wstat);
3587         return py_wstat;
3588 }
3589
3590 static int py_winsif_ResultsNew_set_wstat(PyObject *py_obj, PyObject *value, void *closure)
3591 {
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) {
3595                 PyErr_NoMemory();
3596                 return -1;
3597         }
3598         object->wstat = *(struct winsif_Stat *)pytalloc_get_ptr(value);
3599         return 0;
3600 }
3601
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 },
3613         { NULL }
3614 };
3615
3616 static PyObject *py_winsif_ResultsNew_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3617 {
3618         return pytalloc_new(struct winsif_ResultsNew, type);
3619 }
3620
3621
3622 static PyTypeObject winsif_ResultsNew_Type = {
3623         PyObject_HEAD_INIT(NULL) 0,
3624         .tp_name = "winsif.ResultsNew",
3625         .tp_getset = py_winsif_ResultsNew_getsetters,
3626         .tp_methods = NULL,
3627         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3628         .tp_basicsize = sizeof(pytalloc_Object),
3629         .tp_new = py_winsif_ResultsNew_new,
3630 };
3631
3632
3633 static PyObject *py_winsif_ScavengingRequest_get_opcode(PyObject *obj, void *closure)
3634 {
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);
3638         return py_opcode;
3639 }
3640
3641 static int py_winsif_ScavengingRequest_set_opcode(PyObject *py_obj, PyObject *value, void *closure)
3642 {
3643         struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(py_obj);
3644         {
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) {
3650                                 return -1;
3651                         }
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);
3655                                 return -1;
3656                         }
3657                         object->opcode = test_var;
3658                 } else if (PyInt_Check(value)) {
3659                         long test_var;
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);
3664                                 return -1;
3665                         }
3666                         object->opcode = test_var;
3667                 } else {
3668                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3669                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3670                         return -1;
3671                 }
3672         }
3673         return 0;
3674 }
3675
3676 static PyObject *py_winsif_ScavengingRequest_get_age(PyObject *obj, void *closure)
3677 {
3678         struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(obj);
3679         PyObject *py_age;
3680         py_age = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->age);
3681         return py_age;
3682 }
3683
3684 static int py_winsif_ScavengingRequest_set_age(PyObject *py_obj, PyObject *value, void *closure)
3685 {
3686         struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(py_obj);
3687         {
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) {
3693                                 return -1;
3694                         }
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);
3698                                 return -1;
3699                         }
3700                         object->age = test_var;
3701                 } else if (PyInt_Check(value)) {
3702                         long test_var;
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);
3707                                 return -1;
3708                         }
3709                         object->age = test_var;
3710                 } else {
3711                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3712                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3713                         return -1;
3714                 }
3715         }
3716         return 0;
3717 }
3718
3719 static PyObject *py_winsif_ScavengingRequest_get_force(PyObject *obj, void *closure)
3720 {
3721         struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(obj);
3722         PyObject *py_force;
3723         py_force = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->force);
3724         return py_force;
3725 }
3726
3727 static int py_winsif_ScavengingRequest_set_force(PyObject *py_obj, PyObject *value, void *closure)
3728 {
3729         struct winsif_ScavengingRequest *object = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(py_obj);
3730         {
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) {
3736                                 return -1;
3737                         }
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);
3741                                 return -1;
3742                         }
3743                         object->force = test_var;
3744                 } else if (PyInt_Check(value)) {
3745                         long test_var;
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);
3750                                 return -1;
3751                         }
3752                         object->force = test_var;
3753                 } else {
3754                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3755                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3756                         return -1;
3757                 }
3758         }
3759         return 0;
3760 }
3761
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 },
3766         { NULL }
3767 };
3768
3769 static PyObject *py_winsif_ScavengingRequest_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3770 {
3771         return pytalloc_new(struct winsif_ScavengingRequest, type);
3772 }
3773
3774
3775 static PyTypeObject winsif_ScavengingRequest_Type = {
3776         PyObject_HEAD_INIT(NULL) 0,
3777         .tp_name = "winsif.ScavengingRequest",
3778         .tp_getset = py_winsif_ScavengingRequest_getsetters,
3779         .tp_methods = NULL,
3780         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3781         .tp_basicsize = sizeof(pytalloc_Object),
3782         .tp_new = py_winsif_ScavengingRequest_new,
3783 };
3784
3785
3786 static bool pack_py_winsif_WinsRecordAction_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsRecordAction *r)
3787 {
3788         PyObject *py_record_action;
3789         const char *kwnames[] = {
3790                 "record_action", NULL
3791         };
3792
3793         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsRecordAction", discard_const_p(char *, kwnames), &py_record_action)) {
3794                 return false;
3795         }
3796
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;
3800         } else {
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) {
3804                         PyErr_NoMemory();
3805                         return false;
3806                 }
3807                 *r->in.record_action = (struct winsif_RecordAction *)pytalloc_get_ptr(py_record_action);
3808         }
3809         return true;
3810 }
3811
3812 static PyObject *unpack_py_winsif_WinsRecordAction_args_out(struct winsif_WinsRecordAction *r)
3813 {
3814         PyObject *result;
3815         PyObject *py_record_action;
3816         if (*r->out.record_action == NULL) {
3817                 py_record_action = Py_None;
3818                 Py_INCREF(py_record_action);
3819         } else {
3820                 py_record_action = pytalloc_reference_ex(&winsif_RecordAction_Type, *r->out.record_action, *r->out.record_action);
3821         }
3822         result = py_record_action;
3823         if (!W_ERROR_IS_OK(r->out.result)) {
3824                 PyErr_SetWERROR(r->out.result);
3825                 return NULL;
3826         }
3827
3828         return result;
3829 }
3830
3831 static bool pack_py_winsif_WinsStatus_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsStatus *r)
3832 {
3833         PyObject *py_cmd;
3834         PyObject *py_results;
3835         const char *kwnames[] = {
3836                 "cmd", "results", NULL
3837         };
3838
3839         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winsif_WinsStatus", discard_const_p(char *, kwnames), &py_cmd, &py_results)) {
3840                 return false;
3841         }
3842
3843         {
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) {
3849                                 return false;
3850                         }
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);
3854                                 return false;
3855                         }
3856                         r->in.cmd = test_var;
3857                 } else if (PyInt_Check(py_cmd)) {
3858                         long test_var;
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);
3863                                 return false;
3864                         }
3865                         r->in.cmd = test_var;
3866                 } else {
3867                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3868                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3869                         return false;
3870                 }
3871         }
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) {
3875                 PyErr_NoMemory();
3876                 return false;
3877         }
3878         r->in.results = (struct winsif_Results *)pytalloc_get_ptr(py_results);
3879         return true;
3880 }
3881
3882 static PyObject *unpack_py_winsif_WinsStatus_args_out(struct winsif_WinsStatus *r)
3883 {
3884         PyObject *result;
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);
3890                 return NULL;
3891         }
3892
3893         return result;
3894 }
3895
3896 static bool pack_py_winsif_WinsTrigger_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsTrigger *r)
3897 {
3898         PyObject *py_owner_address;
3899         PyObject *py_trigger_type;
3900         const char *kwnames[] = {
3901                 "owner_address", "trigger_type", NULL
3902         };
3903
3904         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winsif_WinsTrigger", discard_const_p(char *, kwnames), &py_owner_address, &py_trigger_type)) {
3905                 return false;
3906         }
3907
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) {
3911                 PyErr_NoMemory();
3912                 return false;
3913         }
3914         r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
3915         {
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) {
3921                                 return false;
3922                         }
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);
3926                                 return false;
3927                         }
3928                         r->in.trigger_type = test_var;
3929                 } else if (PyInt_Check(py_trigger_type)) {
3930                         long test_var;
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);
3935                                 return false;
3936                         }
3937                         r->in.trigger_type = test_var;
3938                 } else {
3939                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3940                           PyInt_Type.tp_name, PyLong_Type.tp_name);
3941                         return false;
3942                 }
3943         }
3944         return true;
3945 }
3946
3947 static PyObject *unpack_py_winsif_WinsTrigger_args_out(struct winsif_WinsTrigger *r)
3948 {
3949         PyObject *result;
3950         result = Py_None;
3951         Py_INCREF(result);
3952         if (!W_ERROR_IS_OK(r->out.result)) {
3953                 PyErr_SetWERROR(r->out.result);
3954                 return NULL;
3955         }
3956
3957         return result;
3958 }
3959
3960 static bool pack_py_winsif_WinsDoStaticInit_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDoStaticInit *r)
3961 {
3962         PyObject *py_data_file_path;
3963         PyObject *py_delete_file;
3964         const char *kwnames[] = {
3965                 "data_file_path", "delete_file", NULL
3966         };
3967
3968         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winsif_WinsDoStaticInit", discard_const_p(char *, kwnames), &py_data_file_path, &py_delete_file)) {
3969                 return false;
3970         }
3971
3972         if (py_data_file_path == Py_None) {
3973                 r->in.data_file_path = NULL;
3974         } else {
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);
3980                 } else {
3981                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_data_file_path)->tp_name);
3982                         return false;
3983                 }
3984         }
3985         {
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) {
3991                                 return false;
3992                         }
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);
3996                                 return false;
3997                         }
3998                         r->in.delete_file = test_var;
3999                 } else if (PyInt_Check(py_delete_file)) {
4000                         long test_var;
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);
4005                                 return false;
4006                         }
4007                         r->in.delete_file = test_var;
4008                 } else {
4009                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4010                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4011                         return false;
4012                 }
4013         }
4014         return true;
4015 }
4016
4017 static PyObject *unpack_py_winsif_WinsDoStaticInit_args_out(struct winsif_WinsDoStaticInit *r)
4018 {
4019         PyObject *result;
4020         result = Py_None;
4021         Py_INCREF(result);
4022         if (!W_ERROR_IS_OK(r->out.result)) {
4023                 PyErr_SetWERROR(r->out.result);
4024                 return NULL;
4025         }
4026
4027         return result;
4028 }
4029
4030 static bool pack_py_winsif_WinsDoScavenging_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDoScavenging *r)
4031 {
4032         const char *kwnames[] = {
4033                 NULL
4034         };
4035
4036         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":winsif_WinsDoScavenging", discard_const_p(char *, kwnames))) {
4037                 return false;
4038         }
4039
4040         return true;
4041 }
4042
4043 static PyObject *unpack_py_winsif_WinsDoScavenging_args_out(struct winsif_WinsDoScavenging *r)
4044 {
4045         PyObject *result;
4046         result = Py_None;
4047         Py_INCREF(result);
4048         if (!W_ERROR_IS_OK(r->out.result)) {
4049                 PyErr_SetWERROR(r->out.result);
4050                 return NULL;
4051         }
4052
4053         return result;
4054 }
4055
4056 static bool pack_py_winsif_WinsGetDbRecs_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetDbRecs *r)
4057 {
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
4063         };
4064
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)) {
4066                 return false;
4067         }
4068
4069         if (py_owner_address == Py_None) {
4070                 r->in.owner_address = NULL;
4071         } else {
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) {
4075                         PyErr_NoMemory();
4076                         return false;
4077                 }
4078                 r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4079         }
4080         {
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) {
4086                                 return false;
4087                         }
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);
4091                                 return false;
4092                         }
4093                         r->in.min_version_number = test_var;
4094                 } else if (PyInt_Check(py_min_version_number)) {
4095                         long test_var;
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);
4100                                 return false;
4101                         }
4102                         r->in.min_version_number = test_var;
4103                 } else {
4104                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4105                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4106                         return false;
4107                 }
4108         }
4109         {
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) {
4115                                 return false;
4116                         }
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);
4120                                 return false;
4121                         }
4122                         r->in.max_version_number = test_var;
4123                 } else if (PyInt_Check(py_max_version_number)) {
4124                         long test_var;
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);
4129                                 return false;
4130                         }
4131                         r->in.max_version_number = test_var;
4132                 } else {
4133                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4134                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4135                         return false;
4136                 }
4137         }
4138         return true;
4139 }
4140
4141 static PyObject *unpack_py_winsif_WinsGetDbRecs_args_out(struct winsif_WinsGetDbRecs *r)
4142 {
4143         PyObject *result;
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);
4149                 return NULL;
4150         }
4151
4152         return result;
4153 }
4154
4155 static bool pack_py_winsif_WinsTerm_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsTerm *r)
4156 {
4157         PyObject *py_abrupt_termination;
4158         const char *kwnames[] = {
4159                 "abrupt_termination", NULL
4160         };
4161
4162         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsTerm", discard_const_p(char *, kwnames), &py_abrupt_termination)) {
4163                 return false;
4164         }
4165
4166         {
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) {
4172                                 return false;
4173                         }
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);
4177                                 return false;
4178                         }
4179                         r->in.abrupt_termination = test_var;
4180                 } else if (PyInt_Check(py_abrupt_termination)) {
4181                         long test_var;
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);
4186                                 return false;
4187                         }
4188                         r->in.abrupt_termination = test_var;
4189                 } else {
4190                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4191                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4192                         return false;
4193                 }
4194         }
4195         return true;
4196 }
4197
4198 static PyObject *unpack_py_winsif_WinsTerm_args_out(struct winsif_WinsTerm *r)
4199 {
4200         PyObject *result;
4201         result = Py_None;
4202         Py_INCREF(result);
4203         if (!W_ERROR_IS_OK(r->out.result)) {
4204                 PyErr_SetWERROR(r->out.result);
4205                 return NULL;
4206         }
4207
4208         return result;
4209 }
4210
4211 static bool pack_py_winsif_WinsBackup_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsBackup *r)
4212 {
4213         PyObject *py_backup_path;
4214         PyObject *py_incremental;
4215         const char *kwnames[] = {
4216                 "backup_path", "incremental", NULL
4217         };
4218
4219         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:winsif_WinsBackup", discard_const_p(char *, kwnames), &py_backup_path, &py_incremental)) {
4220                 return false;
4221         }
4222
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);
4228         } else {
4229                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_backup_path)->tp_name);
4230                 return false;
4231         }
4232         {
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) {
4238                                 return false;
4239                         }
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);
4243                                 return false;
4244                         }
4245                         r->in.incremental = test_var;
4246                 } else if (PyInt_Check(py_incremental)) {
4247                         long test_var;
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);
4252                                 return false;
4253                         }
4254                         r->in.incremental = test_var;
4255                 } else {
4256                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4257                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4258                         return false;
4259                 }
4260         }
4261         return true;
4262 }
4263
4264 static PyObject *unpack_py_winsif_WinsBackup_args_out(struct winsif_WinsBackup *r)
4265 {
4266         PyObject *result;
4267         result = Py_None;
4268         Py_INCREF(result);
4269         if (!W_ERROR_IS_OK(r->out.result)) {
4270                 PyErr_SetWERROR(r->out.result);
4271                 return NULL;
4272         }
4273
4274         return result;
4275 }
4276
4277 static bool pack_py_winsif_WinsDelDbRecs_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDelDbRecs *r)
4278 {
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
4284         };
4285
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)) {
4287                 return false;
4288         }
4289
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) {
4293                 PyErr_NoMemory();
4294                 return false;
4295         }
4296         r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4297         {
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) {
4303                                 return false;
4304                         }
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);
4308                                 return false;
4309                         }
4310                         r->in.min_version_number = test_var;
4311                 } else if (PyInt_Check(py_min_version_number)) {
4312                         long test_var;
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);
4317                                 return false;
4318                         }
4319                         r->in.min_version_number = test_var;
4320                 } else {
4321                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4322                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4323                         return false;
4324                 }
4325         }
4326         {
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) {
4332                                 return false;
4333                         }
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);
4337                                 return false;
4338                         }
4339                         r->in.max_version_number = test_var;
4340                 } else if (PyInt_Check(py_max_version_number)) {
4341                         long test_var;
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);
4346                                 return false;
4347                         }
4348                         r->in.max_version_number = test_var;
4349                 } else {
4350                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4351                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4352                         return false;
4353                 }
4354         }
4355         return true;
4356 }
4357
4358 static PyObject *unpack_py_winsif_WinsDelDbRecs_args_out(struct winsif_WinsDelDbRecs *r)
4359 {
4360         PyObject *result;
4361         result = Py_None;
4362         Py_INCREF(result);
4363         if (!W_ERROR_IS_OK(r->out.result)) {
4364                 PyErr_SetWERROR(r->out.result);
4365                 return NULL;
4366         }
4367
4368         return result;
4369 }
4370
4371 static bool pack_py_winsif_WinsPullRange_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsPullRange *r)
4372 {
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
4379         };
4380
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)) {
4382                 return false;
4383         }
4384
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) {
4388                 PyErr_NoMemory();
4389                 return false;
4390         }
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) {
4395                 PyErr_NoMemory();
4396                 return false;
4397         }
4398         r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4399         {
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) {
4405                                 return false;
4406                         }
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);
4410                                 return false;
4411                         }
4412                         r->in.min_version_number = test_var;
4413                 } else if (PyInt_Check(py_min_version_number)) {
4414                         long test_var;
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);
4419                                 return false;
4420                         }
4421                         r->in.min_version_number = test_var;
4422                 } else {
4423                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4424                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4425                         return false;
4426                 }
4427         }
4428         {
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) {
4434                                 return false;
4435                         }
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);
4439                                 return false;
4440                         }
4441                         r->in.max_version_number = test_var;
4442                 } else if (PyInt_Check(py_max_version_number)) {
4443                         long test_var;
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);
4448                                 return false;
4449                         }
4450                         r->in.max_version_number = test_var;
4451                 } else {
4452                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4453                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4454                         return false;
4455                 }
4456         }
4457         return true;
4458 }
4459
4460 static PyObject *unpack_py_winsif_WinsPullRange_args_out(struct winsif_WinsPullRange *r)
4461 {
4462         PyObject *result;
4463         result = Py_None;
4464         Py_INCREF(result);
4465         if (!W_ERROR_IS_OK(r->out.result)) {
4466                 PyErr_SetWERROR(r->out.result);
4467                 return NULL;
4468         }
4469
4470         return result;
4471 }
4472
4473 static bool pack_py_winsif_WinsSetPriorityClass_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsSetPriorityClass *r)
4474 {
4475         PyObject *py_prioritiy_class;
4476         const char *kwnames[] = {
4477                 "prioritiy_class", NULL
4478         };
4479
4480         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsSetPriorityClass", discard_const_p(char *, kwnames), &py_prioritiy_class)) {
4481                 return false;
4482         }
4483
4484         {
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) {
4490                                 return false;
4491                         }
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);
4495                                 return false;
4496                         }
4497                         r->in.prioritiy_class = test_var;
4498                 } else if (PyInt_Check(py_prioritiy_class)) {
4499                         long test_var;
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);
4504                                 return false;
4505                         }
4506                         r->in.prioritiy_class = test_var;
4507                 } else {
4508                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4509                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4510                         return false;
4511                 }
4512         }
4513         return true;
4514 }
4515
4516 static PyObject *unpack_py_winsif_WinsSetPriorityClass_args_out(struct winsif_WinsSetPriorityClass *r)
4517 {
4518         PyObject *result;
4519         result = Py_None;
4520         Py_INCREF(result);
4521         if (!W_ERROR_IS_OK(r->out.result)) {
4522                 PyErr_SetWERROR(r->out.result);
4523                 return NULL;
4524         }
4525
4526         return result;
4527 }
4528
4529 static bool pack_py_winsif_WinsResetCounters_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsResetCounters *r)
4530 {
4531         const char *kwnames[] = {
4532                 NULL
4533         };
4534
4535         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":winsif_WinsResetCounters", discard_const_p(char *, kwnames))) {
4536                 return false;
4537         }
4538
4539         return true;
4540 }
4541
4542 static PyObject *unpack_py_winsif_WinsResetCounters_args_out(struct winsif_WinsResetCounters *r)
4543 {
4544         PyObject *result;
4545         result = Py_None;
4546         Py_INCREF(result);
4547         if (!W_ERROR_IS_OK(r->out.result)) {
4548                 PyErr_SetWERROR(r->out.result);
4549                 return NULL;
4550         }
4551
4552         return result;
4553 }
4554
4555 static bool pack_py_winsif_WinsWorkerThreadUpdate_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsWorkerThreadUpdate *r)
4556 {
4557         PyObject *py_num_of_threads;
4558         const char *kwnames[] = {
4559                 "num_of_threads", NULL
4560         };
4561
4562         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsWorkerThreadUpdate", discard_const_p(char *, kwnames), &py_num_of_threads)) {
4563                 return false;
4564         }
4565
4566         {
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) {
4572                                 return false;
4573                         }
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);
4577                                 return false;
4578                         }
4579                         r->in.num_of_threads = test_var;
4580                 } else if (PyInt_Check(py_num_of_threads)) {
4581                         long test_var;
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);
4586                                 return false;
4587                         }
4588                         r->in.num_of_threads = test_var;
4589                 } else {
4590                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4591                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4592                         return false;
4593                 }
4594         }
4595         return true;
4596 }
4597
4598 static PyObject *unpack_py_winsif_WinsWorkerThreadUpdate_args_out(struct winsif_WinsWorkerThreadUpdate *r)
4599 {
4600         PyObject *result;
4601         result = Py_None;
4602         Py_INCREF(result);
4603         if (!W_ERROR_IS_OK(r->out.result)) {
4604                 PyErr_SetWERROR(r->out.result);
4605                 return NULL;
4606         }
4607
4608         return result;
4609 }
4610
4611 static bool pack_py_winsif_WinsGetNameAndAdd_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetNameAndAdd *r)
4612 {
4613         const char *kwnames[] = {
4614                 NULL
4615         };
4616
4617         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":winsif_WinsGetNameAndAdd", discard_const_p(char *, kwnames))) {
4618                 return false;
4619         }
4620
4621         return true;
4622 }
4623
4624 static PyObject *unpack_py_winsif_WinsGetNameAndAdd_args_out(struct winsif_WinsGetNameAndAdd *r)
4625 {
4626         PyObject *result;
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);
4635         } else {
4636                 py_unc_name = PyUnicode_Decode(r->out.unc_name, strlen(r->out.unc_name), "utf-8", "ignore");
4637         }
4638         PyTuple_SetItem(result, 1, py_unc_name);
4639         if (!W_ERROR_IS_OK(r->out.result)) {
4640                 PyErr_SetWERROR(r->out.result);
4641                 return NULL;
4642         }
4643
4644         return result;
4645 }
4646
4647 static bool pack_py_winsif_WinsGetBrowserNames_Old_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetBrowserNames_Old *r)
4648 {
4649         const char *kwnames[] = {
4650                 NULL
4651         };
4652
4653         if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":winsif_WinsGetBrowserNames_Old", discard_const_p(char *, kwnames))) {
4654                 return false;
4655         }
4656
4657         return true;
4658 }
4659
4660 static PyObject *unpack_py_winsif_WinsGetBrowserNames_Old_args_out(struct winsif_WinsGetBrowserNames_Old *r)
4661 {
4662         PyObject *result;
4663         PyObject *py_names;
4664         py_names = pytalloc_reference_ex(&winsif_BrowserNames_Type, r->out.names, r->out.names);
4665         result = py_names;
4666         if (!W_ERROR_IS_OK(r->out.result)) {
4667                 PyErr_SetWERROR(r->out.result);
4668                 return NULL;
4669         }
4670
4671         return result;
4672 }
4673
4674 static bool pack_py_winsif_WinsDeleteWins_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDeleteWins *r)
4675 {
4676         PyObject *py_owner_address;
4677         const char *kwnames[] = {
4678                 "owner_address", NULL
4679         };
4680
4681         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsDeleteWins", discard_const_p(char *, kwnames), &py_owner_address)) {
4682                 return false;
4683         }
4684
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) {
4688                 PyErr_NoMemory();
4689                 return false;
4690         }
4691         r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4692         return true;
4693 }
4694
4695 static PyObject *unpack_py_winsif_WinsDeleteWins_args_out(struct winsif_WinsDeleteWins *r)
4696 {
4697         PyObject *result;
4698         result = Py_None;
4699         Py_INCREF(result);
4700         if (!W_ERROR_IS_OK(r->out.result)) {
4701                 PyErr_SetWERROR(r->out.result);
4702                 return NULL;
4703         }
4704
4705         return result;
4706 }
4707
4708 static bool pack_py_winsif_WinsSetFlags_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsSetFlags *r)
4709 {
4710         PyObject *py_flags;
4711         const char *kwnames[] = {
4712                 "flags", NULL
4713         };
4714
4715         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsSetFlags", discard_const_p(char *, kwnames), &py_flags)) {
4716                 return false;
4717         }
4718
4719         {
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) {
4725                                 return false;
4726                         }
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);
4730                                 return false;
4731                         }
4732                         r->in.flags = test_var;
4733                 } else if (PyInt_Check(py_flags)) {
4734                         long test_var;
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);
4739                                 return false;
4740                         }
4741                         r->in.flags = test_var;
4742                 } else {
4743                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4744                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4745                         return false;
4746                 }
4747         }
4748         return true;
4749 }
4750
4751 static PyObject *unpack_py_winsif_WinsSetFlags_args_out(struct winsif_WinsSetFlags *r)
4752 {
4753         PyObject *result;
4754         result = Py_None;
4755         Py_INCREF(result);
4756         if (!W_ERROR_IS_OK(r->out.result)) {
4757                 PyErr_SetWERROR(r->out.result);
4758                 return NULL;
4759         }
4760
4761         return result;
4762 }
4763
4764 static bool pack_py_winsif_WinsGetBrowserNames_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetBrowserNames *r)
4765 {
4766         PyObject *py_server_handle;
4767         const char *kwnames[] = {
4768                 "server_handle", NULL
4769         };
4770
4771         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsGetBrowserNames", discard_const_p(char *, kwnames), &py_server_handle)) {
4772                 return false;
4773         }
4774
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) {
4778                 PyErr_NoMemory();
4779                 return false;
4780         }
4781         r->in.server_handle = (struct winsif_BindData *)pytalloc_get_ptr(py_server_handle);
4782         return true;
4783 }
4784
4785 static PyObject *unpack_py_winsif_WinsGetBrowserNames_args_out(struct winsif_WinsGetBrowserNames *r)
4786 {
4787         PyObject *result;
4788         PyObject *py_names;
4789         py_names = pytalloc_reference_ex(&winsif_BrowserNames_Type, r->out.names, r->out.names);
4790         result = py_names;
4791         if (!W_ERROR_IS_OK(r->out.result)) {
4792                 PyErr_SetWERROR(r->out.result);
4793                 return NULL;
4794         }
4795
4796         return result;
4797 }
4798
4799 static bool pack_py_winsif_WinsGetDbRecsByName_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsGetDbRecsByName *r)
4800 {
4801         PyObject *py_owner_address;
4802         PyObject *py_search_backward;
4803         PyObject *py_name;
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
4809         };
4810
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)) {
4812                 return false;
4813         }
4814
4815         if (py_owner_address == Py_None) {
4816                 r->in.owner_address = NULL;
4817         } else {
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) {
4821                         PyErr_NoMemory();
4822                         return false;
4823                 }
4824                 r->in.owner_address = (struct winsif_Address *)pytalloc_get_ptr(py_owner_address);
4825         }
4826         {
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) {
4832                                 return false;
4833                         }
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);
4837                                 return false;
4838                         }
4839                         r->in.search_backward = test_var;
4840                 } else if (PyInt_Check(py_search_backward)) {
4841                         long test_var;
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);
4846                                 return false;
4847                         }
4848                         r->in.search_backward = test_var;
4849                 } else {
4850                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4851                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4852                         return false;
4853                 }
4854         }
4855         if (py_name == Py_None) {
4856                 r->in.name = NULL;
4857         } else {
4858                 r->in.name = NULL;
4859                 r->in.name = talloc_strdup(r, PyString_AS_STRING(py_name));
4860         }
4861         {
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) {
4867                                 return false;
4868                         }
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);
4872                                 return false;
4873                         }
4874                         r->in.name_len = test_var;
4875                 } else if (PyInt_Check(py_name_len)) {
4876                         long test_var;
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);
4881                                 return false;
4882                         }
4883                         r->in.name_len = test_var;
4884                 } else {
4885                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4886                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4887                         return false;
4888                 }
4889         }
4890         {
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) {
4896                                 return false;
4897                         }
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);
4901                                 return false;
4902                         }
4903                         r->in.num_records_desired = test_var;
4904                 } else if (PyInt_Check(py_num_records_desired)) {
4905                         long test_var;
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);
4910                                 return false;
4911                         }
4912                         r->in.num_records_desired = test_var;
4913                 } else {
4914                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4915                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4916                         return false;
4917                 }
4918         }
4919         {
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) {
4925                                 return false;
4926                         }
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);
4930                                 return false;
4931                         }
4932                         r->in.only_statics = test_var;
4933                 } else if (PyInt_Check(py_only_statics)) {
4934                         long test_var;
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);
4939                                 return false;
4940                         }
4941                         r->in.only_statics = test_var;
4942                 } else {
4943                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4944                           PyInt_Type.tp_name, PyLong_Type.tp_name);
4945                         return false;
4946                 }
4947         }
4948         return true;
4949 }
4950
4951 static PyObject *unpack_py_winsif_WinsGetDbRecsByName_args_out(struct winsif_WinsGetDbRecsByName *r)
4952 {
4953         PyObject *result;
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);
4959                 return NULL;
4960         }
4961
4962         return result;
4963 }
4964
4965 static bool pack_py_winsif_WinsStatusNew_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsStatusNew *r)
4966 {
4967         PyObject *py_cmd;
4968         const char *kwnames[] = {
4969                 "cmd", NULL
4970         };
4971
4972         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsStatusNew", discard_const_p(char *, kwnames), &py_cmd)) {
4973                 return false;
4974         }
4975
4976         {
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) {
4982                                 return false;
4983                         }
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);
4987                                 return false;
4988                         }
4989                         r->in.cmd = test_var;
4990                 } else if (PyInt_Check(py_cmd)) {
4991                         long test_var;
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);
4996                                 return false;
4997                         }
4998                         r->in.cmd = test_var;
4999                 } else {
5000                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5001                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5002                         return false;
5003                 }
5004         }
5005         return true;
5006 }
5007
5008 static PyObject *unpack_py_winsif_WinsStatusNew_args_out(struct winsif_WinsStatusNew *r)
5009 {
5010         PyObject *result;
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);
5016                 return NULL;
5017         }
5018
5019         return result;
5020 }
5021
5022 static bool pack_py_winsif_WinsStatusWHdl_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsStatusWHdl *r)
5023 {
5024         PyObject *py_server_handle;
5025         PyObject *py_cmd;
5026         PyObject *py_results;
5027         const char *kwnames[] = {
5028                 "server_handle", "cmd", "results", NULL
5029         };
5030
5031         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:winsif_WinsStatusWHdl", discard_const_p(char *, kwnames), &py_server_handle, &py_cmd, &py_results)) {
5032                 return false;
5033         }
5034
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) {
5038                 PyErr_NoMemory();
5039                 return false;
5040         }
5041         r->in.server_handle = (struct winsif_BindData *)pytalloc_get_ptr(py_server_handle);
5042         {
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) {
5048                                 return false;
5049                         }
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);
5053                                 return false;
5054                         }
5055                         r->in.cmd = test_var;
5056                 } else if (PyInt_Check(py_cmd)) {
5057                         long test_var;
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);
5062                                 return false;
5063                         }
5064                         r->in.cmd = test_var;
5065                 } else {
5066                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5067                           PyInt_Type.tp_name, PyLong_Type.tp_name);
5068                         return false;
5069                 }
5070         }
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) {
5074                 PyErr_NoMemory();
5075                 return false;
5076         }
5077         r->in.results = (struct winsif_ResultsNew *)pytalloc_get_ptr(py_results);
5078         return true;
5079 }
5080
5081 static PyObject *unpack_py_winsif_WinsStatusWHdl_args_out(struct winsif_WinsStatusWHdl *r)
5082 {
5083         PyObject *result;
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);
5089                 return NULL;
5090         }
5091
5092         return result;
5093 }
5094
5095 static bool pack_py_winsif_WinsDoScanvengingNew_args_in(PyObject *args, PyObject *kwargs, struct winsif_WinsDoScanvengingNew *r)
5096 {
5097         PyObject *py_request;
5098         const char *kwnames[] = {
5099                 "request", NULL
5100         };
5101
5102         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:winsif_WinsDoScanvengingNew", discard_const_p(char *, kwnames), &py_request)) {
5103                 return false;
5104         }
5105
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) {
5109                 PyErr_NoMemory();
5110                 return false;
5111         }
5112         r->in.request = (struct winsif_ScavengingRequest *)pytalloc_get_ptr(py_request);
5113         return true;
5114 }
5115
5116 static PyObject *unpack_py_winsif_WinsDoScanvengingNew_args_out(struct winsif_WinsDoScanvengingNew *r)
5117 {
5118         PyObject *result;
5119         result = Py_None;
5120         Py_INCREF(result);
5121         if (!W_ERROR_IS_OK(r->out.result)) {
5122                 PyErr_SetWERROR(r->out.result);
5123                 return NULL;
5124         }
5125
5126         return result;
5127 }
5128
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 },
5152         { NULL }
5153 };
5154
5155 static PyObject *interface_winsif_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5156 {
5157         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_winsif);
5158 }
5159
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"
5166 "\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,
5172 };
5173
5174 static PyObject *syntax_winsif_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5175 {
5176         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_winsif.syntax_id);
5177 }
5178
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,
5187 };
5188
5189 static PyMethodDef winsif_methods[] = {
5190         { NULL, NULL, 0, NULL }
5191 };
5192
5193 void initwinsif(void)
5194 {
5195         PyObject *m;
5196         PyObject *dep_samba_dcerpc_nbt;
5197         PyObject *dep_talloc;
5198         PyObject *dep_samba_dcerpc_base;
5199         PyObject *dep_samba_dcerpc_misc;
5200
5201         dep_samba_dcerpc_nbt = PyImport_ImportModule("samba.dcerpc.nbt");
5202         if (dep_samba_dcerpc_nbt == NULL)
5203                 return;
5204
5205         dep_talloc = PyImport_ImportModule("talloc");
5206         if (dep_talloc == NULL)
5207                 return;
5208
5209         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
5210         if (dep_samba_dcerpc_base == NULL)
5211                 return;
5212
5213         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
5214         if (dep_samba_dcerpc_misc == NULL)
5215                 return;
5216
5217         Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
5218         if (Object_Type == NULL)
5219                 return;
5220
5221         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
5222         if (ClientConnection_Type == NULL)
5223                 return;
5224
5225         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
5226         if (ndr_syntax_id_Type == NULL)
5227                 return;
5228
5229         winsif_Address_Type.tp_base = Object_Type;
5230
5231         winsif_RecordAction_Type.tp_base = Object_Type;
5232
5233         winsif_AddressVersionMap_Type.tp_base = Object_Type;
5234
5235         winsif_ReplCounter_Type.tp_base = Object_Type;
5236
5237         winsif_StatCounters_Type.tp_base = Object_Type;
5238
5239         winsif_StatTimeStamps_Type.tp_base = Object_Type;
5240
5241         winsif_Stat_Type.tp_base = Object_Type;
5242
5243         winsif_Results_Type.tp_base = Object_Type;
5244
5245         winsif_Records_Type.tp_base = Object_Type;
5246
5247         winsif_BrowserInfo_Type.tp_base = Object_Type;
5248
5249         winsif_BrowserNames_Type.tp_base = Object_Type;
5250
5251         winsif_BindData_Type.tp_base = Object_Type;
5252
5253         winsif_ResultsNew_Type.tp_base = Object_Type;
5254
5255         winsif_ScavengingRequest_Type.tp_base = Object_Type;
5256
5257         winsif_InterfaceType.tp_base = ClientConnection_Type;
5258
5259         winsif_SyntaxType.tp_base = ndr_syntax_id_Type;
5260
5261         if (PyType_Ready(&winsif_Address_Type) < 0)
5262                 return;
5263         if (PyType_Ready(&winsif_RecordAction_Type) < 0)
5264                 return;
5265         if (PyType_Ready(&winsif_AddressVersionMap_Type) < 0)
5266                 return;
5267         if (PyType_Ready(&winsif_ReplCounter_Type) < 0)
5268                 return;
5269         if (PyType_Ready(&winsif_StatCounters_Type) < 0)
5270                 return;
5271         if (PyType_Ready(&winsif_StatTimeStamps_Type) < 0)
5272                 return;
5273         if (PyType_Ready(&winsif_Stat_Type) < 0)
5274                 return;
5275         if (PyType_Ready(&winsif_Results_Type) < 0)
5276                 return;
5277         if (PyType_Ready(&winsif_Records_Type) < 0)
5278                 return;
5279         if (PyType_Ready(&winsif_BrowserInfo_Type) < 0)
5280                 return;
5281         if (PyType_Ready(&winsif_BrowserNames_Type) < 0)
5282                 return;
5283         if (PyType_Ready(&winsif_BindData_Type) < 0)
5284                 return;
5285         if (PyType_Ready(&winsif_ResultsNew_Type) < 0)
5286                 return;
5287         if (PyType_Ready(&winsif_ScavengingRequest_Type) < 0)
5288                 return;
5289         if (PyType_Ready(&winsif_InterfaceType) < 0)
5290                 return;
5291         if (PyType_Ready(&winsif_SyntaxType) < 0)
5292                 return;
5293         if (!PyInterface_AddNdrRpcMethods(&winsif_InterfaceType, py_ndr_winsif_methods))
5294                 return;
5295
5296 #ifdef PY_ADDRESS_PATCH
5297         PY_ADDRESS_PATCH(&winsif_Address_Type);
5298 #endif
5299 #ifdef PY_RECORDACTION_PATCH
5300         PY_RECORDACTION_PATCH(&winsif_RecordAction_Type);
5301 #endif
5302 #ifdef PY_ADDRESSVERSIONMAP_PATCH
5303         PY_ADDRESSVERSIONMAP_PATCH(&winsif_AddressVersionMap_Type);
5304 #endif
5305 #ifdef PY_REPLCOUNTER_PATCH
5306         PY_REPLCOUNTER_PATCH(&winsif_ReplCounter_Type);
5307 #endif
5308 #ifdef PY_STATCOUNTERS_PATCH
5309         PY_STATCOUNTERS_PATCH(&winsif_StatCounters_Type);
5310 #endif
5311 #ifdef PY_STATTIMESTAMPS_PATCH
5312         PY_STATTIMESTAMPS_PATCH(&winsif_StatTimeStamps_Type);
5313 #endif
5314 #ifdef PY_STAT_PATCH
5315         PY_STAT_PATCH(&winsif_Stat_Type);
5316 #endif
5317 #ifdef PY_RESULTS_PATCH
5318         PY_RESULTS_PATCH(&winsif_Results_Type);
5319 #endif
5320 #ifdef PY_RECORDS_PATCH
5321         PY_RECORDS_PATCH(&winsif_Records_Type);
5322 #endif
5323 #ifdef PY_BROWSERINFO_PATCH
5324         PY_BROWSERINFO_PATCH(&winsif_BrowserInfo_Type);
5325 #endif
5326 #ifdef PY_BROWSERNAMES_PATCH
5327         PY_BROWSERNAMES_PATCH(&winsif_BrowserNames_Type);
5328 #endif
5329 #ifdef PY_BINDDATA_PATCH
5330         PY_BINDDATA_PATCH(&winsif_BindData_Type);
5331 #endif
5332 #ifdef PY_RESULTSNEW_PATCH
5333         PY_RESULTSNEW_PATCH(&winsif_ResultsNew_Type);
5334 #endif
5335 #ifdef PY_SCAVENGINGREQUEST_PATCH
5336         PY_SCAVENGINGREQUEST_PATCH(&winsif_ScavengingRequest_Type);
5337 #endif
5338 #ifdef PY_WINSIF_PATCH
5339         PY_WINSIF_PATCH(&winsif_InterfaceType);
5340 #endif
5341 #ifdef PY_ABSTRACT_SYNTAX_PATCH
5342         PY_ABSTRACT_SYNTAX_PATCH(&winsif_SyntaxType);
5343 #endif
5344
5345         m = Py_InitModule3("winsif", winsif_methods, "winsif DCE/RPC");
5346         if (m == NULL)
5347                 return;
5348
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);
5410 #endif
5411
5412 }