diff cli-tcpfwd.c @ 62:20563735e8b5

just checkpointing
author Matt Johnston <matt@ucc.asn.au>
date Tue, 10 Aug 2004 17:09:52 +0000
parents
children dcc43965928f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cli-tcpfwd.c	Tue Aug 10 17:09:52 2004 +0000
@@ -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;
+}