Commit 55fa03b9 authored by Niels Möller's avatar Niels Möller
Browse files

Renamed "session" to "channel_table". Added connection_startup type.

Rev: src/channel.h:1.5
parent 5577af83
...@@ -76,10 +76,10 @@ struct ssh_channel ...@@ -76,10 +76,10 @@ struct ssh_channel
((s)->fail((s), (w))) ((s)->fail((s), (w)))
/* FIXME: Perhaps, this information is better kept in the connection /* FIXME: Perhaps, this information is better kept in the connection
* object? In any case, "session" is a bad name, as that name is more * object? */
* relevant for the session channel. */ struct channel_table
struct ssh_session
{ {
struct lsh_object header;
#if 0 #if 0
/* FIXME: This is relevant only for the server side. It's probably /* FIXME: This is relevant only for the server side. It's probably
* better to store this in the connection struct */ * better to store this in the connection struct */
...@@ -139,10 +139,22 @@ struct channel_request ...@@ -139,10 +139,22 @@ struct channel_request
#define CHANNEL_REQUEST(s, c, w, a) \ #define CHANNEL_REQUEST(s, c, w, a) \
((s)->handler((s), (c), (w), (a))) ((s)->handler((s), (c), (w), (a)))
struct ssh_session *make_session(void); struct connection_startup
int alloc_channel(struct ssh_session *session); {
void dealloc_channel(struct ssh_session *session, int i); struct lsh_object header;
struct ssh_channel *lookup_channel(struct ssh_session *session, UINT32 i);
int (*start)(struct connection_startup *closure,
struct channel_table *table,
struct abstract_write *write);
};
#define CONNECTION_START(c, s, w) ((c)->start((c), (s), (w)))
struct channel_table *make_channel_table(void);
int alloc_channel(struct channel_table *table);
void dealloc_channel(struct channel_table *table, int i);
int register_channel(struct channel_table *table, struct ssh_channel *channel);
struct ssh_channel *lookup_channel(struct channel_table *table, UINT32 i);
struct lsh_string *format_global_failure(void); struct lsh_string *format_global_failure(void);
struct lsh_string *format_open_failure(UINT32 channel, UINT32 reason, struct lsh_string *format_open_failure(UINT32 channel, UINT32 reason,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment