Viewing File: /usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC3.pyo
ó
-=Pc @ s¤ 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 e j d d ƒ Z e j d d ƒ Z
d Z d Z d e j
j f d „ ƒ YZ d S( iÿÿÿÿNt 0123456789ABCDEFGHIJKLMNOPQRSTUVt ABCDEFGHIJKLMNOPQRSTUVWXYZ234567i t NSEC3c B s‰ e Z d Z d d d d d d g Z d „ Z d
e d „ Z d
e d „ Z e e ƒ Z d
d
d
„ Z
d
d „ Z e e ƒ Z d „ Z RS( sž NSEC3 record
@ivar algorithm: the hash algorithm number
@type algorithm: int
@ivar flags: the flags
@type flags: int
@ivar iterations: the number of iterations
@type iterations: int
@ivar salt: the salt
@type salt: string
@ivar next: the next name hash
@type next: string
@ivar windows: the windowed bitmap list
@type windows: list of (window number, string) tuplest algorithmt flagst
iterationst saltt nextt windowsc C sS t t | ƒ j | | ƒ | | _ | | _ | | _ | | _ | | _ | | _ d S( N( t superR t __init__R R R R R R ( t selft rdclasst rdtypeR R R R R R ( ( s; /usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC3.pyR
6 s c
K s/ t j | j ƒ j t ƒ j ƒ } | j d k r9 d } n | j j d ƒ } d } x¸ | j D] \ } } g } x t d t
| ƒ ƒ D]j }
t | |
ƒ } xQ t d d ƒ D]@ } | d | ?@r© | j t
j j | d |
d | ƒ ƒ q© q© Wqƒ W| d d j | ƒ 7} q[ Wd | j | j | j | | | f S(
Nt t -s hex-codeci i i€ i t s %u %u %u %s %s%s( t base64t b32encodeR t translatet b32_normal_to_hext lowerR t encodeR t xranget lent ordt appendt dnst rdatatypet to_textt joinR R R (
R t origint
relativizet kwR R t textt windowt bitmapt bitst it bytet j( ( s; /usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC3.pyR @ s ! %c C sa | j ƒ } | j ƒ } | j ƒ } | j ƒ } | d k rE d } n | j d ƒ } | j ƒ j ƒ j t ƒ }
t j |
ƒ }
g } x‰ | j ƒ j
ƒ } | j ƒ r© Pn t j
j | j ƒ }
|
d k rß t j j d ƒ ‚ n |
d k r t j j d ƒ ‚ n | j |
ƒ q‡ | j ƒ d } d } d } d g d } g } xÎ | D]Æ }
|
| k r^qFn |
} |
d
} | | k rÂ| d k r¬| j | d j | d | !ƒ f ƒ n d g d } | } n |
d
} | d } | d } | d } t t | | ƒ d
| ?Bƒ | | <qFW| d k rB| j | d j | d | !ƒ f ƒ n | | | | | | | |
| ƒ S( NR R s hex-codeci s NSEC3 with bit 0iÿÿ s NSEC3 with bit > 65535t i i i i i€ ( t get_uint8t
get_uint16t
get_stringt decodet upperR t b32_hex_to_normalR t b32decodet gett unescapet
is_eol_or_eofR R t from_textt valuet exceptiont SyntaxErrorR t sortR t chrR ( t clsR R
t tokR R R R R R R t rdtypest tokent nrdtypeR# t octetst prior_rdtypeR$ R t
new_windowt offsetR' t bit( ( s; /usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC3.pyR4 S sX
&
&&c C sÙ t | j ƒ } | j t j d | j | j | j | ƒ ƒ | j | j ƒ t | j ƒ } | j t j d | ƒ ƒ | j | j ƒ xP | j D]E \ } } | j t
| ƒ ƒ | j t
t | ƒ ƒ ƒ | j | ƒ qŒ Wd S( Ns !BBHBs !B( R R t writet structt packR R R R R R9 ( R t filet compressR t lR# R$ ( ( s; /usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC3.pyt to_wire„ s c C sÝ t j d | | | d !ƒ \ } } } }
| d 7} | d 8} | | | |
!j ƒ } | |
7} | |
8} t j d | | ƒ \ } | d 7} | d 8} | | | | !j ƒ }
| | 7} | | 8} g } xõ | d k r½| d k rö t j j d ƒ ‚ n t | | ƒ } t | | d ƒ } | d k s2| d k rGt j j d ƒ ‚ n | d
7} | d
8} | | k r|t j j d ƒ ‚ n | | | | !j ƒ } | | 7} | | 8} | j | | f ƒ qÉ W| | | | | | | |
| ƒ S( Ns !BBHBi s !Bi i i s NSEC3 too shorti s bad NSEC3 octetsi s bad NSEC3 bitmap length( RE t unpackt unwrapR R6 t FormErrorR R ( R: R R
t wiret currentt rdlenR R R R t slenR t nlenR R R# R? R$ ( ( s; /usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC3.pyt from_wire‘ s<