1. A method of handling a frame in a network device, the method comprising: defining a common header for each rule in a rules table of a search engine, wherein the common header comprises a source port specifying a corresponding rule to be applied to a port or ports, and a frame format specifying a format applied to the corresponding rule; receiving a frame, with the frame having multiple field values, at the port of the network device; parsing the received frame to obtain the field values and corresponding slices; applying the slices to the search engine; determining matches between the slices and the common header of each rule in the rules table; indexing into a policy table based on the determined matches to obtain an action entry; and taking an action based on the obtained action entry.