*/
#include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.40 2000/11/06 23:04:56 markus Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.45 2001/01/21 19:05:47 markus Exp $");
-#include "xmalloc.h"
#include "ssh.h"
+#include "ssh1.h"
+#include "ssh2.h"
+#include "xmalloc.h"
#include "packet.h"
#include "buffer.h"
-#include "readconf.h"
-
-#include "ssh2.h"
#include "compat.h"
#include "channels.h"
#include "dispatch.h"
-
#include "buffer.h"
#include "bufaux.h"
-
-#include <openssl/dsa.h>
-#include <openssl/rsa.h>
#include "key.h"
+#include "log.h"
+#include "readconf.h"
+#include "clientloop.h"
#include "authfd.h"
+#include "atomicio.h"
/* import options */
extern Options options;
static Buffer stdin_buffer; /* Buffer for stdin data. */
static Buffer stdout_buffer; /* Buffer for stdout data. */
static Buffer stderr_buffer; /* Buffer for stderr data. */
-static unsigned long stdin_bytes, stdout_bytes, stderr_bytes;
-static unsigned int buffer_high;/* Soft max buffer size. */
+static u_long stdin_bytes, stdout_bytes, stderr_bytes;
+static u_int buffer_high;/* Soft max buffer size. */
static int max_fd; /* Maximum file descriptor number in select(). */
static int connection_in; /* Connection to server (input). */
static int connection_out; /* Connection to server (output). */
* and also process it as an escape character if
* appropriate.
*/
- if ((unsigned char) buf[0] == escape_char)
+ if ((u_char) buf[0] == escape_char)
escape_pending = 1;
else {
buffer_append(&stdin_buffer, buf, 1);
void
client_make_packets_from_stdin_data()
{
- unsigned int len;
+ u_int len;
/* Send buffered stdin data to the server. */
while (buffer_len(&stdin_buffer) > 0 &&
char string[1024];
pid_t pid;
int bytes = 0;
- unsigned int i;
- unsigned char ch;
+ u_int i;
+ u_char ch;
char *s;
for (i = 0; i < len; i++) {
void
client_input_stdout_data(int type, int plen, void *ctxt)
{
- unsigned int data_len;
+ u_int data_len;
char *data = packet_get_string(&data_len);
packet_integrity_check(plen, 4 + data_len, type);
buffer_append(&stdout_buffer, data, data_len);
void
client_input_stderr_data(int type, int plen, void *ctxt)
{
- unsigned int data_len;
+ u_int data_len;
char *data = packet_get_string(&data_len);
packet_integrity_check(plen, 4 + data_len, type);
buffer_append(&stderr_buffer, data, data_len);
sock = channel_connect_by_listen_adress(listen_port);
if (sock >= 0) {
newch = channel_new("forwarded-tcpip",
- SSH_CHANNEL_OPEN, sock, sock, -1,
+ SSH_CHANNEL_CONNECTING, sock, sock, -1,
CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,
xstrdup(originator_address), 1);
c = channel_lookup(newch);
{
Channel *c = NULL;
char *ctype;
- unsigned int len;
+ u_int len;
int rchan;
int rmaxpack;
int rwindow;
client_input_channel_req(int id, void *arg)
{
Channel *c = NULL;
- unsigned int len;
+ u_int len;
int success = 0;
int reply;
char *rtype;
}
void
-client_set_session_ident(int id)
+clientloop_set_session_ident(int id)
{
- debug2("client_set_session_ident: id %d", id);
+ debug2("clientloop_set_session_ident: id %d", id);
session_ident = id;
channel_register_callback(id, SSH2_MSG_CHANNEL_REQUEST,
client_input_channel_req, (void *)0);