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.
@author Mark Bednarczyk @author Sly Technologies, Inc.
|
|
|
|