Page MenuHomePhabricator

Support of custom types for channels
Open, WishlistPublic

Description

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.

Event Timeline

migration created this object with visibility "Restricted Project (Project)".
migration created this object with edit policy "Restricted Project (Project)".

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.

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 function
int ssh//channel//open//custom(ssh//channel channel, ssh//string type, ssh//buffer payload)
in addition to the existing
int 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.

asn lowered the priority of this task from Normal to Wishlist.Sep 4 2018, 9:38 PM
asn changed the visibility from "Restricted Project (Project)" to "Public (No Login Required)".