diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-06-25 05:01:22 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-06-25 05:01:22 +0000 |
commit | bba81213b972ce15fbbaca60b9ffabb42371ce8f (patch) | |
tree | e6bd40752969f2b93d179cfb9aaae9074ca45956 /clientloop.c | |
parent | 34f91883a6f3123656b0a8017d68b658f7cf2403 (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.c | 60 |
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" |
62 | RCSID("$OpenBSD: clientloop.c,v 1.76 2001/06/20 13:56:39 markus Exp $"); | 62 | RCSID("$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). */ | |||
124 | static int need_rekeying; /* Set to non-zero if rekeying is requested. */ | 124 | static int need_rekeying; /* Set to non-zero if rekeying is requested. */ |
125 | static int session_closed = 0; /* In SSH2: login session closed. */ | 125 | static int session_closed = 0; /* In SSH2: login session closed. */ |
126 | 126 | ||
127 | void client_init_dispatch(void); | 127 | static void client_init_dispatch(void); |
128 | int session_ident = -1; | 128 | int 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 | ||
135 | void | 135 | static void |
136 | leave_non_blocking(void) | 136 | leave_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 | ||
147 | void | 147 | static void |
148 | enter_non_blocking(void) | 148 | enter_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 | ||
160 | void | 160 | static void |
161 | window_change_handler(int sig) | 161 | window_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 | ||
172 | void | 172 | static void |
173 | signal_handler(int sig) | 173 | signal_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 | ||
184 | double | 184 | static double |
185 | get_current_time(void) | 185 | get_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 | ||
198 | void | 198 | static void |
199 | client_check_initial_eof_on_stdin(void) | 199 | client_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 | ||
250 | void | 250 | static void |
251 | client_make_packets_from_stdin_data(void) | 251 | client_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 | ||
282 | void | 282 | static void |
283 | client_check_window_change(void) | 283 | client_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 | ||
319 | void | 319 | static void |
320 | client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, | 320 | client_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 | ||
387 | void | 387 | static void |
388 | client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr) | 388 | client_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 | ||
430 | void | 430 | static void |
431 | client_process_net_input(fd_set * readset) | 431 | client_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 */ |
471 | int | 471 | static int |
472 | process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len) | 472 | process_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 | ||
621 | void | 621 | static void |
622 | client_process_input(fd_set * readset) | 622 | client_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 | ||
674 | void | 674 | static void |
675 | client_process_output(fd_set * writeset) | 675 | client_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 | ||
735 | void | 735 | static void |
736 | client_process_buffered_input_packets(void) | 736 | client_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 | ||
743 | int | 743 | static int |
744 | simple_escape_filter(Channel *c, char *buf, int len) | 744 | simple_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 | ||
750 | void | 750 | static void |
751 | client_channel_closed(int id, void *arg) | 751 | client_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 | ||
1003 | void | 1003 | static void |
1004 | client_input_stdout_data(int type, int plen, void *ctxt) | 1004 | client_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 | } |
1013 | void | 1013 | static void |
1014 | client_input_stderr_data(int type, int plen, void *ctxt) | 1014 | client_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 | } |
1023 | void | 1023 | static void |
1024 | client_input_exit_status(int type, int plen, void *ctxt) | 1024 | client_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 | ||
1040 | Channel * | 1040 | static Channel * |
1041 | client_request_forwarded_tcpip(const char *request_type, int rchan) | 1041 | client_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 | ||
1077 | Channel* | 1077 | static Channel* |
1078 | client_request_x11(const char *request_type, int rchan) | 1078 | client_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 | ||
1116 | Channel* | 1116 | static Channel* |
1117 | client_request_agent(const char *request_type, int rchan) | 1117 | client_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 */ |
1142 | void | 1142 | static void |
1143 | client_input_channel_open(int type, int plen, void *ctxt) | 1143 | client_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 | } |
1194 | void | 1194 | static void |
1195 | client_input_channel_req(int type, int plen, void *ctxt) | 1195 | client_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 | ||
1231 | void | 1231 | static void |
1232 | client_init_dispatch_20(void) | 1232 | client_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 | } |
1248 | void | 1248 | static void |
1249 | client_init_dispatch_13(void) | 1249 | client_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 | } |
1267 | void | 1267 | static void |
1268 | client_init_dispatch_15(void) | 1268 | client_init_dispatch_15(void) |
1269 | { | 1269 | { |
1270 | client_init_dispatch_13(); | 1270 | client_init_dispatch_13(); |