GhostManSec
Server: Apache
System: Linux s323.xrea.com 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: moonarc (17751)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/lib/python2.7/site-packages/dns/update.pyc
�
�b�Wc@s�dZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
dejjfd��YZ
dS(sDNS Dynamic Update Supporti����Ni(tstring_typestUpdatecBs�eZejjd
d
ejjd�Zd
d
d�Z	d�Z
d�Zd�Zd�Z
d�Zd
d�Zd
dd	�ZRS(c	Cs�tt|�j�|jtjjtjj�O_t|t	�rXtj
j|�}n||_t|t	�r�tj
j|�}n||_|j|j|j|tjjdtdt�|dk	r�|j||d|�ndS(s�Initialize a new DNS Update object.

        @param zone: The zone which is being updated.
        @type zone: A dns.name.Name or string
        @param rdclass: The class of the zone; defaults to dns.rdataclass.IN.
        @type rdclass: An int designating the class, or a string whose value
        is the name of a class.
        @param keyring: The TSIG keyring to use; defaults to None.
        @type keyring: dict
        @param keyname: The name of the TSIG key to use; defaults to None.
        The key must be defined in the keyring.  If a keyring is specified
        but a keyname is not, then the key used will be the first key in the
        keyring.  Note that the order of keys in a dictionary is not defined,
        so applications should supply a keyname when a keyring is used, unless
        they know the keyring contains only one key.
        @type keyname: dns.name.Name or string
        @param keyalgorithm: The TSIG algorithm to use; defaults to
        dns.tsig.default_algorithm.  Constants for TSIG algorithms are defined
        in dns.tsig, and the currently implemented algorithms are
        HMAC_MD5, HMAC_SHA1, HMAC_SHA224, HMAC_SHA256, HMAC_SHA384, and
        HMAC_SHA512.
        @type keyalgorithm: string
        tcreatetforce_uniquet	algorithmN(tsuperRt__init__tflagstdnstopcodetto_flagstUPDATEt
isinstanceRtnamet	from_texttorigint
rdataclasstzone_rdclasst
find_rrsettquestiont	rdatatypetSOAtTruetNonetuse_tsig(tselftzonetrdclasstkeyringtkeynametkeyalgorithm((s./usr/lib/python2.7/site-packages/dns/update.pyRs!		!
c	Csb|dkr|j}n|j�}|j|||j|j||tt�}|j||�dS(s&Add a single RR to the update section.N(Rt	authoritytcoversRRtrdtypeRtadd(RR
tttltrdtdeletingtsectionR trrset((s./usr/lib/python2.7/site-packages/dns/update.pyt_add_rrEsc
Gs�t|t�r'tjj|d�}nt|dtjj�r�xx|D]O}|ri|j||j	�nx*|D]"}|j
||j|d|�qpWqGWnt|�}t
|jd��}t|dtjj�r$|r�|j||dj	�nx�|D]}|j
|||d|�q�Wn�|jd�}t|t�rWtjj|�}n|rp|j||�nxH|D]@}	tjj|j||	|j�}|j
|||d|�qwWdS(s�Add records.  The first argument is the replace mode.  If
        false, RRs are added to an existing RRset; if true, the RRset
        is replaced with the specified contents.  The second
        argument is the section to add to.  The third argument
        is always a name.  The other arguments can be:

                - rdataset...

                - ttl, rdata...

                - ttl, rdtype, string...iR&N(RRRR
RRtrdatasettRdatasettdeleteR!R(R#tlisttinttpoptrdatatRdataRRR(
RtreplaceR&R
targstrdsR$R#R!ts((s./usr/lib/python2.7/site-packages/dns/update.pyt_addOs0


'
 
cGs|jt|j||�dS(s�Add records.  The first argument is always a name.  The other
        arguments can be:

                - rdataset...

                - ttl, rdata...

                - ttl, rdtype, string...N(R5tFalseR(RR
R2((s./usr/lib/python2.7/site-packages/dns/update.pyR"ws	c	Gs�t|t�r'tjj|d�}nt|�dkry|j|j|tj	j
tjj
tjjtjj
t
t
�nyt|dtjj�r�x]|D]3}x*|D]"}|j|d|tj	j�q�Wq�Wnt|�}t|dtjj�r(x�|D]"}|j|d|tj	j�q�Wn�|jd�}t|t�r[tjj|�}nt|�dkr�|j|j||j|tjjtj	j
t
t
�nNxK|D]C}tjj|j|||j�}|j|d|tj	j�q�WdS(s�Delete records.  The first argument is always a name.  The other
        arguments can be:

                - I{nothing}

                - rdataset...

                - rdata...

                - rdtype, [string...]iN(RRRR
RRtlenRRRtANYRtNONERR)R*R(R,R/R0R.RR(RR
R2R3R$R!R4((s./usr/lib/python2.7/site-packages/dns/update.pyR+�s6

'
#			

cGs|jt|j||�dS(sQReplace records.  The first argument is always a name.  The other
        arguments can be:

                - rdataset...

                - ttl, rdata...

                - ttl, rdtype, string...

        Note that if you want to replace the entire node, you should do
        a delete of the name followed by one or more calls to add.N(R5RR(RR
R2((s./usr/lib/python2.7/site-packages/dns/update.pyR1�s
c	Gsnt|t�r'tjj|d�}nt|�dkrs|j|j|tj	j
tjj
tjjdt
t
�n�t|dtjj�s�t|dtjj�s�t|�dkrt|dtjj�s�t|�}|jdd�n|jt|j||�n_|d}t|t�r9tjj|�}n|j|j|tj	j
|tjjdt
t
�dS(sBRequire that an owner name (and optionally an rdata type,
        or specific rdataset) exists as a prerequisite to the
        execution of the update.  The first argument is always a name.
        The other arguments can be:

                - rdataset...

                - rdata...

                - rdtype, string...iiN(RRRR
RRR7RtanswerRR8RR9RR)R*R/R0R,tinsertR5R6(RR
R2R!((s./usr/lib/python2.7/site-packages/dns/update.pytpresent�s*

c	Cs�t|t�r'tjj|d�}n|dkrm|j|j|tjj	tj
jtj
j	dtt�nUt|t�r�tj
j|�}n|j|j|tjj	|tj
j	dtt�dS(s�Require that an owner name (and optionally an rdata type) does
        not exist as a prerequisite to the execution of the update.N(
RRRR
RRRR:RR9RR8R(RR
R!((s./usr/lib/python2.7/site-packages/dns/update.pytabsent�s
i��cCs1|dkr|j}ntt|�j||�S(scReturn a string containing the update in DNS compressed wire
        format.
        @rtype: stringN(RRRRtto_wire(RRtmax_size((s./usr/lib/python2.7/site-packages/dns/update.pyR>�sN(t__name__t
__module__RRtINRttsigtdefault_algorithmRR(R5R"R+R1R<R=R>(((s./usr/lib/python2.7/site-packages/dns/update.pyRs%
	(		+		$(t__doc__tdns.messageRtdns.namet
dns.opcodet	dns.rdatatdns.rdataclasstdns.rdatasettdns.tsigt_compatRtmessagetMessageR(((s./usr/lib/python2.7/site-packages/dns/update.pyt<module>s