diff cli-tcpfwd.c @ 63:dcc43965928f

- A nice cleaner structure for tcp (acceptor) forwarding. - still a checkpoint-ish commit - sorted out listening on localhost only
author Matt Johnston <matt@ucc.asn.au>
date Wed, 11 Aug 2004 17:26:47 +0000
parents 20563735e8b5
children efb5e0b335cf
line wrap: on
line diff
--- a/cli-tcpfwd.c	Tue Aug 10 17:09:52 2004 +0000
+++ b/cli-tcpfwd.c	Wed Aug 11 17:26:47 2004 +0000
@@ -12,22 +12,26 @@
 	NULL
 };
 
+void setup_localtcp() {
 
+	qv
 
+}
 
-static int cli_localtcp(char* port) {
+static int cli_localtcp(unsigned int listenport, const char* remoteaddr,
+		unsigned int remoteport) {
 
 	struct TCPListener* tcpinfo = NULL;
 
 	tcpinfo = (struct TCPListener*)m_malloc(sizeof(struct TCPListener*));
-	tcpinfo->addr = NULL;
-	tcpinfo->port = port;
+	tcpinfo->sendaddr = remoteaddr;
+	tcpinfo->sendport = remoteport;
+	tcpinfo->listenport = listenport;
 	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;