Provided by: libnet-ldns-perl_0.75-3_amd64 bug

NAME

       Net::LDNS::Packet - objects representing DNS packets

SYNOPSIS

           my $p = $resolver->query('www.iis.se');
           foreach my $rr ($p->answer) {
               say $rr->string if $rr->type eq 'A';
           }

CLASS METHODS

       new($name, $type, $class)
           Create a new packet, holding nothing by a query record for the provided triplet. $type
           and $class are optional, and default to A and IN respectively.

       new_from_wireformat($data)
           Creates a new Net::LDNS::Packet object from the given wireformat data, if possible.
           Throws an exception if not.

INSTANCE METHODS

       rcode([$string])
           Returns the packet RCODE. If given an argument, tries to set the RCODE to the relevant
           value. If the given string isn't recognized as an RCODE, an exception will be thrown.

       opcode([$string])
           Returns the packet OPCODE. If given an argument, tries to set the OPCODE to the
           relevant value. If the given string isn't recognized as an OPCODE, an exception will
           be thrown.

       id([$value])
           Returns the packet id number. If given an argument, sets the ID value to that value.

       qr()
       aa()
       tc()
       rd()
       cd()
       ra()
       ad()
       do()
           Reads and/or sets the equivalently named flags.

       size()
           Returns the length of the packet's wireformat form in octets.

       edns_size()
           Gets and/or sets the EDNS0 UDP size.

       edns_rcode()
           Gets and/or sets the EDNS0 Extended RCODE field.

       needs_edns()
           This method returns true if the packet has the DO flag set, an EDNS0 size set, and
           EDNS0 extended RCODE set or if the OPT pseudo-RR has one or more RDATA fields. It can
           fail to correctly flag a packet with an OPT pseudo-RR as having EDNS, if the pseudo-RR
           specifies an UDP size of zero, an extended RCODE of zero and the DO flag is unset.
           Since any UDP size less than 512 must be interpreted as 512, packets like that should
           be very rare in practice if they exist at all.

           Note that the OPT pseudo-RR is not visible as an RR in the packet, nor is it included
           in the RR count header fields.

       has_edns()
           An alias for needs_edns().

       edns_version($version)
           Get or set the EDNS version in the packet. For incoming packets, returns 0 if the
           packet does not have an OPT pseudo-RR and 0 if it's an EDNS0 packet. It's thus rather
           pointless until such time as EDNS1 is defined.

       querytime([$value])
           Returns the time the query this packet is the answer to took to execute, in
           milliseconds. If given a value, sets the querytime to that value.

       answerfrom($ipaddr)
           Returns and optionally sets the IP address the packet was received from. If an attempt
           is made to set it to a string that cannot be parsed as an IPv4 or IPv6 address, an
           exception is thrown.

       timestamp($time)
           The time when the query was sent or received (the ldns docs don't specify), as a
           floating-point value on the Unix time_t scale (that is, the same kind of value used by
           Time::HiRes::time()). Conversion effects between floating-point and "struct timeval"
           means that the precision of the value is probably not reliable at the microsecond
           level, even if you computer's clock happen to be.

       question()
       answer()
       authority()
       additional()
           Returns list of objects representing the RRs in the named section. They will be of
           classes appropriate to their types, but all will have "Net::LDNS::RR" as a base class.

       unique_push($section, $rr)
           Push an RR object into the given section, if an identical RR isn't already present. If
           the section isn't one of "question", "answer", "authority" or "additional" an
           exception will be thrown. $rr must be a Net::LDNS::RR subclass.

       string()
           Returns a string with the packet and its contents in common presentation format.

       wireformat()
           Returns a Perl string holding the packet in wire format.

       type()
           Returns the ldns library's guess as to the content of the packet. One of the strings
           "question", "referral", "answer", "nxdomain", "nodata" or "unknown".