Mercurial > dropbear
comparison cli-session.c @ 579:8c737cd7c1af
merge of '48fdaa8706d1acda35e9d564adc9a1fbc96c18c8'
and '658fd03abd21e0da7c4c89b9fff9dc693c72daae'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 27 Feb 2010 11:53:18 +0000 |
parents | 005530560594 |
children | a98a2138364a |
comparison
equal
deleted
inserted
replaced
577:69e98c45db7c | 579:8c737cd7c1af |
---|---|
33 #include "channel.h" | 33 #include "channel.h" |
34 #include "random.h" | 34 #include "random.h" |
35 #include "service.h" | 35 #include "service.h" |
36 #include "runopts.h" | 36 #include "runopts.h" |
37 #include "chansession.h" | 37 #include "chansession.h" |
38 #include "agentfwd.h" | |
38 | 39 |
39 static void cli_remoteclosed(); | 40 static void cli_remoteclosed(); |
40 static void cli_sessionloop(); | 41 static void cli_sessionloop(); |
41 static void cli_session_init(); | 42 static void cli_session_init(); |
42 static void cli_finished(); | 43 static void cli_finished(); |
73 | 74 |
74 static const struct ChanType *cli_chantypes[] = { | 75 static const struct ChanType *cli_chantypes[] = { |
75 #ifdef ENABLE_CLI_REMOTETCPFWD | 76 #ifdef ENABLE_CLI_REMOTETCPFWD |
76 &cli_chan_tcpremote, | 77 &cli_chan_tcpremote, |
77 #endif | 78 #endif |
79 #ifdef ENABLE_CLI_AGENTFWD | |
80 &cli_chan_agent, | |
81 #endif | |
78 NULL /* Null termination */ | 82 NULL /* Null termination */ |
79 }; | 83 }; |
80 | 84 |
81 void cli_session(int sock_in, int sock_out, char* remotehost) { | 85 void cli_session(int sock_in, int sock_out) { |
82 | 86 |
83 seedrandom(); | 87 seedrandom(); |
84 | 88 |
85 crypto_init(); | 89 crypto_init(); |
86 | 90 |
87 common_session_init(sock_in, sock_out, remotehost); | 91 common_session_init(sock_in, sock_out); |
88 | 92 |
89 chaninitialise(cli_chantypes); | 93 chaninitialise(cli_chantypes); |
90 | 94 |
91 /* Set up cli_ses vars */ | 95 /* Set up cli_ses vars */ |
92 cli_session_init(); | 96 cli_session_init(); |
229 #ifdef ENABLE_CLI_NETCAT | 233 #ifdef ENABLE_CLI_NETCAT |
230 if (cli_opts.netcat_host) { | 234 if (cli_opts.netcat_host) { |
231 cli_send_netcat_request(); | 235 cli_send_netcat_request(); |
232 } else | 236 } else |
233 #endif | 237 #endif |
234 if (!cli_opts.no_cmd) { | 238 if (!cli_opts.no_cmd) { |
235 cli_send_chansess_request(); | 239 cli_send_chansess_request(); |
236 } | 240 } |
237 TRACE(("leave cli_sessionloop: running")) | 241 TRACE(("leave cli_sessionloop: running")) |
238 cli_ses.state = SESSION_RUNNING; | 242 cli_ses.state = SESSION_RUNNING; |
239 return; | 243 return; |