~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to channels.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenBSD: channels.h,v 1.88 2006/08/03 03:34:42 deraadt Exp $ */
 
1
/* $OpenBSD: channels.h,v 1.96 2008/06/15 20:06:26 djm Exp $ */
2
2
 
3
3
/*
4
4
 * Author: Tatu Ylonen <ylo@cs.hut.fi>
62
62
 
63
63
typedef void channel_callback_fn(int, void *);
64
64
typedef int channel_infilter_fn(struct Channel *, char *, int);
 
65
typedef void channel_filter_cleanup_fn(int, void *);
65
66
typedef u_char *channel_outfilter_fn(struct Channel *, u_char **, u_int *);
66
67
 
 
68
/* Channel success/failure callbacks */
 
69
typedef void channel_confirm_cb(int, struct Channel *, void *);
 
70
typedef void channel_confirm_abandon_cb(struct Channel *, void *);
 
71
struct channel_confirm {
 
72
        TAILQ_ENTRY(channel_confirm) entry;
 
73
        channel_confirm_cb *cb;
 
74
        channel_confirm_abandon_cb *abandon_cb;
 
75
        void *ctx;
 
76
};
 
77
TAILQ_HEAD(channel_confirms, channel_confirm);
 
78
 
 
79
/* Context for non-blocking connects */
 
80
struct channel_connect {
 
81
        char *host;
 
82
        int port;
 
83
        struct addrinfo *ai, *aitop;
 
84
};
 
85
 
67
86
struct Channel {
68
87
        int     type;           /* channel type/state */
69
88
        int     self;           /* my own channel identifier */
104
123
        char   *ctype;          /* type */
105
124
 
106
125
        /* callback */
107
 
        channel_callback_fn     *confirm;
108
 
        void                    *confirm_ctx;
 
126
        channel_callback_fn     *open_confirm;
 
127
        void                    *open_confirm_ctx;
109
128
        channel_callback_fn     *detach_user;
110
129
        int                     detach_close;
 
130
        struct channel_confirms status_confirms;
111
131
 
112
132
        /* filter */
113
133
        channel_infilter_fn     *input_filter;
114
134
        channel_outfilter_fn    *output_filter;
115
 
 
116
 
        int     datagram;       /* keep boundaries */
 
135
        void                    *filter_ctx;
 
136
        channel_filter_cleanup_fn *filter_cleanup;
 
137
 
 
138
        /* keep boundaries */
 
139
        int                     datagram;
 
140
 
 
141
        /* non-blocking connect */
 
142
        struct channel_connect  connect_ctx;
117
143
};
118
144
 
119
145
#define CHAN_EXTENDED_IGNORE            0
122
148
 
123
149
/* default window/packet sizes for tcp/x11-fwd-channel */
124
150
#define CHAN_SES_PACKET_DEFAULT (32*1024)
125
 
#define CHAN_SES_WINDOW_DEFAULT (4*CHAN_SES_PACKET_DEFAULT)
 
151
#define CHAN_SES_WINDOW_DEFAULT (64*CHAN_SES_PACKET_DEFAULT)
126
152
#define CHAN_TCP_PACKET_DEFAULT (32*1024)
127
 
#define CHAN_TCP_WINDOW_DEFAULT (4*CHAN_TCP_PACKET_DEFAULT)
 
153
#define CHAN_TCP_WINDOW_DEFAULT (64*CHAN_TCP_PACKET_DEFAULT)
128
154
#define CHAN_X11_PACKET_DEFAULT (16*1024)
129
155
#define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT)
130
156
 
162
188
Channel *channel_by_id(int);
163
189
Channel *channel_lookup(int);
164
190
Channel *channel_new(char *, int, int, int, int, u_int, u_int, int, char *, int);
165
 
void     channel_set_fds(int, int, int, int, int, int, u_int);
 
191
void     channel_set_fds(int, int, int, int, int, int, int, u_int);
166
192
void     channel_free(Channel *);
167
193
void     channel_free_all(void);
168
194
void     channel_stop_listening(void);
170
196
void     channel_send_open(int);
171
197
void     channel_request_start(int, char *, int);
172
198
void     channel_register_cleanup(int, channel_callback_fn *, int);
173
 
void     channel_register_confirm(int, channel_callback_fn *, void *);
174
 
void     channel_register_filter(int, channel_infilter_fn *, channel_outfilter_fn *);
 
199
void     channel_register_open_confirm(int, channel_callback_fn *, void *);
 
200
void     channel_register_filter(int, channel_infilter_fn *,
 
201
    channel_outfilter_fn *, channel_filter_cleanup_fn *, void *);
 
202
void     channel_register_status_confirm(int, channel_confirm_cb *,
 
203
    channel_confirm_abandon_cb *, void *);
175
204
void     channel_cancel_cleanup(int);
176
205
int      channel_close_fd(int *);
177
206
void     channel_send_window_changes(void);
188
217
void     channel_input_open_failure(int, u_int32_t, void *);
189
218
void     channel_input_port_open(int, u_int32_t, void *);
190
219
void     channel_input_window_adjust(int, u_int32_t, void *);
 
220
void     channel_input_status_confirm(int, u_int32_t, void *);
191
221
 
192
222
/* file descriptor handling (read/write) */
193
223
 
208
238
int      channel_add_adm_permitted_opens(char *, int);
209
239
void     channel_clear_permitted_opens(void);
210
240
void     channel_clear_adm_permitted_opens(void);
 
241
void     channel_print_adm_permitted_opens(void);
211
242
int      channel_input_port_forward_request(int, int);
212
 
int      channel_connect_to(const char *, u_short);
213
 
int      channel_connect_by_listen_address(u_short);
 
243
Channel *channel_connect_to(const char *, u_short, char *, char *);
 
244
Channel *channel_connect_by_listen_address(u_short, char *, char *);
214
245
int      channel_request_remote_forwarding(const char *, u_short,
215
246
             const char *, u_short);
216
247
int      channel_setup_local_fwd_listener(const char *, u_short,
225
256
int      x11_create_display_inet(int, int, int, u_int *, int **);
226
257
void     x11_input_open(int, u_int32_t, void *);
227
258
void     x11_request_forwarding_with_spoofing(int, const char *, const char *,
228
 
            const char *);
 
259
             const char *);
229
260
void     deny_input_open(int, u_int32_t, void *);
230
261
 
231
262
/* agent forwarding */
240
271
/* channel events */
241
272
 
242
273
void     chan_rcvd_oclose(Channel *);
 
274
void     chan_rcvd_eow(Channel *);      /* SSH2-only */
243
275
void     chan_read_failed(Channel *);
244
276
void     chan_ibuf_empty(Channel *);
245
277