A method and apparatus are provided for implementing predefined actions
based upon packet classification and lookup results in a communications
network processor. A plurality of sets of rules is defined. Each rule set
includes at least one rule and each rule has a set of masked compares for
comparing results of hits and misses of table lookups. Each masked
compare set has an associated field for selecting an action. The action
defines a set of one or more commands and each command defines a
processing operation. One rule set is identified based upon the packet
classification result for a received packet. When one of the rules is
identified having a match of the masked compares, then the action of
associated with the identified rule is selected. Otherwise a default
action is provided responsive to no rule of the identified rule set
having a match of the masked compares.