HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/root/usr/lib/python3/dist-packages/twisted/internet/__pycache__/address.cpython-38.pyc
U

^h�b|�@s&dZddlZddlmZmZmZddlmZddlm	Z	ddl
Z
ddlmZddl
mZmZddlmZe	e�e
jd	d	d
�Gdd�d���Ze	e�e
jd	d	d
�Gd
d�d���Ze	e�Gdd�d��Ze
jd	d	d
�e	e�Gdd�d���Ze
jdddd	d�e	e�Gdd�d���ZGdd�de�ZdS)z*
Address objects for network connections.
�N)�Literal�Optional�Union)�warn)�implementer)�IAddress)�_asFilesystemBytes�_coerceToFilesystemEncoding)�platformT)�hash�auto_attribsc@sReZdZUdZejej�ddg�d�Ze	e
de
dfed<eed<e
ed<dS)	�IPv4Addressat
    An L{IPv4Address} represents the address of an IPv4 socket endpoint.

    @ivar type: A string describing the type of transport, either 'TCP' or
        'UDP'.

    @ivar host: A string containing a dotted-quad IPv4 address; for example,
        "127.0.0.1".
    @type host: C{str}

    @ivar port: An integer representing the port number.
    @type port: C{int}
    �TCP�UDP��	validator�type�host�portN)�__name__�
__module__�__qualname__�__doc__�attr�ib�
validators�in_rrr�__annotations__�str�int�r r �:/usr/lib/python3/dist-packages/twisted/internet/address.pyr
s
�r
c@sreZdZUdZejej�ddg�d�Ze	e
de
dfed<eed<e
ed<dZe
ed	<dZe	ee
fed
<dS)�IPv6Addressa�
    An L{IPv6Address} represents the address of an IPv6 socket endpoint.

    @ivar type: A string describing the type of transport, either 'TCP' or
        'UDP'.

    @ivar host: A string containing a colon-separated, hexadecimal formatted
        IPv6 address; for example, "::1".
    @type host: C{str}

    @ivar port: An integer representing the port number.
    @type port: C{int}

    @ivar flowInfo: the IPv6 flow label.  This can be used by QoS routers to
        identify flows of traffic; you may generally safely ignore it.
    @type flowInfo: L{int}

    @ivar scopeID: the IPv6 scope identifier - roughly analagous to what
        interface traffic destined for this address must be transmitted over.
    @type scopeID: L{int} or L{str}
    rrrrrrr�flowInfo�scopeIDN)rrrrrrrrrrrrrrr#r$r r r r!r".s
�r"c@seZdZdZdS)�_ProcessAddresszD
    An L{interfaces.IAddress} provider for process transports.
    N)rrrrr r r r!r%Psr%c@s"eZdZUdZeed<eed<dS)�HostnameAddressa
    A L{HostnameAddress} represents the address of a L{HostnameEndpoint}.

    @ivar hostname: A hostname byte string; for example, b"example.com".
    @type hostname: L{bytes}

    @ivar port: An integer representing the port number.
    @type port: L{int}
    �hostnamerN)rrrr�bytesrrr r r r!r&Ws

r&F)r�repr�eqrc@s|eZdZUdZejej�e�d�Z	e
eed<e
ejdd�dk	rReed�dd�Zneed�d	d�Zed
�dd�Zd
d�ZdS)�UNIXAddressz�
    Object representing a UNIX socket endpoint.

    @ivar name: The filename associated with this socket.
    @type name: C{bytes}
    )�	converter�name�samefileN��other�returnc
Cs�t||j�stS|j|jk}|s�|jr�|jr�ztj�|j|j�WStk
rTYn2tt	fk
r�}zt
��st|�W5d}~XYnX|S)z�
            Overriding C{attrs} to ensure the os level samefile
            check is done if the name attributes do not match.
            N)�
isinstance�	__class__�NotImplementedr-�os�pathr.�OSError�	TypeError�
ValueErrorr
�isLinux)�selfr0�res�er r r!�__eq__xszUNIXAddress.__eq__cCst||j�r|j|jkStS�N)r2r3r-r4)r;r0r r r!r>�s)r1cCs"|j}|rtd|j�}d|�d�S)N�zUNIXAddress(�))r-r	)r;r-r r r!�__repr__�szUNIXAddress.__repr__cCsZ|jdkrt|jdf�Szt�|j�}t|j|jf�WStk
rTt|j�YSXdSr?)r-rr3r5�stat�st_ino�st_devr7)r;�s1r r r!�__hash__�s
zUNIXAddress.__hash__)rrrrrr�
converters�optionalrr-rr(r�getattrr5r6�object�boolr>rrBrGr r r r!r+hs

�r+c@s eZdZdZeed�dd�ZdS)�_ServerFactoryIPv4Addressz@Backwards compatibility hack. Just like IPv4Address in practice.r/cCs^t|t�r(tdtdd�|j|jf|kSt|t�rZ|j|j|jf}|j|j|jf}||kStS)Nz?IPv4Address.__getitem__ is deprecated.  Use attributes instead.�)�category�
stacklevel)	r2�tupler�DeprecationWarningrrr
rr4)r;r0�a�br r r!r>�s
�
z _ServerFactoryIPv4Address.__eq__N)rrrrrKrLr>r r r r!rM�srM)rr5�typingrrr�warningsr�zope.interfacerr�twisted.internet.interfacesr�twisted.python.filepathrr	�twisted.python.runtimer
�sr
r"r%r&r+rMr r r r!�<module>s. =