Mercurial > 510Connectbot
comparison src/com/trilead/ssh2/packets/PacketSessionSubsystemRequest.java @ 0:0ce5cc452d02
initial version
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 22 May 2014 10:41:19 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0ce5cc452d02 |
---|---|
1 package com.trilead.ssh2.packets; | |
2 | |
3 | |
4 /** | |
5 * PacketSessionSubsystemRequest. | |
6 * | |
7 * @author Christian Plattner, plattner@trilead.com | |
8 * @version $Id: PacketSessionSubsystemRequest.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $ | |
9 */ | |
10 public class PacketSessionSubsystemRequest { | |
11 byte[] payload; | |
12 | |
13 public int recipientChannelID; | |
14 public boolean wantReply; | |
15 public String subsystem; | |
16 | |
17 public PacketSessionSubsystemRequest(int recipientChannelID, 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 | |
35 return payload; | |
36 } | |
37 } |