01: package ch.ethz.ssh2.packets;
02:
03: /**
04: * PacketSessionX11Request.
05: *
06: * @author Christian Plattner, plattner@inf.ethz.ch
07: * @version $Id: PacketSessionX11Request.java,v 1.2 2005/12/05 17:13:27 cplattne Exp $
08: */
09: public class PacketSessionX11Request {
10: byte[] payload;
11:
12: public int recipientChannelID;
13: public boolean wantReply;
14:
15: public boolean singleConnection;
16: String x11AuthenticationProtocol;
17: String x11AuthenticationCookie;
18: int x11ScreenNumber;
19:
20: public PacketSessionX11Request(int recipientChannelID,
21: boolean wantReply, boolean singleConnection,
22: String x11AuthenticationProtocol,
23: String x11AuthenticationCookie, int x11ScreenNumber) {
24: this .recipientChannelID = recipientChannelID;
25: this .wantReply = wantReply;
26:
27: this .singleConnection = singleConnection;
28: this .x11AuthenticationProtocol = x11AuthenticationProtocol;
29: this .x11AuthenticationCookie = x11AuthenticationCookie;
30: this .x11ScreenNumber = x11ScreenNumber;
31: }
32:
33: public byte[] getPayload() {
34: if (payload == null) {
35: TypesWriter tw = new TypesWriter();
36: tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
37: tw.writeUINT32(recipientChannelID);
38: tw.writeString("x11-req");
39: tw.writeBoolean(wantReply);
40:
41: tw.writeBoolean(singleConnection);
42: tw.writeString(x11AuthenticationProtocol);
43: tw.writeString(x11AuthenticationCookie);
44: tw.writeUINT32(x11ScreenNumber);
45:
46: payload = tw.getBytes();
47: }
48: return payload;
49: }
50: }
|