
    Ϫf	                        d Z ddlZddlZddlmZ ddlmZmZ  G d dej                        Z	 G d dej                        Z
 eej                         G d	 d
ej                               Z G d dej                        Z G d dej                        Z G d dej                        Z G d dej                        Zg dZy)zzImplement standard (and unused) TCP protocols.

These protocols are either provided by inetd, or are not provided at all.
    N)implementer)
interfacesprotocolc                       e Zd ZdZd Zy)EchozC
    As soon as any data is received, write it back (RFC 862).
    c                 :    | j                   j                  |       y N)	transportwriteselfdatas     8/usr/lib/python3/dist-packages/twisted/protocols/wire.pydataReceivedzEcho.dataReceived   s    T"    N__name__
__module____qualname____doc__r    r   r   r   r      s    #r   r   c                       e Zd ZdZd Zy)Discardz.
    Discard any received data (RFC 863).
    c                      y r	   r   r   s     r   r   zDiscard.dataReceived    s    r   Nr   r   r   r   r   r      s    r   r   c                   ,    e Zd ZdZdZd Zd Zd Zd Zy)Chargenz-
    Generate repeating noise (RFC 864).
    sG   @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&?c                 <    | j                   j                  | d       y )Nr   )r
   registerProducerr   s    r   connectionMadezChargen.connectionMade-   s    ''a0r   c                 N    | j                   j                  | j                         y r	   )r
   r   noiser   s    r   resumeProducingzChargen.resumeProducing0   s    TZZ(r   c                      y r	   r   r   s    r   pauseProducingzChargen.pauseProducing3       r   c                      y r	   r   r   s    r   stopProducingzChargen.stopProducing6   r&   r   N)	r   r   r   r   r"   r    r#   r%   r(   r   r   r   r   r   %   s#     XE1)r   r   c                       e Zd ZdZd Zd Zy)QOTDz.
    Return a quote of the day (RFC 865).
    c                     | j                   j                  | j                                | j                   j                          y r	   )r
   r   getQuoteloseConnectionr   s    r   r    zQOTD.connectionMade?   *    T]]_-%%'r   c                      y)zB
        Return a quote. May be overrriden in subclasses.
        s'   An apple a day keeps the doctor away.
r   r   s    r   r,   zQOTD.getQuoteC   s     <r   N)r   r   r   r   r    r,   r   r   r   r*   r*   :   s    (<r   r*   c                       e Zd ZdZd Zd Zy)Whoz/
    Return list of active users (RFC 866)
    c                     | j                   j                  | j                                | j                   j                          y r	   )r
   r   getUsersr-   r   s    r   r    zWho.connectionMadeO   r.   r   c                      y)z>
        Return active users. Override in subclasses.
        s   root
r   r   s    r   r3   zWho.getUsersS   s     r   N)r   r   r   r   r    r3   r   r   r   r1   r1   J   s    (r   r1   c                       e Zd ZdZd Zy)Daytimez8
    Send back the daytime in ASCII form (RFC 867).
    c                     | j                   j                  t        j                  t        j                  t        j                                     dz          | j                   j                          y )Ns   
)r
   r   timeasctimegmtimer-   r   s    r   r    zDaytime.connectionMade_   sA    T\\$++diik*BCgMN%%'r   Nr   r   r   r   r    r   r   r   r6   r6   Z   s    (r   r6   c                       e Zd ZdZd Zy)Timez@
    Send back the time in machine readable form (RFC 868).
    c                     t        j                  dt        t        j                                     }| j                  j                  |       | j                  j                          y )Nz!i)structpackintr8   r
   r   r-   )r   results     r   r    zTime.connectionMadei   s?    T3tyy{#34V$%%'r   Nr;   r   r   r   r=   r=   d   s    (r   r=   )r   r   r   r*   r1   r6   r=   )r   r?   r8   zope.interfacer   twisted.internetr   r   Protocolr   r   	IProducerr   r*   r1   r6   r=   __all__r   r   r   <module>rH      s      & 1#8 #h  Z!!"h  #(<8 < (

  (h (	(8 	( Kr   