2004-08-10 17:09:52 +00:00
|
|
|
#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
|
|
|
|
};
|
|
|
|
|
2004-08-11 17:26:47 +00:00
|
|
|
void setup_localtcp() {
|
2004-08-10 17:09:52 +00:00
|
|
|
|
2004-08-11 17:26:47 +00:00
|
|
|
qv
|
2004-08-10 17:09:52 +00:00
|
|
|
|
2004-08-11 17:26:47 +00:00
|
|
|
}
|
2004-08-10 17:09:52 +00:00
|
|
|
|
2004-08-11 17:26:47 +00:00
|
|
|
static int cli_localtcp(unsigned int listenport, const char* remoteaddr,
|
|
|
|
unsigned int remoteport) {
|
2004-08-10 17:09:52 +00:00
|
|
|
|
|
|
|
struct TCPListener* tcpinfo = NULL;
|
|
|
|
|
|
|
|
tcpinfo = (struct TCPListener*)m_malloc(sizeof(struct TCPListener*));
|
2004-08-11 17:26:47 +00:00
|
|
|
tcpinfo->sendaddr = remoteaddr;
|
|
|
|
tcpinfo->sendport = remoteport;
|
|
|
|
tcpinfo->listenport = listenport;
|
2004-08-10 17:09:52 +00:00
|
|
|
tcpinfo->chantype = &cli_chan_tcplocal;
|
|
|
|
|
|
|
|
ret = listen_tcpfwd(tcpinfo);
|
|
|
|
|
|
|
|
if (ret == DROPBEAR_FAILURE) {
|
|
|
|
m_free(tcpinfo);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|