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.

Exceptions
MeaninglessComparison Raised if an attemped is made to compare one rdata type with another.

Function Summary
DNS.rdata.Rdata instance from_text(rdclass, rdtype, tok, origin)
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)
  _base64ify(data, chunksize)
string _escapify(label)
Escape the characters in a quoted string which need it.
  _hexify(data, chunksize)
  _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
int _base64_chunksize
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
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)

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

_escapify(label)

Escape the characters in a quoted string which need it.
Returns:
the escaped string
           (type=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 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 1.1 on Sat Jun 21 20:52:30 2003 http://epydoc.sf.net