diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2013-02-11 21:35:16 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-13 14:00:18 +0200 |
commit | 6bc64c368d49d2c775fa4a0e94dc65fcee746710 (patch) | |
tree | 43be9d404624665a0024c5933299cbd87984a040 /include/libssh/callbacks.h | |
parent | ab2e641b4a68e31390510f020d939107bef53b37 (diff) | |
download | libssh-6bc64c368d49d2c775fa4a0e94dc65fcee746710.tar.gz libssh-6bc64c368d49d2c775fa4a0e94dc65fcee746710.tar.xz libssh-6bc64c368d49d2c775fa4a0e94dc65fcee746710.zip |
server: added channel callbacks
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh/callbacks.h')
-rw-r--r-- | include/libssh/callbacks.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/libssh/callbacks.h b/include/libssh/callbacks.h index 6dd90a8..4593520 100644 --- a/include/libssh/callbacks.h +++ b/include/libssh/callbacks.h @@ -439,6 +439,34 @@ typedef void (*ssh_channel_exit_signal_callback) (ssh_session session, const char *lang, void *userdata); +/** + * @brief SSH channel PTY request from a client. + * @param channel the channel + * @param width width of the terminal, in characters + * @param height height of the terminal, in characters + * @param pxwidth width of the terminal, in pixels + * @param pxheight height of the terminal, in pixels + * @param userdata Userdata to be passed to the callback function. + * @returns 0 if the pty request is accepted + * @returns -1 if the request is denied + */ +typedef int (*ssh_channel_pty_request_callback) (ssh_session session, + ssh_channel channel, + const char *term, + int width, int height, + int pxwidth, int pwheight, + void *userdata); + +/** + * @brief SSH channel Shell request from a client. + * @param channel the channel + * @param userdata Userdata to be passed to the callback function. + * @returns 0 if the pty request is accepted + * @returns 1 if the request is denied + */ +typedef int (*ssh_channel_shell_request_callback) (ssh_session session, + ssh_channel channel, + void *userdata); struct ssh_channel_callbacks_struct { /** DON'T SET THIS use ssh_callbacks_init() instead. */ size_t size; @@ -470,6 +498,14 @@ struct ssh_channel_callbacks_struct { * This functions will be called when an exit signal has been received */ ssh_channel_exit_signal_callback channel_exit_signal_function; + /** + * This function will be called when a client requests a PTY + */ + ssh_channel_pty_request_callback channel_pty_request_function; + /** + * This function will be called when a client requests a shell + */ + ssh_channel_shell_request_callback channel_shell_request_function; }; typedef struct ssh_channel_callbacks_struct *ssh_channel_callbacks; |