comparison src/com/trilead/ssh2/packets/PacketSessionX11Request.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
2 package com.trilead.ssh2.packets;
3
4 /**
5 * PacketSessionX11Request.
6 *
7 * @author Christian Plattner, plattner@trilead.com
8 * @version $Id: PacketSessionX11Request.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
9 */
10 public class PacketSessionX11Request {
11 byte[] payload;
12
13 public int recipientChannelID;
14 public boolean wantReply;
15
16 public boolean singleConnection;
17 String x11AuthenticationProtocol;
18 String x11AuthenticationCookie;
19 int x11ScreenNumber;
20
21 public PacketSessionX11Request(int recipientChannelID, boolean wantReply, boolean singleConnection,
22 String x11AuthenticationProtocol, String x11AuthenticationCookie, int x11ScreenNumber) {
23 this.recipientChannelID = recipientChannelID;
24 this.wantReply = wantReply;
25 this.singleConnection = singleConnection;
26 this.x11AuthenticationProtocol = x11AuthenticationProtocol;
27 this.x11AuthenticationCookie = x11AuthenticationCookie;
28 this.x11ScreenNumber = x11ScreenNumber;
29 }
30
31 public byte[] getPayload() {
32 if (payload == null) {
33 TypesWriter tw = new TypesWriter();
34 tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
35 tw.writeUINT32(recipientChannelID);
36 tw.writeString("x11-req");
37 tw.writeBoolean(wantReply);
38 tw.writeBoolean(singleConnection);
39 tw.writeString(x11AuthenticationProtocol);
40 tw.writeString(x11AuthenticationCookie);
41 tw.writeUINT32(x11ScreenNumber);
42 payload = tw.getBytes();
43 }
44
45 return payload;
46 }
47 }