diff options
Diffstat (limited to 'channels.h')
-rw-r--r-- | channels.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/channels.h b/channels.h index 9629124b9..9acdf5810 100644 --- a/channels.h +++ b/channels.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* RCSID("$OpenBSD: channels.h,v 1.14 2000/06/20 01:39:40 markus Exp $"); */ | 1 | /* RCSID("$OpenBSD: channels.h,v 1.16 2000/08/19 21:55:51 markus Exp $"); */ |
2 | 2 | ||
3 | #ifndef CHANNELS_H | 3 | #ifndef CHANNELS_H |
4 | #define CHANNELS_H | 4 | #define CHANNELS_H |
@@ -21,9 +21,13 @@ | |||
21 | * Data structure for channel data. This is iniailized in channel_allocate | 21 | * Data structure for channel data. This is iniailized in channel_allocate |
22 | * and cleared in channel_free. | 22 | * and cleared in channel_free. |
23 | */ | 23 | */ |
24 | struct Channel; | ||
25 | typedef struct Channel Channel; | ||
26 | |||
24 | typedef void channel_callback_fn(int id, void *arg); | 27 | typedef void channel_callback_fn(int id, void *arg); |
28 | typedef int channel_filter_fn(struct Channel *c, char *buf, int len); | ||
25 | 29 | ||
26 | typedef struct Channel { | 30 | struct Channel { |
27 | int type; /* channel type/state */ | 31 | int type; /* channel type/state */ |
28 | int self; /* my own channel identifier */ | 32 | int self; /* my own channel identifier */ |
29 | int remote_id; /* channel identifier for remote peer */ | 33 | int remote_id; /* channel identifier for remote peer */ |
@@ -61,7 +65,10 @@ typedef struct Channel { | |||
61 | void *cb_arg; | 65 | void *cb_arg; |
62 | int cb_event; | 66 | int cb_event; |
63 | channel_callback_fn *dettach_user; | 67 | channel_callback_fn *dettach_user; |
64 | } Channel; | 68 | |
69 | /* filter */ | ||
70 | channel_filter_fn *input_filter; | ||
71 | }; | ||
65 | 72 | ||
66 | #define CHAN_EXTENDED_IGNORE 0 | 73 | #define CHAN_EXTENDED_IGNORE 0 |
67 | #define CHAN_EXTENDED_READ 1 | 74 | #define CHAN_EXTENDED_READ 1 |
@@ -73,6 +80,7 @@ void channel_request(int id, char *service, int wantconfirm); | |||
73 | void channel_request_start(int id, char *service, int wantconfirm); | 80 | void channel_request_start(int id, char *service, int wantconfirm); |
74 | void channel_register_callback(int id, int mtype, channel_callback_fn *fn, void *arg); | 81 | void channel_register_callback(int id, int mtype, channel_callback_fn *fn, void *arg); |
75 | void channel_register_cleanup(int id, channel_callback_fn *fn); | 82 | void channel_register_cleanup(int id, channel_callback_fn *fn); |
83 | void channel_register_filter(int id, channel_filter_fn *fn); | ||
76 | void channel_cancel_cleanup(int id); | 84 | void channel_cancel_cleanup(int id); |
77 | Channel *channel_lookup(int id); | 85 | Channel *channel_lookup(int id); |
78 | 86 | ||