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