de.mud.ssh
Class SshPacket2

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

public class SshPacket2
extends java.lang.Object

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

Field Summary
protected  byte[] byteArray
           
protected  int offset
           
 
Constructor Summary
SshPacket2(byte newType)
           
SshPacket2(SshCrypto _crypto)
           
 
Method Summary
 byte[] addPayload(byte[] buff)
           
 byte getByte()
           
 byte[] getBytes(int cnt)
           
 byte[] getData()
           
 int getInt16()
           
 int getInt32()
           
 java.math.BigInteger getMpInt()
          Return the mp-int at the position offset in the data First 4 bytes are the number of bytes in the integer, msb first (for example, the value 0x00012345 would have 17 bits).
 byte[] getPayLoad(SshCrypto xcrypt, long seqnr)
           
 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

SshPacket2

public SshPacket2(SshCrypto _crypto)

SshPacket2

public SshPacket2(byte newType)
Method Detail

getMpInt

public java.math.BigInteger getMpInt()
Return the mp-int at the position offset in the data First 4 bytes are the number of bytes 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)

getPayLoad

public byte[] getPayLoad(SshCrypto xcrypt,
                         long seqnr)
                  throws java.io.IOException
Throws:
java.io.IOException

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.