comparison common-channel.c @ 1122:aaf576b27a10

Merge pull request #13 from gazoo74/fix-warnings Fix warnings
author Matt Johnston <matt@ucc.asn.au>
date Thu, 04 Jun 2015 23:08:50 +0800
parents f95b6e87cd0c
children a96cf3627a58
comparison
equal deleted inserted replaced
1087:1e486f368ec3 1122:aaf576b27a10
36 #include "listener.h" 36 #include "listener.h"
37 #include "runopts.h" 37 #include "runopts.h"
38 #include "netio.h" 38 #include "netio.h"
39 39
40 static void send_msg_channel_open_failure(unsigned int remotechan, int reason, 40 static void send_msg_channel_open_failure(unsigned int remotechan, int reason,
41 const unsigned char *text, const unsigned char *lang); 41 const char *text, const char *lang);
42 static void send_msg_channel_open_confirmation(struct Channel* channel, 42 static void send_msg_channel_open_confirmation(struct Channel* channel,
43 unsigned int recvwindow, 43 unsigned int recvwindow,
44 unsigned int recvmaxpacket); 44 unsigned int recvmaxpacket);
45 static void writechannel(struct Channel* channel, int fd, circbuffer *cbuf, 45 static void writechannel(struct Channel* channel, int fd, circbuffer *cbuf,
46 const unsigned char *moredata, unsigned int *morelen); 46 const unsigned char *moredata, unsigned int *morelen);
919 } 919 }
920 920
921 /* Handle a new channel request, performing any channel-type-specific setup */ 921 /* Handle a new channel request, performing any channel-type-specific setup */
922 void recv_msg_channel_open() { 922 void recv_msg_channel_open() {
923 923
924 unsigned char *type; 924 char *type;
925 unsigned int typelen; 925 unsigned int typelen;
926 unsigned int remotechan, transwindow, transmaxpacket; 926 unsigned int remotechan, transwindow, transmaxpacket;
927 struct Channel *channel; 927 struct Channel *channel;
928 const struct ChanType **cp; 928 const struct ChanType **cp;
929 const struct ChanType *chantype; 929 const struct ChanType *chantype;
1037 } 1037 }
1038 1038
1039 /* Send a channel open failure message, with a corresponding reason 1039 /* Send a channel open failure message, with a corresponding reason
1040 * code (usually resource shortage or unknown chan type) */ 1040 * code (usually resource shortage or unknown chan type) */
1041 static void send_msg_channel_open_failure(unsigned int remotechan, 1041 static void send_msg_channel_open_failure(unsigned int remotechan,
1042 int reason, const unsigned char *text, const unsigned char *lang) { 1042 int reason, const char *text, const char *lang) {
1043 1043
1044 TRACE(("enter send_msg_channel_open_failure")) 1044 TRACE(("enter send_msg_channel_open_failure"))
1045 CHECKCLEARTOWRITE(); 1045 CHECKCLEARTOWRITE();
1046 1046
1047 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_OPEN_FAILURE); 1047 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_OPEN_FAILURE);
1048 buf_putint(ses.writepayload, remotechan); 1048 buf_putint(ses.writepayload, remotechan);
1049 buf_putint(ses.writepayload, reason); 1049 buf_putint(ses.writepayload, reason);
1050 buf_putstring(ses.writepayload, text, strlen((char*)text)); 1050 buf_putstring(ses.writepayload, text, strlen(text));
1051 buf_putstring(ses.writepayload, lang, strlen((char*)lang)); 1051 buf_putstring(ses.writepayload, lang, strlen(lang));
1052 1052
1053 encrypt_packet(); 1053 encrypt_packet();
1054 TRACE(("leave send_msg_channel_open_failure")) 1054 TRACE(("leave send_msg_channel_open_failure"))
1055 } 1055 }
1056 1056
1242 } 1242 }
1243 return NULL; 1243 return NULL;
1244 } 1244 }
1245 1245
1246 void start_send_channel_request(struct Channel *channel, 1246 void start_send_channel_request(struct Channel *channel,
1247 unsigned char *type) { 1247 char *type) {
1248 1248
1249 CHECKCLEARTOWRITE(); 1249 CHECKCLEARTOWRITE();
1250 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST); 1250 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST);
1251 buf_putint(ses.writepayload, channel->remotechan); 1251 buf_putint(ses.writepayload, channel->remotechan);
1252 1252