![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/twisted/runner/__pycache__/ |
o �b� � @ s� d Z ddlZddlZddlZddlmZmZ ddlm Z ddl mZmZ ddl mZmZ ejejd�ZG dd � d ej�Zd d� ZdS )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 @ s@ e Zd ZdZg d�g d�gZg d�gZejde�d�id�Z dS ) �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.confzService configuration file)� nointernal�izDon't run internal servicesr z*.conf)� optActionsN) �__name__� __module__�__qualname__�__doc__� optParameters�optFlagsr �Completions� CompleteFiles�compData� r r �9/usr/lib/python3/dist-packages/twisted/runner/inetdtap.pyr s � r c C s� t �� }t�� }t| d �� }|�|� W d � n1 sw Y |jD ]�}|j}|j�d�r7t � d� q&||jfdvrJt � d|j|jf � q&zt|j �|_ W n' tyy zt�|j �d |_ W n tyv t � d|j � Y Y q&w Y nw |jd u r�t�|j �d |_n0zt|j�|_W n' ty� zt�|j�d |_W n ty� t � d |j � Y Y q&w Y nw |jd kr�| d r�q&|jtjvr�t � d|j � q&t� }tj|j |_nt�|�}|d kr�t�|j|��|� q&|dkr�t d��q&|S )Nr zrpc/z/Skipping rpc service due to lack of rpc support))r �stream)r �dgramz)Skipping unsupported type/protocol: %s/%s� zUnknown user: � zUnknown group: �internalr zUnknown internal service: r r znot 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) �factoryr r r �makeService0 sp � ����� ��� �rC )r r5 r0 �socket�twisted.applicationr r r# �twisted.internet.protocolr �twisted.pythonr r �twisted.runnerr r �IPPROTO_TCP�IPPROTO_UDP�protocolDictr rC r r r r �<module> s