Packet::encode in packetlib