Fleshed out server interface

- Enables channel_request_open types of DIRECT_TCPIP, FORWARDED_TCPIP and X11 (ie. implemented the handling of those channel_request_open types).
- Adds functions to retrieve the extra information relating to channel_request_open messages and channel_request messages.
- Adds a channel_write_stderr method (obviously for writing to the STDERR channel from server side) - well, technically just converted the exiting channel_write to take an extra argument and created two wrapper functions.
- Actually does the invoking of message_handle() from channel_recv_request.
- Implemented the handling of the window-change and env channel_requests.
- Implemented a few functions in server.h that were declared but not defined (eg. ssh_message_channel_request_channel).

Signed-off-by: Preston A. Elder <prez@neuromancy.net>
Signed-off-by: Andreas Schneider <mail@cynapses.org>
This commit is contained in:
Preston A. Elder
2009-07-28 10:21:40 -07:00
committed by Andreas Schneider
parent b4111c5c18
commit 4f70cc13e2
4 changed files with 273 additions and 25 deletions

View File

@@ -136,9 +136,10 @@ int ssh_accept(SSH_SESSION *session);
#define SSH_AUTH_UNKNOWN 0
#define SSH_CHANNEL_SESSION 1
#define SSH_CHANNEL_TCPIP 2
#define SSH_CHANNEL_X11 3
#define SSH_CHANNEL_UNKNOWN 4
#define SSH_CHANNEL_DIRECT_TCPIP 2
#define SSH_CHANNEL_FORWARDED_TCPIP 3
#define SSH_CHANNEL_X11 4
#define SSH_CHANNEL_UNKNOWN 5
#define SSH_CHANNEL_REQUEST_PTY 1
#define SSH_CHANNEL_REQUEST_EXEC 2
@@ -165,11 +166,6 @@ int ssh_message_auth_reply_pk_ok(SSH_MESSAGE *msg, ssh_string algo, ssh_string p
int ssh_message_auth_set_methods(SSH_MESSAGE *msg, int methods);
ssh_channel ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg);
ssh_channel ssh_message_channel_request_channel(SSH_MESSAGE *msg);
// returns the TERM env variable
char *ssh_message_channel_request_pty_term(SSH_MESSAGE *msg);
char *ssh_message_channel_request_subsystem(SSH_MESSAGE *msg);
int ssh_message_channel_request_reply_success(SSH_MESSAGE *msg);
int ssh_message_service_reply_success(SSH_MESSAGE *msg);
@@ -177,6 +173,29 @@ char *ssh_message_service_service(SSH_MESSAGE *msg);
void ssh_set_message_callback(SSH_SESSION *session,
int(*ssh_message_callback)(ssh_session session, struct ssh_message *msg));
int channel_write_stderr(ssh_channel channel, const void *data, uint32_t len);
char *ssh_message_channel_request_open_originator(SSH_MESSAGE *msg);
int ssh_message_channel_request_open_originator_port(SSH_MESSAGE *msg);
char *ssh_message_channel_request_open_destination(SSH_MESSAGE *msg);
int ssh_message_channel_request_open_destination_port(SSH_MESSAGE *msg);
ssh_channel ssh_message_channel_request_channel(SSH_MESSAGE *msg);
char *ssh_message_channel_request_pty_term(SSH_MESSAGE *msg);
int ssh_message_channel_request_pty_width(SSH_MESSAGE *msg);
int ssh_message_channel_request_pty_height(SSH_MESSAGE *msg);
int ssh_message_channel_request_pty_pxwidth(SSH_MESSAGE *msg);
int ssh_message_channel_request_pty_pxheight(SSH_MESSAGE *msg);
char *ssh_message_channel_request_env_name(SSH_MESSAGE *msg);
char *ssh_message_channel_request_env_value(SSH_MESSAGE *msg);
char *ssh_message_channel_request_command(SSH_MESSAGE *msg);
char *ssh_message_channel_request_subsystem(SSH_MESSAGE *msg);
#ifdef __cplusplus
}
#endif /* __cplusplus */