12-4 CHAPTER 12: CREATING AND USING PACKET FILTERS
Concepts for Writing Before writing a packet filter, you should understand thsee basic concepts:
a Filter
■How the packet filter language works
■The basic elements of a packet filter
■How to implement sequential tests in a packet filter
■The
How the Packet Filter Language Works
You define packet filters using a simple,
A program in the packet filter language consists of a series of one or more instructions that results in the top of the stack containing a byte value after execution of the last instruction in the program. This byte value determines whether to forward or discard the packet.
In this
■push operands onto the stack
■pop the operands from the stack for comparison purposes
■push the results back onto the stack
Therefore, with the exception of the push instructions, instructions (such as logical operators) locate their operands implicitly and do not require additional operand specifiers in the instruction stream.
Opcodes are the variables used to identify the type of operands and operators you are specifying in the packet filter instructions.