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