diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2013-04-02 22:00:06 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-13 14:57:13 +0200 |
commit | 3e7bd72f76b1b54831b5c1957e3d7d8fafe19663 (patch) | |
tree | 53648c1313282ecc0d030a79483b997cc39ea2c3 /include | |
parent | f457080d62b41826cccddbf86661b4396e297d5f (diff) | |
download | libssh-3e7bd72f76b1b54831b5c1957e3d7d8fafe19663.tar.gz libssh-3e7bd72f76b1b54831b5c1957e3d7d8fafe19663.tar.xz libssh-3e7bd72f76b1b54831b5c1957e3d7d8fafe19663.zip |
client: handle x11 channel open requests with callbacks
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libssh/callbacks.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/libssh/callbacks.h b/include/libssh/callbacks.h index 0bcadc80..8804370b 100644 --- a/include/libssh/callbacks.h +++ b/include/libssh/callbacks.h @@ -95,6 +95,19 @@ typedef void (*ssh_global_request_callback) (ssh_session session, ssh_message message, void *userdata); /** + * @brief Handles an SSH new channel open X11 request. This happens when the server + * sends back an X11 connection attempt. This is a client-side API + * @param session current session handler + * @param userdata Userdata to be passed to the callback function. + * @returns a valid ssh_channel handle if the request is to be allowed + * @returns NULL if the request should not be allowed + * @warning The channel pointer returned by this callback must be closed by the application. + */ +typedef ssh_channel (*ssh_channel_open_request_x11_callback) (ssh_session session, + const char * originator_address, int originator_port, void *userdata); + + +/** * The structure to replace libssh functions with appropriate callbacks. */ struct ssh_callbacks_struct { @@ -121,6 +134,10 @@ struct ssh_callbacks_struct { * This function will be called each time a global request is received. */ ssh_global_request_callback global_request_function; + /** This function will be called when an incoming X11 request is received. + */ + ssh_channel_open_request_x11_callback channel_open_request_x11_function; + }; typedef struct ssh_callbacks_struct *ssh_callbacks; @@ -185,7 +202,6 @@ typedef int (*ssh_service_request_callback) (ssh_session session, const char *se */ typedef ssh_channel (*ssh_channel_open_request_session_callback) (ssh_session session, void *userdata); - /** * This structure can be used to implement a libssh server, with appropriate callbacks. */ |