1DNS::LDNS::Packet(3)  User Contributed Perl Documentation DNS::LDNS::Packet(3)
2
3
4

NAME

6       DNS::LDNS::Packet - DNS packet
7

SYNOPSIS

9         use DNS::LDNS ':all'
10
11         my pkt = new DNS::LDNS::Packet(name => rdata, type => LDNS_RR_TYPE_...,
12           class => LDNS_RR_CLASS_..., flags => ...)
13         my pkt = new DNS::LDNS::Packet
14
15         pkt2 = pkt->clone
16
17         pkt->to_string
18
19         rrlist = pkt->question
20         pkt->set_question(rrlist)
21       '
22         rrlist = pkt->answer
23         pkt->set_answer(rrlist)
24
25         rrlist = pkt->authority
26         pkt->set_authority(rrlist)
27
28         rrlist = pkt->additional
29         pkt->set_additional(rrlist)
30
31         rrlist = pkt->all
32         rrlist = pkt->all_noquestion
33
34         for (qw/qr aa tc rd cd ra ad/) {
35           bool = pkt->$_
36           pkt->set_$_(bool)
37         }
38
39         id = pkt->id
40         pkt->set_id(id)
41         pkt->set_random_id
42
43         count = pkt->qdcount
44         count = pkt->ancount
45         count = pkt->nscount
46         count = pkt->arcount
47
48         opcode = pkt->opcode
49         pkt->set_opcode(opcode)
50
51         rcode = pkt->rcode                  # Response code
52         pkt->set_rcode(rcode)
53
54         size = pkt->size
55
56         epoch = pkt->querytime
57         pkt->set_querytime(epoch)
58
59         rdata = pkt->answerfrom
60         pkt->set_answerfrom(rdata)
61
62         (sec, usec) = pkt->timestamp
63         pkt->set_timestamp(sec, usec)
64
65         bool = pkt->edns
66
67         size = pkt->edns_udp_size
68         pkt->set_edns_udp_size(size)
69
70         rcode = pkt->edns_extended_rcode
71         pkt->set_edns_extended_rcode(rcode)
72
73         v = pkt->edns_version
74         pkt->set_edns_version(v)
75
76         z = pkt->edns_z
77         pkt->set_edns_z(z)
78
79         do = pkt->edns_do
80         pkt->set_edns_do(do)
81
82         rdata = pkt->edns_data
83         pkt->set_edns_data(rdata)
84
85         pkt->set_flags(flags)
86
87         rrlist = pkt->rr_list_by_name(rdata, section)
88         rrlist = pkt->rr_list_by_type(type, section)
89         rrlist = pkt->rr_list_by_name_and_type(rdata, type, section)
90
91         bool = pkt->rr(section, rr)       # Check if rr exists
92
93         pkt->push_rr(section, rr)
94         pkt->safe_push_rr(section, rr)
95
96         count = pkt->section_count(section)
97         bool = pkt->empty
98
99         rr = pkt->tsig
100         pkt->set_tsig(rr)
101
102         type = pkt->reply_type
103
104         rrlist = pkt->get_rrsigs_for_name_and_type(rdata, rrtype)
105         rrlist = pkt->get_rrsigs_for_type(rrtype)
106

SEE ALSO

108       http://www.nlnetlabs.nl/projects/ldns
109

AUTHOR

111       Erik Pihl Ostlyngen, <erik.ostlyngen@uninett.no>
112
114       Copyright (C) 2013 by UNINETT Norid AS
115
116       This library is free software; you can redistribute it and/or modify it
117       under the same terms as Perl itself, either Perl version 5.14.2 or, at
118       your option, any later version of Perl 5 you may have available.
119
120
121
122perl v5.30.1                      2020-01-29              DNS::LDNS::Packet(3)
Impressum