[PATCH v3 07/20] flow: Add helper to determine a flow's protocol