xref: /netbsd-src/crypto/external/bsd/openssh/dist/clientloop.h (revision c2f76ff004a2cb67efe5b12d97bd3ef7fe89e18d)
1 /*	$NetBSD: clientloop.h,v 1.3 2010/11/21 18:29:48 adam Exp $	*/
2 /* $OpenBSD: clientloop.h,v 1.25 2010/06/25 23:15:36 djm Exp $ */
3 
4 /*
5  * Author: Tatu Ylonen <ylo@cs.hut.fi>
6  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
7  *                    All rights reserved
8  *
9  * As far as I am concerned, the code I have written for this software
10  * can be used freely for any purpose.  Any derived versions of this
11  * software must be clearly marked as such, and if the derived work is
12  * incompatible with the protocol description in the RFC file, it must be
13  * called by a name other than "ssh" or "Secure Shell".
14  */
15 /*
16  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions
20  * are met:
21  * 1. Redistributions of source code must retain the above copyright
22  *    notice, this list of conditions and the following disclaimer.
23  * 2. Redistributions in binary form must reproduce the above copyright
24  *    notice, this list of conditions and the following disclaimer in the
25  *    documentation and/or other materials provided with the distribution.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
28  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
31  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37  */
38 
39 #include <termios.h>
40 
41 /* Client side main loop for the interactive session. */
42 int	 client_loop(int, int, int);
43 void	 client_x11_get_proto(const char *, const char *, u_int, u_int,
44 	    char **, char **);
45 void	 client_global_request_reply_fwd(int, u_int32_t, void *);
46 void	 client_session2_setup(int, int, int, const char *, struct termios *,
47 	    int, Buffer *, char **);
48 int	 client_request_tun_fwd(int, int, int);
49 
50 /* Escape filter for protocol 2 sessions */
51 void	*client_new_escape_filter_ctx(int);
52 void	 client_filter_cleanup(int, void *);
53 int	 client_simple_escape_filter(Channel *, char *, int);
54 
55 /* Global request confirmation callbacks */
56 typedef void global_confirm_cb(int, u_int32_t seq, void *);
57 void	 client_register_global_confirm(global_confirm_cb *, void *);
58 
59 /* Multiplexing protocol version */
60 #define SSHMUX_VER			4
61 
62 /* Multiplexing control protocol flags */
63 #define SSHMUX_COMMAND_OPEN		1	/* Open new connection */
64 #define SSHMUX_COMMAND_ALIVE_CHECK	2	/* Check master is alive */
65 #define SSHMUX_COMMAND_TERMINATE	3	/* Ask master to exit */
66 #define SSHMUX_COMMAND_STDIO_FWD	4	/* Open stdio fwd (ssh -W) */
67 #define SSHMUX_COMMAND_FORWARD		5	/* Forward only, no command */
68 
69 void	muxserver_listen(void);
70 void	muxclient(const char *);
71 void	mux_exit_message(Channel *, int);
72