o
    >h}w                  	   @  s*  d Z ddlmZ ddlZddlmZmZmZmZm	Z	m
Z
mZmZmZmZmZ ddlmZ ddlmZmZmZmZmZmZ ddlmZmZ ddlmZmZmZ dd	lm Z  dd
l!m"Z"m#Z#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z,m-Z- G dd dZ.G dd de.ej/Z0G dd de.ej1Z2G dd de0Z3G dd de4Z5G dd dej/Z6ee7ed dG dd de-Z8ee7ed dG dd de-Z9d7d*d+Z:ee#ed d,ee:eeed-d. d/G d0d1 d1e-Z;ee#ed d,e*ee:ee	e
d2d3 d4G d5d6 d6e;Z<dS )8zG
Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}.
    )annotationsN)AF_INETAF_INET6IP_ADD_MEMBERSHIP
IPPROTO_IPIPPROTO_IPV6IPV6_JOIN_GROUP
SOCK_DGRAMAddressFamilyif_nameindex	inet_ptonsocket)skipIf)defererror
interfacesprotocolreactorudp)IPv4AddressIPv6Address)DeferredgatherResultsmaybeDeferred)MulticastJoinError)IMulticastTransportIReactorMulticastIReactorTime)
deferLater)runtime)skipWithoutIPv6)SkipTestTestCasec                   @  s0   e Zd ZdZdZdZdd Zdd Zdd ZdS )	Mixinr   Nc                 C  s
   g | _ d S N)packetsself r(   u/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/twisted/test/test_udp.py__init__0      
zMixin.__init__c                 C  s0   d| _ | jd ur| jd }| _|d  d S d S N   )startedstartedDeferredcallbackr'   dr(   r(   r)   startProtocol3   s
   
zMixin.startProtocolc                 C  s
   d| _ d S r,   )stoppedr&   r(   r(   r)   stopProtocol9   r+   zMixin.stopProtocol)	__name__
__module____qualname__r.   r4   r/   r*   r3   r5   r(   r(   r(   r)   r#   *   s    r#   c                   @  s.   e Zd ZU dZded< dZded< dd ZdS )	ServerNzDeferred[None] | NonepacketReceivedr   r   	transportc                 C  s:   | j ||f | jd ur| jd }| _|d  d S d S r$   r%   appendr:   r0   )r'   dataaddrr2   r(   r(   r)   datagramReceivedB   s
   
zServer.datagramReceived)r6   r7   r8   r:   __annotations__refusedr@   r(   r(   r(   r)   r9   =   s
   
 r9   c                   @  s,   e Zd ZdZdZdd Zdd Zdd ZdS )	ClientNr   c                 C  s6   | j | | jd ur| jd }| _|d  d S d S r$   r<   )r'   r>   r2   r(   r(   r)   r@   M   s
   
zClient.datagramReceivedc                 C  s,   | j d ur| j d }| _ || || _d S r$   )r/   errbackfailure)r'   rE   r2   r(   r(   r)   connectionFailedS   s   


zClient.connectionFailedc                 C  2   | j d ur| j d }| _ |td d| _d S Nyupr-   r/   rD   r   ConnectionRefusedErrorrB   r1   r(   r(   r)   connectionRefusedY      

zClient.connectionRefused)r6   r7   r8   r:   rB   r@   rF   rL   r(   r(   r(   r)   rC   I   s    rC   c                   @     e Zd Zdd ZdS )
GoodClientc                 C  rG   rH   rJ   r1   r(   r(   r)   rL   a   rM   zGoodClient.connectionRefusedN)r6   r7   r8   rL   r(   r(   r(   r)   rO   `       rO   c                   @  s   e Zd ZdZdS )BadClientErrorzf
    Raised by BadClient at the end of every datagramReceived call to try and
    screw stuff up.
    N)r6   r7   r8   __doc__r(   r(   r(   r)   rQ   h   s    rQ   c                   @  s$   e Zd ZdZdZdd Zdd ZdS )	BadClientz
    A DatagramProtocol which always raises an exception from datagramReceived.
    Used to test error handling behavior in the reactor for that method.
    Nc                 C  s
   || _ dS )ze
        Set the Deferred which will be called back when datagramReceived is
        called.
        N)r2   r1   r(   r(   r)   setDeferredw   s   
zBadClient.setDeferredc                 C  s*   | j d ur| j d }| _ || td)NzApplication code is very buggy!)r2   r0   rQ   )r'   bytesr?   r2   r(   r(   r)   r@   ~   s   

zBadClient.datagramReceived)r6   r7   r8   rR   r2   rT   r@   r(   r(   r(   r)   rS   o   s
    rS   !This reactor does not support UDPc                   @  sr   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zee	j
ddkddd Zdd Zdd Zdd Zdd ZdS )UDPTestsc                   s<   t  }t  }|_tjd|dd  fdd}||S )zu
        The C{type} of the host address of a listening L{DatagramProtocol}'s
        transport is C{"UDP"}.
        r   	127.0.0.1	interfacec                   s      }|jd   S )NUDP)getHostassertEqualtypestopListening)ignoredr?   pr'   r(   r)   	cbStarted   s   z+UDPTests.test_oldAddress.<locals>.cbStartedr9   r   r   r/   r   	listenUDPaddCallback)r'   serverr2   rc   r(   ra   r)   test_oldAddress   s
   
zUDPTests.test_oldAddressc                   sR   t  t  }_tjddd  fdd}fdd}|||S )z
        The L{DatagramProtocol}'s C{startProtocol} and C{stopProtocol}
        methods are called when its transports starts and stops listening,
        respectively.
        r   rX   rY   c                   s$    jd  jd   S )Nr-   r   )r]   r.   r4   r_   r`   port1r'   rg   r(   r)   rc      s   z*UDPTests.test_startStop.<locals>.cbStartedc                   s     jd d S r,   )r]   r4   ri   )r'   rg   r(   r)   	cbStopped   s   z*UDPTests.test_startStop.<locals>.cbStoppedrd   )r'   r2   rc   rl   r(   rj   r)   test_startStop   s   zUDPTests.test_startStopc                   sF   t  t  }_tjddd}dd   fdd}| |S )zr
        Re-listening with the same L{DatagramProtocol} re-invokes the
        C{startProtocol} callback.
        r   rX   rY   c                 S  s   |  S r$   r_   )r`   portr(   r(   r)   rc         z'UDPTests.test_rebind.<locals>.cbStartedc                   s*   t   }_tjddd}| |S Nr   rX   rY   )r   r   r/   r   re   rf   )r`   r2   rb   rc   rg   r(   r)   rl      s   z'UDPTests.test_rebind.<locals>.cbStoppedrd   )r'   r2   rb   rl   r(   rr   r)   test_rebind   s   zUDPTests.test_rebindc                   sX   t  t  }_tjddd  fdd}||  fdd}|| |S )z
        A L{CannotListenError} exception is raised when attempting to bind a
        second protocol instance to an already bound port
        r   rX   rY   c                   s>      j  t }jtjtj  j	|dd d S )NrX   rY   )
r]   r\   r;   r9   assertRaisesr   CannotListenErrorr   re   ro   )r`   server2ro   r'   rg   r(   r)   rc      s   
z*UDPTests.test_bindError.<locals>.cbStartedc                   s      S r$   rn   ri   ro   r(   r)   
cbFinished   rp   z+UDPTests.test_bindError.<locals>.cbFinishedrd   )r'   r2   rc   ry   r(   rw   r)   test_bindError   s   

zUDPTests.test_bindErrorc                   s   t  t  }_tjdddt  t   _ fdd}||} fdd}||  fdd	}|| fd
d}|| |S )z
        Datagrams can be sent with the transport's C{write} method and
        received via the C{datagramReceived} callback method.
        r   rX   rY   c                   s   t jd dd_S rq   )r   re   port2ri   )clientclientStartedr'   r(   r)   cbServerStarted   s   z2UDPTests.test_sendPackets.<locals>.cbServerStartedc                   s   j dj  j j  }j  }t  }_j d|j|jf ddd|j|jffg fdd tj	 d |gdd	S )
NrX      hello)   a)   bN   cc                   s6   rt   }_|  jjd  |S d S Nr   )r   r   r:   rf   r;   writepop)r`   nextClientWrite)cbClientSendr|   clientWritesrg   r(   r)   r      s   
zHUDPTests.test_sendPackets.<locals>.cbClientStarted.<locals>.cbClientSendTfireOnOneErrback)
r;   connectr\   ro   r   r   r:   r   hostDeferredList)r`   cAddrsAddr
serverSend)r|   rg   )r   r   r)   cbClientStarted   s   


z2UDPTests.test_sendPackets.<locals>.cbClientStartedc                   s`    j  }j  } jd|j|jffg |j|jf}jd|fd|fd|fg d S )Nr   r   r   r   )r;   r\   r]   r%   r   ro   )r`   r   r   
clientAddrr|   r'   rg   r(   r)   cbSendsFinished  s   

z2UDPTests.test_sendPackets.<locals>.cbSendsFinishedc                   s$   t jt  jt jjgddS NTr   )r   r   r   r_   r{   ri   )rk   r'   r(   r)   ry     s   
z-UDPTests.test_sendPackets.<locals>.cbFinished)r9   r   r   r/   r   re   rO   rf   )r'   serverStartedr~   r2   r   r   ry   r(   )r|   r}   rk   r'   rg   r)   test_sendPackets   s   




	zUDPTests.test_sendPacketsINFRASTRUCTUREAZUREPIPELINESz"Hangs on Pipelines due to firewallc                   s   t   t  } _tjd ddt t  }_tjdddtj||gdd} fdd}|| fdd	}|| |S )
z
        A L{ConnectionRefusedError} exception is raised when a connection
        attempt is actively refused by the other end.

        Note: This test assumes no one is listening on port 80 UDP.
        r   rX   rY   Tr   c                   s^   t   } _ jdd tdD ]} jd|f  jd|f d q|tj	S )NrX   P   
      %drX   r   )
r   r   r/   r;   r   ranger   assertFailurer   rK   )r`   rL   ir   r(   r)   rc   3  s   z2UDPTests.test_connectionRefused.<locals>.cbStartedc                   "   t jt  jt jgddS r   r   r   r   r_   ri   )ro   r{   r(   r)   ry   ?     

z3UDPTests.test_connectionRefused.<locals>.cbFinished)	rO   r   r   r/   r   re   r9   r   rf   )r'   r}   r   r2   rc   ry   r(   )r|   ro   r{   r'   rg   r)   test_connectionRefused  s   


	zUDPTests.test_connectionRefusedc           	        s   t   t  } _tjd dddt t  }_t  }_tjdddtj||gdd} fdd}|	| tj||gdd}fd	d
}|	| fdd}|	| |S )as  
        When a server fails to successfully read a packet the server should
        still be able to process future packets.
        The IOCP reactor had a historical problem where a failure to read caused
        the reactor to ignore any future reads. This test should prevent a regression.

        Note: This test assumes no one is listening on port 80 UDP.
        r   rX   rY   s   Sending test packet to serverTr   c                   s&   j dd  j djf d S )Ns$   write to port no one is listening tor   rX   )r;   r   _realPortNumberri   )r|   rg   
serverPorttest_data_to_sendr(   r)   cbClientAndServerStartedb  s   
zAUDPTests.test_serverReadFailure.<locals>.cbClientAndServerStartedc                   s     jd d  d S r   )r]   r%   ri   )r'   rg   r   r(   r)   verify_server_got_datau  s   z?UDPTests.test_serverReadFailure.<locals>.verify_server_got_datac                   r   r   r   ri   )
clientPortr   r(   r)   cleanupz  r   z0UDPTests.test_serverReadFailure.<locals>.cleanup)
rO   r   r   r/   r   re   r9   r:   r   rf   )	r'   r}   r   serverGotDataserver_client_started_dr   all_data_sentr   r   r(   )r|   r   r'   rg   r   r   r)   test_serverReadFailureK  s*   	


	zUDPTests.test_serverReadFailurec                 C  sV   t  }tjd|dd}| tj|jjdd |jdd | t|jjdd |	 S )a   
        A call to the transport's connect method fails with an
        L{InvalidAddressError} when a non-IP address is passed as the host
        value.

        A call to a transport's connect method fails with a L{RuntimeError}
        when the transport is already connected.
        r   rX   rY   	localhostr   )
rO   r   re   rt   r   InvalidAddressErrorr;   r   RuntimeErrorr_   )r'   r|   ro   r(   r(   r)   test_badConnect  s   	zUDPTests.test_badConnectc                   s   t  fdd}| t tjdddfdd}|   tt	dg  fd	d
  S )zr
        When datagramReceived raises an exception it is logged but the port
        is not disconnected.
        c                   s*     t} t|ddt|f  dS )z
            Flush the exceptions which the reactor should have logged and make
            sure they're actually there.
               z'Incorrectly found %d errors, expected 2N)flushLoggedErrorsrQ   r]   len)ignerrsr&   r(   r)   cbCompleted  s   
z8UDPTests.test_datagramReceivedError.<locals>.cbCompletedr   rX   rY   c                   s   t j fddS )z
            Disconnect the port we started and pass on whatever was given to us
            in case it was a Failure.
            c                       S r$   r(   r   resultr(   r)   <lambda>      zHUDPTests.test_datagramReceivedError.<locals>.cbCleanup.<locals>.<lambda>)r   r   r_   addBothr   rx   r   r)   	cbCleanup  s   z6UDPTests.test_datagramReceivedError.<locals>.cbCleanup<   c                    s   sz d W n ty     Y nw jdd ddf } t }| j	| j
jf  fdd}fdd	}||| |j td
|jtd dS )a6  
            Send one packet to the listening BadClient.  Set up a 0.1 second
            timeout to do re-transmits in case the packet is dropped.  When two
            packets have been received by the BadClient, stop sending and let
            the finalDeferred's callbacks do some assertions.
            zNot enough packets receivedNzUDP Protocol lost its transportr   r   c                   s<      |  tdkrtd jd dS   dS )z
                A packet arrived.  Cancel the timeout for it, record it, and
                maybe finish the test.
                r   r   N)cancelr=   r   r   	callLaterr0   )packet)finalDeferredmakeAttemptsucceededAttemptstimeoutCallr(   r)   cbPacketReceived  s
   

zRUDPTests.test_datagramReceivedError.<locals>.makeAttempt.<locals>.cbPacketReceivedc                   s
      dS )a  
                The packet wasn't received quickly enough.  Try sending another
                one.  It doesn't matter if the packet for which this was the
                timeout eventually arrives: makeAttempt throws away the
                Deferred on which this function is the errback, so when
                datagramReceived callbacks, so it won't be on this Deferred, so
                it won't raise an AlreadyCalledError.
                Nr(   )err)r   r(   r)   ebPacketTimeout  s   
	zQUDPTests.test_datagramReceivedError.<locals>.makeAttempt.<locals>.ebPacketTimeoutg?z&Timed out in testDatagramReceivedError)fail	ExceptionrD   failIfIdenticalr;   r   r   r   rT   r   r   ro   addCallbacks
addErrbackr   r   r   TimeoutError)r   packetDeferredr   r   )r?   attemptsr|   r   r   r'   r   )r   r)   r     s,   
z8UDPTests.test_datagramReceivedError.<locals>.makeAttempt)
r   r   rf   rS   r   re   r   r\   listr   )r'   r   r   r(   )r?   r   r|   r   r   ro   r'   r   r)   test_datagramReceivedError  s   



:z#UDPTests.test_datagramReceivedErrorc                 C  sR   G dd d}t dt }| |_|dd | | jg}| t|d dS )ai  
        C{'<broadcast>'} is an alternative way to say C{'255.255.255.255'}
        ({socket.gethostbyname("<broadcast>")} returns C{'255.255.255.255'}),
        so because it becomes a valid IP address, no deprecation warning about
        passing hostnames to L{twisted.internet.udp.Port.write} needs to be
        emitted by C{write()} in this case.
        c                   @  rN   )z6UDPTests.test_NoWarningOnBroadcast.<locals>.fakeSocketc                 S  s   d S r$   r(   )r'   foobarr(   r(   r)   sendto  s   z=UDPTests.test_NoWarningOnBroadcast.<locals>.fakeSocket.sendtoN)r6   r7   r8   r   r(   r(   r(   r)   
fakeSocket  rP   r   r   s   test)z<broadcast>i  N)	r   Portr9   r   r   flushWarningstest_NoWarningOnBroadcastr]   r   )r'   r   rb   warningsr(   r(   r)   r     s   	z"UDPTests.test_NoWarningOnBroadcastN)r6   r7   r8   rh   rm   rs   rz   r   r   osenvirongetr   r   r   r   r   r(   r(   r(   r)   rW      s    D
)<irW   c                   @  s8   e Zd ZdZeedsdZdd Zdd Z	dd	 Z
dS )
ReactorShutdownInteractionTestsz!Test reactor shutdown interactionNrV   c                 C  s    t  | _tjd| jdd| _dS )zStart a UDP portr   rX   rY   N)r9   rg   r   re   ro   r&   r(   r(   r)   setUp  s   z%ReactorShutdownInteractionTests.setUpc                 C  s
   | j  S )zStop the UDP port)ro   r_   r&   r(   r(   r)   tearDown#  s   
z(ReactorShutdownInteractionTests.tearDownc                   sh   t   t   }j_ fdd}|| fdd} | jjddjj jf  S )z0Test reactor shutdown while in a recvfrom() loopc                   s    j j  td jd  d S r   )rg   r;   connectionLostr   r   r0   ri   finishedr'   r(   r)   pktRece6  s   zQReactorShutdownInteractionTests.testShutdownFromDatagramReceived.<locals>.pktRecec                   s       d S r$   )r   ri   r&   r(   r)   flushErrors@  s   zUReactorShutdownInteractionTests.testShutdownFromDatagramReceived.<locals>.flushErrorss@                                                                   rX   )	r   r   rg   r:   rf   r;   r   r\   ro   )r'   prr   r   r(   r   r)    testShutdownFromDatagramReceived'  s   

z@ReactorShutdownInteractionTests.testShutdownFromDatagramReceived)r6   r7   r8   rR   r   IReactorUDPr   skipr   r   r   r(   r(   r(   r)   r     s    r   afr
   ipprotointjoingroupstrbindtoreturnboolc                 C  s|   t | t}||df t| |}t| |}z"z|||||  W n ty1   Y W |  dS w W |  dS |  w )a	  
    Bind a socket to the given network interface and attempt to join a
    multicast group with the given address family.  This is used to determine
    whether the local networking stack configuration allows for multicast
    within the given address family.
    r   FT)r   r	   bindr   
setsockoptOSErrorclose)r   r   r   r   r   s	packgrouppackifr(   r(   r)   checkMulticastAvailabilityN  s   
	

r   z'This reactor does not support multicast225.0.0.2500.0.0.0z:The local networking stack does not enable IPv4 multicast.c                   @  s   e Zd ZU dZdZded< dZded< dZded< d	Zded
< dZ	ded< dZ
ded< dZded< dZded< dd Zdd Zd*ddZd*ddZd*ddZd*ddZd*dd Zeej ocej  d!d"d# Zd$d% Zeej d&d*d'd(Zd)S )+MulticastTestszs
    Tests for sending and receiving multicast datagrams.  (This suite supports
    IPv4, see below for IPv6.)
    r   r   rZ   	str | intexpectedInterfacerX   clientAddressr   multicastGroupalternateInterfacer   interfaceSynonyminvalidGroup::1wrongAddressFamilyc                 C  sX   t  | _t | _td| j| j| _td| j| j| _| jj	
| j| jj	 j d S r   )r9   rg   rC   r|   r   listenMulticastrZ   rk   r{   r;   r   r  r\   ro   r&   r(   r(   r)   r     s   zMulticastTests.setUpc                 C  s   t t| jjt| jjgS r$   )r   r   rk   r_   r{   r&   r(   r(   r)   r     s
   

zMulticastTests.tearDownr   Nonec                   s<    j jjtkrtdd fdd}| j | j  d S )	Nz+only IPv4 multicast has TTLs, IPv6 has hopsoServer | Clientr   r  c                   sD   t | jsJ  | j d | jd  | j d d S )Nr-   r   )r   
providedByr;   r]   getTTLsetTTL)r  r&   r(   r)   checkttl  s   z(MulticastTests.testTTL.<locals>.checkttl)r  r  r   r  )rg   r;   addressFamilyr   r!   r|   )r'   r  r(   r&   r)   testTTL  s
   
zMulticastTests.testTTLc                   s   | j }| | jj d | jj }| jj|I dH  t | j_| jj	d||j
f | jjI dH  | t| jjd | jjd | | jj d | jj	d||j
f tttdI dH  | t| jjd dS )zv
        Test that after loopback mode has been set, multicast packets are
        delivered to their sender.
        r-   Nr   r   )r  r]   rg   r;   getLoopbackModer\   	joinGroupr   r:   r   ro   r   r%   setLoopbackModer   r   r   )r'   r   r?   r(   r(   r)   test_loopback  s   
zMulticastTests.test_loopbackc                   sN   |  t | jjj| j| jdI dH  W d   dS 1 s w   Y  dS )z
        A sensible error will be reported when using the wrong address family
        literal for the 'interface' argument to 'joinGroup'.
        rY   N)rt   r   rg   r;   r  r  r
  r&   r(   r(   r)   test_wrongFamilyInterfaceJoin  s   "z,MulticastTests.test_wrongFamilyInterfaceJoinc                   s   |  | jj | j |  | jj | j | jj| jI dH  | jj| jI dH  |  | jj | j |  | jj | j dS )zK
        Test C{getOutgoingInterface} and C{setOutgoingInterface}.
        N)	r]   r|   r;   getOutgoingInterfacer  rg   setOutgoingInterfacer  r  r&   r(   r(   r)   test_interface  s"   

zMulticastTests.test_interfacec                   s^   | j j| jI dH  | j j| jI dH  | jj| jI dH  | jj| jI dH  dS )zE
        Test that multicast a group can be joined and left.
        N)r|   r;   r  r  
leaveGrouprg   r&   r(   r(   r)   test_joinLeave  s
   zMulticastTests.test_joinLeavez2Windows' UDP multicast is not yet fully supported.c                 C  s   |  | jj| jtjS )z
        Test that an attempt to join an address which is not a multicast
        address fails with L{error.MulticastJoinError}.
        )r   r|   r;   r  r  r   r   r&   r(   r(   r)   test_joinFailure  s   
zMulticastTests.test_joinFailurec                   s|   t  tdjjj  jjj} fdd}|	| fdd}|	| fdd}|	| |S )zn
        Test that a multicast group can be joined and messages sent to and
        received from it.
        r   c                   s(   t   }j_jdj jf |S )N   hello world)r   rg   r:   r;   r   r  ro   )r`   r2   )r?   cr'   r(   r)   cbJoined  s   z/MulticastTests.test_multicast.<locals>.cbJoinedc                   s      jjd d d d S )Nr   r   )r]   rg   r%   ri   r&   r(   r)   cbPacket  s   z/MulticastTests.test_multicast.<locals>.cbPacketc                   s    t j}| fdd |S )Nc                   r   r$   r(   r   passthroughr(   r)   r   
  r   z@MulticastTests.test_multicast.<locals>.cleanup.<locals>.<lambda>)r   r_   rf   )r%  r   )rb   r$  r)   r     s   
z.MulticastTests.test_multicast.<locals>.cleanup)
r9   r   r  rZ   rg   r;   r\   r  r  rf   )r'   joinedr"  r#  r   r(   )r?   r!  rb   r'   r)   test_multicast  s   


zMulticastTests.test_multicastzjon non-linux platforms it appears multiple processes can listen, but not multiple sockets in same process?c           
        s  t  }tt}|jd|d| jd}| }t|ttfsJ |j	}t  }|j||d| jd}t
| jj| j|| j|| jgI dH  t  }|_t  }	|_|jd| j|f t
||	gI dH  | |jd d d | |jd d d t
t|jt|jgI dH  dS )z
        Test that multiple sockets can listen on the same multicast port and
        that they both receive multicast messages directed to that address.
        r   T)listenMultiplerZ   Nr   )r9   r   r   r  rZ   r\   
isinstancer   r   ro   r   rg   r;   r  r  r   r:   r   r]   r%   r   r_   )
r'   firstClientmreactor	firstPortfpAddrportnosecondClient
secondPortd1d2r(   r(   r)   test_multiListen  sB   



	zMulticastTests.test_multiListenN)r   r  )r6   r7   r8   rR   rZ   rA   r  r  r  r  r  r  r
  r   r   r  r  r  r  r  r   r   platform	isWindowsisVistar  r'  r3  r(   r(   r(   r)   r  e  s8   
 








 r  ff03::1::z/The local stack does not enable IPv6 multicast.c                   @  s   e Zd ZU dZdZded< dZded< dZded< ed	d
 e	 D Z
ded< e
Zded< dZded< dZded< dZded< dS )MulticastTestsIPv6zC
    Tests for sending and receiving IPv6 multicast datagrams.
    r8  r   rZ   r	  r  r7  r  c                 c  s&    | ]}|d   dr|d V  qdS )r-   lor   N)
startswith).0idxnmr(   r(   r)   	<genexpr>^  s   $ zMulticastTestsIPv6.<genexpr>r  r  r  r  r   r  rX   r
  N)r6   r7   r8   rR   rZ   rA   r  r  nextr   r  r  r  r  r
  r(   r(   r(   r)   r9  H  s   
 r9  )r   r
   r   r   r   r   r   r   r   r   r   r   )=rR   
__future__r   r   r   r   r   r   r   r   r   r	   r
   r   r   unittestr   twisted.internetr   r   r   r   r   r   twisted.internet.addressr   r   twisted.internet.deferr   r   r   twisted.internet.errorr   twisted.internet.interfacesr   r   r   twisted.internet.taskr   twisted.pythonr   twisted.test.testutilsr    twisted.trial.unittestr!   r"   r#   DatagramProtocolr9   ConnectedDatagramProtocolrC   rO   r   rQ   rS   r   rW   r   r   r  r9  r(   r(   r(   r)   <module>   sh   4    
6
 Z
