]> andersk Git - openssh.git/blobdiff - serverloop.c
- djm@cvs.openbsd.org 2004/05/21 11:33:11
[openssh.git] / serverloop.c
index bc7cd656afd8e9bac1e44684265685d2d2de1a40..8d2642d5b7fa048bd6939b9e1d8f5b308c68941a 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.114 2003/12/09 15:28:43 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.116 2004/05/21 11:33:11 djm Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
@@ -850,7 +850,7 @@ server_input_window_size(int type, u_int32_t seq, void *ctxt)
 }
 
 static Channel *
-server_request_direct_tcpip(char *ctype)
+server_request_direct_tcpip(void)
 {
        Channel *c;
        int sock;
@@ -872,14 +872,14 @@ server_request_direct_tcpip(char *ctype)
        xfree(originator);
        if (sock < 0)
                return NULL;
-       c = channel_new(ctype, SSH_CHANNEL_CONNECTING,
+       c = channel_new("direct-tcpip", SSH_CHANNEL_CONNECTING,
            sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT,
            CHAN_TCP_PACKET_DEFAULT, 0, "direct-tcpip", 1);
        return c;
 }
 
 static Channel *
-server_request_session(char *ctype)
+server_request_session(void)
 {
        Channel *c;
 
@@ -891,7 +891,7 @@ server_request_session(char *ctype)
         * SSH_CHANNEL_LARVAL.  Additionally, a callback for handling all
         * CHANNEL_REQUEST messages is registered.
         */
-       c = channel_new(ctype, SSH_CHANNEL_LARVAL,
+       c = channel_new("session", SSH_CHANNEL_LARVAL,
            -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT,
            0, "server-session", 1);
        if (session_open(the_authctxt, c->self) != 1) {
@@ -920,9 +920,9 @@ server_input_channel_open(int type, u_int32_t seq, void *ctxt)
            ctype, rchan, rwindow, rmaxpack);
 
        if (strcmp(ctype, "session") == 0) {
-               c = server_request_session(ctype);
+               c = server_request_session();
        } else if (strcmp(ctype, "direct-tcpip") == 0) {
-               c = server_request_direct_tcpip(ctype);
+               c = server_request_direct_tcpip();
        }
        if (c != NULL) {
                debug("server_input_channel_open: confirm %s", ctype);
@@ -991,6 +991,17 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
                            listen_address, listen_port, options.gateway_ports);
                }
                xfree(listen_address);
+       } else if (strcmp(rtype, "cancel-tcpip-forward") == 0) {
+               char *cancel_address;
+               u_short cancel_port;
+
+               cancel_address = packet_get_string(NULL);
+               cancel_port = (u_short)packet_get_int();
+               debug("%s: cancel-tcpip-forward addr %s port %d", __func__,
+                   cancel_address, cancel_port);
+
+               success = channel_cancel_rport_listener(cancel_address,
+                   cancel_port);
        }
        if (want_reply) {
                packet_start(success ?
This page took 0.080849 seconds and 4 git commands to generate.