KickJava   Java API By Example, From Geeks To Geeks.

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


1
2 package ch.ethz.ssh2.packets;
3
4 /**
5  * PacketSessionX11Request.
6  *
7  * @author Christian Plattner, plattner@inf.ethz.ch
8  * @version $Id: PacketSessionX11Request.java,v 1.2 2005/12/05 17:13:27 cplattne Exp $
9  */

10 public class PacketSessionX11Request
11 {
12     byte[] payload;
13
14     public int recipientChannelID;
15     public boolean wantReply;
16
17     public boolean singleConnection;
18     String JavaDoc x11AuthenticationProtocol;
19     String JavaDoc x11AuthenticationCookie;
20     int x11ScreenNumber;
21
22     public PacketSessionX11Request(int recipientChannelID, boolean wantReply, boolean singleConnection,
23             String JavaDoc x11AuthenticationProtocol, String JavaDoc x11AuthenticationCookie, int x11ScreenNumber)
24     {
25         this.recipientChannelID = recipientChannelID;
26         this.wantReply = wantReply;
27
28         this.singleConnection = singleConnection;
29         this.x11AuthenticationProtocol = x11AuthenticationProtocol;
30         this.x11AuthenticationCookie = x11AuthenticationCookie;
31         this.x11ScreenNumber = x11ScreenNumber;
32     }
33
34     public byte[] getPayload()
35     {
36         if (payload == null)
37         {
38             TypesWriter tw = new TypesWriter();
39             tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
40             tw.writeUINT32(recipientChannelID);
41             tw.writeString("x11-req");
42             tw.writeBoolean(wantReply);
43
44             tw.writeBoolean(singleConnection);
45             tw.writeString(x11AuthenticationProtocol);
46             tw.writeString(x11AuthenticationCookie);
47             tw.writeUINT32(x11ScreenNumber);
48
49             payload = tw.getBytes();
50         }
51         return payload;
52     }
53 }
54
Popular Tags