jnetpcap.filter.bpf
Class BPFProgram

java.lang.Object
  extended by jnetpcap.filter.bpf.BPFProgram

public class BPFProgram
extends java.lang.Object

A set of instructions compiled from a textual expression to a binary level which can be passed to a BPF VM for interpretation.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Constructor Summary
BPFProgram(byte[] pc)
           
BPFProgram(java.lang.String tcpdumpText)
           
 
Method Summary
static BPFInstruction[] compileTcpdumpOutput(java.lang.String text)
           
static BPFInstruction[] convertBE(byte[] program)
           
static BPFInstruction[] convertLE(byte[] program)
           
 BPFInstruction[] getCode()
           
 java.nio.ByteOrder getEncoding()
           
 int getLength()
           
 java.nio.ByteBuffer getRaw()
           
 java.lang.StringBuilder toBuffer(java.lang.StringBuilder buf)
           
 java.lang.StringBuilder toBufferCode(java.lang.StringBuilder buf)
           
 java.lang.String toString()
           
 java.lang.String toStringCode()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BPFProgram

public BPFProgram(byte[] pc)
           throws IllegalInstruction
Throws:
IllegalInstruction

BPFProgram

public BPFProgram(java.lang.String tcpdumpText)
           throws IllegalInstruction
Throws:
IllegalInstruction
Method Detail

convertBE

public static BPFInstruction[] convertBE(byte[] program)
                                  throws IllegalInstruction
Throws:
IllegalInstruction

convertLE

public static BPFInstruction[] convertLE(byte[] program)
                                  throws IllegalInstruction
Throws:
IllegalInstruction

compileTcpdumpOutput

public static BPFInstruction[] compileTcpdumpOutput(java.lang.String text)
                                             throws IllegalInstruction
Throws:
IllegalInstruction

getCode

public final BPFInstruction[] getCode()
Returns:
Returns the code.

getEncoding

public final java.nio.ByteOrder getEncoding()
Returns:
Returns the encoding.

getLength

public final int getLength()
Returns:
Returns the length.

getRaw

public final java.nio.ByteBuffer getRaw()
Returns:
Returns the raw.

toBuffer

public java.lang.StringBuilder toBuffer(java.lang.StringBuilder buf)

toBufferCode

public java.lang.StringBuilder toBufferCode(java.lang.StringBuilder buf)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringCode

public java.lang.String toStringCode()
Returns: