Mercurial > dropbear
comparison cli-tcpfwd.c @ 1295:750ec4ec4cbe
Convert #ifdef to #if, other build changes
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 04 May 2016 15:33:40 +0200 |
parents | d49bda490798 |
children | e47e4b8a005d |
comparison
equal
deleted
inserted
replaced
1294:56aba7dedbea | 1295:750ec4ec4cbe |
---|---|
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 #include "netio.h" | 33 #include "netio.h" |
34 | 34 |
35 #ifdef ENABLE_CLI_REMOTETCPFWD | 35 #if DROPBEAR_CLI_REMOTETCPFWD |
36 static int newtcpforwarded(struct Channel * channel); | 36 static int newtcpforwarded(struct Channel * channel); |
37 | 37 |
38 const struct ChanType cli_chan_tcpremote = { | 38 const struct ChanType cli_chan_tcpremote = { |
39 1, /* sepfds */ | 39 1, /* sepfds */ |
40 "forwarded-tcpip", | 40 "forwarded-tcpip", |
43 NULL, | 43 NULL, |
44 NULL | 44 NULL |
45 }; | 45 }; |
46 #endif | 46 #endif |
47 | 47 |
48 #ifdef ENABLE_CLI_LOCALTCPFWD | 48 #if DROPBEAR_CLI_LOCALTCPFWD |
49 static int cli_localtcp(const char* listenaddr, | 49 static int cli_localtcp(const char* listenaddr, |
50 unsigned int listenport, | 50 unsigned int listenport, |
51 const char* remoteaddr, | 51 const char* remoteaddr, |
52 unsigned int remoteport); | 52 unsigned int remoteport); |
53 static const struct ChanType cli_chan_tcplocal = { | 53 static const struct ChanType cli_chan_tcplocal = { |
58 NULL, | 58 NULL, |
59 NULL | 59 NULL |
60 }; | 60 }; |
61 #endif | 61 #endif |
62 | 62 |
63 #ifdef ENABLE_CLI_ANYTCPFWD | 63 #if DROPBEAR_CLI_ANYTCPFWD |
64 static void fwd_failed(const char* format, ...) ATTRIB_PRINTF(1,2); | 64 static void fwd_failed(const char* format, ...) ATTRIB_PRINTF(1,2); |
65 static void fwd_failed(const char* format, ...) | 65 static void fwd_failed(const char* format, ...) |
66 { | 66 { |
67 va_list param; | 67 va_list param; |
68 va_start(param, format); | 68 va_start(param, format); |
75 | 75 |
76 va_end(param); | 76 va_end(param); |
77 } | 77 } |
78 #endif | 78 #endif |
79 | 79 |
80 #ifdef ENABLE_CLI_LOCALTCPFWD | 80 #if DROPBEAR_CLI_LOCALTCPFWD |
81 void setup_localtcp() { | 81 void setup_localtcp() { |
82 m_list_elem *iter; | 82 m_list_elem *iter; |
83 int ret; | 83 int ret; |
84 | 84 |
85 TRACE(("enter setup_localtcp")) | 85 TRACE(("enter setup_localtcp")) |
142 m_free(tcpinfo); | 142 m_free(tcpinfo); |
143 } | 143 } |
144 TRACE(("leave cli_localtcp: %d", ret)) | 144 TRACE(("leave cli_localtcp: %d", ret)) |
145 return ret; | 145 return ret; |
146 } | 146 } |
147 #endif /* ENABLE_CLI_LOCALTCPFWD */ | 147 #endif /* DROPBEAR_CLI_LOCALTCPFWD */ |
148 | 148 |
149 #ifdef ENABLE_CLI_REMOTETCPFWD | 149 #if DROPBEAR_CLI_REMOTETCPFWD |
150 static void send_msg_global_request_remotetcp(const char *addr, int port) { | 150 static void send_msg_global_request_remotetcp(const char *addr, int port) { |
151 | 151 |
152 TRACE(("enter send_msg_global_request_remotetcp")) | 152 TRACE(("enter send_msg_global_request_remotetcp")) |
153 | 153 |
154 CHECKCLEARTOWRITE(); | 154 CHECKCLEARTOWRITE(); |
283 out: | 283 out: |
284 m_free(origaddr); | 284 m_free(origaddr); |
285 TRACE(("leave newtcpdirect: err %d", err)) | 285 TRACE(("leave newtcpdirect: err %d", err)) |
286 return err; | 286 return err; |
287 } | 287 } |
288 #endif /* ENABLE_CLI_REMOTETCPFWD */ | 288 #endif /* DROPBEAR_CLI_REMOTETCPFWD */ |