The present application describes a compiler of a network packet
classification programming language that generates code for processors
such as an application processor and a processing engine. The programming
language includes a variety of instructions including an instruction to
declare a network protocol and an instruction to specify a rule and at
least one action to perform if the rule applies. A processor executing
instructions generated by the compiler assigns values based on
instructions to declare a network protocol and applies the rule
instructions to received packets. The programming language may also
include other instructions such as an instruction to search a set of
values and identify whether an encapsulated packet header is present in a
packet.