factorized QPacketSniffer code