摘要 |
A method and apparatus for protocol parsing are disclosed, the method includes: performing flow table matching on a received packet to recognize a protocol of the packet; and when a protocol type of the packet is recognized and it is determined that the protocol type of the packet is a text-based protocol type, performing keyword matching on the packet according to a keyword matching rule in a keyword library corresponding to the protocol type of the packet, and extracting content of a keyword to be parsed in the packet; wherein, the keyword matching rule in the keyword library includes a keyword to be parsed that is expressed by using a regular expression and content of the keyword. The present invention applies to a device that parses a protocol of a packet.
|