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 class RequestPtyReq : Request 00035 { 00036 void setCode(String cookie) 00037 { 00038 } 00039 public void request(Session session, Channel channel) 00040 { 00041 Buffer buf=new Buffer(); 00042 Packet packet=new Packet(buf); 00043 00044 packet.reset(); 00045 buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); 00046 buf.putInt(channel.getRecipient()); 00047 buf.putString(Util.getBytes("pty-req")); 00048 buf.putByte((byte)(waitForReply() ? 1 : 0)); 00049 buf.putString(Util.getBytes("vt100")); 00050 buf.putInt(80); 00051 buf.putInt(24); 00052 buf.putInt(640); 00053 buf.putInt(480); 00054 buf.putString(Util.getBytes("")); 00055 session.write(packet); 00056 } 00057 public bool waitForReply(){ return false; } 00058 } 00059 00060 }
1.5.9