23 #include "libssh/priv.h"
29 enum ssh_channel_request_state_e {
31 SSH_CHANNEL_REQ_STATE_NONE = 0,
33 SSH_CHANNEL_REQ_STATE_PENDING,
35 SSH_CHANNEL_REQ_STATE_ACCEPTED,
37 SSH_CHANNEL_REQ_STATE_DENIED,
39 SSH_CHANNEL_REQ_STATE_ERROR
42 enum ssh_channel_state_e {
43 SSH_CHANNEL_STATE_NOT_OPEN = 0,
44 SSH_CHANNEL_STATE_OPENING,
45 SSH_CHANNEL_STATE_OPEN_DENIED,
46 SSH_CHANNEL_STATE_OPEN,
47 SSH_CHANNEL_STATE_CLOSED
51 #define SSH_CHANNEL_FLAG_CLOSED_REMOTE 0x1
53 #define SSH_CHANNEL_FLAG_FREED_LOCAL 0x2
55 #define SSH_CHANNEL_FLAG_NOT_BOUND 0x4
57 struct ssh_channel_struct {
59 uint32_t local_channel;
60 uint32_t local_window;
62 uint32_t local_maxpacket;
64 uint32_t remote_channel;
65 uint32_t remote_window;
67 uint32_t remote_maxpacket;
68 enum ssh_channel_state_e state;
71 ssh_buffer stdout_buffer;
72 ssh_buffer stderr_buffer;
76 enum ssh_channel_request_state_e request_state;
77 ssh_channel_callbacks callbacks;
96 int channel_default_bufferize(ssh_channel channel,
void *data,
int len,
98 int ssh_channel_flush(ssh_channel channel);
99 uint32_t ssh_channel_new_id(ssh_session session);
100 ssh_channel ssh_channel_from_local(ssh_session session, uint32_t
id);
101 void ssh_channel_do_free(ssh_channel channel);
108 int channel_open_session1(ssh_channel channel);
109 int channel_request_pty_size1(ssh_channel channel,
const char *terminal,
111 int channel_change_pty_size1(ssh_channel channel,
int cols,
int rows);
112 int channel_request_shell1(ssh_channel channel);
113 int channel_request_exec1(ssh_channel channel,
const char *cmd);
114 int channel_write1(ssh_channel channel,
const void *data,
int len);
115 ssh_channel ssh_get_channel1(ssh_session session);
ssh_channel ssh_channel_new(ssh_session session)
Allocate a new channel.
Definition: channels.c:79
#define SSH_PACKET_CALLBACK(name)
This macro declares a packet callback handler.
Definition: callbacks.h:449