1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 import struct
19
20 import dns.exception
21 import dns.rdata
22 import dns.tokenizer
23 from dns._compat import text_type
24
25
26 -class X25(dns.rdata.Rdata):
27
28 """X25 record
29
30 @ivar address: the PSDN address
31 @type address: string
32 @see: RFC 1183"""
33
34 __slots__ = ['address']
35
36 - def __init__(self, rdclass, rdtype, address):
42
43 - def to_text(self, origin=None, relativize=True, **kw):
44 return '"%s"' % dns.rdata._escapify(self.address)
45
46 @classmethod
47 - def from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True):
51
52 - def to_wire(self, file, compress=None, origin=None):
53 l = len(self.address)
54 assert l < 256
55 file.write(struct.pack('!B', l))
56 file.write(self.address)
57
58 @classmethod
59 - def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None):
67