Mercurial > dropbear
comparison cli-tcpfwd.c @ 156:8c2b3506f112
Rearrange preprocessor parts so that compilation with various options
disabled works OK.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 22 Dec 2004 15:37:50 +0000 |
parents | 10f4d3319780 |
children | 0cfba3034be5 |
comparison
equal
deleted
inserted
replaced
153:6ba95762ec4e | 156:8c2b3506f112 |
---|---|
29 #include "channel.h" | 29 #include "channel.h" |
30 #include "runopts.h" | 30 #include "runopts.h" |
31 #include "session.h" | 31 #include "session.h" |
32 #include "ssh.h" | 32 #include "ssh.h" |
33 | 33 |
34 static int cli_localtcp(unsigned int listenport, const char* remoteaddr, | 34 #ifdef ENABLE_CLI_REMOTETCPFWD |
35 unsigned int remoteport); | |
36 static int newtcpforwarded(struct Channel * channel); | 35 static int newtcpforwarded(struct Channel * channel); |
37 | 36 |
38 const struct ChanType cli_chan_tcpremote = { | 37 const struct ChanType cli_chan_tcpremote = { |
39 1, /* sepfds */ | 38 1, /* sepfds */ |
40 "forwarded-tcpip", | 39 "forwarded-tcpip", |
41 newtcpforwarded, | 40 newtcpforwarded, |
42 NULL, | 41 NULL, |
43 NULL, | 42 NULL, |
44 NULL | 43 NULL |
45 }; | 44 }; |
45 #endif | |
46 | |
47 #ifdef ENABLE_CLI_LOCALTCPFWD | |
48 static int cli_localtcp(unsigned int listenport, const char* remoteaddr, | |
49 unsigned int remoteport); | |
46 static const struct ChanType cli_chan_tcplocal = { | 50 static const struct ChanType cli_chan_tcplocal = { |
47 1, /* sepfds */ | 51 1, /* sepfds */ |
48 "direct-tcpip", | 52 "direct-tcpip", |
49 NULL, | 53 NULL, |
50 NULL, | 54 NULL, |
51 NULL, | 55 NULL, |
52 NULL | 56 NULL |
53 }; | 57 }; |
54 | 58 #endif |
59 | |
60 #ifdef ENABLE_CLI_LOCALTCPFWD | |
55 void setup_localtcp() { | 61 void setup_localtcp() { |
56 | 62 |
57 int ret; | 63 int ret; |
58 | 64 |
59 TRACE(("enter setup_localtcp")); | 65 TRACE(("enter setup_localtcp")); |
100 m_free(tcpinfo); | 106 m_free(tcpinfo); |
101 } | 107 } |
102 TRACE(("leave cli_localtcp: %d", ret)); | 108 TRACE(("leave cli_localtcp: %d", ret)); |
103 return ret; | 109 return ret; |
104 } | 110 } |
105 | 111 #endif /* ENABLE_CLI_LOCALTCPFWD */ |
112 | |
113 #ifdef ENABLE_CLI_REMOTETCPFWD | |
106 static void send_msg_global_request_remotetcp(int port) { | 114 static void send_msg_global_request_remotetcp(int port) { |
107 | 115 |
108 TRACE(("enter send_msg_global_request_remotetcp")); | 116 TRACE(("enter send_msg_global_request_remotetcp")); |
109 | 117 |
110 CHECKCLEARTOWRITE(); | 118 CHECKCLEARTOWRITE(); |
189 | 197 |
190 out: | 198 out: |
191 TRACE(("leave newtcpdirect: err %d", err)); | 199 TRACE(("leave newtcpdirect: err %d", err)); |
192 return err; | 200 return err; |
193 } | 201 } |
202 #endif /* ENABLE_CLI_REMOTETCPFWD */ |