summaryrefslogtreecommitdiffhomepage
path: root/cli-tcpfwd.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-08-10 17:09:52 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-08-10 17:09:52 +0000
commita712baa8e566bfd8403a3e2bfdf350a0dc50ea9f (patch)
tree87dd64b7ca8331c29936a32aab69e9f09f63dccf /cli-tcpfwd.c
parent254e8e34524db48e5ad73d26a923d20b03dd8bf3 (diff)
just checkpointing
--HG-- extra : convert_revision : fbbf404290f3fea3dfa9f6f53eba9389057e9044
Diffstat (limited to 'cli-tcpfwd.c')
-rw-r--r--cli-tcpfwd.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/cli-tcpfwd.c b/cli-tcpfwd.c
new file mode 100644
index 0000000..3dc6e20
--- /dev/null
+++ b/cli-tcpfwd.c
@@ -0,0 +1,34 @@
+#include "includes.h"
+#include "options.h"
+#include "tcp-accept.h"
+#include "tcp-connect.h"
+#include "channel.h"
+
+static const struct ChanType cli_chan_tcplocal = {
+ 1, /* sepfds */
+ "direct-tcpip",
+ NULL,
+ NULL,
+ NULL
+};
+
+
+
+
+static int cli_localtcp(char* port) {
+
+ struct TCPListener* tcpinfo = NULL;
+
+ tcpinfo = (struct TCPListener*)m_malloc(sizeof(struct TCPListener*));
+ tcpinfo->addr = NULL;
+ tcpinfo->port = port;
+ tcpinfo->chantype = &cli_chan_tcplocal;
+
+ ret = listen_tcpfwd(tcpinfo);
+
+ if (ret == DROPBEAR_FAILURE) {
+ DROPBEAR_LOG(LOG_WARNING, "Failed to listen on port %s", port);
+ m_free(tcpinfo);
+ }
+ return ret;
+}