01: package ch.ethz.ssh2.packets;
02:
03: /**
04: * PacketSessionSubsystemRequest.
05: *
06: * @author Christian Plattner, plattner@inf.ethz.ch
07: * @version $Id: PacketSessionSubsystemRequest.java,v 1.2 2005/08/24 17:54:09 cplattne Exp $
08: */
09: public class PacketSessionSubsystemRequest {
10: byte[] payload;
11:
12: public int recipientChannelID;
13: public boolean wantReply;
14: public String subsystem;
15:
16: public PacketSessionSubsystemRequest(int recipientChannelID,
17: boolean wantReply, String subsystem) {
18: this .recipientChannelID = recipientChannelID;
19: this .wantReply = wantReply;
20: this .subsystem = subsystem;
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("subsystem");
29: tw.writeBoolean(wantReply);
30: tw.writeString(subsystem);
31: payload = tw.getBytes();
32: tw.getBytes(payload);
33: }
34: return payload;
35: }
36: }
|