1 2 29 30 package com.jcraft.jsch; 31 32 class RequestEnv extends Request{ 33 String name=null; 34 String value=null; 35 void setEnv(String name, String value){ 36 this.name=name; 37 this.value=value; 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("env".getBytes()); 49 buf.putByte((byte)(waitForReply() ? 1 : 0)); 50 buf.putString(name.getBytes()); 51 buf.putString(value.getBytes()); 52 write(packet); 53 } 54 } 55 | Popular Tags |