Miscellaneous sniffer utility code