version 1.76.2.2, 2006/02/03 02:53:44 |
version 1.77, 2005/06/16 03:38:36 |
|
|
typedef struct Channel Channel; |
typedef struct Channel Channel; |
|
|
typedef void channel_callback_fn(int, void *); |
typedef void channel_callback_fn(int, void *); |
typedef int channel_infilter_fn(struct Channel *, char *, int); |
typedef int channel_filter_fn(struct Channel *, char *, int); |
typedef u_char *channel_outfilter_fn(struct Channel *, u_char **, u_int *); |
|
|
|
struct Channel { |
struct Channel { |
int type; /* channel type/state */ |
int type; /* channel type/state */ |
|
|
|
|
/* callback */ |
/* callback */ |
channel_callback_fn *confirm; |
channel_callback_fn *confirm; |
void *confirm_ctx; |
|
channel_callback_fn *detach_user; |
channel_callback_fn *detach_user; |
int detach_close; |
void *confirm_ctx; |
|
|
/* filter */ |
/* filter */ |
channel_infilter_fn *input_filter; |
channel_filter_fn *input_filter; |
channel_outfilter_fn *output_filter; |
|
|
|
int datagram; /* keep boundaries */ |
|
}; |
}; |
|
|
#define CHAN_EXTENDED_IGNORE 0 |
#define CHAN_EXTENDED_IGNORE 0 |
|
|
#define CHAN_EOF_SENT 0x04 |
#define CHAN_EOF_SENT 0x04 |
#define CHAN_EOF_RCVD 0x08 |
#define CHAN_EOF_RCVD 0x08 |
|
|
#define CHAN_RBUF 16*1024 |
|
|
|
/* check whether 'efd' is still in use */ |
/* check whether 'efd' is still in use */ |
#define CHANNEL_EFD_INPUT_ACTIVE(c) \ |
#define CHANNEL_EFD_INPUT_ACTIVE(c) \ |
(compat20 && c->extended_usage == CHAN_EXTENDED_READ && \ |
(compat20 && c->extended_usage == CHAN_EXTENDED_READ && \ |
|
|
buffer_len(&c->extended) > 0)) |
buffer_len(&c->extended) > 0)) |
#define CHANNEL_EFD_OUTPUT_ACTIVE(c) \ |
#define CHANNEL_EFD_OUTPUT_ACTIVE(c) \ |
(compat20 && c->extended_usage == CHAN_EXTENDED_WRITE && \ |
(compat20 && c->extended_usage == CHAN_EXTENDED_WRITE && \ |
c->efd != -1 && (!(c->flags & (CHAN_EOF_RCVD|CHAN_CLOSE_RCVD)) || \ |
((c->efd != -1 && !(c->flags & (CHAN_EOF_RCVD|CHAN_CLOSE_RCVD))) || \ |
buffer_len(&c->extended) > 0)) |
buffer_len(&c->extended) > 0)) |
|
|
/* channel management */ |
/* channel management */ |
|
|
Channel *channel_by_id(int); |
|
Channel *channel_lookup(int); |
Channel *channel_lookup(int); |
Channel *channel_new(char *, int, int, int, int, u_int, u_int, int, char *, 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, u_int); |
|
|
|
|
void channel_send_open(int); |
void channel_send_open(int); |
void channel_request_start(int, char *, int); |
void channel_request_start(int, char *, int); |
void channel_register_cleanup(int, channel_callback_fn *, int); |
void channel_register_cleanup(int, channel_callback_fn *); |
void channel_register_confirm(int, channel_callback_fn *, void *); |
void channel_register_confirm(int, channel_callback_fn *, void *); |
void channel_register_filter(int, channel_infilter_fn *, channel_outfilter_fn *); |
void channel_register_filter(int, channel_filter_fn *); |
void channel_cancel_cleanup(int); |
void channel_cancel_cleanup(int); |
int channel_close_fd(int *); |
int channel_close_fd(int *); |
void channel_send_window_changes(void); |
void channel_send_window_changes(void); |
|
|
/* x11 forwarding */ |
/* x11 forwarding */ |
|
|
int x11_connect_display(void); |
int x11_connect_display(void); |
int x11_create_display_inet(int, int, int, u_int *, int **); |
int x11_create_display_inet(int, int, int, u_int *); |
void x11_input_open(int, u_int32_t, void *); |
void x11_input_open(int, u_int32_t, void *); |
void x11_request_forwarding_with_spoofing(int, const char *, const char *, |
void x11_request_forwarding_with_spoofing(int, const char *, const char *, |
const char *); |
const char *); |