Part of #45186. Split the code that parses the packet header out from the Packet initializer into a Packet.parse() classmethod (for the time being), so that in the future, PacketsDefinition can already parse the header when figuring out whether it's a type or packet definition and then directly pass that info to Packet().
Part of #45186. Split the code that parses the packet header out from the Packet initializer into a Packet.parse() classmethod (for the time being), so that in the future, PacketsDefinition can already parse the header when figuring out whether it's a type or packet definition and then directly pass that info to Packet().