ó
    Ö›‘hÈ  ã                   ó¾   • S r SSKrSSKrSSKrSSKJrJr  SSKJ	r	  SSK
JrJr  SSKJrJr  \R                   \R"                  S.r " S S	\R&                  5      rS
 rg)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                   óv   • \ rS rSrSr/ SQ/ SQ/r/ SQ/r\R                  " S\R                  " S5      0S9r
S	rg
)ÚOptionsé   zá
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)Ú
optActions© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚoptParametersÚoptFlagsr   ÚCompletionsÚCompleteFilesÚcompDataÚ__static_attributes__r   ó    Ú[C:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/runner/inetdtap.pyr   r      sB   † ñ	ò 	IÚFð€Mò
 CÐC€Hà× Ò ¨V°U×5HÒ5HÈÓ5RÐ,SÑTƒHr"   r   c                 ó~  • [         R                  " 5       n[        R                  " 5       n[	        U S   5       nUR                  U5        S S S 5        UR                   GHç  nUR                  nUR                  R                  S5      (       a  [        R                  " S5        MH  XTR                  4S;  a4  [        R                  " SUR                  < SUR                  < 35        M�   [        UR                  5      Ul        UR$                  c)  [        R&                  " UR                  5      S	   Ul        O [        UR$                  5      Ul        UR,                  S:X  a~  U S   (       a  GM  UR.                  [0        R2                  ;  a&  [        R                  " SUR.                  -   5        GMZ  [5        5       n[0        R2                  UR.                     Ul        O[0        R6                  " U5      nUS:X  a3  [8        R:                  " UR<                  U5      R?                  U5        GMÖ  US:X  d  GMß  [A        S5      e   U$ ! , (       d  f       GN	= f! [         ac     [        R                   " UR                  5      S   Ul         GNŽ! ["         a)    [        R                  " SUR                  -   5          GMh  f = ff = f! [         ac     [(        R*                  " UR$                  5      S   Ul         GN­! ["         a)    [        R                  " S
UR$                  -   5          GMØ  f = ff = f)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   r1   Úfactorys          r#   ÚmakeServicerK   0   su  € Ü×ÒÓ!€AÜ×ÒÓ €DÜ	ˆf�V‰nÔ	 Ø�‰�qÔ÷ 
ð —=•=ˆØ×#Ñ#ˆà×Ñ×&Ñ& v×.Ñ.Ü�GŠGÐEÔFÙà×(Ñ(Ð)Ð1VÓVÜ�G‹Gà×%Ô% w×'7Ó'7ð9ôñ ð	Ü˜wŸ|™|Ó,ˆGŒLð �=‰=Ñ äŸLšL¨¯©Ó6°qÑ9ˆG�MðÜ # G§M¡MÓ 2�”ð �?‰?˜jÓ(Ø�l×#Úð �|‰|¤5×#:Ñ#:Ó:Ü—’Ð4°w·|±|ÑCÔDÚÜ#“oˆGÜ$×6Ñ6°w·|±|ÑDˆGÕä×(Ò(¨Ó1ˆGà�uÓÜ×Ò˜wŸ|™|¨WÓ5×FÑFÀq×IØ˜ÖÜÐ3Ó4Ð4ñm !ðn €H÷u 
Ö	ûô( ó 	ðÜ"Ÿ|š|¨G¯L©LÓ9¸!Ñ<�—øÜó Ü—’Ð(¨7¯<©<Ñ7Ô8Üðúð	ûô ó ðÜ$'§L¢L°·±Ó$?ÀÑ$B�G—MøÜó Ü—G’GÐ-°·±Ñ=Ô>Üðúðús_   ¹IÃ-IÄ>KÉ
IÉ
KÉ*(JÊ-KËKËKËKË
L<Ë(LÌ-L8Ì2L<Ì7L8Ì8L<)r   r=   r8   ÚsocketÚtwisted.applicationr   r   r+   Útwisted.internet.protocolr   Útwisted.pythonr   r   Útwisted.runnerr   r	   ÚIPPROTO_TCPÚIPPROTO_UDPÚprotocolDictr   rK   r   r"   r#   Ú<module>rT      sP   ðñ
ó Û 
Û ç ?Ý 3ß %ß +ð ×)Ñ)°&×2DÑ2DÑE€ôUˆe�m‰mô Uó,=r"   