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

Module opcode

source code

DNS Opcodes.

Classes [hide private]
  UnknownOpcode
An DNS opcode is unknown.
Functions [hide private]
int
from_text(text)
Convert text into an opcode.
source code
int
from_flags(flags)
Extract an opcode from DNS message flags.
source code
int
to_flags(value)
Convert an opcode to a value suitable for ORing into DNS message flags.
source code
string
to_text(value)
Convert an opcode to text.
source code
bool
is_update(flags)
True if the opcode in flags is UPDATE.
source code
Variables [hide private]
  QUERY = 0
  IQUERY = 1
  STATUS = 2
  NOTIFY = 4
  UPDATE = 5
  _by_text = {'IQUERY': 1, 'NOTIFY': 4, 'QUERY': 0, 'STATUS': 2,...
  _by_value = {0: 'QUERY', 1: 'IQUERY', 2: 'STATUS', 4: 'NOTIFY'...
  __package__ = 'dns'
Function Details [hide private]

from_text(text)

source code 

Convert text into an opcode.

Parameters:
  • text (string) - the textual opcode
Returns: int
Raises:

from_flags(flags)

source code 

Extract an opcode from DNS message flags.

Parameters:
  • flags - int
Returns: int

to_text(value)

source code 

Convert an opcode to text.

Parameters:
  • value (int) - the opcdoe
Returns: string
Raises:

is_update(flags)

source code 

True if the opcode in flags is UPDATE.

Parameters:
  • flags (int) - DNS flags
Returns: bool

Variables Details [hide private]

_by_text

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

_by_value

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