comparison common-channel.c @ 62:20563735e8b5

just checkpointing
author Matt Johnston <matt@ucc.asn.au>
date Tue, 10 Aug 2004 17:09:52 +0000
parents 0913e2ee3545
children b0316ce64e4b
comparison
equal deleted inserted replaced
61:3a4f0ef1e8c3 62:20563735e8b5
30 #include "ssh.h" 30 #include "ssh.h"
31 #include "buffer.h" 31 #include "buffer.h"
32 #include "dbutil.h" 32 #include "dbutil.h"
33 #include "channel.h" 33 #include "channel.h"
34 #include "ssh.h" 34 #include "ssh.h"
35 #include "tcpfwd-direct.h"
36 #include "tcpfwd-remote.h"
37 #include "listener.h" 35 #include "listener.h"
38 36
39 static void send_msg_channel_open_failure(unsigned int remotechan, int reason, 37 static void send_msg_channel_open_failure(unsigned int remotechan, int reason,
40 const unsigned char *text, const unsigned char *lang); 38 const unsigned char *text, const unsigned char *lang);
41 static void send_msg_channel_open_confirmation(struct Channel* channel, 39 static void send_msg_channel_open_confirmation(struct Channel* channel,
305 TRACE(("enter send_msg_channel_close")); 303 TRACE(("enter send_msg_channel_close"));
306 /* XXX server */ 304 /* XXX server */
307 if (channel->type->closehandler) { 305 if (channel->type->closehandler) {
308 channel->type->closehandler(channel); 306 channel->type->closehandler(channel);
309 } 307 }
310 #if 0
311 if (channel->type == CHANNEL_ID_SESSION) {
312 send_exitsignalstatus(channel);
313
314 closechansess(channel);
315 }
316 #endif
317 308
318 CHECKCLEARTOWRITE(); 309 CHECKCLEARTOWRITE();
319 310
320 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_CLOSE); 311 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_CLOSE);
321 buf_putint(ses.writepayload, channel->remotechan); 312 buf_putint(ses.writepayload, channel->remotechan);
543 channel->type->reqhandler(channel); 534 channel->type->reqhandler(channel);
544 } else { 535 } else {
545 send_msg_channel_failure(channel); 536 send_msg_channel_failure(channel);
546 } 537 }
547 538
548 #if 0
549 /* handle according to channel type */
550 switch (channel->type) {
551
552 case CHANNEL_ID_SESSION:
553 TRACE(("continue recv_msg_channel_request: session request"));
554 /* XXX server */
555 /* Here we need to do things channel-specific style. Function
556 * pointer callbacks perhaps */
557 chansessionrequest(channel);
558 break;
559
560 default:
561 send_msg_channel_failure(channel);
562 }
563 #endif
564
565 TRACE(("leave recv_msg_channel_request")); 539 TRACE(("leave recv_msg_channel_request"));
566 540
567 } 541 }
568 542
569 /* Reads data from the server's program/shell/etc, and puts it in a 543 /* Reads data from the server's program/shell/etc, and puts it in a
795 TRACE(("inithandler returned failure %d", ret)); 769 TRACE(("inithandler returned failure %d", ret));
796 goto failure; 770 goto failure;
797 } 771 }
798 } 772 }
799 773
800 #if 0
801 /* type specific initialisation */
802 if (typeval == CHANNEL_ID_SESSION) {
803 newchansess(channel);
804 #ifndef DISABLE_LOCALTCPFWD
805 } else if (typeval == CHANNEL_ID_TCPDIRECT) {
806 if (ses.opts->nolocaltcp) {
807 errtype = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
808 } else if (newtcpdirect(channel) == DROPBEAR_FAILURE) {
809 errtype = SSH_OPEN_CONNECT_FAILED;
810 deletechannel(channel);
811 goto failure;
812 }
813 #endif
814 }
815 #endif
816
817 /* success */ 774 /* success */
818 send_msg_channel_open_confirmation(channel, channel->recvwindow, 775 send_msg_channel_open_confirmation(channel, channel->recvwindow,
819 channel->recvmaxpacket); 776 channel->recvmaxpacket);
820 goto cleanup; 777 goto cleanup;
821 778