0
|
1
|
|
2 package com.trilead.ssh2.packets;
|
|
3
|
|
4 /**
|
|
5 * PacketGlobalForwardRequest.
|
|
6 *
|
|
7 * @author Christian Plattner, plattner@trilead.com
|
|
8 * @version $Id: PacketGlobalForwardRequest.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
|
|
9 */
|
|
10 public class PacketGlobalForwardRequest {
|
|
11 byte[] payload;
|
|
12
|
|
13 public boolean wantReply;
|
|
14 public String bindAddress;
|
|
15 public int bindPort;
|
|
16
|
|
17 public PacketGlobalForwardRequest(boolean wantReply, String bindAddress, int bindPort) {
|
|
18 this.wantReply = wantReply;
|
|
19 this.bindAddress = bindAddress;
|
|
20 this.bindPort = bindPort;
|
|
21 }
|
|
22
|
|
23 public byte[] getPayload() {
|
|
24 if (payload == null) {
|
|
25 TypesWriter tw = new TypesWriter();
|
|
26 tw.writeByte(Packets.SSH_MSG_GLOBAL_REQUEST);
|
|
27 tw.writeString("tcpip-forward");
|
|
28 tw.writeBoolean(wantReply);
|
|
29 tw.writeString(bindAddress);
|
|
30 tw.writeUINT32(bindPort);
|
|
31 payload = tw.getBytes();
|
|
32 }
|
|
33
|
|
34 return payload;
|
|
35 }
|
|
36 }
|