AlkantarClanX12

Your IP : 18.118.162.8


Current Path : /proc/self/root/lib/python3.6/site-packages/dns/__pycache__/
Upload File :
Current File : //proc/self/root/lib/python3.6/site-packages/dns/__pycache__/inet.cpython-36.pyc

3

�b�W��@sjdZddlZddlZddlZejZy
ejZWnek
rDdZYnXdd�Zdd�Z	dd	�Z
d
d�ZdS)z*Generic Internet address helper functions.�Ni'cCs0|tkrtjj|�S|tkr(tjj|�St�dS)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
cCs0|tkrtjj|�S|tkr(tjj|�St�dS)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)rrrZ	inet_ntoarrr)r	Zaddressrrr�	inet_ntop:s
rcCsLytjj|�tStk
rFytjj|�tSt�YnXYnXdS)z�Determine 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)rrrr�	Exceptionrr�
ValueError)r
rrr�af_for_addressMsrcCsty$ttjj|�d�}|dko$|dkStk
rnyttjj|�d�}|dkStk
rht�YnXYnXdS)z�Is 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)�ordrrrrrr)r
�firstrrr�is_multicast`sr)�__doc__ZsocketZdns.ipv4rZdns.ipv6rr�AttributeErrorr
rrrrrrr�<module>s