ó
    Ö›‘hæ  ã                   ó¨   • S S/r SSKJr  SSKJrJr  SSKJrJrJ	r	J
r
  SSKJr  SSKJrJr  SSKJr   " S	 S\R$                  5      r " S
 S \5      rg)ÚSecondaryAuthorityÚSecondaryAuthorityServiceé    )Úservice)ÚdeferÚtask)ÚclientÚcommonÚdnsÚresolve)ÚFileAuthority)ÚfailureÚlog)ÚnativeStringc                   óH   • \ rS rSrSrSrSrS r\S 5       r	S r
S rS	 rS
rg)r   é   a  
A service that keeps one or more authorities up to date by doing hourly
zone transfers from a master.

@ivar primary: IP address of the master.
@type primary: L{str}

@ivar domains: An authority for each domain mirrored from the master.
@type domains: L{list} of L{SecondaryAuthority}
Né5   c                 óp   • [        U5      U l        U Vs/ s H  n[        X5      PM     snU l        gs  snf )zÞ
@param primary: The IP address of the server from which to perform
zone transfers.
@type primary: L{str}

@param domains: A sequence of domain names for which to perform
zone transfers.
@type domains: L{list} of L{bytes}
N)r   Úprimaryr   Údomains)Úselfr   r   Úds       Ú[C:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/names/secondary.pyÚ__init__Ú"SecondaryAuthorityService.__init__    s/   € ô $ GÓ,ˆŒÙ@GÓHÂ¸1Ô*¨7Ö6ÁÑHˆ�ùÒHs   •3c                 óŒ   • Uu  p4U " U/ 5      nXEl         U Vs/ s H  n[        R                  X5      PM     snUl        U$ s  snf )a0  
Construct a new L{SecondaryAuthorityService} from a tuple giving a
server address and a C{str} giving the name of a domain for which this
is an authority.

@param serverAddress: A two-tuple, the first element of which is a
    C{str} giving an IP address and the second element of which is a
    C{int} giving a port number.  Together, these define where zone
    transfers will be attempted from.

@param domains: Domain names for which to perform zone transfers.
@type domains: sequence of L{bytes}

@return: A new instance of L{SecondaryAuthorityService}.
)Ú_portr   ÚfromServerAddressAndDomainr   )ÚclsÚserverAddressr   r   Úportr   r   s          r   ÚfromServerAddressAndDomainsÚ5SecondaryAuthorityService.fromServerAddressAndDomains-   sT   € ð" &‰ˆÙ�g˜rÓ"ˆØŒñ ó
â�ô ×9Ñ9¸-ÖKÙñ
ˆŒð ˆùò	
s   ˜Ac                 óB   • [         R                  " U R                  5      $ )zG
Get a resolver for the transferred domains.

@rtype: L{ResolverChain}
)r   ÚResolverChainr   ©r   s    r   ÚgetAuthorityÚ&SecondaryAuthorityService.getAuthorityG   s   € ô ×$Ò$ T§\¡\Ó2Ð2ó    c                 óD  • [         R                  R                  U 5        U R                   Vs/ s H#  n[        R
                  " UR                  5      PM%     snU l        SnSSKJ	n  U R                   H$  nUR                  X$R                  S5        US-  nM&     g s  snf )Nr   ©Úreactori  é   )r   ÚServiceÚstartServicer   r   ÚLoopingCallÚtransferÚcallsÚtwisted.internetr+   Ú	callLaterÚstart)r   r   Úir+   Úcs        r   r.   Ú&SecondaryAuthorityService.startServiceO   sv   € Ü�‰×$Ñ$ TÔ*Ø<@¿LºLÓIºL°q”d×&Ò& q§z¡zÖ2¹LÑIˆŒ
ØˆÝ,à—”ˆAà×Ñ˜a§¡¨'Ô2Ø�‰FŠAò ùò	 Js   ®*Bc                 óˆ   • [         R                  R                  U 5        U R                   H  nUR	                  5         M     g ©N)r   r-   ÚstopServicer1   Ústop)r   r6   s     r   r:   Ú%SecondaryAuthorityService.stopServiceZ   s+   € Ü�‰×#Ñ# DÔ)Ø—”ˆAØ�F‰FŽHò r(   )r1   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r1   r   r   Úclassmethodr!   r&   r.   r:   Ú__static_attributes__© r(   r   r   r      s<   † ñ	ð €Eà€EòIð ñó ðò23ò	õr(   c                   óp   • \ rS rSrSrSrS=rrSrSr	S r
\S 5       rS rSS	 jrS
 rS rS rS rS rSrg)r   é`   aè  
An Authority that keeps itself updated by performing zone transfers.

@ivar primary: The IP address of the server from which zone transfers will
be attempted.
@type primary: L{str}

@ivar _port: The port number of the server from which zone transfers will
be attempted.
@type _port: L{int}

@ivar domain: The domain for which this is the secondary authority.
@type domain: L{bytes}

@ivar _reactor: The reactor to use to perform the zone transfers, or
L{None} to use the global reactor.
FNr   c                 ó˜   • [         R                  R                  U 5        [        U5      U l        [
        R                  " U5      U l        g)zp
@param domain: The domain for which this will be the secondary
    authority.
@type domain: L{bytes} or L{str}
N)r	   ÚResolverBaser   r   r   r
   ÚdomainStringÚdomain)r   Ú	primaryIPrJ   s      r   r   ÚSecondaryAuthority.__init__x   s6   € ô 	×Ñ×$Ñ$ TÔ*Ü# IÓ.ˆŒÜ×&Ò& vÓ.ˆ�r(   c                 ó*   • Uu  p4U " X25      nXEl         U$ )a  
Construct a new L{SecondaryAuthority} from a tuple giving a server
address and a C{bytes} giving the name of a domain for which this is an
authority.

@param serverAddress: A two-tuple, the first element of which is a
    C{str} giving an IP address and the second element of which is a
    C{int} giving a port number.  Together, these define where zone
    transfers will be attempted from.

@param domain: A C{bytes} giving the domain to transfer.
@type domain: L{bytes}

@return: A new instance of L{SecondaryAuthority}.
)r   )r   r   rJ   r   r    Ú	secondarys         r   r   Ú-SecondaryAuthority.fromServerAddressAndDomain…   s    € ð" &‰ˆÙ˜Ó(ˆ	ØŒØÐr(   c                 óP  • U R                   (       a  gSU l        U R                  nUc  SSKJn  [
        R                  " U R                  U R                  4/US9nUR                  U R                  5      R                  U R                  5      R                  U R                  5      $ )z{
Attempt a zone transfer.

@returns: A L{Deferred} that fires with L{None} when attempted zone
    transfer has completed.
NTr   r*   )Úserversr+   )ÚtransferringÚtransferingÚ_reactorr2   r+   r   ÚResolverr   r   Ú
lookupZonerJ   ÚaddCallbackÚ_cbZoneÚ
addErrbackÚ_ebZone)r   r+   Úresolvers      r   r0   ÚSecondaryAuthority.transfer›   s�   € ð ××ØØˆÔà—-‘-ˆØ‰?Ý0ä—?’?Ø—l‘l D§J¡JÐ/Ð0¸'ñ
ˆð ×Ñ §¡Ó,ß‰[˜Ÿ™Ó&ß‰Z˜Ÿ™Ó%ð	
r(   c                 óò   • U R                   (       a  U R                  (       d>  [        R                  " [        R
                  " [        R                  " U5      5      5      $ [        R                  " XX#U5      $ r9   )
ÚsoaÚrecordsr   Úfailr   ÚFailurer
   ÚDomainErrorr   Ú_lookup)r   Únamer   ÚtypeÚtimeouts        r   rc   ÚSecondaryAuthority._lookupµ   sG   € Ø�x�x˜tŸ|Ÿ|ô —:’:œgŸošo¬c¯oªo¸dÓ.CÓDÓEÐEÜ×$Ò$ T°¸GÓDÐDr(   c                 óš  • Uu  n  n0 =U l         nU H¶  nU R                  (       dU  UR                  [        R                  :X  a7  UR
                  R
                  R                  5       UR                  4U l        Mi  UR                  UR
                  R
                  R                  5       / 5      R                  UR                  5        M¸     g r9   )
r_   r^   re   r
   ÚSOArd   ÚlowerÚpayloadÚ
setdefaultÚappend)r   ÚzoneÚansÚ_ÚrÚrecs         r   rX   ÚSecondaryAuthority._cbZone¼   sˆ   € Ø‰	ˆˆQ�ØÐˆŒ�qÛˆCØ—8—8 §¡¬C¯G©GÓ 3ØŸH™HŸM™M×/Ñ/Ó1°3·;±;Ð?�–à—‘˜SŸX™XŸ]™]×0Ñ0Ó2°BÓ7×>Ñ>¸s¿{¹{ÖKò	 r(   c                 ó–   • [         R                  " SU R                  < SU R                  < S35        [         R                  " U5        g )Nz	Updating ú from z failed during zone transfer)r   ÚmsgrJ   r   Úerr©r   r   s     r   rZ   ÚSecondaryAuthority._ebZoneÅ   s.   € Ü�‹à�{Œ{˜DŸLœLð*ô	
ô 	�Š�Õr(   c                 ól   • U R                  5       R                  U R                  U R                  5        g r9   )r0   ÚaddCallbacksÚ_cbTransferredÚ_ebTransferredr%   s    r   ÚupdateÚSecondaryAuthority.updateÌ   s$   € Ø�‰‹×$Ñ$ T×%8Ñ%8¸$×:MÑ:MÕNr(   c                 ó   • SU l         g )NF)rR   )r   Úresults     r   r|   Ú!SecondaryAuthority._cbTransferredÏ   s
   € Ø!ˆÕr(   c                 ó¤   • SU l         [        R                  " SU R                  < SU R                  < S35        [        R
                  " U5        g )NFzTransferring ru   z failed after zone transfer)Útransferredr   rv   rJ   r   rw   rx   s     r   r}   Ú!SecondaryAuthority._ebTransferredÒ   s6   € Ø ˆÔÜ�‹à�{Œ{˜DŸLœLð*ô	
ô 	�Š�Õr(   )rJ   r   r_   r^   rS   r„   rR   r9   )r=   r>   r?   r@   rA   rR   r^   r_   r   rT   r   rB   r   r0   rc   rX   rZ   r~   r|   r}   rC   rD   r(   r   r   r   `   sa   † ñð$ €LØÐ€Cˆ'Ø€EØ€Hò/ð ñó ðò*
ô4EòLòòOò"õr(   N)Ú__all__Útwisted.applicationr   r2   r   r   Útwisted.namesr   r	   r
   r   Útwisted.names.authorityr   Útwisted.pythonr   r   Útwisted.python.compatr   r-   r   r   rD   r(   r   Ú<module>rŒ      sH   ðð  Ð!<Ð
=€å 'ß (ß 6Ó 6Ý 1ß 'Ý .ôM §¡ô Mô`x˜õ xr(   