Ϫf dZddlZddlZddlZddlmZmZddlm Z ddl m Z m Z ddl mZmZej ej"dZGdd e j&Zd Zy) 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)internetservice) ServerFactory)logusage)inetd inetdconf)tcpudpcteZdZdZgdgdgZgdgZejdejdiZ y) 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 )rpcrz/etc/rpcz$DEPRECATED. RPC procedure table file)filefz/etc/inetd.confzService configuration file) nointernalizDon't run internal servicesrz*.conf) optActionsN) __name__ __module__ __qualname____doc__ optParametersoptFlagsr Completions CompleteFilescompData9/usr/lib/python3/dist-packages/twisted/runner/inetdtap.pyr r sG  IFM CCH u  V5HU5H5H5R,STHrr c tj}tj}t |d5}|j |ddd|j D]}|j}|jjdrtjdA||jfdvr0tjd|jd|j t|j|_ |j$(tj&|jd |_n t|j$|_|j,d k(rt|d r|j.t0j2vr$tjd |j.zAt5}t0j2|j.|_nt1j6|}|dk(r1t9j:|j<|j?||dk(stAd|S#1swYxYw#t$r` tj |jd|_ n3#t"$r'tjd|jzYY" swH+H8.J$+H58 J!'I*)J!*+JJ!JJ! J!$ L .'KL +LL LL  L )rr:r5sockettwisted.applicationrrr(twisted.internet.protocolrtwisted.pythonrrtwisted.runnerrr IPPROTO_TCP IPPROTO_UDP protocolDictr rHrrr rQsP  ?3%+))&2D2DE UemmU,= r