1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 import dns.exception
17 import dns.rdata
18 import dns.tokenizer
19 import dns.util
20
21 -class X25(dns.rdata.Rdata):
22 """X25 record
23
24 @ivar address: the PSDN address
25 @type address: string
26 @see: RFC 1183"""
27
28 __slots__ = ['address']
29
30 - def __init__(self, rdclass, rdtype, address):
33
34 - def to_text(self, origin=None, relativize=True, **kw):
35 return '"%s"' % dns.rdata._escapify(self.address)
36
37 - def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
41
42 from_text = classmethod(from_text)
43
44 - def to_wire(self, file, compress = None, origin = None):
45 l = len(self.address)
46 assert l < 256
47 dns.util.write_uint8(file, l)
48 file.write(self.address.encode('latin_1'))
49
50 - def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
58
59 from_wire = classmethod(from_wire)
60
61 - def _cmp(self, other):
63