1. A method comprising: receiving, by a network interface of a network device, a packet stream; identifying one or more packets within the packet stream that satisfy one or more conditions of a plurality of predefined conditions specified by a rule by pre-matching, by an acceleration device of the network device, the packet stream with the plurality of predefined conditions; identifying, by the acceleration device, for a full-match processing stage a candidate packet of the one or more packets that satisfies all of the plurality of predefined conditions by correlating the one or more satisfied conditions of the candidate packet; generating, by the acceleration device, for use by the full-match processing stage a matching token and a corresponding location of the matching token within the candidate packet for each of the plurality of predefined conditions; and determining, by a context-aware pattern matching and parsing (CPMP) processor of the acceleration device, whether the candidate packet meets the rule by performing the full-match processing stage including fetching and executing special purpose CPMP instructions to perform context-aware pattern matching processing on the packet, wherein the context-aware pattern matching processing includes one or more of string matching, regular expression matching and packet field value matching based on, for each of the plurality of predefined conditions, corresponding contextual information provided by the rule, the matching token and the corresponding location.
1. A method comprising: receiving, by a network interface of a network device, a packet stream; identifying one or more packets within the packet stream that satisfy one or more conditions of a plurality of predefined conditions specified by a rule by pre-matching, by an acceleration device of the network device, the packet stream with the plurality of predefined conditions; identifying, by the acceleration device, for a full-match processing stage a candidate packet of the one or more packets that satisfies all of the plurality of predefined conditions by correlating the one or more satisfied conditions of the candidate packet; generating, by the acceleration device, for use by the full-match processing stage a matching token and a corresponding location of the matching token within the candidate packet for each of the plurality of predefined conditions; and determining, by a context-aware pattern matching and parsing (CPMP) processor of the acceleration device, whether the candidate packet meets the rule by performing the full-match processing stage including fetching and executing special purpose CPMP instructions to perform context-aware pattern matching processing on the packet, wherein the context-aware pattern matching processing includes one or more of string matching, regular expression matching and packet field value matching based on, for each of the plurality of predefined conditions, corresponding contextual information provided by the rule, the matching token and the corresponding location. 6. The method of claim 1 , wherein each of the plurality of predetermined conditions comprise one or more of field-level constraints, protocol-level constraints, string-level constraints and character-level constraints.