Viewing File: /usr/lib64/python2.7/site-packages/dns/rdata.pyc
ó
®$Nc @ s d Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d Z d d „ Z d Z d d „ Z
i e d 6e d 6Z d „ Z d „ Z d
e f d „ ƒ YZ d e f d
„ ƒ YZ i Z d Z d „ Z d e d „ Z d d „ Z d S( sæ DNS rdata.
@var _rdata_modules: A dictionary mapping a (rdclass, rdtype) tuple to
the module which implements that type.
@type _rdata_modules: dict
@var _module_prefix: The prefix to use when forming modules names. The
default is 'dns.rdtypes'. Changing this value will break the library.
@type _module_prefix: string
@var _hex_chunk: At most this many octets that will be represented in each
chunk of hexstring that _hexify() produces before whitespace occurs.
@type _hex_chunk: intiÿÿÿÿNi c C s“ | d k r t } n | j d ƒ } t | ƒ } | | k r g } d } x2 | | k r| | j | | | | !ƒ | | 7} qK Wd j | ƒ } n | S( s Convert a binary string into its hex encoding, broken up into chunks
of I{chunksize} characters separated by a space.
@param data: the binary string
@type data: string
@param chunksize: the chunk size. Default is L{dns.rdata._hex_chunksize}
@rtype: string
t hex_codeci t N( t Nonet _hex_chunksizet encodet lent appendt join( t datat chunksizet hext lt chunkst i( ( s/ /usr/lib64/python2.7/site-packages/dns/rdata.pyt _hexify' s
c C s¥ | d k r t } n | j d ƒ } | j d d ƒ } t | ƒ } | | k r¡ g } d } x2 | | k rŽ | j | | | | !ƒ | | 7} q] Wd j | ƒ } n | S( s$ Convert a binary string into its base64 encoding, broken up into chunks
of I{chunksize} characters separated by a space.
@param data: the binary string
@type data: string
@param chunksize: the chunk size. Default is
L{dns.rdata._base64_chunksize}
@rtype: string
t base64_codecs
t i R N( R t _base64_chunksizeR t replaceR R R ( R R t b64R R R
( ( s/ /usr/lib64/python2.7/site-packages/dns/rdata.pyt
_base64ify@ s t "s \c C s} d } xp | D]h } | t k r0 | d | 7} q
t | ƒ d k ra t | ƒ d k ra | | 7} q
| d t | ƒ 7} q
W| S( sª Escape the characters in a quoted string which need it.
@param qstring: the string
@type qstring: string
@returns: the escaped string
@rtype: string
R s \i i s \%03d( t __escapedt ord( t qstringt textt c( ( s/ /usr/lib64/python2.7/site-packages/dns/rdata.pyt _escapify^ s
$
c C sS x8 t t | ƒ d d d ƒ D] } | | d k r Pq q Wd j | d | d !ƒ S( sñ Determine the index of greatest byte that isn't all zeros, and
return the bitmap that contains all the bytes less than that index.
@param what: a string of octets representing a bitmap.
@type what: string
@rtype: string
i iÿÿÿÿt R i ( t xrangeR R ( t whatR
( ( s/ /usr/lib64/python2.7/site-packages/dns/rdata.pyt _truncate_bitmapq s #t Rdatac B s
e Z d Z d d g Z d „ Z d „ Z d „ Z d e d „ Z d d d „ Z
d d „ Z d „ Z d
„ Z
d „ Z d „ Z d
„ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d e d „ Z e e ƒ Z d d „ Z e e ƒ Z d e d „ Z RS( s( Base class for all DNS rdata types.
t rdclasst rdtypec C s | | _ | | _ d S( s Initialize an rdata.
@param rdclass: The rdata class
@type rdclass: int
@param rdtype: The rdata type
@type rdtype: int
N( R! R"