1 package ch.ethz.ssh2.packets; 2 3 4 10 public class PacketSessionExecCommand 11 { 12 byte[] payload; 13 14 public int recipientChannelID; 15 public boolean wantReply; 16 public String command; 17 18 public PacketSessionExecCommand(int recipientChannelID, boolean wantReply, String command) 19 { 20 this.recipientChannelID = recipientChannelID; 21 this.wantReply = wantReply; 22 this.command = command; 23 } 24 25 public byte[] getPayload() 26 { 27 if (payload == null) 28 { 29 TypesWriter tw = new TypesWriter(); 30 tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST); 31 tw.writeUINT32(recipientChannelID); 32 tw.writeString("exec"); 33 tw.writeBoolean(wantReply); 34 tw.writeString(command); 35 payload = tw.getBytes(); 36 } 37 return payload; 38 } 39 } 40 | Popular Tags |