lf:tddlmZmZddlZejejejkr e dddl m Z ddl m Z mZmZddlmZddlZddlZddlZddlZddlZgdZeD]Zeeeee<id d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*ZeD]\ZZeeeee<eej ej!ej"ed+<d,Z#Gd-d.e$Z%e&Z'ej(d/Z)ej(d0Z*ej(d1Z+ej(d2Z,ej(d3Z-d4Z.Gd5d6Z/Gd7d8Z0Gd9d:e0Z1Gd;de0Z3Gd?d@e0Z4GdAdBe0Z5GdCdDe0Z6GdEdFe0Z7GdGdHe0Z8GdIdJe0Z9GdKdLe0Z:GdMdNe0Z;GdOdPe0Z<GdQdRe0Z=GdSdTe0Z>GdUdVe0Z?GdWdXe0Z@GdYdZe0ZAeeBeCzgd[zZD[[dS)\)ffilibNzCould not initialize c-ares)errno) ascii_bytes maybe_str parse_name) __version__)ARES_FLAG_USEVCARES_FLAG_PRIMARYARES_FLAG_IGNTCARES_FLAG_NORECURSEARES_FLAG_STAYOPENARES_FLAG_NOSEARCHARES_FLAG_NOALIASESARES_FLAG_NOCHECKRESPARES_NI_NOFQDNARES_NI_NUMERICHOSTARES_NI_NAMEREQDARES_NI_NUMERICSERV ARES_NI_DGRAM ARES_NI_TCP ARES_NI_UDP ARES_NI_SCTP ARES_NI_DCCPARES_NI_NUMERICSCOPEARES_NI_LOOKUPHOSTARES_NI_LOOKUPSERVICE ARES_NI_IDNARES_NI_IDN_ALLOW_UNASSIGNED ARES_NI_IDN_USE_STD3_ASCII_RULESARES_SOCKET_BAD QUERY_TYPE_AT_AQUERY_TYPE_AAAAT_AAAAQUERY_TYPE_ANYT_ANYQUERY_TYPE_CAAT_CAAQUERY_TYPE_CNAMET_CNAME QUERY_TYPE_MXT_MXQUERY_TYPE_NAPTRT_NAPTR QUERY_TYPE_NST_NSQUERY_TYPE_PTRT_PTRQUERY_TYPE_SOAT_SOAQUERY_TYPE_SRVT_SRVQUERY_TYPE_TXTT_TXTQUERY_CLASS_INC_INQUERY_CLASS_CHAOSC_CHAOSQUERY_CLASS_HSC_HSQUERY_CLASS_NONEC_NONEQUERY_CLASS_ANYC_ANY ARES_VERSIONceZdZdS) AresErrorN)__name__ __module__ __qualname__r/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/pycares/__init__.pyrHrHXsDrMrHcHtj|}||||dSN)_ffi from_handle)data socket_fdreadablewritable sock_state_cbs rN_sock_state_cbrX`s,$T**MM)Xx00000rMctj|}t||tjkrd}nt |}d}|||dSrP)rQrR _global_setdiscard_lib ARES_SUCCESSares_host_result)argstatustimeoutshostentcallbackresults rN_host_cbreese$$H """!'** HVVrMctj|}t||tjkrd}nt ||}d}|||dSrP)rQrRrZr[r\r]ares_nameinfo_result)r_r`ranodeservicercrds rN _nameinfo_cbrjrsg$$H """%dG44 HVVrMc tj|\}}t||tjkr(|tjkrg}tjtjtj tj tj tj tj tjtjtjtjf D]}t%|||\} }|dtjtjfvrd}nO| Jt+| t,jjr|| l|| d}nt%|||\}}nd}|||dSrP)rQrRrZr[r\r]r(r$r&r*r,r.r0r2r4r6r8r: parse_result ARES_ENODATA ARES_EBADRESP isinstance collectionsabcIterableextendappend) r_r`raabufalenrc query_typerdqtypers rN _query_cbrzs_+C00Hj """  # #F(DKT\49VZVbdhdmosoy{|FHLHRTXT^_  (d;; 6$(94;M!NNN!FE=!![_%=>>) a(((( a((()*dDAANFFF HVVrMctj|}t||tjkrd}nt |}d}|||dSrP)rQrRrZr[r\r]ares_addrinfo_result)r_r`raresrcrds rN _addrinfo_cbr~se$$H """%c** HVVrMc|tjkrtjdttjdt}tj||tj|}|tjkrd}|}nfdt|dD}d}n|tj krtjdttjdt}tj ||tj|}|tjkrd}|}n`fdt|dD}d}n;|tj krtjd}tj |||}|tjkrd}|}ng}|d}|tjkr9| t||j}|tjk9tj|dd}nz|tjkrtjd} tj||| tjtj}|tjkrd}|}nt%| d}tj| dd}n|tjkrtjd } tj||| }|tjkrd}|}ng}| d} | tjkr9| t-| | j} | tjk9tj| dd}n |tjkrtjd } tj||| }|tjkrd}|}ng}| d} | tjkr9| t3| | j} | tjk9tj| dd}n_|tjkrtjd}tj|||}|tjkrd}|}ng}|d} d}| j|tjkrM| t;| j||d z }| j|tjkMtj| d}n|tjkrtjd}tj||tjdt@j!|}|tjkrd}|}ng}|d} d}| j|tjkr_| tEtj#| j||d z }| j|tjk_tI| |}tj| d}nm|tj%krstjd }tj&|||}|tjkrd}|}ntO|d}tj|dd}n|tj(krtjd }tj)|||}|tjkrd}|}ng}|d}|tjkr9| tU||j}|tjk9tj|dd}n)|tj+kr tjd}tj,|||}|tjkrd}|}ng}|d}d} |tjkr%|"| t[|nk|j.d kr4|"| t[|t_|}n$t_|}|xj0|j0z c_0|j}tj|dd}ntcd||fS)Nzstruct ares_addrttl[]zint*c:g|]}t|SrL)ares_query_a_result.0iaddrttlss rN z parse_result..s&TTT1)(1+66TTTrMrzstruct ares_addr6ttl[]c:g|]}t|SrL)ares_query_aaaa_resultrs rNrz parse_result..s&WWWa,Xa[99WWWrMzstruct ares_caa_reply **zstruct hostent **zstruct ares_mx_reply **zstruct ares_naptr_reply **rzstruct ares_soa_reply **zstruct ares_srv_reply **zstruct ares_txt_ext **Tinvalid query type specified)2r\r$rQnewPYCARES_ADDRTTL_SIZEares_parse_a_replyNULLr]ranger&ares_parse_aaaa_replyr*ares_parse_caa_replyrtares_query_caa_resultnextares_free_datar,ares_query_cname_resultares_free_hostentr.ares_parse_mx_replyares_query_mx_resultr0ares_parse_naptr_replyares_query_naptr_resultr2ares_parse_ns_reply h_aliasesares_query_ns_resultr4ares_parse_ptr_replysocket AF_UNSPECrstringares_query_ptr_resultr6ares_parse_soa_replyares_query_soa_resultr8ares_parse_srv_replyares_query_srv_resultr:ares_parse_txt_reply_extares_query_txt_result record_startares_query_txt_result_chunktext ValueError)rwrurv naddrttls parse_statusrdr` caa_reply caa_reply_ptrhostmx_reply mx_reply_ptr naptr_replynaptr_reply_ptrrbraliases soa_reply srv_reply srv_reply_ptr txt_reply txt_reply_ptrtmp_obj new_chunkrs @rNrlrlsTX835IJJHV%9:: .tT49hPYZZ 4, , ,F!FFTTTTiPQl@S@STTTFFF t{ " "846JKKHV%9:: 1$diS\]] 4, , ,F!FFWWWW5STCVCVWWWFFF tz ! !H788 0tYGG 4, , ,F!FFF%aLM49,, 3MBBCCC - 2  49,,   ! - - -FF t| # #x+,,.tT4DIVV 4, , ,F!FF,T!W55F  "47 + + +FF ty 8566/dHEE 4, , ,F!FFF#A;L$)++ 2<@@AAA+0 $)++   , , ,FF t| # #h;<< 24{KK 4, , ,F!FFF)!nO!TY.. 5oFFGGG"1"6"TY..   A / / /FF ty (.///dGDD 4, , ,F!FFF1:DA.#ty00 24>!3DEEFFFQ.#ty00  "4 ( ( (FF tz ! !(.//0tTY6K[]dee 4, , ,F!FFG1:DA.#ty00yT^A5F)G)GHHIIIQ.#ty00+499F  "4 ( ( (FF tz ! !H788 0tYGG 4, , ,F!FF*9Q<88F   ! - - -FF tz ! !H788 0tYGG 4, , ,F!FFF%aLM49,, 3MBBCCC - 2  49,,   ! - - -FF tz ! !H566 4T4KK 4, , ,F!FFF%aLMG 3 DI--* &;G&D&DEEE -22* &;G&D&DEEE9-HHGG ;M J JILLIN2LL - 2  3   ! - - -FF7888 6>rMc eZdZejejejejejej ej ej ej ej ejejf ZejejejejejfZ ddZdZedZejdZdZdZdd Zd Zd Z dd Z!ddZ"ddZ#ddZ$dZ%dZ&dZ'dS)ChannelNFctjd}tjd}d}|||_|tjz}|&t |dz|_|tjz}|||_|tj z}|||_ |tj z}|||_ |tj z}|||_|tjz}| | |_|tjz}| | |_|tjz}| r`t)| st+dtj| }||_tj|_||_|tjz}| r6tjdt9| |_|tjz}|rd|D}tjdt?|d zz}tAt?|D] }||||<||_!t?||_"|tj#z}| r|tj$z}|6|tj%z}tjdt9||_&tj'|||}|tj(krtSd tj*|d |_+|r||_,|r|-||r|.|dSdS) Nzares_channel *zstruct ares_options *rizsock_state_cb is not callablechar[]cRg|]$}tjdt|%S)r)rQrr)rrs rNrz$Channel.__init__..s*HHH1DHX{1~~66HHHrMz char *[%d]rz#Failed to initialize c-ares channelc6tj|dSNr)r\ ares_destroy)xs rNz"Channel.__init__..s43DQqT3J3JrM)/rQrflagsr\ARES_OPT_FLAGSinttimeoutARES_OPT_TIMEOUTMStriesARES_OPT_TRIESndotsARES_OPT_NDOTStcp_portARES_OPT_TCP_PORTudp_portARES_OPT_UDP_PORTsocket_send_buffer_sizeARES_OPT_SOCK_SNDBUFsocket_receive_buffer_sizeARES_OPT_SOCK_RCVBUFcallable TypeError new_handle_sock_state_cb_handlerXrWsock_state_cb_dataARES_OPT_SOCK_STATE_CBrlookupsARES_OPT_LOOKUPSlenrdomainsndomainsARES_OPT_DOMAINSARES_OPT_ROTATEARES_OPT_RESOLVCONFresolvconf_pathares_init_optionsr]rHgc_channelservers set_local_ip set_local_dev)selfrrrrrrrrrrWrrrotatelocal_ip local_devrchanneloptionsoptmaskuserdatastrscrrys rN__init__zChannel.__init__Js$(+,,(233  !GM 33G  !'D.11GO 77G  !GM!44G  !GM!44G  'G !77G  'G !77G " ..EG +!::G % 11KG .!::G  =M** A ?@@@}55H*2D &$($7G !)1G &!<;v3F3FWXYZW[W`WfHgHghhlmmm$n! $V_k&6I6I4>Z[\]Z^ZcZiKjKjkkoppp$o!  !56661uu $qt 4 4!a%  !$-"2A 6 6 ! ! !Au~a0011 1 " !rMcg}g}tjdtjz}tj|jd|tj}t tjD]b}tj||r|||tj ||r|||c||fS)Nzares_socket_t [%d]r) rQrr\ARES_GETSOCK_MAXNUM ares_getsockrrARES_GETSOCK_READABLErtARES_GETSOCK_WRITABLE)rrfdswfdssocksbitmaskrs rNgetsockzChannel.getsocks-0HHII#DM!$4eT=UVVt/00 & &A)'155 & E!H%%%)'155 & E!H%%%TzrMctj|jdtjd|tjd|dS)Nr ares_socket_t)r\ares_process_fdrrQcast)rread_fdwrite_fds rN process_fdzChannel.process_fds@ T]1-ty'/R/RTXT]^mowTxTxyyyyyrMctj}tjd}|z|dkretjd}tt j||_tt j|ddz|_ntdtj |j d|||tjkrdS|j|jdz zS)Nzstruct timeval*gg?i@Bz-timeout needs to be a positive number or Nonerg.A) rQrrrmathfloortv_secfmodtv_usecrr\ ares_timeoutr)rtmaxtvtvs rNrzChannel.timeouts  X' ( ( =Cxx!233"4:a==11 #DIa$5$5$? @ @  !PQQQ $-*E2666 ??3 BJ223rMct|stdtjd}tjd}t jt jt||dkr|}t j}nOt jt j t||dkr|}t j }ntdtj |}t |t j|jd|tj|d|tj|dS)Na callable is requiredstruct in_addr*struct ares_in6_addr*rr r)rrrQrr\r rr rrrrrZaddares_gethostbyaddrrsizeofre)rrrcr raddressrrs rN gethostbyaddrzChannel.gethostbyaddrs!! 6455 5*++011  v~{4/@/@5 J Ja O OG^FF  +d2C2Ce M MQR R RG_FF122 2?8,,!!!  a 0'4;wqz;R;RTZ\`\ikstttttrMct|stdtj|}t|t j|jdt||t j |dS)Nr-r) rrrQrrZr0r\ares_gethostbynamerr re)rnamerrcrs rN gethostbynamezChannel.gethostbynamess!! 6455 5?8,,!!!  a 0*T2B2BFDM[cdddddrMrc t|std| tj}nGt |t r#t |d}nt|}tj |} t | tj d} || _ || _|| _|| _t#j|jdt)||| t"j| dS)Nr-asciizstruct ares_addrinfo_hints*r)rrrQrrorstrencoderrrZr0rai_flags ai_family ai_socktype ai_protocolr\ares_getaddrinforr r~) rrportrcrtypeprotorrirhintss rN getaddrinfozChannel.getaddrinfos!! 6455 5 <iGG c " " ($ii&&w//GG!$''G?8,,!!!677  ! dmA. 40@0@'5RVRcemnnnnnrMcN|tj||||dSN) query_class) _do_queryr\ ares_queryrr7rwrcrIs rNqueryz Channel.query0s' tj(P[\\\\\rMcN|tj||||dSrH)rJr\ ares_searchrLs rNsearchzChannel.search3s( t'z8Q\]]]]]rMct|std||jvrtd| tj}||jvrtdtj||f}t |||j dt|||tj |dS)Nr-rzinvalid query class specifiedr)rr __qtypes__rr\r< __qclasses__rQrrZr0rr rz)rfuncr7rwrcrIrs rNrJzChannel._do_query6s!! 6455 5 T_ , ,;<< <  )K d/ / /<== =?Hj#9::!!! T]1 z$//j$.ZbcccccrMctjd}tjd}tjtjt ||dkr9tj|jdt j |j dStjtj t ||dkr"tj |jd|dStd)Nr.r/rrr )rQrr\r rr rares_set_local_ip4rntohls_addrrares_set_local_ip6r)rrr rs rNrzChannel.set_local_ipGs*++011  v~{2 F F! K K  #DM!$4fl5<6P6P Q Q Q Q Q  +b//5 I IQ N N  #DM!$4e < < < < <122 2rMc~t|stdt|dkr|\}}tjd}t jtjt|tj |j dkrtd|ztj|_ tj||_|}nt|dkr|\}}}} tjd} t jtjt|tj | jdkrtd|ztj| _tj|| _tj|| _| | _| }ntd tj|} t0| t j|jd tjd |tj|d |t j| dS) Nr-struct sockaddr_in*rzInvalid IPv4 address %rstruct sockaddr_in6*zInvalid IPv6 address %rzInvalid address argumentrzstruct sockaddr*)rrrrQrr\r rr rrsin_addrr sin_familyhtonssin_portr sin6_addr sin6_family sin6_porthtonl sin6_flowinfo sin6_scope_idrrZr0ares_getnameinforrr2rj) rr3rrcrrBsa4saflowinfoscope_idsa6rs rN getnameinfozChannel.getnameinfoQs!! 6455 5 w<<1   JR(011C"6>;r??DNSVS_D`D`aaefff !:R!?@@@#^CN!<--CLBB \\Q  -4 *Rx(122C"6?KOOT^TWTaEbEbccghhh !:R!?@@@$oCO"L..CM & X 6 6C  (C BB788 8?8,,!!! dmA. :Lb0Q0QSWS^_abc_dSeSeglnrnBJ K K K K KrMcFtj|jd|dSr)r\ares_set_local_devr)rdevs rNrzChannel.set_local_devns"  a 0#66666rM)NNNNNNNNNNNNFNNNrP)rrrr)(rIrJrKr\r$r&r(r*r,r.r0r2r4r6r8r:rRr<r>r@rBrDrSrrpropertyrsetterrr!rr4r8rFrMrPrJrrorrLrMrNrrFs(DKTZtyZ^Zfhlhqsws}@D@JLPLVX\XbcJIt|TY TZPL  !%+/.2 !#'!e*e*e*e*N+++X, ^22^2"   zzz4444&uuu&eeeoooo*]]]]^^^^dddd"333KKK:77777rMrceZdZdZdZdS) AresResultrLctfdjD}djjdd|S)Nc:g|]}|dt|S)=)getattr)rars rNrz'AresResult.__repr__..vs/IIIQAAAwtQ///0IIIrM z, ) __slots__ __class__rIjoin)rattrss` rN__repr__zAresResult.__repr__usEIIII$.III N333TYYu5E5E5EFFrMN)rIrJrKr}rrLrMrNrvrvrs-IGGGGGrMrvceZdZdZdZdZdS)rrttlAcBtjdtj}tjt jtj|j|tjttj |tj|_ |j |_ dSNr) rQrr\rrrr ripaddrrrrrr ares_addrttlbufs rNrzares_query_a_result.__init__smhx!677 FNDN<;N,O,OQTVZVkllldk#t/DEEFF #rMNrIrJrKr}rCrrLrMrNrr}s-I D$$$$$rMrceZdZdZdZdZdS)rrAAAAcBtjdtj}tjt jtj|j|tjttj |tj|_ |j |_ dSr) rQrr\rrrrrip6addrrrrrrs rNrzares_query_aaaa_result.__init__smhx!677 FOT^LrQrr\rrr rrrrr`rr_rntohsrbrrrdrcrergrhr)r ares_noderrrs rNrz"ares_addrinfo_node_result.__init__!s#' !- !-  ~!44444 Xi!6 7 7 >V^ + + .DK /66AyD/ dnQZ>X>XZ\^b^stttt![T-BCCV\RSR\E]E]^ ut^v . . /DK 0$77AyD/ t~ak?Z?Z\^`d`uvvvv![T-BCCV\RSR]E^E^`a`oqrrAB wv677 7rMNrrLrMrNrrs(JI88888rMrceZdZdZdZdS)ares_addrinfo_cname_result)raliasr7c|j|_ttj|j|_ttj|j|_dSrP)rrrQrrr7)r ares_cnames rNrz#ares_addrinfo_cname_result.__init__=sF>t{:+;<<== dk*/::;; rMNrrLrMrNrr:s((I<<<<|jt ||j}|tjk>|j}|tjkr>|jt||j}|tjk>tj |dSrP) rrrQrrtrrrai_nextr\ares_freeaddrinfo)r ares_addrinfo cname_ptrnode_ptrs rNrzares_addrinfo_result.__init__Fs  !( 49$$ K  9)DD E E E!I49$$!&$)## J  7AA B B B'H$)## }-----rMNrrLrMrNr|r|Cs(#I . . . . .rMr|)rHrrr )E_caresrrQrr\ _cffi_backendr]ares_library_initARES_LIB_INIT_ALL RuntimeErrorrutilsrrr _versionr collections.abcrprr# functoolssysexported_pycares_symbolssymbolrzglobalsexported_pycares_symbols_mapitemskvr ares_versionrr ExceptionrHsetrZ def_externrXrerjrzr~rlrrvrrrrrrrrrrrrr^rgrrr|listkeys__all__rLrMrNrs,,,,,,,,..t/EFFFF ,4 5 555555555555!!!!!!  @'..Ff--GGIIf                   ! "# $% &' () . ) . . 0 0$$DAq74##GGIIaLL&Ikdk2C$2CDI2N2N&O&OPP .        cee 111      4   \\\~i7i7i7i7i7i7i7i7X GGGGGGGG$$$$$*$$$$$$$$Z$$$Zj:     j   :J     J        Z   J*z(YYYYY:YYY88888 8888<<<<<<<<.....:...$ #TT*F*K*K*M*M%N%N NRBRBRB B:::rM