ϪfdZddlZddlmZmZddlmZddlmZddl Z ddlm Z ddl m Z ddl mZmZdd lmZee e j$d d Gd d Zee e j$d d GddZee GddZe j$d d ee GddZe j$dddd ee GddZGddeZy)z* Address objects for network connections. N)OptionalUnion)warn) implementer)Literal)IAddress)_asFilesystemBytes_coerceToFilesystemEncoding)platformT)hash auto_attribsceZdZUdZej ej jddgZe e de dfe d<e e d<e e d<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} TCPUDP validatortypehostportN)__name__ __module__ __qualname____doc__attrib validatorsin_rrr__annotations__strint:/usr/lib/python3/dist-packages/twisted/internet/address.pyrrsT 3:$''//%%uen53D%. / I Ir#rceZdZUdZej ej jddgZe e de dfe d<e e d<e e d<dZe e d <dZe e e fe d <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} rrrrrrrflowInfoscopeIDN)rrrrrrrrrrrrr r!r'r(r"r#r$r&r&/sp,3:$''//%%uen53D%. / I IHc GU38_ r#r&ceZdZdZy)_ProcessAddresszD An L{interfaces.IAddress} provider for process transports. N)rrrrr"r#r$r*r*Qsr#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)rrrrbytesrr!r"r#r$r,r,XsO Ir#r,F)r repreqr ceZdZUdZej ej jeZ e e e d<e ejdd dedefdZndedefd Zdefd Zd Zy) UNIXAddressz Object representing a UNIX socket endpoint. @ivar name: The filename associated with this socket. @type name: C{bytes} ) converternamesamefileNotherreturnct||jstS|j|jk(}|sM|jrA|jr5 tj j |j|jS|S#t$rY|Sttf$r!}tjs|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__NotImplementedr4ospathr5OSError TypeError ValueErrorr isLinux)selfr6reses r$__eq__zUNIXAddress.__eq__ys eT^^4%%))uzz)C499 77++DIIuzzBBJ J ":. $++-.J  s3B CC!B==Cclt||jr|j|jk(StSN)r9r:r4r;)rBr6s r$rEzUNIXAddress.__eq__s)%0yyEJJ..! !r#cF|j}| td|nd}d|dS)Nz UNIXAddress())r4r )rBr4shows r$__repr__zUNIXAddress.__repr__s.yy8<8H*2t4ddXQ''r#c|jt|jdfS tj|j}t|j |j fS#t$rt|jcYSwxYwrG)r4r r:r<statst_inost_devr>)rBs1s r$__hash__zUNIXAddress.__hash__sl 99 ./ / ##BBII./ / # ? " #s?A%%BB)rrrrrr convertersoptionalr r4rr.rgetattrr<r=objectboolrEr rLrRr"r#r$r2r2is$DGG//**+=>D(5/rww D)5  4 , " "4 " (#( #r#r2c eZdZdZdedefdZy)_ServerFactoryIPv4Addressz@Backwards compatibility hack. Just like IPv4Address in practice.r6r7c>t|tr-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) r9tuplerDeprecationWarningrrrrr;)rBr6abs r$rEz _ServerFactoryIPv4Address.__eq__s eU # T+  IItyy)U2 2 { +DIItyy1AUZZ4A6Mr#N)rrrrrVrWrEr"r#r$rYrYsJ F t r#rY)rr<typingrrwarningsrzope.interfacerrrtwisted.internet.interfacesrtwisted.python.filepathr r twisted.python.runtimer srr&r*r,r2rYr"r#r$ris#  "& 0S+ XT%&, XT%!!&!@ X T% X  & U5t< X5#5#=5#x r#