1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """NS-like base classes."""
17
18 import cStringIO
19
20 import dns.exception
21 import dns.rdata
22 import dns.name
23
25 """Base class for rdata that is like an NS record.
26
27 @ivar target: the target name of the rdata
28 @type target: dns.name.Name object"""
29
30 __slots__ = ['target']
31
32 - def __init__(self, rdclass, rdtype, target):
35
36 - def to_text(self, origin=None, relativize=True, **kw):
39
40 - def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
45
46 from_text = classmethod(from_text)
47
48 - def to_wire(self, file, compress = None, origin = None):
50
53
54 - def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
62
63 from_wire = classmethod(from_wire)
64
67
69 """Base class for rdata that is like an NS record, but whose name
70 is not compressed when convert to DNS wire format, and whose
71 digestable form is not downcased."""
72
73 - def to_wire(self, file, compress = None, origin = None):
75
77 f = cStringIO.StringIO()
78 self.to_wire(f, None, origin)
79 return f.getvalue()
80