summaryrefslogtreecommitdiff
path: root/cli-tcpfwd.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-08-11 17:26:47 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-08-11 17:26:47 +0000
commit09d419bc31dc598240ed03cdf9168d7d0ae6a98f (patch)
treedffe7a4d63c88753c9763cbbe584d3d95d1a95f2 /cli-tcpfwd.c
parent97858f3dcef78891ed7befc02d073c3dd4d9be18 (diff)
downloaddropbear-09d419bc31dc598240ed03cdf9168d7d0ae6a98f.tar.gz
- A nice cleaner structure for tcp (acceptor) forwarding.
- still a checkpoint-ish commit - sorted out listening on localhost only
Diffstat (limited to 'cli-tcpfwd.c')
-rw-r--r--cli-tcpfwd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/cli-tcpfwd.c b/cli-tcpfwd.c
index 3dc6e20..955ffab 100644
--- a/cli-tcpfwd.c
+++ b/cli-tcpfwd.c
@@ -12,22 +12,26 @@ static const struct ChanType cli_chan_tcplocal = {
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;