comparison src/com/trilead/ssh2/packets/PacketSessionPtyRequest.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 package com.trilead.ssh2.packets;
2
3
4 /**
5 * PacketSessionPtyRequest.
6 *
7 * @author Christian Plattner, plattner@trilead.com
8 * @version $Id: PacketSessionPtyRequest.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
9 */
10 public class PacketSessionPtyRequest {
11 byte[] payload;
12
13 public int recipientChannelID;
14 public boolean wantReply;
15 public String term;
16 public int character_width;
17 public int character_height;
18 public int pixel_width;
19 public int pixel_height;
20 public byte[] terminal_modes;
21
22 public PacketSessionPtyRequest(int recipientChannelID, boolean wantReply, String term,
23 int character_width, 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 payload = tw.getBytes();
49 }
50
51 return payload;
52 }
53 }