Parse packet type