£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>
3
bW                 @   sj   d Z ddlZddlZddlZejZy
ejZW n ek
rD   dZY nX dd Zdd Z	dd	 Z
d
d ZdS )z*Generic Internet address helper functions.    Ni'  c             C   s0   | t krtjj|S | tkr(tjj|S tdS )a*  Convert the textual form of a network address into its binary form.

    @param family: the address family
    @type family: int
    @param text: the textual address
    @type text: string
    @raises NotImplementedError: the address family specified is not
    implemented.
    @rtype: string
    N)AF_INETdnsipv4	inet_atonAF_INET6ipv6NotImplementedError)familytext r   /usr/lib/python3.6/inet.py	inet_pton&   s
    r   c             C   s0   | t krtjj|S | tkr(tjj|S tdS )a/  Convert the binary form of a network address into its textual form.

    @param family: the address family
    @type family: int
    @param address: the binary address
    @type address: string
    @raises NotImplementedError: the address family specified is not
    implemented.
    @rtype: string
    N)r   r   r   Z	inet_ntoar   r   r   )r	   Zaddressr   r   r   	inet_ntop:   s
    r   c             C   sL   yt jj|  tS  tk
rF   yt jj|  tS    tY nX Y nX dS )zDetermine the address family of a textual-form network address.

    @param text: the textual address
    @type text: string
    @raises ValueError: the address family cannot be determined from the input.
    @rtype: int
    N)r   r   r   r   	Exceptionr   r   
ValueError)r
   r   r   r   af_for_addressM   s    r   c             C   st   y$t tjj| d }|dko$|dkS  tk
rn   yt tjj| d }|dkS  tk
rh   tY nX Y nX dS )zIs the textual-form network address a multicast address?

    @param text: the textual address
    @raises ValueError: the address family cannot be determined from the input.
    @rtype: bool
    r            N)ordr   r   r   r   r   r   )r
   firstr   r   r   is_multicast`   s    r   )__doc__ZsocketZdns.ipv4r   Zdns.ipv6r   r   AttributeErrorr   r   r   r   r   r   r   r   <module>   s   

