|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.nio.JMemory
org.jnetpcap.nio.JBuffer
org.jnetpcap.packet.JHeader
public abstract class JHeader
A base class for all protocol header definitions.
| Nested Class Summary | |
|---|---|
static class |
JHeader.State
This class is peered state of a header a native state structure |
| Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory |
|---|
JMemory.Type |
| Field Summary | |
|---|---|
protected AnnotatedHeader |
annotatedHeader
|
protected static JHeader[] |
EMPTY_HEADER_ARRAY
|
protected boolean |
isSubHeader
|
protected JPacket |
packet
A reference to the packet that this header is part of |
protected JHeader.State |
state
Reference to header's native state structure |
| Fields inherited from class org.jnetpcap.nio.JMemory |
|---|
JNETPCAP_LIBRARY_NAME |
| Constructor Summary | |
|---|---|
JHeader()
Calls on the header defintion's static annotated \@HeaderLength method to get header's length. |
|
JHeader(int id,
JField[] fields,
java.lang.String name)
Constructs a header and initializes its static fields |
|
JHeader(int id,
JField[] fields,
java.lang.String name,
java.lang.String nicname)
Constructs a header and initializes its static fields |
|
JHeader(int id,
java.lang.String name)
Constructs a header. |
|
JHeader(int id,
java.lang.String name,
java.lang.String nicname)
Constructs a header. |
|
JHeader(JHeader.State state,
JField[] fields,
java.lang.String name,
java.lang.String nicname)
Constructs a header and initializes its static fields |
|
JHeader(JProtocol protocol)
|
|
| Method Summary | ||
|---|---|---|
void |
addAnalysis(JAnalysis analysis)
|
|
void |
decode()
Method that gets called everytime a header is successfully peered with new buffer and/or state structure. |
|
protected void |
decodeHeader()
Allows a header to decode its complex fields |
|
|
getAnalysis(T analysis)
|
|
java.lang.Iterable<JAnalysis> |
getAnalysisIterable()
|
|
AnnotatedHeader |
getAnnotatedHeader()
|
|
java.lang.String |
getDescription()
|
|
JField[] |
getFields()
Retrieves the fields at runtime, that this header has so that they may be used by a formatter |
|
int |
getId()
Gets the numerical ID of this protocol header at runtime as assigned by the JRegistry |
|
int |
getLength()
Length of this header within the buffer |
|
java.lang.String |
getName()
Gets the comprehensive name for this header |
|
java.lang.String |
getNicname()
Gets the short name for this header |
|
int |
getOffset()
Offset into the packet buffer |
|
JPacket |
getPacket()
Gets the packet that this header is associated with |
|
JHeader |
getParent()
|
|
JHeader.State |
getState()
Gets the reference to the current header's native state structure |
|
JHeader[] |
getSubHeaders()
Gets an array of currently defined sub headers |
|
int |
getType()
|
|
boolean |
hasAnalysis(java.lang.Class<? extends JAnalysis> analysis)
|
|
boolean |
hasAnalysis(int type)
|
|
|
hasAnalysis(T analysis)
|
|
boolean |
hasDescription()
|
|
boolean |
hasSubHeaders()
|
|
int |
peer(JBuffer buffer,
int offset)
|
|
int |
peer(JHeader header)
Peers, associates a native packet buffer and scanner structure with this header. |
|
void |
setPacket(JPacket packet)
Sets the packet that this header should be associated with |
|
void |
setSubHeaders(JHeader[] headers)
|
|
static int |
sizeof()
Gets the size of the native header_t structure on this particular platform |
|
java.lang.String |
toString()
Gets a string with summary information about the header. |
|
protected void |
validateHeader()
Allows a header to validate its values |
|
| 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, isInitialized, 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, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jnetpcap.nio.JByteBuffer |
|---|
size |
| Field Detail |
|---|
protected static final JHeader[] EMPTY_HEADER_ARRAY
protected AnnotatedHeader annotatedHeader
protected boolean isSubHeader
protected JPacket packet
protected final JHeader.State state
| Constructor Detail |
|---|
public JHeader()
public JHeader(int id,
JField[] fields,
java.lang.String name)
id - numerical ID of the protocolfields - fields usd by the formatter to reformat the packet for outputname - comprehensive name of the protocol
public JHeader(int id,
JField[] fields,
java.lang.String name,
java.lang.String nicname)
id - numerical ID of the protocolfields - fields usd by the formatter to reformat the packet for outputname - comprehensive name of the protocolnicname - a short name for the protocol
public JHeader(int id,
java.lang.String name)
id - numerical ID of the protocolname - comprehensive name of the protocol
public JHeader(int id,
java.lang.String name,
java.lang.String nicname)
id - numerical ID of the protocolname - comprehensive name of the protocolnicname - a short name for the protocolpublic JHeader(JProtocol protocol)
public JHeader(JHeader.State state,
JField[] fields,
java.lang.String name,
java.lang.String nicname)
state - the default header state object being referencedfields - fields usd by the formatter to reformat the packet for outputname - comprehensive name of the protocolnicname - a short name for the protocol| Method Detail |
|---|
public static int sizeof()
public final void decode()
protected void decodeHeader()
public void addAnalysis(JAnalysis analysis)
public <T extends JAnalysis> T getAnalysis(T analysis)
public AnnotatedHeader getAnnotatedHeader()
public java.lang.String getDescription()
public JField[] getFields()
public final int getId()
public int getLength()
public final java.lang.String getName()
public final java.lang.String getNicname()
public int getOffset()
public final JPacket getPacket()
public JHeader getParent()
public JHeader.State getState()
public JHeader[] getSubHeaders()
public int getType()
public boolean hasAnalysis(int type)
public boolean hasAnalysis(java.lang.Class<? extends JAnalysis> analysis)
public <T extends JAnalysis> boolean hasAnalysis(T analysis)
public boolean hasDescription()
public boolean hasSubHeaders()
public int peer(JBuffer buffer,
int offset)
public int peer(JHeader header)
header - the header to peer with this header
public final void setPacket(JPacket packet)
packet - packet to associate with this headerpublic void setSubHeaders(JHeader[] headers)
public java.lang.String toString()
toString in class java.lang.Objectprotected void validateHeader()
public java.lang.Iterable<JAnalysis> getAnalysisIterable()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||