2. The method of claim 1 wherein storing the multi-rule header of the multi-rule further includes storing, consecutively, a rule validity value for each of the key matching rules of the chunk in which storing a first value for the rule validity value corresponding to a subject key matching rule enables matching of the subject key matching rule, while storing a second value instead of the first value disables matching of the subject key matching rule.
1. A method for encoding a plurality of key matching rules grouped in a chunk, each of the key matching rules beginning with a header and having at least one dimension, the method comprising: in a rule encoding engine, communicatively coupled to memory and provided with a chunk of key matching rules, building a multi-rule corresponding to the chunk comprising: storing in the memory a multi-rule header of the multi-rule, the multi-rule header representing, collectively, a plurality of headers stored one after the other, the multi-rule header being decoded by a rule matching engine in a single decode operation to extract the plurality of headers of the key matching rules, wherein the plurality of headers include values which control the rule matching engine processing of the key matching rules, including dimensions, the rule matching engine formats the key matching rules based on a key and matches the key matching rules against the key to find a match based on the values stored in the plurality of headers.