1 package com.trilead.ssh2.packets;
\r
5 * PacketSessionExecCommand.
\r
7 * @author Christian Plattner, plattner@trilead.com
\r
8 * @version $Id: PacketSessionExecCommand.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
\r
10 public class PacketSessionExecCommand
\r
14 public int recipientChannelID;
\r
15 public boolean wantReply;
\r
16 public String command;
\r
18 public PacketSessionExecCommand(int recipientChannelID, boolean wantReply, String command)
\r
20 this.recipientChannelID = recipientChannelID;
\r
21 this.wantReply = wantReply;
\r
22 this.command = command;
\r
25 public byte[] getPayload()
\r
27 if (payload == null)
\r
29 TypesWriter tw = new TypesWriter();
\r
30 tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
\r
31 tw.writeUINT32(recipientChannelID);
\r
32 tw.writeString("exec");
\r
33 tw.writeBoolean(wantReply);
\r
34 tw.writeString(command);
\r
35 payload = tw.getBytes();
\r