version 1.79.2.2, 2006/10/06 03:19:32 |
version 1.80, 2005/10/10 10:23:08 |
|
|
/* $OpenBSD$ */ |
/* $OpenBSD$ */ |
|
|
/* |
/* |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
|
|
#ifndef CHANNEL_H |
#ifndef CHANNEL_H |
#define CHANNEL_H |
#define CHANNEL_H |
|
|
|
#include "buffer.h" |
|
|
/* Definitions for channel types. */ |
/* Definitions for channel types. */ |
#define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */ |
#define SSH_CHANNEL_X11_LISTENER 1 /* Listening for inet X11 conn. */ |
#define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */ |
#define SSH_CHANNEL_PORT_LISTENER 2 /* Listening on a port. */ |
|
|
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 */ |
|
|
int detach_close; |
int detach_close; |
|
|
/* 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 && \ |
|
|
|
|
/* 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_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 *, int); |
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); |
|
|
void channel_set_af(int af); |
void channel_set_af(int af); |
void channel_permit_all_opens(void); |
void channel_permit_all_opens(void); |
void channel_add_permitted_opens(char *, int); |
void channel_add_permitted_opens(char *, int); |
int channel_add_adm_permitted_opens(char *, int); |
|
void channel_clear_permitted_opens(void); |
void channel_clear_permitted_opens(void); |
void channel_clear_adm_permitted_opens(void); |
void channel_input_port_forward_request(int, int); |
int channel_input_port_forward_request(int, int); |
|
int channel_connect_to(const char *, u_short); |
int channel_connect_to(const char *, u_short); |
int channel_connect_by_listen_address(u_short); |
int channel_connect_by_listen_address(u_short); |
int channel_request_remote_forwarding(const char *, u_short, |
void channel_request_remote_forwarding(const char *, u_short, |
const char *, u_short); |
const char *, u_short); |
int channel_setup_local_fwd_listener(const char *, u_short, |
int channel_setup_local_fwd_listener(const char *, u_short, |
const char *, u_short, int); |
const char *, u_short, int); |