← Back
Editing: address.cpython-38.pyc
U W[~ � @ s4 d Z ddlmZmZ ddlZddlZddlZddlmZ ddl m Z ddlmZ ddlm Z ddlmZ dd lmZ ee �ejd d�G dd � d e���Zee �ejd d�G dd� de���Zee �G dd� de��Zejd d�ee �G dd� de���Zejdddd�ee �G dd� de���ZG dd� de�ZdS )z* Address objects for network connections. � )�division�absolute_importN)�implementer)�IAddress)�_asFilesystemBytes)�_coerceToFilesystemEncoding)�platform)�_PY3T)�hashc @ s8 e Zd ZdZejej�ddg�d�Ze�� Z e�� Z 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�Z validatorN)�__name__� __module__�__qualname__�__doc__�attr�ib� validators�in_�type�host�port� r r �:/usr/lib/python3/dist-packages/twisted/internet/address.pyr s r c @ sP e Zd ZdZejej�ddg�d�Ze�� Z e�� Z ejdd�Zejdd�ZdS )�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} r r r r )�defaultN) r r r r r r r r r r r ZflowInfoZscopeIDr r r r r + s r c @ s e Zd ZdZdS )�_ProcessAddresszD An L{interfaces.IAddress} provider for process transports. N)r r r r r r r r r K s r c @ s e Zd ZdZe�� Ze�� ZdS )�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} N)r r r r r r Zhostnamer r r r r r S s r F)r �reprZcmpc @ s` e Zd ZdZejej�e�d�Z e ejdd�dk r<dd� Z ndd� Z dd � Zd d� Zdd � ZdS )�UNIXAddressz� Object representing a UNIX socket endpoint. @ivar name: The filename associated with this socket. @type name: C{bytes} )Z converter�samefileNc C s� t || j�r| j|jk}ndS |s�| jr�|jr�ztj�| j|j�W S tk rV Y n6 ttfk r� } zt szt �� sz|�W 5 d}~X Y nX |S )z� Overriding C{attrs} to ensure the os level samefile check is done if the name attributes do not match. FN)� isinstance� __class__�name�os�pathr"