Versatile packet parser