26
|
1 #include <includes.h> |
|
2 |
|
3 int main(int argc, char ** argv) { |
|
4 |
|
5 int sock; |
|
6 char* error = NULL; |
|
7 char* hostandport; |
|
8 int len; |
|
9 |
|
10 _dropbear_exit = cli_dropbear_exit; |
|
11 _dropbear_log = cli_dropbear_log; |
|
12 |
|
13 cli_getopts(argc, argv); |
|
14 |
|
15 sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, |
|
16 0, &error); |
|
17 |
|
18 if (sock < 0) { |
|
19 dropbear_exit("%s", error); |
|
20 } |
|
21 |
|
22 /* Set up the host:port log */ |
|
23 len = strlen(cli_opts.remotehost); |
|
24 len += 10; /* 16 bit port and leeway*/ |
|
25 hostandport = (char*)m_malloc(len); |
|
26 snprintf(hostandport, len, "%s%d", |
|
27 cli_opts.remotehost, cli_opts.remoteport); |
|
28 |
|
29 cli_session(sock, hostandport); |
|
30 |
|
31 /* not reached */ |
|
32 return -1; |
|
33 } |