�
�.=Pc@s\ddlZddlZddlZddlZddlZdejjfd��YZdS(i����NtNSECcBs�eZdZddgZd�Zd
ed�Zd
ed�Ze e�Zd
d
d�Z
d
d�Ze e�Zd
ed�Zd �Z
RS(s�NSEC record
@ivar next: the next name
@type next: dns.name.Name object
@ivar windows: the windowed bitmap list
@type windows: list of (window number, string) tuplestnexttwindowscCs/tt|�j||�||_||_dS(N(tsuperRt__init__RR(tselftrdclasstrdtypeRR((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyR!s cKs�|jj||�}d}x�|jD]�\}}g}x�tdt|��D]j} t|| �}
xQtdd�D]@}|
d|?@rs|jtjj |d| d|��qsqsWqMW|ddj
|�7}q%Wd||fS(Ntiii�it s%s%s(Rtchoose_relativityRtxrangetlentordtappendtdnst rdatatypetto_texttjoin(Rtorigint
relativizetkwRttexttwindowtbitmaptbitstitbytetj((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyR&s%cCs�|j�}|j||�}g}x�|j�j�}|j�rIPntjj|j�} | dkrtj j
d��n| dkr�tj j
d��n|j| �q'|j�d}
d}d}dgd}
g}x�|D]�} | |kr�q�n| }| d}||
krS|j|
dj
|
d|!�f�dgd}
|}
n| d}|d }|d }|d
}tt|
|�d|?B�|
|<q�W|j|
dj
|
d|!�f�|||||�S(NisNSEC with bit 0i��sNSEC with bit > 65535ti iRiii�(tget_nameR
tgettunescapet
is_eol_or_eofRRt from_texttvaluet exceptiontSyntaxErrorRtsortRtchrR
(tclsRRttokRRRtrdtypesttokentnrdtypeRtoctetstprior_rdtypeRRt
new_windowtoffsetRtbit((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyR"4sF
#
&#cCsm|jj|d|�xP|jD]E\}}|jt|��|jtt|���|j|�q WdS(N(Rtto_wiretNoneRtwriteR'R(RtfiletcompressRRR((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyR2[s
c
Csftjj||| |�\}}||7}||8}g} x�|dkr4|dkrmtjjd��nt||�}
t||d�}|dks�|dkr�tjjd��n|d7}|d8}||kr�tjjd��n||||!j�}||7}||8}| j|
|f�q@W|dk rS|j |�}n||||| �S( NiisNSEC too shortii sbad NSEC octetsisbad NSEC bitmap length(
Rtnamet from_wireR$t FormErrorR
tunwrapRR3R(
R(RRtwiretcurrenttrdlenRRtcusedRRR-R((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyR8bs,#
cCs|jj||�|_dS(N(RR
(RRR((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyR
|scCs
|j|�S(N(t _wire_cmp(Rtother((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyt_cmpsN(t__name__t
__module__t__doc__t __slots__RR3tTrueRR"tclassmethodR2R8R
RA(((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyRs %( t cStringIOt
dns.exceptionRt dns.rdatat
dns.rdatatypetdns.nametrdatatRdataR(((s:/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/NSEC.pyt<module>s
|