T45: Support of custom types for channels
Description
Originally reported by migration: https://bugs.libssh.org/T45
Since the SSH (v2 at least, as I don't know v1) protocol allows channel requests with custom type and payload, I was thinking it would be nice to make this available in the public API of libssh.
What do you think?
I guess it would look like:
int ssh//channel//open//custom(ssh//channel channel, ssh//string type, ssh//buffer payload)
Thank you very much.
Comments:
migration commented on 2017-06-19 06:53:14 UTC:
On Monday, February 22nd 2016 07:03:29, Andreas Schneider wrote:
This is already supported, see
http://api.libssh.org/master/group////libssh////channel.html#ga06024b070f9b2a3d6964b79ae36695b7
and the RFCs.
migration commented on 2017-06-19 06:53:14 UTC:
On Monday, February 22nd 2016 21:12:54, Gaetan de Villele wrote:
Thank you for the reply.
I wasn't talking about "subsystems" nor "requests we send inside channels", (5.4. "Channel-Specific Requests" in RFC 4254) I probably should have put more details in my question.
I was talking about the type of a channel itself. (5.1. "Opening a Channel" in RFC 4254) For exemple, for sftp, we have to open a channel of type "session" and then send a request inside this channel to ask the server if it supports the "sftp subsystem"... I would like libssh to allow for channels that are not of type "session" but of an arbitrarily type.
in channels.c the non-exposed function
static int channel//open(ssh//channel channel, const char **type, int window, int maxpacket, ssh//buffer payload)
is called multiple times with hardcoded channel types like "session", "direct-tcpip", "forwarded-tcpip", "x11" ... Basically I am suggesting writing a functionint ssh//channel//open//custom(ssh//channel channel, ssh//string type, ssh//buffer payload)
in addition to the existingint ssh//channel//open//session(ssh//channel channel)
int ssh//channel//open//auth//agent(ssh//channel channel)
int ssh//channel//open//forward(ssh//channel channel, const char **remotehost, int remoteport, const char **sourcehost, int local port)
...Feel free to ask me any question if it is still unclear. Thank you.