]> andersk Git - openssh.git/blobdiff - channels.h
- (stevesk) [auth1.c] fix password auth for protocol 1 when
[openssh.git] / channels.h
index 9f97488b2c3dc03876b91e8b2484effb969c569b..bd31c455825b8f927906cc496b7e8c87456f529c 100644 (file)
@@ -1,3 +1,5 @@
+/*     $OpenBSD: channels.h,v 1.67 2002/03/26 22:50:39 markus Exp $    */
+
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -10,7 +12,7 @@
  * called by a name other than "ssh" or "Secure Shell".
  */
 /*
- * Copyright (c) 1999, 2000, 2001 Markus Friedl.  All rights reserved.
+ * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,7 +34,6 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/* RCSID("$OpenBSD: channels.h,v 1.58 2002/01/14 13:55:55 markus Exp $"); */
 
 #ifndef CHANNEL_H
 #define CHANNEL_H
@@ -101,9 +102,7 @@ struct Channel {
        char   *ctype;          /* type */
 
        /* callback */
-       channel_callback_fn     *cb_fn;
-       void    *cb_arg;
-       int     cb_event;
+       channel_callback_fn     *confirm;
        channel_callback_fn     *detach_user;
 
        /* filter */
@@ -115,12 +114,12 @@ struct Channel {
 #define CHAN_EXTENDED_WRITE            2
 
 /* default window/packet sizes for tcp/x11-fwd-channel */
-#define CHAN_SES_WINDOW_DEFAULT        (32*1024)
-#define CHAN_SES_PACKET_DEFAULT        (CHAN_SES_WINDOW_DEFAULT/2)
-#define CHAN_TCP_WINDOW_DEFAULT        (32*1024)
-#define CHAN_TCP_PACKET_DEFAULT        (CHAN_TCP_WINDOW_DEFAULT/2)
-#define CHAN_X11_WINDOW_DEFAULT        (4*1024)
-#define CHAN_X11_PACKET_DEFAULT        (CHAN_X11_WINDOW_DEFAULT/2)
+#define CHAN_SES_PACKET_DEFAULT        (32*1024)
+#define CHAN_SES_WINDOW_DEFAULT        (4*CHAN_SES_PACKET_DEFAULT)
+#define CHAN_TCP_PACKET_DEFAULT        (32*1024)
+#define CHAN_TCP_WINDOW_DEFAULT        (4*CHAN_TCP_PACKET_DEFAULT)
+#define CHAN_X11_PACKET_DEFAULT        (16*1024)
+#define CHAN_X11_WINDOW_DEFAULT        (4*CHAN_X11_PACKET_DEFAULT)
 
 /* possible input states */
 #define CHAN_INPUT_OPEN                        0
@@ -136,28 +135,38 @@ struct Channel {
 
 #define CHAN_CLOSE_SENT                        0x01
 #define CHAN_CLOSE_RCVD                        0x02
+#define CHAN_EOF_SENT                  0x04
+#define CHAN_EOF_RCVD                  0x08
+
+/* check whether 'efd' is still in use */
+#define CHANNEL_EFD_INPUT_ACTIVE(c) \
+       (compat20 && c->extended_usage == CHAN_EXTENDED_READ && \
+       (c->efd != -1 || \
+       buffer_len(&c->extended) > 0))
+#define CHANNEL_EFD_OUTPUT_ACTIVE(c) \
+       (compat20 && c->extended_usage == CHAN_EXTENDED_WRITE && \
+       ((c->efd != -1 && !(c->flags & (CHAN_EOF_RCVD|CHAN_CLOSE_RCVD))) || \
+       buffer_len(&c->extended) > 0))
 
 /* channel management */
 
 Channel        *channel_lookup(int);
 Channel *channel_new(char *, int, int, int, int, int, int, int, char *, int);
-void    channel_set_fds(int, int, int, int, int, int);
+void    channel_set_fds(int, int, int, int, int, int, u_int);
 void    channel_free(Channel *);
 void    channel_free_all(void);
 void    channel_stop_listening(void);
 
 void    channel_send_open(int);
-void    channel_request(int, char *, int);
 void    channel_request_start(int, char *, int);
-void    channel_register_callback(int, int mtype, channel_callback_fn *, void *);
 void    channel_register_cleanup(int, channel_callback_fn *);
+void    channel_register_confirm(int, channel_callback_fn *);
 void    channel_register_filter(int, channel_filter_fn *);
 void    channel_cancel_cleanup(int);
 int     channel_close_fd(int *);
 
 /* protocol handler */
 
-void    channel_input_channel_request(int, u_int32_t, void *);
 void    channel_input_close(int, u_int32_t, void *);
 void    channel_input_close_confirmation(int, u_int32_t, void *);
 void    channel_input_data(int, u_int32_t, void *);
@@ -190,10 +199,8 @@ void     channel_input_port_forward_request(int, int);
 int     channel_connect_to(const char *, u_short);
 int     channel_connect_by_listen_address(u_short);
 void    channel_request_remote_forwarding(u_short, const char *, u_short);
-int     channel_request_local_forwarding(u_short, const char *, u_short, int);
-int
-channel_request_forwarding(const char *, u_short, const char *, u_short, int,
-    int);
+int     channel_setup_local_fwd_listener(u_short, const char *, u_short, int);
+int     channel_setup_remote_fwd_listener(const char *, u_short, int);
 
 /* x11 forwarding */
 
This page took 0.035368 seconds and 4 git commands to generate.