summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:01:22 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:01:22 +0000
commitbba81213b972ce15fbbaca60b9ffabb42371ce8f (patch)
treee6bd40752969f2b93d179cfb9aaae9074ca45956 /clientloop.c
parent34f91883a6f3123656b0a8017d68b658f7cf2403 (diff)
- itojun@cvs.openbsd.org 2001/06/23 15:12:20
[auth1.c auth2.c auth2-chall.c authfd.c authfile.c auth-rhosts.c canohost.c channels.c cipher.c clientloop.c deattack.c dh.c hostfile.c kex.c kexdh.c kexgex.c key.c nchan.c packet.c radix.c readpass.c scp.c servconf.c serverloop.c session.c sftp.c sftp-client.c sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c sshconnect1.c sshconnect2.c sshconnect.c sshd.c ssh-keygen.c ssh-keyscan.c] more strict prototypes. raise warning level in Makefile.inc. markus ok'ed TODO; cleanup headers
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/clientloop.c b/clientloop.c
index a62a71131..c96aea56f 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
59 */ 59 */
60 60
61#include "includes.h" 61#include "includes.h"
62RCSID("$OpenBSD: clientloop.c,v 1.76 2001/06/20 13:56:39 markus Exp $"); 62RCSID("$OpenBSD: clientloop.c,v 1.77 2001/06/23 15:12:18 itojun Exp $");
63 63
64#include "ssh.h" 64#include "ssh.h"
65#include "ssh1.h" 65#include "ssh1.h"
@@ -124,7 +124,7 @@ static int connection_out; /* Connection to server (output). */
124static int need_rekeying; /* Set to non-zero if rekeying is requested. */ 124static int need_rekeying; /* Set to non-zero if rekeying is requested. */
125static int session_closed = 0; /* In SSH2: login session closed. */ 125static int session_closed = 0; /* In SSH2: login session closed. */
126 126
127void client_init_dispatch(void); 127static void client_init_dispatch(void);
128int session_ident = -1; 128int session_ident = -1;
129 129
130/*XXX*/ 130/*XXX*/
@@ -132,7 +132,7 @@ extern Kex *xxx_kex;
132 132
133/* Restores stdin to blocking mode. */ 133/* Restores stdin to blocking mode. */
134 134
135void 135static void
136leave_non_blocking(void) 136leave_non_blocking(void)
137{ 137{
138 if (in_non_blocking_mode) { 138 if (in_non_blocking_mode) {
@@ -144,7 +144,7 @@ leave_non_blocking(void)
144 144
145/* Puts stdin terminal in non-blocking mode. */ 145/* Puts stdin terminal in non-blocking mode. */
146 146
147void 147static void
148enter_non_blocking(void) 148enter_non_blocking(void)
149{ 149{
150 in_non_blocking_mode = 1; 150 in_non_blocking_mode = 1;
@@ -157,7 +157,7 @@ enter_non_blocking(void)
157 * flag indicating that the window has changed. 157 * flag indicating that the window has changed.
158 */ 158 */
159 159
160void 160static void
161window_change_handler(int sig) 161window_change_handler(int sig)
162{ 162{
163 received_window_change_signal = 1; 163 received_window_change_signal = 1;
@@ -169,7 +169,7 @@ window_change_handler(int sig)
169 * signals must be trapped to restore terminal modes. 169 * signals must be trapped to restore terminal modes.
170 */ 170 */
171 171
172void 172static void
173signal_handler(int sig) 173signal_handler(int sig)
174{ 174{
175 received_signal = sig; 175 received_signal = sig;
@@ -181,7 +181,7 @@ signal_handler(int sig)
181 * available resolution. 181 * available resolution.
182 */ 182 */
183 183
184double 184static double
185get_current_time(void) 185get_current_time(void)
186{ 186{
187 struct timeval tv; 187 struct timeval tv;
@@ -195,7 +195,7 @@ get_current_time(void)
195 * not appear to wake up when redirecting from /dev/null. 195 * not appear to wake up when redirecting from /dev/null.
196 */ 196 */
197 197
198void 198static void
199client_check_initial_eof_on_stdin(void) 199client_check_initial_eof_on_stdin(void)
200{ 200{
201 int len; 201 int len;
@@ -247,7 +247,7 @@ client_check_initial_eof_on_stdin(void)
247 * connection. 247 * connection.
248 */ 248 */
249 249
250void 250static void
251client_make_packets_from_stdin_data(void) 251client_make_packets_from_stdin_data(void)
252{ 252{
253 u_int len; 253 u_int len;
@@ -279,7 +279,7 @@ client_make_packets_from_stdin_data(void)
279 * appropriate. 279 * appropriate.
280 */ 280 */
281 281
282void 282static void
283client_check_window_change(void) 283client_check_window_change(void)
284{ 284{
285 struct winsize ws; 285 struct winsize ws;
@@ -316,7 +316,7 @@ client_check_window_change(void)
316 * one of the file descriptors). 316 * one of the file descriptors).
317 */ 317 */
318 318
319void 319static void
320client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, 320client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
321 int *maxfdp, int rekeying) 321 int *maxfdp, int rekeying)
322{ 322{
@@ -384,7 +384,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
384 } 384 }
385} 385}
386 386
387void 387static void
388client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr) 388client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
389{ 389{
390 struct winsize oldws, newws; 390 struct winsize oldws, newws;
@@ -427,7 +427,7 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
427 enter_raw_mode(); 427 enter_raw_mode();
428} 428}
429 429
430void 430static void
431client_process_net_input(fd_set * readset) 431client_process_net_input(fd_set * readset)
432{ 432{
433 int len; 433 int len;
@@ -468,7 +468,7 @@ client_process_net_input(fd_set * readset)
468} 468}
469 469
470/* process the characters one by one */ 470/* process the characters one by one */
471int 471static int
472process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len) 472process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
473{ 473{
474 char string[1024]; 474 char string[1024];
@@ -618,7 +618,7 @@ Supported escape sequences:\r\n\
618 return bytes; 618 return bytes;
619} 619}
620 620
621void 621static void
622client_process_input(fd_set * readset) 622client_process_input(fd_set * readset)
623{ 623{
624 int len; 624 int len;
@@ -671,7 +671,7 @@ client_process_input(fd_set * readset)
671 } 671 }
672} 672}
673 673
674void 674static void
675client_process_output(fd_set * writeset) 675client_process_output(fd_set * writeset)
676{ 676{
677 int len; 677 int len;
@@ -732,7 +732,7 @@ client_process_output(fd_set * writeset)
732 * preparatory phase. 732 * preparatory phase.
733 */ 733 */
734 734
735void 735static void
736client_process_buffered_input_packets(void) 736client_process_buffered_input_packets(void)
737{ 737{
738 dispatch_run(DISPATCH_NONBLOCK, &quit_pending, compat20 ? xxx_kex : NULL); 738 dispatch_run(DISPATCH_NONBLOCK, &quit_pending, compat20 ? xxx_kex : NULL);
@@ -740,14 +740,14 @@ client_process_buffered_input_packets(void)
740 740
741/* scan buf[] for '~' before sending data to the peer */ 741/* scan buf[] for '~' before sending data to the peer */
742 742
743int 743static int
744simple_escape_filter(Channel *c, char *buf, int len) 744simple_escape_filter(Channel *c, char *buf, int len)
745{ 745{
746 /* XXX we assume c->extended is writeable */ 746 /* XXX we assume c->extended is writeable */
747 return process_escapes(&c->input, &c->output, &c->extended, buf, len); 747 return process_escapes(&c->input, &c->output, &c->extended, buf, len);
748} 748}
749 749
750void 750static void
751client_channel_closed(int id, void *arg) 751client_channel_closed(int id, void *arg)
752{ 752{
753 if (id != session_ident) 753 if (id != session_ident)
@@ -1000,7 +1000,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1000 1000
1001/*********/ 1001/*********/
1002 1002
1003void 1003static void
1004client_input_stdout_data(int type, int plen, void *ctxt) 1004client_input_stdout_data(int type, int plen, void *ctxt)
1005{ 1005{
1006 u_int data_len; 1006 u_int data_len;
@@ -1010,7 +1010,7 @@ client_input_stdout_data(int type, int plen, void *ctxt)
1010 memset(data, 0, data_len); 1010 memset(data, 0, data_len);
1011 xfree(data); 1011 xfree(data);
1012} 1012}
1013void 1013static void
1014client_input_stderr_data(int type, int plen, void *ctxt) 1014client_input_stderr_data(int type, int plen, void *ctxt)
1015{ 1015{
1016 u_int data_len; 1016 u_int data_len;
@@ -1020,7 +1020,7 @@ client_input_stderr_data(int type, int plen, void *ctxt)
1020 memset(data, 0, data_len); 1020 memset(data, 0, data_len);
1021 xfree(data); 1021 xfree(data);
1022} 1022}
1023void 1023static void
1024client_input_exit_status(int type, int plen, void *ctxt) 1024client_input_exit_status(int type, int plen, void *ctxt)
1025{ 1025{
1026 packet_integrity_check(plen, 4, type); 1026 packet_integrity_check(plen, 4, type);
@@ -1037,7 +1037,7 @@ client_input_exit_status(int type, int plen, void *ctxt)
1037 quit_pending = 1; 1037 quit_pending = 1;
1038} 1038}
1039 1039
1040Channel * 1040static Channel *
1041client_request_forwarded_tcpip(const char *request_type, int rchan) 1041client_request_forwarded_tcpip(const char *request_type, int rchan)
1042{ 1042{
1043 Channel* c = NULL; 1043 Channel* c = NULL;
@@ -1074,7 +1074,7 @@ client_request_forwarded_tcpip(const char *request_type, int rchan)
1074 return c; 1074 return c;
1075} 1075}
1076 1076
1077Channel* 1077static Channel*
1078client_request_x11(const char *request_type, int rchan) 1078client_request_x11(const char *request_type, int rchan)
1079{ 1079{
1080 Channel *c = NULL; 1080 Channel *c = NULL;
@@ -1113,7 +1113,7 @@ client_request_x11(const char *request_type, int rchan)
1113 return c; 1113 return c;
1114} 1114}
1115 1115
1116Channel* 1116static Channel*
1117client_request_agent(const char *request_type, int rchan) 1117client_request_agent(const char *request_type, int rchan)
1118{ 1118{
1119 Channel *c = NULL; 1119 Channel *c = NULL;
@@ -1139,7 +1139,7 @@ client_request_agent(const char *request_type, int rchan)
1139} 1139}
1140 1140
1141/* XXXX move to generic input handler */ 1141/* XXXX move to generic input handler */
1142void 1142static void
1143client_input_channel_open(int type, int plen, void *ctxt) 1143client_input_channel_open(int type, int plen, void *ctxt)
1144{ 1144{
1145 Channel *c = NULL; 1145 Channel *c = NULL;
@@ -1191,7 +1191,7 @@ client_input_channel_open(int type, int plen, void *ctxt)
1191 } 1191 }
1192 xfree(ctype); 1192 xfree(ctype);
1193} 1193}
1194void 1194static void
1195client_input_channel_req(int type, int plen, void *ctxt) 1195client_input_channel_req(int type, int plen, void *ctxt)
1196{ 1196{
1197 Channel *c = NULL; 1197 Channel *c = NULL;
@@ -1228,7 +1228,7 @@ client_input_channel_req(int type, int plen, void *ctxt)
1228 xfree(rtype); 1228 xfree(rtype);
1229} 1229}
1230 1230
1231void 1231static void
1232client_init_dispatch_20(void) 1232client_init_dispatch_20(void)
1233{ 1233{
1234 dispatch_init(&dispatch_protocol_error); 1234 dispatch_init(&dispatch_protocol_error);
@@ -1245,7 +1245,7 @@ client_init_dispatch_20(void)
1245 /* rekeying */ 1245 /* rekeying */
1246 dispatch_set(SSH2_MSG_KEXINIT, &kex_input_kexinit); 1246 dispatch_set(SSH2_MSG_KEXINIT, &kex_input_kexinit);
1247} 1247}
1248void 1248static void
1249client_init_dispatch_13(void) 1249client_init_dispatch_13(void)
1250{ 1250{
1251 dispatch_init(NULL); 1251 dispatch_init(NULL);
@@ -1264,7 +1264,7 @@ client_init_dispatch_13(void)
1264 dispatch_set(SSH_SMSG_X11_OPEN, options.forward_x11 ? 1264 dispatch_set(SSH_SMSG_X11_OPEN, options.forward_x11 ?
1265 &x11_input_open : &deny_input_open); 1265 &x11_input_open : &deny_input_open);
1266} 1266}
1267void 1267static void
1268client_init_dispatch_15(void) 1268client_init_dispatch_15(void)
1269{ 1269{
1270 client_init_dispatch_13(); 1270 client_init_dispatch_13();