|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public static interface Scanner.Scandec
Scanner's Decoder or Scandec for short. Is deceptively simple interface that accomplishes several tasks. Scandecs are deployed along with protocol bindings and are a merger of a protocol binding information any NPL header length formulas. In addition any assert conditions within the NPL definition are applied as well.
The primary task of a Scandec is to determine if all the conditions of a scandec are met and the header that the scandec represents exists. The second task is to return the length of the header. If length returned by a Scandec is greater then -1, that means that the header exists or was found to exist and the value is the actual length of the header in bits. A lenth of 0 actually means that that the match was on a ProtocolGroup and its not a physical header that exists.
Scandecs read data directly from raw buffers and do not rely on HeaderCodecs or java Protocol classes. The Scandecs may be autogenerated or custom written in java or BPF byte code. They do not instantiate any objects and are really fast at runtime to execute.
| Method Summary | |
|---|---|
int |
getLength(com.slytechs.utils.memory.BitBuffer buffer,
int source,
int sink)
Returns the length of the sink header for which this scandec was built. |
| Method Detail |
|---|
int getLength(com.slytechs.utils.memory.BitBuffer buffer,
int source,
int sink)
Returns the length of the sink header for which this scandec was built. A length of -1 means that the header does not exist in the packet buffer or that 1 or more assert conditions originally defined within the source NPL definition did not pass, evaluate to true.
buffer - packet runtime environment used to access the raw buffer and
possibly some static properties; it is not used to access codecs
or other decoded headerssource - offset of the source header in bits from the start of the raw
buffersink - bit offset into the buffer of the sink protocol under evaluation
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||