comparison app/src/main/java/ch/ethz/ssh2/packets/PacketOpenDirectTCPIPChannel.java @ 438:d29cce60f393

migrate from Eclipse to Android Studio
author Carl Byington <carl@five-ten-sg.com>
date Thu, 03 Dec 2015 11:23:55 -0800
parents src/ch/ethz/ssh2/packets/PacketOpenDirectTCPIPChannel.java@071eccdff8ea
children
comparison
equal deleted inserted replaced
437:208b31032318 438:d29cce60f393
1 /*
2 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved.
3 * Please refer to the LICENSE.txt for licensing details.
4 */
5 package ch.ethz.ssh2.packets;
6
7 /**
8 * @author Christian Plattner
9 * @version $Id: PacketOpenDirectTCPIPChannel.java 160 2014-05-01 14:30:26Z dkocher@sudo.ch $
10 */
11 public final class PacketOpenDirectTCPIPChannel {
12 private final byte[] payload;
13
14 public PacketOpenDirectTCPIPChannel(int channelID, int initialWindowSize, int maxPacketSize,
15 String host_to_connect, int port_to_connect, String originator_IP_address,
16 int originator_port) {
17 TypesWriter tw = new TypesWriter();
18 tw.writeByte(Packets.SSH_MSG_CHANNEL_OPEN);
19 tw.writeString("direct-tcpip");
20 tw.writeUINT32(channelID);
21 tw.writeUINT32(initialWindowSize);
22 tw.writeUINT32(maxPacketSize);
23 tw.writeString(host_to_connect);
24 tw.writeUINT32(port_to_connect);
25 tw.writeString(originator_IP_address);
26 tw.writeUINT32(originator_port);
27 payload = tw.getBytes();
28 }
29
30 public byte[] getPayload() {
31 return payload;
32 }
33 }