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

# Module rdatatype

source code

DNS Rdata Types.

Classes | [hide private]
| UnknownRdatatype Raised if a type is unknown.

Functions | [hide private]
int |
from_text(text) Convert text into a DNS rdata type value. | source code
string |
to_text(value) Convert a DNS rdata type to text. | source code
bool |
is_metatype(rdtype) True if the type is a metatype. | source code
bool |
is_singleton(rdtype) True if the type is a singleton. | source code

Variables | [hide private]
| NONE = `0`
| A = `1`
| NS = `2`
| MD = `3`
| MF = `4`
| CNAME = `5`
| SOA = `6`
| MB = `7`
| MG = `8`
| MR = `9`
| NULL = `10`
| WKS = `11`
| PTR = `12`
| HINFO = `13`
| MINFO = `14`
| MX = `15`
| TXT = `16`
| RP = `17`
| AFSDB = `18`
| X25 = `19`
| ISDN = `20`
| RT = `21`
| NSAP = `22`
| NSAP_PTR = `23`
| SIG = `24`
| KEY = `25`
| PX = `26`
| GPOS = `27`
| AAAA = `28`
| LOC = `29`
| NXT = `30`
| SRV = `33`
| NAPTR = `35`
| KX = `36`
| CERT = `37`
| A6 = `38`
| DNAME = `39`
| OPT = `41`
| APL = `42`
| DS = `43`
| SSHFP = `44`
| IPSECKEY = `45`
| RRSIG = `46`
| NSEC = `47`
| DNSKEY = `48`
| DHCID = `49`
| NSEC3 = `50`
| NSEC3PARAM = `51`
| HIP = `55`
| SPF = `99`
| UNSPEC = `103`
| TKEY = `249`
| TSIG = `250`
| IXFR = `251`
| AXFR = `252`
| MAILB = `253`
| MAILA = `254`
| ANY = `255`
| TA = `32768`
| DLV = `32769`
dict | _by_text = ``{``'``A``'``:` 1`,` `'``A6``'``:` 38`,` `'``AAAA``'``:` 28`,` `'``AFSDB``'``:` 18`,` `'``ANY``'``:` `...`` The rdata type textual name to value mapping
dict | _by_value = ``{`0`:` `'``NONE``'``,` 1`:` `'``A``'``,` 2`:` `'``NS``'``,` 3`:` `'``MD``'``,` 4`:` `'``MF``'``,` 5`:` `...`` The rdata type value to textual name mapping
dict | _metatypes = ``{`41`:` True`}`` If an rdatatype is a metatype, there will be a mapping whose key is the rdatatype value and whose value is True in this dictionary.
dict | _singletons = ``{`6`:` True`,` 30`:` True`,` 39`:` True`,` 47`:` True`}`` If an rdatatype is a singleton, there will be a mapping whose key is the rdatatype value and whose value is True in this dictionary.
| _unknown_type_pattern = `re.compile(r'`(?i)`TYPE`(``[`0`-`9`]``+``)`$')`
| __package__ = ``'``dns``'``
| x = ``'``MX``'``
| y = `15`

Function Details | [hide private]

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

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

### is_metatype(rdtype) | source code
True if the type is a metatype. Parameters: `rdtype` (int) - the type Returns: bool

### is_singleton(rdtype) | source code
True if the type is a singleton. Parameters: `rdtype` (int) - the type Returns: bool

Variables Details | [hide private]

  ### _by_text The rdata type textual name to value mapping Type: dict Value:
      {'A': 1,
       'A6': 38,
       'AAAA': 28,
       'AFSDB': 18,
       'ANY': 255,
       'APL': 42,
       'AXFR': 252,
       'CERT': 37,
      ...

  ### _by_value The rdata type value to textual name mapping Type: dict Value:
      {0: 'NONE',
       1: 'A',
       2: 'NS',
       3: 'MD',
       4: 'MF',
       5: 'CNAME',
       6: 'SOA',
       7: 'MB',
      ...