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.

Function Summary
dns.name.Name object from_text(text, origin)
Convert text into a Name object.
(dns.name.Name object, int) tuple from_wire(message, current)
Convert possibly compressed wire format into a Name.
string _escapify(label)
Escape the characters in label which need it.
  _validate_labels(labels)
Check for empty labels in the middle of a label sequence, labels that are too long, and for too many labels.

Variable Summary
dns.name.Name object empty - The empty DNS name.
int NAMERELN_COMMONANCESTOR
int NAMERELN_EQUAL
int NAMERELN_NONE
int NAMERELN_SUBDOMAIN
int NAMERELN_SUPERDOMAIN
dns.name.Name object root - The DNS root name.
dict _escaped

Function Details

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

Convert text into a Name object.
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.

_escapify(label)

Escape the characters in label which need it.
Returns:
the escaped string
           (type=string)

_validate_labels(labels)

Check for empty labels in the middle of a label sequence, labels that are too long, and for too many labels.
Raises:
NameTooLong - the name as a whole is too long
LabelTooLong - an individual label is too long
EmptyLabel - a label is empty (i.e. the root label) and appears in a position other than the end of the label sequence

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 .>                                                           

_escaped

Type:
dict
Value:
{'"': True,
 '$': True,
 '(': True,
 ')': True,
 '.': True,
 ';': True,
 '@': True,
 '\\': True}                                                           

Generated by Epydoc 1.1 on Sun Jun 6 13:48:47 2004 http://epydoc.sf.net