summaryrefslogtreecommitdiff
path: root/cli-main.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-07-26 02:44:20 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-07-26 02:44:20 +0000
commita9c38fb37f5fc8796435c2bcbcdecf35cf802ca6 (patch)
treea0342c77df2912832910cc72c9fcef0a2f597461 /cli-main.c
parentf6fce0981d1a351681c58e36d845fa1fa366b398 (diff)
downloaddropbear-a9c38fb37f5fc8796435c2bcbcdecf35cf802ca6.tar.gz
snapshot of stuff
--HG-- extra : convert_revision : 2903853ba24669d01547710986ad531357602633
Diffstat (limited to 'cli-main.c')
-rw-r--r--cli-main.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/cli-main.c b/cli-main.c
new file mode 100644
index 0000000..2460060
--- /dev/null
+++ b/cli-main.c
@@ -0,0 +1,33 @@
+#include <includes.h>
+
+int main(int argc, char ** argv) {
+
+ int sock;
+ char* error = NULL;
+ char* hostandport;
+ int len;
+
+ _dropbear_exit = cli_dropbear_exit;
+ _dropbear_log = cli_dropbear_log;
+
+ cli_getopts(argc, argv);
+
+ sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport,
+ 0, &error);
+
+ if (sock < 0) {
+ dropbear_exit("%s", error);
+ }
+
+ /* Set up the host:port log */
+ len = strlen(cli_opts.remotehost);
+ len += 10; /* 16 bit port and leeway*/
+ hostandport = (char*)m_malloc(len);
+ snprintf(hostandport, len, "%s%d",
+ cli_opts.remotehost, cli_opts.remoteport);
+
+ cli_session(sock, hostandport);
+
+ /* not reached */
+ return -1;
+}