1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 import dns.exception
17
18 -class DHCID(dns.rdata.Rdata):
19 """DHCID record
20
21 @ivar data: the data (the content of the RR is opaque as far as the
22 DNS is concerned)
23 @type data: string
24 @see: RFC 4701"""
25
26 __slots__ = ['data']
27
28 - def __init__(self, rdclass, rdtype, data):
31
32 - def to_text(self, origin=None, relativize=True, **kw):
33 return dns.rdata._base64ify(self.data)
34
35 - def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
36 chunks = []
37 while 1:
38 t = tok.get().unescape()
39 if t.is_eol_or_eof():
40 break
41 if not t.is_identifier():
42 raise dns.exception.SyntaxError
43 chunks.append(t.value)
44 b64 = ''.join(chunks)
45 data = b64.decode('base64_codec')
46 return cls(rdclass, rdtype, data)
47
48 from_text = classmethod(from_text)
49
50 - def to_wire(self, file, compress = None, origin = None):
52
53 - def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
56
57 from_wire = classmethod(from_wire)
58
59 - def _cmp(self, other):
61