Improved some error messages for command line processing.
[python/dscho.git] / Demo / dns / dnstype.py
blob80c2b76c459dc2dc61f28bdc899743b977baf3a8
1 # TYPE values (section 3.2.2)
3 A = 1 # a host address
4 NS = 2 # an authoritative name server
5 MD = 3 # a mail destination (Obsolete - use MX)
6 MF = 4 # a mail forwarder (Obsolete - use MX)
7 CNAME = 5 # the canonical name for an alias
8 SOA = 6 # marks the start of a zone of authority
9 MB = 7 # a mailbox domain name (EXPERIMENTAL)
10 MG = 8 # a mail group member (EXPERIMENTAL)
11 MR = 9 # a mail rename domain name (EXPERIMENTAL)
12 NULL = 10 # a null RR (EXPERIMENTAL)
13 WKS = 11 # a well known service description
14 PTR = 12 # a domain name pointer
15 HINFO = 13 # host information
16 MINFO = 14 # mailbox or mail list information
17 MX = 15 # mail exchange
18 TXT = 16 # text strings
20 # Additional TYPE values from host.c source
22 UNAME = 110
23 MP = 240
25 # QTYPE values (section 3.2.3)
27 AXFR = 252 # A request for a transfer of an entire zone
28 MAILB = 253 # A request for mailbox-related records (MB, MG or MR)
29 MAILA = 254 # A request for mail agent RRs (Obsolete - see MX)
30 ANY = 255 # A request for all records
32 # Construct reverse mapping dictionary
34 _names = dir()
35 typemap = {}
36 for _name in _names:
37 if _name[0] != '_': typemap[eval(_name)] = _name
39 def typestr(type):
40 if typemap.has_key(type): return typemap[type]
41 else: return `type`