Package dns :: Module opcode
[show private | hide private]
[frames | no frames]

Module dns.opcode

DNS Opcodes.
Exceptions
UnknownOpcode Raised if an opcode is unknown.

Function Summary
int from_flags(flags)
Extract an opcode from DNS message flags.
int from_text(text)
Convert text into an opcode.
bool is_update(flags)
True if the opcode in flags is UPDATE.
int to_flags(value)
Convert an opcode to a value suitable for ORing into DNS message flags.
string to_text(value)
Convert an opcode to text.

Variable Summary
int IQUERY = 1                                                                     
int NOTIFY = 4                                                                     
int QUERY = 0                                                                     
int STATUS = 2                                                                     
int UPDATE = 5                                                                     
dict _by_text = {'STATUS': 2, 'QUERY': 0, 'UPDATE': 5, 'IQUER...
dict _by_value = {0: 'QUERY', 1: 'IQUERY', 2: 'STATUS', 4: 'N...

Function Details

from_flags(flags)

Extract an opcode from DNS message flags.
Parameters:
flags - int
Returns:
int

from_text(text)

Convert text into an opcode.
Parameters:
text - the textual opcode
           (type=string)
Returns:
int
Raises:
UnknownOpcode - the opcode is unknown

is_update(flags)

True if the opcode in flags is UPDATE.
Parameters:
flags - DNS flags
           (type=int)
Returns:
bool

to_flags(value)

Convert an opcode to a value suitable for ORing into DNS message flags.
Returns:
int

to_text(value)

Convert an opcode to text.
Parameters:
value - the opcdoe
           (type=int)
Returns:
string
Raises:
UnknownOpcode - the opcode is unknown

Variable Details

IQUERY

Type:
int
Value:
1                                                                     

NOTIFY

Type:
int
Value:
4                                                                     

QUERY

Type:
int
Value:
0                                                                     

STATUS

Type:
int
Value:
2                                                                     

UPDATE

Type:
int
Value:
5                                                                     

_by_text

Type:
dict
Value:
{'STATUS': 2, 'QUERY': 0, 'UPDATE': 5, 'IQUERY': 1, 'NOTIFY': 4}       

_by_value

Type:
dict
Value:
{0: 'QUERY', 1: 'IQUERY', 2: 'STATUS', 4: 'NOTIFY', 5: 'UPDATE'}       

Generated by Epydoc 2.1 on Sun Jul 31 21:35:42 2005 http://epydoc.sf.net