Staging
v0.8.1
https://github.com/python/cpython
Raw File
Tip revision: 2fb17ba2fa19d15d2c422ef7c2b45dca4f4de140 authored by cvs2svn on 16 April 2001, 18:46:45 UTC
This commit was manufactured by cvs2svn to create tag 'release21'.
Tip revision: 2fb17ba
dnsopcode.py
# Opcode values in message header (section 4.1.1)

QUERY = 0
IQUERY = 1
STATUS = 2

# Construct reverse mapping dictionary

_names = dir()
opcodemap = {}
for _name in _names:
	if _name[0] != '_': opcodemap[eval(_name)] = _name

def opcodestr(opcode):
	if opcodemap.has_key(opcode): return opcodemap[opcode]
	else: return `opcode`
back to top