home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pyos2bin.zip / Demo / dns / dnstype.py < prev    next >
Text File  |  1994-10-08  |  1KB  |  42 lines

  1. # TYPE values (section 3.2.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
  19.  
  20. # Additional TYPE values from host.c source
  21.  
  22. UNAME = 110
  23. MP = 240
  24.  
  25. # QTYPE values (section 3.2.3)
  26.  
  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
  31.  
  32. # Construct reverse mapping dictionary
  33.  
  34. _names = dir()
  35. typemap = {}
  36. for _name in _names:
  37.     if _name[0] != '_': typemap[eval(_name)] = _name
  38.  
  39. def typestr(type):
  40.     if typemap.has_key(type): return typemap[type]
  41.     else: return `type`
  42.