=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/channels.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- src/usr.bin/ssh/channels.c 2000/04/14 10:09:14 1.48 +++ src/usr.bin/ssh/channels.c 2000/04/14 10:30:30 1.49 @@ -1,23 +1,23 @@ /* - * + * * channels.c - * + * * Author: Tatu Ylonen - * + * * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved - * + * * Created: Fri Mar 24 16:35:24 1995 ylo - * + * * This file contains functions for generic socket connection forwarding. * There is also code for initiating connection forwarding for X11 connections, * arbitrary tcp/ip connections, and the authentication agent connection. - * + * * SSH2 support added by Markus Friedl. */ #include "includes.h" -RCSID("$Id: channels.c,v 1.48 2000/04/14 10:09:14 markus Exp $"); +RCSID("$Id: channels.c,v 1.49 2000/04/14 10:30:30 markus Exp $"); #include "ssh.h" #include "packet.h" @@ -109,7 +109,7 @@ /* Sets specific protocol options. */ -void +void channel_set_options(int hostname_in_open) { have_hostname_in_open = hostname_in_open; @@ -121,7 +121,7 @@ * and the server has no way to know but to trust the client anyway. */ -void +void channel_permit_all_opens() { all_opens_permitted = 1; @@ -150,7 +150,7 @@ * remote_name to be freed. */ -int +int channel_new(char *ctype, int type, int rfd, int wfd, int efd, int window, int maxpack, int extended_usage, char *remote_name) { @@ -226,7 +226,7 @@ debug("channel %d: new [%s]", found, remote_name); return found; } -int +int channel_allocate(int type, int sock, char *remote_name) { return channel_new("", type, sock, sock, -1, 0, 0, 0, remote_name); @@ -234,7 +234,7 @@ /* Free the channel and close its socket. */ -void +void channel_free(int id) { Channel *c = channel_lookup(id); @@ -361,7 +361,7 @@ { if (buffer_len(&c->output) == 0) channel_free(c->self); - else + else FD_SET(c->sock, writeset); } @@ -784,7 +784,7 @@ channel_handler_init_15(); } -void +void channel_handler(chan_fn *ftab[], fd_set * readset, fd_set * writeset) { static int did_init = 0; @@ -806,13 +806,13 @@ } } -void +void channel_prepare_select(fd_set * readset, fd_set * writeset) { channel_handler(channel_pre, readset, writeset); } -void +void channel_after_select(fd_set * readset, fd_set * writeset) { channel_handler(channel_post, readset, writeset); @@ -820,7 +820,7 @@ /* If there is data to send to the connection, send some of it now. */ -void +void channel_output_poll() { int len, i; @@ -911,7 +911,7 @@ * still there. */ -void +void channel_input_data(int type, int plen) { int id; @@ -956,7 +956,7 @@ buffer_append(&c->output, data, data_len); xfree(data); } -void +void channel_input_extended_data(int type, int plen) { int id; @@ -1002,7 +1002,7 @@ * more channel is overfull. */ -int +int channel_not_very_much_buffered_data() { unsigned int i; @@ -1026,7 +1026,7 @@ return 1; } -void +void channel_input_ieof(int type, int plen) { int id; @@ -1041,7 +1041,7 @@ chan_rcvd_ieof(c); } -void +void channel_input_close(int type, int plen) { int id; @@ -1080,7 +1080,7 @@ } /* proto version 1.5 overloads CLOSE_CONFIRMATION with OCLOSE */ -void +void channel_input_oclose(int type, int plen) { int id = packet_get_int(); @@ -1091,7 +1091,7 @@ chan_rcvd_oclose(c); } -void +void channel_input_close_confirmation(int type, int plen) { int id = packet_get_int(); @@ -1107,7 +1107,7 @@ channel_free(c->self); } -void +void channel_input_open_confirmation(int type, int plen) { int id, remote_id; @@ -1141,7 +1141,7 @@ } } -void +void channel_input_open_failure(int type, int plen) { int id; @@ -1194,7 +1194,7 @@ } } -void +void channel_input_window_adjust(int type, int plen) { Channel *c; @@ -1223,7 +1223,7 @@ * might have. */ -void +void channel_stop_listening() { int i; @@ -1250,7 +1250,7 @@ * descriptors after a fork. */ -void +void channel_close_all() { int i; @@ -1262,7 +1262,7 @@ /* Returns the maximum file descriptor number used by the channels. */ -int +int channel_max_fd() { return channel_max_fd_value; @@ -1270,7 +1270,7 @@ /* Returns true if any channel is still open. */ -int +int channel_still_open() { unsigned int i; @@ -1357,7 +1357,7 @@ * channel to host:port from remote side. */ -void +void channel_request_local_forwarding(u_short port, const char *host, u_short host_port, int gateway_ports) { @@ -1441,7 +1441,7 @@ * the secure channel to host:port from local side. */ -void +void channel_request_remote_forwarding(u_short listen_port, const char *host_to_connect, u_short port_to_connect) { @@ -1484,7 +1484,7 @@ * message if there was an error). This never returns if there was an error. */ -void +void channel_input_port_forward_request(int is_root) { u_short port, host_port; @@ -1567,7 +1567,7 @@ * or CHANNEL_OPEN_FAILURE. */ -void +void channel_input_port_open(int type, int plen) { u_short host_port; @@ -1761,7 +1761,7 @@ * with either SSH_MSG_OPEN_CONFIRMATION or SSH_MSG_OPEN_FAILURE. */ -void +void x11_input_open(int type, int plen) { int remote_channel, display_number, sock = 0, newch; @@ -1865,7 +1865,7 @@ } freeaddrinfo(aitop); if (!ai) { - error("connect %.100s port %d: %.100s", buf, 6000 + display_number, + error("connect %.100s port %d: %.100s", buf, 6000 + display_number, strerror(errno)); goto fail; } @@ -1899,7 +1899,7 @@ * data, and enables authentication spoofing. */ -void +void x11_request_forwarding_with_spoofing(const char *proto, const char *data) { unsigned int data_len = (unsigned int) strlen(data) / 2; @@ -1957,7 +1957,7 @@ /* Sends a message to the server to request authentication fd forwarding. */ -void +void auth_request_forwarding() { packet_start(SSH_CMSG_AGENT_REQUEST_FORWARDING); @@ -1979,7 +1979,7 @@ /* removes the agent forwarding socket */ -void +void cleanup_socket(void) { remove(channel_forwarded_auth_socket_name); @@ -1991,7 +1991,7 @@ * This starts forwarding authentication requests. */ -void +void auth_input_request_forwarding(struct passwd * pw) { int sock, newch; @@ -2049,7 +2049,7 @@ /* This is called to process an SSH_SMSG_AGENT_OPEN message. */ -void +void auth_input_open_request(int type, int plen) { int remch, sock, newch;