0
|
1
|
|
2 package com.trilead.ssh2.packets;
|
|
3
|
|
4 /**
|
|
5 * PacketChannelTrileadPing.
|
|
6 *
|
|
7 * @author Christian Plattner, plattner@trilead.com
|
|
8 * @version $Id: PacketChannelTrileadPing.java,v 1.1 2008/03/03 07:01:36
|
|
9 * cplattne Exp $
|
|
10 */
|
|
11 public class PacketChannelTrileadPing {
|
|
12 byte[] payload;
|
|
13
|
|
14 public int recipientChannelID;
|
|
15
|
|
16 public PacketChannelTrileadPing(int recipientChannelID) {
|
|
17 this.recipientChannelID = recipientChannelID;
|
|
18 }
|
|
19
|
|
20 public byte[] getPayload() {
|
|
21 if (payload == null) {
|
|
22 TypesWriter tw = new TypesWriter();
|
|
23 tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
|
|
24 tw.writeUINT32(recipientChannelID);
|
|
25 tw.writeString("trilead-ping");
|
|
26 tw.writeBoolean(true);
|
|
27 payload = tw.getBytes();
|
|
28 }
|
|
29
|
|
30 return payload;
|
|
31 }
|
|
32 }
|