IPfilter refactored to reduce complexity and for better packet-rule
matching.