1 2 29 30 package com.jcraft.jsch; 31 32 public class RequestSubsystem extends Request{ 33 private String subsystem=null; 34 public void request(Session session, Channel channel, String subsystem, boolean want_reply) throws Exception { 35 setReply(want_reply); 36 this.subsystem=subsystem; 37 this.request(session, channel); 38 } 39 public void request(Session session, Channel channel) throws Exception { 40 super.request(session, channel); 41 42 Buffer buf=new Buffer(); 43 Packet packet=new Packet(buf); 44 45 packet.reset(); 46 buf.putByte((byte)Session.SSH_MSG_CHANNEL_REQUEST); 47 buf.putInt(channel.getRecipient()); 48 buf.putString("subsystem".getBytes()); 49 buf.putByte((byte)(waitForReply() ? 1 : 0)); 50 buf.putString(subsystem.getBytes()); 51 write(packet); 52 } 53 } 54 | Popular Tags |