org.jnetpcap.protocol.tcpip
Class TcpDuplexStream

java.lang.Object
  extended by org.jnetpcap.nio.JMemory
      extended by org.jnetpcap.nio.JBuffer
          extended by org.jnetpcap.nio.JObjectBuffer
              extended by org.jnetpcap.nio.JStructBuffer
                  extended by org.jnetpcap.packet.analysis.AbstractAnalysis<TcpDuplexStream,TcpStreamEvent>
                      extended by org.jnetpcap.protocol.tcpip.TcpDuplexStream
All Implemented Interfaces:
java.lang.Iterable<JAnalysis>, JByteBuffer, JAnalysis

public class TcpDuplexStream
extends AbstractAnalysis<TcpDuplexStream,TcpStreamEvent>

The main tcp stream analysis object that keeps global properties about a tcp stream. It also consists of 2 uni-directional streams, that descrive various properties of the tcp stream in a single direction.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class TcpDuplexStream.Direction
           
 
Nested classes/interfaces inherited from class org.jnetpcap.nio.JStructBuffer
JStructBuffer.JStructField
 
Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory
JMemory.Type
 
Field Summary
static int FLAG_HAS_ERRORS
           
static int FLAG_HAS_FIN
           
static int FLAG_HAS_SYNCH
           
static int FLAG_HAS_WARNINGS
           
 
Fields inherited from class org.jnetpcap.nio.JObjectBuffer
REF
 
Fields inherited from class org.jnetpcap.nio.JMemory
JNETPCAP_LIBRARY_NAME
 
Constructor Summary
  TcpDuplexStream()
           
protected TcpDuplexStream(int hash, int client, int server, TcpAnalyzer analyzer)
           
 
Method Summary
<T extends JAnalysis>
T
getAnalysis(T analysis)
           
 TcpStream getClientStream()
           
 TcpDuplexStream.Direction getDirection(Tcp tcp)
           
 TcpStream getForward(int uniHash)
           
 TcpStream getForward(Tcp tcp)
           
 long getNormalizedAck(Tcp tcp)
           
 long getNormalizedSequence(Tcp tcp)
           
 TcpStream getReverse(int uniHash)
           
 TcpStream getReverse(Tcp tcp)
           
 TcpStream getServerStream()
           
 TcpAnalyzer.Stage getStage()
           
 long getTime()
           
<T extends JAnalysis>
boolean
hasAnalysis(java.lang.Class<T> analysis)
           
<T extends JAnalysis>
boolean
hasAnalysis(T analysis)
           
 int hashCode()
           
 boolean isInitialized()
          Checks if this peered object is initialized.
 void setStage(TcpAnalyzer.Stage stage)
           
 void setTime(long processingTime)
           
 java.lang.String toString()
           
 
Methods inherited from class org.jnetpcap.packet.analysis.AbstractAnalysis
addListener, getAnalyzer, getSupport, getText, getTitle, getType, hasAnalysis, iterator, peer, removeListener, setAnalyzer, setText
 
Methods inherited from class org.jnetpcap.nio.JStructBuffer
calcSize
 
Methods inherited from class org.jnetpcap.nio.JObjectBuffer
getObject, getObject, setObject, setObject, sizeofJObject
 
Methods inherited from class org.jnetpcap.nio.JBuffer
findUTF8String, getByte, getByteArray, getByteArray, getDouble, getFloat, getInt, getLong, getShort, getUByte, getUInt, getUShort, getUTF8Char, getUTF8String, getUTF8String, getUTF8String, getUTF8String, isReadonly, order, order, peer, peer, peer, peer, setByte, setByteArray, setByteBuffer, setDouble, setFloat, setInt, setLong, setShort, setUByte, setUInt, setUShort, transferFrom, transferFrom, transferFrom, transferTo, transferTo, transferTo
 
Methods inherited from class org.jnetpcap.nio.JMemory
check, cleanup, finalize, isJMemoryBasedOwner, isOwner, peer, setSize, size, toDebugString, toHexdump, toHexdump, totalActiveAllocated, totalAllocateCalls, totalAllocated, totalAllocatedSegments0To255Bytes, totalAllocatedSegments256OrAbove, totalDeAllocateCalls, totalDeAllocated, transferFrom, transferFrom, transferFromDirect, transferOwnership, transferTo, transferTo, transferTo, transferTo, transferTo
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jnetpcap.nio.JByteBuffer
size
 

Field Detail

FLAG_HAS_ERRORS

public static final int FLAG_HAS_ERRORS
See Also:
Constant Field Values

FLAG_HAS_FIN

public static final int FLAG_HAS_FIN
See Also:
Constant Field Values

FLAG_HAS_SYNCH

public static final int FLAG_HAS_SYNCH
See Also:
Constant Field Values

FLAG_HAS_WARNINGS

public static final int FLAG_HAS_WARNINGS
See Also:
Constant Field Values
Constructor Detail

TcpDuplexStream

public TcpDuplexStream()
Parameters:
type -
size -

TcpDuplexStream

protected TcpDuplexStream(int hash,
                          int client,
                          int server,
                          TcpAnalyzer analyzer)
Parameters:
support - TODO
type -
size -
name -
Method Detail

getAnalysis

public <T extends JAnalysis> T getAnalysis(T analysis)
Specified by:
getAnalysis in interface JAnalysis
Overrides:
getAnalysis in class AbstractAnalysis<TcpDuplexStream,TcpStreamEvent>

getClientStream

public TcpStream getClientStream()

getDirection

public TcpDuplexStream.Direction getDirection(Tcp tcp)

getForward

public TcpStream getForward(int uniHash)
                     throws TcpInvalidStreamHashcode
Throws:
TcpInvalidStreamHashcode

getForward

public TcpStream getForward(Tcp tcp)

getReverse

public TcpStream getReverse(int uniHash)
                     throws TcpInvalidStreamHashcode
Throws:
TcpInvalidStreamHashcode

getReverse

public TcpStream getReverse(Tcp tcp)

getServerStream

public TcpStream getServerStream()

getStage

public TcpAnalyzer.Stage getStage()

getTime

public long getTime()

hasAnalysis

public <T extends JAnalysis> boolean hasAnalysis(java.lang.Class<T> analysis)
Specified by:
hasAnalysis in interface JAnalysis
Overrides:
hasAnalysis in class AbstractAnalysis<TcpDuplexStream,TcpStreamEvent>

hasAnalysis

public <T extends JAnalysis> boolean hasAnalysis(T analysis)
Specified by:
hasAnalysis in interface JAnalysis
Overrides:
hasAnalysis in class AbstractAnalysis<TcpDuplexStream,TcpStreamEvent>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isInitialized

public boolean isInitialized()
Description copied from class: JMemory
Checks if this peered object is initialized. This method does not throw any exceptions.

Overrides:
isInitialized in class JMemory
Returns:
if initialized true is returned, otherwise false

setStage

public void setStage(TcpAnalyzer.Stage stage)
Parameters:
syn_wait1 -

setTime

public void setTime(long processingTime)
Parameters:
processingTime -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNormalizedSequence

public long getNormalizedSequence(Tcp tcp)
Parameters:
tcp -
Returns:

getNormalizedAck

public long getNormalizedAck(Tcp tcp)
Parameters:
tcp -
Returns: