/usr/lib/python3/dist-packages/twisted/conch/ssh/__pycache__
Edit: /usr/lib/python3/dist-packages/twisted/conch/ssh/__pycache__/forwarding.cpython-310.pyc (8652B)
o
b! @ s d Z ddlZddlmZmZ ddlmZmZ ddlm Z m
Z
G dd dejZG dd d ej
ZG d
d deZG dd
d
eZG dd dej
Zdd ZG dd dejZdd 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)channelcommon)protocolreactor)HostnameEndpointconnectProtocolc @ s e Zd Zdd Zdd ZdS )SSHListenForwardingFactoryc C s || _ || _|| _d S N)connhostportklass)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
SSHForwardingClientclienthostportpackOpen_direct_tcpipr openChannel)r
addrr r addrTuplechannelOpenDatar 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| jjdkr| jjdd }| | d| j_d S )Nzopened forwarding channel {id}id )_loginfor! lenr bufwrite)r
specificDatabr r r channelOpen$ s
z&SSHListenForwardingChannel.channelOpenc C s | d S r )closedr
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 loseConnectionr
r r r eofReceived1 s z&SSHListenForwardingChannel.eofReceivedc C s4 t | dr| 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-tcpipNr r r namer r r r r9 ; r9 c @ r8 ) SSHListenServerForwardingChannels forwarded-tcpipNr: r r r r r= @ r<