1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """NS-like base classes."""
19
20 from io import BytesIO
21
22 import dns.exception
23 import dns.rdata
24 import dns.name
25
26
27 -class NSBase(dns.rdata.Rdata):
28
29 """Base class for rdata that is like an NS record.
30
31 @ivar target: the target name of the rdata
32 @type target: dns.name.Name object"""
33
34 __slots__ = ['target']
35
36 - def __init__(self, rdclass, rdtype, target):
39
40 - def to_text(self, origin=None, relativize=True, **kw):
43
44 @classmethod
45 - def from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True):
50
51 - def to_wire(self, file, compress=None, origin=None):
53
56
57 @classmethod
58 - def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None):
66
69
72
73 """Base class for rdata that is like an NS record, but whose name
74 is not compressed when convert to DNS wire format, and whose
75 digestable form is not downcased."""
76
77 - def to_wire(self, file, compress=None, origin=None):
79
81 f = BytesIO()
82 self.to_wire(f, None, origin)
83 return f.getvalue()
84