File: pldns.html

package info (click to toggle)
python-libtrace 1.6%2Bgit20161027-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,124 kB
  • ctags: 1,357
  • sloc: ansic: 6,890; python: 3,228; makefile: 70; sh: 49
file content (294 lines) | stat: -rw-r--r-- 8,160 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html><head>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>pldns</title>

<meta name="generator" content="amaya 8.5, see http://www.w3.org/Amaya/" />
<link rel="stylesheet" type="text/css" href="plt-doc.css" /></head><body>
<h2>pldns Module</h2>
<p>ldns is a C library developed by NLnetLabs,&nbsp; It provides a
complete set of functions for handling dns records, as well as DNS
resolvers, etc.<br />
This Module provides methods from ldns that can be used to analyse DNS records;<br />
it is <span style="font-style: italic;">not</span> a complete python extension of all the ldns functionality.<br />
</p>


<h3>Module Methods</h3>These allow you acess to the ldns routines that map a (small integer) DNS object into a descriptive string.<br />
<br />

<table class="indent1">
<tbody>
<tr><td class="name methodwidth"><strong>opcodestr()</strong></td>
<td class="name descriptionwidth"><em>pldns.opcodestr(integer) -&gt;&nbsp; aString<br />
</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a string describing a DNS operation code value<br /></td>
</tr>
<tr>
<td class="name methodwidth"><strong>rcodestr()</strong><br />
</td>
<td class="name descriptionwidth"><em>pldns.rcodestr(integer) -&gt; aString</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a string describing a DNS result code value</td>
</tr>


<tr>
<td class="name"><strong>typestr</strong>()<br />
</td>
<td class="name"><em><em>pldns.typestr(integer)
-&gt; aString<br />
 </em></em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a string describing a DNS Resource Record type  <span style="font-style: italic;"><span style="font-style: italic;"><span style="font-style: italic;" /></span></span></td>
</tr>
<tr>
<td class="name methodwidth"><strong>errorstr</strong>()<br />
</td>
<td class="name descriptionwidth"><em>r</em><em>ldns_obj.</em><em>errorstr(ldns_obj.status) -&gt;&nbsp; anInteger<br />
      </em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a string describing an ldns status code. 
</td>
</tr>
</tbody></table>
<br />

<h3>Class LdnsRR<br />
</h3>Ldns functions (see below) return tuples of LdnsRR objects.&nbsp;
Each such object contains all the information from a single Resource
Record in a DNS datagram.<br />
<br /><table class="indent1"><tbody><tr><td class="heading" colspan="2">Instance Attributes</td>
</tr>
<tr>
<td class="name methodwidth"><strong>owner</strong><br />
</td>
<td class="name descriptionwidth"><em>rr.owner -&gt; aString<br />
</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns the RR owner's FQDN (fully qualified domain name)<br />
<span style="font-family: monospace;" /></td>
</tr>
<tr>
<td class="name methodwidth"><strong>type</strong><br />
</td>
<td class="name descriptionwidth"><em>rr.type -&gt; anInteger</em><br />
</td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns the RR's type as a small integer<br />
</td>
</tr>
<tr>
</tr><tr>
<td class="name methodwidth"><strong>ttl</strong><br />
</td>
<td class="name descriptionwidth"><em>rr.ttl -&gt;&nbsp; anInteger<br />
</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns the RR's TTL (Time To Live) in seconds<br />
</td>
</tr>
<tr>
</tr><tr>
<td class="name methodwidth"><strong>rdata<br />
</strong></td>
<td class="name descriptionwidth"><em>rr.rdata-&gt;&nbsp; aString<br />
</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a string with all the information about
the RR.&nbsp; Since different RR types have different data items, the
string is similar to those returned by dig for RRs.<br />
</td>
</tr>
<tr>
</tr><tr>
<td class="name methodwidth"><strong>str</strong><br />
</td>
<td class="name descriptionwidth"><em>ipf.proto -&gt;&nbsp; aString</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a string containing all the information about the RR, in a format similar to that returned by dig for an RR.<br />
</td>
</tr>

</tbody></table>
<br />

<h3>Class Ldns<br />
</h3>An Ldns object contains all the information from a DNS datagram.<br />
<br /><table class="indent1"><tbody>
<tr><td class="heading" colspan="2">Class functions</td>
</tr>
<tr>
<td class="name methodwidth"><strong>ldns()</strong><br />
</td>
<td class="name descriptionwidth"><em>pldns.ldns(udp.payload) -&gt; anLdns_obj<br />
</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">This function creates an ldns object. It's argument is a DNS datagram from plt, either udp.payload or tcp.payload.<br />
<span style="font-family: monospace;" /></td>
</tr>
<tr>
<td class="name methodwidth"><strong>is_ok</strong>()<br />
</td>
<td class="name descriptionwidth"><em>rldns_obj.status-&gt; True or False</em><br />
</td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns True if the ldns object was created without problems.<br />
</td>
</tr>
<tr><td class="heading" colspan="2">Instance Attributes</td>
</tr>
<tr>
<td class="name methodwidth"><strong>status</strong><br />
</td>
<td class="name descriptionwidth"><em>rldns_obj.status-&gt; anInteger</em><br />
</td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns zero if the ldns object was created without problems, <br />or an ldns status code otherwise.<br />
</td>
</tr>
<tr>
</tr><tr>
</tr><tr>
<td style="font-weight: bold;" class="name methodwidth"><strong>ident</strong></td>
<td class="name descriptionwidth"><em>ldns_obj.ident</em><em>-&gt;&nbsp; anInteger<br />
      </em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns the datagram's ident value (16-bit unsigned integer).<br />
</td>
</tr>
<tr>
</tr><tr>
<td class="name methodwidth"><strong>is_response</strong><br />
</td>
<td class="name descriptionwidth"><em><em>ldns_obj.</em><em>is_response -&gt;&nbsp; True or False<br />
</em></em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns True if the datagram is a response.<br />
</td>
</tr>
<tr>
</tr><tr>
<td class="name methodwidth"><strong>opcode</strong><br />
</td>
<td class="name descriptionwidth"><em>ldns_obj.</em><em>opcode -&gt;&nbsp; anInteger</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns the datagram's opcode field.<br />
</td>
</tr>
<tr>
</tr><tr>
<td class="name methodwidth"><strong>rcode</strong><br />
</td>
<td class="name descriptionwidth"><em>i</em><em>ldns_obj.rcode</em><em> -&gt;&nbsp; aString</em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns the datagram's rcode field.<br />
</td>
</tr>
<tr>
</tr>

<tr>
</tr><tr>
<td class="name methodwidth"><strong>query_rr_list</strong><br />
</td>
<td class="name descriptionwidth"><em><em>ldns_obj.</em><em>query_rr_list -&gt;&nbsp; a list of LdnsRRs<br />
</em></em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a a list of LdnsRR objects from the datagram's <br />Query section.
</td>
</tr>
<tr>
</tr><tr>
<td class="name methodwidth"><strong>response_rr_list</strong><br />
</td>
<td class="name descriptionwidth"><em>ldns_obj.</em><em>response_r_list -&gt;&nbsp; </em><em><em>a list of LdnsRRs</em></em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a a list of LdnsRR objects from the datagram's <br />Response section.
</td>
</tr>
<tr>
</tr><tr>
<td class="name methodwidth"><strong>auth_rr_list</strong>
</td>
<td class="name descriptionwidth"><em>ldns_obj.auth_rr_list </em><em>-&gt;&nbsp; </em><em><em>a list of LdnsRRs</em></em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a a list of LdnsRR objects from the datagram's <br />Authority section.
</td>
</tr>
<tr>
<td class="name methodwidth"><strong>addit_rr_list</strong>
</td>
<td class="name descriptionwidth"><em>ldns_obj.</em><em>-&gt;&nbsp; </em><em><em>a list of LdnsRRs</em></em></td>
</tr>
<tr>
<td><br />
</td>
<td class="description">Returns a a list of LdnsRR objects from the datagram's <br />Additional section.</td>
</tr>

</tbody></table>
<br />

<p /><p>Nevil Brownlee<br />
Tue, 19 Aug 14 (NZST)</p>
</body></html>