subType; } /** * @param int $subType */ public function setSubType(int $subType): void { $this->subType = $subType; } /** * @return string */ public function getHostname(): string { return $this->hostname; } /** * @param string $hostname */ public function setHostname(string $hostname): void { $this->hostname = $hostname; } /** * {@inheritdoc} * * @throws \InvalidArgumentException */ public function toText(): string { if (!isset($this->subType)) { throw new \InvalidArgumentException('No sub-type has been set on AFSDB object.'); } if (!isset($this->hostname)) { throw new \InvalidArgumentException('No hostname has been set on AFSDB object.'); } return sprintf('%d %s', $this->subType, $this->hostname); } /** * {@inheritdoc} */ public function toWire(): string { return pack('n', $this->subType).self::encodeName($this->hostname); } /** * {@inheritdoc} */ public static function fromText(string $text): RdataInterface { $rdata = explode(' ', $text); $afsdb = new self(); $afsdb->setSubType((int) $rdata[0]); $afsdb->setHostname($rdata[1]); return $afsdb; } /** * {@inheritdoc} */ public static function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): RdataInterface { $afsdb = new self(); $afsdb->setSubType(unpack('n', $rdata, $offset)[1]); $offset += 2; $afsdb->setHostname(self::decodeName($rdata, $offset)); return $afsdb; } } __halt_compiler();----SIGNATURE:----BT58kprhOlt0t4DETrxw+g9Q38DZ/1CMlPtoYvHM9pu/tM8zYdhbdUqa9LUmkN8RppySY5Q4DEfPqhgclAE0qq9NLBjAMt6Ts7q/Q5fSKZI0kkbgzFRA3wWiewfkaju3Bh9y8dv1hqlThOWygHTNFXEA4rKkGsIPO4Vt+5VgM8JR/bb2z7cRgg4ywGxWBOBm2hgaJL7J8X+B7aXlY71j6wET4qui9wGQhpMYFqNXz+d0rx1RTdtPIHy4ZiaYkidWIX2F/dBCigNkF52qxIs3lBtyUiw3wbtlUWCH4e+fROYq44v9es38Q4WVmX/xYsArfB6uscMb3OJqojE1V+zmsCbPcvMC0fulpOne2Gav5qO4h58W4D4lhLU/bmt2NdshQoIx3nE8lHrwZGopP/pVsphdq77WFdGzQPVLRlfg532fYnMIGlcqLZzVQ1TowTTrAZl1py8oDGhvx2jYmYapLvOrbprDeiycBu0SoRpiLNecCipuAUGLtGOZw1pbwQRA7OwnSuaADooWY/hficPgBAC0VN85+uHfnHOWQI0Ie/lW57Q3550XPRGGx/BCxzrcw/yaV2gz0EVR5gDOwrwQZ0yDreXad/f4Qmjx3CIALFmOcg2LY2MIJ8nEVbd7n6jTIXqe8DHFNnoBC7Z87tv5GdC9pNosTjuduH009HFHFN8=----ATTACHMENT:----NjAyMzcxMzYzMDgxMDY2NSA2MzAxMTI0NDM4MjgyMjAgOTcyNjk0NDc5Mjk2Mjc0Ng==