ptp: Add generic ptp v2 header parsing function