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

  1. # CLASS values (section 3.2.4)
  2.  
  3. IN = 1        # the Internet
  4. CS = 2        # the CSNET class (Obsolete - used only for examples in
  5.         # some obsolete RFCs)
  6. CH = 3        # the CHAOS class
  7. HS = 4        # Hesiod [Dyer 87]
  8.  
  9. # QCLASS values (section 3.2.5)
  10.  
  11. ANY = 255    # any class
  12.  
  13.  
  14. # Construct reverse mapping dictionary
  15.  
  16. _names = dir()
  17. classmap = {}
  18. for _name in _names:
  19.     if _name[0] != '_': classmap[eval(_name)] = _name
  20.  
  21. def classstr(klass):
  22.     if classmap.has_key(klass): return classmap[klass]
  23.     else: return `klass`
  24.