KickJava   Java API By Example, From Geeks To Geeks.

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


1
2 package ch.ethz.ssh2.packets;
3
4 /**
5  * PacketGlobalForwardRequest.
6  *
7  * @author Christian Plattner, plattner@inf.ethz.ch
8  * @version $Id: PacketGlobalForwardRequest.java,v 1.1 2005/12/05 17:13:27 cplattne Exp $
9  */

10 public class PacketGlobalForwardRequest
11 {
12     byte[] payload;
13
14     public boolean wantReply;
15     public String JavaDoc bindAddress;
16     public int bindPort;
17
18     public PacketGlobalForwardRequest(boolean wantReply, String JavaDoc bindAddress, int bindPort)
19     {
20         this.wantReply = wantReply;
21         this.bindAddress = bindAddress;
22         this.bindPort = bindPort;
23     }
24
25     public byte[] getPayload()
26     {
27         if (payload == null)
28         {
29             TypesWriter tw = new TypesWriter();
30             tw.writeByte(Packets.SSH_MSG_GLOBAL_REQUEST);
31             
32             tw.writeString("tcpip-forward");
33             tw.writeBoolean(wantReply);
34             tw.writeString(bindAddress);
35             tw.writeUINT32(bindPort);
36
37             payload = tw.getBytes();
38         }
39         return payload;
40     }
41 }
42
Popular Tags