+
    Dfj                         R t ^ RIHt ^ RIHtHt ^ RIHtHt ^ RI	H
t
 ^ RIHt ^ RIHt R tR t ! R	 R
]P"                  4      tR# )z
hosts(5) support.
)defer)isIPAddressisIPv6Address)commondns)failure)nativeString)FilePathc                B   . p V P                  4       P                  4       pTP                  4       pT F  pTP	                  R4      pTR8w  d   TRT pT'       g   K*  TP                  4       pTP                  4       TR,           Uu. uF  qwP                  4       NK  	  up9   g   Ku   \        T^ ,          4      p\        T4      '       g   \        T4      '       g   K  TP                  T4       K  	  T#   \         d    Tu # i ; iu upi   \         d     K  i ; i)a  
Search the given file, which is in hosts(5) standard format, for addresses
associated with a given name.

@param hostsFile: The name of the hosts(5)-format file to search.
@type hostsFile: L{FilePath}

@param name: The name to search for.
@type name: C{bytes}

@return: L{None} if the name is not found in the file, otherwise a
    C{str} giving the address in the file associated with the name.
   #N:   NN)
getContent
splitlinesBaseExceptionlowerfindsplitr   
ValueErrorr   r   append)		hostsFilenameresultslineslineidxpartssmaybeIPs	   &&       5/usr/lib/python3/dist-packages/twisted/names/hosts.pysearchFileForAllr       s     G$$&113 ::<Diio"9:D

::<uRy9y!GGIy99&uQx0 7##}W'='=w'  N'   :  s)   C7 D
*D7DDDDc                R    \        \        V 4      V4      pV'       d
   V^ ,          # R# )a  
Grep given file, which is in hosts(5) standard format, for an address
entry with a given name.

@param file: The name of the hosts(5)-format file to search.
@type file: C{str} or C{bytes}

@param name: The name to search for.
@type name: C{bytes}

@return: L{None} if the name is not found in the file, otherwise a
    C{str} giving the first address in the file associated with
    the name.
N)r    r	   )filer   	addressess   && r   searchFileForr$   9   s$     !$6I|    c                   X   a  ] tR t^Nt o RtR
R ltR tR tR tRR lt	RR lt
]	tR	tV tR# )Resolverz1
A resolver that services hosts(5) format files.
c                \    \         P                  P                  V 4       Wn        W n        R # N)r   ResolverBase__init__r"   ttl)selfr"   r,   s   &&&r   r+   Resolver.__init__S   s     $$T*	r%   c                   a a \         ;QJ d5    . VV 3R l\        \        S P                  4      S4       4       F  NK  	  5# ! VV 3R l\        \        S P                  4      S4       4       4      # )z^
Return a tuple of L{dns.RRHeader} instances for all of the IPv4
addresses in the hosts file.
c              3     <"   T Fw  p\        V4      '       g   K  \        P                  ! S\        P                  \        P                  SP
                  \        P                  ! VSP
                  4      4      x  Ky  	  R # 5ir)   )r   r   RRHeaderAINr,   Record_A.0addrr   r-   s   & r   	<genexpr>%Resolver._aRecords.<locals>.<genexpr>]   sR      
C4  VCLLsuucffdhhT4888TUUC   BA'Btupler    r	   r"   r-   r   s   ffr   	_aRecordsResolver._aRecordsX   sW    
 u 
($)))<dC
u 	
u 
($)))<dC
 
 	
r%   c                   a a \         ;QJ d5    . VV 3R l\        \        S P                  4      S4       4       F  NK  	  5# ! VV 3R l\        \        S P                  4      S4       4       4      # )z^
Return a tuple of L{dns.RRHeader} instances for all of the IPv6
addresses in the hosts file.
c              3     <"   T Fw  p\        V4      '       g   K  \        P                  ! S\        P                  \        P                  SP
                  \        P                  ! VSP
                  4      4      x  Ky  	  R # 5ir)   )r   r   r1   AAAAr3   r,   Record_AAAAr5   s   & r   r8   (Resolver._aaaaRecords.<locals>.<genexpr>h   s\      
 DT"	CLLchh#//$2Q  Dr:   r;   r=   s   ffr   _aaaaRecordsResolver._aaaaRecordsc   s[    
 u 
 )$)))<dC	
u 	
u 
 )$)))<dC	
 
 	
r%   c                    V'       d   \         P                  ! VRR34      # \         P                  ! \        P                  ! \
        P                  ! V4      4      4      # )a  
Generate a response for the given name containing the given result
records, or a failure if there are no result records.

@param name: The DNS name the response is for.
@type name: C{str}

@param records: A tuple of L{dns.RRHeader} instances giving the results
    that will go into the response.

@return: A L{Deferred} which will fire with a three-tuple of result
    records, authority records, and additional records, or which will
    fail with L{dns.DomainError} if there are no result records.
 )r   succeedfailr   Failurer   DomainError)r-   r   recordss   &&&r   _respondResolver._respondp   s>     =='2r!233zz'//#//$*?@AAr%   Nc                n    \         P                  ! V4      pV P                  WP                  V4      4      # )zU
Read any IPv4 addresses from C{self.file} and return them as
L{Record_A} instances.
)r   domainStringrN   r>   r-   r   timeouts   &&&r   lookupAddressResolver.lookupAddress   s,    
 %}}T>>$#788r%   c                n    \         P                  ! V4      pV P                  WP                  V4      4      # )zX
Read any IPv6 addresses from C{self.file} and return them as
L{Record_AAAA} instances.
)r   rQ   rN   rE   rR   s   &&&r   lookupIPV6AddressResolver.lookupIPV6Address   s.    
 %}}T#4#4T#:;;r%   )r"   r,   )s
   /etc/hostsi  r)   )__name__
__module____qualname____firstlineno____doc__r+   r>   rE   rN   rT   rW   lookupAllRecords__static_attributes____classdictcell__)__classdict__s   @r   r'   r'   N   s1     
	

B&9< %r%   r'   N)r]   twisted.internetr   twisted.internet.abstractr   r   twisted.namesr   r   twisted.pythonr   twisted.python.compatr   twisted.python.filepathr	   r    r$   r*   r'   rH   r%   r   <module>rh      s=   

 # @ % " . ,$N*I%v"" I%r%   