
/* Python wrapper functions auto-generated by pidl */
#include <Python.h>
#include "includes.h"
#include <pytalloc.h>
#include "librpc/rpc/pyrpc.h"
#include "librpc/rpc/pyrpc_util.h"
#include "autoconf/librpc/gen_ndr/ndr_dns.h"
#include "autoconf/librpc/gen_ndr/ndr_dns_c.h"

#include "librpc/gen_ndr/misc.h"
staticforward PyTypeObject dns_name_question_Type;
staticforward PyTypeObject dns_rdata_data_Type;
staticforward PyTypeObject dns_soa_record_Type;
staticforward PyTypeObject dns_mx_record_Type;
staticforward PyTypeObject dns_txt_record_Type;
staticforward PyTypeObject dns_srv_record_Type;
staticforward PyTypeObject dns_opt_record_Type;
staticforward PyTypeObject dns_tkey_record_Type;
staticforward PyTypeObject dns_tsig_record_Type;
staticforward PyTypeObject dns_fake_tsig_rec_Type;
staticforward PyTypeObject dns_res_rec_Type;
staticforward PyTypeObject dns_name_packet_Type;
staticforward PyTypeObject dns_InterfaceType;

void initdns(void);static PyTypeObject *Object_Type;
static PyTypeObject *ClientConnection_Type;

static PyObject *py_dns_name_question_get_name(PyObject *obj, void *closure)
{
	struct dns_name_question *object = (struct dns_name_question *)pytalloc_get_ptr(obj);
	PyObject *py_name;
	py_name = PyString_FromStringOrNULL(object->name);
	return py_name;
}

static int py_dns_name_question_set_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_question *object = (struct dns_name_question *)pytalloc_get_ptr(py_obj);
	object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyObject *py_dns_name_question_get_question_type(PyObject *obj, void *closure)
{
	struct dns_name_question *object = (struct dns_name_question *)pytalloc_get_ptr(obj);
	PyObject *py_question_type;
	py_question_type = PyInt_FromLong(object->question_type);
	return py_question_type;
}

static int py_dns_name_question_set_question_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_question *object = (struct dns_name_question *)pytalloc_get_ptr(py_obj);
	if (PyLong_Check(value)) {
		object->question_type = PyLong_AsLongLong(value);
	} else if (PyInt_Check(value)) {
		object->question_type = PyInt_AsLong(value);
	} 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_dns_name_question_get_question_class(PyObject *obj, void *closure)
{
	struct dns_name_question *object = (struct dns_name_question *)pytalloc_get_ptr(obj);
	PyObject *py_question_class;
	py_question_class = PyInt_FromLong(object->question_class);
	return py_question_class;
}

static int py_dns_name_question_set_question_class(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_question *object = (struct dns_name_question *)pytalloc_get_ptr(py_obj);
	if (PyLong_Check(value)) {
		object->question_class = PyLong_AsLongLong(value);
	} else if (PyInt_Check(value)) {
		object->question_class = PyInt_AsLong(value);
	} 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_dns_name_question_getsetters[] = {
	{ discard_const_p(char, "name"), py_dns_name_question_get_name, py_dns_name_question_set_name },
	{ discard_const_p(char, "question_type"), py_dns_name_question_get_question_type, py_dns_name_question_set_question_type },
	{ discard_const_p(char, "question_class"), py_dns_name_question_get_question_class, py_dns_name_question_set_question_class },
	{ NULL }
};

static PyObject *py_dns_name_question_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_name_question, type);
}

static PyObject *py_dns_name_question_ndr_pack(PyObject *py_obj)
{
	struct dns_name_question *object = (struct dns_name_question *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_name_question);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_name_question_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_name_question *object = (struct dns_name_question *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_name_question);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_name_question);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_name_question_ndr_print(PyObject *py_obj)
{
	struct dns_name_question *object = (struct dns_name_question *)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_dns_name_question, "dns_name_question", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_name_question_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_name_question_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_name_question_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_name_question_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_name_question_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.name_question",
	.tp_getset = py_dns_name_question_getsetters,
	.tp_methods = py_dns_name_question_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_name_question_new,
};


static PyObject *py_dns_rdata_data_get_length(PyObject *obj, void *closure)
{
	struct dns_rdata_data *object = (struct dns_rdata_data *)pytalloc_get_ptr(obj);
	PyObject *py_length;
	py_length = PyInt_FromLong(object->length);
	return py_length;
}

static int py_dns_rdata_data_set_length(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_rdata_data *object = (struct dns_rdata_data *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->length = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_rdata_data_get_data(PyObject *obj, void *closure)
{
	struct dns_rdata_data *object = (struct dns_rdata_data *)pytalloc_get_ptr(obj);
	PyObject *py_data;
	py_data = PyList_New(object->length);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_0;
		for (data_cntr_0 = 0; data_cntr_0 < object->length; data_cntr_0++) {
			PyObject *py_data_0;
			py_data_0 = PyInt_FromLong(object->data[data_cntr_0]);
			PyList_SetItem(py_data, data_cntr_0, py_data_0);
		}
	}
	return py_data;
}

static int py_dns_rdata_data_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_rdata_data *object = (struct dns_rdata_data *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int data_cntr_0;
		object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
		if (!object->data) { return -1;; }
		talloc_set_name_const(object->data, "ARRAY: object->data");
		for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
			PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, data_cntr_0), return -1;);
			object->data[data_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, data_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_dns_rdata_data_getsetters[] = {
	{ discard_const_p(char, "length"), py_dns_rdata_data_get_length, py_dns_rdata_data_set_length },
	{ discard_const_p(char, "data"), py_dns_rdata_data_get_data, py_dns_rdata_data_set_data },
	{ NULL }
};

static PyObject *py_dns_rdata_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_rdata_data, type);
}

static PyObject *py_dns_rdata_data_ndr_pack(PyObject *py_obj)
{
	struct dns_rdata_data *object = (struct dns_rdata_data *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_rdata_data);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_rdata_data_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_rdata_data *object = (struct dns_rdata_data *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_rdata_data);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_rdata_data);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_rdata_data_ndr_print(PyObject *py_obj)
{
	struct dns_rdata_data *object = (struct dns_rdata_data *)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_dns_rdata_data, "dns_rdata_data", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_rdata_data_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_rdata_data_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_rdata_data_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_rdata_data_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_rdata_data_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.rdata_data",
	.tp_getset = py_dns_rdata_data_getsetters,
	.tp_methods = py_dns_rdata_data_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_rdata_data_new,
};


static PyObject *py_dns_soa_record_get_mname(PyObject *obj, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(obj);
	PyObject *py_mname;
	py_mname = PyString_FromStringOrNULL(object->mname);
	return py_mname;
}

static int py_dns_soa_record_set_mname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(py_obj);
	object->mname = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyObject *py_dns_soa_record_get_rname(PyObject *obj, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(obj);
	PyObject *py_rname;
	py_rname = PyString_FromStringOrNULL(object->rname);
	return py_rname;
}

static int py_dns_soa_record_set_rname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(py_obj);
	object->rname = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyObject *py_dns_soa_record_get_serial(PyObject *obj, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(obj);
	PyObject *py_serial;
	py_serial = PyInt_FromLong(object->serial);
	return py_serial;
}

static int py_dns_soa_record_set_serial(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->serial = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_soa_record_get_refresh(PyObject *obj, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(obj);
	PyObject *py_refresh;
	py_refresh = PyInt_FromLong(object->refresh);
	return py_refresh;
}

static int py_dns_soa_record_set_refresh(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->refresh = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_soa_record_get_retry(PyObject *obj, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(obj);
	PyObject *py_retry;
	py_retry = PyInt_FromLong(object->retry);
	return py_retry;
}

static int py_dns_soa_record_set_retry(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->retry = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_soa_record_get_expire(PyObject *obj, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(obj);
	PyObject *py_expire;
	py_expire = PyInt_FromLong(object->expire);
	return py_expire;
}

static int py_dns_soa_record_set_expire(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->expire = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_soa_record_get_minimum(PyObject *obj, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(obj);
	PyObject *py_minimum;
	py_minimum = PyInt_FromLong(object->minimum);
	return py_minimum;
}

static int py_dns_soa_record_set_minimum(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_soa_record *object = (struct dns_soa_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->minimum = PyInt_AsLong(value);
	return 0;
}

static PyGetSetDef py_dns_soa_record_getsetters[] = {
	{ discard_const_p(char, "mname"), py_dns_soa_record_get_mname, py_dns_soa_record_set_mname },
	{ discard_const_p(char, "rname"), py_dns_soa_record_get_rname, py_dns_soa_record_set_rname },
	{ discard_const_p(char, "serial"), py_dns_soa_record_get_serial, py_dns_soa_record_set_serial },
	{ discard_const_p(char, "refresh"), py_dns_soa_record_get_refresh, py_dns_soa_record_set_refresh },
	{ discard_const_p(char, "retry"), py_dns_soa_record_get_retry, py_dns_soa_record_set_retry },
	{ discard_const_p(char, "expire"), py_dns_soa_record_get_expire, py_dns_soa_record_set_expire },
	{ discard_const_p(char, "minimum"), py_dns_soa_record_get_minimum, py_dns_soa_record_set_minimum },
	{ NULL }
};

static PyObject *py_dns_soa_record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_soa_record, type);
}


static PyTypeObject dns_soa_record_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.soa_record",
	.tp_getset = py_dns_soa_record_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_soa_record_new,
};


static PyObject *py_dns_mx_record_get_preference(PyObject *obj, void *closure)
{
	struct dns_mx_record *object = (struct dns_mx_record *)pytalloc_get_ptr(obj);
	PyObject *py_preference;
	py_preference = PyInt_FromLong(object->preference);
	return py_preference;
}

static int py_dns_mx_record_set_preference(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_mx_record *object = (struct dns_mx_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->preference = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_mx_record_get_exchange(PyObject *obj, void *closure)
{
	struct dns_mx_record *object = (struct dns_mx_record *)pytalloc_get_ptr(obj);
	PyObject *py_exchange;
	py_exchange = PyString_FromStringOrNULL(object->exchange);
	return py_exchange;
}

static int py_dns_mx_record_set_exchange(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_mx_record *object = (struct dns_mx_record *)pytalloc_get_ptr(py_obj);
	object->exchange = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyGetSetDef py_dns_mx_record_getsetters[] = {
	{ discard_const_p(char, "preference"), py_dns_mx_record_get_preference, py_dns_mx_record_set_preference },
	{ discard_const_p(char, "exchange"), py_dns_mx_record_get_exchange, py_dns_mx_record_set_exchange },
	{ NULL }
};

static PyObject *py_dns_mx_record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_mx_record, type);
}

static PyObject *py_dns_mx_record_ndr_pack(PyObject *py_obj)
{
	struct dns_mx_record *object = (struct dns_mx_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_mx_record);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_mx_record_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_mx_record *object = (struct dns_mx_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_mx_record);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_mx_record);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_mx_record_ndr_print(PyObject *py_obj)
{
	struct dns_mx_record *object = (struct dns_mx_record *)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_dns_mx_record, "dns_mx_record", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_mx_record_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_mx_record_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_mx_record_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_mx_record_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_mx_record_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.mx_record",
	.tp_getset = py_dns_mx_record_getsetters,
	.tp_methods = py_dns_mx_record_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_mx_record_new,
};


static PyObject *py_dns_txt_record_get_length(PyObject *obj, void *closure)
{
	struct dns_txt_record *object = (struct dns_txt_record *)pytalloc_get_ptr(obj);
	PyObject *py_length;
	py_length = PyInt_FromLong(object->length);
	return py_length;
}

static int py_dns_txt_record_set_length(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_txt_record *object = (struct dns_txt_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->length = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_txt_record_get_txt(PyObject *obj, void *closure)
{
	struct dns_txt_record *object = (struct dns_txt_record *)pytalloc_get_ptr(obj);
	PyObject *py_txt;
	if (object->txt == NULL) {
		py_txt = Py_None;
		Py_INCREF(py_txt);
	} else {
		py_txt = PyUnicode_Decode(object->txt, strlen(object->txt), "utf-8", "ignore");
	}
	return py_txt;
}

static int py_dns_txt_record_set_txt(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_txt_record *object = (struct dns_txt_record *)pytalloc_get_ptr(py_obj);
	if (PyUnicode_Check(value)) {
		object->txt = PyString_AS_STRING(PyUnicode_AsEncodedString(value, "utf-8", "ignore"));
	} else if (PyString_Check(value)) {
		object->txt = PyString_AS_STRING(value);
	} else {
		PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
		return -1;
	}
	return 0;
}

static PyGetSetDef py_dns_txt_record_getsetters[] = {
	{ discard_const_p(char, "length"), py_dns_txt_record_get_length, py_dns_txt_record_set_length },
	{ discard_const_p(char, "txt"), py_dns_txt_record_get_txt, py_dns_txt_record_set_txt },
	{ NULL }
};

static PyObject *py_dns_txt_record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_txt_record, type);
}

static PyObject *py_dns_txt_record_ndr_pack(PyObject *py_obj)
{
	struct dns_txt_record *object = (struct dns_txt_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_txt_record);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_txt_record_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_txt_record *object = (struct dns_txt_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_txt_record);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_txt_record);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_txt_record_ndr_print(PyObject *py_obj)
{
	struct dns_txt_record *object = (struct dns_txt_record *)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_dns_txt_record, "dns_txt_record", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_txt_record_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_txt_record_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_txt_record_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_txt_record_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_txt_record_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.txt_record",
	.tp_getset = py_dns_txt_record_getsetters,
	.tp_methods = py_dns_txt_record_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_txt_record_new,
};


static PyObject *py_dns_srv_record_get_priority(PyObject *obj, void *closure)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyInt_FromLong(object->priority);
	return py_priority;
}

static int py_dns_srv_record_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->priority = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_srv_record_get_weight(PyObject *obj, void *closure)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(obj);
	PyObject *py_weight;
	py_weight = PyInt_FromLong(object->weight);
	return py_weight;
}

static int py_dns_srv_record_set_weight(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->weight = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_srv_record_get_port(PyObject *obj, void *closure)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(obj);
	PyObject *py_port;
	py_port = PyInt_FromLong(object->port);
	return py_port;
}

static int py_dns_srv_record_set_port(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->port = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_srv_record_get_target(PyObject *obj, void *closure)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(obj);
	PyObject *py_target;
	py_target = PyString_FromStringOrNULL(object->target);
	return py_target;
}

static int py_dns_srv_record_set_target(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(py_obj);
	object->target = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyGetSetDef py_dns_srv_record_getsetters[] = {
	{ discard_const_p(char, "priority"), py_dns_srv_record_get_priority, py_dns_srv_record_set_priority },
	{ discard_const_p(char, "weight"), py_dns_srv_record_get_weight, py_dns_srv_record_set_weight },
	{ discard_const_p(char, "port"), py_dns_srv_record_get_port, py_dns_srv_record_set_port },
	{ discard_const_p(char, "target"), py_dns_srv_record_get_target, py_dns_srv_record_set_target },
	{ NULL }
};

static PyObject *py_dns_srv_record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_srv_record, type);
}

static PyObject *py_dns_srv_record_ndr_pack(PyObject *py_obj)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_srv_record);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_srv_record_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_srv_record *object = (struct dns_srv_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_srv_record);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_srv_record);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_srv_record_ndr_print(PyObject *py_obj)
{
	struct dns_srv_record *object = (struct dns_srv_record *)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_dns_srv_record, "dns_srv_record", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_srv_record_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_srv_record_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_srv_record_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_srv_record_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_srv_record_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.srv_record",
	.tp_getset = py_dns_srv_record_getsetters,
	.tp_methods = py_dns_srv_record_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_srv_record_new,
};


static PyObject *py_dns_opt_record_get_option_code(PyObject *obj, void *closure)
{
	struct dns_opt_record *object = (struct dns_opt_record *)pytalloc_get_ptr(obj);
	PyObject *py_option_code;
	py_option_code = PyInt_FromLong(object->option_code);
	return py_option_code;
}

static int py_dns_opt_record_set_option_code(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_opt_record *object = (struct dns_opt_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->option_code = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_opt_record_get_option_length(PyObject *obj, void *closure)
{
	struct dns_opt_record *object = (struct dns_opt_record *)pytalloc_get_ptr(obj);
	PyObject *py_option_length;
	py_option_length = PyInt_FromLong(object->option_length);
	return py_option_length;
}

static int py_dns_opt_record_set_option_length(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_opt_record *object = (struct dns_opt_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->option_length = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_opt_record_get_option_data(PyObject *obj, void *closure)
{
	struct dns_opt_record *object = (struct dns_opt_record *)pytalloc_get_ptr(obj);
	PyObject *py_option_data;
	py_option_data = PyList_New(object->option_length);
	if (py_option_data == NULL) {
		return NULL;
	}
	{
		int option_data_cntr_0;
		for (option_data_cntr_0 = 0; option_data_cntr_0 < object->option_length; option_data_cntr_0++) {
			PyObject *py_option_data_0;
			py_option_data_0 = PyInt_FromLong(object->option_data[option_data_cntr_0]);
			PyList_SetItem(py_option_data, option_data_cntr_0, py_option_data_0);
		}
	}
	return py_option_data;
}

static int py_dns_opt_record_set_option_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_opt_record *object = (struct dns_opt_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int option_data_cntr_0;
		object->option_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->option_data, PyList_GET_SIZE(value));
		if (!object->option_data) { return -1;; }
		talloc_set_name_const(object->option_data, "ARRAY: object->option_data");
		for (option_data_cntr_0 = 0; option_data_cntr_0 < PyList_GET_SIZE(value); option_data_cntr_0++) {
			PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, option_data_cntr_0), return -1;);
			object->option_data[option_data_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, option_data_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_dns_opt_record_getsetters[] = {
	{ discard_const_p(char, "option_code"), py_dns_opt_record_get_option_code, py_dns_opt_record_set_option_code },
	{ discard_const_p(char, "option_length"), py_dns_opt_record_get_option_length, py_dns_opt_record_set_option_length },
	{ discard_const_p(char, "option_data"), py_dns_opt_record_get_option_data, py_dns_opt_record_set_option_data },
	{ NULL }
};

static PyObject *py_dns_opt_record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_opt_record, type);
}

static PyObject *py_dns_opt_record_ndr_pack(PyObject *py_obj)
{
	struct dns_opt_record *object = (struct dns_opt_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_opt_record);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_opt_record_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_opt_record *object = (struct dns_opt_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_opt_record);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_opt_record);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_opt_record_ndr_print(PyObject *py_obj)
{
	struct dns_opt_record *object = (struct dns_opt_record *)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_dns_opt_record, "dns_opt_record", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_opt_record_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_opt_record_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_opt_record_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_opt_record_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_opt_record_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.opt_record",
	.tp_getset = py_dns_opt_record_getsetters,
	.tp_methods = py_dns_opt_record_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_opt_record_new,
};


static PyObject *py_dns_tkey_record_get_algorithm(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_algorithm;
	py_algorithm = PyString_FromStringOrNULL(object->algorithm);
	return py_algorithm;
}

static int py_dns_tkey_record_set_algorithm(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	object->algorithm = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyObject *py_dns_tkey_record_get_inception(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_inception;
	py_inception = PyInt_FromLong(object->inception);
	return py_inception;
}

static int py_dns_tkey_record_set_inception(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->inception = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tkey_record_get_expiration(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_expiration;
	py_expiration = PyInt_FromLong(object->expiration);
	return py_expiration;
}

static int py_dns_tkey_record_set_expiration(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->expiration = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tkey_record_get_mode(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_mode;
	py_mode = PyInt_FromLong(object->mode);
	return py_mode;
}

static int py_dns_tkey_record_set_mode(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	if (PyLong_Check(value)) {
		object->mode = PyLong_AsLongLong(value);
	} else if (PyInt_Check(value)) {
		object->mode = PyInt_AsLong(value);
	} 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_dns_tkey_record_get_error(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_error;
	py_error = PyInt_FromLong(object->error);
	return py_error;
}

static int py_dns_tkey_record_set_error(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->error = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tkey_record_get_key_size(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_key_size;
	py_key_size = PyInt_FromLong(object->key_size);
	return py_key_size;
}

static int py_dns_tkey_record_set_key_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->key_size = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tkey_record_get_key_data(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_key_data;
	py_key_data = PyList_New(object->key_size);
	if (py_key_data == NULL) {
		return NULL;
	}
	{
		int key_data_cntr_0;
		for (key_data_cntr_0 = 0; key_data_cntr_0 < object->key_size; key_data_cntr_0++) {
			PyObject *py_key_data_0;
			py_key_data_0 = PyInt_FromLong(object->key_data[key_data_cntr_0]);
			PyList_SetItem(py_key_data, key_data_cntr_0, py_key_data_0);
		}
	}
	return py_key_data;
}

static int py_dns_tkey_record_set_key_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int key_data_cntr_0;
		object->key_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->key_data, PyList_GET_SIZE(value));
		if (!object->key_data) { return -1;; }
		talloc_set_name_const(object->key_data, "ARRAY: object->key_data");
		for (key_data_cntr_0 = 0; key_data_cntr_0 < PyList_GET_SIZE(value); key_data_cntr_0++) {
			PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, key_data_cntr_0), return -1;);
			object->key_data[key_data_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, key_data_cntr_0));
		}
	}
	return 0;
}

static PyObject *py_dns_tkey_record_get_other_size(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_other_size;
	py_other_size = PyInt_FromLong(object->other_size);
	return py_other_size;
}

static int py_dns_tkey_record_set_other_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->other_size = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tkey_record_get_other_data(PyObject *obj, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(obj);
	PyObject *py_other_data;
	py_other_data = PyList_New(object->other_size);
	if (py_other_data == NULL) {
		return NULL;
	}
	{
		int other_data_cntr_0;
		for (other_data_cntr_0 = 0; other_data_cntr_0 < object->other_size; other_data_cntr_0++) {
			PyObject *py_other_data_0;
			py_other_data_0 = PyInt_FromLong(object->other_data[other_data_cntr_0]);
			PyList_SetItem(py_other_data, other_data_cntr_0, py_other_data_0);
		}
	}
	return py_other_data;
}

static int py_dns_tkey_record_set_other_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int other_data_cntr_0;
		object->other_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->other_data, PyList_GET_SIZE(value));
		if (!object->other_data) { return -1;; }
		talloc_set_name_const(object->other_data, "ARRAY: object->other_data");
		for (other_data_cntr_0 = 0; other_data_cntr_0 < PyList_GET_SIZE(value); other_data_cntr_0++) {
			PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, other_data_cntr_0), return -1;);
			object->other_data[other_data_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, other_data_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_dns_tkey_record_getsetters[] = {
	{ discard_const_p(char, "algorithm"), py_dns_tkey_record_get_algorithm, py_dns_tkey_record_set_algorithm },
	{ discard_const_p(char, "inception"), py_dns_tkey_record_get_inception, py_dns_tkey_record_set_inception },
	{ discard_const_p(char, "expiration"), py_dns_tkey_record_get_expiration, py_dns_tkey_record_set_expiration },
	{ discard_const_p(char, "mode"), py_dns_tkey_record_get_mode, py_dns_tkey_record_set_mode },
	{ discard_const_p(char, "error"), py_dns_tkey_record_get_error, py_dns_tkey_record_set_error },
	{ discard_const_p(char, "key_size"), py_dns_tkey_record_get_key_size, py_dns_tkey_record_set_key_size },
	{ discard_const_p(char, "key_data"), py_dns_tkey_record_get_key_data, py_dns_tkey_record_set_key_data },
	{ discard_const_p(char, "other_size"), py_dns_tkey_record_get_other_size, py_dns_tkey_record_set_other_size },
	{ discard_const_p(char, "other_data"), py_dns_tkey_record_get_other_data, py_dns_tkey_record_set_other_data },
	{ NULL }
};

static PyObject *py_dns_tkey_record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_tkey_record, type);
}

static PyObject *py_dns_tkey_record_ndr_pack(PyObject *py_obj)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_tkey_record);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_tkey_record_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_tkey_record);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_tkey_record);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_tkey_record_ndr_print(PyObject *py_obj)
{
	struct dns_tkey_record *object = (struct dns_tkey_record *)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_dns_tkey_record, "dns_tkey_record", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_tkey_record_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_tkey_record_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_tkey_record_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_tkey_record_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_tkey_record_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.tkey_record",
	.tp_getset = py_dns_tkey_record_getsetters,
	.tp_methods = py_dns_tkey_record_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_tkey_record_new,
};


static PyObject *py_dns_tsig_record_get_algorithm_name(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_algorithm_name;
	py_algorithm_name = PyString_FromStringOrNULL(object->algorithm_name);
	return py_algorithm_name;
}

static int py_dns_tsig_record_set_algorithm_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	object->algorithm_name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyObject *py_dns_tsig_record_get_time_prefix(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_time_prefix;
	py_time_prefix = PyInt_FromLong(object->time_prefix);
	return py_time_prefix;
}

static int py_dns_tsig_record_set_time_prefix(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->time_prefix = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tsig_record_get_time(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_time;
	py_time = PyInt_FromLong(object->time);
	return py_time;
}

static int py_dns_tsig_record_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->time = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tsig_record_get_fudge(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_fudge;
	py_fudge = PyInt_FromLong(object->fudge);
	return py_fudge;
}

static int py_dns_tsig_record_set_fudge(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->fudge = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tsig_record_get_mac_size(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_mac_size;
	py_mac_size = PyInt_FromLong(object->mac_size);
	return py_mac_size;
}

static int py_dns_tsig_record_set_mac_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->mac_size = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tsig_record_get_mac(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_mac;
	py_mac = PyList_New(object->mac_size);
	if (py_mac == NULL) {
		return NULL;
	}
	{
		int mac_cntr_0;
		for (mac_cntr_0 = 0; mac_cntr_0 < object->mac_size; mac_cntr_0++) {
			PyObject *py_mac_0;
			py_mac_0 = PyInt_FromLong(object->mac[mac_cntr_0]);
			PyList_SetItem(py_mac, mac_cntr_0, py_mac_0);
		}
	}
	return py_mac;
}

static int py_dns_tsig_record_set_mac(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int mac_cntr_0;
		object->mac = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->mac, PyList_GET_SIZE(value));
		if (!object->mac) { return -1;; }
		talloc_set_name_const(object->mac, "ARRAY: object->mac");
		for (mac_cntr_0 = 0; mac_cntr_0 < PyList_GET_SIZE(value); mac_cntr_0++) {
			PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, mac_cntr_0), return -1;);
			object->mac[mac_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, mac_cntr_0));
		}
	}
	return 0;
}

static PyObject *py_dns_tsig_record_get_original_id(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_original_id;
	py_original_id = PyInt_FromLong(object->original_id);
	return py_original_id;
}

static int py_dns_tsig_record_set_original_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->original_id = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tsig_record_get_error(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_error;
	py_error = PyInt_FromLong(object->error);
	return py_error;
}

static int py_dns_tsig_record_set_error(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->error = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tsig_record_get_other_size(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_other_size;
	py_other_size = PyInt_FromLong(object->other_size);
	return py_other_size;
}

static int py_dns_tsig_record_set_other_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->other_size = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_tsig_record_get_other_data(PyObject *obj, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(obj);
	PyObject *py_other_data;
	py_other_data = PyList_New(object->other_size);
	if (py_other_data == NULL) {
		return NULL;
	}
	{
		int other_data_cntr_0;
		for (other_data_cntr_0 = 0; other_data_cntr_0 < object->other_size; other_data_cntr_0++) {
			PyObject *py_other_data_0;
			py_other_data_0 = PyInt_FromLong(object->other_data[other_data_cntr_0]);
			PyList_SetItem(py_other_data, other_data_cntr_0, py_other_data_0);
		}
	}
	return py_other_data;
}

static int py_dns_tsig_record_set_other_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int other_data_cntr_0;
		object->other_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->other_data, PyList_GET_SIZE(value));
		if (!object->other_data) { return -1;; }
		talloc_set_name_const(object->other_data, "ARRAY: object->other_data");
		for (other_data_cntr_0 = 0; other_data_cntr_0 < PyList_GET_SIZE(value); other_data_cntr_0++) {
			PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, other_data_cntr_0), return -1;);
			object->other_data[other_data_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, other_data_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_dns_tsig_record_getsetters[] = {
	{ discard_const_p(char, "algorithm_name"), py_dns_tsig_record_get_algorithm_name, py_dns_tsig_record_set_algorithm_name },
	{ discard_const_p(char, "time_prefix"), py_dns_tsig_record_get_time_prefix, py_dns_tsig_record_set_time_prefix },
	{ discard_const_p(char, "time"), py_dns_tsig_record_get_time, py_dns_tsig_record_set_time },
	{ discard_const_p(char, "fudge"), py_dns_tsig_record_get_fudge, py_dns_tsig_record_set_fudge },
	{ discard_const_p(char, "mac_size"), py_dns_tsig_record_get_mac_size, py_dns_tsig_record_set_mac_size },
	{ discard_const_p(char, "mac"), py_dns_tsig_record_get_mac, py_dns_tsig_record_set_mac },
	{ discard_const_p(char, "original_id"), py_dns_tsig_record_get_original_id, py_dns_tsig_record_set_original_id },
	{ discard_const_p(char, "error"), py_dns_tsig_record_get_error, py_dns_tsig_record_set_error },
	{ discard_const_p(char, "other_size"), py_dns_tsig_record_get_other_size, py_dns_tsig_record_set_other_size },
	{ discard_const_p(char, "other_data"), py_dns_tsig_record_get_other_data, py_dns_tsig_record_set_other_data },
	{ NULL }
};

static PyObject *py_dns_tsig_record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_tsig_record, type);
}

static PyObject *py_dns_tsig_record_ndr_pack(PyObject *py_obj)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_tsig_record);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_tsig_record_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_tsig_record);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_tsig_record);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_tsig_record_ndr_print(PyObject *py_obj)
{
	struct dns_tsig_record *object = (struct dns_tsig_record *)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_dns_tsig_record, "dns_tsig_record", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_tsig_record_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_tsig_record_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_tsig_record_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_tsig_record_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_tsig_record_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.tsig_record",
	.tp_getset = py_dns_tsig_record_getsetters,
	.tp_methods = py_dns_tsig_record_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_tsig_record_new,
};


static PyObject *py_dns_fake_tsig_rec_get_name(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_name;
	py_name = PyString_FromStringOrNULL(object->name);
	return py_name;
}

static int py_dns_fake_tsig_rec_set_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_rr_class(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_rr_class;
	py_rr_class = PyInt_FromLong(object->rr_class);
	return py_rr_class;
}

static int py_dns_fake_tsig_rec_set_rr_class(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	if (PyLong_Check(value)) {
		object->rr_class = PyLong_AsLongLong(value);
	} else if (PyInt_Check(value)) {
		object->rr_class = PyInt_AsLong(value);
	} 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_dns_fake_tsig_rec_get_ttl(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_ttl;
	py_ttl = PyInt_FromLong(object->ttl);
	return py_ttl;
}

static int py_dns_fake_tsig_rec_set_ttl(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->ttl = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_algorithm_name(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_algorithm_name;
	py_algorithm_name = PyString_FromStringOrNULL(object->algorithm_name);
	return py_algorithm_name;
}

static int py_dns_fake_tsig_rec_set_algorithm_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	object->algorithm_name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_time_prefix(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_time_prefix;
	py_time_prefix = PyInt_FromLong(object->time_prefix);
	return py_time_prefix;
}

static int py_dns_fake_tsig_rec_set_time_prefix(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->time_prefix = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_time(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_time;
	py_time = PyInt_FromLong(object->time);
	return py_time;
}

static int py_dns_fake_tsig_rec_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->time = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_fudge(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_fudge;
	py_fudge = PyInt_FromLong(object->fudge);
	return py_fudge;
}

static int py_dns_fake_tsig_rec_set_fudge(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->fudge = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_original_id(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_original_id;
	py_original_id = PyInt_FromLong(object->original_id);
	return py_original_id;
}

static int py_dns_fake_tsig_rec_set_original_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->original_id = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_error(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_error;
	py_error = PyInt_FromLong(object->error);
	return py_error;
}

static int py_dns_fake_tsig_rec_set_error(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->error = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_other_size(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_other_size;
	py_other_size = PyInt_FromLong(object->other_size);
	return py_other_size;
}

static int py_dns_fake_tsig_rec_set_other_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->other_size = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_fake_tsig_rec_get_other_data(PyObject *obj, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(obj);
	PyObject *py_other_data;
	py_other_data = PyList_New(object->other_size);
	if (py_other_data == NULL) {
		return NULL;
	}
	{
		int other_data_cntr_0;
		for (other_data_cntr_0 = 0; other_data_cntr_0 < object->other_size; other_data_cntr_0++) {
			PyObject *py_other_data_0;
			py_other_data_0 = PyInt_FromLong(object->other_data[other_data_cntr_0]);
			PyList_SetItem(py_other_data, other_data_cntr_0, py_other_data_0);
		}
	}
	return py_other_data;
}

static int py_dns_fake_tsig_rec_set_other_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int other_data_cntr_0;
		object->other_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->other_data, PyList_GET_SIZE(value));
		if (!object->other_data) { return -1;; }
		talloc_set_name_const(object->other_data, "ARRAY: object->other_data");
		for (other_data_cntr_0 = 0; other_data_cntr_0 < PyList_GET_SIZE(value); other_data_cntr_0++) {
			PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, other_data_cntr_0), return -1;);
			object->other_data[other_data_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, other_data_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_dns_fake_tsig_rec_getsetters[] = {
	{ discard_const_p(char, "name"), py_dns_fake_tsig_rec_get_name, py_dns_fake_tsig_rec_set_name },
	{ discard_const_p(char, "rr_class"), py_dns_fake_tsig_rec_get_rr_class, py_dns_fake_tsig_rec_set_rr_class },
	{ discard_const_p(char, "ttl"), py_dns_fake_tsig_rec_get_ttl, py_dns_fake_tsig_rec_set_ttl },
	{ discard_const_p(char, "algorithm_name"), py_dns_fake_tsig_rec_get_algorithm_name, py_dns_fake_tsig_rec_set_algorithm_name },
	{ discard_const_p(char, "time_prefix"), py_dns_fake_tsig_rec_get_time_prefix, py_dns_fake_tsig_rec_set_time_prefix },
	{ discard_const_p(char, "time"), py_dns_fake_tsig_rec_get_time, py_dns_fake_tsig_rec_set_time },
	{ discard_const_p(char, "fudge"), py_dns_fake_tsig_rec_get_fudge, py_dns_fake_tsig_rec_set_fudge },
	{ discard_const_p(char, "original_id"), py_dns_fake_tsig_rec_get_original_id, py_dns_fake_tsig_rec_set_original_id },
	{ discard_const_p(char, "error"), py_dns_fake_tsig_rec_get_error, py_dns_fake_tsig_rec_set_error },
	{ discard_const_p(char, "other_size"), py_dns_fake_tsig_rec_get_other_size, py_dns_fake_tsig_rec_set_other_size },
	{ discard_const_p(char, "other_data"), py_dns_fake_tsig_rec_get_other_data, py_dns_fake_tsig_rec_set_other_data },
	{ NULL }
};

static PyObject *py_dns_fake_tsig_rec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_fake_tsig_rec, type);
}

static PyObject *py_dns_fake_tsig_rec_ndr_pack(PyObject *py_obj)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_fake_tsig_rec);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_fake_tsig_rec_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_fake_tsig_rec);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_fake_tsig_rec);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_fake_tsig_rec_ndr_print(PyObject *py_obj)
{
	struct dns_fake_tsig_rec *object = (struct dns_fake_tsig_rec *)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_dns_fake_tsig_rec, "dns_fake_tsig_rec", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_fake_tsig_rec_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_fake_tsig_rec_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_fake_tsig_rec_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_fake_tsig_rec_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_fake_tsig_rec_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.fake_tsig_rec",
	.tp_getset = py_dns_fake_tsig_rec_getsetters,
	.tp_methods = py_dns_fake_tsig_rec_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_fake_tsig_rec_new,
};

PyObject *py_import_dns_rdata(TALLOC_CTX *mem_ctx, int level, union dns_rdata *in)
{
	PyObject *ret;

	switch (level) {
		case DNS_QTYPE_A:
			ret = PyString_FromStringOrNULL(in->ipv4_record);
			return ret;

		case DNS_QTYPE_NS:
			ret = PyString_FromStringOrNULL(in->ns_record);
			return ret;

		case DNS_QTYPE_CNAME:
			ret = PyString_FromStringOrNULL(in->cname_record);
			return ret;

		case DNS_QTYPE_SOA:
			ret = pytalloc_reference_ex(&dns_soa_record_Type, mem_ctx, &in->soa_record);
			return ret;

		case DNS_QTYPE_PTR:
			ret = PyString_FromStringOrNULL(in->ptr_record);
			return ret;

		case DNS_QTYPE_MX:
			ret = pytalloc_reference_ex(&dns_mx_record_Type, mem_ctx, &in->mx_record);
			return ret;

		case DNS_QTYPE_TXT:
			ret = pytalloc_reference_ex(&dns_txt_record_Type, mem_ctx, &in->txt_record);
			return ret;

		case DNS_QTYPE_AAAA:
			ret = PyString_FromStringOrNULL(in->ipv6_record);
			return ret;

		case DNS_QTYPE_SRV:
			ret = pytalloc_reference_ex(&dns_srv_record_Type, mem_ctx, &in->srv_record);
			return ret;

		case DNS_QTYPE_OPT:
			ret = pytalloc_reference_ex(&dns_opt_record_Type, mem_ctx, &in->opt_record);
			return ret;

		case DNS_QTYPE_TSIG:
			ret = pytalloc_reference_ex(&dns_tsig_record_Type, mem_ctx, &in->tsig_record);
			return ret;

		case DNS_QTYPE_TKEY:
			ret = pytalloc_reference_ex(&dns_tkey_record_Type, mem_ctx, &in->tkey_record);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

union dns_rdata *py_export_dns_rdata(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union dns_rdata *ret = talloc_zero(mem_ctx, union dns_rdata);
	switch (level) {
		case DNS_QTYPE_A:
			ret->ipv4_record = PyString_AS_STRING(in);
			break;

		case DNS_QTYPE_NS:
			ret->ns_record = talloc_strdup(mem_ctx, PyString_AS_STRING(in));
			break;

		case DNS_QTYPE_CNAME:
			ret->cname_record = talloc_strdup(mem_ctx, PyString_AS_STRING(in));
			break;

		case DNS_QTYPE_SOA:
			PY_CHECK_TYPE(&dns_soa_record_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->soa_record = *(struct dns_soa_record *)pytalloc_get_ptr(in);
			break;

		case DNS_QTYPE_PTR:
			ret->ptr_record = talloc_strdup(mem_ctx, PyString_AS_STRING(in));
			break;

		case DNS_QTYPE_MX:
			PY_CHECK_TYPE(&dns_mx_record_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->mx_record = *(struct dns_mx_record *)pytalloc_get_ptr(in);
			break;

		case DNS_QTYPE_TXT:
			PY_CHECK_TYPE(&dns_txt_record_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->txt_record = *(struct dns_txt_record *)pytalloc_get_ptr(in);
			break;

		case DNS_QTYPE_AAAA:
			ret->ipv6_record = PyString_AsString(in);
			break;

		case DNS_QTYPE_SRV:
			PY_CHECK_TYPE(&dns_srv_record_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->srv_record = *(struct dns_srv_record *)pytalloc_get_ptr(in);
			break;

		case DNS_QTYPE_OPT:
			PY_CHECK_TYPE(&dns_opt_record_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->opt_record = *(struct dns_opt_record *)pytalloc_get_ptr(in);
			break;

		case DNS_QTYPE_TSIG:
			PY_CHECK_TYPE(&dns_tsig_record_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->tsig_record = *(struct dns_tsig_record *)pytalloc_get_ptr(in);
			break;

		case DNS_QTYPE_TKEY:
			PY_CHECK_TYPE(&dns_tkey_record_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->tkey_record = *(struct dns_tkey_record *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}


static PyObject *py_dns_res_rec_get_name(PyObject *obj, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(obj);
	PyObject *py_name;
	py_name = PyString_FromStringOrNULL(object->name);
	return py_name;
}

static int py_dns_res_rec_set_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(py_obj);
	object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
	return 0;
}

static PyObject *py_dns_res_rec_get_rr_type(PyObject *obj, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(obj);
	PyObject *py_rr_type;
	py_rr_type = PyInt_FromLong(object->rr_type);
	return py_rr_type;
}

static int py_dns_res_rec_set_rr_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(py_obj);
	if (PyLong_Check(value)) {
		object->rr_type = PyLong_AsLongLong(value);
	} else if (PyInt_Check(value)) {
		object->rr_type = PyInt_AsLong(value);
	} 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_dns_res_rec_get_rr_class(PyObject *obj, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(obj);
	PyObject *py_rr_class;
	py_rr_class = PyInt_FromLong(object->rr_class);
	return py_rr_class;
}

static int py_dns_res_rec_set_rr_class(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(py_obj);
	if (PyLong_Check(value)) {
		object->rr_class = PyLong_AsLongLong(value);
	} else if (PyInt_Check(value)) {
		object->rr_class = PyInt_AsLong(value);
	} 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_dns_res_rec_get_ttl(PyObject *obj, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(obj);
	PyObject *py_ttl;
	py_ttl = PyInt_FromLong(object->ttl);
	return py_ttl;
}

static int py_dns_res_rec_set_ttl(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->ttl = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_res_rec_get_length(PyObject *obj, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(obj);
	PyObject *py_length;
	py_length = PyInt_FromLong(object->length);
	return py_length;
}

static int py_dns_res_rec_set_length(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->length = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_res_rec_get_rdata(PyObject *obj, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(obj);
	PyObject *py_rdata;
	py_rdata = py_import_dns_rdata(pytalloc_get_mem_ctx(obj), object->rr_type, &object->rdata);
	if (py_rdata == NULL) {
		return NULL;
	}
	return py_rdata;
}

static int py_dns_res_rec_set_rdata(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(py_obj);
	{
		union dns_rdata *rdata_switch_0;
		rdata_switch_0 = py_export_dns_rdata(pytalloc_get_mem_ctx(py_obj), object->rr_type, value);
		if (rdata_switch_0 == NULL) {
			return -1;
		}
		object->rdata = *rdata_switch_0;
	}
	return 0;
}

static PyObject *py_dns_res_rec_get_unexpected(PyObject *obj, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(obj);
	PyObject *py_unexpected;
	py_unexpected = PyString_FromStringAndSize((char *)(object->unexpected).data, (object->unexpected).length);
	return py_unexpected;
}

static int py_dns_res_rec_set_unexpected(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_res_rec *object = (struct dns_res_rec *)pytalloc_get_ptr(py_obj);
	object->unexpected = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
	return 0;
}

static PyGetSetDef py_dns_res_rec_getsetters[] = {
	{ discard_const_p(char, "name"), py_dns_res_rec_get_name, py_dns_res_rec_set_name },
	{ discard_const_p(char, "rr_type"), py_dns_res_rec_get_rr_type, py_dns_res_rec_set_rr_type },
	{ discard_const_p(char, "rr_class"), py_dns_res_rec_get_rr_class, py_dns_res_rec_set_rr_class },
	{ discard_const_p(char, "ttl"), py_dns_res_rec_get_ttl, py_dns_res_rec_set_ttl },
	{ discard_const_p(char, "length"), py_dns_res_rec_get_length, py_dns_res_rec_set_length },
	{ discard_const_p(char, "rdata"), py_dns_res_rec_get_rdata, py_dns_res_rec_set_rdata },
	{ discard_const_p(char, "unexpected"), py_dns_res_rec_get_unexpected, py_dns_res_rec_set_unexpected },
	{ NULL }
};

static PyObject *py_dns_res_rec_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_res_rec, type);
}


static PyTypeObject dns_res_rec_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.res_rec",
	.tp_getset = py_dns_res_rec_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_res_rec_new,
};


static PyObject *py_dns_name_packet_get_id(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_id;
	py_id = PyInt_FromLong(object->id);
	return py_id;
}

static int py_dns_name_packet_set_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->id = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_name_packet_get_operation(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_operation;
	py_operation = PyInt_FromLong(object->operation);
	return py_operation;
}

static int py_dns_name_packet_set_operation(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	if (PyLong_Check(value)) {
		object->operation = PyLong_AsLongLong(value);
	} else if (PyInt_Check(value)) {
		object->operation = PyInt_AsLong(value);
	} 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_dns_name_packet_get_qdcount(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_qdcount;
	py_qdcount = PyInt_FromLong(object->qdcount);
	return py_qdcount;
}

static int py_dns_name_packet_set_qdcount(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->qdcount = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_name_packet_get_ancount(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_ancount;
	py_ancount = PyInt_FromLong(object->ancount);
	return py_ancount;
}

static int py_dns_name_packet_set_ancount(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->ancount = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_name_packet_get_nscount(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_nscount;
	py_nscount = PyInt_FromLong(object->nscount);
	return py_nscount;
}

static int py_dns_name_packet_set_nscount(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->nscount = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_name_packet_get_arcount(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_arcount;
	py_arcount = PyInt_FromLong(object->arcount);
	return py_arcount;
}

static int py_dns_name_packet_set_arcount(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
	object->arcount = PyInt_AsLong(value);
	return 0;
}

static PyObject *py_dns_name_packet_get_questions(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_questions;
	py_questions = PyList_New(object->qdcount);
	if (py_questions == NULL) {
		return NULL;
	}
	{
		int questions_cntr_0;
		for (questions_cntr_0 = 0; questions_cntr_0 < object->qdcount; questions_cntr_0++) {
			PyObject *py_questions_0;
			py_questions_0 = pytalloc_reference_ex(&dns_name_question_Type, object->questions, &object->questions[questions_cntr_0]);
			PyList_SetItem(py_questions, questions_cntr_0, py_questions_0);
		}
	}
	return py_questions;
}

static int py_dns_name_packet_set_questions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int questions_cntr_0;
		object->questions = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->questions, PyList_GET_SIZE(value));
		if (!object->questions) { return -1;; }
		talloc_set_name_const(object->questions, "ARRAY: object->questions");
		for (questions_cntr_0 = 0; questions_cntr_0 < PyList_GET_SIZE(value); questions_cntr_0++) {
			PY_CHECK_TYPE(&dns_name_question_Type, PyList_GET_ITEM(value, questions_cntr_0), return -1;);
			if (talloc_reference(object->questions, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, questions_cntr_0))) == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->questions[questions_cntr_0] = *(struct dns_name_question *)pytalloc_get_ptr(PyList_GET_ITEM(value, questions_cntr_0));
		}
	}
	return 0;
}

static PyObject *py_dns_name_packet_get_answers(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_answers;
	py_answers = PyList_New(object->ancount);
	if (py_answers == NULL) {
		return NULL;
	}
	{
		int answers_cntr_0;
		for (answers_cntr_0 = 0; answers_cntr_0 < object->ancount; answers_cntr_0++) {
			PyObject *py_answers_0;
			py_answers_0 = pytalloc_reference_ex(&dns_res_rec_Type, object->answers, &object->answers[answers_cntr_0]);
			PyList_SetItem(py_answers, answers_cntr_0, py_answers_0);
		}
	}
	return py_answers;
}

static int py_dns_name_packet_set_answers(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int answers_cntr_0;
		object->answers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->answers, PyList_GET_SIZE(value));
		if (!object->answers) { return -1;; }
		talloc_set_name_const(object->answers, "ARRAY: object->answers");
		for (answers_cntr_0 = 0; answers_cntr_0 < PyList_GET_SIZE(value); answers_cntr_0++) {
			PY_CHECK_TYPE(&dns_res_rec_Type, PyList_GET_ITEM(value, answers_cntr_0), return -1;);
			if (talloc_reference(object->answers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, answers_cntr_0))) == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->answers[answers_cntr_0] = *(struct dns_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, answers_cntr_0));
		}
	}
	return 0;
}

static PyObject *py_dns_name_packet_get_nsrecs(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_nsrecs;
	py_nsrecs = PyList_New(object->nscount);
	if (py_nsrecs == NULL) {
		return NULL;
	}
	{
		int nsrecs_cntr_0;
		for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < object->nscount; nsrecs_cntr_0++) {
			PyObject *py_nsrecs_0;
			py_nsrecs_0 = pytalloc_reference_ex(&dns_res_rec_Type, object->nsrecs, &object->nsrecs[nsrecs_cntr_0]);
			PyList_SetItem(py_nsrecs, nsrecs_cntr_0, py_nsrecs_0);
		}
	}
	return py_nsrecs;
}

static int py_dns_name_packet_set_nsrecs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int nsrecs_cntr_0;
		object->nsrecs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->nsrecs, PyList_GET_SIZE(value));
		if (!object->nsrecs) { return -1;; }
		talloc_set_name_const(object->nsrecs, "ARRAY: object->nsrecs");
		for (nsrecs_cntr_0 = 0; nsrecs_cntr_0 < PyList_GET_SIZE(value); nsrecs_cntr_0++) {
			PY_CHECK_TYPE(&dns_res_rec_Type, PyList_GET_ITEM(value, nsrecs_cntr_0), return -1;);
			if (talloc_reference(object->nsrecs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, nsrecs_cntr_0))) == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->nsrecs[nsrecs_cntr_0] = *(struct dns_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, nsrecs_cntr_0));
		}
	}
	return 0;
}

static PyObject *py_dns_name_packet_get_additional(PyObject *obj, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(obj);
	PyObject *py_additional;
	py_additional = PyList_New(object->arcount);
	if (py_additional == NULL) {
		return NULL;
	}
	{
		int additional_cntr_0;
		for (additional_cntr_0 = 0; additional_cntr_0 < object->arcount; additional_cntr_0++) {
			PyObject *py_additional_0;
			py_additional_0 = pytalloc_reference_ex(&dns_res_rec_Type, object->additional, &object->additional[additional_cntr_0]);
			PyList_SetItem(py_additional, additional_cntr_0, py_additional_0);
		}
	}
	return py_additional;
}

static int py_dns_name_packet_set_additional(PyObject *py_obj, PyObject *value, void *closure)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int additional_cntr_0;
		object->additional = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->additional, PyList_GET_SIZE(value));
		if (!object->additional) { return -1;; }
		talloc_set_name_const(object->additional, "ARRAY: object->additional");
		for (additional_cntr_0 = 0; additional_cntr_0 < PyList_GET_SIZE(value); additional_cntr_0++) {
			PY_CHECK_TYPE(&dns_res_rec_Type, PyList_GET_ITEM(value, additional_cntr_0), return -1;);
			if (talloc_reference(object->additional, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, additional_cntr_0))) == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->additional[additional_cntr_0] = *(struct dns_res_rec *)pytalloc_get_ptr(PyList_GET_ITEM(value, additional_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_dns_name_packet_getsetters[] = {
	{ discard_const_p(char, "id"), py_dns_name_packet_get_id, py_dns_name_packet_set_id },
	{ discard_const_p(char, "operation"), py_dns_name_packet_get_operation, py_dns_name_packet_set_operation },
	{ discard_const_p(char, "qdcount"), py_dns_name_packet_get_qdcount, py_dns_name_packet_set_qdcount },
	{ discard_const_p(char, "ancount"), py_dns_name_packet_get_ancount, py_dns_name_packet_set_ancount },
	{ discard_const_p(char, "nscount"), py_dns_name_packet_get_nscount, py_dns_name_packet_set_nscount },
	{ discard_const_p(char, "arcount"), py_dns_name_packet_get_arcount, py_dns_name_packet_set_arcount },
	{ discard_const_p(char, "questions"), py_dns_name_packet_get_questions, py_dns_name_packet_set_questions },
	{ discard_const_p(char, "answers"), py_dns_name_packet_get_answers, py_dns_name_packet_set_answers },
	{ discard_const_p(char, "nsrecs"), py_dns_name_packet_get_nsrecs, py_dns_name_packet_set_nsrecs },
	{ discard_const_p(char, "additional"), py_dns_name_packet_get_additional, py_dns_name_packet_set_additional },
	{ NULL }
};

static PyObject *py_dns_name_packet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct dns_name_packet, type);
}

static PyObject *py_dns_name_packet_ndr_pack(PyObject *py_obj)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	enum ndr_err_code err;
	err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_dns_name_packet);
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	return PyString_FromStringAndSize((char *)blob.data, blob.length);
}

static PyObject *py_dns_name_packet_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct dns_name_packet *object = (struct dns_name_packet *)pytalloc_get_ptr(py_obj);
	DATA_BLOB blob;
	int 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_dns_name_packet);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_dns_name_packet);
	}
	if (err != NDR_ERR_SUCCESS) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_dns_name_packet_ndr_print(PyObject *py_obj)
{
	struct dns_name_packet *object = (struct dns_name_packet *)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_dns_name_packet, "dns_name_packet", object);
	ret = PyString_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_dns_name_packet_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_dns_name_packet_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", (PyCFunction)py_dns_name_packet_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", (PyCFunction)py_dns_name_packet_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject dns_name_packet_Type = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.name_packet",
	.tp_getset = py_dns_name_packet_getsetters,
	.tp_methods = py_dns_name_packet_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_basicsize = sizeof(pytalloc_Object),
	.tp_new = py_dns_name_packet_new,
};


static bool pack_py_decode_dns_name_packet_args_in(PyObject *args, PyObject *kwargs, struct decode_dns_name_packet *r)
{
	PyObject *py_packet;
	const char *kwnames[] = {
		"packet", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:decode_dns_name_packet", discard_const_p(char *, kwnames), &py_packet)) {
		return false;
	}

	PY_CHECK_TYPE(&dns_name_packet_Type, py_packet, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_packet)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.packet = *(struct dns_name_packet *)pytalloc_get_ptr(py_packet);
	return true;
}

static PyObject *unpack_py_decode_dns_name_packet_args_out(struct decode_dns_name_packet *r)
{
	PyObject *result;
	result = Py_None;
	Py_INCREF(result);
	return result;
}

const struct PyNdrRpcMethodDef py_ndr_dns_methods[] = {
	{ "decode_dns_name_packet", "S.decode_dns_name_packet(packet) -> None", (py_dcerpc_call_fn)dcerpc_decode_dns_name_packet_r, (py_data_pack_fn)pack_py_decode_dns_name_packet_args_in, (py_data_unpack_fn)unpack_py_decode_dns_name_packet_args_out, 0, &ndr_table_dns },
	{ NULL }
};

static PyObject *interface_dns_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_dns);
}

#define PY_DOC_DNS "DNS records"
static PyTypeObject dns_InterfaceType = {
	PyObject_HEAD_INIT(NULL) 0,
	.tp_name = "dns.dns",
	.tp_basicsize = sizeof(dcerpc_InterfaceObject),
	.tp_doc = "dns(binding, lp_ctx=None, credentials=None) -> connection\n"
"\n"
"binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
"lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
"credentials should be a credentials.Credentials object.\n\n"PY_DOC_DNS,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = interface_dns_new,
};

static PyMethodDef dns_methods[] = {
	{ NULL, NULL, 0, NULL }
};

void initdns(void)
{
	PyObject *m;
	PyObject *dep_talloc;
	PyObject *dep_samba_dcerpc_misc;
	PyObject *dep_samba_dcerpc_base;

	dep_talloc = PyImport_ImportModule("talloc");
	if (dep_talloc == NULL)
		return;

	dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
	if (dep_samba_dcerpc_misc == NULL)
		return;

	dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
	if (dep_samba_dcerpc_base == NULL)
		return;

	Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
	if (Object_Type == NULL)
		return;

	ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
	if (ClientConnection_Type == NULL)
		return;

	dns_name_question_Type.tp_base = Object_Type;

	dns_rdata_data_Type.tp_base = Object_Type;

	dns_soa_record_Type.tp_base = Object_Type;

	dns_mx_record_Type.tp_base = Object_Type;

	dns_txt_record_Type.tp_base = Object_Type;

	dns_srv_record_Type.tp_base = Object_Type;

	dns_opt_record_Type.tp_base = Object_Type;

	dns_tkey_record_Type.tp_base = Object_Type;

	dns_tsig_record_Type.tp_base = Object_Type;

	dns_fake_tsig_rec_Type.tp_base = Object_Type;

	dns_res_rec_Type.tp_base = Object_Type;

	dns_name_packet_Type.tp_base = Object_Type;

	dns_InterfaceType.tp_base = ClientConnection_Type;

	if (PyType_Ready(&dns_name_question_Type) < 0)
		return;
	if (PyType_Ready(&dns_rdata_data_Type) < 0)
		return;
	if (PyType_Ready(&dns_soa_record_Type) < 0)
		return;
	if (PyType_Ready(&dns_mx_record_Type) < 0)
		return;
	if (PyType_Ready(&dns_txt_record_Type) < 0)
		return;
	if (PyType_Ready(&dns_srv_record_Type) < 0)
		return;
	if (PyType_Ready(&dns_opt_record_Type) < 0)
		return;
	if (PyType_Ready(&dns_tkey_record_Type) < 0)
		return;
	if (PyType_Ready(&dns_tsig_record_Type) < 0)
		return;
	if (PyType_Ready(&dns_fake_tsig_rec_Type) < 0)
		return;
	if (PyType_Ready(&dns_res_rec_Type) < 0)
		return;
	if (PyType_Ready(&dns_name_packet_Type) < 0)
		return;
	if (PyType_Ready(&dns_InterfaceType) < 0)
		return;
	if (!PyInterface_AddNdrRpcMethods(&dns_InterfaceType, py_ndr_dns_methods))
		return;

#ifdef PY_NAME_QUESTION_PATCH
	PY_NAME_QUESTION_PATCH(&dns_name_question_Type);
#endif
#ifdef PY_RDATA_DATA_PATCH
	PY_RDATA_DATA_PATCH(&dns_rdata_data_Type);
#endif
#ifdef PY_SOA_RECORD_PATCH
	PY_SOA_RECORD_PATCH(&dns_soa_record_Type);
#endif
#ifdef PY_MX_RECORD_PATCH
	PY_MX_RECORD_PATCH(&dns_mx_record_Type);
#endif
#ifdef PY_TXT_RECORD_PATCH
	PY_TXT_RECORD_PATCH(&dns_txt_record_Type);
#endif
#ifdef PY_SRV_RECORD_PATCH
	PY_SRV_RECORD_PATCH(&dns_srv_record_Type);
#endif
#ifdef PY_OPT_RECORD_PATCH
	PY_OPT_RECORD_PATCH(&dns_opt_record_Type);
#endif
#ifdef PY_TKEY_RECORD_PATCH
	PY_TKEY_RECORD_PATCH(&dns_tkey_record_Type);
#endif
#ifdef PY_TSIG_RECORD_PATCH
	PY_TSIG_RECORD_PATCH(&dns_tsig_record_Type);
#endif
#ifdef PY_FAKE_TSIG_REC_PATCH
	PY_FAKE_TSIG_REC_PATCH(&dns_fake_tsig_rec_Type);
#endif
#ifdef PY_RES_REC_PATCH
	PY_RES_REC_PATCH(&dns_res_rec_Type);
#endif
#ifdef PY_NAME_PACKET_PATCH
	PY_NAME_PACKET_PATCH(&dns_name_packet_Type);
#endif
#ifdef PY_DNS_PATCH
	PY_DNS_PATCH(&dns_InterfaceType);
#endif

	m = Py_InitModule3("dns", dns_methods, "dns DCE/RPC");
	if (m == NULL)
		return;

	PyModule_AddObject(m, "DNS_RCODE_FORMERR", PyInt_FromLong(DNS_RCODE_FORMERR));
	PyModule_AddObject(m, "DNS_FLAG_RECURSION_AVAIL", PyInt_FromLong(DNS_FLAG_RECURSION_AVAIL));
	PyModule_AddObject(m, "DNS_OPCODE_UPDATE", PyInt_FromLong(DNS_OPCODE_UPDATE));
	PyModule_AddObject(m, "DNS_QTYPE_MAILB", PyInt_FromLong(DNS_QTYPE_MAILB));
	PyModule_AddObject(m, "DNS_OPCODE", PyInt_FromLong(DNS_OPCODE));
	PyModule_AddObject(m, "DNS_QTYPE_ALL", PyInt_FromLong(DNS_QTYPE_ALL));
	PyModule_AddObject(m, "DNS_QTYPE_TKEY", PyInt_FromLong(DNS_QTYPE_TKEY));
	PyModule_AddObject(m, "DNS_QTYPE_ISDN", PyInt_FromLong(DNS_QTYPE_ISDN));
	PyModule_AddObject(m, "DNS_QTYPE_RP", PyInt_FromLong(DNS_QTYPE_RP));
	PyModule_AddObject(m, "DNS_RCODE_NXDOMAIN", PyInt_FromLong(DNS_RCODE_NXDOMAIN));
	PyModule_AddObject(m, "DNS_RCODE_SERVFAIL", PyInt_FromLong(DNS_RCODE_SERVFAIL));
	PyModule_AddObject(m, "DNS_RCODE_BADKEY", PyInt_FromLong(DNS_RCODE_BADKEY));
	PyModule_AddObject(m, "DNS_OPCODE_REFRESH2", PyInt_FromLong(DNS_OPCODE_REFRESH2));
	PyModule_AddObject(m, "DNS_FLAG_TRUNCATION", PyInt_FromLong(DNS_FLAG_TRUNCATION));
	PyModule_AddObject(m, "DNS_QTYPE_ZERO", PyInt_FromLong(DNS_QTYPE_ZERO));
	PyModule_AddObject(m, "DNS_OPCODE_MULTI_HOME_REG", PyInt_FromLong(DNS_OPCODE_MULTI_HOME_REG));
	PyModule_AddObject(m, "DNS_OPCODE_WACK", PyInt_FromLong(DNS_OPCODE_WACK));
	PyModule_AddObject(m, "DNS_QTYPE_NETBIOS", PyInt_FromLong(DNS_QTYPE_NETBIOS));
	PyModule_AddObject(m, "DNS_TKEY_MODE_LAST", PyInt_FromLong(DNS_TKEY_MODE_LAST));
	PyModule_AddObject(m, "DNS_QTYPE_CNAME", PyInt_FromLong(DNS_QTYPE_CNAME));
	PyModule_AddObject(m, "DNS_QCLASS_ANY", PyInt_FromLong(DNS_QCLASS_ANY));
	PyModule_AddObject(m, "DNS_OPCODE_IQUERY", PyInt_FromLong(DNS_OPCODE_IQUERY));
	PyModule_AddObject(m, "DNS_TKEY_MODE_SERVER", PyInt_FromLong(DNS_TKEY_MODE_SERVER));
	PyModule_AddObject(m, "DNS_QTYPE_NULL", PyInt_FromLong(DNS_QTYPE_NULL));
	PyModule_AddObject(m, "DNS_SERVICE_PORT", PyInt_FromLong(53));
	PyModule_AddObject(m, "DNS_QTYPE_SOA", PyInt_FromLong(DNS_QTYPE_SOA));
	PyModule_AddObject(m, "DNS_QTYPE_TXT", PyInt_FromLong(DNS_QTYPE_TXT));
	PyModule_AddObject(m, "DNS_RCODE_BADTIME", PyInt_FromLong(DNS_RCODE_BADTIME));
	PyModule_AddObject(m, "DNS_RCODE_OK", PyInt_FromLong(DNS_RCODE_OK));
	PyModule_AddObject(m, "DNS_QTYPE_NXT", PyInt_FromLong(DNS_QTYPE_NXT));
	PyModule_AddObject(m, "DNS_RCODE", PyInt_FromLong(DNS_RCODE));
	PyModule_AddObject(m, "DNS_TKEY_MODE_DELETE", PyInt_FromLong(DNS_TKEY_MODE_DELETE));
	PyModule_AddObject(m, "DNS_QTYPE_MINFO", PyInt_FromLong(DNS_QTYPE_MINFO));
	PyModule_AddObject(m, "DNS_RCODE_NOTAUTH", PyInt_FromLong(DNS_RCODE_NOTAUTH));
	PyModule_AddObject(m, "DNS_QTYPE_MG", PyInt_FromLong(DNS_QTYPE_MG));
	PyModule_AddObject(m, "DNS_QTYPE_DNAME", PyInt_FromLong(DNS_QTYPE_DNAME));
	PyModule_AddObject(m, "DNS_QTYPE_WKS", PyInt_FromLong(DNS_QTYPE_WKS));
	PyModule_AddObject(m, "DNS_FLAG_BROADCAST", PyInt_FromLong(DNS_FLAG_BROADCAST));
	PyModule_AddObject(m, "DNS_QTYPE_MR", PyInt_FromLong(DNS_QTYPE_MR));
	PyModule_AddObject(m, "DNS_RCODE_BADMODE", PyInt_FromLong(DNS_RCODE_BADMODE));
	PyModule_AddObject(m, "DNS_QTYPE_NS", PyInt_FromLong(DNS_QTYPE_NS));
	PyModule_AddObject(m, "DNS_QTYPE_MD", PyInt_FromLong(DNS_QTYPE_MD));
	PyModule_AddObject(m, "DNS_TKEY_MODE_CLIENT", PyInt_FromLong(DNS_TKEY_MODE_CLIENT));
	PyModule_AddObject(m, "DNS_TKEY_MODE_DH", PyInt_FromLong(DNS_TKEY_MODE_DH));
	PyModule_AddObject(m, "DNS_OPCODE_QUERY", PyInt_FromLong(DNS_OPCODE_QUERY));
	PyModule_AddObject(m, "DNS_RCODE_BADALG", PyInt_FromLong(DNS_RCODE_BADALG));
	PyModule_AddObject(m, "DNS_QTYPE_DHCID", PyInt_FromLong(DNS_QTYPE_DHCID));
	PyModule_AddObject(m, "DNS_QTYPE_NAPTR", PyInt_FromLong(DNS_QTYPE_NAPTR));
	PyModule_AddObject(m, "DNS_QCLASS_IN", PyInt_FromLong(DNS_QCLASS_IN));
	PyModule_AddObject(m, "DNS_QTYPE_SIG", PyInt_FromLong(DNS_QTYPE_SIG));
	PyModule_AddObject(m, "DNS_QTYPE_PTR", PyInt_FromLong(DNS_QTYPE_PTR));
	PyModule_AddObject(m, "DNS_QTYPE_RT", PyInt_FromLong(DNS_QTYPE_RT));
	PyModule_AddObject(m, "DNS_QTYPE_MB", PyInt_FromLong(DNS_QTYPE_MB));
	PyModule_AddObject(m, "DNS_OPCODE_STATUS", PyInt_FromLong(DNS_OPCODE_STATUS));
	PyModule_AddObject(m, "DNS_QTYPE_RRSIG", PyInt_FromLong(DNS_QTYPE_RRSIG));
	PyModule_AddObject(m, "DNS_RCODE_BADNAME", PyInt_FromLong(DNS_RCODE_BADNAME));
	PyModule_AddObject(m, "DNS_FLAG_REPLY", PyInt_FromLong(DNS_FLAG_REPLY));
	PyModule_AddObject(m, "DNS_RCODE_YXDOMAIN", PyInt_FromLong(DNS_RCODE_YXDOMAIN));
	PyModule_AddObject(m, "DNS_QTYPE_MF", PyInt_FromLong(DNS_QTYPE_MF));
	PyModule_AddObject(m, "DNS_QTYPE_KEY", PyInt_FromLong(DNS_QTYPE_KEY));
	PyModule_AddObject(m, "DNS_RCODE_YXRRSET", PyInt_FromLong(DNS_RCODE_YXRRSET));
	PyModule_AddObject(m, "DNS_QTYPE_ATMA", PyInt_FromLong(DNS_QTYPE_ATMA));
	PyModule_AddObject(m, "DNS_RCODE_NOTIMP", PyInt_FromLong(DNS_RCODE_NOTIMP));
	PyModule_AddObject(m, "DNS_QTYPE_X25", PyInt_FromLong(DNS_QTYPE_X25));
	PyModule_AddObject(m, "DNS_QTYPE_AXFR", PyInt_FromLong(DNS_QTYPE_AXFR));
	PyModule_AddObject(m, "DNS_QTYPE_OPT", PyInt_FromLong(DNS_QTYPE_OPT));
	PyModule_AddObject(m, "DNS_QTYPE_TSIG", PyInt_FromLong(DNS_QTYPE_TSIG));
	PyModule_AddObject(m, "DNS_QTYPE_AFSDB", PyInt_FromLong(DNS_QTYPE_AFSDB));
	PyModule_AddObject(m, "DNS_QTYPE_LOC", PyInt_FromLong(DNS_QTYPE_LOC));
	PyModule_AddObject(m, "DNS_QTYPE_DNSKEY", PyInt_FromLong(DNS_QTYPE_DNSKEY));
	PyModule_AddObject(m, "DNS_QTYPE_HINFO", PyInt_FromLong(DNS_QTYPE_HINFO));
	PyModule_AddObject(m, "DNS_QTYPE_MAILA", PyInt_FromLong(DNS_QTYPE_MAILA));
	PyModule_AddObject(m, "DNS_FLAG_RECURSION_DESIRED", PyInt_FromLong(DNS_FLAG_RECURSION_DESIRED));
	PyModule_AddObject(m, "DNS_TKEY_MODE_GSSAPI", PyInt_FromLong(DNS_TKEY_MODE_GSSAPI));
	PyModule_AddObject(m, "DNS_QCLASS_NONE", PyInt_FromLong(DNS_QCLASS_NONE));
	PyModule_AddObject(m, "DNS_OPCODE_REFRESH", PyInt_FromLong(DNS_OPCODE_REFRESH));
	PyModule_AddObject(m, "DNS_OPCODE_RELEASE", PyInt_FromLong(DNS_OPCODE_RELEASE));
	PyModule_AddObject(m, "DNS_RCODE_NXRRSET", PyInt_FromLong(DNS_RCODE_NXRRSET));
	PyModule_AddObject(m, "DNS_RCODE_BADSIG", PyInt_FromLong(DNS_RCODE_BADSIG));
	PyModule_AddObject(m, "DNS_QTYPE_A", PyInt_FromLong(DNS_QTYPE_A));
	PyModule_AddObject(m, "DNS_QTYPE_NSEC", PyInt_FromLong(DNS_QTYPE_NSEC));
	PyModule_AddObject(m, "DNS_QTYPE_DS", PyInt_FromLong(DNS_QTYPE_DS));
	PyModule_AddObject(m, "DNS_QTYPE_SRV", PyInt_FromLong(DNS_QTYPE_SRV));
	PyModule_AddObject(m, "DNS_RCODE_REFUSED", PyInt_FromLong(DNS_RCODE_REFUSED));
	PyModule_AddObject(m, "DNS_TKEY_MODE_NULL", PyInt_FromLong(DNS_TKEY_MODE_NULL));
	PyModule_AddObject(m, "DNS_RCODE_NOTZONE", PyInt_FromLong(DNS_RCODE_NOTZONE));
	PyModule_AddObject(m, "DNS_QTYPE_MX", PyInt_FromLong(DNS_QTYPE_MX));
	PyModule_AddObject(m, "DNS_FLAG_AUTHORITATIVE", PyInt_FromLong(DNS_FLAG_AUTHORITATIVE));
	PyModule_AddObject(m, "DNS_QTYPE_AAAA", PyInt_FromLong(DNS_QTYPE_AAAA));
	Py_INCREF((PyObject *)(void *)&dns_name_question_Type);
	PyModule_AddObject(m, "name_question", (PyObject *)(void *)&dns_name_question_Type);
	Py_INCREF((PyObject *)(void *)&dns_rdata_data_Type);
	PyModule_AddObject(m, "rdata_data", (PyObject *)(void *)&dns_rdata_data_Type);
	Py_INCREF((PyObject *)(void *)&dns_soa_record_Type);
	PyModule_AddObject(m, "soa_record", (PyObject *)(void *)&dns_soa_record_Type);
	Py_INCREF((PyObject *)(void *)&dns_mx_record_Type);
	PyModule_AddObject(m, "mx_record", (PyObject *)(void *)&dns_mx_record_Type);
	Py_INCREF((PyObject *)(void *)&dns_txt_record_Type);
	PyModule_AddObject(m, "txt_record", (PyObject *)(void *)&dns_txt_record_Type);
	Py_INCREF((PyObject *)(void *)&dns_srv_record_Type);
	PyModule_AddObject(m, "srv_record", (PyObject *)(void *)&dns_srv_record_Type);
	Py_INCREF((PyObject *)(void *)&dns_opt_record_Type);
	PyModule_AddObject(m, "opt_record", (PyObject *)(void *)&dns_opt_record_Type);
	Py_INCREF((PyObject *)(void *)&dns_tkey_record_Type);
	PyModule_AddObject(m, "tkey_record", (PyObject *)(void *)&dns_tkey_record_Type);
	Py_INCREF((PyObject *)(void *)&dns_tsig_record_Type);
	PyModule_AddObject(m, "tsig_record", (PyObject *)(void *)&dns_tsig_record_Type);
	Py_INCREF((PyObject *)(void *)&dns_fake_tsig_rec_Type);
	PyModule_AddObject(m, "fake_tsig_rec", (PyObject *)(void *)&dns_fake_tsig_rec_Type);
	Py_INCREF((PyObject *)(void *)&dns_res_rec_Type);
	PyModule_AddObject(m, "res_rec", (PyObject *)(void *)&dns_res_rec_Type);
	Py_INCREF((PyObject *)(void *)&dns_name_packet_Type);
	PyModule_AddObject(m, "name_packet", (PyObject *)(void *)&dns_name_packet_Type);
	Py_INCREF((PyObject *)(void *)&dns_InterfaceType);
	PyModule_AddObject(m, "dns", (PyObject *)(void *)&dns_InterfaceType);
#ifdef PY_MOD_DNS_PATCH
	PY_MOD_DNS_PATCH(m);
#endif

}
