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: //lib/python3/dist-packages/twisted/internet/__pycache__/address.cpython-312.pyc
�

^h�b|���dZddlZddlmZmZmZddlmZddlm	Z	ddl
Z
ddlmZddl
mZmZddlmZe	e�e
j$d	d	�
�Gd�d���Ze	e�e
j$d	d	�
�Gd
�d���Ze	e�Gd�d��Ze
j$d	d	�
�e	e�Gd�d���Ze
j$dddd	��e	e�Gd�d���ZGd�de�Zy)z*
Address objects for network connections.
�N)�Literal�Optional�Union)�warn)�implementer)�IAddress)�_asFilesystemBytes�_coerceToFilesystemEncoding)�platformT)�hash�auto_attribsc��eZdZUdZej
ejjddg���Ze	e
de
dfed<eed<e
ed<y)	�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���:/usr/lib/python3/dist-packages/twisted/internet/address.pyrrsT���3:�$�'�'��/�/�%�%�u�e�n�5�3�D�%�������.�
/���I�

�Ir#rc���eZdZUdZej
ejjddg���Ze	e
de
dfed<eed<e
ed<dZe
ed	<dZe	ee
fed
<y)�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)rrrrrrrrrrrrr r!r'r(r"r#r$r&r&.sp���,3:�$�'�'��/�/�%�%�u�e�n�5�3�D�%�������.�
/���I�

�I��H�c�� �G�U�3��8�_� r#r&c��eZdZdZy)�_ProcessAddresszD
    An L{interfaces.IAddress} provider for process transports.
    N)rrrrr"r#r$r*r*Ps��r#r*c�&�eZdZUdZeed<eed<y)�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�bytesrr!r"r#r$r,r,Ws����O�

�Ir#r,F)r�repr�eqr
c���eZdZUdZej
ejje���Z	e
eed<e
ejdd��	dedefd�Zndedefd	�Zdefd
�Zd�Zy)�UNIXAddressz�
    Object representing a UNIX socket endpoint.

    @ivar name: The filename associated with this socket.
    @type name: C{bytes}
    )�	converter�name�samefileN�other�returnc��t||j�stS|j|jk(}|sM|jrA|jr5	tj
j
|j|j�S|S#t$rY|Sttf$r!}tj�s|�Yd}~|Sd}~wwxYw)z�
            Overriding C{attrs} to ensure the os level samefile
            check is done if the name attributes do not match.
            N)�
isinstance�	__class__�NotImplementedr4�os�pathr5�OSError�	TypeError�
ValueErrorr�isLinux)�selfr6�res�es    r$�__eq__zUNIXAddress.__eq__xs���
�e�T�^�^�4�%�%��)�)�u�z�z�)�C��4�9�9���� ��7�7�+�+�D�I�I�u�z�z�B�B��J������J�"�:�.� �$�+�+�-���.��J�� �s�3B�	C�C�!B=�=Cc�l�t||j�r|j|jk(StS�N)r9r:r4r;)rBr6s  r$rEzUNIXAddress.__eq__�s)���%����0��y�y�E�J�J�.�.�!�!r#c�V�|j}|rtd|j�}d|�d�S)N�zUNIXAddress(�))r4r
)rBr4s  r$�__repr__zUNIXAddress.__repr__�s-���y�y���.�r�4�9�9�=�D��d�X�Q�'�'r#c��|j�t|jdf�S	tj|j�}t|j
|jf�S#t$rt|j�cYSwxYwrG)r4rr:r<�stat�st_ino�st_devr>)rB�s1s  r$�__hash__zUNIXAddress.__hash__�sl���9�9�������.�/�/�	#�������#�B�����B�I�I�.�/�/���	#���	�	�?�"�	#�s�?A%�%B�B)rrrrrr�
converters�optionalr	r4rr.r�getattrr<r=�object�boolrEr rKrQr"r#r$r2r2hs����$�D�G�G��/�/�*�*�+=�>��D�(�5�/���r�w�w�
�D�)�5�	��	�4�	�,	"��	"�4�	"�
(�#�(�#r#r2c� �eZdZdZdedefd�Zy)�_ServerFactoryIPv4Addressz@Backwards compatibility hack. Just like IPv4Address in practice.r6r7c�>�t|t�r-tdtd��|j|j
f|k(St|t�rK|j|j|j
f}|j|j|j
f}||k(StS)Nz?IPv4Address.__getitem__ is deprecated.  Use attributes instead.�)�category�
stacklevel)	r9�tupler�DeprecationWarningrrrrr;)rBr6�a�bs    r$rEz _ServerFactoryIPv4Address.__eq__�s����e�U�#��T�+��
�
�I�I�t�y�y�)�U�2�2�
��{�
+����D�I�I�t�y�y�1�A����U�Z�Z����4�A���6�M��r#N)rrrrrUrVrEr"r#r$rXrX�s��J��F��t�r#rX)rr<�typingrrr�warningsr�zope.interfacerr�twisted.internet.interfacesr�twisted.python.filepathr	r
�twisted.python.runtimer�srr&r*r,r2rXr"r#r$�<module>rhs#���

�+�+��&��0�S�+�
�X������T��%���&���,
�X������T��%�!�!�&��!�@
�X����������T��%��X�����&������U��5�t�<��X��6#�6#��=�6#�z��r#