net.sourceforge.jpcap.net
Class TCPEncoding

java.lang.Object
  |
  +--net.sourceforge.jpcap.net.TCPEncoding

public class TCPEncoding
extends java.lang.Object

TCP protocol encoding information.


Field Summary
static int HEADER_LEN
          Length in bytes of a TCP header.
 
Constructor Summary
TCPEncoding()
           
 
Method Summary
static TCPPacket create(int lLen, byte[] bytes)
          TCPPacket factory.
static int extractTCPDstPort(int lLen, byte[] packetBytes)
          Extract the destination port from a tcp packet.
static int extractTCPSrcPort(int lLen, byte[] packetBytes)
          Extract the source port from a tcp packet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_LEN

public static final int HEADER_LEN
Length in bytes of a TCP header.
Constructor Detail

TCPEncoding

public TCPEncoding()
Method Detail

create

public static TCPPacket create(int lLen,
                               byte[] bytes)
TCPPacket factory.

extractTCPSrcPort

public static int extractTCPSrcPort(int lLen,
                                    byte[] packetBytes)
Extract the source port from a tcp packet.
Parameters:
llen - the length of the link-level header.
packetBytes - packet bytes, including the link-layer and IP headers.

extractTCPDstPort

public static int extractTCPDstPort(int lLen,
                                    byte[] packetBytes)
Extract the destination port from a tcp packet.
Parameters:
llen - the length of the link-level header.
packetBytes - packet bytes, including the link-layer and IP headers.