00001 using System; 00002 00003 namespace Tamir.SharpSsh.jsch 00004 { 00005 /* -*-mode:java; c-basic-offset:2; -*- */ 00006 /* 00007 Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved. 00008 00009 Redistribution and use in source and binary forms, with or without 00010 modification, are permitted provided that the following conditions are met: 00011 00012 1. Redistributions of source code must retain the above copyright notice, 00013 this list of conditions and the following disclaimer. 00014 00015 2. Redistributions in binary form must reproduce the above copyright 00016 notice, this list of conditions and the following disclaimer in 00017 the documentation and/or other materials provided with the distribution. 00018 00019 3. The names of the authors may not be used to endorse or promote products 00020 derived from this software without specific prior written permission. 00021 00022 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, 00023 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00024 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, 00025 INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, 00026 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00027 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00028 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00029 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00030 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00031 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 */ 00033 00034 public class RequestWindowChange : Request 00035 { 00036 internal int width_columns=80; 00037 internal int height_rows=24; 00038 internal int width_pixels=640; 00039 internal int height_pixels=480; 00040 public void setSize(int row, int col, int wp, int hp) 00041 { 00042 this.width_columns=row; 00043 this.height_rows=col; 00044 this.width_pixels=wp; 00045 this.height_pixels=hp; 00046 } 00047 public void request(Session session, Channel channel) 00048 { 00049 Buffer buf=new Buffer(); 00050 Packet packet=new Packet(buf); 00051 00052 //byte SSH_MSG_CHANNEL_REQUEST 00053 //uint32 recipient_channel 00054 //string "window-change" 00055 //boolean FALSE 00056 //uint32 terminal width, columns 00057 //uint32 terminal height, rows 00058 //uint32 terminal width, pixels 00059 //uint32 terminal height, pixels 00060 packet.reset(); 00061 buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); 00062 buf.putInt(channel.getRecipient()); 00063 buf.putString(Util.getBytes("window-change")); 00064 buf.putByte((byte)(waitForReply() ? 1 : 0)); 00065 buf.putInt(width_columns); 00066 buf.putInt(height_rows); 00067 buf.putInt(width_pixels); 00068 buf.putInt(height_pixels); 00069 session.write(packet); 00070 } 00071 public bool waitForReply(){ return false; } 00072 } 00073 00074 }
1.5.9