SourceForge Jpcap

net.sourceforge.jpcap.net
Class DTP.Packet

java.lang.Object
  extended by net.sourceforge.jpcap.net.Packet
      extended by net.sourceforge.jpcap.net.EthernetPacket
          extended by net.sourceforge.jpcap.net.DTP.Packet
All Implemented Interfaces:
Serializable, EthernetFields
Enclosing interface:
DTP

public static class DTP.Packet
extends EthernetPacket

DTP packet class.

Since:
2.0.0
Version:
$Revision: 1.1 $
Author:
Esmond Pitt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.jpcap.net.EthernetPacket
_byteBuffer, _bytes, _ethOffset, _timeval
 
Fields inherited from interface net.sourceforge.jpcap.net.EthernetFields
ETH_CODE_LEN, ETH_CODE_POS, ETH_DST_POS, ETH_HEADER_LEN, ETH_SRC_POS
 
Constructor Summary
DTP.Packet(int lLen, byte[] bytes)
          Creates a new DTP packet
DTP.Packet(int lLen, byte[] bytes, Timeval tv)
          Create a new DTP packet.
DTP.Packet(int lLen, ByteBuffer bb, Timeval tv)
          Create a new DTP packet
 
Method Summary
 byte[] getData()
          Fetch the data portion of the packet.
 byte[] getDTPData()
           
 int getDTPVersion()
           
 void setDTPData(byte[] data)
          Set the DTP data payload.
 void setDTPVersion(int version)
          Set the DTP protocol version
 String toColoredString(boolean colored)
          Generate string with contents describing this packet.
 
Methods inherited from class net.sourceforge.jpcap.net.EthernetPacket
equals, getColor, getDestinationHwAddress, getDestinationMACAddress, getEthernetCRC32, getEthernetData, getEthernetHeader, getEthernetHeaderLength, getEthernetProtocol, getHeader, getHeaderLength, getPacketData, getPacketLength, getProtocol, getSourceHwAddress, getSourceMACAddress, getTimeval, hashCode, setChecksums, setDestinationMACAddress, setEthernetProtocol, setSourceMACAddress, toByteArray, toString
 
Methods inherited from class net.sourceforge.jpcap.net.Packet
getChecksum, ipChecksum, isValidChecksum
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DTP.Packet

public DTP.Packet(int lLen,
                  byte[] bytes)
Creates a new DTP packet


DTP.Packet

public DTP.Packet(int lLen,
                  byte[] bytes,
                  Timeval tv)
Create a new DTP packet.


DTP.Packet

public DTP.Packet(int lLen,
                  ByteBuffer bb,
                  Timeval tv)
Create a new DTP packet

Parameters:
lLen - Packet length
bb - Packet bytes in a ByteBuffer
tv - TimeValue
Method Detail

getDTPVersion

public int getDTPVersion()

setDTPVersion

public void setDTPVersion(int version)
Set the DTP protocol version

Parameters:
version - DTP protocol version

getData

public byte[] getData()
Description copied from class: EthernetPacket
Fetch the data portion of the packet. This is overridden in derived classes to return successively smaller and smaller amounts of data. For example:

Overrides:
getData in class EthernetPacket

getDTPData

public byte[] getDTPData()
Returns:
a copy of the DTP data, which is a series of MIBs in the format type:length:value, where 'type' and 'length' are two bytes each and 'length' includes the length of 'type' and 'length': as the data is a copy, changing it has no effect on the DTP packet object.

setDTPData

public void setDTPData(byte[] data)
Set the DTP data payload.

Parameters:
data - Payload data.

toColoredString

public String toColoredString(boolean colored)
Description copied from class: EthernetPacket
Generate string with contents describing this packet.

Overrides:
toColoredString in class EthernetPacket
Parameters:
colored - whether or not the string should contain ansi color escape sequences.

Copyright © Patrick Charles & Jonas Lehmann, 2001; Esmond Pitt, 2008.