Creating Packet Filters 12-15
4 Enter executable instruction #3:
eq # if the two values on the top of the stack are equal,
# then return a non-zero value
Packet Filter Two. This filter is designed to accept packets within the
socket range of 0x76c and 0x898. These steps show how to create this filter:
1 Name the filter:
“Socket range filter”
2 Enter executable instruction #1:
pushLiteral.w 0x76c # put the lowest socket value on top
# of the stack
3 Enter executable instruction #2:
pushField.w 30 # put the value of the socket from the
# packet on top of the stack
4 Enter executable instruction #3:
ge # compare if the value of the socket is greater than
# or equal to the lower bound
5 Enter executable instruction #4:
pushLiteral.w 0x0898 # put the highest socket value on
# top of the stack
6 Enter executable instruction #5:
pushField.w 30 # put the value of the socket from the
# packet on top of the stack
7 Enter executable instruction #6:
lt # compare if the value of the socket is less than the
# upper bound
8 Enter executable instruction #7:
and # “and” together with “ge” and “lt” test to determine
# if the socket value is “within” the range. If it is,
# a “one” will be placed on the stack.