Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.voytechs.jnetanalyzer.tcp
Class TCPSegment  view TCPSegment download TCPSegment.java

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended bycom.voytechs.util.ObjectProperties
              extended bycom.voytechs.jnetanalyzer.message.MessageProperties
                  extended bycom.voytechs.jnetanalyzer.message.MessageSegment
                      extended bycom.voytechs.jnetanalyzer.message.PacketMessageSegment
                          extended bycom.voytechs.jnetanalyzer.tcp.TCPSegment
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class TCPSegment
extends com.voytechs.jnetanalyzer.message.PacketMessageSegment


Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private static boolean debug
           
private  com.voytechs.jnetstream.protocol.layer3.IPv4 ip
           
private  int segmentLen
           
private  com.voytechs.jnetstream.protocol.layer4.TCP tcp
           
 
Fields inherited from class com.voytechs.jnetanalyzer.message.PacketMessageSegment
 
Fields inherited from class com.voytechs.jnetanalyzer.message.MessageSegment
 
Fields inherited from class com.voytechs.util.ObjectProperties
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
TCPSegment(com.voytechs.jnetstream.codec.Packet pkt)
          Initialize the TCP segment from packet information.
TCPSegment(com.voytechs.jnetstream.protocol.layer4.TCP tcp, com.voytechs.jnetstream.codec.Packet pkt, long seq, int len)
           
 
Method Summary
private  void calculateTcpPayloadLength()
          Calculates the length of the TCP payload.
 long getAck()
          Return the acknoledgement.
 com.voytechs.jnetstream.protocol.layer3.IPv4 getIPv4Header()
          Returns the tcp header.
 int getLength()
          Return the length of the tcp segment.
 com.voytechs.jnetstream.protocol.layer4.TCP getTCPHeader()
          Returns the tcp header.
static void main(java.lang.String[] args)
          Test function for TCPSegment
 
Methods inherited from class com.voytechs.jnetanalyzer.message.PacketMessageSegment
getPacket
 
Methods inherited from class com.voytechs.jnetanalyzer.message.MessageSegment
getSeq, init
 
Methods inherited from class com.voytechs.util.ObjectProperties
addListener, booleanValue, floatValue, intValue, longValue, setSource, stringValue
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

private static final boolean debug
See Also:
Constant Field Values

tcp

private com.voytechs.jnetstream.protocol.layer4.TCP tcp

ip

private com.voytechs.jnetstream.protocol.layer3.IPv4 ip

segmentLen

private int segmentLen
Constructor Detail

TCPSegment

public TCPSegment(com.voytechs.jnetstream.codec.Packet pkt)
Initialize the TCP segment from packet information.


TCPSegment

public TCPSegment(com.voytechs.jnetstream.protocol.layer4.TCP tcp,
                  com.voytechs.jnetstream.codec.Packet pkt,
                  long seq,
                  int len)
Method Detail

getTCPHeader

public com.voytechs.jnetstream.protocol.layer4.TCP getTCPHeader()
Returns the tcp header.


getIPv4Header

public com.voytechs.jnetstream.protocol.layer3.IPv4 getIPv4Header()
Returns the tcp header.


getLength

public int getLength()
Return the length of the tcp segment. A -1 means its not initialized yet.


getAck

public long getAck()
Return the acknoledgement.


calculateTcpPayloadLength

private void calculateTcpPayloadLength()
Calculates the length of the TCP payload. Extracts ip.len field and subtracts ip and TCP header lengths.


main

public static void main(java.lang.String[] args)
Test function for TCPSegment