|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetstream.filter.bpf.BPFProgram
public class BPFProgram
A set of instructions compiled from a textual expression to a binary level which can be passed to a BPF VM for interpretation.
| Constructor Summary | |
|---|---|
BPFProgram(BPFInstruction[] code,
java.nio.ByteOrder order)
|
|
BPFProgram(byte[] pc)
Compiles the supplied rawBuffer BPF byte code array into a more java friendly BPFInstruction program. |
|
BPFProgram(java.lang.String tcpdumpText)
Initializes this BPF program from a tcpdump/libpcap generated pseudo code. |
|
| Method Summary | |
|---|---|
static BPFInstruction[] |
convertBE(byte[] program)
Converts a rawBuffer byte[] byte code into an array of more java friendly BPFInstructions. |
static BPFInstruction[] |
convertLE(byte[] program)
Converts a rawBuffer byte[] code into an array of more java friendly BPFInstructions. |
BPFInstruction[] |
getCode()
Gets the java friendly compiled BPF instruction code. |
java.nio.ByteOrder |
getEncoding()
Gets the byte encoding of this program. |
int |
getLength()
|
java.nio.ByteBuffer |
getRawBuffer()
Gets the raw byte code of this bpf program. |
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BPFProgram(BPFInstruction[] code,
java.nio.ByteOrder order)
public BPFProgram(byte[] pc)
throws IllegalInstructionException
IllegalInstructionException - if an unrecognized instruction is encountered in the pc array
public BPFProgram(java.lang.String tcpdumpText)
throws IllegalInstructionException
tcpdumpText - the pseudo code as generated by tcpdump/libpcap tools
IllegalInstructionException - if an unrecognized instruction is encountered| Method Detail |
|---|
public static BPFInstruction[] convertBE(byte[] program)
throws IllegalInstructionException
program - the rawBuffer byte code program to convert
IllegalInstructionException - if an unrecognized instruction is encountered
public static BPFInstruction[] convertLE(byte[] program)
throws IllegalInstructionException
program - the rawBuffer byte code program to convert
IllegalInstructionException - if an unrecognized instruction is encounteredpublic final BPFInstruction[] getCode()
public final java.nio.ByteOrder getEncoding()
public final int getLength()
public final java.nio.ByteBuffer getRawBuffer()
public java.lang.StringBuilder toBuffer(java.lang.StringBuilder buf)
buf -
public java.lang.StringBuilder toBufferCode(java.lang.StringBuilder buf)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toStringCode()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||