packet_start(SSH2_MSG_CHANNEL_OPEN_CONFIRMATION); packet_put_int(c->remote_id); packet_put_int(c->self); packet_put_int(c->local_window); packet_put_int(c->local_maxpacket); packet_send();
if (c->type != SSH_CHANNEL_CONNECTING) { packet_start(SSH2_MSG_CHANNEL_OPEN_CONFIRMATION); packet_put_int(c->remote_id); packet_put_int(c->self); packet_put_int(c->local_window); packet_put_int(c->local_maxpacket); packet_send(); }
client_input_channel_open(int type, int plen, void *ctxt){	Channel *c = NULL;	char *ctype;	u_int len;	int rchan;	int rmaxpack;	int rwindow;	ctype = packet_get_string(&len);	rchan = packet_get_int();	rwindow = packet_get_int();	rmaxpack = packet_get_int();	debug("client_input_channel_open: ctype %s rchan %d win %d max %d",	    ctype, rchan, rwindow, rmaxpack);	if (strcmp(ctype, "forwarded-tcpip") == 0) {		c = client_request_forwarded_tcpip(ctype, rchan);	} else if (strcmp(ctype, "x11") == 0) {		c = client_request_x11(ctype, rchan);	} else if (strcmp(ctype, "auth-agent@openssh.com") == 0) {		c = client_request_agent(ctype, rchan);	}/* XXX duplicate : */	if (c != NULL) {		debug("confirm %s", ctype);		c->remote_id = rchan;		c->remote_window = rwindow;		c->remote_maxpacket = rmaxpack;		packet_start(SSH2_MSG_CHANNEL_OPEN_CONFIRMATION);		packet_put_int(c->remote_id);		packet_put_int(c->self);		packet_put_int(c->local_window);		packet_put_int(c->local_maxpacket);		packet_send();	} else {		debug("failure %s", ctype);		packet_start(SSH2_MSG_CHANNEL_OPEN_FAILURE);		packet_put_int(rchan);		packet_put_int(SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED);		if (!(datafellows & SSH_BUG_OPENFAILURE)) {			packet_put_cstring("bla bla");			packet_put_cstring("");		}		packet_send();	}	xfree(ctype);}