org.jnetpcap.packet
Interface JBinding

All Superinterfaces:
JDependency
All Known Implementing Classes:
AbstractBinding, AnnotatedBinding, JBinding.DefaultJBinding

public interface JBinding
extends JDependency

A bindinding between two protocol headers.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class JBinding.DefaultJBinding
          An abstract adaptor that provides a default implementation for a binding.
 
Field Summary
static int NULL_ID
          A status code that indicates that no protocol was matched.
 
Method Summary
 int getSourceId()
          Protocol header ID for this binding.
 int getTargetId()
          Protocol header ID to which this binding is bound to.
 boolean isBound(JPacket packet, int offset)
          Checks the length of the header that has not been bound yet.
 int[] listDependencies()
          A list of dependencies that a binding has.
 

Field Detail

NULL_ID

static final int NULL_ID
A status code that indicates that no protocol was matched.

See Also:
Constant Field Values
Method Detail

getTargetId

int getTargetId()
Protocol header ID to which this binding is bound to.

Returns:
numerical protocol ID as assigned by JRegistry

isBound

boolean isBound(JPacket packet,
                int offset)
Checks the length of the header that has not been bound yet. The returned length value provides 2 pieces of information. 1st, length of 0 indicates that the header is not bound. 2nd, length of non zero indicates that the header is bound and either the entire or trucated length of the header.

Parameters:
packet - packet and its data buffer
offset - offset into the packet data buffer where the end of the previous header is
Returns:
either full or truncated length of the header or 0 if header is not bound at all

listDependencies

int[] listDependencies()
A list of dependencies that a binding has.

Returns:
list of depdencies

getSourceId

int getSourceId()
Protocol header ID for this binding.

Returns:
numerical ID of the header as assigned by JRegistry