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

# Module rdataclass

source code

DNS Rdata Classes.

Classes | [hide private]
| UnknownRdataclass A DNS class is unknown.

Functions | [hide private]
int |
from_text(text) Convert text into a DNS rdata class value. | source code
string |
to_text(value) Convert a DNS rdata class to text. | source code
bool |
is_metaclass(rdclass) True if the class is a metaclass. | source code

Variables | [hide private]
| RESERVED0 = `0`
| IN = `1`
| CH = `3`
| HS = `4`
| NONE = `254`
| ANY = `255`
dict | _by_text = ``{``'``ANY``'``:` 255`,` `'``CH``'``:` 3`,` `'``CHAOS``'``:` 3`,` `'``HESIOD``'``:` 4`,` `'``HS``'``...`` The rdata class textual name to value mapping
dict | _by_value = ``{`0`:` `'``RESERVED0``'``,` 1`:` `'``IN``'``,` 3`:` `'``CH``'``,` 4`:` `'``HS``'``,` 254`:` `'``...`` The rdata class value to textual name mapping
dict | _metaclasses = ``{`254`:` True`,` 255`:` True`}`` If an rdataclass is a metaclass, there will be a mapping whose key is the rdatatype value and whose value is True in this dictionary.
| _unknown_class_pattern = `re.compile(r'`(?i)`CLASS`(``[`0`-`9`]``+``)`$')`
| __package__ = ``'``dns``'``

Function Details | [hide private]

### from_text(text) | source code
Convert text into a DNS rdata class value. Parameters: `text` (string) - the text Returns: int Raises: `dns.rdataclass.UnknownRdataclass` - the class is unknown `ValueError` - the rdata class value is not >= 0 and <= 65535

### to_text(value) | source code
Convert a DNS rdata class to text. Parameters: `value` (int) - the rdata class value Returns: string Raises: `ValueError` - the rdata class value is not >= 0 and <= 65535

### is_metaclass(rdclass) | source code
True if the class is a metaclass. Parameters: `rdclass` (int) - the rdata class Returns: bool

Variables Details | [hide private]

  ### _by_text The rdata class textual name to value mapping Type: dict Value:
      {'ANY': 255,
       'CH': 3,
       'CHAOS': 3,
       'HESIOD': 4,
       'HS': 4,
       'IN': 1,
       'INTERNET': 1,
       'NONE': 254,
      ...

  ### _by_value The rdata class value to textual name mapping Type: dict Value:
      {0: 'RESERVED0', 1: 'IN', 3: 'CH', 4: 'HS', 254: 'NONE', 255: 'ANY'}