
    g.y                     $   % S r SSKrSSKrSSKrSSKrSSKrSSKrSSKJr  SSK	J
r
JrJrJrJr  SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSrSr " S S\R8                  R:                  5      r\S	4S
 jr\S	4S jr \S	4S jr!Sr"S r#S r$\RJ                  RL                  r'\RJ                  RJ                   " S S5      5       r(\RJ                  RJ                   " S S\(5      5       r)0 r*\\\RV                  RX                  \RZ                  R\                  4   \
4   \/S'   Sr0Sq1S.S jr2S.S jr3    S/S\\RV                  RX                  \44   S\\RZ                  R\                  \44   S\\Rj                  Rl                  \44   S\\Rn                  Rp                     S\9S\\Rn                  Rp                     S\\Rn                  Rt                     S\(4S  jjr; S0S\\RV                  RX                  \44   S\\RZ                  R\                  \44   S!\Rx                  Rz                  S\\Rn                  Rp                     S\(4
S" jjr> S0S\\RV                  RX                  \44   S\\RZ                  R\                  \44   S#\?S$\@S%\@S\\Rn                  Rp                     S\(4S& jjrA " S' S(\R8                  R:                  5      rBS)\RV                  R                  4S*\
S\@S+\4S,\9S\RV                  RX                  SS4S- jjrDg)1z
DNS rdata.    N)import_module)AnyDictOptionalTupleUnion    Tc                       \ rS rSrSrSrg)NoRelativeRdataOrdering3   zAn attempt was made to do an ordered comparison of one or more
rdata with relative names.  The only reliable way of sorting rdata
is to use non-relativized rdata.

 N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       B/home/matz/Project1/venv/lib/python3.13/site-packages/dns/rdata.pyr   r   3   s    r   r       c           	          U(       d  U R                  5       $ UR                  [        S[        U 5      U5       Vs/ s H	  o0X3U-    PM     sn5      R                  5       $ s  snf )zPBreak a binary string into chunks of chunksize characters separated by
a space.
r   )decodejoinrangelen)data	chunksize	separatoris       r   
_wordbreakr    ;   sV    
 {{}>>*/3t9i*HI*HQai-	 *HIfhIs   A c                 B    [        [        R                  " U 5      X5      $ )zwConvert a binary string into its hex encoding, broken up into chunks
of chunksize characters separated by a separator.
)r    binasciihexlifyr   r   r   kws       r   _hexifyr&   J   s    
 h&&t,iCCr   c                 B    [        [        R                  " U 5      X5      $ )zzConvert a binary string into its base64 encoding, broken up into chunks
of chunksize characters separated by a separator.
)r    base64	b64encoder$   s       r   
_base64ifyr*   R   s    
 f&&t,iCCr   s   "\c                 (   [        U [        5      (       a  U R                  5       n [        U [        5      (       d  [        U 5      n SnU  HD  nU[        ;   a  US[        U5      -   -  nM   US:  a  US:  a  U[        U5      -  nM<  USU-  -  nMF     U$ )z7Escape the characters in a quoted string which need it. \r	      z\%03d)
isinstancestrencode	bytearray	__escapedchr)qstringtextcs      r   	_escapifyr8   _   s     '3.."gy))G$D	>D3q6M!D$Y1t8CFNDHqL D  Kr   c                 p    [        [        U 5      S-
  SS5       H  nX   S:w  d  M  U SUS-    s  $    U SS $ )zDetermine the index of greatest byte that isn't all zeros, and
return the bitmap that contains all the bytes less than that index.
   r   )r   r   )whatr   s     r   _truncate_bitmapr=   r   sF    
 3t9q="b)7a<AE?" * !9r   c                      \ rS rSrSr/ SQrS rS rS rS r	S\
R                  R                  4S	 jrS\4S
 jr  S?S\\
R"                  R$                     S\S\\\4   S\4S jjr   S@S\\   S\\
R"                  R0                     S\\
R"                  R$                     S\SS4
S jjr    SAS\\   S\\
R"                  R0                     S\\
R"                  R$                     S\S\\   4
S jjr SBS\\
R"                  R$                     SS4S jjrSBS\\
R"                  R$                     S\4S jjrS rS rS r S r!S r"S r#S r$S r%S  r&S! r'\(   SCS"\
RR                  RT                  S#\
R                  R                  S$\
RV                  RX                  S\\
R"                  R$                     S\S%\\
R"                  R$                     SS 4S& jj5       r-\( SBS"\
RR                  RT                  S#\
R                  R                  S'\
R\                  R^                  S\\
R"                  R$                     SS 4
S( jj5       r0S)\SS 4S* jr1\(S+ 5       r2\(S, 5       r3\(   SDS-\S.\S/\\   S0\S\4
S1 jj5       r4\(S2 5       r5\(S3 5       r6\(S4 5       r7\(S5 5       r8\(S6 5       r9\(SES7 j5       r:\(S8 5       r;\(S9 5       r<\(S: 5       r=\(S; 5       r>\(S< 5       r?\(S= 5       r@S>rAg)FRdata   z#Base class for all DNS rdata types.)rdclassrdtype	rdcommentc                 j    U R                  U5      U l        U R                  U5      U l        SU l        g)zInitialize an rdata.

*rdclass*, an ``int`` is the rdataclass of the Rdata.

*rdtype*, an ``int`` is the rdatatype of the Rdata.
N)_as_rdataclassrA   _as_rdatatyperB   rC   )selfrA   rB   s      r   __init__Rdata.__init__   s/     **73((0r   c                 v    [         R                  R                  S U R                  R                   5       5      $ )Nc              3   <   #    U  H  n[        US / 5      v   M     g7f)	__slots__N)getattr).0clss     r   	<genexpr>'Rdata._get_all_slots.<locals>.<genexpr>   s       -
5KcGCb))5Ks   )	itertoolschainfrom_iterable	__class____mro__rG   s    r   _get_all_slotsRdata._get_all_slots   s0    ,, -
59^^5K5K-
 
 	
r   c                 R    0 nU R                  5        H  n[        X5      X'   M     U$ N)rX   rM   )rG   stateslots      r   __getstate__Rdata.__getstate__   s-     '')D!$-EK *r   c                     UR                  5        H  u  p#[        R                  XU5        M     [        U S5      (       d  [        R                  U SS 5        g g )NrC   )itemsobject__setattr__hasattr)rG   r\   r]   vals       r   __setstate__Rdata.__setstate__   sJ    IDt3/ 't[)) t[$7 *r   returnc                 6    [         R                  R                  $ )al  Return the type a Rdata covers.

DNS SIG/RRSIG rdatas apply to a specific type; this type is
returned by the covers() function.  If the rdata type is not
SIG or RRSIG, dns.rdatatype.NONE is returned.  This is useful when
creating rdatasets, allowing the rdataset to contain only RRSIGs
of a particular type, e.g. RRSIG(NS).

Returns a ``dns.rdatatype.RdataType``.
)dns	rdatatypeNONErW   s    r   coversRdata.covers   s     }}!!!r   c                 B    U R                  5       S-  U R                  -  $ )zReturn a 32-bit type value, the least significant 16 bits of
which are the ordinary DNS type, and the upper 16 bits of which are
the "covered" type, if any.

Returns an ``int``.
   )rm   rB   rW   s    r   extended_rdatatypeRdata.extended_rdatatype   s     {{}"T[[00r   Norigin
relativizer%   c                     [         e)z5Convert an rdata to text format.

Returns a ``str``.
NotImplementedErrorrG   rs   rt   r%   s       r   to_textRdata.to_text   s
     "!r   filecompresscanonicalizec                     [         er[   rv   rG   r{   r|   rs   r}   s        r   _to_wireRdata._to_wire   s
     "!r   c                     U(       a  U R                  XX45        g[        R                  " 5       nU R                  XRX45        UR                  5       $ )znConvert an rdata to wire format.

Returns a ``bytes`` if no output file was specified, or ``None`` otherwise.
N)r   ioBytesIOgetvalue)rG   r{   r|   rs   r}   fs         r   to_wireRdata.to_wire   s?     
 MM$&?

AMM!v<::<r   zdns.rdata.GenericRdatac                     [         R                  R                  U R                  U R                  U R                  US95      $ )zbCreates a dns.rdata.GenericRdata equivalent of this rdata.

Returns a ``dns.rdata.GenericRdata``.
)rs   )rj   rdataGenericRdatarA   rB   r   )rG   rs   s     r   
to_genericRdata.to_generic   s5     yy%%LL$++t||6|'B
 	
r   c                 0    U R                  USS9nUc   eU$ )z{Convert rdata to a format suitable for digesting in hashes.  This
is also the DNSSEC canonical form.

Returns a ``bytes``.
T)rs   r}   )r   )rG   rs   wires      r   to_digestableRdata.to_digestable   s'     ||6|=r   c                    U R                  5       nU[        R                  R                  :X  a  SnO%S[        R                  R	                  U5      -   S-   nS[        R
                  R	                  U R                  5      -   S-   [        R                  R	                  U R                  5      -   U-   S-   [        U 5      -   S-   $ )Nr,   ()z<DNS  z rdata: >)	rm   rj   rk   rl   ry   
rdataclassrA   rB   r0   )rG   rm   ctexts      r   __repr__Rdata.__repr__	  s    S]]'''E#--//77#=Enn$$T\\23 mm##DKK01 	
  $i 		
r   c                 "    U R                  5       $ r[   )ry   rW   s    r   __str__Rdata.__str__  s    ||~r   c                 .    U R                  5       nSn UR                  5       nSn[        (       a  X5:w  a	  U(       a  ggOU(       d  U(       a  [        eWW:X  a  gX$:  a  gg! [        R                  R                   a9    [        (       a)  U R                  [        R                  R
                  5      nSn Nf = f! [        R                  R                   a9    [        (       a)  UR                  [        R                  R
                  5      nSn Nf = f)a  Compare an rdata with another rdata of the same rdtype and
rdclass.

For rdata with only absolute names:
    Return < 0 if self < other in the DNSSEC ordering, 0 if self
    == other, and > 0 if self > other.
For rdata with at least one relative names:
    The rdata sorts before any rdata with only absolute names.
    When compared with another relative rdata, all names are
    made absolute as if they were relative to the root, as the
    proper origin is not available.  While this creates a stable
    ordering, it is NOT guaranteed to be the DNSSEC ordering.
    In the future, all ordering comparisons for rdata with
    relative names will be disallowed.
FTr;   r:   r   )r   rj   nameNeedAbsoluteNameOrOrigin_allow_relative_comparisonsrootr   )rG   otherourour_relativetheirtheir_relatives         r   _cmp
Rdata._cmp  s     	 $$&C L
	"'')E"N
 '&-   . ^))%<[5 xx00 	 **((7L	  xx00 	"**++CHHMM:!N	"s$   A# B= #AB:9B:=ADDc                 4   [        U[        5      (       d  gU R                  UR                  :w  d  U R                  UR                  :w  a  gSnSn U R	                  5       n UR	                  5       nX#:w  a  gXE:H  $ ! [
        R                  R                   a.    U R	                  [
        R                  R                  5      nSn Nff = f! [
        R                  R                   a.    UR	                  [
        R                  R                  5      nSn Nf = f)NFT)	r/   r?   rA   rB   r   rj   r   r   r   )rG   r   r   r   r   r   s         r   __eq__Rdata.__eq__L  s    %''<<5==(DKK5<<,G	 $$&C	"'')E )| xx00 	 $$SXX]]3CL	 
 xx00 	"''6E!N	"s&   A< "C <A	CCA	DDc                     [        U[        5      (       d  gU R                  UR                  :w  d  U R                  UR                  :w  a  gU R	                  U5      (       + $ NT)r/   r?   rA   rB   r   rG   r   s     r   __ne__Rdata.__ne__a  sF    %''<<5==(DKK5<<,G;;u%%%r   c                     [        U[        5      (       a4  U R                  UR                  :w  d  U R                  UR                  :w  a  [        $ U R                  U5      S:  $ Nr   r/   r?   rA   rB   NotImplementedr   r   s     r   __lt__Rdata.__lt__h  I    5%((||u}},{{ell*!!yy!##r   c                     [        U[        5      (       a4  U R                  UR                  :w  d  U R                  UR                  :w  a  [        $ U R                  U5      S:*  $ r   r   r   s     r   __le__Rdata.__le__q  I    5%((||u}},{{ell*!!yy1$$r   c                     [        U[        5      (       a4  U R                  UR                  :w  d  U R                  UR                  :w  a  [        $ U R                  U5      S:  $ r   r   r   s     r   __ge__Rdata.__ge__z  r   r   c                     [        U[        5      (       a4  U R                  UR                  :w  d  U R                  UR                  :w  a  [        $ U R                  U5      S:  $ r   r   r   s     r   __gt__Rdata.__gt__  r   r   c                 f    [        U R                  [        R                  R                  5      5      $ r[   )hashr   rj   r   r   rW   s    r   __hash__Rdata.__hash__  s     D&&sxx}}566r   rA   rB   tokrelativize_toc                     [         er[   rv   )rO   rA   rB   r   rs   rt   r   s          r   	from_textRdata.from_text  s
     "!r   parserc                     [         er[   rv   rO   rA   rB   r   rs   s        r   from_wire_parserRdata.from_wire_parser  s
     "!r   kwargsc                   ^ ^ [         R                  " T R                  5      R                  nT Hb  nUS:X  a  M  X2;  a&  [	        ST R
                  R                   SU S35      eUS;   d  M>  [	        ST R
                  R                   SU S35      e   UU 4S jU 5       nT R
                  " U6 nTR                  ST R                  5      nUb  [        R                  USU5        U$ )aS  
Create a new Rdata instance based on the instance replace was
invoked on. It is possible to pass different parameters to
override the corresponding properties of the base Rdata.

Any field specific to the Rdata type can be replaced, but the
*rdtype* and *rdclass* fields cannot.

Returns an instance of the same Rdata subclass as *self*.
rC   'z' object has no attribute 'rA   rB   zCannot overwrite 'z' attribute 'c              3   \   >#    U  H!  nTR                  U[        TU5      5      v   M#     g 7fr[   )getrM   )rN   keyr   rG   s     r   rP    Rdata.replace.<locals>.<genexpr>  s&     Jz

3c 233zs   ),)inspect	signaturerH   
parametersAttributeErrorrU   r   r   rC   rb   rc   )rG   r   r   r   argsrdrC   s   ``     r   replaceRdata.replace  s     &&t}}5@@
 Ck!$$//00KC5PQR  ++$()@)@(AseSTU   KzJ ^^T" JJ{DNN;	 r;	:	r   c                 T    [         R                  R                  R                  U5      $ r[   )rj   r   
RdataClassmakerO   values     r   rE   Rdata._as_rdataclass  s    ~~((--e44r   c                 T    [         R                  R                  R                  U5      $ r[   )rj   rk   	RdataTyper   r   s     r   rF   Rdata._as_rdatatype  s    }}&&++E22r   r   r1   
max_lengthempty_okc                 d   U(       a&  [        U[        5      (       a  UR                  5       nOD[        U[        5      (       a  [	        U5      nO#[        U[        5      (       a  UnO[        S5      eUb  [        U5      U:  a  [        S5      eU(       d  [        U5      S:X  a  [        S5      eU$ )Nz	not bytesztoo longr   zempty bytes not allowed)r/   r0   r1   r2   bytes
ValueErrorr   )rO   r   r1   r   r   bvalues         r   	_as_bytesRdata._as_bytes  s     j,,\\^Fy))5\Fu%%F[))!c&kJ&>Z((CK1,677r   c                     [        U[        5      (       a  [        R                  R	                  U5      $ [        U[        R                  R
                  5      (       d  [        S5      eU$ )Nz
not a name)r/   r0   rj   r   r   Namer   r   s     r   _as_nameRdata._as_name  sK    
 eS!!88%%e,,E388==11\**r   c                 t    [        U[        5      (       d  [        S5      eUS:  d  US:  a  [        S5      eU$ )Nnot an integerr      znot a uint8r/   intr   r   s     r   	_as_uint8Rdata._as_uint8  s8    %%%-..19]++r   c                 t    [        U[        5      (       d  [        S5      eUS:  d  US:  a  [        S5      eU$ )Nr   r   i  znot a uint16r   r   s     r   
_as_uint16Rdata._as_uint16  s8    %%%-..19^,,r   c                 t    [        U[        5      (       d  [        S5      eUS:  d  US:  a  [        S5      eU$ )Nr   r   l    znot a uint32r   r   s     r   
_as_uint32Rdata._as_uint32  s9    %%%-..19
*^,,r   c                 t    [        U[        5      (       d  [        S5      eUS:  d  US:  a  [        S5      eU$ )Nr   r   l    znot a uint48r   r   s     r   
_as_uint48Rdata._as_uint48  s9    %%%-..19/^,,r   c                     [        U[        5      (       d  [        S5      eUb  X:  a  [        S5      eUb  X:  a  [        S5      eU$ )Nr   zvalue too smallzvalue too larger   )rO   r   lowhighs       r   _as_intRdata._as_int  sK    %%%-..?u{.//.//r   c                     [        U[        5      (       a  [        R                  R	                  U5      $ [        U[
        5      (       a  [        R                  R                  U5      $ [        S5      e)Nznot an IPv4 address)r/   r0   rj   ipv4r}   r   	inet_ntoar   r   s     r   _as_ipv4_addressRdata._as_ipv4_address%  R    eS!!88((//u%%88%%e,,233r   c                     [        U[        5      (       a  [        R                  R	                  U5      $ [        U[
        5      (       a  [        R                  R                  U5      $ [        S5      e)Nznot an IPv6 address)r/   r0   rj   ipv6r}   r   r  r   r   s     r   _as_ipv6_addressRdata._as_ipv6_address.  r  r   c                 F    [        U[        5      (       a  U$ [        S5      e)Nznot a boolean)r/   boolr   r   s     r   _as_boolRdata._as_bool7  s    eT""L_--r   c                     [        U[        5      (       a+  U R                  US[        R                  R
                  5      $ [        U[        5      (       a  [        R                  R                  U5      $ [        S5      e)Nr   z	not a TTL)	r/   r   r	  rj   ttlMAX_TTLr0   r   r   r   s     r   _as_ttlRdata._as_ttl>  sW    eS!!;;ua99s##77$$U++[))r   c                 b   ^  T" U5      4$ ! [          a    [        U4S jU 5       5      s $ f = f)Nc              3   4   >#    U  H  nT" U5      v   M     g 7fr[   r   )rN   vas_values     r   rP   "Rdata._as_tuple.<locals>.<genexpr>P  s     4e!es   )	Exceptiontuple)rO   r   r!  s     `r   	_as_tupleRdata._as_tupleG  s9    	5 UO%% 	5 4e444	5s    ..c                 H    [        U5      n[        R                  " U5        U$ r[   )listrandomshuffle)rO   iterablera   s      r   _processing_orderRdata._processing_orderT  s    Xur   )rA   rC   rB   r   NNF)NNNFr[   NTN)FNT)NN)Br   r   r   r   r   rL   rH   rX   r^   rf   rj   rk   r   rm   r   rq   r   r   r   r  r   r0   r   ry   CompressTyper   r   r   r   r   r   r   r   r   r   r   r   r   r   r   classmethodr   r   	tokenizer	Tokenizerr   r   Parserr   r   rE   rF   r   r   r   r   r  r  r	  r  r  r  r  r%  r,  r   r   r   r   r?   r?      sU   -2I


8"// "1C 1 +/"'" " 38n	"
 
"  59*.""sm" 388001" '	"
 " 
" #48*." sm  388001  '	 
   
% 2 15	
sxx}}-	
	!	
HSXX]]$; u 
"-^*&$%%$7  +/15	"**	" ''	" ]]$$		"
 '	" 	"  .	" 
	" 	"  +/"**" ''" 	"
 '" 
" "( ( (Z 5 5 3 3  $(  SM	
  
 *             4 4 4 4 . . * * 5 5  r   r?   c            	          ^  \ rS rSrSrS/rU 4S jr  SS\\R                  R                     S\S\\\4   S\4S	 jjr\ SS
 j5       rSS jr\SS j5       rSrU =r$ )r   i[  zGeneric Rdata Class

This class is used for rdata types for which we have no better
implementation.  It implements the DNS "unknown RRs" scheme.
r   c                 0   > [         TU ]  X5        X0l        g r[   )superrH   r   )rG   rA   rB   r   rU   s       r   rH   GenericRdata.__init__e  s    )	r   rs   rt   r%   rh   c                 `    S[        U R                  5      -  [        U R                  40 UD6-   $ )Nz\# %d )r   r   r&   rx   s       r   ry   GenericRdata.to_texti  s*     3tyy>)GDII,D,DDDr   c                    UR                  5       nUR                  5       (       a  UR                  S:w  a  [        R                  R                  S5      eUR                  5       nUR                  S5      R                  5       n	[        R                  " U	5      n
[        U
5      U:w  a  [        R                  R                  S5      eU " XU
5      $ )N\#z$generic rdata does not start with \#Tz'generic rdata hex data has wrong length)r   is_identifierr   rj   	exceptionSyntaxErrorget_int!concatenate_remaining_identifiersr1   r"   	unhexlifyr   )rO   rA   rB   r   rs   rt   r   tokenlengthhexr   s              r   r   GenericRdata.from_textq  s     	""$$u(<--++,STT33D9@@B!!#&t9--++,UVV7D))r   c                 :    UR                  U R                  5        g r[   )writer   r   s        r   r   GenericRdata._to_wire  s    

499r   c                 0    U " XUR                  5       5      $ r[   )get_remainingr   s        r   r   GenericRdata.from_wire_parser  s    7F$8$8$:;;r   )r   r   r/  r.  r[   )r   r   r   r   r   rL   rH   r   rj   r   r   r  r   r0   r   ry   r1  r   r   r   r   __classcell__)rU   s   @r   r   r   [  s     I +/E'E E 38n	E
 
E OS* * < <r   r   _rdata_classeszdns.rdtypesc                     [         R                  X45      nU(       d  [         R                  [        R                  R                  U45      nU(       d  [
        (       a  [        R                  R                  U 5      n[        R                  R                  U5      nUR                  SS5      n [        SR                  [        XE/5      5      n[        Xe5      nU[         X4'   U(       d  U(       a  [        nU[         X4'   U$ ! [         an     [        SR                  [        SU/5      5      n[        Xe5      nU[         [        R                  R                  U4'   U[         X4'    N! [         a      Nf = ff = f)N-_.ANY)rN  r   rj   rk   rS  _dynamic_load_allowedr   ry   r   r   r   _module_prefixrM   ImportErrorr   )rA   rB   use_genericrO   rdclass_textrdtype_textmods          r   get_rdata_classr[    sC   


g.
/C  #--"3"3V!<=,,>>11':L--//7K%--c37K#HHnlHI c/4701 ;,/()J  '.%1U(VWC!#3CCFNCNN$6$6#?@8;NG#45" s+   05D 
E=AE++
E95E=8E99E=c                    [         R                  R                   H(  n[        [         R                  R
                  US5        M*     [        [         R                  R                  [         R                  R                  S5        U (       a  Sqgg)a  Load all rdata types for which dnspython has a non-generic implementation.

Normally dnspython loads DNS rdatatype implementations on demand, but in some
specialized cases loading all types at an application-controlled time is preferred.

If *disable_dynamic_load*, a ``bool``, is ``True`` then dnspython will not attempt
to use its dynamic loading mechanism if an unknown type is subsequently encountered,
and will simply use the ``GenericRdata`` class.
FN)	rj   rk   r   r[  r   INCHArT  )disable_dynamic_loadrB   s     r   load_all_typesra    s^     --))))659 *
 CNN%%s}}> !&	 r   rA   rB   r   rs   rt   r   
idna_codecrh   c           
         [        U[        5      (       a  [        R                  R	                  X&S9n[        R
                  R                  R                  U 5      n [        R                  R                  R                  U5      n[        X5      n[        R                  R                  [        R                  R                  5         SnU[        :w  a  UR                  5       n	UR!                  U	5        U	R#                  5       (       a  U	R$                  S:X  a  [        R'                  XX#XE5      n
[)        XU
R*                  S[-        U
R*                  5      U5      nUR/                  5       nXR*                  :w  a  [        R                  R                  S5      eUc  UR'                  XX#XE5      nUR1                  5       n	U	R2                  b!  [4        R7                  USU	R2                  5        UsSSS5        $ ! , (       d  f       g= f)a  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.

If *tok* is a ``str``, then a tokenizer is created and the string
is used as its input.

*rdclass*, a ``dns.rdataclass.RdataClass`` or ``str``, the rdataclass.

*rdtype*, a ``dns.rdatatype.RdataType`` or ``str``, the rdatatype.

*tok*, a ``dns.tokenizer.Tokenizer`` or a ``str``.

*origin*, a ``dns.name.Name`` (or ``None``), the
origin to use for relative names.

*relativize*, a ``bool``.  If true, name will be relativized.

*relativize_to*, a ``dns.name.Name`` (or ``None``), the origin to use
when relativizing names.  If not set, the *origin* value will be used.

*idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA
encoder/decoder to use if a tokenizer needs to be created.  If
``None``, the default IDNA 2003 encoder/decoder is used.  If a
tokenizer is not created, then the codec associated with the tokenizer
is the one that is used.

Returns an instance of the chosen Rdata subclass.

)rb  Nr<  r   z9compressed data in generic syntax form of known rdatatyperC   )r/   r0   rj   r2  r3  r   r   r   rk   r   r[  r>  ExceptionWrapperr?  r   r   ungetr=  r   r   	from_wirer   r   r   get_eol_as_tokencommentrb   rc   )rA   rB   r   rs   rt   r   rb  rO   r   rC  grdatarwires               r   r   r     s   Z #smm%%c%Ann'',,W5G]]$$))&1F
'
*C		'	'(A(A	B,GGIEIIe""$$)= &//S* "V[[!S5Ev KK'--33- 
 =MMjE $$&==$uk5==AK 
C	B	Bs   D)G::
Hr   c                    [         R                  R                  R                  U 5      n [         R                  R
                  R                  U5      n[        X5      n[         R                  R                  [         R                  R                  5         UR                  XX#5      sSSS5        $ ! , (       d  f       g= f)a  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.

*rdclass*, a ``dns.rdataclass.RdataClass`` or ``str``, the rdataclass.

*rdtype*, a ``dns.rdatatype.RdataType`` or ``str``, the rdatatype.

*parser*, a ``dns.wire.Parser``, the parser, which should be
restricted to the rdata length.

*origin*, a ``dns.name.Name`` (or ``None``).  If not ``None``,
then names will be relativized to this origin.

Returns an instance of the chosen Rdata subclass.
N)rj   r   r   r   rk   r   r[  r>  rd  	FormErrorr   )rA   rB   r   rs   rO   s        r   r   r     s{    : nn'',,W5G]]$$))&1F
'
*C		'	'(?(?	@##GVD 
A	@	@s   B11
B?r   currentrdlenc                     [         R                  R                  X#5      nUR                  U5         [	        XXe5      sSSS5        $ ! , (       d  f       g= f)a  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.

*rdclass*, an ``int``, the rdataclass.

*rdtype*, an ``int``, the rdatatype.

*wire*, a ``bytes``, the wire-format message.

*current*, an ``int``, the offset in wire of the beginning of
the rdata.

*rdlen*, an ``int``, the length of the wire-format rdata

*origin*, a ``dns.name.Name`` (or ``None``).  If not ``None``,
then names will be relativized to this origin.

Returns an instance of the chosen Rdata subclass.
N)rj   r   r4  restrict_tor   )rA   rB   r   rm  rn  rs   r   s          r   rf  rf  @  s;    D XX__T+F			E	"@ 
#	"	"s   A
Ac                   $    \ rS rSrSrSS1rSrSrg)RdatatypeExistsig  zDNS rdatatype already exists.rA   rB   zKThe rdata type with class {rdclass:d} and rdtype {rdtype:d} already exists.r   N)r   r   r   r   r   supp_kwargsfmtr   r   r   r   rr  rr  g  s    'h'K	 r   rr  FimplementationrY  is_singletonc                 `   [         R                  R                  R                  U5      n[	        XA5      nU[
        :w  d$  [         R                  R                  U5      (       a	  [        XAS9e[        XR                  SS5      5      [        XA4'   [         R                  R                  XU5        g)a  Dynamically register a module to handle an rdatatype.

*implementation*, a module implementing the type in the usual dnspython
way.

*rdtype*, an ``int``, the rdatatype to register.

*rdtype_text*, a ``str``, the textual form of the rdatatype.

*is_singleton*, a ``bool``, indicating if the type is a singleton (i.e.
RRsets of the type can have only one member.)

*rdclass*, the rdataclass of the type, or ``dns.rdataclass.ANY`` if
it applies to all classes.
r   rP  rQ  N)rj   rk   r   r   r[  r   is_metatyperr  rM   r   rN  register_type)ru  rB   rY  rv  rA   existing_clss         r   ry  ry  q  s    . ]]$$))&1F"73L|#s}}'@'@'H'Hg==(/++C5)NG$% MM\Br   )T)NTNNr[   )Er   r(   r"   r   r   rR   r)  	importlibr   typingr   r   r   r   r   dns.exceptionrj   dns.immutabledns.ipv4dns.ipv6dns.namedns.rdataclassdns.rdatatypedns.tokenizerdns.ttldns.wire
_chunksizer   r>  DNSExceptionr   r    r&   r*   r3   r8   r=   	immutableconstify	_constifyr?   r   rN  r   r   rk   r   __annotations__rU  rT  r[  ra  r0   r2  r3  r   r   r  	IDNACodecr   r   r4  r   r   r   rf  rr  r]  ry  r   r   r   <module>r     s  $     	   # 4 4          
 # cmm88   *T 	 '$ D  *T D 	& MM""	 V V Vr (<5 (< (<X  U3>>44cmm6M6MMNPSST   8&8 '+-1/3W3>>,,c12W#--))3./W 
s}}&&+	,W SXX]]#	W
 W CHHMM*W ++,W W| '+	!E3>>,,c12!E#--))3./!E HHOO!E SXX]]#	!E
 !ET '+$A3>>,,c12$A#--))3./$A $A 	$A
 $A SXX]]#$A $ANcmm00  ),):):CCC C 	C
 ^^&&C 
Cr   