![]() 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/conch/ssh/__pycache__/ |
o �b! � @ s� d Z ddlZddlmZmZ ddlmZmZ ddlm Z m Z G dd� dej�ZG dd � d ej �ZG d d� de�ZG dd � d e�ZG dd� dej �Zdd� ZG dd� dej�Zdd� ZeZdd� ZeZdd� Zdd� ZdS )z� This module contains the implementation of the TCP forwarding, which allows clients and servers to forward arbitrary TCP data across the connection. Maintainer: Paul Swartz � N)�channel�common)�protocol�reactor)�HostnameEndpoint�connectProtocolc @ s e Zd Zdd� Zdd� ZdS )�SSHListenForwardingFactoryc C s || _ || _|| _d S �N)�conn�hostport�klass)�self� connectionr r � r �>/usr/lib/python3/dist-packages/twisted/conch/ssh/forwarding.py�__init__ s z#SSHListenForwardingFactory.__init__c C sF | j | jd�}t|�}||_|j|jf}t| j|�}| j�||� |S )N)r ) r r �SSHForwardingClient�client�host�port�packOpen_direct_tcpipr �openChannel)r �addrr r � addrTuple�channelOpenDatar r r � buildProtocol s z(SSHListenForwardingFactory.buildProtocolN)�__name__� __module__�__qualname__r r r r r r r s r c @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d � ZdS )�SSHListenForwardingChannelc C sH | j jd| jd� t| jj�dkr| jjdd � }| �|� d| j_d S )Nzopened forwarding channel {id}��id� � )�_log�infor! �lenr �buf�write)r �specificData�br r r �channelOpen$ s z&SSHListenForwardingChannel.channelOpenc C s | � � d S r )�closed�r �reasonr r r � openFailed+ s z%SSHListenForwardingChannel.openFailedc C s | j j�|� d S r )r � transportr( �r �datar r r �dataReceived. s z'SSHListenForwardingChannel.dataReceivedc C s | j j�� d S r )r r0 �loseConnection�r r r r �eofReceived1 s z&SSHListenForwardingChannel.eofReceivedc C s4 t | d�r| jjd| jd� | jj�� | `d S d S )Nr z%closing local forwarding channel {id}r )�hasattrr$ r% r! r r0 r4 r5 r r r r, 4 s �z!SSHListenForwardingChannel.closedN)r r r r+ r/ r3 r6 r, r r r r r # s r c @ � e Zd ZdZdS )� SSHListenClientForwardingChannels direct-tcpipN�r r r �namer r r r r9 ; � r9 c @ r8 )� SSHListenServerForwardingChannels forwarded-tcpipNr: r r r r r= @ r<