Never miss an old file
[myops.git] / web / collect / client / DNS / Opcode.py
1 """
2  $Id: Opcode.py,v 1.6.2.1 2011/03/16 20:06:39 customdesigned Exp $
3
4  This file is part of the pydns project.
5  Homepage: http://pydns.sourceforge.net
6
7  This code is covered by the standard Python License. See LICENSE for details.
8
9  Opcode values in message header. RFC 1035, 1996, 2136.
10 """
11
12
13
14 QUERY = 0
15 IQUERY = 1
16 STATUS = 2
17 NOTIFY = 4
18 UPDATE = 5
19
20 # Construct reverse mapping dictionary
21
22 _names = dir()
23 opcodemap = {}
24 for _name in _names:
25     if _name[0] != '_': opcodemap[eval(_name)] = _name
26
27 def opcodestr(opcode):
28     if opcodemap.has_key(opcode): return opcodemap[opcode]
29     else: return `opcode`
30
31 #
32 # $Log: Opcode.py,v $
33 # Revision 1.6.2.1  2011/03/16 20:06:39  customdesigned
34 # Refer to explicit LICENSE file.
35 #
36 # Revision 1.6  2002/04/23 10:51:43  anthonybaxter
37 # Added UPDATE, NOTIFY.
38 #
39 # Revision 1.5  2002/03/19 12:41:33  anthonybaxter
40 # tabnannied and reindented everything. 4 space indent, no tabs.
41 # yay.
42 #
43 # Revision 1.4  2002/03/19 12:26:13  anthonybaxter
44 # death to leading tabs.
45 #
46 # Revision 1.3  2001/08/09 09:08:55  anthonybaxter
47 # added identifying header to top of each file
48 #
49 # Revision 1.2  2001/07/19 06:57:07  anthony
50 # cvs keywords added
51 #
52 #