net.sourceforge.jpcap.net
Class TCPPacket

java.lang.Object
  |
  +--net.sourceforge.jpcap.net.Packet
        |
        +--net.sourceforge.jpcap.net.EthernetPacket
              |
              +--net.sourceforge.jpcap.net.IPPacket
                    |
                    +--net.sourceforge.jpcap.net.TCPPacket

public class TCPPacket
extends IPPacket

A TCP packet.

Extends an IP packet, adding a TCP header and TCP data payload.


Constructor Summary
TCPPacket(int lLen, byte[] bytes, java.lang.String macSourceAddress, java.lang.String macDestinationAddress, java.lang.String sourceAddress, int sourcePort, java.lang.String destinationAddress, int destinationPort, int ipProtocol)
          Create a new TCP packet.
 
Method Summary
 byte[] getData()
          Fetch data portion of the tcp header.
 int getDestinationPort()
           
 byte[] getHeader()
          Fetch the tcp header, excluding tcp data payload.
 int getSourcePort()
           
 java.lang.String toString()
          Convert this TCP packet to a readable string.
 
Methods inherited from class net.sourceforge.jpcap.net.IPPacket
getDestinationAddress, getProtocol, getSourceAddress
 
Methods inherited from class net.sourceforge.jpcap.net.EthernetPacket
getDestinationHwAddress, getSourceHwAddress, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TCPPacket

public TCPPacket(int lLen,
                 byte[] bytes,
                 java.lang.String macSourceAddress,
                 java.lang.String macDestinationAddress,
                 java.lang.String sourceAddress,
                 int sourcePort,
                 java.lang.String destinationAddress,
                 int destinationPort,
                 int ipProtocol)
Create a new TCP packet.
Method Detail

getSourcePort

public int getSourcePort()

getDestinationPort

public int getDestinationPort()

getHeader

public byte[] getHeader()
Fetch the tcp header, excluding tcp data payload.
Overrides:
getHeader in class IPPacket

getData

public byte[] getData()
Fetch data portion of the tcp header.
Overrides:
getData in class IPPacket

toString

public java.lang.String toString()
Convert this TCP packet to a readable string.
Overrides:
toString in class IPPacket