01: package ch.ethz.ssh2.packets;
02:
03: /**
04: * PacketSessionExecCommand.
05: *
06: * @author Christian Plattner, plattner@inf.ethz.ch
07: * @version $Id: PacketSessionExecCommand.java,v 1.2 2005/08/24 17:54:09 cplattne Exp $
08: */
09: public class PacketSessionExecCommand {
10: byte[] payload;
11:
12: public int recipientChannelID;
13: public boolean wantReply;
14: public String command;
15:
16: public PacketSessionExecCommand(int recipientChannelID,
17: boolean wantReply, String command) {
18: this .recipientChannelID = recipientChannelID;
19: this .wantReply = wantReply;
20: this .command = command;
21: }
22:
23: public byte[] getPayload() {
24: if (payload == null) {
25: TypesWriter tw = new TypesWriter();
26: tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
27: tw.writeUINT32(recipientChannelID);
28: tw.writeString("exec");
29: tw.writeBoolean(wantReply);
30: tw.writeString(command);
31: payload = tw.getBytes();
32: }
33: return payload;
34: }
35: }
|