Lines Matching full:channel
30 #include "channel.h"
43 static int sessioncommand(struct Channel *channel, struct ChanSess *chansess,
47 static int noptycommand(struct Channel *channel, struct ChanSess *chansess);
48 static int ptycommand(struct Channel *channel, struct ChanSess *chansess);
53 static void closechansess(struct Channel *channel);
54 static int newchansess(struct Channel *channel);
55 static void chansessionrequest(struct Channel *channel);
57 static void send_exitsignalstatus(struct Channel *channel);
58 static void send_msg_chansess_exitstatus(struct Channel * channel,
60 static void send_msg_chansess_exitsignal(struct Channel * channel,
68 static int sesscheckclose(struct Channel *channel) {
69 struct ChanSess *chansess = (struct ChanSess*)channel->typedata;
145 static void send_exitsignalstatus(struct Channel *channel) {
147 struct ChanSess *chansess = (struct ChanSess*)channel->typedata;
151 send_msg_chansess_exitsignal(channel, chansess);
153 send_msg_chansess_exitstatus(channel, chansess);
159 static void send_msg_chansess_exitstatus(struct Channel * channel,
168 buf_putint(ses.writepayload, channel->remotechan);
178 static void send_msg_chansess_exitsignal(struct Channel * channel,
204 buf_putint(ses.writepayload, channel->remotechan);
215 /* set up a session channel */
216 static int newchansess(struct Channel *channel) {
220 dropbear_assert(channel->typedata == NULL);
234 channel->typedata = chansess;
252 /* clean a session channel */
253 static void closechansess(struct Channel *channel) {
261 chansess = (struct ChanSess*)channel->typedata;
268 send_exitsignalstatus(channel);
308 /* Handle requests for a channel. These can be execution requests,
310 static void chansessionrequest(struct Channel *channel) {
328 chansess = (struct ChanSess*)channel->typedata;
335 ret = sessioncommand(channel, chansess, 0, 0);
339 ret = sessioncommand(channel, chansess, 1, 0);
341 ret = sessioncommand(channel, chansess, 1, 1);
360 send_msg_channel_success(channel);
362 send_msg_channel_failure(channel);
566 static int sessioncommand(struct Channel *channel, struct ChanSess *chansess,
616 ret = noptycommand(channel, chansess);
619 ret = ptycommand(channel, chansess);
631 static int noptycommand(struct Channel *channel, struct ChanSess *chansess) {
712 channel->writefd = infds[FDOUT];
713 channel->readfd = outfds[FDIN];
714 channel->errfd = errfds[FDIN];
715 ses.maxfd = MAX(ses.maxfd, channel->writefd);
716 ses.maxfd = MAX(ses.maxfd, channel->readfd);
717 ses.maxfd = MAX(ses.maxfd, channel->errfd);
719 setnonblocking(channel->readfd);
720 setnonblocking(channel->writefd);
721 setnonblocking(channel->errfd);
734 static int ptycommand(struct Channel *channel, struct ChanSess *chansess) {
833 channel->writefd = chansess->master;
834 channel->readfd = chansess->master;