comparison cli-session.c @ 64:efb5e0b335cf

TCP forwarding works.
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Aug 2004 13:48:42 +0000
parents 20563735e8b5
children 02e4a7f614f8
comparison
equal deleted inserted replaced
63:dcc43965928f 64:efb5e0b335cf
2 #include "session.h" 2 #include "session.h"
3 #include "dbutil.h" 3 #include "dbutil.h"
4 #include "kex.h" 4 #include "kex.h"
5 #include "ssh.h" 5 #include "ssh.h"
6 #include "packet.h" 6 #include "packet.h"
7 #include "tcp-accept.h" 7 #include "tcpfwd.h"
8 #include "tcp-connect.h"
9 #include "channel.h" 8 #include "channel.h"
10 #include "random.h" 9 #include "random.h"
11 #include "service.h" 10 #include "service.h"
12 #include "runopts.h" 11 #include "runopts.h"
13 #include "chansession.h" 12 #include "chansession.h"
43 #endif 42 #endif
44 {0, 0} /* End */ 43 {0, 0} /* End */
45 }; 44 };
46 45
47 static const struct ChanType *cli_chantypes[] = { 46 static const struct ChanType *cli_chantypes[] = {
48 /* &chan_tcpdirect etc, though need to only allow if we've requested 47 #ifdef ENABLE_CLI_REMOTETCPFWD
49 * that forwarding */ 48 &cli_chan_tcpremote,
49 #endif
50 NULL /* Null termination */ 50 NULL /* Null termination */
51 }; 51 };
52 52
53 void cli_session(int sock, char* remotehost) { 53 void cli_session(int sock, char* remotehost) {
54 54
176 cli_ses.state = SESSION_RUNNING; 176 cli_ses.state = SESSION_RUNNING;
177 return; 177 return;
178 */ 178 */
179 179
180 case USERAUTH_SUCCESS_RCVD: 180 case USERAUTH_SUCCESS_RCVD:
181 #ifdef ENABLE_CLI_LOCALTCPFWD
182 TRACE(("recvd USERAUTH_SUCCESS_RCVD"));
183 setup_localtcp();
184 #endif
181 cli_send_chansess_request(); 185 cli_send_chansess_request();
182 TRACE(("leave cli_sessionloop: cli_send_chansess_request")); 186 TRACE(("leave cli_sessionloop: cli_send_chansess_request"));
183 cli_ses.state = SESSION_RUNNING; 187 cli_ses.state = SESSION_RUNNING;
184 return; 188 return;
185 189
219 common_session_cleanup(); 223 common_session_cleanup();
220 fprintf(stderr, "Connection to %s@%s:%s closed.\n", cli_opts.username, 224 fprintf(stderr, "Connection to %s@%s:%s closed.\n", cli_opts.username,
221 cli_opts.remotehost, cli_opts.remoteport); 225 cli_opts.remotehost, cli_opts.remoteport);
222 exit(EXIT_SUCCESS); 226 exit(EXIT_SUCCESS);
223 } 227 }
224
225 228
226 229
227 /* called when the remote side closes the connection */ 230 /* called when the remote side closes the connection */
228 static void cli_remoteclosed() { 231 static void cli_remoteclosed() {
229 232