]> andersk Git - openssh.git/blobdiff - channels.h
- (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c]
[openssh.git] / channels.h
index 46cde0309a60223c173fe09e75f3c57b5a9e9b90..4dbeeb6e158e43aca83cad5081aeaa3f6e98427b 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.h,v 1.90 2008/05/08 12:02:23 djm Exp $ */
+/* $OpenBSD: channels.h,v 1.100 2009/11/11 21:37:03 markus Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
 #define SSH_CHANNEL_ZOMBIE             14      /* Almost dead. */
 #define SSH_CHANNEL_MAX_TYPE           15
 
-#define SSH_CHANNEL_PATH_LEN           256
-
 struct Channel;
 typedef struct Channel Channel;
 
 typedef void channel_callback_fn(int, void *);
 typedef int channel_infilter_fn(struct Channel *, char *, int);
+typedef void channel_filter_cleanup_fn(int, void *);
 typedef u_char *channel_outfilter_fn(struct Channel *, u_char **, u_int *);
 
 /* Channel success/failure callbacks */
@@ -75,6 +74,13 @@ struct channel_confirm {
 };
 TAILQ_HEAD(channel_confirms, channel_confirm);
 
+/* Context for non-blocking connects */
+struct channel_connect {
+       char *host;
+       int port;
+       struct addrinfo *ai, *aitop;
+};
+
 struct Channel {
        int     type;           /* channel type/state */
        int     self;           /* my own channel identifier */
@@ -91,13 +97,17 @@ struct Channel {
        int     wfd_isatty;     /* wfd is a tty */
        int     client_tty;     /* (client) TTY has been requested */
        int     force_drain;    /* force close on iEOF */
-       int     delayed;                /* fdset hack */
+       int     delayed;        /* post-select handlers for newly created
+                                * channels are delayed until the first call
+                                * to a matching pre-select handler. 
+                                * this way post-select handlers are not
+                                * accidenly called if a FD gets reused */
        Buffer  input;          /* data read from socket, to be sent over
                                 * encrypted connection */
        Buffer  output;         /* data received over encrypted connection for
                                 * send on socket */
        Buffer  extended;
-       char    path[SSH_CHANNEL_PATH_LEN];
+       char    *path;
                /* path for unix domain sockets, or host name for forwards */
        int     listening_port; /* port being listened for forwards */
        int     host_port;      /* remote port to connect for forwards */
@@ -124,8 +134,14 @@ struct Channel {
        /* filter */
        channel_infilter_fn     *input_filter;
        channel_outfilter_fn    *output_filter;
+       void                    *filter_ctx;
+       channel_filter_cleanup_fn *filter_cleanup;
+
+       /* keep boundaries */
+       int                     datagram;
 
-       int     datagram;       /* keep boundaries */
+       /* non-blocking connect */
+       struct channel_connect  connect_ctx;
 };
 
 #define CHAN_EXTENDED_IGNORE           0
@@ -174,7 +190,7 @@ struct Channel {
 Channel        *channel_by_id(int);
 Channel        *channel_lookup(int);
 Channel *channel_new(char *, int, int, int, int, u_int, u_int, int, char *, int);
-void    channel_set_fds(int, int, int, int, int, int, u_int);
+void    channel_set_fds(int, int, int, int, int, int, int, u_int);
 void    channel_free(Channel *);
 void    channel_free_all(void);
 void    channel_stop_listening(void);
@@ -184,7 +200,7 @@ void         channel_request_start(int, char *, int);
 void    channel_register_cleanup(int, channel_callback_fn *, int);
 void    channel_register_open_confirm(int, channel_callback_fn *, void *);
 void    channel_register_filter(int, channel_infilter_fn *,
-    channel_outfilter_fn *);
+    channel_outfilter_fn *, channel_filter_cleanup_fn *, void *);
 void    channel_register_status_confirm(int, channel_confirm_cb *,
     channel_confirm_abandon_cb *, void *);
 void    channel_cancel_cleanup(int);
@@ -219,20 +235,22 @@ int        channel_find_open(void);
 
 /* tcp forwarding */
 void    channel_set_af(int af);
+void    channel_set_rdomain(int);
 void     channel_permit_all_opens(void);
 void    channel_add_permitted_opens(char *, int);
 int     channel_add_adm_permitted_opens(char *, int);
 void    channel_clear_permitted_opens(void);
 void    channel_clear_adm_permitted_opens(void);
+void    channel_print_adm_permitted_opens(void);
 int      channel_input_port_forward_request(int, int);
-int     channel_connect_to(const char *, u_short);
-int     channel_connect_by_listen_address(u_short);
+Channel        *channel_connect_to(const char *, u_short, char *, char *);
+Channel        *channel_connect_by_listen_address(u_short, char *, char *);
 int     channel_request_remote_forwarding(const char *, u_short,
             const char *, u_short);
 int     channel_setup_local_fwd_listener(const char *, u_short,
             const char *, u_short, int);
 void    channel_request_rforward_cancel(const char *host, u_short port);
-int     channel_setup_remote_fwd_listener(const char *, u_short, int);
+int     channel_setup_remote_fwd_listener(const char *, u_short, int *, int);
 int     channel_cancel_rport_listener(const char *, u_short);
 
 /* x11 forwarding */
@@ -241,7 +259,7 @@ int  x11_connect_display(void);
 int     x11_create_display_inet(int, int, int, u_int *, int **);
 void     x11_input_open(int, u_int32_t, void *);
 void    x11_request_forwarding_with_spoofing(int, const char *, const char *,
-           const char *);
+            const char *);
 void    deny_input_open(int, u_int32_t, void *);
 
 /* agent forwarding */
@@ -256,6 +274,7 @@ void         chan_mark_dead(Channel *);
 /* channel events */
 
 void    chan_rcvd_oclose(Channel *);
+void    chan_rcvd_eow(Channel *);      /* SSH2-only */
 void    chan_read_failed(Channel *);
 void    chan_ibuf_empty(Channel *);
 
This page took 0.048223 seconds and 4 git commands to generate.