org.jnetstream.filter.bpf
Class PcapDebugFilter

java.lang.Object
  extended by org.jnetstream.filter.bpf.BPFFilter<ProtocolFilterTarget>
      extended by org.jnetstream.filter.bpf.PcapFilter
          extended by org.jnetstream.filter.bpf.PcapDebugFilter
All Implemented Interfaces:
Filter<ProtocolFilterTarget>, FilterExpression<BPFProgram>

public class PcapDebugFilter
extends PcapFilter

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jnetstream.filter.bpf.BPFFilter
BPFFilter.BPFProtocolFilter
 
Nested classes/interfaces inherited from interface org.jnetstream.filter.FilterExpression
FilterExpression.FilterExpressionType
 
Nested classes/interfaces inherited from interface org.jnetstream.filter.Filter
Filter.AND<T extends FilterTarget>, Filter.MAXIMUM<T extends FilterTarget>, Filter.MINIMUM<T extends FilterTarget>, Filter.NOT<T extends FilterTarget>, Filter.OR<T extends FilterTarget>
 
Field Summary
static java.lang.String TYPE
           
 
Fields inherited from interface org.jnetstream.filter.Filter
TRUE
 
Constructor Summary
PcapDebugFilter(java.lang.String tcpdumpOutput, FilterTarget target)
           
 
Method Summary
 BPFProgram compile(FilterTarget target)
          Compiles the current expression for target and returns the compiled result
static BPFInstruction[] compileTcpdumpOutput(java.lang.String text)
          Compiles a tcpdump/libpcap generated pseudo BPF code to binary form suitable for use with BPFProgram.
 
Methods inherited from class org.jnetstream.filter.bpf.PcapFilter
getExpression, getExpressionType
 
Methods inherited from class org.jnetstream.filter.bpf.BPFFilter
accept, execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values
Constructor Detail

PcapDebugFilter

public PcapDebugFilter(java.lang.String tcpdumpOutput,
                       FilterTarget target)
                throws IllegalInstructionException
Throws:
IllegalInstructionException
Method Detail

compileTcpdumpOutput

public static BPFInstruction[] compileTcpdumpOutput(java.lang.String text)
                                             throws IllegalInstructionException
Compiles a tcpdump/libpcap generated pseudo BPF code to binary form suitable for use with BPFProgram.

Parameters:
text - the textual pseudo code as generated by tcpdump/libpcap tools
Returns:
array of compiled BPFInstructions that are more java friendly
Throws:
IllegalInstructionException - if an unrecognized instruction is encountered

compile

public BPFProgram compile(FilterTarget target)
                   throws FilterSyntaxError,
                          FilterNotFoundException
Description copied from interface: FilterExpression
Compiles the current expression for target and returns the compiled result

Specified by:
compile in interface FilterExpression<BPFProgram>
Overrides:
compile in class BPFFilter<ProtocolFilterTarget>
Parameters:
target - target for which to compile the expression
Returns:
result of the compilation
Throws:
FilterSyntaxError - any Syntax errors generated during the expression
FilterNotFoundException