/* Python wrapper functions auto-generated by pidl */
+#define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
#include <Python.h>
#include "includes.h"
#include <pytalloc.h>
#include "bin/default/librpc/gen_ndr/ndr_witness.h"
#include "bin/default/librpc/gen_ndr/ndr_witness_c.h"
-#include "librpc/gen_ndr/misc.h"
-staticforward PyTypeObject witness_interfaceInfo_Type;
-staticforward PyTypeObject witness_interfaceList_Type;
-staticforward PyTypeObject witness_notifyResponse_Type;
-staticforward PyTypeObject witness_InterfaceType;
+/*
+ * These functions are here to ensure they can be optimized out by
+ * the compiler based on the constant input values
+ */
+
+static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
+{
+ switch (var_size) {
+ case 8:
+ return UINT64_MAX;
+ case 4:
+ return UINT32_MAX;
+ case 2:
+ return UINT16_MAX;
+ case 1:
+ return UINT8_MAX;
+ }
-void initwitness(void);static PyTypeObject *Object_Type;
+ return 0;
+}
+
+static inline long long ndr_sizeof2intmax(size_t var_size)
+{
+ switch (var_size) {
+ case 8:
+ return INT64_MAX;
+ case 4:
+ return INT32_MAX;
+ case 2:
+ return INT16_MAX;
+ case 1:
+ return INT8_MAX;
+ }
+
+ return 0;
+}
+
+static inline PyObject *ndr_PyLong_FromLongLong(long long v)
+{
+ if (v > LONG_MAX || v < LONG_MIN) {
+ return PyLong_FromLongLong(v);
+ } else {
+ return PyInt_FromLong(v);
+ }
+}
+
+static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)
+{
+ if (v > LONG_MAX) {
+ return PyLong_FromUnsignedLongLong(v);
+ } else {
+ return PyInt_FromLong(v);
+ }
+}
+
+#include "librpc/gen_ndr/misc.h"
+static PyTypeObject witness_interfaceInfo_Type;
+static PyTypeObject witness_interfaceList_Type;
+static PyTypeObject witness_ResourceChange_Type;
+static PyTypeObject witness_IPaddrInfo_Type;
+static PyTypeObject witness_IPaddrInfoList_Type;
+PyObject *py_import_witness_notifyResponse_message(TALLOC_CTX *mem_ctx, int level, union witness_notifyResponse_message *in);
+union witness_notifyResponse_message *py_export_witness_notifyResponse_message(TALLOC_CTX *mem_ctx, int level, PyObject *in);
+static PyTypeObject witness_notifyResponse_Type;
+static PyTypeObject witness_InterfaceType;
+
+void initwitness(void);static PyTypeObject *BaseObject_Type;
static PyTypeObject *policy_handle_Type;
static PyTypeObject *ClientConnection_Type;
static PyTypeObject *ndr_syntax_id_Type;
static int py_witness_interfaceInfo_set_group_name(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
- if (PyUnicode_Check(value)) {
- object->group_name = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
- } else if (PyString_Check(value)) {
- object->group_name = PyString_AS_STRING(value);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->group_name");
return -1;
}
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(value)) {
+ unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(value)) {
+ test_str = PyString_AS_STRING(value);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->group_name = talloc_str;
+ }
return 0;
}
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
PyObject *py_version;
- py_version = PyInt_FromLong(object->version);
+ py_version = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->version);
return py_version;
}
static int py_witness_interfaceInfo_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
- if (PyLong_Check(value)) {
- object->version = PyLong_AsLongLong(value);
- } else if (PyInt_Check(value)) {
- object->version = PyInt_AsLong(value);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
- PyInt_Type.tp_name, PyLong_Type.tp_name);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
return -1;
}
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->version = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->version = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
return 0;
}
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
PyObject *py_state;
- py_state = PyInt_FromLong(object->state);
+ py_state = PyInt_FromLong((uint16_t)object->state);
return py_state;
}
static int py_witness_interfaceInfo_set_state(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
- if (PyLong_Check(value)) {
- object->state = PyLong_AsLongLong(value);
- } else if (PyInt_Check(value)) {
- object->state = PyInt_AsLong(value);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
- PyInt_Type.tp_name, PyLong_Type.tp_name);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->state");
return -1;
}
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->state));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->state = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->state = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
return 0;
}
static int py_witness_interfaceInfo_set_ipv4(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
- object->ipv4 = PyString_AS_STRING(value);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ipv4");
+ return -1;
+ }
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(value)) {
+ unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(value)) {
+ test_str = PyString_AS_STRING(value);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->ipv4 = talloc_str;
+ }
return 0;
}
static int py_witness_interfaceInfo_set_ipv6(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
- object->ipv6 = PyString_AsString(value);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ipv6");
+ return -1;
+ }
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(value)) {
+ unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(value)) {
+ test_str = PyString_AS_STRING(value);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->ipv6 = talloc_str;
+ }
return 0;
}
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(obj);
PyObject *py_flags;
- py_flags = PyInt_FromLong(object->flags);
+ py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
return py_flags;
}
static int py_witness_interfaceInfo_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_interfaceInfo *object = (struct witness_interfaceInfo *)pytalloc_get_ptr(py_obj);
- if (PyLong_Check(value)) {
- object->flags = PyLong_AsLongLong(value);
- } else if (PyInt_Check(value)) {
- object->flags = PyInt_AsLong(value);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
- PyInt_Type.tp_name, PyLong_Type.tp_name);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
return -1;
}
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->flags = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->flags = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
return 0;
}
static PyGetSetDef py_witness_interfaceInfo_getsetters[] = {
- { discard_const_p(char, "group_name"), py_witness_interfaceInfo_get_group_name, py_witness_interfaceInfo_set_group_name },
- { discard_const_p(char, "version"), py_witness_interfaceInfo_get_version, py_witness_interfaceInfo_set_version },
- { discard_const_p(char, "state"), py_witness_interfaceInfo_get_state, py_witness_interfaceInfo_set_state },
- { discard_const_p(char, "ipv4"), py_witness_interfaceInfo_get_ipv4, py_witness_interfaceInfo_set_ipv4 },
- { discard_const_p(char, "ipv6"), py_witness_interfaceInfo_get_ipv6, py_witness_interfaceInfo_set_ipv6 },
- { discard_const_p(char, "flags"), py_witness_interfaceInfo_get_flags, py_witness_interfaceInfo_set_flags },
- { NULL }
+ {
+ .name = discard_const_p(char, "group_name"),
+ .get = py_witness_interfaceInfo_get_group_name,
+ .set = py_witness_interfaceInfo_set_group_name,
+ .doc = discard_const_p(char, "PIDL-generated element group_name")
+ },
+ {
+ .name = discard_const_p(char, "version"),
+ .get = py_witness_interfaceInfo_get_version,
+ .set = py_witness_interfaceInfo_set_version,
+ .doc = discard_const_p(char, "PIDL-generated element version")
+ },
+ {
+ .name = discard_const_p(char, "state"),
+ .get = py_witness_interfaceInfo_get_state,
+ .set = py_witness_interfaceInfo_set_state,
+ .doc = discard_const_p(char, "PIDL-generated element state")
+ },
+ {
+ .name = discard_const_p(char, "ipv4"),
+ .get = py_witness_interfaceInfo_get_ipv4,
+ .set = py_witness_interfaceInfo_set_ipv4,
+ .doc = discard_const_p(char, "PIDL-generated element ipv4")
+ },
+ {
+ .name = discard_const_p(char, "ipv6"),
+ .get = py_witness_interfaceInfo_get_ipv6,
+ .set = py_witness_interfaceInfo_set_ipv6,
+ .doc = discard_const_p(char, "PIDL-generated element ipv6")
+ },
+ {
+ .name = discard_const_p(char, "flags"),
+ .get = py_witness_interfaceInfo_get_flags,
+ .set = py_witness_interfaceInfo_set_flags,
+ .doc = discard_const_p(char, "PIDL-generated element flags")
+ },
+ { .name = NULL }
};
static PyObject *py_witness_interfaceInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
.tp_getset = py_witness_interfaceInfo_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_witness_interfaceInfo_new,
};
{
struct witness_interfaceList *object = (struct witness_interfaceList *)pytalloc_get_ptr(obj);
PyObject *py_num_interfaces;
- py_num_interfaces = PyInt_FromLong(object->num_interfaces);
+ py_num_interfaces = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num_interfaces);
return py_num_interfaces;
}
static int py_witness_interfaceList_set_num_interfaces(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_interfaceList *object = (struct witness_interfaceList *)pytalloc_get_ptr(py_obj);
- PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
- object->num_interfaces = PyInt_AsLong(value);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_interfaces");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_interfaces));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->num_interfaces = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->num_interfaces = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
return 0;
}
}
{
int interfaces_cntr_1;
- for (interfaces_cntr_1 = 0; interfaces_cntr_1 < object->num_interfaces; interfaces_cntr_1++) {
+ for (interfaces_cntr_1 = 0; interfaces_cntr_1 < (object->num_interfaces); interfaces_cntr_1++) {
PyObject *py_interfaces_1;
py_interfaces_1 = pytalloc_reference_ex(&witness_interfaceInfo_Type, object->interfaces, &object->interfaces[interfaces_cntr_1]);
PyList_SetItem(py_interfaces, interfaces_cntr_1, py_interfaces_1);
}
}
}
- return py_interfaces;
+ return py_interfaces;
+}
+
+static int py_witness_interfaceList_set_interfaces(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_interfaceList *object = (struct witness_interfaceList *)pytalloc_get_ptr(py_obj);
+ talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->interfaces));
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->interfaces");
+ return -1;
+ }
+ if (value == Py_None) {
+ object->interfaces = NULL;
+ } else {
+ object->interfaces = NULL;
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *object->interfaces");
+ return -1;
+ }
+ PY_CHECK_TYPE(&PyList_Type, value, return -1;);
+ {
+ int interfaces_cntr_1;
+ object->interfaces = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->interfaces, PyList_GET_SIZE(value));
+ if (!object->interfaces) { return -1;; }
+ talloc_set_name_const(object->interfaces, "ARRAY: object->interfaces");
+ for (interfaces_cntr_1 = 0; interfaces_cntr_1 < PyList_GET_SIZE(value); interfaces_cntr_1++) {
+ if (PyList_GET_ITEM(value, interfaces_cntr_1) == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->interfaces[interfaces_cntr_1]");
+ return -1;
+ }
+ PY_CHECK_TYPE(&witness_interfaceInfo_Type, PyList_GET_ITEM(value, interfaces_cntr_1), return -1;);
+ if (talloc_reference(object->interfaces, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, interfaces_cntr_1))) == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->interfaces[interfaces_cntr_1] = *(struct witness_interfaceInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, interfaces_cntr_1));
+ }
+ }
+ }
+ return 0;
+}
+
+static PyGetSetDef py_witness_interfaceList_getsetters[] = {
+ {
+ .name = discard_const_p(char, "num_interfaces"),
+ .get = py_witness_interfaceList_get_num_interfaces,
+ .set = py_witness_interfaceList_set_num_interfaces,
+ .doc = discard_const_p(char, "PIDL-generated element num_interfaces")
+ },
+ {
+ .name = discard_const_p(char, "interfaces"),
+ .get = py_witness_interfaceList_get_interfaces,
+ .set = py_witness_interfaceList_set_interfaces,
+ .doc = discard_const_p(char, "PIDL-generated element interfaces")
+ },
+ { .name = NULL }
+};
+
+static PyObject *py_witness_interfaceList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct witness_interfaceList, type);
+}
+
+
+static PyTypeObject witness_interfaceList_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "witness.interfaceList",
+ .tp_getset = py_witness_interfaceList_getsetters,
+ .tp_methods = NULL,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_new = py_witness_interfaceList_new,
+};
+
+
+static PyObject *py_witness_ResourceChange_get_length(PyObject *obj, void *closure)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(obj);
+ PyObject *py_length;
+ py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
+ return py_length;
+}
+
+static int py_witness_ResourceChange_set_length(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->length = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->length = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static PyObject *py_witness_ResourceChange_get_type(PyObject *obj, void *closure)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(obj);
+ PyObject *py_type;
+ py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type);
+ return py_type;
+}
+
+static int py_witness_ResourceChange_set_type(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->type = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->type = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static PyObject *py_witness_ResourceChange_get_name(PyObject *obj, void *closure)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(obj);
+ PyObject *py_name;
+ py_name = PyString_FromStringOrNULL(object->name);
+ return py_name;
+}
+
+static int py_witness_ResourceChange_set_name(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
+ return -1;
+ }
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(value)) {
+ unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(value)) {
+ test_str = PyString_AS_STRING(value);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->name = talloc_str;
+ }
+ return 0;
+}
+
+static PyGetSetDef py_witness_ResourceChange_getsetters[] = {
+ {
+ .name = discard_const_p(char, "length"),
+ .get = py_witness_ResourceChange_get_length,
+ .set = py_witness_ResourceChange_set_length,
+ .doc = discard_const_p(char, "PIDL-generated element length")
+ },
+ {
+ .name = discard_const_p(char, "type"),
+ .get = py_witness_ResourceChange_get_type,
+ .set = py_witness_ResourceChange_set_type,
+ .doc = discard_const_p(char, "PIDL-generated element type")
+ },
+ {
+ .name = discard_const_p(char, "name"),
+ .get = py_witness_ResourceChange_get_name,
+ .set = py_witness_ResourceChange_set_name,
+ .doc = discard_const_p(char, "PIDL-generated element name")
+ },
+ { .name = NULL }
+};
+
+static PyObject *py_witness_ResourceChange_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct witness_ResourceChange, type);
+}
+
+static PyObject *py_witness_ResourceChange_ndr_pack(PyObject *py_obj)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
+ PyObject *ret = NULL;
+ DATA_BLOB blob;
+ enum ndr_err_code err;
+ TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
+ if (tmp_ctx == NULL) {
+ PyErr_SetNdrError(NDR_ERR_ALLOC);
+ return NULL;
+ }
+ err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_witness_ResourceChange);
+ if (err != NDR_ERR_SUCCESS) {
+ TALLOC_FREE(tmp_ctx);
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ ret = PyString_FromStringAndSize((char *)blob.data, blob.length);
+ TALLOC_FREE(tmp_ctx);
+ return ret;
+}
+
+static PyObject *py_witness_ResourceChange_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ Py_ssize_t blob_length = 0;
+ enum ndr_err_code err;
+ const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
+ PyObject *allow_remaining_obj = NULL;
+ bool allow_remaining = false;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
+ discard_const_p(char *, kwnames),
+ &blob.data, &blob_length,
+ &allow_remaining_obj)) {
+ return NULL;
+ }
+ blob.length = blob_length;
+
+ if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
+ allow_remaining = true;
+ }
+
+ if (allow_remaining) {
+ err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_witness_ResourceChange);
+ } else {
+ err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_witness_ResourceChange);
+ }
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_witness_ResourceChange_ndr_print(PyObject *py_obj)
+{
+ struct witness_ResourceChange *object = (struct witness_ResourceChange *)pytalloc_get_ptr(py_obj);
+ PyObject *ret;
+ char *retstr;
+
+ retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_witness_ResourceChange, "witness_ResourceChange", object);
+ ret = PyString_FromString(retstr);
+ talloc_free(retstr);
+
+ return ret;
+}
+
+static PyMethodDef py_witness_ResourceChange_methods[] = {
+ { "__ndr_pack__", (PyCFunction)py_witness_ResourceChange_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
+ { "__ndr_unpack__", (PyCFunction)py_witness_ResourceChange_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
+ { "__ndr_print__", (PyCFunction)py_witness_ResourceChange_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
+ { NULL, NULL, 0, NULL }
+};
+
+
+static PyTypeObject witness_ResourceChange_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "witness.ResourceChange",
+ .tp_getset = py_witness_ResourceChange_getsetters,
+ .tp_methods = py_witness_ResourceChange_methods,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_new = py_witness_ResourceChange_new,
+};
+
+
+static PyObject *py_witness_IPaddrInfo_get_flags(PyObject *obj, void *closure)
+{
+ struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(obj);
+ PyObject *py_flags;
+ py_flags = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->flags);
+ return py_flags;
+}
+
+static int py_witness_IPaddrInfo_set_flags(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->flags = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->flags = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static PyObject *py_witness_IPaddrInfo_get_ipv4(PyObject *obj, void *closure)
+{
+ struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(obj);
+ PyObject *py_ipv4;
+ py_ipv4 = PyString_FromStringOrNULL(object->ipv4);
+ return py_ipv4;
+}
+
+static int py_witness_IPaddrInfo_set_ipv4(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ipv4");
+ return -1;
+ }
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(value)) {
+ unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(value)) {
+ test_str = PyString_AS_STRING(value);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->ipv4 = talloc_str;
+ }
+ return 0;
+}
+
+static PyObject *py_witness_IPaddrInfo_get_ipv6(PyObject *obj, void *closure)
+{
+ struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(obj);
+ PyObject *py_ipv6;
+ py_ipv6 = PyString_FromStringOrNULL(object->ipv6);
+ return py_ipv6;
+}
+
+static int py_witness_IPaddrInfo_set_ipv6(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_IPaddrInfo *object = (struct witness_IPaddrInfo *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ipv6");
+ return -1;
+ }
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(value)) {
+ unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(value)) {
+ test_str = PyString_AS_STRING(value);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->ipv6 = talloc_str;
+ }
+ return 0;
+}
+
+static PyGetSetDef py_witness_IPaddrInfo_getsetters[] = {
+ {
+ .name = discard_const_p(char, "flags"),
+ .get = py_witness_IPaddrInfo_get_flags,
+ .set = py_witness_IPaddrInfo_set_flags,
+ .doc = discard_const_p(char, "PIDL-generated element flags")
+ },
+ {
+ .name = discard_const_p(char, "ipv4"),
+ .get = py_witness_IPaddrInfo_get_ipv4,
+ .set = py_witness_IPaddrInfo_set_ipv4,
+ .doc = discard_const_p(char, "PIDL-generated element ipv4")
+ },
+ {
+ .name = discard_const_p(char, "ipv6"),
+ .get = py_witness_IPaddrInfo_get_ipv6,
+ .set = py_witness_IPaddrInfo_set_ipv6,
+ .doc = discard_const_p(char, "PIDL-generated element ipv6")
+ },
+ { .name = NULL }
+};
+
+static PyObject *py_witness_IPaddrInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct witness_IPaddrInfo, type);
+}
+
+
+static PyTypeObject witness_IPaddrInfo_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "witness.IPaddrInfo",
+ .tp_getset = py_witness_IPaddrInfo_getsetters,
+ .tp_methods = NULL,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_new = py_witness_IPaddrInfo_new,
+};
+
+
+static PyObject *py_witness_IPaddrInfoList_get_length(PyObject *obj, void *closure)
+{
+ struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(obj);
+ PyObject *py_length;
+ py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
+ return py_length;
+}
+
+static int py_witness_IPaddrInfoList_set_length(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->length = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->length = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static PyObject *py_witness_IPaddrInfoList_get_reserved(PyObject *obj, void *closure)
+{
+ struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(obj);
+ PyObject *py_reserved;
+ py_reserved = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->reserved);
+ return py_reserved;
+}
+
+static int py_witness_IPaddrInfoList_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->reserved = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->reserved = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static PyObject *py_witness_IPaddrInfoList_get_num(PyObject *obj, void *closure)
+{
+ struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(obj);
+ PyObject *py_num;
+ py_num = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num);
+ return py_num;
+}
+
+static int py_witness_IPaddrInfoList_set_num(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->num = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->num = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
+ return 0;
}
-static int py_witness_interfaceList_set_interfaces(PyObject *py_obj, PyObject *value, void *closure)
+static PyObject *py_witness_IPaddrInfoList_get_addr(PyObject *obj, void *closure)
{
- struct witness_interfaceList *object = (struct witness_interfaceList *)pytalloc_get_ptr(py_obj);
- talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->interfaces);
- if (value == Py_None) {
- object->interfaces = NULL;
- } else {
- object->interfaces = NULL;
- PY_CHECK_TYPE(&PyList_Type, value, return -1;);
- {
- int interfaces_cntr_1;
- object->interfaces = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->interfaces, PyList_GET_SIZE(value));
- if (!object->interfaces) { return -1;; }
- talloc_set_name_const(object->interfaces, "ARRAY: object->interfaces");
- for (interfaces_cntr_1 = 0; interfaces_cntr_1 < PyList_GET_SIZE(value); interfaces_cntr_1++) {
- PY_CHECK_TYPE(&witness_interfaceInfo_Type, PyList_GET_ITEM(value, interfaces_cntr_1), return -1;);
- if (talloc_reference(object->interfaces, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, interfaces_cntr_1))) == NULL) {
- PyErr_NoMemory();
- return -1;
- }
- object->interfaces[interfaces_cntr_1] = *(struct witness_interfaceInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, interfaces_cntr_1));
+ struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(obj);
+ PyObject *py_addr;
+ py_addr = PyList_New(object->num);
+ if (py_addr == NULL) {
+ return NULL;
+ }
+ {
+ int addr_cntr_0;
+ for (addr_cntr_0 = 0; addr_cntr_0 < (object->num); addr_cntr_0++) {
+ PyObject *py_addr_0;
+ py_addr_0 = pytalloc_reference_ex(&witness_IPaddrInfo_Type, object->addr, &object->addr[addr_cntr_0]);
+ PyList_SetItem(py_addr, addr_cntr_0, py_addr_0);
+ }
+ }
+ return py_addr;
+}
+
+static int py_witness_IPaddrInfoList_set_addr(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct witness_IPaddrInfoList *object = (struct witness_IPaddrInfoList *)pytalloc_get_ptr(py_obj);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addr");
+ return -1;
+ }
+ PY_CHECK_TYPE(&PyList_Type, value, return -1;);
+ {
+ int addr_cntr_0;
+ object->addr = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->addr, PyList_GET_SIZE(value));
+ if (!object->addr) { return -1;; }
+ talloc_set_name_const(object->addr, "ARRAY: object->addr");
+ for (addr_cntr_0 = 0; addr_cntr_0 < PyList_GET_SIZE(value); addr_cntr_0++) {
+ if (PyList_GET_ITEM(value, addr_cntr_0) == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->addr[addr_cntr_0]");
+ return -1;
}
+ PY_CHECK_TYPE(&witness_IPaddrInfo_Type, PyList_GET_ITEM(value, addr_cntr_0), return -1;);
+ if (talloc_reference(object->addr, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, addr_cntr_0))) == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->addr[addr_cntr_0] = *(struct witness_IPaddrInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, addr_cntr_0));
}
}
return 0;
}
-static PyGetSetDef py_witness_interfaceList_getsetters[] = {
- { discard_const_p(char, "num_interfaces"), py_witness_interfaceList_get_num_interfaces, py_witness_interfaceList_set_num_interfaces },
- { discard_const_p(char, "interfaces"), py_witness_interfaceList_get_interfaces, py_witness_interfaceList_set_interfaces },
- { NULL }
+static PyGetSetDef py_witness_IPaddrInfoList_getsetters[] = {
+ {
+ .name = discard_const_p(char, "length"),
+ .get = py_witness_IPaddrInfoList_get_length,
+ .set = py_witness_IPaddrInfoList_set_length,
+ .doc = discard_const_p(char, "PIDL-generated element length")
+ },
+ {
+ .name = discard_const_p(char, "reserved"),
+ .get = py_witness_IPaddrInfoList_get_reserved,
+ .set = py_witness_IPaddrInfoList_set_reserved,
+ .doc = discard_const_p(char, "PIDL-generated element reserved")
+ },
+ {
+ .name = discard_const_p(char, "num"),
+ .get = py_witness_IPaddrInfoList_get_num,
+ .set = py_witness_IPaddrInfoList_set_num,
+ .doc = discard_const_p(char, "PIDL-generated element num")
+ },
+ {
+ .name = discard_const_p(char, "addr"),
+ .get = py_witness_IPaddrInfoList_get_addr,
+ .set = py_witness_IPaddrInfoList_set_addr,
+ .doc = discard_const_p(char, "PIDL-generated element addr")
+ },
+ { .name = NULL }
};
-static PyObject *py_witness_interfaceList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+static PyObject *py_witness_IPaddrInfoList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- return pytalloc_new(struct witness_interfaceList, type);
+ return pytalloc_new(struct witness_IPaddrInfoList, type);
}
-static PyTypeObject witness_interfaceList_Type = {
+static PyTypeObject witness_IPaddrInfoList_Type = {
PyObject_HEAD_INIT(NULL) 0,
- .tp_name = "witness.interfaceList",
- .tp_getset = py_witness_interfaceList_getsetters,
+ .tp_name = "witness.IPaddrInfoList",
+ .tp_getset = py_witness_IPaddrInfoList_getsetters,
.tp_methods = NULL,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
- .tp_new = py_witness_interfaceList_new,
+ .tp_new = py_witness_IPaddrInfoList_new,
};
+PyObject *py_import_witness_notifyResponse_message(TALLOC_CTX *mem_ctx, int level, union witness_notifyResponse_message *in)
+{
+ PyObject *ret;
+
+ switch (level) {
+ case WITNESS_NOTIFY_RESOURCE_CHANGE:
+ ret = pytalloc_reference_ex(&witness_ResourceChange_Type, mem_ctx, &in->resource_change);
+ return ret;
+
+ case WITNESS_NOTIFY_CLIENT_MOVE:
+ ret = pytalloc_reference_ex(&witness_IPaddrInfoList_Type, mem_ctx, &in->client_move);
+ return ret;
+
+ case WITNESS_NOTIFY_SHARE_MOVE:
+ ret = pytalloc_reference_ex(&witness_IPaddrInfoList_Type, mem_ctx, &in->share_move);
+ return ret;
+
+ case WITNESS_NOTIFY_IP_CHANGE:
+ ret = pytalloc_reference_ex(&witness_IPaddrInfoList_Type, mem_ctx, &in->ip_change);
+ return ret;
+
+ default:
+ ret = PyString_FromStringAndSize((char *)(in->data).data, (in->data).length);
+ return ret;
+
+ }
+ PyErr_SetString(PyExc_TypeError, "unknown union level");
+ return NULL;
+}
+
+union witness_notifyResponse_message *py_export_witness_notifyResponse_message(TALLOC_CTX *mem_ctx, int level, PyObject *in)
+{
+ union witness_notifyResponse_message *ret = talloc_zero(mem_ctx, union witness_notifyResponse_message);
+ switch (level) {
+ case WITNESS_NOTIFY_RESOURCE_CHANGE:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->resource_change");
+ talloc_free(ret); return NULL;
+ }
+ PY_CHECK_TYPE(&witness_ResourceChange_Type, in, talloc_free(ret); return NULL;);
+ if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
+ PyErr_NoMemory();
+ talloc_free(ret); return NULL;
+ }
+ ret->resource_change = *(struct witness_ResourceChange *)pytalloc_get_ptr(in);
+ break;
+
+ case WITNESS_NOTIFY_CLIENT_MOVE:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->client_move");
+ talloc_free(ret); return NULL;
+ }
+ PY_CHECK_TYPE(&witness_IPaddrInfoList_Type, in, talloc_free(ret); return NULL;);
+ if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
+ PyErr_NoMemory();
+ talloc_free(ret); return NULL;
+ }
+ ret->client_move = *(struct witness_IPaddrInfoList *)pytalloc_get_ptr(in);
+ break;
+
+ case WITNESS_NOTIFY_SHARE_MOVE:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->share_move");
+ talloc_free(ret); return NULL;
+ }
+ PY_CHECK_TYPE(&witness_IPaddrInfoList_Type, in, talloc_free(ret); return NULL;);
+ if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
+ PyErr_NoMemory();
+ talloc_free(ret); return NULL;
+ }
+ ret->share_move = *(struct witness_IPaddrInfoList *)pytalloc_get_ptr(in);
+ break;
+
+ case WITNESS_NOTIFY_IP_CHANGE:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ip_change");
+ talloc_free(ret); return NULL;
+ }
+ PY_CHECK_TYPE(&witness_IPaddrInfoList_Type, in, talloc_free(ret); return NULL;);
+ if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
+ PyErr_NoMemory();
+ talloc_free(ret); return NULL;
+ }
+ ret->ip_change = *(struct witness_IPaddrInfoList *)pytalloc_get_ptr(in);
+ break;
+
+ default:
+ if (in == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->data");
+ talloc_free(ret); return NULL;
+ }
+ ret->data = data_blob_talloc(mem_ctx, PyString_AS_STRING(in), PyString_GET_SIZE(in));
+ break;
+
+ }
+
+ return ret;
+}
+
-static PyObject *py_witness_notifyResponse_get_message_type(PyObject *obj, void *closure)
+static PyObject *py_witness_notifyResponse_get_type(PyObject *obj, void *closure)
{
struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(obj);
- PyObject *py_message_type;
- py_message_type = PyInt_FromLong(object->message_type);
- return py_message_type;
+ PyObject *py_type;
+ py_type = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->type);
+ return py_type;
}
-static int py_witness_notifyResponse_set_message_type(PyObject *py_obj, PyObject *value, void *closure)
+static int py_witness_notifyResponse_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
- if (PyLong_Check(value)) {
- object->message_type = PyLong_AsLongLong(value);
- } else if (PyInt_Check(value)) {
- object->message_type = PyInt_AsLong(value);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
- PyInt_Type.tp_name, PyLong_Type.tp_name);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
return -1;
}
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->type = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->type = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
return 0;
}
{
struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(obj);
PyObject *py_length;
- py_length = PyInt_FromLong(object->length);
+ py_length = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->length);
return py_length;
}
static int py_witness_notifyResponse_set_length(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
- PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
- object->length = PyInt_AsLong(value);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->length = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->length = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
return 0;
}
-static PyObject *py_witness_notifyResponse_get_num_messages(PyObject *obj, void *closure)
+static PyObject *py_witness_notifyResponse_get_num(PyObject *obj, void *closure)
{
struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(obj);
- PyObject *py_num_messages;
- py_num_messages = PyInt_FromLong(object->num_messages);
- return py_num_messages;
+ PyObject *py_num;
+ py_num = ndr_PyLong_FromUnsignedLongLong((uint32_t)object->num);
+ return py_num;
}
-static int py_witness_notifyResponse_set_num_messages(PyObject *py_obj, PyObject *value, void *closure)
+static int py_witness_notifyResponse_set_num(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
- PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
- object->num_messages = PyInt_AsLong(value);
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num");
+ return -1;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num));
+ if (PyLong_Check(value)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(value);
+ if (PyErr_Occurred() != NULL) {
+ return -1;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->num = test_var;
+ } else if (PyInt_Check(value)) {
+ long test_var;
+ test_var = PyInt_AsLong(value);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return -1;
+ }
+ object->num = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return -1;
+ }
+ }
return 0;
}
-static PyObject *py_witness_notifyResponse_get_message_buffer(PyObject *obj, void *closure)
+static PyObject *py_witness_notifyResponse_get_messages(PyObject *obj, void *closure)
{
struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(obj);
- PyObject *py_message_buffer;
- if (object->message_buffer == NULL) {
- py_message_buffer = Py_None;
- Py_INCREF(py_message_buffer);
- } else {
- py_message_buffer = PyList_New(object->length);
- if (py_message_buffer == NULL) {
- return NULL;
- }
- {
- int message_buffer_cntr_1;
- for (message_buffer_cntr_1 = 0; message_buffer_cntr_1 < object->length; message_buffer_cntr_1++) {
- PyObject *py_message_buffer_1;
- py_message_buffer_1 = PyInt_FromLong(object->message_buffer[message_buffer_cntr_1]);
- PyList_SetItem(py_message_buffer, message_buffer_cntr_1, py_message_buffer_1);
+ PyObject *py_messages;
+ py_messages = PyList_New(object->num);
+ if (py_messages == NULL) {
+ return NULL;
+ }
+ {
+ int messages_cntr_0;
+ for (messages_cntr_0 = 0; messages_cntr_0 < (object->num); messages_cntr_0++) {
+ PyObject *py_messages_0;
+ py_messages_0 = py_import_witness_notifyResponse_message(object->messages, object->type, &object->messages[messages_cntr_0]);
+ if (py_messages_0 == NULL) {
+ return NULL;
}
+ PyList_SetItem(py_messages, messages_cntr_0, py_messages_0);
}
}
- return py_message_buffer;
+ return py_messages;
}
-static int py_witness_notifyResponse_set_message_buffer(PyObject *py_obj, PyObject *value, void *closure)
+static int py_witness_notifyResponse_set_messages(PyObject *py_obj, PyObject *value, void *closure)
{
struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
- talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->message_buffer);
- if (value == Py_None) {
- object->message_buffer = NULL;
- } else {
- object->message_buffer = NULL;
- PY_CHECK_TYPE(&PyList_Type, value, return -1;);
- {
- int message_buffer_cntr_1;
- object->message_buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->message_buffer, PyList_GET_SIZE(value));
- if (!object->message_buffer) { return -1;; }
- talloc_set_name_const(object->message_buffer, "ARRAY: object->message_buffer");
- for (message_buffer_cntr_1 = 0; message_buffer_cntr_1 < PyList_GET_SIZE(value); message_buffer_cntr_1++) {
- PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, message_buffer_cntr_1), return -1;);
- object->message_buffer[message_buffer_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, message_buffer_cntr_1));
+ if (value == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->messages");
+ return -1;
+ }
+ PY_CHECK_TYPE(&PyList_Type, value, return -1;);
+ {
+ int messages_cntr_0;
+ object->messages = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->messages, PyList_GET_SIZE(value));
+ if (!object->messages) { return -1;; }
+ talloc_set_name_const(object->messages, "ARRAY: object->messages");
+ for (messages_cntr_0 = 0; messages_cntr_0 < PyList_GET_SIZE(value); messages_cntr_0++) {
+ if (PyList_GET_ITEM(value, messages_cntr_0) == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->messages[messages_cntr_0]");
+ return -1;
+ }
+ {
+ union witness_notifyResponse_message *messages_switch_2;
+ messages_switch_2 = py_export_witness_notifyResponse_message(object->messages, object->type, PyList_GET_ITEM(value, messages_cntr_0));
+ if (messages_switch_2 == NULL) {
+ return -1;
+ }
+ object->messages[messages_cntr_0] = *messages_switch_2;
}
}
}
}
static PyGetSetDef py_witness_notifyResponse_getsetters[] = {
- { discard_const_p(char, "message_type"), py_witness_notifyResponse_get_message_type, py_witness_notifyResponse_set_message_type },
- { discard_const_p(char, "length"), py_witness_notifyResponse_get_length, py_witness_notifyResponse_set_length },
- { discard_const_p(char, "num_messages"), py_witness_notifyResponse_get_num_messages, py_witness_notifyResponse_set_num_messages },
- { discard_const_p(char, "message_buffer"), py_witness_notifyResponse_get_message_buffer, py_witness_notifyResponse_set_message_buffer },
- { NULL }
+ {
+ .name = discard_const_p(char, "type"),
+ .get = py_witness_notifyResponse_get_type,
+ .set = py_witness_notifyResponse_set_type,
+ .doc = discard_const_p(char, "PIDL-generated element type")
+ },
+ {
+ .name = discard_const_p(char, "length"),
+ .get = py_witness_notifyResponse_get_length,
+ .set = py_witness_notifyResponse_set_length,
+ .doc = discard_const_p(char, "PIDL-generated element length")
+ },
+ {
+ .name = discard_const_p(char, "num"),
+ .get = py_witness_notifyResponse_get_num,
+ .set = py_witness_notifyResponse_set_num,
+ .doc = discard_const_p(char, "PIDL-generated element num")
+ },
+ {
+ .name = discard_const_p(char, "messages"),
+ .get = py_witness_notifyResponse_get_messages,
+ .set = py_witness_notifyResponse_set_messages,
+ .doc = discard_const_p(char, "PIDL-generated element messages")
+ },
+ { .name = NULL }
};
static PyObject *py_witness_notifyResponse_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
return pytalloc_new(struct witness_notifyResponse, type);
}
+static PyObject *py_witness_notifyResponse_ndr_pack(PyObject *py_obj)
+{
+ struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
+ PyObject *ret = NULL;
+ DATA_BLOB blob;
+ enum ndr_err_code err;
+ TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
+ if (tmp_ctx == NULL) {
+ PyErr_SetNdrError(NDR_ERR_ALLOC);
+ return NULL;
+ }
+ err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_witness_notifyResponse);
+ if (err != NDR_ERR_SUCCESS) {
+ TALLOC_FREE(tmp_ctx);
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ ret = PyString_FromStringAndSize((char *)blob.data, blob.length);
+ TALLOC_FREE(tmp_ctx);
+ return ret;
+}
+
+static PyObject *py_witness_notifyResponse_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
+{
+ struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ Py_ssize_t blob_length = 0;
+ enum ndr_err_code err;
+ const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
+ PyObject *allow_remaining_obj = NULL;
+ bool allow_remaining = false;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
+ discard_const_p(char *, kwnames),
+ &blob.data, &blob_length,
+ &allow_remaining_obj)) {
+ return NULL;
+ }
+ blob.length = blob_length;
+
+ if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
+ allow_remaining = true;
+ }
+
+ if (allow_remaining) {
+ err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_witness_notifyResponse);
+ } else {
+ err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_witness_notifyResponse);
+ }
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_witness_notifyResponse_ndr_print(PyObject *py_obj)
+{
+ struct witness_notifyResponse *object = (struct witness_notifyResponse *)pytalloc_get_ptr(py_obj);
+ PyObject *ret;
+ char *retstr;
+
+ retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_witness_notifyResponse, "witness_notifyResponse", object);
+ ret = PyString_FromString(retstr);
+ talloc_free(retstr);
+
+ return ret;
+}
+
+static PyMethodDef py_witness_notifyResponse_methods[] = {
+ { "__ndr_pack__", (PyCFunction)py_witness_notifyResponse_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
+ { "__ndr_unpack__", (PyCFunction)py_witness_notifyResponse_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
+ { "__ndr_print__", (PyCFunction)py_witness_notifyResponse_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
+ { NULL, NULL, 0, NULL }
+};
+
static PyTypeObject witness_notifyResponse_Type = {
PyObject_HEAD_INIT(NULL) 0,
.tp_name = "witness.notifyResponse",
.tp_getset = py_witness_notifyResponse_getsetters,
- .tp_methods = NULL,
+ .tp_methods = py_witness_notifyResponse_methods,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_new = py_witness_notifyResponse_new,
};
return false;
}
- if (PyLong_Check(py_version)) {
- r->in.version = PyLong_AsLongLong(py_version);
- } else if (PyInt_Check(py_version)) {
- r->in.version = PyInt_AsLong(py_version);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
- PyInt_Type.tp_name, PyLong_Type.tp_name);
+ if (py_version == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.version");
+ return false;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.version));
+ if (PyLong_Check(py_version)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(py_version);
+ if (PyErr_Occurred() != NULL) {
+ return false;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return false;
+ }
+ r->in.version = test_var;
+ } else if (PyInt_Check(py_version)) {
+ long test_var;
+ test_var = PyInt_AsLong(py_version);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return false;
+ }
+ r->in.version = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return false;
+ }
+ }
+ if (py_net_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.net_name");
return false;
}
if (py_net_name == Py_None) {
r->in.net_name = NULL;
} else {
r->in.net_name = NULL;
- if (PyUnicode_Check(py_net_name)) {
- r->in.net_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_net_name, "utf-8", "ignore"));
- } else if (PyString_Check(py_net_name)) {
- r->in.net_name = PyString_AS_STRING(py_net_name);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_net_name)->tp_name);
+ if (py_net_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.net_name");
return false;
}
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(py_net_name)) {
+ unicode = PyUnicode_AsEncodedString(py_net_name, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(py_net_name)) {
+ test_str = PyString_AS_STRING(py_net_name);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_net_name)->tp_name);
+ return false;
+ }
+ talloc_str = talloc_strdup(r, test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.net_name = talloc_str;
+ }
+ }
+ if (py_ip_address == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ip_address");
+ return false;
}
if (py_ip_address == Py_None) {
r->in.ip_address = NULL;
} else {
r->in.ip_address = NULL;
- if (PyUnicode_Check(py_ip_address)) {
- r->in.ip_address = PyString_AS_STRING(PyUnicode_AsEncodedString(py_ip_address, "utf-8", "ignore"));
- } else if (PyString_Check(py_ip_address)) {
- r->in.ip_address = PyString_AS_STRING(py_ip_address);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ip_address)->tp_name);
+ if (py_ip_address == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.ip_address");
return false;
}
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(py_ip_address)) {
+ unicode = PyUnicode_AsEncodedString(py_ip_address, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(py_ip_address)) {
+ test_str = PyString_AS_STRING(py_ip_address);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ip_address)->tp_name);
+ return false;
+ }
+ talloc_str = talloc_strdup(r, test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.ip_address = talloc_str;
+ }
+ }
+ if (py_client_computer_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_computer_name");
+ return false;
}
if (py_client_computer_name == Py_None) {
r->in.client_computer_name = NULL;
} else {
r->in.client_computer_name = NULL;
- if (PyUnicode_Check(py_client_computer_name)) {
- r->in.client_computer_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_client_computer_name, "utf-8", "ignore"));
- } else if (PyString_Check(py_client_computer_name)) {
- r->in.client_computer_name = PyString_AS_STRING(py_client_computer_name);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_computer_name)->tp_name);
+ if (py_client_computer_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.client_computer_name");
return false;
}
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(py_client_computer_name)) {
+ unicode = PyUnicode_AsEncodedString(py_client_computer_name, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(py_client_computer_name)) {
+ test_str = PyString_AS_STRING(py_client_computer_name);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_computer_name)->tp_name);
+ return false;
+ }
+ talloc_str = talloc_strdup(r, test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.client_computer_name = talloc_str;
+ }
}
return true;
}
return false;
}
+ if (py_context_handle == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.context_handle");
+ return false;
+ }
PY_CHECK_TYPE(policy_handle_Type, py_context_handle, return false;);
if (talloc_reference(r, pytalloc_get_mem_ctx(py_context_handle)) == NULL) {
PyErr_NoMemory();
return false;
}
+ if (py_context_handle == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.context_handle");
+ return false;
+ }
PY_CHECK_TYPE(policy_handle_Type, py_context_handle, return false;);
if (talloc_reference(r, pytalloc_get_mem_ctx(py_context_handle)) == NULL) {
PyErr_NoMemory();
return false;
}
- if (PyLong_Check(py_version)) {
- r->in.version = PyLong_AsLongLong(py_version);
- } else if (PyInt_Check(py_version)) {
- r->in.version = PyInt_AsLong(py_version);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
- PyInt_Type.tp_name, PyLong_Type.tp_name);
+ if (py_version == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.version");
+ return false;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.version));
+ if (PyLong_Check(py_version)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(py_version);
+ if (PyErr_Occurred() != NULL) {
+ return false;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return false;
+ }
+ r->in.version = test_var;
+ } else if (PyInt_Check(py_version)) {
+ long test_var;
+ test_var = PyInt_AsLong(py_version);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return false;
+ }
+ r->in.version = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return false;
+ }
+ }
+ if (py_net_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.net_name");
return false;
}
if (py_net_name == Py_None) {
r->in.net_name = NULL;
} else {
r->in.net_name = NULL;
- if (PyUnicode_Check(py_net_name)) {
- r->in.net_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_net_name, "utf-8", "ignore"));
- } else if (PyString_Check(py_net_name)) {
- r->in.net_name = PyString_AS_STRING(py_net_name);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_net_name)->tp_name);
+ if (py_net_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.net_name");
return false;
}
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(py_net_name)) {
+ unicode = PyUnicode_AsEncodedString(py_net_name, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(py_net_name)) {
+ test_str = PyString_AS_STRING(py_net_name);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_net_name)->tp_name);
+ return false;
+ }
+ talloc_str = talloc_strdup(r, test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.net_name = talloc_str;
+ }
+ }
+ if (py_share_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.share_name");
+ return false;
}
if (py_share_name == Py_None) {
r->in.share_name = NULL;
} else {
r->in.share_name = NULL;
- if (PyUnicode_Check(py_share_name)) {
- r->in.share_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_share_name, "utf-8", "ignore"));
- } else if (PyString_Check(py_share_name)) {
- r->in.share_name = PyString_AS_STRING(py_share_name);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_name)->tp_name);
+ if (py_share_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.share_name");
return false;
}
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(py_share_name)) {
+ unicode = PyUnicode_AsEncodedString(py_share_name, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(py_share_name)) {
+ test_str = PyString_AS_STRING(py_share_name);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_share_name)->tp_name);
+ return false;
+ }
+ talloc_str = talloc_strdup(r, test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.share_name = talloc_str;
+ }
+ }
+ if (py_ip_address == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.ip_address");
+ return false;
}
if (py_ip_address == Py_None) {
r->in.ip_address = NULL;
} else {
r->in.ip_address = NULL;
- if (PyUnicode_Check(py_ip_address)) {
- r->in.ip_address = PyString_AS_STRING(PyUnicode_AsEncodedString(py_ip_address, "utf-8", "ignore"));
- } else if (PyString_Check(py_ip_address)) {
- r->in.ip_address = PyString_AS_STRING(py_ip_address);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ip_address)->tp_name);
+ if (py_ip_address == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.ip_address");
return false;
}
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(py_ip_address)) {
+ unicode = PyUnicode_AsEncodedString(py_ip_address, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(py_ip_address)) {
+ test_str = PyString_AS_STRING(py_ip_address);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_ip_address)->tp_name);
+ return false;
+ }
+ talloc_str = talloc_strdup(r, test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.ip_address = talloc_str;
+ }
+ }
+ if (py_client_computer_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_computer_name");
+ return false;
}
if (py_client_computer_name == Py_None) {
r->in.client_computer_name = NULL;
} else {
r->in.client_computer_name = NULL;
- if (PyUnicode_Check(py_client_computer_name)) {
- r->in.client_computer_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_client_computer_name, "utf-8", "ignore"));
- } else if (PyString_Check(py_client_computer_name)) {
- r->in.client_computer_name = PyString_AS_STRING(py_client_computer_name);
+ if (py_client_computer_name == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct *r->in.client_computer_name");
+ return false;
+ }
+ {
+ const char *test_str;
+ const char *talloc_str;
+ PyObject *unicode = NULL;
+ if (PyUnicode_Check(py_client_computer_name)) {
+ unicode = PyUnicode_AsEncodedString(py_client_computer_name, "utf-8", "ignore");
+ if (unicode == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ test_str = PyString_AS_STRING(unicode);
+ } else if (PyString_Check(py_client_computer_name)) {
+ test_str = PyString_AS_STRING(py_client_computer_name);
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_computer_name)->tp_name);
+ return false;
+ }
+ talloc_str = talloc_strdup(r, test_str);
+ if (unicode != NULL) {
+ Py_DECREF(unicode);
+ }
+ if (talloc_str == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.client_computer_name = talloc_str;
+ }
+ }
+ if (py_flags == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
+ return false;
+ }
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
+ if (PyLong_Check(py_flags)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(py_flags);
+ if (PyErr_Occurred() != NULL) {
+ return false;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return false;
+ }
+ r->in.flags = test_var;
+ } else if (PyInt_Check(py_flags)) {
+ long test_var;
+ test_var = PyInt_AsLong(py_flags);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return false;
+ }
+ r->in.flags = test_var;
} else {
- PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_client_computer_name)->tp_name);
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
return false;
}
}
- if (PyLong_Check(py_flags)) {
- r->in.flags = PyLong_AsLongLong(py_flags);
- } else if (PyInt_Check(py_flags)) {
- r->in.flags = PyInt_AsLong(py_flags);
- } else {
- PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
- PyInt_Type.tp_name, PyLong_Type.tp_name);
+ if (py_timeout == NULL) {
+ PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.timeout");
return false;
}
- PY_CHECK_TYPE(&PyInt_Type, py_timeout, return false;);
- r->in.timeout = PyInt_AsLong(py_timeout);
+ {
+ const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.timeout));
+ if (PyLong_Check(py_timeout)) {
+ unsigned long long test_var;
+ test_var = PyLong_AsUnsignedLongLong(py_timeout);
+ if (PyErr_Occurred() != NULL) {
+ return false;
+ }
+ if (test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %llu",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return false;
+ }
+ r->in.timeout = test_var;
+ } else if (PyInt_Check(py_timeout)) {
+ long test_var;
+ test_var = PyInt_AsLong(py_timeout);
+ if (test_var < 0 || test_var > uint_max) {
+ PyErr_Format(PyExc_OverflowError, "Expected type %s or %s within range 0 - %llu, got %ld",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);
+ return false;
+ }
+ r->in.timeout = test_var;
+ } else {
+ PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
+ PyInt_Type.tp_name, PyLong_Type.tp_name);
+ return false;
+ }
+ }
return true;
}
static PyTypeObject witness_SyntaxType = {
PyObject_HEAD_INIT(NULL) 0,
.tp_name = "witness.witness",
- .tp_basicsize = sizeof(pytalloc_Object),
.tp_doc = "abstract_syntax()\n"PY_DOC_WITNESS_SYNTAX,
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
.tp_new = syntax_witness_new,
if (dep_samba_dcerpc_base == NULL)
return;
- Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
- if (Object_Type == NULL)
+ BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
+ if (BaseObject_Type == NULL)
return;
policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
if (ndr_syntax_id_Type == NULL)
return;
- witness_interfaceInfo_Type.tp_base = Object_Type;
+ witness_interfaceInfo_Type.tp_base = BaseObject_Type;
+ witness_interfaceInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
+
+ witness_interfaceList_Type.tp_base = BaseObject_Type;
+ witness_interfaceList_Type.tp_basicsize = pytalloc_BaseObject_size();
- witness_interfaceList_Type.tp_base = Object_Type;
+ witness_ResourceChange_Type.tp_base = BaseObject_Type;
+ witness_ResourceChange_Type.tp_basicsize = pytalloc_BaseObject_size();
- witness_notifyResponse_Type.tp_base = Object_Type;
+ witness_IPaddrInfo_Type.tp_base = BaseObject_Type;
+ witness_IPaddrInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
+
+ witness_IPaddrInfoList_Type.tp_base = BaseObject_Type;
+ witness_IPaddrInfoList_Type.tp_basicsize = pytalloc_BaseObject_size();
+
+ witness_notifyResponse_Type.tp_base = BaseObject_Type;
+ witness_notifyResponse_Type.tp_basicsize = pytalloc_BaseObject_size();
witness_InterfaceType.tp_base = ClientConnection_Type;
witness_SyntaxType.tp_base = ndr_syntax_id_Type;
+ witness_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
if (PyType_Ready(&witness_interfaceInfo_Type) < 0)
return;
if (PyType_Ready(&witness_interfaceList_Type) < 0)
return;
+ if (PyType_Ready(&witness_ResourceChange_Type) < 0)
+ return;
+ if (PyType_Ready(&witness_IPaddrInfo_Type) < 0)
+ return;
+ if (PyType_Ready(&witness_IPaddrInfoList_Type) < 0)
+ return;
if (PyType_Ready(&witness_notifyResponse_Type) < 0)
return;
if (PyType_Ready(&witness_InterfaceType) < 0)
#ifdef PY_INTERFACELIST_PATCH
PY_INTERFACELIST_PATCH(&witness_interfaceList_Type);
#endif
+#ifdef PY_RESOURCECHANGE_PATCH
+ PY_RESOURCECHANGE_PATCH(&witness_ResourceChange_Type);
+#endif
+#ifdef PY_IPADDRINFO_PATCH
+ PY_IPADDRINFO_PATCH(&witness_IPaddrInfo_Type);
+#endif
+#ifdef PY_IPADDRINFOLIST_PATCH
+ PY_IPADDRINFOLIST_PATCH(&witness_IPaddrInfoList_Type);
+#endif
#ifdef PY_NOTIFYRESPONSE_PATCH
PY_NOTIFYRESPONSE_PATCH(&witness_notifyResponse_Type);
#endif
if (m == NULL)
return;
- PyModule_AddObject(m, "WITNESS_V1", PyInt_FromLong(WITNESS_V1));
- PyModule_AddObject(m, "WITNESS_V2", PyInt_FromLong(WITNESS_V2));
- PyModule_AddObject(m, "WITNESS_STATE_UNKNOWN", PyInt_FromLong(WITNESS_STATE_UNKNOWN));
- PyModule_AddObject(m, "WITNESS_STATE_AVAILABLE", PyInt_FromLong(WITNESS_STATE_AVAILABLE));
- PyModule_AddObject(m, "WITNESS_STATE_UNAVAILABLE", PyInt_FromLong(WITNESS_STATE_UNAVAILABLE));
- PyModule_AddObject(m, "WITNESS_INFO_IPv4_VALID", PyInt_FromLong(WITNESS_INFO_IPv4_VALID));
- PyModule_AddObject(m, "WITNESS_INFO_IPv6_VALID", PyInt_FromLong(WITNESS_INFO_IPv6_VALID));
- PyModule_AddObject(m, "WITNESS_INFO_WITNESS_IF", PyInt_FromLong(WITNESS_INFO_WITNESS_IF));
- PyModule_AddObject(m, "WITNESS_NOTIFY_RESOURCE_CHANGE", PyInt_FromLong(WITNESS_NOTIFY_RESOURCE_CHANGE));
- PyModule_AddObject(m, "WITNESS_NOTIFY_CLIENT_MOVE", PyInt_FromLong(WITNESS_NOTIFY_CLIENT_MOVE));
- PyModule_AddObject(m, "WITNESS_NOTIFY_SHARE_MOVE", PyInt_FromLong(WITNESS_NOTIFY_SHARE_MOVE));
- PyModule_AddObject(m, "WITNESS_NOTIFY_IP_CHANGE", PyInt_FromLong(WITNESS_NOTIFY_IP_CHANGE));
- PyModule_AddObject(m, "WITNESS_REGISTER_NONE", PyInt_FromLong(WITNESS_REGISTER_NONE));
- PyModule_AddObject(m, "WITNESS_REGISTER_IP_NOTIFICATION", PyInt_FromLong(WITNESS_REGISTER_IP_NOTIFICATION));
+ PyModule_AddObject(m, "WITNESS_V1", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_V1));
+ PyModule_AddObject(m, "WITNESS_V2", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_V2));
+ PyModule_AddObject(m, "WITNESS_UNSPECIFIED_VERSION", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_UNSPECIFIED_VERSION));
+ PyModule_AddObject(m, "WITNESS_STATE_UNKNOWN", PyInt_FromLong((uint16_t)WITNESS_STATE_UNKNOWN));
+ PyModule_AddObject(m, "WITNESS_STATE_AVAILABLE", PyInt_FromLong((uint16_t)WITNESS_STATE_AVAILABLE));
+ PyModule_AddObject(m, "WITNESS_STATE_UNAVAILABLE", PyInt_FromLong((uint16_t)WITNESS_STATE_UNAVAILABLE));
+ PyModule_AddObject(m, "WITNESS_INFO_IPv4_VALID", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_INFO_IPv4_VALID));
+ PyModule_AddObject(m, "WITNESS_INFO_IPv6_VALID", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_INFO_IPv6_VALID));
+ PyModule_AddObject(m, "WITNESS_INFO_WITNESS_IF", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_INFO_WITNESS_IF));
+ PyModule_AddObject(m, "WITNESS_NOTIFY_RESOURCE_CHANGE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_NOTIFY_RESOURCE_CHANGE));
+ PyModule_AddObject(m, "WITNESS_NOTIFY_CLIENT_MOVE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_NOTIFY_CLIENT_MOVE));
+ PyModule_AddObject(m, "WITNESS_NOTIFY_SHARE_MOVE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_NOTIFY_SHARE_MOVE));
+ PyModule_AddObject(m, "WITNESS_NOTIFY_IP_CHANGE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_NOTIFY_IP_CHANGE));
+ PyModule_AddObject(m, "WITNESS_RESOURCE_STATE_UNKNOWN", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_RESOURCE_STATE_UNKNOWN));
+ PyModule_AddObject(m, "WITNESS_RESOURCE_STATE_AVAILABLE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_RESOURCE_STATE_AVAILABLE));
+ PyModule_AddObject(m, "WITNESS_RESOURCE_STATE_UNAVAILABLE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_RESOURCE_STATE_UNAVAILABLE));
+ PyModule_AddObject(m, "WITNESS_IPADDR_V4", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_IPADDR_V4));
+ PyModule_AddObject(m, "WITNESS_IPADDR_V6", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_IPADDR_V6));
+ PyModule_AddObject(m, "WITNESS_IPADDR_ONLINE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_IPADDR_ONLINE));
+ PyModule_AddObject(m, "WITNESS_IPADDR_OFFLINE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_IPADDR_OFFLINE));
+ PyModule_AddObject(m, "WITNESS_REGISTER_NONE", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_REGISTER_NONE));
+ PyModule_AddObject(m, "WITNESS_REGISTER_IP_NOTIFICATION", ndr_PyLong_FromUnsignedLongLong((uint32_t)WITNESS_REGISTER_IP_NOTIFICATION));
Py_INCREF((PyObject *)(void *)&witness_interfaceInfo_Type);
PyModule_AddObject(m, "interfaceInfo", (PyObject *)(void *)&witness_interfaceInfo_Type);
Py_INCREF((PyObject *)(void *)&witness_interfaceList_Type);
PyModule_AddObject(m, "interfaceList", (PyObject *)(void *)&witness_interfaceList_Type);
+ Py_INCREF((PyObject *)(void *)&witness_ResourceChange_Type);
+ PyModule_AddObject(m, "ResourceChange", (PyObject *)(void *)&witness_ResourceChange_Type);
+ Py_INCREF((PyObject *)(void *)&witness_IPaddrInfo_Type);
+ PyModule_AddObject(m, "IPaddrInfo", (PyObject *)(void *)&witness_IPaddrInfo_Type);
+ Py_INCREF((PyObject *)(void *)&witness_IPaddrInfoList_Type);
+ PyModule_AddObject(m, "IPaddrInfoList", (PyObject *)(void *)&witness_IPaddrInfoList_Type);
Py_INCREF((PyObject *)(void *)&witness_notifyResponse_Type);
PyModule_AddObject(m, "notifyResponse", (PyObject *)(void *)&witness_notifyResponse_Type);
Py_INCREF((PyObject *)(void *)&witness_InterfaceType);