comparison cli-main.c @ 1032:0da8ba489c23 fastopen

Move generic network routines to netio.c
author Matt Johnston <matt@ucc.asn.au>
date Fri, 20 Feb 2015 23:16:38 +0800
parents daf21fd50abf
children 23103e1e9548
comparison
equal deleted inserted replaced
1031:64c0aa01e2b6 1032:0da8ba489c23
28 #include "dbutil.h" 28 #include "dbutil.h"
29 #include "runopts.h" 29 #include "runopts.h"
30 #include "session.h" 30 #include "session.h"
31 #include "dbrandom.h" 31 #include "dbrandom.h"
32 #include "crypto_desc.h" 32 #include "crypto_desc.h"
33 #include "netio.h"
33 34
34 static void cli_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN; 35 static void cli_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN;
35 static void cli_dropbear_log(int priority, const char* format, va_list param); 36 static void cli_dropbear_log(int priority, const char* format, va_list param);
36 37
37 #ifdef ENABLE_CLI_PROXYCMD 38 #ifdef ENABLE_CLI_PROXYCMD
44 #else 45 #else
45 int main(int argc, char ** argv) { 46 int main(int argc, char ** argv) {
46 #endif 47 #endif
47 48
48 int sock_in, sock_out; 49 int sock_in, sock_out;
49 char* error = NULL;
50 struct dropbear_progress_connection *progress = NULL; 50 struct dropbear_progress_connection *progress = NULL;
51 51
52 _dropbear_exit = cli_dropbear_exit; 52 _dropbear_exit = cli_dropbear_exit;
53 _dropbear_log = cli_dropbear_log; 53 _dropbear_log = cli_dropbear_log;
54 54
71 cli_proxy_cmd(&sock_in, &sock_out); 71 cli_proxy_cmd(&sock_in, &sock_out);
72 m_free(cli_opts.proxycmd); 72 m_free(cli_opts.proxycmd);
73 } else 73 } else
74 #endif 74 #endif
75 { 75 {
76 progress = connect_remote(cli_opts.remotehost, cli_opts.remoteport, cli_connected, NULL); 76 progress = connect_remote(cli_opts.remotehost, cli_opts.remoteport, cli_connected, &ses);
77 sock_in = sock_out = -1; 77 sock_in = sock_out = -1;
78 } 78 }
79 79
80 cli_session(sock_in, sock_out, progress); 80 cli_session(sock_in, sock_out, progress);
81 81