=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh.c,v retrieving revision 1.169 retrieving revision 1.169.2.1 diff -u -r1.169 -r1.169.2.1 --- src/usr.bin/ssh/ssh.c 2002/03/26 11:37:05 1.169 +++ src/usr.bin/ssh/ssh.c 2002/05/18 04:12:11 1.169.2.1 @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.169 2002/03/26 11:37:05 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.169.2.1 2002/05/18 04:12:11 jason Exp $"); #include #include @@ -138,6 +138,9 @@ /* Should we execute a command or invoke a subsystem? */ int subsystem_flag = 0; +/* # of replies received for global requests */ +static int client_global_request_id = 0; + /* Prints a help message to the user. This function never returns. */ static void @@ -1019,6 +1022,27 @@ if (type == SSH2_MSG_CHANNEL_FAILURE) fatal("Request for subsystem '%.*s' failed on channel %d", len, (u_char *)buffer_ptr(&command), id); +} + +void +client_global_request_reply(int type, u_int32_t seq, void *ctxt) +{ + int i; + + i = client_global_request_id++; + if (i >= options.num_remote_forwards) { + debug("client_global_request_reply: too many replies %d > %d", + i, options.num_remote_forwards); + return; + } + debug("remote forward %s for: listen %d, connect %s:%d", + type == SSH2_MSG_REQUEST_SUCCESS ? "success" : "failure", + options.remote_forwards[i].port, + options.remote_forwards[i].host, + options.remote_forwards[i].host_port); + if (type == SSH2_MSG_REQUEST_FAILURE) + log("Warning: remote port forwarding failed for listen port %d", + options.remote_forwards[i].port); } /* request pty/x11/agent/tcpfwd/shell for channel */