KickJava   Java API By Example, From Geeks To Geeks.

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


1 package ch.ethz.ssh2.packets;
2
3
4 /**
5  * PacketSessionPtyRequest.
6  *
7  * @author Christian Plattner, plattner@inf.ethz.ch
8  * @version $Id: PacketSessionPtyRequest.java,v 1.2 2005/08/24 17:54:09 cplattne Exp $
9  */

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