clientloop.h revision 162852
1162852Sdes/* $OpenBSD: clientloop.h,v 1.16 2006/03/25 22:22:42 djm Exp $ */
276259Sgreen
376259Sgreen/*
476259Sgreen * Author: Tatu Ylonen <ylo@cs.hut.fi>
576259Sgreen * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
676259Sgreen *                    All rights reserved
776259Sgreen *
876259Sgreen * As far as I am concerned, the code I have written for this software
976259Sgreen * can be used freely for any purpose.  Any derived versions of this
1076259Sgreen * software must be clearly marked as such, and if the derived work is
1176259Sgreen * incompatible with the protocol description in the RFC file, it must be
1276259Sgreen * called by a name other than "ssh" or "Secure Shell".
1376259Sgreen */
1476259Sgreen/*
1576259Sgreen * Copyright (c) 2001 Markus Friedl.  All rights reserved.
1676259Sgreen *
1776259Sgreen * Redistribution and use in source and binary forms, with or without
1876259Sgreen * modification, are permitted provided that the following conditions
1976259Sgreen * are met:
2076259Sgreen * 1. Redistributions of source code must retain the above copyright
2176259Sgreen *    notice, this list of conditions and the following disclaimer.
2276259Sgreen * 2. Redistributions in binary form must reproduce the above copyright
2376259Sgreen *    notice, this list of conditions and the following disclaimer in the
2476259Sgreen *    documentation and/or other materials provided with the distribution.
2576259Sgreen *
2676259Sgreen * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2776259Sgreen * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2876259Sgreen * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2976259Sgreen * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3076259Sgreen * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3176259Sgreen * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3276259Sgreen * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3376259Sgreen * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3476259Sgreen * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3576259Sgreen * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3676259Sgreen */
3776259Sgreen
38162852Sdes#include <termios.h>
39162852Sdes
4076259Sgreen/* Client side main loop for the interactive session. */
4192555Sdesint	 client_loop(int, int, int);
42149749Sdesvoid	 client_x11_get_proto(const char *, const char *, u_int,
43149749Sdes	    char **, char **);
44126274Sdesvoid	 client_global_request_reply_fwd(int, u_int32_t, void *);
45137015Sdesvoid	 client_session2_setup(int, int, int, const char *, struct termios *,
46137015Sdes	    int, Buffer *, char **, dispatch_fn *);
47146998Sdes
48149749Sdes/* Multiplexing protocol version */
49149749Sdes#define SSHMUX_VER			1
50149749Sdes
51146998Sdes/* Multiplexing control protocol flags */
52146998Sdes#define SSHMUX_COMMAND_OPEN		1	/* Open new connection */
53146998Sdes#define SSHMUX_COMMAND_ALIVE_CHECK	2	/* Check master is alive */
54146998Sdes#define SSHMUX_COMMAND_TERMINATE	3	/* Ask master to exit */
55146998Sdes
56146998Sdes#define SSHMUX_FLAG_TTY			(1)	/* Request tty on open */
57146998Sdes#define SSHMUX_FLAG_SUBSYS		(1<<1)	/* Subsystem request on open */
58149749Sdes#define SSHMUX_FLAG_X11_FWD		(1<<2)	/* Request X11 forwarding */
59149749Sdes#define SSHMUX_FLAG_AGENT_FWD		(1<<3)	/* Request agent forwarding */
60