BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //lib64/python3.6/site-packages/__pycache__/unbound.cpython-36.pyc
3

�	�h`��@s2ddlmZesdekr&ddlmZnddlZyddlZWne	k
rVddlZYnXdd�Z
dd	�Zd
d�Zdd
�Z
Gdd�de�ZddlZyddlZWne	k
r�ddlZYnXde�kr�eZdd�Zdd�ZejZejZejZejZejZejZejZejZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'Z'ej(Z(ej)Z)ej*Z*ej+Z+ej,Z,ej-Z-ej.Z.ej/Z/ej0Z0ej1Z1ej2Z2ej3Z3ej4Z4ej5Z5ej6Z6ej7Z7ej8Z8ej9Z9ej:Z:ej;Z;ej<Z<ej=Z=ej>Z>ej?Z?ej@Z@ejAZAejBZBejCZCejDZDejEZEejFZFejGZGejHZHejIZIejJZJejKZKejLZLejMZMejNZNejOZOejPZPejQZQejRZRejSZSejTZTejUZUejVZVejWZWejXZXejYZYejZZZdd�Z[ej\Z\ej]Z]ej^Z^ej_Z_ej`Z`ejaZaejbZbejcZcejdZdejeZeejfZfGdd�d�ZgejhZhejiZiejjZjejkZkejlZlejmZmGdd�den�Zoejpeo�ejqZqejrZrejsZsejtZtejuZuejvZvejwZwejxZxejyZyejzZzej{Z{dd�Z|dd�Z}dd �Z~d!d"�Zd#d$�Z�d%d&�Z�d'd(�Z�d)d*�Z�d+d,�Z�d-d.�Z�d/d0�Z�d1d2�Z�d3d4�Z�d5d6�Z�d7d8�Z�d9d:�Z�d;d<�Z�d=d>�Z�d?d@�Z�dAdB�Z�dCdD�Z�dEdF�Z�dGdH�Z�dIdJ�Z�dKdL�Z�dMdN�Z�dOdP�Z�dQdR�Z�dSdT�Z�dUdV�Z�dWdX�Z�GdYdZ�dZen�Z�ej�e��Gd[d\�d\en�Z�ej�e��Gd]d^�d^en�Z�ej�e��ej�Z�ej�Z�ej�Z�ej�Z�ej�Z�ej�Z�Gd_d`�d`en�Z�ej�e��Gdadb�dben�Z�ej�e��Gdcdd�dden�Z�ej�e��dedf�Z�dgdh�Z�ej�Z�didj�Z�dkdl�Z�dmdn�Z�dS)o�)�version_info�.�)�_unboundNcCsDyd|jj�}Wntjk
r,d}YnXd|jj|jj|fS)Nz	proxy of �z<%s.%s; %s >)�this�__repr__�__builtin__�	Exception�	__class__�
__module__�__name__)�selfZstrthis�r�/usr/lib64/python3.6/unbound.py�
_swig_reprs

rcs�fdd�}|S)Ncsh|dkr�|||�nN|dkr,|jj|�n8t||�rXttt|�|�t�rX�|||�ntd|��dS)Nr�thisownz(You cannot add instance attributes to %s)r�own�hasattr�
isinstance�getattr�type�property�AttributeError)r�name�value)�setrr�set_instance_attrszE_swig_setattr_nondynamic_instance_variable.<locals>.set_instance_attrr)rrr)rr�*_swig_setattr_nondynamic_instance_variables	rcs�fdd�}|S)Ncs:t||�r*tt||�t�r*�|||�ntd|��dS)Nz%You cannot add class attributes to %s)rrrrr)�clsrr)rrr�set_class_attr)sz?_swig_setattr_nondynamic_class_variable.<locals>.set_class_attrr)rr r)rr�'_swig_setattr_nondynamic_class_variable(sr!cs�fdd�}|S)zlClass decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclasscs�|j|j|jj��S)N)r
�	__bases__�__dict__�copy)r)�	metaclassrr�wrapper3sz$_swig_add_metaclass.<locals>.wrapperr)r%r&r)r%r�_swig_add_metaclass1sr'c@seZdZdZeej�ZdS)�_SwigNonDynamicMetazKMeta class to enforce nondynamic attributes (no new attributes) for a classN)r
r�__qualname__�__doc__r!r�__setattr__rrrrr(8sr(�bytescCst|t�r|Stj|�S)N)r�int�builtins�ord)�srrrr/Hs
r/cCs
tj|�S)N)r�ub_ctx_free_dbg)�crrrr1Nsr1cCs
tj|�S)N)r�ub_resolve_free_dbg)�rrrrr3�sr3c@s�eZdZdZdd�Zdd�Zeddd��Zd	d
�Ze	edd�Z
d
d�Ze	edd�Zdd�Z
e	e
dd�Zdd�Ze	edd�Zdd�Ze	edd�Zdd�Ze	edd�ZdS)�ub_dataz3Class which makes the resolution results accessiblecCs|dkrtd��||_dS)zZCreates ub_data class
         :param data: a list of the result data in RAW format
      Nzub_data init: No data)r
�data)rr6rrr�__init__�szub_data.__init__cCsdjdd�|jD��S)zRepresents data as string�;cSs g|]}djtdd�|���qS)� cSsdt|�S)Nz%02X)r/)�xrrr�<lambda>�sz,ub_data.__str__.<locals>.<listcomp>.<lambda>)�join�map)�.0�arrr�
<listcomp>�sz#ub_data.__str__.<locals>.<listcomp>)r<r6)rrrr�__str__�szub_data.__str__rcCsz|sgSg}t|�}|dkr&t||�}|}xJ||krtt||�}|jt||d|d|�j���||d7}q,W|S)z�Parses DNAME and produces a list of labels

         :param ofs: where the conversion should start to parse data
         :param maxlen: maximum length (0 means parse to the end)
         :returns: list of labels (string)
      rr)�len�minr/�append�str�decode)r0Zofs�maxlen�resZslen�idxZcomplenrrr�	dname2str�s

&zub_data.dname2strcCs|jS)zReturns a list of RAW strings)r6)rrrr�as_raw_data�szub_data.as_raw_datazLReturns RAW data (a list of binary encoded strings). See :meth:`as_raw_data`)�doccs�fdd��jD�S)zzRepresents data as a list of MX records (query for RR_TYPE_MX)

         :returns: list of tuples (priority, dname)
      csDg|]<}dt|d�t|d�djdd��j|d�D��f�qS)�rrrcSsg|]}|�qSrr)r>r?rrrr@�sz1ub_data.as_mx_list.<locals>.<listcomp>.<listcomp>�)r/r<rJ)r>�rdf)rrrr@�sz&ub_data.as_mx_list.<locals>.<listcomp>)r6)rr)rr�
as_mx_list�szub_data.as_mx_listzUReturns a list of tuples containing priority and domain names. See :meth:`as_mx_list`cs�fdd��jD�S)z�Represents data as a list of MX records (query for RR_TYPE_MX)

         :returns: list of tuples (priority, unicode dname)
      csDg|]<}dt|d�t|d�djdd��j|d�D��f�qS)rMrrrcSsg|]}tjj|��qSr)�	encodings�idna�	ToUnicode)r>r?rrrr@�sz5ub_data.as_idn_mx_list.<locals>.<listcomp>.<listcomp>rN)r/r<rJ)r>rO)rrrr@�sz*ub_data.as_idn_mx_list.<locals>.<listcomp>)r6)rr)rr�as_idn_mx_list�szub_data.as_idn_mx_listz]Returns a list of tuples containing priority and IDN domain names. See :meth:`as_idn_mx_list`cCsdd�|jD�S)zlRepresents data as a list of IP addresses (query for RR_TYPE_PTR)

         :returns: list of strings
      cSs g|]}djtdd�|���qS)rcSstt|��S)N)rEr/)r:rrrr;�sz4ub_data.as_address_list.<locals>.<listcomp>.<lambda>)r<r=)r>r?rrrr@�sz+ub_data.as_address_list.<locals>.<listcomp>)r6)rrrr�as_address_list�szub_data.as_address_listz;Returns a list of IP addresses. See :meth:`as_address_list`cst�fdd��j�S)zjRepresents data as a list of domain names (query for RR_TYPE_A)

         :returns: list of strings
      csdj�j|��S)Nr)r<rJ)r:)rrrr;�sz(ub_data.as_domain_list.<locals>.<lambda>)r=r6)rr)rr�as_domain_list�szub_data.as_domain_listz:Returns a list of domain names. See :meth:`as_domain_list`cst�fdd��j�S)zrRepresents data as a list of unicode domain names (query for RR_TYPE_A)

         :returns: list of strings
      csdjdd��j|�D��S)NrcSsg|]}tjj|��qSr)rQrRrS)r>r?rrrr@�sz@ub_data.as_idn_domain_list.<locals>.<lambda>.<locals>.<listcomp>)r<rJ)r:)rrrr;�sz,ub_data.as_idn_domain_list.<locals>.<lambda>)r=r6)rr)rr�as_idn_domain_list�szub_data.as_idn_domain_listzBReturns a list of IDN domain names. See :meth:`as_idn_domain_list`N)rr)r
rr)r*r7rA�staticmethodrJrKr�rawrPZmx_listrTZmx_list_idnrUZaddress_listrVZdomain_listrWZdomain_list_idnrrrrr5�s"r5c@s�eZdZdZedd�dd�dd�Zdd�ZeZee	j
e	j�Zee	j
e	j�Zee	je	j�Zee	je	j�Zee	je	j�Zee	je	j�Zee	je	j�Zee	je	j �Z!ee	j"e	j#�Z$ee	j%e	j&�Z'ee	j(e	j)�Z*ee	j+e	j,�Z-ee	j.e	j/�Z0ee	j1e	j2�Z3ee	j4e	j5�Z6ee	j7e	j8�Z9d	d
�Z:dd�Z;d
d�Ze	j<Z=e>de?de@deAdeBdeCdeDdeEdeFdeGdeHdiZIdd�ZJeeJ�ZKdd�ZLeeLdd�ZMdd�ZNee;�ZOeeNd d�ZPd!S)"�	ub_resultz&The validation and resolution results.cCs
|jj�S)N)rr)r:rrrr;szub_result.<lambda>cCs|jj|�S)N)rr)r:�vrrrr;szThe membership flag)rLcOstd��dS)NzNo constructor defined)r)r�args�kwargsrrrr7szub_result.__init__cCstj||�S)N)rZub_result__ub_result_data)r�resultrrr�_ub_result_dataszub_result._ub_result_datacCs
tj|�S)N)rZub_result__packet)rrrr�_packetszub_result._packetcCstd��dS)Nz%This class can't be created directly.)r
)rrrrr7"szno errorz
form errorz	serv failz	nx domainznot implementedZrefusedZyxdomainZyxrrsetZnxrrsetznot authznot zonecCs|j|jS)zRReturns rcode in display representation form

           :returns: string
        )�	rcode2str�rcode)rrrr�_get_rcode_str,szub_result._get_rcode_strcCs
|j|�S)aResult data, a list of network order DNS rdata items. 

           Data are represented as a list of strings. To decode RAW data to the list of IP addresses use :attr:`data` attribute which returns an :class:`ub_data` instance containing conversion function.
        )r_)rrrr�
_get_raw_data5szub_result._get_raw_dataz�Returns raw data, a list of rdata items. To decode RAW data use the :attr:`data` attribute which returns an instance of :class:`ub_data` containing the conversion functions.cCs|js
dSt|j|��S)N)�havedatar5r_)rrrr�	_get_data>szub_result._get_datazOReturns :class:`ub_data` instance containing various decoding functions or NoneN)Qr
rr)r*rrr7rrrZub_result_qname_getZub_result_qname_setZqnameZub_result_qtype_getZub_result_qtype_set�qtypeZub_result_qclass_getZub_result_qclass_set�qclassZub_result__data_getZub_result__data_set�_dataZub_result_len_getZub_result_len_setrBZub_result_canonname_getZub_result_canonname_setZ	canonnameZub_result_rcode_getZub_result_rcode_setrbZub_result_answer_packet_getZub_result_answer_packet_setZ
answer_packetZub_result_answer_len_getZub_result_answer_len_setZ
answer_lenZub_result_havedata_getZub_result_havedata_setreZub_result_nxdomain_getZub_result_nxdomain_setZnxdomainZub_result_secure_getZub_result_secure_setZsecureZub_result_bogus_getZub_result_bogus_setZbogusZub_result_why_bogus_getZub_result_why_bogus_setZ	why_bogusZub_result_ttl_getZub_result_ttl_setZttlZub_result_was_ratelimited_getZub_result_was_ratelimited_setZwas_ratelimitedr_r`�_ub_resolve_free�__swig_destroy__�
RCODE_NOERROR�
RCODE_FORMERR�RCODE_SERVFAIL�RCODE_NXDOMAIN�
RCODE_NOTIMPL�
RCODE_REFUSED�RCODE_YXDOMAIN�
RCODE_YXRRSET�
RCODE_NXRRSET�
RCODE_NOTAUTH�
RCODE_NOTZONErarcZ	rcode_strrdZrawdatarfZpacketr6rrrrrZs@0rZcCstj�S)N)r�
ub_ctx_createrrrrrwUsrwcCs
tj|�S)N)r�_ub_ctx_delete)�ctxrrrrxXsrxcCstj|||�S)N)r�ub_ctx_set_option)ry�opt�valrrrrz[srzcCstj|||�S)N)r�ub_ctx_get_option)ryr{rErrrr}^sr}cCstj||�S)N)r�
ub_ctx_config)ry�fnamerrrr~asr~cCstj||�S)N)r�ub_ctx_set_fwd)ry�addrrrrr�dsr�cCstj||�S)N)r�ub_ctx_set_tls)ryZtlsrrrr�gsr�cCstj||||�S)N)r�ub_ctx_set_stub)ryZzoner�Zisprimerrrr�jsr�cCstj||�S)N)r�ub_ctx_resolvconf)ryrrrrr�msr�cCstj||�S)N)r�ub_ctx_hosts)ryrrrrr�psr�cCstj||�S)N)r�
ub_ctx_add_ta)ry�tarrrr�ssr�cCstj||�S)N)r�ub_ctx_add_ta_file)ryrrrrr�vsr�cCstj||�S)N)r�ub_ctx_add_ta_autr)ryrrrrr�ysr�cCstj||�S)N)r�ub_ctx_trustedkeys)ryrrrrr�|sr�cCstj||�S)N)r�ub_ctx_debuglevel)ry�drrrr�sr�cCstj||�S)N)r�ub_ctx_async)ry�dothreadrrrr��sr�cCs
tj|�S)N)r�ub_poll)ryrrrr��sr�cCs
tj|�S)N)r�ub_wait)ryrrrr��sr�cCs
tj|�S)N)r�ub_fd)ryrrrr��sr�cCs
tj|�S)N)r�
ub_process)ryrrrr��sr�cCstj||||�S)N)r�
ub_resolve)ryr�rrtype�rrclassrrrr��sr�cCstj|||||||�S)N)r�ub_resolve_async)ryrr�r��mydata�callback�async_idrrrr��sr�cCstj||�S)N)r�	ub_cancel)ryr�rrrr��sr�cCs
tj|�S)N)rrj)r^rrrrj�srjcCs
tj|�S)N)r�ub_strerror)�errrrrr��sr�cCs
tj|�S)N)r�ub_ctx_print_local_zones)ryrrrr��sr�cCstj|||�S)N)r�ub_ctx_zone_add)ry�	zone_nameZ	zone_typerrrr��sr�cCstj||�S)N)r�ub_ctx_zone_remove)ryr�rrrr��sr�cCstj||�S)N)r�ub_ctx_data_add)ryr6rrrr��sr�cCstj||�S)N)r�ub_ctx_data_remove)ryr6rrrr��sr�cCstj�S)N)r�
ub_versionrrrrr��sr�c@sVeZdZedd�dd�dd�ZeZeejej	�Z
eej�Zeej
�Zdd�ZejZdS)	�ub_shm_stat_infocCs
|jj�S)N)rr)r:rrrr;�szub_shm_stat_info.<lambda>cCs|jj|�S)N)rr)r:r[rrrr;�szThe membership flag)rLcCstj|tj��dS)N)rZub_shm_stat_info_swiginitZnew_ub_shm_stat_info)rrrrr7�szub_shm_stat_info.__init__N)r
rr)rrrrrZ ub_shm_stat_info_num_threads_getZ ub_shm_stat_info_num_threads_setZnum_threadsZub_shm_stat_info_time_getZtimeZub_shm_stat_info_mem_getZmemr7Zdelete_ub_shm_stat_inforkrrrrr��s

r�c@s�eZdZedd�dd�dd�ZeZeejej	�Z
eejej�Z
eejej�Zeejej�Zeejej�Zeejej�Zeejej�Zeejej�Zeej ej!�Z"eej#ej$�Z%dd�Z&ej'Z(dS)	�ub_shm_stat_info_memcCs
|jj�S)N)rr)r:rrrr;�szub_shm_stat_info_mem.<lambda>cCs|jj|�S)N)rr)r:r[rrrr;�szThe membership flag)rLcCstj|tj��dS)N)rZub_shm_stat_info_mem_swiginitZnew_ub_shm_stat_info_mem)rrrrr7�szub_shm_stat_info_mem.__init__N))r
rr)rrrrrZub_shm_stat_info_mem_msg_getZub_shm_stat_info_mem_msg_set�msgZub_shm_stat_info_mem_rrset_getZub_shm_stat_info_mem_rrset_setZrrsetZub_shm_stat_info_mem_val_getZub_shm_stat_info_mem_val_setr|Zub_shm_stat_info_mem_iter_getZub_shm_stat_info_mem_iter_set�iterZub_shm_stat_info_mem_subnet_getZub_shm_stat_info_mem_subnet_setZsubnetZ!ub_shm_stat_info_mem_ipsecmod_getZ!ub_shm_stat_info_mem_ipsecmod_setZipsecmodZub_shm_stat_info_mem_respip_getZub_shm_stat_info_mem_respip_setZrespipZ/ub_shm_stat_info_mem_dnscrypt_shared_secret_getZ/ub_shm_stat_info_mem_dnscrypt_shared_secret_setZdnscrypt_shared_secretZ'ub_shm_stat_info_mem_dnscrypt_nonce_getZ'ub_shm_stat_info_mem_dnscrypt_nonce_setZdnscrypt_nonceZub_shm_stat_info_mem_dynlib_getZub_shm_stat_info_mem_dynlib_setZdynlibr7Zdelete_ub_shm_stat_info_memrkrrrrr��sr�c@s�eZdZedd�dd�dd�ZeZeejej	�Z
eejej�Z
eejej�Zeejej�Zeejej�Zeejej�Zdd�ZejZdS)	�ub_shm_stat_info_timecCs
|jj�S)N)rr)r:rrrr;�szub_shm_stat_info_time.<lambda>cCs|jj|�S)N)rr)r:r[rrrr;�szThe membership flag)rLcCstj|tj��dS)N)rZub_shm_stat_info_time_swiginitZnew_ub_shm_stat_info_time)rrrrr7�szub_shm_stat_info_time.__init__N)r
rr)rrrrrZ!ub_shm_stat_info_time_now_sec_getZ!ub_shm_stat_info_time_now_sec_setZnow_secZ"ub_shm_stat_info_time_now_usec_getZ"ub_shm_stat_info_time_now_usec_setZnow_usecZ ub_shm_stat_info_time_up_sec_getZ ub_shm_stat_info_time_up_sec_setZup_secZ!ub_shm_stat_info_time_up_usec_getZ!ub_shm_stat_info_time_up_usec_setZup_usecZ%ub_shm_stat_info_time_elapsed_sec_getZ%ub_shm_stat_info_time_elapsed_sec_setZelapsed_secZ&ub_shm_stat_info_time_elapsed_usec_getZ&ub_shm_stat_info_time_elapsed_usec_setZelapsed_usecr7Zdelete_ub_shm_stat_info_timerkrrrrr��sr�c@s�eZdZedd�dd�dd�ZeZeejej	�Z
eejej�Z
eejej�Zeejej�Zeejej�Zeejej�Zeejej�Zeejej�Zeej ej!�Z"eej#ej$�Z%eej&ej'�Z(eej)ej*�Z+eej,ej-�Z.eej/ej0�Z1eej2ej3�Z4eej5ej6�Z7eej8ej9�Z:eej;ej<�Z=eej>ej?�Z@eejAejB�ZCeejDejE�ZFeejGejH�ZIeejJejK�ZLeejMejN�ZOeejPejQ�ZReejSejT�ZUeejVejW�ZXeejYejZ�Z[eej\ej]�Z^eej_ej`�Zaeejbejc�Zdeejeejf�Zgeejheji�Zjeejkejl�Zmeejnejo�Zpeejqejr�Zseejteju�Zveejwejx�Zyeejzej{�Z|eej}ej~�Zeej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�eej�ej��Z�dd�Z�ej�Z�dS)	�ub_server_statscCs
|jj�S)N)rr)r:rrrr;�szub_server_stats.<lambda>cCs|jj|�S)N)rr)r:r[rrrr;�szThe membership flag)rLcCstj|tj��dS)N)rZub_server_stats_swiginitZnew_ub_server_stats)rrrrr7*szub_server_stats.__init__N)�r
rr)rrrrrZub_server_stats_num_queries_getZub_server_stats_num_queries_setZnum_queriesZ.ub_server_stats_num_queries_ip_ratelimited_getZ.ub_server_stats_num_queries_ip_ratelimited_setZnum_queries_ip_ratelimitedZ,ub_server_stats_num_queries_missed_cache_getZ,ub_server_stats_num_queries_missed_cache_setZnum_queries_missed_cacheZ(ub_server_stats_num_queries_prefetch_getZ(ub_server_stats_num_queries_prefetch_setZnum_queries_prefetchZ'ub_server_stats_sum_query_list_size_getZ'ub_server_stats_sum_query_list_size_setZsum_query_list_sizeZ'ub_server_stats_max_query_list_size_getZ'ub_server_stats_max_query_list_size_setZmax_query_list_sizeZub_server_stats_extended_getZub_server_stats_extended_setZextendedZub_server_stats_qtype_getZub_server_stats_qtype_setrgZub_server_stats_qtype_big_getZub_server_stats_qtype_big_setZ	qtype_bigZub_server_stats_qclass_getZub_server_stats_qclass_setrhZub_server_stats_qclass_big_getZub_server_stats_qclass_big_setZ
qclass_bigZub_server_stats_qopcode_getZub_server_stats_qopcode_setZqopcodeZub_server_stats_qtcp_getZub_server_stats_qtcp_setZqtcpZ!ub_server_stats_qtcp_outgoing_getZ!ub_server_stats_qtcp_outgoing_setZ
qtcp_outgoingZ!ub_server_stats_qudp_outgoing_getZ!ub_server_stats_qudp_outgoing_setZ
qudp_outgoingZub_server_stats_qtls_getZub_server_stats_qtls_setZqtlsZub_server_stats_qhttps_getZub_server_stats_qhttps_setZqhttpsZub_server_stats_qipv6_getZub_server_stats_qipv6_setZqipv6Zub_server_stats_qbit_QR_getZub_server_stats_qbit_QR_setZqbit_QRZub_server_stats_qbit_AA_getZub_server_stats_qbit_AA_setZqbit_AAZub_server_stats_qbit_TC_getZub_server_stats_qbit_TC_setZqbit_TCZub_server_stats_qbit_RD_getZub_server_stats_qbit_RD_setZqbit_RDZub_server_stats_qbit_RA_getZub_server_stats_qbit_RA_setZqbit_RAZub_server_stats_qbit_Z_getZub_server_stats_qbit_Z_setZqbit_ZZub_server_stats_qbit_AD_getZub_server_stats_qbit_AD_setZqbit_ADZub_server_stats_qbit_CD_getZub_server_stats_qbit_CD_setZqbit_CDZub_server_stats_qEDNS_getZub_server_stats_qEDNS_setZqEDNSZub_server_stats_qEDNS_DO_getZub_server_stats_qEDNS_DO_setZqEDNS_DOZub_server_stats_ans_rcode_getZub_server_stats_ans_rcode_setZ	ans_rcodeZ$ub_server_stats_ans_rcode_nodata_getZ$ub_server_stats_ans_rcode_nodata_setZans_rcode_nodataZub_server_stats_ans_secure_getZub_server_stats_ans_secure_setZ
ans_secureZub_server_stats_ans_bogus_getZub_server_stats_ans_bogus_setZ	ans_bogusZub_server_stats_rrset_bogus_getZub_server_stats_rrset_bogus_setZrrset_bogusZ'ub_server_stats_queries_ratelimited_getZ'ub_server_stats_queries_ratelimited_setZqueries_ratelimitedZ$ub_server_stats_unwanted_replies_getZ$ub_server_stats_unwanted_replies_setZunwanted_repliesZ$ub_server_stats_unwanted_queries_getZ$ub_server_stats_unwanted_queries_setZunwanted_queriesZ$ub_server_stats_tcp_accept_usage_getZ$ub_server_stats_tcp_accept_usage_setZtcp_accept_usageZub_server_stats_ans_expired_getZub_server_stats_ans_expired_setZans_expiredZub_server_stats_hist_getZub_server_stats_hist_setZhistZ#ub_server_stats_msg_cache_count_getZ#ub_server_stats_msg_cache_count_setZmsg_cache_countZ%ub_server_stats_rrset_cache_count_getZ%ub_server_stats_rrset_cache_count_setZrrset_cache_countZ%ub_server_stats_infra_cache_count_getZ%ub_server_stats_infra_cache_count_setZinfra_cache_countZ#ub_server_stats_key_cache_count_getZ#ub_server_stats_key_cache_count_setZkey_cache_countZ.ub_server_stats_num_query_dnscrypt_crypted_getZ.ub_server_stats_num_query_dnscrypt_crypted_setZnum_query_dnscrypt_cryptedZ+ub_server_stats_num_query_dnscrypt_cert_getZ+ub_server_stats_num_query_dnscrypt_cert_setZnum_query_dnscrypt_certZ0ub_server_stats_num_query_dnscrypt_cleartext_getZ0ub_server_stats_num_query_dnscrypt_cleartext_setZnum_query_dnscrypt_cleartextZ8ub_server_stats_num_query_dnscrypt_crypted_malformed_getZ8ub_server_stats_num_query_dnscrypt_crypted_malformed_setZ$num_query_dnscrypt_crypted_malformedZ:ub_server_stats_num_query_dnscrypt_secret_missed_cache_getZ:ub_server_stats_num_query_dnscrypt_secret_missed_cache_setZ&num_query_dnscrypt_secret_missed_cacheZ-ub_server_stats_shared_secret_cache_count_getZ-ub_server_stats_shared_secret_cache_count_setZshared_secret_cache_countZ-ub_server_stats_num_query_dnscrypt_replay_getZ-ub_server_stats_num_query_dnscrypt_replay_setZnum_query_dnscrypt_replayZ%ub_server_stats_nonce_cache_count_getZ%ub_server_stats_nonce_cache_count_setZnonce_cache_countZ)ub_server_stats_num_query_authzone_up_getZ)ub_server_stats_num_query_authzone_up_setZnum_query_authzone_upZ+ub_server_stats_num_query_authzone_down_getZ+ub_server_stats_num_query_authzone_down_setZnum_query_authzone_downZ)ub_server_stats_num_neg_cache_noerror_getZ)ub_server_stats_num_neg_cache_noerror_setZnum_neg_cache_noerrorZ*ub_server_stats_num_neg_cache_nxdomain_getZ*ub_server_stats_num_neg_cache_nxdomain_setZnum_neg_cache_nxdomainZ$ub_server_stats_num_query_subnet_getZ$ub_server_stats_num_query_subnet_setZnum_query_subnetZ*ub_server_stats_num_query_subnet_cache_getZ*ub_server_stats_num_query_subnet_cache_setZnum_query_subnet_cacheZ#ub_server_stats_mem_stream_wait_getZ#ub_server_stats_mem_stream_wait_setZmem_stream_waitZ*ub_server_stats_mem_http2_query_buffer_getZ*ub_server_stats_mem_http2_query_buffer_setZmem_http2_query_bufferZ-ub_server_stats_mem_http2_response_buffer_getZ-ub_server_stats_mem_http2_response_buffer_setZmem_http2_response_bufferZub_server_stats_qtls_resume_getZub_server_stats_qtls_resume_setZqtls_resumeZub_server_stats_rpz_action_getZub_server_stats_rpz_action_setZ
rpz_actionr7Zdelete_ub_server_statsrkrrrrr��s�r�c@s�eZdZedd�dd�dd�ZeZeejej	�Z
eejej�Z
eejej�Zeejej�Zeejej�Zeejej�Zeejej�Zeejej�Zeej ej!�Z"dd�Z#ej$Z%dS)	�
ub_stats_infocCs
|jj�S)N)rr)r:rrrr;1szub_stats_info.<lambda>cCs|jj|�S)N)rr)r:r[rrrr;1szThe membership flag)rLcCstj|tj��dS)N)rZub_stats_info_swiginitZnew_ub_stats_info)rrrrr7=szub_stats_info.__init__N)&r
rr)rrrrrZub_stats_info_svr_getZub_stats_info_svr_setZsvrZ!ub_stats_info_mesh_num_states_getZ!ub_stats_info_mesh_num_states_setZmesh_num_statesZ'ub_stats_info_mesh_num_reply_states_getZ'ub_stats_info_mesh_num_reply_states_setZmesh_num_reply_statesZub_stats_info_mesh_jostled_getZub_stats_info_mesh_jostled_setZmesh_jostledZub_stats_info_mesh_dropped_getZub_stats_info_mesh_dropped_setZmesh_droppedZ#ub_stats_info_mesh_replies_sent_getZ#ub_stats_info_mesh_replies_sent_setZmesh_replies_sentZ+ub_stats_info_mesh_replies_sum_wait_sec_getZ+ub_stats_info_mesh_replies_sum_wait_sec_setZmesh_replies_sum_wait_secZ,ub_stats_info_mesh_replies_sum_wait_usec_getZ,ub_stats_info_mesh_replies_sum_wait_usec_setZmesh_replies_sum_wait_usecZ"ub_stats_info_mesh_time_median_getZ"ub_stats_info_mesh_time_median_setZmesh_time_medianr7Zdelete_ub_stats_inforkrrrrr�0sr�c@seZdZdZedd�dd�dd�Zdd�ZeZd	d�Ze	j
Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zd=dd�Zdd�Zd>dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z e!e"fd6d7�Z#e!e"fd8d9�Z$d:d;�Z%d<S)?�ub_ctxam
    Unbound resolving and validation context. 

    The validation context is created to hold the resolver status, validation keys and a small cache (containing messages, rrsets, roundtrip times, trusted keys, lameness information).

    **Usage**

    >>> import unbound
    >>> ctx = unbound.ub_ctx()
    >>> ctx.resolvconf("/etc/resolv.conf")
    >>> status, result = ctx.resolve("www.google.com", unbound.RR_TYPE_A, unbound.RR_CLASS_IN)
    >>> if status==0 and result.havedata:
    >>>    print "Result:",result.data.address_list
    Result: ['74.125.43.147', '74.125.43.99', '74.125.43.103', '74.125.43.104']

    cCs
|jj�S)N)rr)r:rrrr;Uszub_ctx.<lambda>cCs|jj|�S)N)rr)r:r[rrrr;UszThe membership flag)rLcOstd��dS)NzNo constructor defined)r)rr\r]rrrr7Wszub_ctx.__init__cCstj�|_|jstd��dS)z�Creates a resolving and validation context.

           An exception is invoked if the process of creation an ub_ctx instance fails.
        z2Fatal error: unbound context initialization failedN)rrwrr
)rrrrr7[s
cCstj||�S)aPAdd a trust anchor to the given context.

           The trust anchor is a string, on one line, that holds a valid DNSKEY or DS RR.

           :param ta:
               string, with zone-format RR on one line. [domainname] [TTL optional] [type] [class optional] [rdata contents]
           :returns: (int) 0 if OK, else error.
        )rr�)rr�rrr�add_tahs	z
ub_ctx.add_tacCstj||�S)aAdd trust anchors to the given context.

           Pass name of a file with DS and DNSKEY records (like from dig or drill).

           :param fname:
               filename of file with keyfile with trust anchors.
           :returns: (int) 0 if OK, else error.
        )rr�)rrrrr�add_ta_fileus	zub_ctx.add_ta_filecCstj||�S)a\setup configuration for the given context.

           :param fname:
               unbound config file (not all settings applicable). This is a power-users interface that lets you specify all sorts of options. For some specific options, such as adding trust anchors, special routines exist.
           :returns: (int) 0 if OK, else error.
        )rr~)rrrrr�config�sz
ub_ctx.configcCstj||�S)z�Set debug verbosity for the context Output is directed to stderr.

           :param d:
               debug level, 0 is off, 1 is very minimal, 2 is detailed, and 3 is lots.
           :returns: (int) 0 if OK, else error.
        )rr�)rr�rrr�
debuglevel�szub_ctx.debuglevelcCstj||�S)a�Set debug output (and error output) to the specified stream.

           Pass None to disable. Default is stderr.

           :param out:
               File stream to log to.
           :returns: (int) 0 if OK, else error.

           **Usage:**

              In order to log into file, use

              ::

                ctx = unbound.ub_ctx()
                fw = fopen("debug.log")
                ctx.debuglevel(3)
                ctx.debugout(fw)

              Another option is to print the debug information to stderr output

              ::

                ctx = unbound.ub_ctx()
                ctx.debuglevel(10)
                ctx.debugout(sys.stderr) 
        )r�ub_ctx_debugout)r�outrrr�debugout�szub_ctx.debugout�
/etc/hostscCstj||�S)a"Read list of hosts from the filename given.

           Usually "/etc/hosts". These addresses are not flagged as DNSSEC secure when queried for.

           :param fname:
               file name string. If None "/etc/hosts" is used.
           :returns: (int) 0 if OK, else error.
        )rr�)rrrrr�hosts�s	zub_ctx.hostscCs
tj|�S)z�Print the local zones and their content (RR data) to the debug output.

           :returns: (int) 0 if OK, else error.
        )rr�)rrrr�print_local_zones�szub_ctx.print_local_zones�/etc/resolv.confcCstj||�S)a�Read list of nameservers to use from the filename given.

           Usually "/etc/resolv.conf". Uses those nameservers as caching proxies. If they do not support DNSSEC, validation may fail.

           Only nameservers are picked up, the searchdomain, ndots and other settings from resolv.conf(5) are ignored.

           :param fname:
               file name string. If None "/etc/resolv.conf" is used.
           :returns: (int) 0 if OK, else error.
        )rr�)rrrrr�
resolvconf�szub_ctx.resolvconfcCstj||�S)a�Set a context behaviour for asynchronous action.

           :param dothread:
               if True, enables threading and a call to :meth:`resolve_async` creates a thread to handle work in the background. 
               If False, a process is forked to handle work in the background. 
               Changes to this setting after :meth:`async` calls have been made have no effect (delete and re-create the context to change).
           :returns: (int) 0 if OK, else error.
        )rr�)rr�rrr�	set_async�s	zub_ctx.set_asynccCstj||�S)aoSet machine to forward DNS queries to, the caching resolver to use.

           IP4 or IP6 address. Forwards all DNS requests to that machine, which is expected to run a recursive resolver. If the  is not DNSSEC-capable, validation may fail. Can be called several times, in that case the addresses are used as backup servers.

           To read the list of nameservers from /etc/resolv.conf (from DHCP or so), use the call :meth:`resolvconf`.

           :param addr:
               address, IP4 or IP6 in string format. If the addr is None, forwarding is disabled.
           :returns: (int) 0 if OK, else error.
        )rr�)rr�rrr�set_fwd�szub_ctx.set_fwdcCstj|||�S)a�Set an option for the context.

           Changes to the options after :meth:`resolve`, :meth:`resolve_async`, :meth:`zone_add`, :meth:`zone_remove`, :meth:`data_add` or :meth:`data_remove` have no effect (you have to delete and re-create the context).

           :param opt:
               option name from the unbound.conf config file format. (not all settings applicable). The name includes the trailing ':' for example set_option("logfile:", "mylog.txt"); This is a power-users interface that lets you specify all sorts of options. For some specific options, such as adding trust anchors, special routines exist.
           :param val:
               value of the option.
           :returns: (int) 0 if OK, else error.
        )rrz)rr{r|rrr�
set_option�szub_ctx.set_optioncCstj||�S)aAdd trust anchors to the given context.

           Pass the name of a bind-style config file with trusted-keys{}.

           :param fname:
               filename of file with bind-style config entries with trust anchors.
           :returns: (int) 0 if OK, else error.
        )rr�)rrrrr�trustedkeyss	zub_ctx.trustedkeyscCstj|�dS)z Print local zones using debugoutN)rr�)rrrr�
zone_printszub_ctx.zone_printcCstj|||�S)z�Add new local zone

           :param zonename: zone domain name (e.g. myzone.)
           :param zonetype: type of the zone ("static",...) 
           :returns: (int) 0 if OK, else error. 
        )rr�)r�zonenameZzonetyperrr�zone_addszub_ctx.zone_addcCstj||�S)z�Remove local zone

           If exists, removes local zone with all the RRs.

           :param zonename: zone domain name
           :returns: (int) 0 if OK, else error. 
        )rr�)rr�rrr�zone_remove%szub_ctx.zone_removecCstj||�S)a�Add new local RR data

           :param rrdata: string, in zone-format on one line. [domainname] [TTL optional] [type] [class optional] [rdata contents]
           :returns: (int) 0 if OK, else error. 

           **Usage**
              The local data ...

              ::

                >>> ctx = unbound.ub_ctx()
                >>> ctx.zone_add("mydomain.net.","static")
                0
                >>> status = ctx.data_add("test.mydomain.net. IN A 192.168.1.1")
                0
                >>> status, result = ctx.resolve("test.mydomain.net")
                >>> if status==0 and result.havedata:
                >>>    print "Result:",result.data.address_list
                Result: ['192.168.1.1']

        )rr�)r�rrdatarrr�data_add1szub_ctx.data_addcCstj||�S)aRemove local RR data

           If exists, remove resource record from local zone

           :param rrdata: string, in zone-format on one line. [domainname] [TTL optional] [type] [class optional] [rdata contents]
           :returns: (int) 0 if OK, else error. 
        )rr�)rr�rrr�data_removeKszub_ctx.data_removecCstj||�S)z�Cancel an async query in progress.

           Its callback will not be called.

           :param async_id:
               which query to cancel.
           :returns: (int) 0 if OK, else error.
        )rr�)rr�rrr�cancelXs	z
ub_ctx.cancelcCs
tj|�S)ajGet file descriptor.

           Wait for it to become readable, at this point answers are returned from the asynchronous validating resolver. Then call the ub_process to continue processing. This routine works immediately after context creation, the fd does not change.

           :returns: (int) -1 on error, or file descriptor to use select(2) with.
        )rr�)rrrr�get_fdesz
ub_ctx.get_fdcCs
tj|�S)a:Poll a context to see if it has any new results Do not poll in a loop, instead extract the fd below to poll for readiness, and then check, or wait using the wait routine.

           :returns: (int) 0 if nothing to read, or nonzero if a result is available. If nonzero, call ctx_process() to do callbacks.
        )rr�)rrrr�pollpszub_ctx.pollcCs
tj|�S)z�Call this routine to continue processing results from the validating resolver (when the fd becomes readable).

           Will perform necessary callbacks.

           :returns: (int) 0 if OK, else error.
        )rr�)rrrr�processyszub_ctx.processcCs2t|t�rtj||||�Stj|t|�||�SdS)a�Perform resolution and validation of the target name. 

           :param name:
               domain name in text format (a string or unicode string). IDN domain name have to be passed as a unicode string.
           :param rrtype:
               type of RR in host order (optional argument). Default value is RR_TYPE_A (A class).
           :param rrclass:
               class of RR in host order (optional argument). Default value is RR_CLASS_IN (for internet).
           :returns: * (int) 0 if OK, else error.
                     * (:class:`ub_result`) the result data is returned in a newly allocated result structure. May be None on return, return value is set to an error in that case (out of memory).
        N)rr,rr��	idn2dname)rrr�r�rrr�resolve�s
zub_ctx.resolvecCs:t|t�rtj||||||�Stj|t|�||||�SdS)aKPerform resolution and validation of the target name.

           Asynchronous, after a while, the callback will be called with your data and the result. 
           If an error happens during processing, your callback will be called with error set to a nonzero value (and result==None).

           :param name:
               domain name in text format (a string or unicode string). IDN domain name have to be passed as a unicode string.
           :param mydata:
               this data is your own data (you can pass arbitrary python object or None) which are passed on to the callback function.
           :param callback:
               call-back function which is called on completion of the resolution. 
           :param rrtype:
               type of RR in host order (optional argument). Default value is RR_TYPE_A (A class).
           :param rrclass:
               class of RR in host order (optional argument). Default value is RR_CLASS_IN (for internet).
           :returns: * (int) 0 if OK, else error.
                     * (int) async_id, an identifier number is returned for the query as it is in progress. It can be used to cancel the query.

           **Call-back function:**
                The call-back function looks as the follows::

                    def call_back(mydata, status, result):
                        pass

                **Parameters:** 
                    * `mydata` - mydata object
                    * `status` - 0 when a result has been found
                    * `result` - the result structure. The result may be None, in that case err is set.

        N)rr,r�_ub_resolve_asyncr�)rrr�r�r�r�rrr�
resolve_async�s
zub_ctx.resolve_asynccCs
tj|�S)z�Wait for a context to finish with results.

           Calls  after the wait for you. After the wait, there are no more outstanding asynchronous queries.

           :returns: (int) 0 if OK, else error.
        )rr�)rrrr�wait�szub_ctx.waitN)r�)r�)&r
rr)r*rrr7rrrrxrkr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��	RR_TYPE_A�RR_CLASS_INr�r�r�rrrrr�Cs<


 

	



	&r�cGs
tj|�S)N)rr�)r\rrrr��sr�cCstj||||||�S)N)rr�)ryrr�r�r�Zpyfuncrrrr��sr�cCs$djdd�|jd�D�ddd��S)zbReverse domain name

       Usable for reverse lookups when the IP address should be reversed
    rcSsg|]}|�qSrr)r>r?rrrr@�szreverse.<locals>.<listcomp>Nr���)r<�split)Zdomainrrr�reverse�sr�cCsdjdd�|jd�D��S)z�Converts domain name in IDN format to canonic domain name

       :param idnname: (unicode string) IDN name
       :returns: (string) domain name
    rcSs g|]}|rtjj|�nd�qS)r)rQrRZToASCII)r>r?rrrr@�szidn2dname.<locals>.<listcomp>)r<r�)Zidnnamerrrr��sr�cCsdjdd�|jd�D��S)z�Converts canonic domain name in IDN format to unicode string

        :param name: (string) domain name
        :returns: (unicode string) domain name
    rcSsg|]}tjj|��qSr)rQrRrS)r>r?rrrr@�szdname2idn.<locals>.<listcomp>)r<r�)rrrr�	dname2idn�sr�)��sysrZ_swig_python_version_info�__package__r
rrr.r	�ImportErrorrrr!r'rr(Zencodings.idnarQ�varsrEr,r/r1r�Z
RR_TYPE_NSZ
RR_TYPE_MDZ
RR_TYPE_MFZ
RR_TYPE_CNAMEZRR_TYPE_SOAZ
RR_TYPE_MBZ
RR_TYPE_MGZ
RR_TYPE_MRZRR_TYPE_NULLZRR_TYPE_WKSZRR_TYPE_PTRZ
RR_TYPE_HINFOZ
RR_TYPE_MINFOZ
RR_TYPE_MXZRR_TYPE_TXTZ
RR_TYPE_RPZ
RR_TYPE_AFSDBZRR_TYPE_X25ZRR_TYPE_ISDNZ
RR_TYPE_RTZRR_TYPE_NSAPZRR_TYPE_NSAP_PTRZRR_TYPE_SIGZRR_TYPE_KEYZ
RR_TYPE_PXZRR_TYPE_GPOSZRR_TYPE_AAAAZRR_TYPE_LOCZRR_TYPE_NXTZRR_TYPE_EIDZRR_TYPE_NIMLOCZRR_TYPE_SRVZRR_TYPE_ATMAZ
RR_TYPE_NAPTRZ
RR_TYPE_KXZRR_TYPE_CERTZ
RR_TYPE_A6Z
RR_TYPE_DNAMEZRR_TYPE_SINKZRR_TYPE_OPTZRR_TYPE_APLZ
RR_TYPE_DSZ
RR_TYPE_SSHFPZRR_TYPE_IPSECKEYZ
RR_TYPE_RRSIGZRR_TYPE_NSECZRR_TYPE_DNSKEYZ
RR_TYPE_DHCIDZ
RR_TYPE_NSEC3ZRR_TYPE_NSEC3PARAMSZ
RR_TYPE_UINFOZRR_TYPE_UIDZRR_TYPE_GIDZRR_TYPE_UNSPECZRR_TYPE_TSIGZRR_TYPE_IXFRZRR_TYPE_AXFRZ
RR_TYPE_MAILBZ
RR_TYPE_MAILAZRR_TYPE_ANYZRR_TYPE_CAAZRR_TYPE_DLVr�ZRR_CLASS_CHZRR_CLASS_HSZ
RR_CLASS_NONEZRR_CLASS_ANYr3rlrmrnrorprqrrrsrtrurvr5ZUNBOUND_VERSION_MAJORZUNBOUND_VERSION_MINORZUNBOUND_VERSION_MICROZUNBOUND_VERSION_MAJOR_REALZUNBOUND_VERSION_MINOR_REALZUNBOUND_VERSION_MICRO_REAL�objectrZZub_result_swigregisterZ
UB_NOERRORZ	UB_SOCKETZUB_NOMEMZ	UB_SYNTAXZUB_SERVFAILZUB_FORKFAILZ
UB_AFTERFINALZUB_INITFAILZUB_PIPEZUB_READFILEZUB_NOIDrwrxrzr}r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rjr�r�r�r�r�r�r�r�Zub_shm_stat_info_swigregisterr�Z!ub_shm_stat_info_mem_swigregisterr�Z"ub_shm_stat_info_time_swigregisterZUB_STATS_QTYPE_NUMZUB_STATS_QCLASS_NUMZUB_STATS_RCODE_NUMZUB_STATS_OPCODE_NUMZUB_STATS_BUCKET_NUMZUB_STATS_RPZ_ACTION_NUMr�Zub_server_stats_swigregisterr�Zub_stats_info_swigregisterr�Zub_ctx_swigregisterr�r�r�r�r�rrrr�<module>sf
	
ZE



G