|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Header
Super interface of all headers contained within a packet. Each packet contans 0 or more protocol specific headers that are typically daisy chained. The header are part of the packet data as returned by live packet capture or as read from a capture/trace file.
This header interface does not provide any mutable methods outside of returning a mutable ByteBuffer with the header's content. The reason for this is that the header structure is built based upon the contents of the buffer and the header's NPL definition. If the header's contents have been modified structurally the entire has to be redecoded again.
The interface does not provide any methods with dealing with fields within this header or sub headers if they exist. You use the type specific header interface to check for existance of fields and sub headers and then access those fields and sub headers.
| Nested Class Summary | |
|---|---|
static class |
Header.DynamicProperty
Common properties found in every header that are dynamic. |
static class |
Header.StaticProperty
Constants which define various automatic and user defined properties. |
| Nested classes/interfaces inherited from interface com.slytechs.utils.namespace.Named |
|---|
com.slytechs.utils.namespace.Named.Util |
| Method Summary | ||
|---|---|---|
Field<?>[] |
getAllFields()
|
|
Header[] |
getAllHeaders()
|
|
com.slytechs.utils.memory.BitBuffer |
getBuffer()
Returns buffer containing the header's data. |
|
|
getField(DataField field)
Retrieves field's runtime environment. |
|
int |
getLength()
Returns the length of this header in bytes. |
|
java.lang.String |
getName()
Returns the NPL name of this header. |
|
int |
getOffset()
Position or offset from the start of the packet buffer this buffer belongs to. |
|
|
getProperty(Header.DynamicProperty key)
|
|
|
getProperty(Header.StaticProperty key)
|
|
|
getProperty(java.lang.String name)
|
|
Protocol |
getProtocol()
|
|
java.lang.Class<? extends Header> |
getType()
|
|
boolean |
isTruncated()
Tells if this header has been truncated or if all of the headers contents are contained within the packet buffer. |
|
| Methods inherited from interface org.jnetstream.packet.HeaderElement |
|---|
getFieldConstant |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Method Detail |
|---|
java.lang.String getName()
getName in interface com.slytechs.utils.namespace.Named
boolean isTruncated()
throws java.io.IOException
java.io.IOExceptionint getOffset()
int getLength()
com.slytechs.utils.memory.BitBuffer getBuffer()
throws java.io.IOException
getPosition(), getPosition() + getLength()
and getPosition() +
getLength() respectively. No new data is
allocated and any changes to the returned header buffer are also reflected
in the backing packet buffer.
java.io.IOException
<T> Field<T> getField(DataField field)
throws CodecException,
java.io.IOException
T - value type of the fieldc - class of the field's runtime environment
java.io.IOException
CodecExceptionjava.lang.Class<? extends Header> getType()
<T> T getProperty(Header.StaticProperty key)
key -
<T> T getProperty(Header.DynamicProperty key)
key -
<T> T getProperty(java.lang.String name)
T - name -
Protocol getProtocol()
Field<?>[] getAllFields()
Header[] getAllHeaders()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||