# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.4.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if getattr(globals().get("__spec__"), "parent", None) or __package__ or "." in __name__:
    from . import _unboundmodule
else:
    import _unboundmodule

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)



def GetNameAsLabelList(name, len):
    return _unboundmodule.GetNameAsLabelList(name, len)

def CharArrayAsStringList(array, len):
    return _unboundmodule.CharArrayAsStringList(array, len)
class query_info(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    qtype = property(_unboundmodule.query_info_qtype_get)
    qclass = property(_unboundmodule.query_info_qclass_get)

    def _get_qtype_str(self): return sldns_wire2str_type(self.qtype)
    qtype_str = property(_get_qtype_str)

    def _get_qclass_str(self): return sldns_wire2str_class(self.qclass)
    qclass_str = property(_get_qclass_str)

    qname = property(_unboundmodule._get_qname)

    qname_list = property(_unboundmodule._get_qname_components)

    def _get_qname_str(self): return dnameAsStr(self.qname)
    qname_str = property(_get_qname_str)


    def __init__(self):
        _unboundmodule.query_info_swiginit(self, _unboundmodule.new_query_info())
    __swig_destroy__ = _unboundmodule.delete_query_info

# Register query_info in _unboundmodule:
_unboundmodule.query_info_swigregister(query_info)
RR_CLASS_IN = _unboundmodule.RR_CLASS_IN
RR_CLASS_CH = _unboundmodule.RR_CLASS_CH
RR_CLASS_HS = _unboundmodule.RR_CLASS_HS
RR_CLASS_NONE = _unboundmodule.RR_CLASS_NONE
RR_CLASS_ANY = _unboundmodule.RR_CLASS_ANY
RR_TYPE_A = _unboundmodule.RR_TYPE_A
RR_TYPE_NS = _unboundmodule.RR_TYPE_NS
RR_TYPE_MD = _unboundmodule.RR_TYPE_MD
RR_TYPE_MF = _unboundmodule.RR_TYPE_MF
RR_TYPE_CNAME = _unboundmodule.RR_TYPE_CNAME
RR_TYPE_SOA = _unboundmodule.RR_TYPE_SOA
RR_TYPE_MB = _unboundmodule.RR_TYPE_MB
RR_TYPE_MG = _unboundmodule.RR_TYPE_MG
RR_TYPE_MR = _unboundmodule.RR_TYPE_MR
RR_TYPE_NULL = _unboundmodule.RR_TYPE_NULL
RR_TYPE_WKS = _unboundmodule.RR_TYPE_WKS
RR_TYPE_PTR = _unboundmodule.RR_TYPE_PTR
RR_TYPE_HINFO = _unboundmodule.RR_TYPE_HINFO
RR_TYPE_MINFO = _unboundmodule.RR_TYPE_MINFO
RR_TYPE_MX = _unboundmodule.RR_TYPE_MX
RR_TYPE_TXT = _unboundmodule.RR_TYPE_TXT
RR_TYPE_RP = _unboundmodule.RR_TYPE_RP
RR_TYPE_AFSDB = _unboundmodule.RR_TYPE_AFSDB
RR_TYPE_X25 = _unboundmodule.RR_TYPE_X25
RR_TYPE_ISDN = _unboundmodule.RR_TYPE_ISDN
RR_TYPE_RT = _unboundmodule.RR_TYPE_RT
RR_TYPE_NSAP = _unboundmodule.RR_TYPE_NSAP
RR_TYPE_NSAP_PTR = _unboundmodule.RR_TYPE_NSAP_PTR
RR_TYPE_SIG = _unboundmodule.RR_TYPE_SIG
RR_TYPE_KEY = _unboundmodule.RR_TYPE_KEY
RR_TYPE_PX = _unboundmodule.RR_TYPE_PX
RR_TYPE_GPOS = _unboundmodule.RR_TYPE_GPOS
RR_TYPE_AAAA = _unboundmodule.RR_TYPE_AAAA
RR_TYPE_LOC = _unboundmodule.RR_TYPE_LOC
RR_TYPE_NXT = _unboundmodule.RR_TYPE_NXT
RR_TYPE_EID = _unboundmodule.RR_TYPE_EID
RR_TYPE_NIMLOC = _unboundmodule.RR_TYPE_NIMLOC
RR_TYPE_SRV = _unboundmodule.RR_TYPE_SRV
RR_TYPE_ATMA = _unboundmodule.RR_TYPE_ATMA
RR_TYPE_NAPTR = _unboundmodule.RR_TYPE_NAPTR
RR_TYPE_KX = _unboundmodule.RR_TYPE_KX
RR_TYPE_CERT = _unboundmodule.RR_TYPE_CERT
RR_TYPE_A6 = _unboundmodule.RR_TYPE_A6
RR_TYPE_DNAME = _unboundmodule.RR_TYPE_DNAME
RR_TYPE_SINK = _unboundmodule.RR_TYPE_SINK
RR_TYPE_OPT = _unboundmodule.RR_TYPE_OPT
RR_TYPE_APL = _unboundmodule.RR_TYPE_APL
RR_TYPE_DS = _unboundmodule.RR_TYPE_DS
RR_TYPE_SSHFP = _unboundmodule.RR_TYPE_SSHFP
RR_TYPE_IPSECKEY = _unboundmodule.RR_TYPE_IPSECKEY
RR_TYPE_RRSIG = _unboundmodule.RR_TYPE_RRSIG
RR_TYPE_NSEC = _unboundmodule.RR_TYPE_NSEC
RR_TYPE_DNSKEY = _unboundmodule.RR_TYPE_DNSKEY
RR_TYPE_DHCID = _unboundmodule.RR_TYPE_DHCID
RR_TYPE_NSEC3 = _unboundmodule.RR_TYPE_NSEC3
RR_TYPE_NSEC3PARAMS = _unboundmodule.RR_TYPE_NSEC3PARAMS
RR_TYPE_UINFO = _unboundmodule.RR_TYPE_UINFO
RR_TYPE_UID = _unboundmodule.RR_TYPE_UID
RR_TYPE_GID = _unboundmodule.RR_TYPE_GID
RR_TYPE_UNSPEC = _unboundmodule.RR_TYPE_UNSPEC
RR_TYPE_TSIG = _unboundmodule.RR_TYPE_TSIG
RR_TYPE_IXFR = _unboundmodule.RR_TYPE_IXFR
RR_TYPE_AXFR = _unboundmodule.RR_TYPE_AXFR
RR_TYPE_MAILB = _unboundmodule.RR_TYPE_MAILB
RR_TYPE_MAILA = _unboundmodule.RR_TYPE_MAILA
RR_TYPE_ANY = _unboundmodule.RR_TYPE_ANY
RR_TYPE_DLV = _unboundmodule.RR_TYPE_DLV

def _get_qname(q):
    return _unboundmodule._get_qname(q)

def _get_qname_components(q):
    return _unboundmodule._get_qname_components(q)

def dnameAsStr(dname):
    return _unboundmodule.dnameAsStr(dname)
class packed_rrset_key(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    flags = property(_unboundmodule.packed_rrset_key_flags_get)
    type = property(_unboundmodule.packed_rrset_key_type_get)
    rrset_class = property(_unboundmodule.packed_rrset_key_rrset_class_get)

    def _get_type_str(self): return sldns_wire2str_type(_unboundmodule.ntohs(self.type))
    type_str = property(_get_type_str)

    def _get_class_str(self): return sldns_wire2str_class(_unboundmodule.ntohs(self.rrset_class))
    rrset_class_str = property(_get_class_str)

    dname = property(_unboundmodule._get_dname)

    dname_list = property(_unboundmodule._get_dname_components)

    def _get_dname_str(self): return dnameAsStr(self.dname)
    dname_str = property(_get_dname_str)


    def __init__(self):
        _unboundmodule.packed_rrset_key_swiginit(self, _unboundmodule.new_packed_rrset_key())
    __swig_destroy__ = _unboundmodule.delete_packed_rrset_key

# Register packed_rrset_key in _unboundmodule:
_unboundmodule.packed_rrset_key_swigregister(packed_rrset_key)

def ntohs(netshort):
    return _unboundmodule.ntohs(netshort)

def _get_dname(k):
    return _unboundmodule._get_dname(k)

def _get_dname_components(k):
    return _unboundmodule._get_dname_components(k)
class ub_packed_rrset_key(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    entry = property(_unboundmodule.ub_packed_rrset_key_entry_get, _unboundmodule.ub_packed_rrset_key_entry_set)
    id = property(_unboundmodule.ub_packed_rrset_key_id_get, _unboundmodule.ub_packed_rrset_key_id_set)
    rk = property(_unboundmodule.ub_packed_rrset_key_rk_get, _unboundmodule.ub_packed_rrset_key_rk_set)

    def __init__(self):
        _unboundmodule.ub_packed_rrset_key_swiginit(self, _unboundmodule.new_ub_packed_rrset_key())
    __swig_destroy__ = _unboundmodule.delete_ub_packed_rrset_key

# Register ub_packed_rrset_key in _unboundmodule:
_unboundmodule.ub_packed_rrset_key_swigregister(ub_packed_rrset_key)
class lruhash_entry(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    lock = property(_unboundmodule.lruhash_entry_lock_get, _unboundmodule.lruhash_entry_lock_set)
    overflow_next = property(_unboundmodule.lruhash_entry_overflow_next_get, _unboundmodule.lruhash_entry_overflow_next_set)
    lru_next = property(_unboundmodule.lruhash_entry_lru_next_get, _unboundmodule.lruhash_entry_lru_next_set)
    lru_prev = property(_unboundmodule.lruhash_entry_lru_prev_get, _unboundmodule.lruhash_entry_lru_prev_set)
    hash = property(_unboundmodule.lruhash_entry_hash_get, _unboundmodule.lruhash_entry_hash_set)
    key = property(_unboundmodule.lruhash_entry_key_get, _unboundmodule.lruhash_entry_key_set)
    data = property(_unboundmodule.lruhash_entry_data_get, _unboundmodule.lruhash_entry_data_set)

    def __init__(self):
        _unboundmodule.lruhash_entry_swiginit(self, _unboundmodule.new_lruhash_entry())
    __swig_destroy__ = _unboundmodule.delete_lruhash_entry

# Register lruhash_entry in _unboundmodule:
_unboundmodule.lruhash_entry_swigregister(lruhash_entry)
class packed_rrset_data(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    ttl = property(_unboundmodule.packed_rrset_data_ttl_get, _unboundmodule.packed_rrset_data_ttl_set)
    count = property(_unboundmodule.packed_rrset_data_count_get, _unboundmodule.packed_rrset_data_count_set)
    rrsig_count = property(_unboundmodule.packed_rrset_data_rrsig_count_get, _unboundmodule.packed_rrset_data_rrsig_count_set)
    trust = property(_unboundmodule.packed_rrset_data_trust_get, _unboundmodule.packed_rrset_data_trust_set)
    security = property(_unboundmodule.packed_rrset_data_security_get, _unboundmodule.packed_rrset_data_security_set)

    def _get_data_rr_len(self): return RRSetData_RRLen(self)
    rr_len = property(_get_data_rr_len)
    def _get_data_rr_ttl(self): return RRSetData_RRTTL(self)
    rr_ttl = property(_get_data_rr_ttl)
    def _get_data_rr_data(self): return RRSetData_RRData(self)
    rr_data = property(_get_data_rr_data)


    def __init__(self):
        _unboundmodule.packed_rrset_data_swiginit(self, _unboundmodule.new_packed_rrset_data())
    __swig_destroy__ = _unboundmodule.delete_packed_rrset_data

# Register packed_rrset_data in _unboundmodule:
_unboundmodule.packed_rrset_data_swigregister(packed_rrset_data)

class RRSetData_RRLen:
    def __init__(self, obj): self.obj = obj
    def __getitem__(self, index): return _unboundmodule._get_data_rr_len(self.obj, index)
    def __len__(self): return self.obj.count + self.obj.rrsig_count
class RRSetData_RRTTL:
    def __init__(self, obj): self.obj = obj
    def __getitem__(self, index): return _unboundmodule._get_data_rr_ttl(self.obj, index)
    def __setitem__(self, index, value): _unboundmodule._set_data_rr_ttl(self.obj, index, value)
    def __len__(self): return self.obj.count + self.obj.rrsig_count
class RRSetData_RRData:
    def __init__(self, obj): self.obj = obj
    def __getitem__(self, index): return _unboundmodule._get_data_rr_data(self.obj, index)
    def __len__(self): return self.obj.count + self.obj.rrsig_count


def _get_data_rr_len(d, idx):
    return _unboundmodule._get_data_rr_len(d, idx)

def _set_data_rr_ttl(d, idx, ttl):
    return _unboundmodule._set_data_rr_ttl(d, idx, ttl)

def _get_data_rr_ttl(d, idx):
    return _unboundmodule._get_data_rr_ttl(d, idx)

def _get_data_rr_data(d, idx):
    return _unboundmodule._get_data_rr_data(d, idx)
class reply_info(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    flags = property(_unboundmodule.reply_info_flags_get, _unboundmodule.reply_info_flags_set)
    qdcount = property(_unboundmodule.reply_info_qdcount_get, _unboundmodule.reply_info_qdcount_set)
    ttl = property(_unboundmodule.reply_info_ttl_get, _unboundmodule.reply_info_ttl_set)
    prefetch_ttl = property(_unboundmodule.reply_info_prefetch_ttl_get, _unboundmodule.reply_info_prefetch_ttl_set)
    authoritative = property(_unboundmodule.reply_info_authoritative_get, _unboundmodule.reply_info_authoritative_set)
    security = property(_unboundmodule.reply_info_security_get, _unboundmodule.reply_info_security_set)
    an_numrrsets = property(_unboundmodule.reply_info_an_numrrsets_get, _unboundmodule.reply_info_an_numrrsets_set)
    ns_numrrsets = property(_unboundmodule.reply_info_ns_numrrsets_get, _unboundmodule.reply_info_ns_numrrsets_set)
    ar_numrrsets = property(_unboundmodule.reply_info_ar_numrrsets_get, _unboundmodule.reply_info_ar_numrrsets_set)
    rrset_count = property(_unboundmodule.reply_info_rrset_count_get, _unboundmodule.reply_info_rrset_count_set)

    def _rrset_ref_get(self): return ReplyInfo_Ref(self)
    ref = property(_rrset_ref_get)

    def _rrset_rrsets_get(self): return ReplyInfo_RRSet(self)
    rrsets = property(_rrset_rrsets_get)


    def __init__(self):
        _unboundmodule.reply_info_swiginit(self, _unboundmodule.new_reply_info())
    __swig_destroy__ = _unboundmodule.delete_reply_info

# Register reply_info in _unboundmodule:
_unboundmodule.reply_info_swigregister(reply_info)
class rrset_ref(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    key = property(_unboundmodule.rrset_ref_key_get, _unboundmodule.rrset_ref_key_set)
    id = property(_unboundmodule.rrset_ref_id_get, _unboundmodule.rrset_ref_id_set)

    def __init__(self):
        _unboundmodule.rrset_ref_swiginit(self, _unboundmodule.new_rrset_ref())
    __swig_destroy__ = _unboundmodule.delete_rrset_ref

# Register rrset_ref in _unboundmodule:
_unboundmodule.rrset_ref_swigregister(rrset_ref)
class dns_msg(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    qinfo = property(_unboundmodule.dns_msg_qinfo_get, _unboundmodule.dns_msg_qinfo_set)
    rep = property(_unboundmodule.dns_msg_rep_get, _unboundmodule.dns_msg_rep_set)

    def __init__(self):
        _unboundmodule.dns_msg_swiginit(self, _unboundmodule.new_dns_msg())
    __swig_destroy__ = _unboundmodule.delete_dns_msg

# Register dns_msg in _unboundmodule:
_unboundmodule.dns_msg_swigregister(dns_msg)

class ReplyInfo_RRSet:
    def __init__(self, obj): self.obj = obj
    def __getitem__(self, index): return _unboundmodule._rrset_rrsets_get(self.obj, index)
    def __len__(self): return self.obj.rrset_count

class ReplyInfo_Ref:
    def __init__(self, obj): self.obj = obj
    def __getitem__(self, index): return _unboundmodule._rrset_ref_get(self.obj, index)
    def __len__(self): return self.obj.rrset_count


def _rrset_rrsets_get(r, idx):
    return _unboundmodule._rrset_rrsets_get(r, idx)

def _rrset_ref_get(r, idx):
    return _unboundmodule._rrset_ref_get(r, idx)
class sockaddr_storage(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def _family_get(self): return _sockaddr_storage_family(self)
    family = property(_family_get)

    def _addr_get(self): return _sockaddr_storage_addr(self)
    addr = property(_addr_get)

    def _raw_addr_get(self): return _sockaddr_storage_raw_addr(self)
    raw_addr = property(_raw_addr_get)

    def _port_get(self): return _sockaddr_storage_port(self)
    port = property(_port_get)

    def _flowinfo_get(self): return _sockaddr_storage_flowinfo(self)
    flowinfo = property(_flowinfo_get)

    def _scope_id_get(self): return _sockaddr_storage_scope_id(self)
    scope_id = property(_scope_id_get)


    def __init__(self):
        _unboundmodule.sockaddr_storage_swiginit(self, _unboundmodule.new_sockaddr_storage())
    __swig_destroy__ = _unboundmodule.delete_sockaddr_storage

# Register sockaddr_storage in _unboundmodule:
_unboundmodule.sockaddr_storage_swigregister(sockaddr_storage)

def _sockaddr_storage_len(ss):
    return _unboundmodule._sockaddr_storage_len(ss)

def _sockaddr_storage_family(ss):
    return _unboundmodule._sockaddr_storage_family(ss)

def _sockaddr_storage_addr(ss):
    return _unboundmodule._sockaddr_storage_addr(ss)

def _sockaddr_storage_raw_addr(ss):
    return _unboundmodule._sockaddr_storage_raw_addr(ss)

def _sockaddr_storage_port(ss):
    return _unboundmodule._sockaddr_storage_port(ss)

def _sockaddr_storage_flowinfo(ss):
    return _unboundmodule._sockaddr_storage_flowinfo(ss)

def _sockaddr_storage_scope_id(ss):
    return _unboundmodule._sockaddr_storage_scope_id(ss)
class mesh_state(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    reply_list = property(_unboundmodule.mesh_state_reply_list_get, _unboundmodule.mesh_state_reply_list_set)

    def __init__(self):
        _unboundmodule.mesh_state_swiginit(self, _unboundmodule.new_mesh_state())
    __swig_destroy__ = _unboundmodule.delete_mesh_state

# Register mesh_state in _unboundmodule:
_unboundmodule.mesh_state_swigregister(mesh_state)
class mesh_reply(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    next = property(_unboundmodule.mesh_reply_next_get, _unboundmodule.mesh_reply_next_set)
    query_reply = property(_unboundmodule.mesh_reply_query_reply_get, _unboundmodule.mesh_reply_query_reply_set)

    def __init__(self):
        _unboundmodule.mesh_reply_swiginit(self, _unboundmodule.new_mesh_reply())
    __swig_destroy__ = _unboundmodule.delete_mesh_reply

# Register mesh_reply in _unboundmodule:
_unboundmodule.mesh_reply_swigregister(mesh_reply)
class comm_reply(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    _addr = property(_unboundmodule.comm_reply__addr_get, _unboundmodule.comm_reply__addr_set)

    def _addr_get(self): return _sockaddr_storage_addr(self._addr)
    addr = property(_addr_get)

    def _port_get(self): return _sockaddr_storage_port(self._addr)
    port = property(_port_get)

    def _family_get(self): return _sockaddr_storage_family(self._addr)
    family = property(_family_get)


    def __init__(self):
        _unboundmodule.comm_reply_swiginit(self, _unboundmodule.new_comm_reply())
    __swig_destroy__ = _unboundmodule.delete_comm_reply

# Register comm_reply in _unboundmodule:
_unboundmodule.comm_reply_swigregister(comm_reply)
class edns_option(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    _next = property(_unboundmodule.edns_option__next_get, _unboundmodule.edns_option__next_set)
    _opt_code = property(_unboundmodule.edns_option__opt_code_get, _unboundmodule.edns_option__opt_code_set)
    _opt_len = property(_unboundmodule.edns_option__opt_len_get, _unboundmodule.edns_option__opt_len_set)
    _opt_data = property(_unboundmodule.edns_option__opt_data_get, _unboundmodule.edns_option__opt_data_set)

    def _opt_code_get(self): return _edns_option_opt_code_get(self)
    code = property(_opt_code_get)

    def _opt_data_get(self): return _edns_option_opt_data_get(self)
    data = property(_opt_data_get)


    def __init__(self):
        _unboundmodule.edns_option_swiginit(self, _unboundmodule.new_edns_option())
    __swig_destroy__ = _unboundmodule.delete_edns_option

# Register edns_option in _unboundmodule:
_unboundmodule.edns_option_swigregister(edns_option)

def _edns_option_opt_code_get(option):
    return _unboundmodule._edns_option_opt_code_get(option)

def _edns_option_opt_data_get(option):
    return _unboundmodule._edns_option_opt_data_get(option)
class edns_data(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    edns_present = property(_unboundmodule.edns_data_edns_present_get, _unboundmodule.edns_data_edns_present_set)
    ext_rcode = property(_unboundmodule.edns_data_ext_rcode_get, _unboundmodule.edns_data_ext_rcode_set)
    edns_version = property(_unboundmodule.edns_data_edns_version_get, _unboundmodule.edns_data_edns_version_set)
    bits = property(_unboundmodule.edns_data_bits_get, _unboundmodule.edns_data_bits_set)
    udp_size = property(_unboundmodule.edns_data_udp_size_get, _unboundmodule.edns_data_udp_size_set)
    opt_list_in = property(_unboundmodule.edns_data_opt_list_in_get, _unboundmodule.edns_data_opt_list_in_set)
    opt_list_out = property(_unboundmodule.edns_data_opt_list_out_get, _unboundmodule.edns_data_opt_list_out_set)
    opt_list_inplace_cb_out = property(_unboundmodule.edns_data_opt_list_inplace_cb_out_get, _unboundmodule.edns_data_opt_list_inplace_cb_out_set)
    padding_block_size = property(_unboundmodule.edns_data_padding_block_size_get, _unboundmodule.edns_data_padding_block_size_set)

    def _opt_list_iter(self): return EdnsOptsListIter(self.opt_list)
    opt_list_iter = property(_opt_list_iter)
    def _opt_list(self): return _edns_data_opt_list_get(self)
    opt_list = property(_opt_list)


    def __init__(self):
        _unboundmodule.edns_data_swiginit(self, _unboundmodule.new_edns_data())
    __swig_destroy__ = _unboundmodule.delete_edns_data

# Register edns_data in _unboundmodule:
_unboundmodule.edns_data_swigregister(edns_data)

def _edns_data_opt_list_get(edns):
    return _unboundmodule._edns_data_opt_list_get(edns)
class module_env(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    cfg = property(_unboundmodule.module_env_cfg_get, _unboundmodule.module_env_cfg_set)
    msg_cache = property(_unboundmodule.module_env_msg_cache_get, _unboundmodule.module_env_msg_cache_set)
    rrset_cache = property(_unboundmodule.module_env_rrset_cache_get, _unboundmodule.module_env_rrset_cache_set)
    infra_cache = property(_unboundmodule.module_env_infra_cache_get, _unboundmodule.module_env_infra_cache_set)
    key_cache = property(_unboundmodule.module_env_key_cache_get, _unboundmodule.module_env_key_cache_set)
    send_query = property(_unboundmodule.module_env_send_query_get, _unboundmodule.module_env_send_query_set)
    detach_subs = property(_unboundmodule.module_env_detach_subs_get, _unboundmodule.module_env_detach_subs_set)
    attach_sub = property(_unboundmodule.module_env_attach_sub_get, _unboundmodule.module_env_attach_sub_set)
    kill_sub = property(_unboundmodule.module_env_kill_sub_get, _unboundmodule.module_env_kill_sub_set)
    detect_cycle = property(_unboundmodule.module_env_detect_cycle_get, _unboundmodule.module_env_detect_cycle_set)
    scratch = property(_unboundmodule.module_env_scratch_get, _unboundmodule.module_env_scratch_set)
    scratch_buffer = property(_unboundmodule.module_env_scratch_buffer_get, _unboundmodule.module_env_scratch_buffer_set)
    worker = property(_unboundmodule.module_env_worker_get, _unboundmodule.module_env_worker_set)
    mesh = property(_unboundmodule.module_env_mesh_get, _unboundmodule.module_env_mesh_set)
    alloc = property(_unboundmodule.module_env_alloc_get, _unboundmodule.module_env_alloc_set)
    rnd = property(_unboundmodule.module_env_rnd_get, _unboundmodule.module_env_rnd_set)
    _now = property(_unboundmodule.module_env__now_get, _unboundmodule.module_env__now_set)
    _now_tv = property(_unboundmodule.module_env__now_tv_get, _unboundmodule.module_env__now_tv_set)
    need_to_validate = property(_unboundmodule.module_env_need_to_validate_get, _unboundmodule.module_env_need_to_validate_set)
    anchors = property(_unboundmodule.module_env_anchors_get, _unboundmodule.module_env_anchors_set)
    neg_cache = property(_unboundmodule.module_env_neg_cache_get, _unboundmodule.module_env_neg_cache_set)
    probe_timer = property(_unboundmodule.module_env_probe_timer_get, _unboundmodule.module_env_probe_timer_set)
    fwds = property(_unboundmodule.module_env_fwds_get, _unboundmodule.module_env_fwds_set)
    hints = property(_unboundmodule.module_env_hints_get, _unboundmodule.module_env_hints_set)
    modinfo = property(_unboundmodule.module_env_modinfo_get, _unboundmodule.module_env_modinfo_set)
    inplace_cb_lists = property(_unboundmodule.module_env_inplace_cb_lists_get, _unboundmodule.module_env_inplace_cb_lists_set)
    edns_known_options = property(_unboundmodule.module_env_edns_known_options_get, _unboundmodule.module_env_edns_known_options_set)
    edns_known_options_num = property(_unboundmodule.module_env_edns_known_options_num_get, _unboundmodule.module_env_edns_known_options_num_set)

    def _now_get(self): return _module_env_now_get(self)
    now = property(_now_get)


    def __init__(self):
        _unboundmodule.module_env_swiginit(self, _unboundmodule.new_module_env())
    __swig_destroy__ = _unboundmodule.delete_module_env

# Register module_env in _unboundmodule:
_unboundmodule.module_env_swigregister(module_env)

def _module_env_now_get(env):
    return _unboundmodule._module_env_now_get(env)
class module_qstate(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    qinfo = property(_unboundmodule.module_qstate_qinfo_get, _unboundmodule.module_qstate_qinfo_set)
    query_flags = property(_unboundmodule.module_qstate_query_flags_get, _unboundmodule.module_qstate_query_flags_set)
    is_priming = property(_unboundmodule.module_qstate_is_priming_get, _unboundmodule.module_qstate_is_priming_set)
    is_valrec = property(_unboundmodule.module_qstate_is_valrec_get, _unboundmodule.module_qstate_is_valrec_set)
    reply = property(_unboundmodule.module_qstate_reply_get, _unboundmodule.module_qstate_reply_set)
    return_msg = property(_unboundmodule.module_qstate_return_msg_get, _unboundmodule.module_qstate_return_msg_set)
    return_rcode = property(_unboundmodule.module_qstate_return_rcode_get, _unboundmodule.module_qstate_return_rcode_set)
    region = property(_unboundmodule.module_qstate_region_get, _unboundmodule.module_qstate_region_set)
    curmod = property(_unboundmodule.module_qstate_curmod_get, _unboundmodule.module_qstate_curmod_set)
    prefetch_leeway = property(_unboundmodule.module_qstate_prefetch_leeway_get, _unboundmodule.module_qstate_prefetch_leeway_set)
    env = property(_unboundmodule.module_qstate_env_get, _unboundmodule.module_qstate_env_set)
    mesh_info = property(_unboundmodule.module_qstate_mesh_info_get, _unboundmodule.module_qstate_mesh_info_set)
    no_cache_lookup = property(_unboundmodule.module_qstate_no_cache_lookup_get, _unboundmodule.module_qstate_no_cache_lookup_set)
    no_cache_store = property(_unboundmodule.module_qstate_no_cache_store_get, _unboundmodule.module_qstate_no_cache_store_set)

    def set_ext_state(self, id, state):
        """Sets the ext state"""
        _unboundmodule._ext_state_set(self, id, state)

    def __ext_state_get(self): return ExtState(self)
    ext_state = property(__ext_state_get) #, __ext_state_set

    def _edns_opts_front_in_iter(self): return EdnsOptsListIter(self.edns_opts_front_in)
    edns_opts_front_in_iter = property(_edns_opts_front_in_iter)
    def _edns_opts_back_out_iter(self): return EdnsOptsListIter(self.edns_opts_back_out)
    edns_opts_back_out_iter = property(_edns_opts_back_out_iter)
    def _edns_opts_back_in_iter(self): return EdnsOptsListIter(self.edns_opts_back_in)
    edns_opts_back_in_iter = property(_edns_opts_back_in_iter)
    def _edns_opts_front_out_iter(self): return EdnsOptsListIter(self.edns_opts_front_out)
    edns_opts_front_out_iter = property(_edns_opts_front_out_iter)

    def _edns_opts_front_in(self): return _edns_opts_front_in_get(self)
    edns_opts_front_in = property(_edns_opts_front_in)
    def _edns_opts_back_out(self): return _edns_opts_back_out_get(self)
    edns_opts_back_out = property(_edns_opts_back_out)
    def _edns_opts_back_in(self): return _edns_opts_back_in_get(self)
    edns_opts_back_in = property(_edns_opts_back_in)
    def _edns_opts_front_out(self): return _edns_opts_front_out_get(self)
    edns_opts_front_out = property(_edns_opts_front_out)


    def __init__(self):
        _unboundmodule.module_qstate_swiginit(self, _unboundmodule.new_module_qstate())
    __swig_destroy__ = _unboundmodule.delete_module_qstate

# Register module_qstate in _unboundmodule:
_unboundmodule.module_qstate_swigregister(module_qstate)
MODULE_COUNT = _unboundmodule.MODULE_COUNT
QF_BIT_CD = _unboundmodule.QF_BIT_CD
QF_BIT_AD = _unboundmodule.QF_BIT_AD
QF_BIT_Z = _unboundmodule.QF_BIT_Z
QF_BIT_RA = _unboundmodule.QF_BIT_RA
QF_BIT_RD = _unboundmodule.QF_BIT_RD
QF_BIT_TC = _unboundmodule.QF_BIT_TC
QF_BIT_AA = _unboundmodule.QF_BIT_AA
QF_BIT_QR = _unboundmodule.QF_BIT_QR
RCODE_NOERROR = _unboundmodule.RCODE_NOERROR
RCODE_FORMERR = _unboundmodule.RCODE_FORMERR
RCODE_SERVFAIL = _unboundmodule.RCODE_SERVFAIL
RCODE_NXDOMAIN = _unboundmodule.RCODE_NXDOMAIN
RCODE_NOTIMPL = _unboundmodule.RCODE_NOTIMPL
RCODE_REFUSED = _unboundmodule.RCODE_REFUSED
RCODE_YXDOMAIN = _unboundmodule.RCODE_YXDOMAIN
RCODE_YXRRSET = _unboundmodule.RCODE_YXRRSET
RCODE_NXRRSET = _unboundmodule.RCODE_NXRRSET
RCODE_NOTAUTH = _unboundmodule.RCODE_NOTAUTH
RCODE_NOTZONE = _unboundmodule.RCODE_NOTZONE

class ExtState:
    def __init__(self, obj): self.obj = obj
    def __str__(self):
        return ", ".join([_unboundmodule.strextstate(_unboundmodule._ext_state_get(self.obj,a)) for a in range(0, _unboundmodule.MODULE_COUNT)])
    def __getitem__(self, index): return _unboundmodule._ext_state_get(self.obj, index)
    def __setitem__(self, index, value): _unboundmodule._ext_state_set(self.obj, index, value)
    def __len__(self): return _unboundmodule.MODULE_COUNT

class EdnsOptsListIter:
    def __init__(self, obj):
        self._current = obj
        self._temp = None
    def __iter__(self): return self
    def __next__(self):
        """Python 3 compatibility"""
        return self._get_next()
    def next(self):
        """Python 2 compatibility"""
        return self._get_next()
    def _get_next(self):
        if not edns_opt_list_is_empty(self._current):
            self._temp = self._current
            self._current = _p_p_edns_option_get_next(self._current)
            return _dereference_edns_option(self._temp)
        else:
            raise StopIteration


def _ext_state_get(q, idx):
    return _unboundmodule._ext_state_get(q, idx)

def _ext_state_set(q, idx, state):
    return _unboundmodule._ext_state_set(q, idx, state)

def edns_opt_list_is_empty(opt):
    return _unboundmodule.edns_opt_list_is_empty(opt)

def _dereference_edns_option(opt):
    return _unboundmodule._dereference_edns_option(opt)

def _p_p_edns_option_get_next(opt):
    return _unboundmodule._p_p_edns_option_get_next(opt)

def _edns_opts_front_in_get(q):
    return _unboundmodule._edns_opts_front_in_get(q)

def _edns_opts_back_out_get(q):
    return _unboundmodule._edns_opts_back_out_get(q)

def _edns_opts_back_in_get(q):
    return _unboundmodule._edns_opts_back_in_get(q)

def _edns_opts_front_out_get(q):
    return _unboundmodule._edns_opts_front_out_get(q)
class config_strlist(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    next = property(_unboundmodule.config_strlist_next_get, _unboundmodule.config_strlist_next_set)
    str = property(_unboundmodule.config_strlist_str_get, _unboundmodule.config_strlist_str_set)

    def __init__(self):
        _unboundmodule.config_strlist_swiginit(self, _unboundmodule.new_config_strlist())
    __swig_destroy__ = _unboundmodule.delete_config_strlist

# Register config_strlist in _unboundmodule:
_unboundmodule.config_strlist_swigregister(config_strlist)
class config_str2list(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    next = property(_unboundmodule.config_str2list_next_get, _unboundmodule.config_str2list_next_set)
    str = property(_unboundmodule.config_str2list_str_get, _unboundmodule.config_str2list_str_set)
    str2 = property(_unboundmodule.config_str2list_str2_get, _unboundmodule.config_str2list_str2_set)

    def __init__(self):
        _unboundmodule.config_str2list_swiginit(self, _unboundmodule.new_config_str2list())
    __swig_destroy__ = _unboundmodule.delete_config_str2list

# Register config_str2list in _unboundmodule:
_unboundmodule.config_str2list_swigregister(config_str2list)
class config_file(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    verbosity = property(_unboundmodule.config_file_verbosity_get, _unboundmodule.config_file_verbosity_set)
    stat_interval = property(_unboundmodule.config_file_stat_interval_get, _unboundmodule.config_file_stat_interval_set)
    stat_cumulative = property(_unboundmodule.config_file_stat_cumulative_get, _unboundmodule.config_file_stat_cumulative_set)
    stat_extended = property(_unboundmodule.config_file_stat_extended_get, _unboundmodule.config_file_stat_extended_set)
    num_threads = property(_unboundmodule.config_file_num_threads_get, _unboundmodule.config_file_num_threads_set)
    port = property(_unboundmodule.config_file_port_get, _unboundmodule.config_file_port_set)
    do_ip4 = property(_unboundmodule.config_file_do_ip4_get, _unboundmodule.config_file_do_ip4_set)
    do_ip6 = property(_unboundmodule.config_file_do_ip6_get, _unboundmodule.config_file_do_ip6_set)
    do_udp = property(_unboundmodule.config_file_do_udp_get, _unboundmodule.config_file_do_udp_set)
    do_tcp = property(_unboundmodule.config_file_do_tcp_get, _unboundmodule.config_file_do_tcp_set)
    outgoing_num_ports = property(_unboundmodule.config_file_outgoing_num_ports_get, _unboundmodule.config_file_outgoing_num_ports_set)
    outgoing_num_tcp = property(_unboundmodule.config_file_outgoing_num_tcp_get, _unboundmodule.config_file_outgoing_num_tcp_set)
    incoming_num_tcp = property(_unboundmodule.config_file_incoming_num_tcp_get, _unboundmodule.config_file_incoming_num_tcp_set)
    outgoing_avail_ports = property(_unboundmodule.config_file_outgoing_avail_ports_get, _unboundmodule.config_file_outgoing_avail_ports_set)
    msg_buffer_size = property(_unboundmodule.config_file_msg_buffer_size_get, _unboundmodule.config_file_msg_buffer_size_set)
    msg_cache_size = property(_unboundmodule.config_file_msg_cache_size_get, _unboundmodule.config_file_msg_cache_size_set)
    msg_cache_slabs = property(_unboundmodule.config_file_msg_cache_slabs_get, _unboundmodule.config_file_msg_cache_slabs_set)
    num_queries_per_thread = property(_unboundmodule.config_file_num_queries_per_thread_get, _unboundmodule.config_file_num_queries_per_thread_set)
    jostle_time = property(_unboundmodule.config_file_jostle_time_get, _unboundmodule.config_file_jostle_time_set)
    rrset_cache_size = property(_unboundmodule.config_file_rrset_cache_size_get, _unboundmodule.config_file_rrset_cache_size_set)
    rrset_cache_slabs = property(_unboundmodule.config_file_rrset_cache_slabs_get, _unboundmodule.config_file_rrset_cache_slabs_set)
    host_ttl = property(_unboundmodule.config_file_host_ttl_get, _unboundmodule.config_file_host_ttl_set)
    infra_cache_slabs = property(_unboundmodule.config_file_infra_cache_slabs_get, _unboundmodule.config_file_infra_cache_slabs_set)
    infra_cache_numhosts = property(_unboundmodule.config_file_infra_cache_numhosts_get, _unboundmodule.config_file_infra_cache_numhosts_set)
    target_fetch_policy = property(_unboundmodule.config_file_target_fetch_policy_get, _unboundmodule.config_file_target_fetch_policy_set)
    if_automatic = property(_unboundmodule.config_file_if_automatic_get, _unboundmodule.config_file_if_automatic_set)
    num_ifs = property(_unboundmodule.config_file_num_ifs_get, _unboundmodule.config_file_num_ifs_set)
    num_out_ifs = property(_unboundmodule.config_file_num_out_ifs_get, _unboundmodule.config_file_num_out_ifs_set)
    root_hints = property(_unboundmodule.config_file_root_hints_get, _unboundmodule.config_file_root_hints_set)
    stubs = property(_unboundmodule.config_file_stubs_get, _unboundmodule.config_file_stubs_set)
    forwards = property(_unboundmodule.config_file_forwards_get, _unboundmodule.config_file_forwards_set)
    donotqueryaddrs = property(_unboundmodule.config_file_donotqueryaddrs_get, _unboundmodule.config_file_donotqueryaddrs_set)
    acls = property(_unboundmodule.config_file_acls_get, _unboundmodule.config_file_acls_set)
    donotquery_localhost = property(_unboundmodule.config_file_donotquery_localhost_get, _unboundmodule.config_file_donotquery_localhost_set)
    harden_short_bufsize = property(_unboundmodule.config_file_harden_short_bufsize_get, _unboundmodule.config_file_harden_short_bufsize_set)
    harden_large_queries = property(_unboundmodule.config_file_harden_large_queries_get, _unboundmodule.config_file_harden_large_queries_set)
    harden_glue = property(_unboundmodule.config_file_harden_glue_get, _unboundmodule.config_file_harden_glue_set)
    harden_unverified_glue = property(_unboundmodule.config_file_harden_unverified_glue_get, _unboundmodule.config_file_harden_unverified_glue_set)
    harden_dnssec_stripped = property(_unboundmodule.config_file_harden_dnssec_stripped_get, _unboundmodule.config_file_harden_dnssec_stripped_set)
    harden_referral_path = property(_unboundmodule.config_file_harden_referral_path_get, _unboundmodule.config_file_harden_referral_path_set)
    use_caps_bits_for_id = property(_unboundmodule.config_file_use_caps_bits_for_id_get, _unboundmodule.config_file_use_caps_bits_for_id_set)
    private_address = property(_unboundmodule.config_file_private_address_get, _unboundmodule.config_file_private_address_set)
    private_domain = property(_unboundmodule.config_file_private_domain_get, _unboundmodule.config_file_private_domain_set)
    unwanted_threshold = property(_unboundmodule.config_file_unwanted_threshold_get, _unboundmodule.config_file_unwanted_threshold_set)
    chrootdir = property(_unboundmodule.config_file_chrootdir_get, _unboundmodule.config_file_chrootdir_set)
    username = property(_unboundmodule.config_file_username_get, _unboundmodule.config_file_username_set)
    directory = property(_unboundmodule.config_file_directory_get, _unboundmodule.config_file_directory_set)
    logfile = property(_unboundmodule.config_file_logfile_get, _unboundmodule.config_file_logfile_set)
    pidfile = property(_unboundmodule.config_file_pidfile_get, _unboundmodule.config_file_pidfile_set)
    use_syslog = property(_unboundmodule.config_file_use_syslog_get, _unboundmodule.config_file_use_syslog_set)
    hide_identity = property(_unboundmodule.config_file_hide_identity_get, _unboundmodule.config_file_hide_identity_set)
    hide_version = property(_unboundmodule.config_file_hide_version_get, _unboundmodule.config_file_hide_version_set)
    identity = property(_unboundmodule.config_file_identity_get, _unboundmodule.config_file_identity_set)
    version = property(_unboundmodule.config_file_version_get, _unboundmodule.config_file_version_set)
    module_conf = property(_unboundmodule.config_file_module_conf_get, _unboundmodule.config_file_module_conf_set)
    trust_anchor_file_list = property(_unboundmodule.config_file_trust_anchor_file_list_get, _unboundmodule.config_file_trust_anchor_file_list_set)
    trust_anchor_list = property(_unboundmodule.config_file_trust_anchor_list_get, _unboundmodule.config_file_trust_anchor_list_set)
    trusted_keys_file_list = property(_unboundmodule.config_file_trusted_keys_file_list_get, _unboundmodule.config_file_trusted_keys_file_list_set)
    max_ttl = property(_unboundmodule.config_file_max_ttl_get, _unboundmodule.config_file_max_ttl_set)
    val_date_override = property(_unboundmodule.config_file_val_date_override_get, _unboundmodule.config_file_val_date_override_set)
    bogus_ttl = property(_unboundmodule.config_file_bogus_ttl_get, _unboundmodule.config_file_bogus_ttl_set)
    val_clean_additional = property(_unboundmodule.config_file_val_clean_additional_get, _unboundmodule.config_file_val_clean_additional_set)
    val_permissive_mode = property(_unboundmodule.config_file_val_permissive_mode_get, _unboundmodule.config_file_val_permissive_mode_set)
    val_nsec3_key_iterations = property(_unboundmodule.config_file_val_nsec3_key_iterations_get, _unboundmodule.config_file_val_nsec3_key_iterations_set)
    key_cache_size = property(_unboundmodule.config_file_key_cache_size_get, _unboundmodule.config_file_key_cache_size_set)
    key_cache_slabs = property(_unboundmodule.config_file_key_cache_slabs_get, _unboundmodule.config_file_key_cache_slabs_set)
    neg_cache_size = property(_unboundmodule.config_file_neg_cache_size_get, _unboundmodule.config_file_neg_cache_size_set)
    local_zones = property(_unboundmodule.config_file_local_zones_get, _unboundmodule.config_file_local_zones_set)
    local_zones_nodefault = property(_unboundmodule.config_file_local_zones_nodefault_get, _unboundmodule.config_file_local_zones_nodefault_set)
    local_data = property(_unboundmodule.config_file_local_data_get, _unboundmodule.config_file_local_data_set)
    remote_control_enable = property(_unboundmodule.config_file_remote_control_enable_get, _unboundmodule.config_file_remote_control_enable_set)
    control_ifs = property(_unboundmodule.config_file_control_ifs_get, _unboundmodule.config_file_control_ifs_set)
    control_port = property(_unboundmodule.config_file_control_port_get, _unboundmodule.config_file_control_port_set)
    server_key_file = property(_unboundmodule.config_file_server_key_file_get, _unboundmodule.config_file_server_key_file_set)
    server_cert_file = property(_unboundmodule.config_file_server_cert_file_get, _unboundmodule.config_file_server_cert_file_set)
    control_key_file = property(_unboundmodule.config_file_control_key_file_get, _unboundmodule.config_file_control_key_file_set)
    control_cert_file = property(_unboundmodule.config_file_control_cert_file_get, _unboundmodule.config_file_control_cert_file_set)
    do_daemonize = property(_unboundmodule.config_file_do_daemonize_get, _unboundmodule.config_file_do_daemonize_set)

    ifs = property(_unboundmodule._get_ifs_tuple)
    out_ifs = property(_unboundmodule._get_ifs_out_tuple)

    def _deprecated_python_script(self): return "cfg.python_script is deprecated, you can use `mod_env['script']` instead."
    python_script = property(_deprecated_python_script)


    def __init__(self):
        _unboundmodule.config_file_swiginit(self, _unboundmodule.new_config_file())
    __swig_destroy__ = _unboundmodule.delete_config_file

# Register config_file in _unboundmodule:
_unboundmodule.config_file_swigregister(config_file)

def _get_ifs_tuple(cfg):
    return _unboundmodule._get_ifs_tuple(cfg)

def _get_ifs_out_tuple(cfg):
    return _unboundmodule._get_ifs_out_tuple(cfg)
class delegpt_ns(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    next = property(_unboundmodule.delegpt_ns_next_get, _unboundmodule.delegpt_ns_next_set)
    resolved = property(_unboundmodule.delegpt_ns_resolved_get, _unboundmodule.delegpt_ns_resolved_set)
    got4 = property(_unboundmodule.delegpt_ns_got4_get, _unboundmodule.delegpt_ns_got4_set)
    got6 = property(_unboundmodule.delegpt_ns_got6_get, _unboundmodule.delegpt_ns_got6_set)
    lame = property(_unboundmodule.delegpt_ns_lame_get, _unboundmodule.delegpt_ns_lame_set)
    done_pside4 = property(_unboundmodule.delegpt_ns_done_pside4_get, _unboundmodule.delegpt_ns_done_pside4_set)
    done_pside6 = property(_unboundmodule.delegpt_ns_done_pside6_get, _unboundmodule.delegpt_ns_done_pside6_set)

    dname = property(_unboundmodule._get_dpns_dname)

    dname_list = property(_unboundmodule._get_dpns_dname_components)

    def _get_dname_str(self): return dnameAsStr(self.dname)
    dname_str = property(_get_dname_str)


    def __init__(self):
        _unboundmodule.delegpt_ns_swiginit(self, _unboundmodule.new_delegpt_ns())
    __swig_destroy__ = _unboundmodule.delete_delegpt_ns

# Register delegpt_ns in _unboundmodule:
_unboundmodule.delegpt_ns_swigregister(delegpt_ns)
class delegpt_addr(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    next_result = property(_unboundmodule.delegpt_addr_next_result_get, _unboundmodule.delegpt_addr_next_result_set)
    next_usable = property(_unboundmodule.delegpt_addr_next_usable_get, _unboundmodule.delegpt_addr_next_usable_set)
    next_target = property(_unboundmodule.delegpt_addr_next_target_get, _unboundmodule.delegpt_addr_next_target_set)
    attempts = property(_unboundmodule.delegpt_addr_attempts_get, _unboundmodule.delegpt_addr_attempts_set)
    sel_rtt = property(_unboundmodule.delegpt_addr_sel_rtt_get, _unboundmodule.delegpt_addr_sel_rtt_set)
    bogus = property(_unboundmodule.delegpt_addr_bogus_get, _unboundmodule.delegpt_addr_bogus_set)
    lame = property(_unboundmodule.delegpt_addr_lame_get, _unboundmodule.delegpt_addr_lame_set)

    def _addr_get(self): return _delegpt_addr_addr_get(self)
    addr = property(_addr_get)


    def __init__(self):
        _unboundmodule.delegpt_addr_swiginit(self, _unboundmodule.new_delegpt_addr())
    __swig_destroy__ = _unboundmodule.delete_delegpt_addr

# Register delegpt_addr in _unboundmodule:
_unboundmodule.delegpt_addr_swigregister(delegpt_addr)
class delegpt(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    namelabs = property(_unboundmodule.delegpt_namelabs_get, _unboundmodule.delegpt_namelabs_set)
    nslist = property(_unboundmodule.delegpt_nslist_get, _unboundmodule.delegpt_nslist_set)
    target_list = property(_unboundmodule.delegpt_target_list_get, _unboundmodule.delegpt_target_list_set)
    usable_list = property(_unboundmodule.delegpt_usable_list_get, _unboundmodule.delegpt_usable_list_set)
    result_list = property(_unboundmodule.delegpt_result_list_get, _unboundmodule.delegpt_result_list_set)
    bogus = property(_unboundmodule.delegpt_bogus_get, _unboundmodule.delegpt_bogus_set)
    has_parent_side_NS = property(_unboundmodule.delegpt_has_parent_side_NS_get, _unboundmodule.delegpt_has_parent_side_NS_set)
    dp_type_mlc = property(_unboundmodule.delegpt_dp_type_mlc_get, _unboundmodule.delegpt_dp_type_mlc_set)

    dname = property(_unboundmodule._get_dp_dname)

    dname_list = property(_unboundmodule._get_dp_dname_components)

    def _get_dname_str(self): return dnameAsStr(self.dname)
    dname_str = property(_get_dname_str)


    def __init__(self):
        _unboundmodule.delegpt_swiginit(self, _unboundmodule.new_delegpt())
    __swig_destroy__ = _unboundmodule.delete_delegpt

# Register delegpt in _unboundmodule:
_unboundmodule.delegpt_swigregister(delegpt)

def _get_dp_dname(dp):
    return _unboundmodule._get_dp_dname(dp)

def _get_dp_dname_components(dp):
    return _unboundmodule._get_dp_dname_components(dp)

def _get_dpns_dname(dpns):
    return _unboundmodule._get_dpns_dname(dpns)

def _get_dpns_dname_components(dpns):
    return _unboundmodule._get_dpns_dname_components(dpns)

def _delegpt_addr_addr_get(target):
    return _unboundmodule._delegpt_addr_addr_get(target)
MODULE_STATE_INITIAL = _unboundmodule.MODULE_STATE_INITIAL
MODULE_WAIT_REPLY = _unboundmodule.MODULE_WAIT_REPLY
MODULE_WAIT_MODULE = _unboundmodule.MODULE_WAIT_MODULE
MODULE_RESTART_NEXT = _unboundmodule.MODULE_RESTART_NEXT
MODULE_WAIT_SUBQUERY = _unboundmodule.MODULE_WAIT_SUBQUERY
MODULE_ERROR = _unboundmodule.MODULE_ERROR
MODULE_FINISHED = _unboundmodule.MODULE_FINISHED
MODULE_EVENT_NEW = _unboundmodule.MODULE_EVENT_NEW
MODULE_EVENT_PASS = _unboundmodule.MODULE_EVENT_PASS
MODULE_EVENT_REPLY = _unboundmodule.MODULE_EVENT_REPLY
MODULE_EVENT_NOREPLY = _unboundmodule.MODULE_EVENT_NOREPLY
MODULE_EVENT_CAPSFAIL = _unboundmodule.MODULE_EVENT_CAPSFAIL
MODULE_EVENT_MODDONE = _unboundmodule.MODULE_EVENT_MODDONE
MODULE_EVENT_ERROR = _unboundmodule.MODULE_EVENT_ERROR
sec_status_unchecked = _unboundmodule.sec_status_unchecked
sec_status_bogus = _unboundmodule.sec_status_bogus
sec_status_indeterminate = _unboundmodule.sec_status_indeterminate
sec_status_insecure = _unboundmodule.sec_status_insecure
sec_status_secure = _unboundmodule.sec_status_secure
NO_VERBOSE = _unboundmodule.NO_VERBOSE
VERB_OPS = _unboundmodule.VERB_OPS
VERB_DETAIL = _unboundmodule.VERB_DETAIL
VERB_QUERY = _unboundmodule.VERB_QUERY
VERB_ALGO = _unboundmodule.VERB_ALGO
inplace_cb_reply = _unboundmodule.inplace_cb_reply
inplace_cb_reply_cache = _unboundmodule.inplace_cb_reply_cache
inplace_cb_reply_local = _unboundmodule.inplace_cb_reply_local
inplace_cb_reply_servfail = _unboundmodule.inplace_cb_reply_servfail
inplace_cb_query = _unboundmodule.inplace_cb_query
inplace_cb_edns_back_parsed = _unboundmodule.inplace_cb_edns_back_parsed
inplace_cb_types_total = _unboundmodule.inplace_cb_types_total
PKT_QR = _unboundmodule.PKT_QR
PKT_AA = _unboundmodule.PKT_AA
PKT_TC = _unboundmodule.PKT_TC
PKT_RD = _unboundmodule.PKT_RD
PKT_CD = _unboundmodule.PKT_CD
PKT_RA = _unboundmodule.PKT_RA
PKT_AD = _unboundmodule.PKT_AD

def set_return_msg(qstate, rr_name, rr_type, rr_class, flags, default_ttl, question, answer, authority, additional):
    return _unboundmodule.set_return_msg(qstate, rr_name, rr_type, rr_class, flags, default_ttl, question, answer, authority, additional)

class DNSMessage:
    def __init__(self, rr_name, rr_type, rr_class = RR_CLASS_IN, query_flags = 0, default_ttl = 0):
        """Query flags is a combination of PKT_xx constants"""
        self.rr_name = rr_name
        self.rr_type = rr_type
        self.rr_class = rr_class
        self.default_ttl = default_ttl
        self.query_flags = query_flags
        self.question = []
        self.answer = []
        self.authority = []
        self.additional = []

    def set_return_msg(self, qstate):
        """Returns 1 if OK"""
        status = _unboundmodule.set_return_msg(qstate, self.rr_name, self.rr_type, self.rr_class,
                                       self.query_flags, self.default_ttl,
                                       self.question, self.answer, self.authority, self.additional)

        if (status) and (PKT_AA & self.query_flags):
            qstate.return_msg.rep.authoritative = 1

        return status



def dns_cache_find_delegation(env, qname, qnamelen, qtype, qclass, region, msg, timenow, noexpiredabove, expiretop, expiretoplen):
    return _unboundmodule.dns_cache_find_delegation(env, qname, qnamelen, qtype, qclass, region, msg, timenow, noexpiredabove, expiretop, expiretoplen)

def iter_dp_is_useless(qinfo, qflags, dp, supports_ipv4, supports_ipv6, use_nat64):
    return _unboundmodule.iter_dp_is_useless(qinfo, qflags, dp, supports_ipv4, supports_ipv6, use_nat64)

def hints_lookup_stub(hints, qname, qclass, dp, nolock):
    return _unboundmodule.hints_lookup_stub(hints, qname, qclass, dp, nolock)

def find_delegation(qstate, nm, nmlen):
    return _unboundmodule.find_delegation(qstate, nm, nmlen)

def unbound_verbose(*args):
    return _unboundmodule.unbound_verbose(*args)

def unbound_log_info(*args):
    return _unboundmodule.unbound_log_info(*args)

def unbound_log_err(*args):
    return _unboundmodule.unbound_log_err(*args)

def unbound_log_warn(*args):
    return _unboundmodule.unbound_log_warn(*args)

def log_hex(msg, data, length):
    return _unboundmodule.log_hex(msg, data, length)

def log_dns_msg(str, qinfo, rep):
    return _unboundmodule.log_dns_msg(str, qinfo, rep)

def log_query_info(v, str, qinf):
    return _unboundmodule.log_query_info(v, str, qinf)

def regional_log_stats(r):
    return _unboundmodule.regional_log_stats(r)

def log_info(str):
    return _unboundmodule.log_info(str)

def log_err(str):
    return _unboundmodule.log_err(str)

def log_warn(str):
    return _unboundmodule.log_warn(str)

def verbose(level, str):
    return _unboundmodule.verbose(level, str)

def sldns_wire2str_type(atype):
    return _unboundmodule.sldns_wire2str_type(atype)

def sldns_wire2str_class(aclass):
    return _unboundmodule.sldns_wire2str_class(aclass)

def storeQueryInCache(qstate, qinfo, msgrep, is_referral):
    return _unboundmodule.storeQueryInCache(qstate, qinfo, msgrep, is_referral)

def invalidateQueryInCache(qstate, qinfo):
    return _unboundmodule.invalidateQueryInCache(qstate, qinfo)

def strextstate(s):
    return _unboundmodule.strextstate(s)

def strmodulevent(e):
    return _unboundmodule.strmodulevent(e)

def edns_opt_list_find(list, code):
    return _unboundmodule.edns_opt_list_find(list, code)

def edns_register_option(opt_code, bypass_cache_stage, no_aggregation, env):
    return _unboundmodule.edns_register_option(opt_code, bypass_cache_stage, no_aggregation, env)

def register_edns_option(env, code, bypass_cache_stage=False,
                         no_aggregation=False):
    """Wrapper function to provide keyword attributes."""
    return edns_register_option(code, bypass_cache_stage,
                                no_aggregation, env)


def edns_opt_list_remove(list, code):
    return _unboundmodule.edns_opt_list_remove(list, code)

def edns_opt_list_append(list, code, len, region):
    return _unboundmodule.edns_opt_list_append(list, code, len, region)

def inplace_cb_register(cb, type, cbarg, env, id):
    return _unboundmodule.inplace_cb_register(cb, type, cbarg, env, id)

def register_inplace_cb_reply(py_cb, env, id):
    return _unboundmodule.register_inplace_cb_reply(py_cb, env, id)

def register_inplace_cb_reply_cache(py_cb, env, id):
    return _unboundmodule.register_inplace_cb_reply_cache(py_cb, env, id)

def register_inplace_cb_reply_local(py_cb, env, id):
    return _unboundmodule.register_inplace_cb_reply_local(py_cb, env, id)

def register_inplace_cb_reply_servfail(py_cb, env, id):
    return _unboundmodule.register_inplace_cb_reply_servfail(py_cb, env, id)

def register_inplace_cb_query(py_cb, env, id):
    return _unboundmodule.register_inplace_cb_query(py_cb, env, id)

def register_inplace_cb_query_response(py_cb, env, id):
    return _unboundmodule.register_inplace_cb_query_response(py_cb, env, id)

def register_inplace_cb_edns_back_parsed_call(py_cb, env, id):
    return _unboundmodule.register_inplace_cb_edns_back_parsed_call(py_cb, env, id)

