f#dZddlmZmZmZmZmZmZddlZ ddl Z ddl Z ddl Z Gdde jjZ ddee j j"efdedee j(j*efd ee j,j.efd eed ee j j0d ee j j"d edee j j"defdZdee j j"efdedee j(j*efd ee j,j.efd edef dZ ddee j j"efdedee j8j:d ee j j0def dZdee j j"efdededefdZy)z)DNS RRsets (an RRset is a named rdataset))Any CollectionDictOptionalUnioncastNc eZdZdZddgZej jdfdejjdejjdej jdej jde ejjf fd Zfd Zd Zd Zfd Zd ededeffd Z ddejjdejjdej jdej jde ejjdef fd Z dde ejjdedeeefdeffd Z ddede ejj4de ejjdeeefdef fd Zdej:j<fdZxZ S)RRseta6A DNS RRset (named rdataset). RRset inherits from Rdataset, and RRsets can be treated as Rdatasets in most cases. There are, however, a few notable exceptions. RRsets have different to_wire() and to_text() method arguments, reflecting the fact that RRsets always have an owner name. namedeletingNrdclassrdtypecoverscDt||||||_||_y)zCreate a new RRset.N)super__init__r r selfr r rrr __class__s R/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/dns/rrset.pyrzRRset.__init__(s$ &&1   cht|}|j|_|j|_|SN)r_cloner r )robjrs rrz RRset._clone6s*gn99}}  rc|jdk(rd}n/dtjj|jzdz}|j-dtj j|jz}nd}dt |jzdztj j|jzdztjj|jz|z|zdz|jzd zS) Nr()z delete=z) rdns rdatatypeto_textr rdataclassstrr r r _rdata_repr)rctextdtexts r__repr__zRRset.__repr__<s ;;! E#--// <rs rr$z RRset.to_texts/,w IIvz4== <>  rfilecompressc Tt||j||||jfi|S)zConvert the RRset to wire format. All keyword arguments are passed to ``dns.rdataset.to_wire()``; see that function for details. Returns an ``int``, the number of records emitted. )rto_wirer r )rr@rAr<r>rs rrCz RRset.to_wires1w IItXvt}} @B  rchtjj|jt |S)zYConvert an RRset into an Rdataset. Returns a ``dns.rdataset.Rdataset``. )r"r0from_rdata_listttllistr,s r to_rdatasetzRRset.to_rdatasets# ||++DHHd4jAArr)NT)NN)!__name__ __module__ __qualname____doc__ __slots__r"r#NONEr r8r% RdataClass RdataTyperrrr*r-r2rboolr:r9rr&r$ CompressTypeintrCr0r1rH __classcell__)rs@rr r s$I+.--*<*<8< !hhmm !** ! '' !  '' ! 3>>445 !  .%232#2$2.9= hhmm** ''   ''  3>>445  *+/ '  38n   :59*.   388001 '  38n   *BS\\22Brr r rFr r text_rdatas idna_codecr<r= relativize_tor6c t|tr"tjj |d|}tj j j|}tjjj|}t|||} | j||D]L} tjj | j| j| ||||} | j| N| S)ayCreate an RRset with the specified name, TTL, class, and type, and with the specified list of rdatas in text format. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA encoder/decoder to use; if ``None``, the default IDNA 2003 encoder/decoder is used. *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. Returns a ``dns.rrset.RRset`` object. NrV)r/r&r"r from_textr%rOmaker#rPr update_ttlrdatar radd) r rFr rrUrVr<r=rWrtrds rfrom_text_listrbs:$xx!!$!Dnn'',,W5G ]] $ $ ) )& 1F dGV$ALL  YY IIqxxFJ z  b  Hrc Jt||||ttt|S)zCreate an RRset with the specified name, TTL, class, and type and with the specified rdatas in text format. Returns a ``dns.rrset.RRset`` object. )rbrrr&)r rFr rrUs rrZrZs'  c7FDC+$F rrdatasc@t|tr"tjj |d|}t |dk(r t dd}|D]G}|2t||j|j}|j||j|I|J|S)a/Create an RRset with the specified name and TTL, and with the specified list of rdata objects. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA encoder/decoder to use; if ``None``, the default IDNA 2003 encoder/decoder is used. Returns a ``dns.rrset.RRset`` object. NrYrzrdata list must not be empty) r/r&r"r rZlen ValueErrorr r rr\r^)r rFrdrVr_ras rrErEs"$xx!!$!D 6{a788 A 9dBJJ 2A LL  b  == Hrcnt||tttjj |S)zCreate an RRset with the specified name and TTL, and with the specified rdata objects. Returns a ``dns.rrset.RRset`` object. )rErrr"r]Rdata)r rFrds r from_rdatarjs' 4d:ciioo+F&O PPr)NNTNr) rLtypingrrrrrrdns.namer"dns.rdataclass dns.rdataset dns.rendererr0r1r r r8r&rSr%rOr#rP IDNACodecrQrbrZr]rirErjrrrrs($0??ZBCLL ! !ZBF04&*-1(  s" #( ( 3>>,,c1 2(  #--))3. / ( C ( ++, (  SXX]] #( ( CHHMM*(  ( V  s" # 3>>,,c1 2 #--))3. /     ,04   s" #   syy ' ++,    @QU388==#-.QSQ3Q5Qr