org.jnetpcap.packet
Class JScan

java.lang.Object
  extended by org.jnetpcap.nio.JMemory
      extended by org.jnetpcap.nio.JStruct
          extended by org.jnetpcap.packet.JScan

public class JScan
extends JStruct

A inprogress working scan structure. Used by JScanner to pass around information between various scan routines. This class is peered with scan_t structure that is used to pass information both between native header scanners and java scanners.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory
JMemory.Type
 
Field Summary
static int END_OF_HEADERS_ID
          Special header ID that when used with a scanner's next_id variable, indicates that this is the last header and scanner should exit its loop.
 
Fields inherited from class org.jnetpcap.nio.JMemory
JNETPCAP_LIBRARY_NAME
 
Constructor Summary
JScan()
          Alocates and creates scan_t structure in native memory
JScan(JMemory.Type type)
          Creates an uninitialized scan structure
 
Method Summary
 void record_header()
           
 void scan_buf_len(int size)
          Size of packet data
 void scan_buf(JBuffer buffer)
          Gets the current packet data buffer
 int scan_id()
           
 void scan_id(int id)
           
 int scan_length()
           
 void scan_length(int length)
           
 int scan_next_id()
           
 void scan_next_id(int next_id)
           
 int scan_offset()
          Gets teh curren offset by the dscanner into the packet buffer
 void scan_offset(int offset)
          Sets the current offset by the scanner into the packet buffer
 JPacket scan_packet()
          Java packet that is being processed
static int sizeof()
          Size in bytes of the native scan_t structure on this particular platform
 
Methods inherited from class org.jnetpcap.nio.JStruct
getStructName, toString
 
Methods inherited from class org.jnetpcap.nio.JMemory
check, cleanup, finalize, isInitialized, isJMemoryBasedOwner, isOwner, peer, peer, peer, setSize, size, toDebugString, toHexdump, toHexdump, totalActiveAllocated, totalAllocateCalls, totalAllocated, totalAllocatedSegments0To255Bytes, totalAllocatedSegments256OrAbove, totalDeAllocateCalls, totalDeAllocated, transferFrom, transferFrom, transferFrom, transferFrom, transferFromDirect, transferOwnership, transferTo, transferTo, transferTo, transferTo, transferTo, transferTo, transferTo
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

END_OF_HEADERS_ID

public static final int END_OF_HEADERS_ID
Special header ID that when used with a scanner's next_id variable, indicates that this is the last header and scanner should exit its loop. The constant can be used both in java and in JNI code.

See Also:
Constant Field Values
Constructor Detail

JScan

public JScan()
Alocates and creates scan_t structure in native memory


JScan

public JScan(JMemory.Type type)
Creates an uninitialized scan structure

Parameters:
type - memory type
Method Detail

scan_id

public int scan_id()

scan_next_id

public int scan_next_id()

scan_length

public int scan_length()

scan_id

public void scan_id(int id)

scan_next_id

public void scan_next_id(int next_id)

scan_length

public void scan_length(int length)

record_header

public void record_header()

sizeof

public static int sizeof()
Size in bytes of the native scan_t structure on this particular platform

Returns:
size in bytes

scan_buf

public void scan_buf(JBuffer buffer)
Gets the current packet data buffer

Parameters:
buffer - packet data buffer

scan_buf_len

public void scan_buf_len(int size)
Size of packet data

Parameters:
size - length in bytes

scan_offset

public void scan_offset(int offset)
Sets the current offset by the scanner into the packet buffer

Parameters:
offset - offset in bytes

scan_packet

public JPacket scan_packet()
Java packet that is being processed

Returns:
the packet instance being currently processed

scan_offset

public int scan_offset()
Gets teh curren offset by the dscanner into the packet buffer

Returns:
offset in bytes