+
    Dfj%              	         a  R# t/0 t R t^ RIt^ RIt^ RIHtHtHtHtH	t	H
t
HtHtHtHtHtHt ^ RIHt ^ RIHtHtHt ^ RIHtHtHt ^ RIHt ]! ]! R4      ;'       g    R4      t]P:                  P=                  R	4      '       g   ]P:                  R
8X  d   R]3R]3.t] ^ k M	R]3.t] ^k  ! R R]4      t  ! R R]4      t! ! R R]4      t" ! R R]4      t# ! R R]4      t$ ! R R]4      t%]! ]%4      t&R]&3R]3R]3R]! ]"4      3R]! ]"4      3R]! ]"4      3R]3.]%n'        ]PP                  t(]! ]&4      .](n)        ]	](n*        ]PV                  t+]&.]+n)        R  t,R! t-R" t.R# )$z>
POSIX implementation of local network interface enumeration.
N)CDLLPOINTER	Structurec_char_pc_intc_ubytec_uint8c_uint32c_ushortc_void_pcastpointer)find_library)AF_INETAF_INET6	inet_ntop)AnyListTuple)nativeStringc freebsddarwinsin_len
sin_familyc                   .    ] tR t^,tR ]^,          3.tRtR# )in_addr N__name__
__module____qualname____firstlineno__r   _fields___static_attributes__r       D/usr/lib/python3/dist-packages/twisted/internet/test/_posixifaces.pyr   r   ,   s    	GaK Hr&   r   c                   .    ] tR t^2tR]^,          3.tRtR# )in6_addrr   r   Nr   r   r&   r'   r)   r)   2   s    	GbL!Hr&   r)   c                   .    ] tR t^8t]R]3.,           tRtR# )sockaddrsin_portr   N)r    r!   r"   r#   _sockaddrCommonr
   r$   r%   r   r&   r'   r+   r+   8   s    	X" Hr&   r+   c                   4    ] tR t^>t]R]3R]3.,           tRtR# )sockaddr_inr,   sin_addrr   N)	r    r!   r"   r#   r-   r
   r   r$   r%   r   r&   r'   r/   r/   >   s!    	X	W" Hr&   r/   c                   :    ] tR t^Et]R]3R]3R]3.,           tRt	R# )sockaddr_in6r,   sin_flowinfor0   r   N)
r    r!   r"   r#   r-   r
   r	   r)   r$   r%   r   r&   r'   r2   r2   E   s)    	X	"	X" Hr&   r2   c                       ] tR t^MtRtR# )ifaddrsr   N)r    r!   r"   r#   r%   r   r&   r'   r5   r5   M   s    r&   r5   ifa_nextifa_name	ifa_flagsifa_addrifa_netmaskifa_dstaddrifa_datac                    \         P                  P                  R4      '       d-   VR,          R8X  d   VR,          R,           VR,          ,           # V# )aj  
On FreeBSD, kill the embedded interface indices in link-local scoped
addresses.

@param family: The address family of the packed address - one of the
    I{socket.AF_*} constants.

@param packed: The packed representation of the address (ie, the bytes of a
    I{in_addr} field).
@type packed: L{bytes}

@return: The packed address with any FreeBSD-specific extra bits cleared.
@rtype: L{bytes}

@see: U{https://twistedmatrix.com/trac/ticket/6843}
@see: U{http://www.freebsd.org/doc/en/books/developers-handbook/ipv6.html#ipv6-scope-index}

@note: Indications are that the need for this will be gone in FreeBSD >=10.
r   :N   Ns   s     :   NN)sysplatform
startswith)familypackeds   &&r'   _maybeCleanupScopeIndexrE   d   sA    ( ||y))fRjK.GbzK'&*44Mr&   c                    \        4       p \        \        V 4      4      ^ 8  d   \        4       h. p V '       Ed1   V ^ ,          P                  '       Ed   V ^ ,          P                  ^ ,          P
                  pV\        8X  d,   \        V ^ ,          P                  \        \        4      4      pM8V\        8X  d,   \        V ^ ,          P                  \        \        4      4      pMRpV'       dg   \        V^ ,          P                  P                  R,          4      p\        W$4      pVP!                  V ^ ,          P"                  V\%        W$4      34       V ^ ,          P&                  p EK9   \)        V 4       V#   \)        T 4       i ; i)z
Call C{getifaddrs(3)} and return a list of tuples of interface name, address
family, and human-readable address representing its results.
N:NNN)	ifaddrs_p
getifaddrsr   OSErrorr9   r   r   r   r   r/   r   r2   bytesr0   r   rE   appendr7   r   r6   freeifaddrs)r5   resultsrC   addrrD   s        r'   _interfacesrO   }   s*   
 kG''"#a'iGgqz""" ,,Q/::W$
 3 3W[5IJDx'
 3 3W\5JKDD"47#3#3#;#;A#>?F4VDFNN ,,fi6OP aj))G# & 	GN 	Gs   E8 E8 BE8 .A<E8 8Fc                     . p \        4        Fb  w  rp\        V4      p\        V4      pV\        P                  8X  g   K3  VP	                  R4      '       g   KL  V P                  V RV 24       Kd  	  V # )z
Return a list of strings in colon-hex format representing all the link local
IPv6 addresses available on the system, as reported by I{getifaddrs(3)}.
zfe80:%)rO   r   socketr   rB   rK   )retList	interfacerC   addresss       r'   posixGetLinkLocalIPv6AddressesrV      sh    
 G&1m"	7 +	w'V__$););G)D)DNNgYa	{34	 '4
 Nr&   c                    V ^8  d   Qh/ ^ \         9   d&   \        \        \        \        3,          ,          ;R&   ^\         9   d&   \        \        \        \        3,          ,          ;R&   # )r>   r-   )__conditional_annotations__r   r   strr   )formats   "r'   __annotate__r[      sT      < T%S/* =F T%S/* Gr&   )0rX   __doc__rR   r@   ctypesr   r   r   r   r   r   r   r	   r
   r   r   r   ctypes.utilr   r   r   r   typingr   r   r   twisted.python.compatr   libcrA   rB   r-   r   r)   r+   r/   r2   r5   rG   r$   rH   argtypesrestyperL   rE   rO   rV   r[   )rX   s   @r'   <module>rd      s  
  
    % / / # # .L##$<<9%%)A	G	w.O  
x .O 
i y y ) 9 	i 	 G	("#GH%&GH%&  __
y)*
 
 !{ 2Br&   