1. An apparatus for processing a packet comprising: a tree walk engine (TWE) configured to: receive a key request including a key, the key including data extracted from a packet; parse the key to extract at least one field; select at least one entry in a tree access table indicated by the key request, the entry providing an address of a set of rules stored in a memory; and process the entry, based on the at least one field, to determine at least one bucket having an ordered set of bucket entries, the bucket entries including pointers to respective subsets of rules, the subsets of rules each being a portion of the set of rules; a bucket-walk engine (BWE) configured to retrieve a selection of the subsets of rules from the memory, the selection corresponding to a configuration of the bucket; a rule-matching engine (RME) configured to apply the at least one field against the selection and output a response signal.