Mercurial > 510Connectbot
comparison src/com/trilead/ssh2/packets/PacketGlobalForwardRequest.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 | |
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 } |