Code for packet classification.