o 5@g|@s&dZddlZddlmZmZmZddlmZddlm Z ddl Z ddl m Z ddl mZmZddlmZe e e jd d d Gd d d Ze e e jd d d Gd ddZe e GdddZe jd d d e e GdddZe jdddd de e GdddZGdddeZdS)z* Address objects for network connections. N)LiteralOptionalUnion)warn) implementer)IAddress)_asFilesystemBytes_coerceToFilesystemEncoding)platformT)hash auto_attribsc@sReZdZUdZejejddgdZe e de dfe d<e e d<e e d<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} TCPUDP validatortypehostportN)__name__ __module__ __qualname____doc__attrib validatorsin_rrr__annotations__strintr r :/usr/lib/python3/dist-packages/twisted/internet/address.pyr s  r c@sreZdZUdZejejddgdZe e de dfe d<e e d<e e d<dZe e d <dZe e e fe d <d S) 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} rrrrrrrflowInfoscopeIDN)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)rrrrbytesrrr r r r!r&Ws  r&F)r repreqr c@seZdZUdZejejedZ e e e d<e ejdddur*dedefdd Zn dedefd d Zdefd d Zd dZdS) UNIXAddressz Object representing a UNIX socket endpoint. @ivar name: The filename associated with this socket. @type name: C{bytes} ) converternamesamefileNotherreturnc Cst||jstS|j|jk}|sE|jrE|jrEz tj|j|jWSty*Y|Stt fyD}z t s9|WYd}~|Sd}~ww|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-ospathr.OSError TypeError ValueErrorr isLinux)selfr/reser r r!__eq__xs"    zUNIXAddress.__eq__cCst||jr |j|jkStSN)r1r2r-r3)r:r/r r r!r=s  cCs"|j}|r td|j}d|dS)Nz UNIXAddress())r-r )r:r-r r r!__repr__s  zUNIXAddress.__repr__cCsT|jdur t|jdfSzt|j}t|j|jfWSty)t|jYSwr>)r-r r2r4statst_inost_devr6)r:s1r r r!__hash__s   zUNIXAddress.__hash__)rrrrrr convertersoptionalrr-rr(rgetattrr4r5objectboolr=rrArFr r r r!r+hs   r+c@s"eZdZdZdedefddZdS)_ServerFactoryIPv4Addressz@Backwards compatibility hack. Just like IPv4Address in practice.r/r0cCs^t|trtdtdd|j|jf|kSt|tr-|j|j|jf}|j|j|jf}||kStS)Nz?IPv4Address.__getitem__ is deprecated. Use attributes instead.)category stacklevel) r1tuplerDeprecationWarningrrr rr3)r:r/abr r r!r=s  z _ServerFactoryIPv4Address.__eq__N)rrrrrJrKr=r r r r!rLsrL)rr4typingrrrwarningsrzope.interfacerrtwisted.internet.interfacesrtwisted.python.filepathrr twisted.python.runtimer sr r"r%r&r+rLr r r r!s0        =