Patent ID: 8065721

Claim:
A method comprising: receiving configuration input defining a plurality of filters for a network device, wherein each of the plurality of filters includes one or more rules, wherein each of the rules includes a matching criteria and a corresponding action, wherein each of the filters is associated with at least one of a plurality of filter matching modules provided by hardware components of the network device, and wherein the filter matching modules apply the filters to packets in a forwarding path internal to the network device; merging two or more of the plurality of filters that are each associated with a different one of the plurality of filter matching modules into a single merged filter, wherein merging two or more of the plurality of filters comprises taking the intersection of the matching criteria and the union of the actions of each of the rules for each of the two or more of the plurality of filters; storing the merged filter to a filter memory within the network device; and applying the merged filter to packets in the forwarding path.