1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """MX-like base classes."""
17
18 import cStringIO
19 import struct
20
21 import dns.exception
22 import dns.rdata
23 import dns.name
24
26 """Base class for rdata that is like an MX record.
27
28 @ivar preference: the preference value
29 @type preference: int
30 @ivar exchange: the exchange name
31 @type exchange: dns.name.Name object"""
32
33 __slots__ = ['preference', 'exchange']
34
35 - def __init__(self, rdclass, rdtype, preference, exchange):
39
40 - def to_text(self, origin=None, relativize=True, **kw):
43
44 - def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
50
51 from_text = classmethod(from_text)
52
53 - def to_wire(self, file, compress = None, origin = None):
57
61
62 - def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
73
74 from_wire = classmethod(from_wire)
75
78
79 - def _cmp(self, other):
86
88 """Base class for rdata that is like an MX record, but whose name
89 is not compressed when converted to DNS wire format, and whose
90 digestable form is not downcased."""
91
92 - def to_wire(self, file, compress = None, origin = None):
94
96 f = cStringIO.StringIO()
97 self.to_wire(f, None, origin)
98 return f.getvalue()
99
101 """Base class for rdata that is like an MX record, but whose name
102 is not compressed when convert to DNS wire format."""
103
104 - def to_wire(self, file, compress = None, origin = None):
106