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

Module dns.rdatatype

DNS Rdata Types.
Exceptions
UnknownRdatatype Raised if a type is unknown.

Function Summary
int from_text(text)
Convert text into a DNS rdata type value.
bool is_metatype(rdtype)
True if the type is a metatype.
bool is_singleton(rdtype)
True if the type is a singleton.
string to_text(value)
Convert a DNS rdata type to text.

Variable Summary
dict _by_text: The rdata type textual name to value mapping
dict _by_value: The rdata type value to textual name mapping
dict _metatypes: 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: 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.

Function Details

from_text(text)

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

is_metatype(rdtype)

True if the type is a metatype.
Parameters:
rdtype - the type
           (type=int)
Returns:
bool

is_singleton(rdtype)

True if the type is a singleton.
Parameters:
rdtype - the type
           (type=int)
Returns:
bool

to_text(value)

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

Variable Details

_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',
...                                                                    

_metatypes

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.
Type:
dict
Value:
{41: True}                                                             

_singletons

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.
Type:
dict
Value:
{30: True, 6: True, 39: True}                                          

Generated by Epydoc 2.1 on Sun Nov 25 17:43:05 2007 http://epydoc.sf.net