code: function parseOpt(val, msg, rdata, packet) {
    // assert first entry in additional
    rdata.buf = msg.slice(rdata.len);
  
    val.rcode = ((val.ttl & 0xFF000000) >> 20) + packet.header.rcode;
    val.version = (val.ttl >> 16) & 0xFF;
    val.do = (val.ttl >> 15) & 1;
    val.z = val.ttl & 0x7F;
    val.options = [];
  
    packet.edns = val;
    packet.edns_version = val.version; // TODO: return BADVERS for unsupported version! (Section 6.1.3)
  
    // !! BEGIN DEPRECATION NOTICE !!
    // THESE FIELDS MAY BE REMOVED IN THE FUTURE!
    packet.edns_options = val.options;
    packet.payload = val.class;
    // !! END DEPRECATION NOTICE !!
  
    while (!rdata.buf.eof()) {
      val.options.push({
        code: rdata.buf.readUInt16BE(),
        data: rdata.buf.slice(rdata.buf.readUInt16BE()).buffer
      });
    }
    return PARSE_RESOURCE_DONE;
  }
docs: https://tools.ietf.org/html/rfc6891#section-6.1.2 https://tools.ietf.org/html/rfc2671#section-4.4 - [payload size selection](https://tools.ietf.org/html/rfc6891#section-6.2.5)