Added methods to Packet to work with generic types