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

Module dns.rdata

DNS rdata.
Classes
GenericRdata Generate Rdata Class
Rdata Base class for all DNS rdata types.

Function Summary
dns.rdata.Rdata instance from_text(rdclass, rdtype, tok, origin, relativize)
Build an rdata object from text format.
dns.rdata.Rdata instance from_wire(rdclass, rdtype, wire, current, rdlen, origin)
Build an rdata object from wire format
  get_rdata_class(rdclass, rdtype)
string _base64ify(data, chunksize)
Convert a binary string into its base64 encoding, broken up into chunks of chunksize characters separated by a space.
string _escapify(qstring)
Escape the characters in a quoted string which need it.
string _hexify(data, chunksize)
Convert a binary string into its hex encoding, broken up into chunks of chunksize characters separated by a space.
string _truncate_bitmap(what)
Determine the index of greatest byte that isn't all zeros, and return the bitmap that contains all the bytes less than that index.

Variable Summary
dict __escaped = {'"': True, '\\': True}
int _base64_chunksize = 32                                                                    
int _hex_chunk: At most this many octets that will be represented in each chunk of hexstring that _hexify() produces before whitespace occurs.
int _hex_chunksize = 32                                                                    
string _module_prefix: The prefix to use when forming modules names.
dict _rdata_modules: A dictionary mapping a (rdclass, rdtype) tuple to the module which implements that type.

Function Details

from_text(rdclass, rdtype, tok, origin=None, relativize=True)

Build an rdata object from text format.

This function attempts to dynamically load a class which implements the specified rdata class and type. If there is no class-and-type-specific implementation, the GenericRdata class is used.

Once a class is chosen, its from_text() class method is called with the parameters to this function.
Parameters:
rdclass - The rdata class
           (type=int)
rdtype - The rdata type
           (type=int)
tok - The tokenizer
           (type=dns.tokenizer.Tokenizer)
origin - The origin to use for relative names
           (type=dns.name.Name)
relativize - Should names be relativized?
           (type=bool)
Returns:
dns.rdata.Rdata instance

from_wire(rdclass, rdtype, wire, current, rdlen, origin=None)

Build an rdata object from wire format

This function attempts to dynamically load a class which implements the specified rdata class and type. If there is no class-and-type-specific implementation, the GenericRdata class is used.

Once a class is chosen, its from_wire() class method is called with the parameters to this function.
Parameters:
rdclass - The rdata class
           (type=int)
rdtype - The rdata type
           (type=int)
wire - The wire-format message
           (type=string)
current - The offet in wire of the beginning of the rdata.
           (type=int)
rdlen - The length of the wire-format rdata
           (type=int)
origin - The origin to use for relative names
           (type=dns.name.Name)
Returns:
dns.rdata.Rdata instance

_base64ify(data, chunksize=None)

Convert a binary string into its base64 encoding, broken up into chunks of chunksize characters separated by a space.
Parameters:
data - the binary string
           (type=string)
chunksize - the chunk size. Default is dns.rdata._base64_chunksize
Returns:
string

_escapify(qstring)

Escape the characters in a quoted string which need it.
Parameters:
qstring - the string
           (type=string)
Returns:
the escaped string
           (type=string)

_hexify(data, chunksize=None)

Convert a binary string into its hex encoding, broken up into chunks of chunksize characters separated by a space.
Parameters:
data - the binary string
           (type=string)
chunksize - the chunk size. Default is dns.rdata._hex_chunksize
Returns:
string

_truncate_bitmap(what)

Determine the index of greatest byte that isn't all zeros, and return the bitmap that contains all the bytes less than that index.
Parameters:
what - a string of octets representing a bitmap.
           (type=string)
Returns:
string

Variable Details

__escaped

Type:
dict
Value:
{'"': True, '\\': True}                                                

_base64_chunksize

Type:
int
Value:
32                                                                    

_hex_chunk

At most this many octets that will be represented in each chunk of hexstring that _hexify() produces before whitespace occurs.
Type:
int

_hex_chunksize

Type:
int
Value:
32                                                                    

_module_prefix

The prefix to use when forming modules names. The default is 'dns.rdtypes'. Changing this value will break the library.
Type:
string
Value:
'dns.rdtypes'                                                          

_rdata_modules

A dictionary mapping a (rdclass, rdtype) tuple to the module which implements that type.
Type:
dict
Value:
{}                                                                     

Generated by Epydoc 2.1 on Fri Jun 2 14:38:19 2006 http://epydoc.sf.net