A Real-Time Ad Hoc Packet Matching Technique for Hardware-Based Network Intrusion Detection Systems