Staging
v0.8.1
https://github.com/python/cpython
Raw File
Tip revision: b022eb54e6544499c9f689a3b4343380d28c8852 authored by cvs2svn on 22 March 1995, 12:27:16 UTC
This commit was manufactured by cvs2svn to create tag 'r12beta4'.
Tip revision: b022eb5
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