1/*
2 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved.
3 * Please refer to the LICENSE.txt for licensing details.
4 */
5package ch.ethz.ssh2.packets;
6
7/**
8 * PacketGlobalCancelForwardRequest.
9 *
10 * @author Christian Plattner
11 * @version 2.50, 03/15/10
12 */
13public class PacketGlobalCancelForwardRequest
14{
15	byte[] payload;
16
17	public boolean wantReply;
18	public String bindAddress;
19	public int bindPort;
20
21	public PacketGlobalCancelForwardRequest(boolean wantReply, String bindAddress, int bindPort)
22	{
23		this.wantReply = wantReply;
24		this.bindAddress = bindAddress;
25		this.bindPort = bindPort;
26	}
27
28	public byte[] getPayload()
29	{
30		if (payload == null)
31		{
32			TypesWriter tw = new TypesWriter();
33			tw.writeByte(Packets.SSH_MSG_GLOBAL_REQUEST);
34
35			tw.writeString("cancel-tcpip-forward");
36			tw.writeBoolean(wantReply);
37			tw.writeString(bindAddress);
38			tw.writeUINT32(bindPort);
39
40			payload = tw.getBytes();
41		}
42		return payload;
43	}
44}
45