clientloop.h revision 226046
111894Speter/* $OpenBSD: clientloop.h,v 1.28 2011/06/22 22:08:42 djm Exp $ */ 29Sjkh 311894Speter/* 411894Speter * Author: Tatu Ylonen <ylo@cs.hut.fi> 59Sjkh * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 69Sjkh * All rights reserved 79Sjkh * 89Sjkh * As far as I am concerned, the code I have written for this software 99Sjkh * can be used freely for any purpose. Any derived versions of this 109Sjkh * software must be clearly marked as such, and if the derived work is 119Sjkh * incompatible with the protocol description in the RFC file, it must be 129Sjkh * called by a name other than "ssh" or "Secure Shell". 139Sjkh */ 149Sjkh/* 159Sjkh * Copyright (c) 2001 Markus Friedl. All rights reserved. 169Sjkh * 179Sjkh * Redistribution and use in source and binary forms, with or without 189Sjkh * modification, are permitted provided that the following conditions 199Sjkh * are met: 2011894Speter * 1. Redistributions of source code must retain the above copyright 2111894Speter * notice, this list of conditions and the following disclaimer. 2211894Speter * 2. Redistributions in binary form must reproduce the above copyright 239Sjkh * notice, this list of conditions and the following disclaimer in the 249Sjkh * documentation and/or other materials provided with the distribution. 259Sjkh * 269Sjkh * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 279Sjkh * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 289Sjkh * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 299Sjkh * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 3011894Speter * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 3111894Speter * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3211894Speter * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 338858Srgrimes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3411894Speter * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 3511894Speter * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3611894Speter */ 3711894Speter 3811894Speter#include <termios.h> 3911894Speter 4011894Speter/* Client side main loop for the interactive session. */ 4111894Speterint client_loop(int, int, int); 4211894Spetervoid client_x11_get_proto(const char *, const char *, u_int, u_int, 4311894Speter char **, char **); 4411894Spetervoid client_global_request_reply_fwd(int, u_int32_t, void *); 4511894Spetervoid client_session2_setup(int, int, int, const char *, struct termios *, 4611894Speter int, Buffer *, char **); 4711894Speterint client_request_tun_fwd(int, int, int); 4811894Spetervoid client_stop_mux(void); 4911894Speter 5011894Speter/* Escape filter for protocol 2 sessions */ 5111894Spetervoid *client_new_escape_filter_ctx(int); 5211894Spetervoid client_filter_cleanup(int, void *); 5311894Speterint client_simple_escape_filter(Channel *, char *, int); 5411894Speter 5511894Speter/* Global request confirmation callbacks */ 5611894Spetertypedef void global_confirm_cb(int, u_int32_t seq, void *); 579Sjkhvoid client_register_global_confirm(global_confirm_cb *, void *); 589Sjkh 599Sjkh/* Channel request confirmation callbacks */ 609Sjkhenum confirm_action { CONFIRM_WARN = 0, CONFIRM_CLOSE, CONFIRM_TTY }; 619Sjkhvoid client_expect_confirm(int, const char *, enum confirm_action); 629Sjkh 639Sjkh/* Multiplexing protocol version */ 649Sjkh#define SSHMUX_VER 4 659Sjkh 669Sjkh/* Multiplexing control protocol flags */ 679Sjkh#define SSHMUX_COMMAND_OPEN 1 /* Open new connection */ 689Sjkh#define SSHMUX_COMMAND_ALIVE_CHECK 2 /* Check master is alive */ 699Sjkh#define SSHMUX_COMMAND_TERMINATE 3 /* Ask master to exit */ 709Sjkh#define SSHMUX_COMMAND_STDIO_FWD 4 /* Open stdio fwd (ssh -W) */ 719Sjkh#define SSHMUX_COMMAND_FORWARD 5 /* Forward only, no command */ 729Sjkh#define SSHMUX_COMMAND_STOP 6 /* Disable mux but not conn */ 739Sjkh 749Sjkhvoid muxserver_listen(void); 759Sjkhvoid muxclient(const char *); 769Sjkhvoid mux_exit_message(Channel *, int); 779Sjkhvoid mux_tty_alloc_failed(Channel *); 789Sjkh 799Sjkh