Commit 18a45a98 authored by Pontus Freyhult's avatar Pontus Freyhult
Browse files

(init_login_service): New function to setup a

login service.
(login_service_command): Command to setup a connection for login
service.

Rev: src/channel.c:1.116
parent 922ec9fe
......@@ -1695,7 +1695,7 @@ init_connection_service(struct ssh_connection *connection)
connection->dispatch[SSH_MSG_REQUEST_FAILURE]
= &global_failure_handler;
}
DEFINE_COMMAND(connection_service_command)
(struct command *s UNUSED,
struct lsh_object *a,
......@@ -1709,6 +1709,68 @@ DEFINE_COMMAND(connection_service_command)
COMMAND_RETURN(c, connection);
}
void
init_login_service(struct ssh_connection *connection)
{
struct channel_table *table = make_channel_table();
debug("channel.c: do_connection_service\n");
connection->table = table;
/* Cancel handshake timeout */
connection_clear_timeout(connection);
/* Unfreeze channels after key exchange */
connection_after_keyexchange(connection, &channels_after_keyexchange);
connection->dispatch[SSH_MSG_CHANNEL_OPEN]
= &channel_open_handler;
connection->dispatch[SSH_MSG_CHANNEL_REQUEST]
= &channel_request_handler;
connection->dispatch[SSH_MSG_CHANNEL_WINDOW_ADJUST]
= &window_adjust_handler;
connection->dispatch[SSH_MSG_CHANNEL_DATA]
= &channel_data_handler;
connection->dispatch[SSH_MSG_CHANNEL_EXTENDED_DATA]
= &channel_extended_data_handler;
connection->dispatch[SSH_MSG_CHANNEL_EOF]
= &channel_eof_handler;
connection->dispatch[SSH_MSG_CHANNEL_CLOSE]
= &channel_close_handler;
connection->dispatch[SSH_MSG_CHANNEL_OPEN_CONFIRMATION]
= &channel_open_confirm_handler;
connection->dispatch[SSH_MSG_CHANNEL_OPEN_FAILURE]
= &channel_open_failure_handler;
connection->dispatch[SSH_MSG_CHANNEL_SUCCESS]
= &channel_success_handler;
connection->dispatch[SSH_MSG_CHANNEL_FAILURE]
= &channel_failure_handler;
connection->dispatch[SSH_MSG_REQUEST_SUCCESS]
= &global_success_handler;
connection->dispatch[SSH_MSG_REQUEST_FAILURE]
= &global_failure_handler;
}
DEFINE_COMMAND(login_service_command)
(struct command *s UNUSED,
struct lsh_object *a,
struct command_continuation *c,
struct exception_handler *e UNUSED)
{
CAST(ssh_connection, connection, a);
init_login_service(connection);
COMMAND_RETURN(c, connection);
}
struct lsh_string *
format_channel_close(struct ssh_channel *channel)
{
......
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