de.mud.ssh
Class SshPacket1

java.lang.Object
  extended by de.mud.ssh.SshPacket1

public class SshPacket1
extends java.lang.Object

Version:
$Id: SshPacket1.java 499 2005-09-29 08:24:54Z leo $
Author:
Marcus Meissner

Field Summary
protected  byte[] byteArray
           
protected  int offset
           
 
Constructor Summary
SshPacket1(byte newType)
           
SshPacket1(SshCrypto _crypto)
           
 
Method Summary
 byte[] addPayload(byte[] buff)
           
 byte getByte()
           
 byte[] getBytes(int cnt)
           
 byte[] getData()
           
 int getInt16()
           
 int getInt32()
           
 byte[] getMpInt()
          Return the mp-int at the position offset in the data First 2 bytes are the number of bits in the integer, msb first (for example, the value 0x00012345 would have 17 bits).
 java.lang.String getString()
           
 byte getType()
           
 boolean isFinished()
           
 void putByte(byte xbyte)
           
 void putBytes(byte[] bytes)
           
 void putData(byte[] data)
           
 void putInt16(int xint)
           
 void putInt32(int xint)
           
 void putMpInt(java.math.BigInteger bi)
           
 void putString(java.lang.String str)
          Add a SSH String to a packet.
 void setType(byte ntype)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

byteArray

protected byte[] byteArray

offset

protected int offset
Constructor Detail

SshPacket1

public SshPacket1(SshCrypto _crypto)

SshPacket1

public SshPacket1(byte newType)
Method Detail

getMpInt

public byte[] getMpInt()
Return the mp-int at the position offset in the data First 2 bytes are the number of bits in the integer, msb first (for example, the value 0x00012345 would have 17 bits). The value zero has zero bits. It is permissible that the number of bits be larger than the real number of bits. The number of bits is followed by (bits + 7) / 8 bytes of binary data, msb first, giving the value of the integer.


putMpInt

public void putMpInt(java.math.BigInteger bi)

addPayload

public byte[] addPayload(byte[] buff)

getData

public byte[] getData()

putData

public void putData(byte[] data)

isFinished

public boolean isFinished()

getType

public byte getType()

setType

public void setType(byte ntype)

getInt32

public int getInt32()

getInt16

public int getInt16()

getString

public java.lang.String getString()

getByte

public byte getByte()

getBytes

public byte[] getBytes(int cnt)

putInt16

public void putInt16(int xint)

putInt32

public void putInt32(int xint)

putByte

public void putByte(byte xbyte)

putBytes

public void putBytes(byte[] bytes)

putString

public void putString(java.lang.String str)
Add a SSH String to a packet. The incore representation is a INT32 length BYTE[length] data

Parameters:
str: - The string to be added.