Edit File: unbound.cpython-36.opt-1.pyc
3 /�(d��������������$���@���s���d�dl�mZ�edskr&dd��Ze��Z[n"edtkr@dd��Ze��Z[nd�dlZ[yeZW�n�ek rf���Y�nX�yd�dlZ W�n�e k r����d�dl Z Y�nX�dud d�Zdd ��Zdd��Z dd��ZyeZd ZW�n(�e jk r����G�dd��d�Zd�ZY�nX�d�dlZyd�dlZW�n�e k �r���d�dl ZY�nX�de��k�r.eZdd��Zdd��ZejZejZejZejZejZejZejZej 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@ejAZAejBZBejCZCejDZDejEZEejFZFejGZGejHZHejIZIejJZJejKZKejLZLejMZMejNZNejOZOejPZPejQZQejRZRejSZSejTZTejUZUejVZVejWZWejXZXejYZYejZZZej[Z[ej\Z\ej]Z]dd��Z^ej^Z^ej_Z_ej`Z`ejaZaejbZbejcZcejdZdejeZeejfZfejgZgejhZhejiZiG�dd��d�ZjejkZkejlZlejmZmejnZnejoZoejpZpG�dd��de�ZqejrZrereq��ejsZsejtZtejuZuejvZvejwZwejxZxejyZyejzZzej{Z{ej|Z|ej}Z}dd ��Z~ej~Z~d!d"��ZejZd#d$��Z�ej�Z�d%d&��Z�ej�Z�d'd(��Z�ej�Z�d)d*��Z�ej�Z�d+d,��Z�ej�Z�d-d.��Z�ej�Z�d/d0��Z�ej�Z�d1d2��Z�ej�Z�d3d4��Z�ej�Z�d5d6��Z�ej�Z�d7d8��Z�ej�Z�d9d:��Z�ej�Z�d;d<��Z�ej�Z�d=d>��Z�ej�Z�d?d@��Z�ej�Z�dAdB��Z�ej�Z�dCdD��Z�ej�Z�dEdF��Z�ej�Z�dGdH��Z�ej�Z�dIdJ��Z�ej�Z�dKdL��Z�ej�Z�dMdN��Z�ej�Z�dOdP��Z�ej�Z�dQdR��Z�ej�Z�dSdT��Z�ej�Z�dUdV��Z�ej�Z�dWdX��Z�ej�Z�dYdZ��Z�ej�Z�d[d\��Z�ej�Z�G�d]d^��d^e�Z�ej�Z�e�e���G�d_d`��d`e�Z�ej�Z�e�e���G�dadb��dbe�Z�ej�Z�e�e���ej�Z�ej�Z�ej�Z�ej�Z�ej�Z�ej�Z�G�dcdd��dde�Z�ej�Z�e�e���G�dedf��dfe�Z�ej�Z�e�e���G�dgdh��dhe�Z�ej�Z�e�e���didj��Z�ej�Z�dkdl��Z�ej�Z�ej�Z�dmdn��Z�dodp��Z�dqdr��Z�dS�)v�����)�version_info��������c��������������C���sT���dd�l�}�tjd�d�}dj|df�jd�}y |�j|�S��tk rN���|�jd�S�X�d�S�)Nr����.�_unbound)� importlib�__name__� rpartition�join�lstrip� import_module�ImportError)r���ZpkgZmname��r����/usr/lib64/python3.6/unbound.py�swig_import_helper ���s���� r�������c��������������C���s~���ddl�m}��dd�l}d�}y|jd|�t�g�\}}}W�n�tk rP���dd�l}|S�X�z|jd|||�}W�d�|d�k rx|j���X�|S�)Nr���)�dirnamer���) Zos.pathr����imp�find_module�__file__r ���r����load_module�close)r���r����fp�pathname�descriptionr���Z_modr���r���r���r������s���� N����c�������������C���s����|dkr|�j�j|�S�|dkr8t|�jdkr8||�j|<�d�S�|jj|d��}|rT||�|�S�|sxtrltj |�||��q�||�j|<�nt d|����d�S�)N�thisown�thisZSwigPyObjectzYou cannot add attributes to %s)r����own�typer����__dict__�__swig_setmethods__�get� _newclass�object�__setattr__�AttributeError)�self� class_type�name�valueZstatic�methodr���r���r����_swig_setattr_nondynamic3���s���� r,���c�������������C���s���t�|�|||d�S�)Nr���)r,���)r'���r(���r)���r*���r���r���r���� _swig_setattrF���s����r-���c�������������C���sB���|dkr|�j�j��S�|jj|d��}|r,||��S�td|j|f���d�S�)Nr���z!'%s' object has no attribute '%s')r���r����__swig_getmethods__r"���r&���r���)r'���r(���r)���r+���r���r���r���� _swig_getattrJ���s���� r/���c�������������C���sD���yd|�j�j���}W�n�tjk r,���d}Y�nX�d|�jj|�jj|f�S�)Nz proxy of ��z<%s.%s; %s >)r����__repr__�__builtin__� Exception� __class__� __module__r���)r'���Zstrthisr���r���r���� _swig_reprS���s ���� r6���c���������������@���s���e�Zd�ZdS�)�_objectN)r���r5����__qualname__r���r���r���r���r7���^���s���r7����bytesc�������������C���s���t�|�t�r|�S�tj|��S�)N)� isinstance�int�builtins�ord)�sr���r���r���r=���m���s���� r=���c�������������C���s ���t�j|��S�)N)r����ub_ctx_free_dbg)�cr���r���r���r?���s���s����r?���c�������������C���s ���t�j|��S�)N)r����ub_resolve_free_dbg)�rr���r���r���rA�������s����rA���c���������������@���s����e�Zd�ZdZdd��Zdd��Zeddd��Zd d ��Ze edd�Z d d��Ze edd�Zdd��Z e e dd�Zdd��Ze edd�Zdd��Ze edd�Zdd��Ze edd�ZdS�)�ub_dataz3Class which makes the resolution results accessiblec�������������C���s���|dkrt�d��||�_dS�)zZCreates ub_data class :param data: a list of the result data in RAW format Nzub_data init: No data)r3����data)r'���rD���r���r���r����__init__����s����zub_data.__init__c�������������C���s���dj�dd��|�jD���S�)zRepresents data as string�;c�������������S���s ���g�|�]}d�j�tdd��|���qS�)� c�������������S���s���dt�|���S�)Nz%02X)r=���)�xr���r���r����<lambda>����s����z,ub_data.__str__.<locals>.<listcomp>.<lambda>)r ����map)�.0�ar���r���r���� <listcomp>����s����z#ub_data.__str__.<locals>.<listcomp>)r ���rD���)r'���r���r���r����__str__����s����zub_data.__str__r���c�������������C���sz���|�sg�S�g�}t�|��}|dkr&t||�}|}xJ||k�rtt|�|��}|jt|�|d�|d�|���j�����||d�7�}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) r���r���)�len�minr=����append�str�decode)r>���Zofs�maxlen�resZslen�idxZcomplenr���r���r���� dname2str����s���� &zub_data.dname2strc�������������C���s���|�j�S�)zReturns a list of RAW strings)rD���)r'���r���r���r����as_raw_data����s����zub_data.as_raw_datazLReturns RAW data (a list of binary encoded strings). See :meth:`as_raw_data`)�docc����������������s�����fdd���j�D��S�)zzRepresents data as a list of MX records (query for RR_TYPE_MX) :returns: list of tuples (priority, dname) c����������������sD���g�|�]<}d�t�|d���t�|d���djdd����j|d�D���f�qS�)����r���r���r���c�������������S���s���g�|�]}|�qS�r���r���)rK���rL���r���r���r���rM�������s����z1ub_data.as_mx_list.<locals>.<listcomp>.<listcomp>r���)r=���r ���rW���)rK����rdf)r'���r���r���rM�������s����z&ub_data.as_mx_list.<locals>.<listcomp>)rD���)r'���r���)r'���r���� as_mx_list����s����zub_data.as_mx_listzUReturns a list of tuples containing priority and domain names. See :meth:`as_mx_list`c����������������s�����fdd���j�D��S�)z�Represents data as a list of MX records (query for RR_TYPE_MX) :returns: list of tuples (priority, unicode dname) c����������������sD���g�|�]<}d�t�|d���t�|d���djdd����j|d�D���f�qS�)rZ���r���r���r���c�������������S���s���g�|�]}t�jj|��qS�r���)� encodings�idna� ToUnicode)rK���rL���r���r���r���rM�����s����z5ub_data.as_idn_mx_list.<locals>.<listcomp>.<listcomp>r���)r=���r ���rW���)rK���r[���)r'���r���r���rM�����s����z*ub_data.as_idn_mx_list.<locals>.<listcomp>)rD���)r'���r���)r'���r����as_idn_mx_list���s����zub_data.as_idn_mx_listz]Returns a list of tuples containing priority and IDN domain names. See :meth:`as_idn_mx_list`c�������������C���s���dd��|�j�D��S�)zlRepresents data as a list of IP addresses (query for RR_TYPE_PTR) :returns: list of strings c�������������S���s ���g�|�]}d�j�tdd��|���qS�)r���c�������������S���s���t�t|���S�)N)rR���r=���)rH���r���r���r���rI�����s����z4ub_data.as_address_list.<locals>.<listcomp>.<lambda>)r ���rJ���)rK���rL���r���r���r���rM�����s����z+ub_data.as_address_list.<locals>.<listcomp>)rD���)r'���r���r���r����as_address_list ��s����zub_data.as_address_listz;Returns a list of IP addresses. See :meth:`as_address_list`c����������������s���t���fdd���j�S�)zjRepresents data as a list of domain names (query for RR_TYPE_A) :returns: list of strings c����������������s���dj���j|���S�)Nr���)r ���rW���)rH���)r'���r���r���rI�����s����z(ub_data.as_domain_list.<locals>.<lambda>)rJ���rD���)r'���r���)r'���r����as_domain_list��s����zub_data.as_domain_listz:Returns a list of domain names. See :meth:`as_domain_list`c����������������s���t���fdd���j�S�)zrRepresents data as a list of unicode domain names (query for RR_TYPE_A) :returns: list of strings c����������������s���dj�dd����j|��D���S�)Nr���c�������������S���s���g�|�]}t�jj|��qS�r���)r]���r^���r_���)rK���rL���r���r���r���rM��� ��s����z@ub_data.as_idn_domain_list.<locals>.<lambda>.<locals>.<listcomp>)r ���rW���)rH���)r'���r���r���rI��� ��s����z,ub_data.as_idn_domain_list.<locals>.<lambda>)rJ���rD���)r'���r���)r'���r����as_idn_domain_list��s����zub_data.as_idn_domain_listzBReturns a list of IDN domain names. See :meth:`as_idn_domain_list`N)r���r���)r���r5���r8����__doc__rE���rN����staticmethodrW���rX����property�rawr\���Zmx_listr`���Zmx_list_idnra���Zaddress_listrb���Zdomain_listrc���Zdomain_list_idnr���r���r���r���rC�������s"���rC���c���������������@���s8��e�Zd�ZdZi�Zdd��Zi�Zdd��Zdd��Ze Z ejed<�ej ed<�erVeej ej�Zejed<�ejed<�er|eejej�Zejed <�ejed <�er�eejej�Zejed <�ejed <�er�eejej�Zejed<�ejed<�er�eejej�Zejed<�ejed<�e�reejej�Zej ed <�ej!ed <�e�r>eej!ej �Z"ej#ed<�ej$ed<�e�rfeej$ej#�Z%ej&ed<�ej'ed<�e�r�eej'ej&�Z(ej)ed<�ej*ed<�e�r�eej*ej)�Z+ej,ed<�ej-ed<�e�r�eej-ej,�Z.ej/ed<�ej0ed<�e�reej0ej/�Z1ej2ed<�ej3ed<�e�r.eej3ej2�Z4ej5ed<�ej6ed<�e�rVeej6ej5�Z7ej8ed<�ej9ed<�e�r~eej9ej8�Z:ej;ed<�ej<ed<�e�r�eej<ej;�Z=dd��Z>dd��Z?dd��Zej@ZAeBdeCdeDdeEdeFd eGd!eHd"eId#eJd$eKd%eLd&iZMd'd(��ZNeOeN�ZPd)d*��ZQeOeQd+d,�ZRd-d.��ZSeOe?�ZTeOeSd/d,�ZUd0S�)1� ub_resultz&The validation and resolution results.c�������������C���s���t�|�t||�S�)N)r-���rh���)r'���r)���r*���r���r���r���rI���.��s����zub_result.<lambda>c�������������C���s���t�|�t|�S�)N)r/���rh���)r'���r)���r���r���r���rI���0��s����c�������������O���s���t�d��d�S�)NzNo constructor defined)r&���)r'����args�kwargsr���r���r���rE���2��s����zub_result.__init__�qname�qtype�qclass�_datarO���� canonname�rcode� answer_packet� answer_len�havedata�nxdomain�secure�bogus� why_bogus�ttl�was_ratelimitedc�������������C���s���t�j|�|�S�)N)r���Zub_result__ub_result_data)r'����resultr���r���r����_ub_result_datav��s����zub_result._ub_result_datac�������������C���s ���t�j|��S�)N)r���Zub_result__packet)r'���r���r���r����_packety��s����zub_result._packetc�������������C���s���t�d��d�S�)Nz%This class can't be created directly.)r3���)r'���r���r���r���rE���|��s����zno errorz form errorz serv failz nx domainznot implementedZrefusedZyxdomainZyxrrsetZnxrrsetznot authznot zonec�������������C���s���|�j�|�j�S�)zRReturns rcode in display representation form :returns: string )� rcode2strrp���)r'���r���r���r����_get_rcode_str���s����zub_result._get_rcode_strc�������������C���s ���|�j�|��S�)a��Result 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{���)r'���r���r���r���� _get_raw_data���s����zub_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.)rY���c�������������C���s���|�j�s d�S�t|�j|���S�)N)rs���rC���r{���)r'���r���r���r���� _get_data���s�����zub_result._get_datazOReturns :class:`ub_data` instance containing various decoding functions or NoneN)Vr���r5���r8���rd���r!���r%���r.����__getattr__rE���r6���r1���r���Zub_result_qname_setZub_result_qname_getr#����_swig_propertyrk���Zub_result_qtype_setZub_result_qtype_getrl���Zub_result_qclass_setZub_result_qclass_getrm���Zub_result__data_setZub_result__data_getrn���Zub_result_len_setZub_result_len_getrO���Zub_result_canonname_setZub_result_canonname_getro���Zub_result_rcode_setZub_result_rcode_getrp���Zub_result_answer_packet_setZub_result_answer_packet_getrq���Zub_result_answer_len_setZub_result_answer_len_getrr���Zub_result_havedata_setZub_result_havedata_getrs���Zub_result_nxdomain_setZub_result_nxdomain_getrt���Zub_result_secure_setZub_result_secure_getru���Zub_result_bogus_setZub_result_bogus_getrv���Zub_result_why_bogus_setZub_result_why_bogus_getrw���Zub_result_ttl_setZub_result_ttl_getrx���Zub_result_was_ratelimited_setZub_result_was_ratelimited_getry���r{���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_NOTZONEr}���r~���rf���Z rcode_strr���Zrawdatar����ZpacketrD���r���r���r���r���rh���*��s���� 0rh���c���������������C���s���t�j��S�)N)r���� ub_ctx_creater���r���r���r���r�������s����r����c�������������C���s ���t�j|��S�)N)r����_ub_ctx_delete)�ctxr���r���r���r�������s����r����c�������������C���s���t�j|�||�S�)N)r����ub_ctx_set_option)r�����opt�valr���r���r���r�������s����r����c�������������C���s���t�j|�||�S�)N)r����ub_ctx_get_option)r����r����rR���r���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r���� ub_ctx_config)r�����fnamer���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_set_fwd)r�����addrr���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_set_tls)r����Ztlsr���r���r���r�������s����r����c�������������C���s���t�j|�|||�S�)N)r����ub_ctx_set_stub)r����Zzoner����Zisprimer���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_resolvconf)r����r����r���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_hosts)r����r����r���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r���� ub_ctx_add_ta)r�����tar���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_add_ta_file)r����r����r���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_add_ta_autr)r����r����r���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_trustedkeys)r����r����r���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_debuglevel)r�����dr���r���r���r�������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_async)r�����dothreadr���r���r���r�������s����r����c�������������C���s ���t�j|��S�)N)r����ub_poll)r����r���r���r���r�������s����r����c�������������C���s ���t�j|��S�)N)r����ub_wait)r����r���r���r���r�������s����r����c�������������C���s ���t�j|��S�)N)r����ub_fd)r����r���r���r���r�������s����r����c�������������C���s ���t�j|��S�)N)r���� ub_process)r����r���r���r���r�������s����r����c�������������C���s���t�j|�|||�S�)N)r���� ub_resolve)r����r)����rrtype�rrclassr���r���r���r�������s����r����c�������������C���s���t�j|�||||||�S�)N)r����ub_resolve_async)r����r)���r����r�����mydata�callback�async_idr���r���r���r������s����r����c�������������C���s���t�j|�|�S�)N)r���� ub_cancel)r����r����r���r���r���r������s����r����c�������������C���s ���t�j|��S�)N)r���r����)rz���r���r���r���r������s����r����c�������������C���s ���t�j|��S�)N)r����ub_strerror)�errr���r���r���r������s����r����c�������������C���s ���t�j|��S�)N)r����ub_ctx_print_local_zones)r����r���r���r���r������s����r����c�������������C���s���t�j|�||�S�)N)r����ub_ctx_zone_add)r����� zone_nameZ zone_typer���r���r���r������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_zone_remove)r����r����r���r���r���r������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_data_add)r����rD���r���r���r���r������s����r����c�������������C���s���t�j|�|�S�)N)r����ub_ctx_data_remove)r����rD���r���r���r���r����#��s����r����c���������������C���s���t�j��S�)N)r���� ub_versionr���r���r���r���r����'��s����r����c���������������@���s����e�Zd�Zi�Zdd��Zi�Zdd��ZeZe j ed<�e jed<�erJe e je j �Ze jed<�erbe e j�Ze jed<�erze e j�Zdd��Ze jZd d��Zd S�)�ub_shm_stat_infoc�������������C���s���t�|�t||�S�)N)r-���r����)r'���r)���r*���r���r���r���rI���,��s����zub_shm_stat_info.<lambda>c�������������C���s���t�|�t|�S�)N)r/���r����)r'���r)���r���r���r���rI���.��s�����num_threads�time�memc�������������C���s:���t�j��}y|�jj|��W�n�tjk r4���||�_Y�nX�d�S�)N)r���Znew_ub_shm_stat_infor���rQ���r2���r3���)r'���r���r���r���r���rE���;��s ����zub_shm_stat_info.__init__c�������������C���s���d�S�)Nr���)r'���r���r���r���rI���B��s����N)r���r5���r8���r!���r%���r.���r����r6���r1���r���Z ub_shm_stat_info_num_threads_setZ ub_shm_stat_info_num_threads_getr#���r����r����Zub_shm_stat_info_time_getr����Zub_shm_stat_info_mem_getr����rE���Zdelete_ub_shm_stat_infor�����__del__r���r���r���r���r����*��s$��� r����c���������������@���s���e�Zd�Zi�Zdd��Zi�Zdd��ZeZe j ed<�e jed<�erJe e je j �Ze jed<�e jed<�erpe e je j�Ze jed<�e jed<�er�e e je j�Ze jed<�e jed<�er�e e je j�Ze jed<�e jed<�er�e e je j�Ze jed <�e jed <�e�r e e je j�Ze jed <�e jed <�e�r2e e je j�Z e j!ed<�e j"ed<�e�rZe e j"e j!�Z#e j$ed<�e j%ed<�e�r�e e j%e j$�Z&e j'ed <�e j(ed <�e�r�e e j(e j'�Z)dd��Z*e j+Z,dd��Z-dS�)�ub_shm_stat_info_memc�������������C���s���t�|�t||�S�)N)r-���r����)r'���r)���r*���r���r���r���rI���H��s����zub_shm_stat_info_mem.<lambda>c�������������C���s���t�|�t|�S�)N)r/���r����)r'���r)���r���r���r���rI���J��s�����msg�rrsetr�����iter�subnet�ipsecmod�respip�dnscrypt_shared_secret�dnscrypt_nonce�dynlibc�������������C���s:���t�j��}y|�jj|��W�n�tjk r4���||�_Y�nX�d�S�)N)r���Znew_ub_shm_stat_info_memr���rQ���r2���r3���)r'���r���r���r���r���rE���u��s ����zub_shm_stat_info_mem.__init__c�������������C���s���d�S�)Nr���)r'���r���r���r���rI���|��s����N).r���r5���r8���r!���r%���r.���r����r6���r1���r���Zub_shm_stat_info_mem_msg_setZub_shm_stat_info_mem_msg_getr#���r����r����Zub_shm_stat_info_mem_rrset_setZub_shm_stat_info_mem_rrset_getr����Zub_shm_stat_info_mem_val_setZub_shm_stat_info_mem_val_getr����Zub_shm_stat_info_mem_iter_setZub_shm_stat_info_mem_iter_getr����Zub_shm_stat_info_mem_subnet_setZub_shm_stat_info_mem_subnet_getr����Z!ub_shm_stat_info_mem_ipsecmod_setZ!ub_shm_stat_info_mem_ipsecmod_getr����Zub_shm_stat_info_mem_respip_setZub_shm_stat_info_mem_respip_getr����Z/ub_shm_stat_info_mem_dnscrypt_shared_secret_setZ/ub_shm_stat_info_mem_dnscrypt_shared_secret_getr����Z'ub_shm_stat_info_mem_dnscrypt_nonce_setZ'ub_shm_stat_info_mem_dnscrypt_nonce_getr����Zub_shm_stat_info_mem_dynlib_setZub_shm_stat_info_mem_dynlib_getr����rE���Zdelete_ub_shm_stat_info_memr����r����r���r���r���r���r����F��s`��� r����c���������������@���s$��e�Zd�Zi�Zdd��Zi�Zdd��ZeZe j ed<�e jed<�erJe e je j �Ze jed<�e jed<�erpe e je j�Ze jed<�e jed<�er�e e je j�Ze jed<�e jed<�er�e e je j�Ze jed<�e jed<�er�e e je j�Ze jed <�e jed <�e�r e e je j�Zd d��Ze jZ dd��Z!d S�)�ub_shm_stat_info_timec�������������C���s���t�|�t||�S�)N)r-���r����)r'���r)���r*���r���r���r���rI������s����zub_shm_stat_info_time.<lambda>c�������������C���s���t�|�t|�S�)N)r/���r����)r'���r)���r���r���r���rI������s�����now_sec�now_usec�up_sec�up_usec�elapsed_sec�elapsed_usecc�������������C���s:���t�j��}y|�jj|��W�n�tjk r4���||�_Y�nX�d�S�)N)r���Znew_ub_shm_stat_info_timer���rQ���r2���r3���)r'���r���r���r���r���rE������s ����zub_shm_stat_info_time.__init__c�������������C���s���d�S�)Nr���)r'���r���r���r���rI������s����N)"r���r5���r8���r!���r%���r.���r����r6���r1���r���Z!ub_shm_stat_info_time_now_sec_setZ!ub_shm_stat_info_time_now_sec_getr#���r����r����Z"ub_shm_stat_info_time_now_usec_setZ"ub_shm_stat_info_time_now_usec_getr����Z ub_shm_stat_info_time_up_sec_setZ ub_shm_stat_info_time_up_sec_getr����Z!ub_shm_stat_info_time_up_usec_setZ!ub_shm_stat_info_time_up_usec_getr����Z%ub_shm_stat_info_time_elapsed_sec_setZ%ub_shm_stat_info_time_elapsed_sec_getr����Z&ub_shm_stat_info_time_elapsed_usec_setZ&ub_shm_stat_info_time_elapsed_usec_getr����rE���Zdelete_ub_shm_stat_info_timer����r����r���r���r���r���r�������s@��� r����c���������������@���s� ��e�Zd�Zi�Zdd��Zi�Zdd��ZeZe j ed<�e jed<�erJe e je j �Ze jed<�e jed<�erpe e je j�Ze jed<�e jed<�er�e e je j�Ze jed<�e jed<�er�e e je j�Ze jed<�e jed<�er�e e je j�Ze jed <�e jed <�e�r e e je j�Ze jed <�e jed <�e�r2e e je j�Z e j!ed<�e j"ed<�e�rZe e j"e j!�Z#e j$ed<�e j%ed<�e�r�e e j%e j$�Z&e j'ed <�e j(ed <�e�r�e e j(e j'�Z)e j*ed<�e j+ed<�e�r�e e j+e j*�Z,e j-ed<�e j.ed<�e�r�e e j.e j-�Z/e j0ed<�e j1ed<�e�r"e e j1e j0�Z2e j3ed<�e j4ed<�e�rJe e j4e j3�Z5e j6ed<�e j7ed<�e�rre e j7e j6�Z8e j9ed<�e j:ed<�e�r�e e j:e j9�Z;e j<ed<�e j=ed<�e�r�e e j=e j<�Z>e j?ed<�e j@ed<�e�r�e e j@e j?�ZAe jBed<�e jCed<�e�re e jCe jB�ZDe jEed<�e jFed<�e�r:e e jFe jE�ZGe jHed<�e jIed<�e�rbe e jIe jH�ZJe jKed<�e jLed<�e�r�e e jLe jK�ZMe jNed<�e jOed<�e�r�e e jOe jN�ZPe jQed<�e jRed<�e�r�e e jRe jQ�ZSe jTed<�e jUed<�e�re e jUe jT�ZVe jWed<�e jXed<�e�r*e e jXe jW�ZYe jZed<�e j[ed<�e�rRe e j[e jZ�Z\e j]ed<�e j^ed<�e�rze e j^e j]�Z_e j`ed <�e jaed <�e�r�e e jae j`�Zbe jced!<�e jded!<�e�r�e e jde jc�Zee jfed"<�e jged"<�e�r�e e jge jf�Zhe jied#<�e jjed#<�e�re e jje ji�Zke jled$<�e jmed$<�e�rBe e jme jl�Zne joed%<�e jped%<�e�rje e jpe jo�Zqe jred&<�e jsed&<�e�r�e e jse jr�Zte jued'<�e jved'<�e�r�e e jve ju�Zwe jxed(<�e jyed(<�e�r�e e jye jx�Zze j{ed)<�e j|ed)<�e�r e e j|e j{�Z}e j~ed*<�e jed*<�e�r2e e je j~�Z�e j�ed+<�e j�ed+<�e�rZe e j�e j��Z�e j�ed,<�e j�ed,<�e�r�e e j�e j��Z�e j�ed-<�e j�ed-<�e�r�e e j�e j��Z�e j�ed.<�e j�ed.<�e�r�e e j�e j��Z�e j�ed/<�e j�ed/<�e�r�e e j�e j��Z�e j�ed0<�e j�ed0<�e�r"e e j�e j��Z�e j�ed1<�e j�ed1<�e�rJe e j�e j��Z�e j�ed2<�e j�ed2<�e�rre e j�e j��Z�e j�ed3<�e j�ed3<�e�r�e e j�e j��Z�e j�ed4<�e j�ed4<�e�r�e e j�e j��Z�e j�ed5<�e j�ed5<�e�r�e e j�e j��Z�e j�ed6<�e j�ed6<�e�re e j�e j��Z�e j�ed7<�e j�ed7<�e�r:e e j�e j��Z�e j�ed8<�e j�ed8<�e�rbe e j�e j��Z�e j�ed9<�e j�ed9<�e�r�e e j�e j��Z�e j�ed:<�e j�ed:<�e�r�e e j�e j��Z�e j�ed;<�e j�ed;<�e�r�e e j�e j��Z�e j�ed<<�e j�ed<<�e� re e j�e j��Z�e j�ed=<�e j�ed=<�e� r*e e j�e j��Z�e j�ed><�e j�ed><�e� rRe e j�e j��Z�e j�ed?<�e j�ed?<�e� rze e j�e j��Z�e j�ed@<�e j�ed@<�e� r�e e j�e j��Z�e j�edA<�e j�edA<�e� r�e e j�e jÃZ�dBdC��Z�e j�Z�dDd��Z�dES�)F�ub_server_statsc�������������C���s���t�|�t||�S�)N)r-���r����)r'���r)���r*���r���r���r���rI������s����zub_server_stats.<lambda>c�������������C���s���t�|�t|�S�)N)r/���r����)r'���r)���r���r���r���rI������s�����num_queries�num_queries_ip_ratelimited�num_queries_missed_cache�num_queries_prefetch�sum_query_list_size�max_query_list_size�extendedrl���� qtype_bigrm���� qclass_big�qopcode�qtcp� qtcp_outgoing� qudp_outgoing�qtls�qhttps�qipv6�qbit_QR�qbit_AA�qbit_TC�qbit_RD�qbit_RA�qbit_Z�qbit_AD�qbit_CD�qEDNS�qEDNS_DO� ans_rcode�ans_rcode_nodata� ans_secure� ans_bogus�rrset_bogus�queries_ratelimited�unwanted_replies�unwanted_queries�tcp_accept_usage�ans_expired�hist�msg_cache_count�rrset_cache_count�infra_cache_count�key_cache_count�num_query_dnscrypt_crypted�num_query_dnscrypt_cert�num_query_dnscrypt_cleartext�$num_query_dnscrypt_crypted_malformed�&num_query_dnscrypt_secret_missed_cache�shared_secret_cache_count�num_query_dnscrypt_replay�nonce_cache_count�num_query_authzone_up�num_query_authzone_down�num_neg_cache_noerror�num_neg_cache_nxdomain�num_query_subnet�num_query_subnet_cache�mem_stream_wait�mem_http2_query_buffer�mem_http2_response_buffer�qtls_resume� rpz_actionc�������������C���s:���t�j��}y|�jj|��W�n�tjk r4���||�_Y�nX�d�S�)N)r���Znew_ub_server_statsr���rQ���r2���r3���)r'���r���r���r���r���rE������s ����zub_server_stats.__init__c�������������C���s���d�S�)Nr���)r'���r���r���r���rI������s����N)�r���r5���r8���r!���r%���r.���r����r6���r1���r���Zub_server_stats_num_queries_setZub_server_stats_num_queries_getr#���r����r����Z.ub_server_stats_num_queries_ip_ratelimited_setZ.ub_server_stats_num_queries_ip_ratelimited_getr����Z,ub_server_stats_num_queries_missed_cache_setZ,ub_server_stats_num_queries_missed_cache_getr����Z(ub_server_stats_num_queries_prefetch_setZ(ub_server_stats_num_queries_prefetch_getr����Z'ub_server_stats_sum_query_list_size_setZ'ub_server_stats_sum_query_list_size_getr����Z'ub_server_stats_max_query_list_size_setZ'ub_server_stats_max_query_list_size_getr����Zub_server_stats_extended_setZub_server_stats_extended_getr����Zub_server_stats_qtype_setZub_server_stats_qtype_getrl���Zub_server_stats_qtype_big_setZub_server_stats_qtype_big_getr����Zub_server_stats_qclass_setZub_server_stats_qclass_getrm���Zub_server_stats_qclass_big_setZub_server_stats_qclass_big_getr����Zub_server_stats_qopcode_setZub_server_stats_qopcode_getr����Zub_server_stats_qtcp_setZub_server_stats_qtcp_getr����Z!ub_server_stats_qtcp_outgoing_setZ!ub_server_stats_qtcp_outgoing_getr����Z!ub_server_stats_qudp_outgoing_setZ!ub_server_stats_qudp_outgoing_getr����Zub_server_stats_qtls_setZub_server_stats_qtls_getr����Zub_server_stats_qhttps_setZub_server_stats_qhttps_getr����Zub_server_stats_qipv6_setZub_server_stats_qipv6_getr����Zub_server_stats_qbit_QR_setZub_server_stats_qbit_QR_getr����Zub_server_stats_qbit_AA_setZub_server_stats_qbit_AA_getr����Zub_server_stats_qbit_TC_setZub_server_stats_qbit_TC_getr����Zub_server_stats_qbit_RD_setZub_server_stats_qbit_RD_getr����Zub_server_stats_qbit_RA_setZub_server_stats_qbit_RA_getr����Zub_server_stats_qbit_Z_setZub_server_stats_qbit_Z_getr����Zub_server_stats_qbit_AD_setZub_server_stats_qbit_AD_getr����Zub_server_stats_qbit_CD_setZub_server_stats_qbit_CD_getr����Zub_server_stats_qEDNS_setZub_server_stats_qEDNS_getr����Zub_server_stats_qEDNS_DO_setZub_server_stats_qEDNS_DO_getr����Zub_server_stats_ans_rcode_setZub_server_stats_ans_rcode_getr����Z$ub_server_stats_ans_rcode_nodata_setZ$ub_server_stats_ans_rcode_nodata_getr����Zub_server_stats_ans_secure_setZub_server_stats_ans_secure_getr����Zub_server_stats_ans_bogus_setZub_server_stats_ans_bogus_getr����Zub_server_stats_rrset_bogus_setZub_server_stats_rrset_bogus_getr����Z'ub_server_stats_queries_ratelimited_setZ'ub_server_stats_queries_ratelimited_getr����Z$ub_server_stats_unwanted_replies_setZ$ub_server_stats_unwanted_replies_getr����Z$ub_server_stats_unwanted_queries_setZ$ub_server_stats_unwanted_queries_getr����Z$ub_server_stats_tcp_accept_usage_setZ$ub_server_stats_tcp_accept_usage_getr����Zub_server_stats_ans_expired_setZub_server_stats_ans_expired_getr����Zub_server_stats_hist_setZub_server_stats_hist_getr����Z#ub_server_stats_msg_cache_count_setZ#ub_server_stats_msg_cache_count_getr����Z%ub_server_stats_rrset_cache_count_setZ%ub_server_stats_rrset_cache_count_getr����Z%ub_server_stats_infra_cache_count_setZ%ub_server_stats_infra_cache_count_getr����Z#ub_server_stats_key_cache_count_setZ#ub_server_stats_key_cache_count_getr����Z.ub_server_stats_num_query_dnscrypt_crypted_setZ.ub_server_stats_num_query_dnscrypt_crypted_getr����Z+ub_server_stats_num_query_dnscrypt_cert_setZ+ub_server_stats_num_query_dnscrypt_cert_getr����Z0ub_server_stats_num_query_dnscrypt_cleartext_setZ0ub_server_stats_num_query_dnscrypt_cleartext_getr����Z8ub_server_stats_num_query_dnscrypt_crypted_malformed_setZ8ub_server_stats_num_query_dnscrypt_crypted_malformed_getr���Z:ub_server_stats_num_query_dnscrypt_secret_missed_cache_setZ:ub_server_stats_num_query_dnscrypt_secret_missed_cache_getr��Z-ub_server_stats_shared_secret_cache_count_setZ-ub_server_stats_shared_secret_cache_count_getr��Z-ub_server_stats_num_query_dnscrypt_replay_setZ-ub_server_stats_num_query_dnscrypt_replay_getr��Z%ub_server_stats_nonce_cache_count_setZ%ub_server_stats_nonce_cache_count_getr��Z)ub_server_stats_num_query_authzone_up_setZ)ub_server_stats_num_query_authzone_up_getr��Z+ub_server_stats_num_query_authzone_down_setZ+ub_server_stats_num_query_authzone_down_getr��Z)ub_server_stats_num_neg_cache_noerror_setZ)ub_server_stats_num_neg_cache_noerror_getr��Z*ub_server_stats_num_neg_cache_nxdomain_setZ*ub_server_stats_num_neg_cache_nxdomain_getr��Z$ub_server_stats_num_query_subnet_setZ$ub_server_stats_num_query_subnet_getr ��Z*ub_server_stats_num_query_subnet_cache_setZ*ub_server_stats_num_query_subnet_cache_getr ��Z#ub_server_stats_mem_stream_wait_setZ#ub_server_stats_mem_stream_wait_getr��Z*ub_server_stats_mem_http2_query_buffer_setZ*ub_server_stats_mem_http2_query_buffer_getr��Z-ub_server_stats_mem_http2_response_buffer_setZ-ub_server_stats_mem_http2_response_buffer_getr ��Zub_server_stats_qtls_resume_setZub_server_stats_qtls_resume_getr��Zub_server_stats_rpz_action_setZub_server_stats_rpz_action_getr��rE���Zdelete_ub_server_statsr����r����r���r���r���r���r�������s��� r����c���������������@���s���e�Zd�Zi�Zdd��Zi�Zdd��ZeZe j ed<�e jed<�erJe e je j �Ze jed<�e jed<�erpe e je j�Ze jed<�e jed<�er�e e je j�Ze jed<�e jed<�er�e e je j�Ze jed<�e jed<�er�e e je j�Ze jed <�e jed <�e�r e e je j�Ze jed <�e jed <�e�r2e e je j�Z e j!ed<�e j"ed<�e�rZe e j"e j!�Z#e j$ed<�e j%ed<�e�r�e e j%e j$�Z&d d��Z'e j(Z)dd��Z*dS�)� ub_stats_infoc�������������C���s���t�|�t||�S�)N)r-���r��)r'���r)���r*���r���r���r���rI������s����zub_stats_info.<lambda>c�������������C���s���t�|�t|�S�)N)r/���r��)r'���r)���r���r���r���rI������s�����svr�mesh_num_states�mesh_num_reply_states�mesh_jostled�mesh_dropped�mesh_replies_sent�mesh_replies_sum_wait_sec�mesh_replies_sum_wait_usec�mesh_time_medianc�������������C���s:���t�j��}y|�jj|��W�n�tjk r4���||�_Y�nX�d�S�)N)r���Znew_ub_stats_infor���rQ���r2���r3���)r'���r���r���r���r���rE������s ����zub_stats_info.__init__c�������������C���s���d�S�)Nr���)r'���r���r���r���rI������s����N)+r���r5���r8���r!���r%���r.���r����r6���r1���r���Zub_stats_info_svr_setZub_stats_info_svr_getr#���r����r��Z!ub_stats_info_mesh_num_states_setZ!ub_stats_info_mesh_num_states_getr��Z'ub_stats_info_mesh_num_reply_states_setZ'ub_stats_info_mesh_num_reply_states_getr��Zub_stats_info_mesh_jostled_setZub_stats_info_mesh_jostled_getr��Zub_stats_info_mesh_dropped_setZub_stats_info_mesh_dropped_getr��Z#ub_stats_info_mesh_replies_sent_setZ#ub_stats_info_mesh_replies_sent_getr��Z+ub_stats_info_mesh_replies_sum_wait_sec_setZ+ub_stats_info_mesh_replies_sum_wait_sec_getr��Z,ub_stats_info_mesh_replies_sum_wait_usec_setZ,ub_stats_info_mesh_replies_sum_wait_usec_getr��Z"ub_stats_info_mesh_time_median_setZ"ub_stats_info_mesh_time_median_getr��rE���Zdelete_ub_stats_infor����r����r���r���r���r���r�����sX��� r��c���������������@���s��e�Zd�ZdZi�Zdd��Zi�Zdd��Zdd��Ze Z dd��ZejZ dd ��Zd d��Zdd ��Zdd��Zdd��Zd;dd�Zdd��Zd<dd�Zdd��Zdd��Zdd��Zd d!��Zd"d#��Zd$d%��Zd&d'��Zd(d)��Zd*d+��Zd,d-��Zd.d/��Z d0d1��Z!d2d3��Z"e#e$fd4d5�Z%e#e$fd6d7�Z&d8d9��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'] c�������������C���s���t�|�t||�S�)N)r-���r��)r'���r)���r*���r���r���r���rI�����s����zub_ctx.<lambda>c�������������C���s���t�|�t|�S�)N)r/���r��)r'���r)���r���r���r���rI�����s����c�������������O���s���t�d��d�S�)NzNo constructor defined)r&���)r'���ri���rj���r���r���r���rE�����s����zub_ctx.__init__c�������������C���s���t�j��|�_|�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)r���r����r���r3���)r'���r���r���r���rE�����s���� c�������������C���s���t�j|�|�S�)aP��Add 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. )r���r����)r'���r����r���r���r����add_ta��s���� z ub_ctx.add_tac�������������C���s���t�j|�|�S�)a��Add 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. )r���r����)r'���r����r���r���r����add_ta_file%��s���� zub_ctx.add_ta_filec�������������C���s���t�j|�|�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. )r���r����)r'���r����r���r���r����config2��s����z ub_ctx.configc�������������C���s���t�j|�|�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. )r���r����)r'���r����r���r���r���� debuglevel=��s����zub_ctx.debuglevelc�������������C���s���t�j|�|�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'����outr���r���r����debugoutH��s����zub_ctx.debugout� /etc/hostsc�������������C���s���t�j|�|�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. )r���r����)r'���r����r���r���r����hostsh��s���� zub_ctx.hostsc�������������C���s ���t�j|��S�)z�Print the local zones and their content (RR data) to the debug output. :returns: (int) 0 if OK, else error. )r���r����)r'���r���r���r����print_local_zonesu��s����zub_ctx.print_local_zones�/etc/resolv.confc�������������C���s���t�j|�|�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. )r���r����)r'���r����r���r���r���� resolvconf~��s����zub_ctx.resolvconfc�������������C���s���t�j|�|�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. )r���r����)r'���r����r���r���r���� set_async���s���� zub_ctx.set_asyncc�������������C���s���t�j|�|�S�)ao��Set 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. )r���r����)r'���r����r���r���r����set_fwd���s����zub_ctx.set_fwdc�������������C���s���t�j|�||�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. )r���r����)r'���r����r����r���r���r���� set_option���s����zub_ctx.set_optionc�������������C���s���t�j|�|�S�)a��Add 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. )r���r����)r'���r����r���r���r����trustedkeys���s���� zub_ctx.trustedkeysc�������������C���s���t�j|���dS�)z Print local zones using debugoutN)r���r����)r'���r���r���r���� zone_print���s����zub_ctx.zone_printc�������������C���s���t�j|�||�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. )r���r����)r'����zonenameZzonetyper���r���r����zone_add���s����zub_ctx.zone_addc�������������C���s���t�j|�|�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. )r���r����)r'���r,��r���r���r����zone_remove���s����zub_ctx.zone_removec�������������C���s���t�j|�|�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'] )r���r����)r'����rrdatar���r���r����data_add���s����zub_ctx.data_addc�������������C���s���t�j|�|�S�)a��Remove 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. )r���r����)r'���r/��r���r���r����data_remove���s����zub_ctx.data_removec�������������C���s���t�j|�|�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. )r���r����)r'���r����r���r���r����cancel��s���� z ub_ctx.cancelc�������������C���s ���t�j|��S�)aj��Get 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. )r���r����)r'���r���r���r����get_fd��s����z ub_ctx.get_fdc�������������C���s ���t�j|��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. )r���r����)r'���r���r���r����poll ��s����zub_ctx.pollc�������������C���s ���t�j|��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. )r���r����)r'���r���r���r����process)��s����zub_ctx.processc�������������C���s2���t�|t�rtj|�|||�S�tj|�t|�||�S�dS�)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)r:���r9���r���r����� idn2dname)r'���r)���r����r����r���r���r����resolve4��s���� zub_ctx.resolvec�������������C���s:���t�|t�rtj|�|||||�S�tj|�t|�||||�S�dS�)aK��Perform 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)r:���r9���r����_ub_resolve_asyncr6��)r'���r)���r����r����r����r����r���r���r���� resolve_asyncG��s���� zub_ctx.resolve_asyncc�������������C���s ���t�j|��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. )r���r����)r'���r���r���r����waitm��s����zub_ctx.waitN)r"��)r%��)(r���r5���r8���rd���r!���r%���r.���r����rE���r6���r1���r���r����r����r��r��r��r��r!��r#��r$��r&��r'��r(��r)��r*��r+��r-��r.��r0��r1��r2��r3��r4��r5��� RR_TYPE_A�RR_CLASS_INr7��r9��r:��r���r���r���r���r�����sB��� &r��c��������������G���s ���t�j|���S�)N)r���r��)ri���r���r���r���r��~��s����r��c�������������C���s���t�j|�|||||�S�)N)r���r8��)r����r)���r����r����r����Zpyfuncr���r���r���r8�����s����r8��c�������������C���s$���dj�dd��|�jd�D��ddd���S�)zbReverse domain name Usable for reverse lookups when the IP address should be reversed r���c�������������S���s���g�|�]}|�qS�r���r���)rK���rL���r���r���r���rM������s����zreverse.<locals>.<listcomp>Nr������)r ����split)Zdomainr���r���r����reverse���s����r?��c�������������C���s���dj�dd��|�jd�D���S�)z�Converts domain name in IDN format to canonic domain name :param idnname: (unicode string) IDN name :returns: (string) domain name r���c�������������S���s ���g�|�]}|rt�jj|�nd��qS�)r0���)r]���r^���ZToASCII)rK���rL���r���r���r���rM������s����zidn2dname.<locals>.<listcomp>)r ���r>��)Zidnnamer���r���r���r6�����s����r6��c�������������C���s���dj�dd��|�jd�D���S�)z�Converts canonic domain name in IDN format to unicode string :param name: (string) domain name :returns: (unicode string) domain name r���c�������������S���s���g�|�]}t�jj|��qS�r���)r]���r^���r_���)rK���rL���r���r���r���rM������s����zdname2idn.<locals>.<listcomp>)r ���r>��)r)���r���r���r���� dname2idn���s����r@��)r���r���r���)r���r���r���)r���)��sysr���Z_swig_python_version_infor���r���rf���r����� NameErrorr<���r2���r ���r,���r-���r/���r6���r$���r7���r#���r3���Zencodings.idnar]����varsrR���r9���r=���r?���r;��Z RR_TYPE_NSZ RR_TYPE_MDZ RR_TYPE_MFZ RR_TYPE_CNAMEZRR_TYPE_SOAZ RR_TYPE_MBZ RR_TYPE_MGZ RR_TYPE_MRZRR_TYPE_NULLZRR_TYPE_WKSZRR_TYPE_PTRZ RR_TYPE_HINFOZ RR_TYPE_MINFOZ RR_TYPE_MXZRR_TYPE_TXTZ RR_TYPE_RPZ RR_TYPE_AFSDBZRR_TYPE_X25ZRR_TYPE_ISDNZ RR_TYPE_RTZRR_TYPE_NSAPZRR_TYPE_NSAP_PTRZRR_TYPE_SIGZRR_TYPE_KEYZ RR_TYPE_PXZRR_TYPE_GPOSZRR_TYPE_AAAAZRR_TYPE_LOCZRR_TYPE_NXTZRR_TYPE_EIDZRR_TYPE_NIMLOCZRR_TYPE_SRVZRR_TYPE_ATMAZ RR_TYPE_NAPTRZ RR_TYPE_KXZRR_TYPE_CERTZ RR_TYPE_A6Z RR_TYPE_DNAMEZRR_TYPE_SINKZRR_TYPE_OPTZRR_TYPE_APLZ RR_TYPE_DSZ RR_TYPE_SSHFPZRR_TYPE_IPSECKEYZ RR_TYPE_RRSIGZRR_TYPE_NSECZRR_TYPE_DNSKEYZ RR_TYPE_DHCIDZ RR_TYPE_NSEC3ZRR_TYPE_NSEC3PARAMSZ RR_TYPE_UINFOZRR_TYPE_UIDZRR_TYPE_GIDZRR_TYPE_UNSPECZRR_TYPE_TSIGZRR_TYPE_IXFRZRR_TYPE_AXFRZ RR_TYPE_MAILBZ RR_TYPE_MAILAZRR_TYPE_ANYZRR_TYPE_CAAZRR_TYPE_DLVr<��ZRR_CLASS_CHZRR_CLASS_HSZ RR_CLASS_NONEZRR_CLASS_ANYrA���r����r����r����r����r����r����r����r����r����r����r����rC���ZUNBOUND_VERSION_MAJORZUNBOUND_VERSION_MINORZUNBOUND_VERSION_MICROZUNBOUND_VERSION_MAJOR_REALZUNBOUND_VERSION_MINOR_REALZUNBOUND_VERSION_MICRO_REALrh���Zub_result_swigregisterZ UB_NOERRORZ UB_SOCKETZUB_NOMEMZ UB_SYNTAXZUB_SERVFAILZUB_FORKFAILZ UB_AFTERFINALZUB_INITFAILZUB_PIPEZUB_READFILEZUB_NOIDr����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����r����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��r8��r?��r6��r@��r���r���r���r����<module>���s��� Zv7'�� 3���