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

Module dns.name

DNS Names.
Classes
Name A DNS name.

Exceptions
AbsoluteConcatenation Raised if an attempt is made to append anything other than the empty name to an absolute name.
BadEscape Raised if an escaped code in a text format name is invalid.
BadLabelType Raised if the label type of a wire format name is unknown.
BadPointer Raised if a compression pointer points forward instead of backward.
EmptyLabel Raised if a label is empty.
LabelTooLong Raised if a label is > 63 octets long.
NameTooLong Raised if a name is > 255 octets long.
NeedAbsoluteNameOrOrigin Raised if an attempt is made to convert a non-absolute name to wire when there is also a non-absolute (or missing) origin.
NoParent Raised if an attempt is made to get the parent of the root name or the empty name.

Function Summary
dns.name.Name object from_text(text, origin)
Convert text into a Name object.
dns.name.Name object from_unicode(text, origin)
Convert unicode text into a Name object.
(dns.name.Name object, int) tuple from_wire(message, current)
Convert possibly compressed wire format into a Name.

Variable Summary
dns.name.Name object empty: The empty DNS name.
int NAMERELN_COMMONANCESTOR = 4                                                                     
int NAMERELN_EQUAL = 3                                                                     
int NAMERELN_NONE = 0                                                                     
int NAMERELN_SUBDOMAIN = 2                                                                     
int NAMERELN_SUPERDOMAIN = 1                                                                     
dns.name.Name object root: The DNS root name.

Function Details

from_text(text, origin=<DNS name .>)

Convert text into a Name object.
Returns:
dns.name.Name object

from_unicode(text, origin=<DNS name .>)

Convert unicode text into a Name object.

Lables are encoded in IDN ACE form.
Returns:
dns.name.Name object

from_wire(message, current)

Convert possibly compressed wire format into a Name.
Parameters:
message - the entire DNS message
           (type=string)
current - the offset of the beginning of the name from the start of the message
           (type=int)
Returns:
a tuple consisting of the name that was read and the number of bytes of the wire format message which were consumed reading it
           (type=(dns.name.Name object, int) tuple)
Raises:
dns.name.BadPointer - a compression pointer did not point backwards in the message
dns.name.BadLabelType - an invalid label type was encountered.

Variable Details

empty

The empty DNS name.
Type:
dns.name.Name object
Value:
<DNS name @>                                                           

NAMERELN_COMMONANCESTOR

Type:
int
Value:
4                                                                     

NAMERELN_EQUAL

Type:
int
Value:
3                                                                     

NAMERELN_NONE

Type:
int
Value:
0                                                                     

NAMERELN_SUBDOMAIN

Type:
int
Value:
2                                                                     

NAMERELN_SUPERDOMAIN

Type:
int
Value:
1                                                                     

root

The DNS root name.
Type:
dns.name.Name object
Value:
<DNS name .>                                                           

Generated by Epydoc 2.1 on Sun Dec 10 12:46:08 2006 http://epydoc.sf.net