Libssh2 channel open ex

From Libssh2

LIBSSH2_CHANNEL *libssh2_channel_open_ex(LIBSSH2_SESSION *session,
                         const char *channel_type, int channel_type_len, 
                         int window_size, int packet_size,
                         const char *message, int message_len);
#define libssh2_channel_open_session(session) \
        libssh2_channel_open_ex((session), "session", sizeof("session") - 1, \
        LIBSSH2_CHANNEL_WINDOW_DEFAULT, LIBSSH2_CHANNEL_PACKET_DEFAULT, NULL, 0)

About

Allocate a new channel for exchanging data with the server. This method is typically called through its macroized form: libssh2_channel_open_session() or via libssh2_channel_direct_tcpip() or libssh2_channel_forward_listen().

Parameters

  • session
    Session instance as returned by libssh2_session_init().
  • channel_type
    Channel type to open. Typically one of session, direct-tcpip, or tcpip-forward. The SSH2 protocol allowed for additional types including local, custom channel types.
  • channel_type_len
    Length of channel_type
  • window_size
    Maximum amount of unacknowledged data remote host is allowed to send before receiving an SSH_MSG_CHANNEL_WINDOW_ADJUST packet.
  • packet_size
    Maximum number of bytes remote host is allowed to send in a single SSH_MSG_CHANNEL_DATA or SSG_MSG_CHANNEL_EXTENDED_DATA packet.
  • message
    Additional data as required by the selected channel_type.
  • message_len
    Length of message parameter.

Returns

  • On Success
    Newly allocated Channel instance.
  • On Failure
    NULL