KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > ssh2 > packets > PacketSessionStartShell


1
2 package ch.ethz.ssh2.packets;
3
4 /**
5  * PacketSessionStartShell.
6  *
7  * @author Christian Plattner, plattner@inf.ethz.ch
8  * @version $Id: PacketSessionStartShell.java,v 1.2 2005/08/24 17:54:09 cplattne Exp $
9  */

10 public class PacketSessionStartShell
11 {
12     byte[] payload;
13
14     public int recipientChannelID;
15     public boolean wantReply;
16
17     public PacketSessionStartShell(int recipientChannelID, boolean wantReply)
18     {
19         this.recipientChannelID = recipientChannelID;
20         this.wantReply = wantReply;
21     }
22
23     public byte[] getPayload()
24     {
25         if (payload == null)
26         {
27             TypesWriter tw = new TypesWriter();
28             tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
29             tw.writeUINT32(recipientChannelID);
30             tw.writeString("shell");
31             tw.writeBoolean(wantReply);
32             payload = tw.getBytes();
33         }
34         return payload;
35     }
36 }
37
Popular Tags