§
    ÈtºfÈ  ã                   ó¨   — d Z ddlZddlZddlZddlmZmZ ddlm	Z	 ddl
mZmZ ddlmZmZ ej        ej        dœZ G d„ d	ej        ¦  «        Zd
„ ZdS )zë
Twisted inetd TAP support

The purpose of inetdtap is to provide an inetd-like server, to allow Twisted to
invoke other programs to handle incoming sockets.
This is a useful thing as a "networking swiss army knife" tool, like netcat.
é    N)ÚinternetÚservice)ÚServerFactory)ÚlogÚusage)ÚinetdÚ	inetdconf)ÚtcpÚudpc                   ón   — e Zd ZdZg d¢g d¢gZg d¢gZ ej        d ej        d¦  «        i¬¦  «        Z	dS )	ÚOptionszù
    To use it, create a file named `sample-inetd.conf` with:

    8123 stream tcp wait some_user /bin/cat -

    You can then run it as in the following example and port 8123 became an
    echo server.

    twistd -n inetd -f sample-inetd.conf
    )ÚrpcÚrz/etc/rpcz$DEPRECATED. RPC procedure table file)ÚfileÚfz/etc/inetd.confzService configuration file)Ú
nointernalÚizDon't run internal servicesr   z*.conf)Ú
optActionsN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚoptParametersÚoptFlagsr   ÚCompletionsÚCompleteFilesÚcompData© ó    úV/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/runner/inetdtap.pyr   r      sm   € € € € € ð	ð 	ð 	IÐHÐHØFÐFÐFð€Mð
 CÐBÐBÐC€Hà ˆuÔ ¨VÐ5H°UÔ5HÈÑ5RÔ5RÐ,SÐTÑTÔT€H€H€Hr   r   c                 óª  — t          j        ¦   «         }t          j        ¦   «         }t	          | d         ¦  «        5 }|                     |¦  «         d d d ¦  «         n# 1 swxY w Y   |j        D �]a}|j        }|j                             d¦  «        rt          j
        d¦  «         Œ9||j        fdvr%t          j
        d|j        ›d|j        ›�¦  «         Œi	 t          |j        ¦  «        |_        nc# t          $ rV 	 t          j        |j        ¦  «        d         |_        n-# t"          $ r  t          j
        d|j        z   ¦  «         Y Y ŒÝw xY wY nw xY w|j        €%t          j        |j        ¦  «        d	         |_        n	 t          |j        ¦  «        |_        nd# t          $ rW 	 t)          j        |j        ¦  «        d         |_        n.# t"          $ r! t          j
        d
|j        z   ¦  «         Y Y �Œˆw xY wY nw xY w|j        dk    rf| d         r�Œ§|j        t0          j        vrt          j
        d|j        z   ¦  «         �ŒØt5          ¦   «         }t0          j        |j                 |_        nt1          j        |¦  «        }|dk    r/t9          j        |j        |¦  «                             |¦  «         �ŒL|dk    rtA          d¦  «        ‚�Œc|S )Nr   zrpc/z/Skipping rpc service due to lack of rpc support))r
   Ústream)r   Údgramz$Skipping unsupported type/protocol: ú/é   zUnknown user: é   zUnknown group: Úinternalr   zUnknown internal service: r
   r   znot supporting UDP)!Ú
appserviceÚMultiServicer	   Ú	InetdConfÚopenÚ	parseFileÚservicesÚprotocolÚ
startswithr   ÚmsgÚ
socketTypeÚintÚuserÚ
ValueErrorÚpwdÚgetpwnamÚKeyErrorÚgroupÚgetpwuidÚgrpÚgetgrnamÚprogramÚnamer   ÚinternalProtocolsr   ÚInetdFactoryr   Ú	TCPServerÚportÚsetServiceParentÚRuntimeError)ÚconfigÚsÚconfr   r   r.   Úfactorys          r    ÚmakeServicerH   0   s=  € ÝÔÑ!Ô!€AÝÔÑ Ô €DÝ	ˆf�VŒnÑ	Ô	ð  Ø�Š�qÑÔÐðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð ”=ð 65ñ 65ˆØÔ#ˆàÔ×&Ò& vÑ.Ô.ð 	ÝŒGÐEÑFÔFÐFØà�gÔ(Ð)Ð1VÐVÐVÝŒGˆGàÔ%Ð%Ð% wÔ'7Ð'7ð9ñô ð ð ð	Ý˜wœ|Ñ,Ô,ˆGŒLˆLøÝð 	ð 	ð 	ðÝ"œ|¨G¬LÑ9Ô9¸!Ô<�”�øÝð ð ð Ý”Ð(¨7¬<Ñ7Ñ8Ô8Ð8Ø��ðøøøð �ð	øøøð Œ=Ð åœL¨¬Ñ6Ô6°qÔ9ˆGŒMˆMðÝ # G¤MÑ 2Ô 2�”�øÝð ð ð ðÝ$'¤L°´Ñ$?Ô$?ÀÔ$B�G”M�MøÝð ð ð Ý”GÐ-°´Ñ=Ñ>Ô>Ð>Ø�H‘Hðøøøð "�Mðøøøð Œ?˜jÒ(Ð(Ø�lÔ#ð Ùð Œ|¥5Ô#:Ð:Ð:Ý”Ð4°w´|ÑCÑDÔDÐDÙÝ#‘o”oˆGÝ$Ô6°w´|ÔDˆGÔÐåÔ(¨Ñ1Ô1ˆGà�uÒÐÝÔ˜wœ|¨WÑ5Ô5×FÒFÀqÑIÔIÐIÑIØ˜ÒÐÝÐ3Ñ4Ô4Ð4ñ à€Hs}   ¼AÁA"Á%A"ÃC4Ã4
EÃ?$D$Ä#EÄ$&EÅ
EÅEÅEÅEÆFÆ
G?Æ)$GÇG?Ç&G9Ç4G?Ç8G9Ç9G?Ç>G?)r   r:   r5   ÚsocketÚtwisted.applicationr   r   r(   Útwisted.internet.protocolr   Útwisted.pythonr   r   Útwisted.runnerr   r	   ÚIPPROTO_TCPÚIPPROTO_UDPÚprotocolDictr   rH   r   r   r    ú<module>rQ      sè   ðð
ð ð €
€
€
Ø 
€
€
€
Ø €€€à ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø %Ð %Ð %Ð %Ð %Ð %Ð %Ð %Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +ð Ô)°&Ô2DÐEÐE€ðUð Uð Uð Uð UˆeŒmñ Uô Uð Uð,=ð =ð =ð =ð =r   